text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def fabolas ( objective _ function, lower, upper, s _ min, s _ max, n _ init = 40, num _ iterations = 100, subsets = [ 256, 128, 64 ], inc _ estimation = " mean ", burnin = 100, chain _ length = 100, n _ hypers = 12, output _ path = none, rng = none ) : assert n _ init < = num _ iterations, " number of initial design p... | [
0.16048114001750946,
0.233137845993042,
0.9697088599205017,
0.49135464429855347,
-0.648055911064148,
-0.0878438875079155,
-0.2034684717655182,
0.3367275595664978,
-0.6381332278251648,
0.6504014134407043,
-0.17250846326351166,
0.8369165062904358,
-0.32503601908683777,
0.5833101272583008,
... |
def map _ operations _ and _ unroll ( circuit : circuit _ type, map _ func : callable [ [ ops. operation, int ], ops. op _ tree ], ) - > circuit _ type : return unroll _ circuit _ op ( map _ operations ( circuit, map _ func ) ) | [
-0.1979774534702301,
0.12184247374534607,
0.6274884343147278,
-0.040646545588970184,
-1.0511970520019531,
-0.8045560717582703,
0.8525109887123108,
0.35739946365356445,
0.9704439640045166,
-0.0029930202290415764,
0.05895848944783211,
0.2446439564228058,
0.9975573420524597,
-0.71122622489929... |
def evaluate _ fold ( clf, x _ train, y _ train, x _ test, y _ test ) : tmp = dict ( ) tmp ['x _ train. shape'] = x _ train. shape tmp ['x _ test. shape'] = x _ test. shape try : pred _ test = clf. predict _ proba ( x _ test ) pred _ train = clf. predict _ proba ( x _ train ) tmp ['roc'] = roc _ info ( y _ test, pred _... | [
0.3813101053237915,
0.13500602543354034,
0.6505854725837708,
-0.36270737648010254,
0.3659920394420624,
-0.044507574290037155,
0.33311593532562256,
0.3073411285877228,
-1.2403843402862549,
0.2522116005420685,
-0.1626851111650467,
-0.22971393167972565,
1.1559666395187378,
0.21335071325302124... |
def test _ connection _ db _ exception ( self, mock _ g, mock _ event _ logger, mock _ get _ sqla _ engine ) : database = get _ example _ database ( ) mock _ g. user = security _ manager. find _ user ( " admin " ) mock _ get _ sqla _ engine. side _ effect = exception ( " an error has occurred! " ) db _ uri = database. ... | [
0.16661809384822845,
0.7882598638534546,
0.3894634544849396,
0.1505625694990158,
0.493721067905426,
0.36887168884277344,
0.1817830502986908,
0.44889140129089355,
0.21799317002296448,
-0.06957453489303589,
-0.36614006757736206,
-0.44884198904037476,
-0.4898662269115448,
0.43357113003730774,... |
def csw _ query _ command ( csw _ endpoint, query, result _ type, limit, verbose ) : csw _ client = query _ a _ cat. util. csw _ client. cswclient ( csw _ endpoint, verbose ) if not result _ type = = " hits " : records = csw _ client. csw _ query ( query, result _ type, limit ) print ( json. dumps ( records, indent = 4... | [
0.4510052502155304,
0.29890355467796326,
0.5019281506538391,
0.6151718497276306,
0.5187113285064697,
-0.13458184897899628,
-0.45862650871276855,
-0.5825390815734863,
0.026269732043147087,
-0.25283369421958923,
0.6546385288238525,
0.6828417778015137,
-0.11837722361087799,
0.164181187748909,... |
def test _ all _ survey _ package _ instance _ record _ success ( self, client, all _ survey _ package _ instances ) : instances = client. all _ survey _ package _ instances ( record = " 000002 " ) for instance in instances : assert instance [ " record _ id " ] = = " 000002 " instance _ keys = instance. keys ( ) assert... | [
-0.5512577891349792,
0.0878034308552742,
0.327629029750824,
-0.21949011087417603,
-0.09564739465713501,
0.725843608379364,
-0.4770636260509491,
0.3801751434803009,
0.006772478576749563,
0.5870411992073059,
-0.6970710754394531,
-0.3471788763999939,
-0.30087658762931824,
-0.08932585269212723... |
def create _ user ( self, user _ name, password ) : # type : ( str, str ) - > dict if isinstance ( user _ name, str ) : user _ name = user _ name. encode ( " ascii " ) if isinstance ( password, str ) : password = password. encode ( " ascii " ) if not self. connected : raise exception ( " not connected " ) # generate rs... | [
-0.09292617440223694,
0.4645532965660095,
0.9451972842216492,
1.1404606103897095,
-0.13418206572532654,
-0.032125797122716904,
0.24233947694301605,
-0.9516943693161011,
-0.03717127814888954,
0.24557705223560333,
-0.8173331618309021,
-0.21038296818733215,
-0.3468681871891022,
0.828963339328... |
def bus _ init ( self ) : self. write ( b " \ xff \ xff \ xff \ xff \ xff \ xff \ x7b \ x9e \ xff \ xff \ xff \ xff \ xff \ xff \ x0f " ) self. _ sync ( ) | [
0.14850229024887085,
0.9139636158943176,
0.6495206952095032,
-0.01718045212328434,
0.30050787329673767,
0.654151201248169,
0.033829331398010254,
-0.315841943025589,
0.1909177303314209,
-0.19638703763484955,
-1.5472490787506104,
0.7521803975105286,
-1.1665472984313965,
0.10361526161432266,
... |
def pooling _ output _ shape ( dimension _ size, pool _ size, padding, stride ) : if dimension _ size is none : return none if padding in ('same ','same') : return int ( math. ceil ( dimension _ size / stride ) ) elif padding in ('valid ','valid') : return int ( math. ceil ( ( dimension _ size - pool _ size + 1 ) / str... | [
0.6182492971420288,
0.17641916871070862,
0.6140567064285278,
-0.17920680344104767,
-1.0021189451217651,
0.022490091621875763,
0.5321094393730164,
-0.5614011287689209,
-0.2756684720516205,
0.151750385761261,
0.4291616976261139,
0.9812260270118713,
-0.04959449544548988,
-0.11121527850627899,... |
def signedlesser ( a, b ) : return 1 if _ _ twocomplement ( a ) < _ _ twocomplement ( b ) else 0 | [
0.386883020401001,
-1.4231235980987549,
0.7026997804641724,
-0.04676342010498047,
-0.20488741993904114,
-0.11596515774726868,
0.37274932861328125,
-0.33428263664245605,
0.0842757374048233,
-0.6352607607841492,
-0.6274242401123047,
-0.24509477615356445,
-0.5732554197311401,
0.74644201993942... |
def _ write _ comid _ lat _ lon _ z ( self ) : if self. comid _ lat _ lon _ z _ file : # get list of comids lookup _ table = csv _ to _ list ( self. comid _ lat _ lon _ z _ file ) lookup _ comids = np. array ( [ int ( float ( row [ 0 ] ) ) for row in lookup _ table [ 1 : ] ] ) # get relevant arrays while we update them... | [
-0.06826642900705338,
-1.5435030460357666,
0.4200507402420044,
-0.5209764838218689,
0.35897761583328247,
-0.2551715075969696,
0.1335599571466446,
0.30567196011543274,
0.224050834774971,
0.04382441192865372,
-0.04001332446932793,
0.32341206073760986,
-0.07097011059522629,
0.1840586811304092... |
def solver ( i, v, f, c, u _ 0, u _ l, l, dt, c, t, user _ action = none, version ='scalar ', stability _ safety _ factor = 1. 0 ) : nt = int ( round ( t / dt ) ) t = np. linspace ( 0, nt * dt, nt + 1 ) # mesh points in time # find max ( c ) using a fake mesh and adapt dx to c and dt if isinstance ( c, ( float, int ) )... | [
0.43022429943084717,
0.06493709236383438,
0.8292689919471741,
0.548557460308075,
-0.20637105405330658,
-0.1455080807209015,
0.1291852742433548,
-0.02560528740286827,
-0.4114619791507721,
0.319467693567276,
-0.6090582013130188,
-0.06199020892381668,
0.6565030217170715,
0.11357764154672623,
... |
def _ gen _ tb1 _ tb1 ( ) : x _ values = np. linspace ( 0, 2 * np. pi, self. n _ tb1, endpoint = false ) # generate n _ tb1 values between 0 and 2π sinus = np. sin ( x _ values ) # each row is shifted by 1 column weights = np. zeros ( [ self. n _ tb1, self. n _ tb1 ] ) for i in range ( self. n _ tb1 ) : weights [ i, : ... | [
-0.25373026728630066,
0.352092444896698,
0.45802727341651917,
0.3603743016719818,
-0.09053317457437515,
0.49370354413986206,
0.45170027017593384,
0.12863744795322418,
-0.5950125455856323,
0.9451872110366821,
0.0322309173643589,
-0.1520310938358307,
-0.12696145474910736,
0.02956785447895527... |
def _ determine _ num _ psi ( base _ num _ psi, num _ blades _ list ) : # compute the least common multiple of all of the numbers lcm = 1 for number in num _ blades _ list : lcm = _ compute _ least _ common _ multiple ( lcm, number ) # determine the closest number to the template number and the least common multiple re... | [
0.4545944631099701,
-0.10884985327720642,
0.6808869242668152,
-0.3086118996143341,
-0.3035283088684082,
-0.3154451847076416,
0.09231342375278473,
0.6413136124610901,
-0.05673065409064293,
-0.6469058990478516,
-0.6888188123703003,
-0.7514007091522217,
-1.3984102010726929,
0.2810156643390655... |
def from _ string ( self, xml _ string ) : tree = self. et. fromstring ( xml _ string ) return self. from _ element _ tree ( tree ) | [
0.9398615956306458,
-1.1303801536560059,
0.0226382277905941,
0.3412174582481384,
-0.7215496301651001,
0.111741803586483,
-0.677911102771759,
0.04592602699995041,
1.030697226524353,
-0.86152583360672,
0.3096759617328644,
0.24227915704250336,
0.14363589882850647,
-0.8705980181694031,
-0.42... |
def create _ multi _ time _ series ( self, ts _ path _ lst, data _ type _ lst, encoding _ lst, compressor _ lst, props _ lst = none, tags _ lst = none, attributes _ lst = none, alias _ lst = none, ) : data _ type _ lst = [ data _ type. value for data _ type in data _ type _ lst ] encoding _ lst = [ encoding. value for ... | [
-1.260749340057373,
0.5593213438987732,
0.4840758144855499,
0.48173272609710693,
0.5636441111564636,
0.4144141376018524,
-0.9953360557556152,
-0.3931426703929901,
-0.5577920079231262,
0.5125381946563721,
-1.5047714710235596,
-0.011194652877748013,
-0.3975520730018616,
0.4893704354763031,
... |
def append _ payment _ date ( self, hours : str, payment _ date : str ) : if hours and float ( hours ) > 0 and payment _ date : self. payment _ dates. append ( get _ date _ from _ str ( payment _ date ) ) | [
0.6612346768379211,
0.34347042441368103,
0.506077229976654,
-0.14063811302185059,
-0.6826104521751404,
0.5886209011077881,
-2.608259677886963,
-0.44881677627563477,
0.4851303696632385,
0.19610579311847687,
1.0235854387283325,
0.2853536009788513,
0.14025357365608215,
1.2935513257980347,
-... |
def sign _ data ( self ) : assert isinstance ( self. data, ordereddict ) encoded = encoder. base64 _ dumps ( ordereddict ( ( k, v ) for k, v in self. data. items ( ) if k! ='mac') ) signature = salted _ hmac ( self. nut. session _ key, encoded ). digest ( ) return signature | [
-0.39325156807899475,
-0.4145065248012543,
0.2773016393184662,
-0.47049790620803833,
-0.3491411507129669,
-0.05994240194559097,
-1.377882957458496,
0.17555102705955505,
0.07522386312484741,
0.43057781457901,
-0.8359543681144714,
-0.47317036986351013,
-0.9609400033950806,
0.0416523627936840... |
def testaddpattern ( self ) : locale = locale. getfrance ( ) dtpg = datetimepatterngenerator. createinstance ( locale ) sdf = simpledateformat ( dtpg. getbestpattern ('mmmmddhmm'), locale ) sdf. settimezone ( self. tz ) if icu _ version <'68. 0': self. assertequal ( sdf. format ( self. date ), u'09 mai a 17 : 30') self... | [
-0.2220752239227295,
0.5815437436103821,
0.8140987753868103,
-0.333112508058548,
-0.10126224160194397,
0.8625665903091431,
-0.6799909472465515,
0.4932619333267212,
0.8217533826828003,
-1.028403401374817,
-0.7686920762062073,
-0.17895376682281494,
-0.11100677400827408,
-0.4186755120754242,
... |
def to _ numpy _ dtypes ( dtypes ) : return [ getattr ( np, dt ) for dt in dtypes if isinstance ( dt, str ) ] | [
-0.993342399597168,
-0.18619674444198608,
0.47851359844207764,
0.26014167070388794,
0.3575480580329895,
-0.07508018612861633,
-0.2869969606399536,
-1.1584192514419556,
0.43851813673973083,
1.2265058755874634,
-0.8659725785255432,
0.6294282674789429,
-0.20736929774284363,
0.2668235599994659... |
def test _ delete _ template _ association ( self ) : pass | [
-0.009683892130851746,
-0.3203125,
0.21463775634765625,
0.6386147737503052,
-0.21021120250225067,
-0.09146387130022049,
2.0614380836486816,
0.6588508486747742,
0.5519927740097046,
-0.7712668776512146,
0.1014910340309143,
-0.32699528336524963,
-0.6225672960281372,
0.7314304709434509,
-0.1... |
def write _ xyz _ to _ csv ( hostname : str, lidar _ port : int = 7502, cloud _ prefix : str ='xyz ', n _ scans : int = 5 ) - > none : metadata, sample = client. scans. sample ( hostname, n _ scans, lidar _ port ) h = metadata. format. pixels _ per _ column w = metadata. format. columns _ per _ frame xyzlut = client. x... | [
-0.028444979339838028,
0.27584099769592285,
0.5482539534568787,
0.18442177772521973,
0.18399998545646667,
-0.1808425784111023,
-0.0265768114477396,
-0.4120558202266693,
-0.10632239282131195,
-0.017278725281357765,
-0.36181163787841797,
0.406655877828598,
-0.013581364415585995,
0.1788587272... |
def install _ env ( self ) : mode = os. getenv ( " mode " ) if mode = = " function " : os. system ( " apt update " ) os. system ( " apt - get install - y curl " ) os. system ( " curl - - version " ) | [
-0.6330608129501343,
-1.1875776052474976,
0.7527247667312622,
-0.09291676431894302,
0.6058692336082458,
0.6037556529045105,
-0.11532645672559738,
0.1645175665616989,
-0.8268258571624756,
0.9723584651947021,
-0.12326225638389587,
0.2348010092973709,
0.3205837607383728,
0.8475582599639893,
... |
def wire ( * args ) : return _ topods. topods _ wire ( * args ) | [
-1.0097007751464844,
0.3845818340778351,
0.4458967447280884,
0.4097192883491516,
0.29422062635421753,
0.9513017535209656,
-0.3063543438911438,
-1.5394721031188965,
-0.4674074947834015,
-0.3108772337436676,
0.17748035490512848,
0.0032514387276023626,
-1.2568442821502686,
0.5359084606170654,... |
def _ _ init _ _ ( self, stream = none, tbformat = none, rterrors = none, publisher = none ) : self. _ calls = [ ] self. shouldstop = false self. _ stream = stream self. _ tbformat = tbformat self. _ rterrors = rterrors self. _ publisher = publisher | [
0.4529401957988739,
-0.07955200970172882,
0.4434398412704468,
0.6210347414016724,
-0.11716863512992859,
-0.2883833348751068,
-0.5099081993103027,
-0.3789539039134979,
0.13299959897994995,
-0.6451188921928406,
0.1714751124382019,
0.6079358458518982,
-0.6252924203872681,
0.6242168545722961,
... |
def read _ docs ( filepath ) : spacy _ parser = get _ spacy _ parser ( ) data = pickle. load ( open ( filepath,'rb') ) for row in data : doc = doc ( spacy _ parser. vocab ) # read doc object from serialized byte array row ['content'] = doc. from _ bytes ( row. pop ('binary _ content') ) return data | [
0.30622655153274536,
-0.3495596647262573,
0.2015073299407959,
-0.6659764051437378,
-0.481933057308197,
-0.2314203381538391,
-0.442213773727417,
-0.402688205242157,
0.42418888211250305,
0.0728401392698288,
-0.11277296394109726,
-0.5591722726821899,
0.04934127628803253,
-0.8475338816642761,
... |
def mutate ( self ) : style = int ( self. mutantbutton ['style']. split ( '.') [ 0 ] ) newstyle = style + 5 if newstyle > 50 : newstyle = 10 print ('choosing font'+ str ( newstyle ) ) self. mutantbutton ['style'] = fontstyle [ newstyle ] # resize the frame # get the current geometries currentgeometry = self. _ root ( )... | [
-0.3168903589248657,
0.04877929762005806,
0.5867361426353455,
0.3172866106033325,
-0.3508516252040863,
-0.23645943403244019,
0.421711802482605,
-0.729016125202179,
0.7067141532897949,
0.05362321063876152,
-0.1075480729341507,
0.8006983399391174,
-0.28762009739875793,
0.26475805044174194,
... |
def raizcuadrada ( listanumeros ) : return [ math. sqrt ( n ) for n in listanumeros ] | [
0.47116225957870483,
-0.25973424315452576,
0.15341924130916595,
0.8787590265274048,
0.15467827022075653,
0.3005526065826416,
-1.2873159646987915,
0.5640661120414734,
1.439972996711731,
0.4634810984134674,
0.06563324481248856,
0.5693946480751038,
-1.1927481889724731,
1.1465282440185547,
-... |
def wavread ( filename ) : if ( os. path. isfile ( filename ) = = false ) : # raise error if wrong input file raise valueerror ( " input file is wrong " ) fs, x = read ( filename ) if ( len ( x. shape )! = 1 ) : # raise error if more than one channel print ('audio en estereo : tomar solo el canal 1') # raise valueerror... | [
-0.25129520893096924,
-0.5081143379211426,
0.8430391550064087,
-0.1328132450580597,
-0.16831226646900177,
0.4169004559516907,
0.5778217315673828,
0.3103496730327606,
0.2614881992340088,
0.26920026540756226,
0.6809403300285339,
0.4633863866329193,
-0.5149498581886292,
-0.16182342171669006,
... |
def ids _ in _ id _ list ( tree ) : ids = [ ] # grab all ids and id ranges. id _ list = tree. xpath ('/ / id _ set / descendant : : * / text ( )') for i in id _ list : logger. debug ('id : % s'% i ) if'-'in i : id _ start = i [ : i. find ('-') ] id _ end = i [ i. find ('-') + 1 : ] ids + = range ( int ( id _ start ), i... | [
-0.6295024156570435,
-0.34212878346443176,
0.45188021659851074,
-0.15599480271339417,
-0.17912444472312927,
-0.2435985952615738,
-0.5509377717971802,
0.6494817137718201,
0.6352115869522095,
0.23507536947727203,
-0.85833740234375,
0.4063773453235626,
-0.11886189132928848,
0.4770948588848114... |
def add _ track ( self, track, track _ level ) : if track is none : raise valueerror ( " must specify track " ) if track _ level not in self. tracks : # no track at that level self. tracks [ track _ level ] = track # so just add it else : # already a track there, so shunt all higher tracks up one occupied _ levels = se... | [
-0.2929213047027588,
0.03821659833192825,
0.826727032661438,
0.5527437329292297,
-0.0005860283854417503,
0.8249306082725525,
-0.15342259407043457,
-0.4572952091693878,
-0.8409322500228882,
-0.6728638410568237,
0.29711201786994934,
-0.051861077547073364,
-0.4503287076950073,
0.6896757483482... |
def translate ( self, schema : list [ dict [ str, any ] ] ) - > list [ dict [ str, any ] ] : cassandra _ mapping = { " timestamptype " : " timestamp ", " binarytype " : " boolean ", " booleantype " : " boolean ", " datetype " : " timestamp ", " decimaltype " : " decimal ", " doubletype " : " double ", " floattype " : "... | [
-0.5455669164657593,
0.26284945011138916,
0.7529128789901733,
0.2716159522533417,
-0.010928967036306858,
-0.4679063558578491,
-0.7092042565345764,
0.8610473275184631,
0.40378326177597046,
0.7004249691963196,
-1.057273030281067,
-0.40999001264572144,
0.7645462155342102,
-0.01667077653110027... |
def populate _ graph ( self, node : dict, parent : union [ str, dict ] = none, depth : int = 4 ) : for key, value in node. items ( ) : if key! ='counter': if depth = = 0 : return none if isinstance ( value, dict ) : # we start with the root node whose parent is none # we don't want to graph the none node if parent : se... | [
-0.31885072588920593,
1.77576744556427,
0.6811470985412598,
-0.7010166049003601,
-0.006373570300638676,
-0.30625826120376587,
-0.18177758157253265,
-0.7665768265724182,
0.33612558245658875,
-0.3270108997821808,
0.508169949054718,
-0.06969480961561203,
0.13239318132400513,
0.670979380607605... |
def norm _ hounsfield _ dyn ( arr, c _ min = 0. 1, c _ max = 0. 3 ) : # calc min and max min, max = np. amin ( arr ), np. amax ( arr ) arr = arr. astype ( img _ dtype ) if min < = 0 : arr = np. clip ( arr, min * c _ min, max * c _ max ) # right shift to zero arr = np. abs ( min * c _ min ) + arr else : arr = np. clip (... | [
-0.15167273581027985,
0.048786211758852005,
0.7957427501678467,
0.7437233328819275,
-0.777960479259491,
-0.24159002304077148,
0.6469635963439941,
-0.1897491067647934,
0.7402227520942688,
0.03662911057472229,
0.10873346775770187,
-0.43302929401397705,
0.3365451693534851,
0.8603348135948181,... |
def get _ item ( request, id ) : item = item. objects. filter ( id = id ) toppings = [ t for t in topping. objects. all ( ). values _ list ('name ', flat = true ) ] # get all pricings for this item pricings = pricing. objects. filter ( item = item [ 0 ] ) # list to store pricings as a list that contains # lists res = [... | [
-1.4588767290115356,
-0.03726651892066002,
0.7690423727035522,
0.6310519576072693,
-0.5722598433494568,
0.1287386566400528,
-0.9492351412773132,
-0.17214295268058777,
-0.04868666082620621,
0.9692822098731995,
-0.7626857757568359,
-0.5931969881057739,
0.7714386582374573,
0.43090394139289856... |
def compute ( v1, op, v2, v3 ) : if op = ='+': return v1 + v2 * v3 else : return v1 - v2 * v3 | [
0.15946736931800842,
0.385297030210495,
0.7115796804428101,
0.7428980469703674,
-0.5942593216896057,
0.24704302847385406,
-0.5072473883628845,
0.32536742091178894,
1.0574597120285034,
1.1463077068328857,
-0.10106690973043442,
-0.45854467153549194,
-0.6403815150260925,
-1.0998821258544922,
... |
def get _ opts ( self ) : return list ( self. _ args ) | [
-0.6656655669212341,
0.0068507324904203415,
0.41470539569854736,
0.07301697880029678,
1.548478126525879,
0.24532093107700348,
-1.3226398229599,
-0.17130981385707855,
-0.1627841293811798,
0.3466857671737671,
-0.186850443482399,
0.502707839012146,
-0.5831586718559265,
-0.0023412173613905907,... |
def test _ register _ input _ and _ user _ name _ has _ improper _ space _ in _ beg ( self, * _ ) : self. open ( base _ url +'/ logout') # go to main page self. open ( base _ url +'/ register') # validate that the user is taken to / login assert self. get _ current _ url ( ) = = base _ url +'/ register'self. type ('# e... | [
-0.007884867489337921,
0.26311665773391724,
0.5946152210235596,
0.7597628235816956,
-0.0008058449602685869,
0.5232725143432617,
0.5692873597145081,
-0.1660918891429901,
-0.2713158428668976,
-0.635039210319519,
-0.4510010778903961,
0.9237277507781982,
-0.13982656598091125,
1.807135343551635... |
def get _ project _ numbers ( self, resource _ name, timestamp ) : project _ numbers _ sql = select _ data. project _ numbers. format ( timestamp ) rows = self. execute _ sql _ with _ fetch ( resource _ name, project _ numbers _ sql, ( ) ) return [ row ['project _ number'] for row in rows ] | [
-0.7363566160202026,
0.7257957458496094,
0.4546373784542084,
0.7074748277664185,
0.12573377788066864,
-0.5082800388336182,
-0.46313515305519104,
-0.272453248500824,
0.6583082675933838,
0.37987446784973145,
-0.8677610754966736,
-0.23355846107006073,
0.891534686088562,
-0.4091317653656006,
... |
def test _ delete ( ) : with patch. object ( swift, " _ auth ", magicmock ( ) ) : assert swift. delete ( " mycontainer " ) assert swift. delete ( " mycontainer ", path = " myfile. png " ) | [
0.35074445605278015,
0.4049816429615021,
0.42641544342041016,
0.10977042466402054,
0.8906856775283813,
0.4458989202976227,
0.33785563707351685,
0.34927985072135925,
1.2662559747695923,
-0.4906122386455536,
0.2567180097103119,
0.13621163368225098,
0.002396748634055257,
-0.01710512489080429,... |
def procrustes _ alignment _ example ( a, b, outputfile ) : f = gzip. open ('data / mnist. pkl. gz ','rb') train _ set, valid _ set, test _ set = cpickle. load ( f ) f. close ( ) images, labels = train _ set id1 = np. where ( labels = = a ) [ 0 ] im11 = images [ np. random. choice ( id1 ) ]. reshape ( ( 28, 28 ) ) im12... | [
0.6751760244369507,
-0.12529630959033966,
1.0223044157028198,
-0.08371312916278839,
-1.1454524993896484,
0.1257081925868988,
0.9953973889350891,
1.0169274806976318,
0.24062655866146088,
0.6648298501968384,
0.20825856924057007,
0.40613576769828796,
0.17825885117053986,
-0.002205758821219206... |
def register ( micros = [ ] ) : logger. warn ( " micro services is loading... " ) count = 0 services = micros # print ( " services as : ", services, type ( services ) ) logger. warn ( f " micro services { services } " ) if services : for module in services : try : command _ module = _ _ import _ _ ( " apps. % s. namesp... | [
-0.38911616802215576,
0.48070499300956726,
0.7715261578559875,
1.151854395866394,
-0.1632147878408432,
0.23856431245803833,
0.15333117544651031,
-0.32097485661506653,
0.6645761728286743,
-0.1839272528886795,
-0.6603159308433533,
-0.3588581383228302,
-0.46336060762405396,
0.845776379108429,... |
def write _ result ( hdf5 _ data, data ) : dset = utility. require _ dataset ( hdf5 _ data, structure. h5 _ results _ forces, data [ " line " ]. shape, dtype ='f') utility. set _ hdf5 _ attributes ( dset, structure. h5 _ results _ forces _ attr ) dset [ :, : ] = data [ " line " ]. astype ( copy = false, dtype ='f') tem... | [
-0.4399397373199463,
0.07700374722480774,
0.6409581303596497,
-0.1900726854801178,
0.5622979998588562,
-0.4474802613258362,
0.06243917718529701,
-0.15456949174404144,
-0.5870627164840698,
-0.02850721776485443,
-0.08616560697555542,
0.07501856982707977,
-0.45626336336135864,
-0.502993285655... |
def _ _ init _ _ ( self, scheme = none, userinfo = none, host = none, port = none, path = none, query = none, fragment = none, ) : self. scheme = scheme self. userinfo = userinfo self. host = host self. port = port self. path = path self. query = query self. fragment = fragment | [
0.36078742146492004,
-0.10614953190088272,
0.45763030648231506,
0.1250540018081665,
0.23546507954597473,
0.11149962991476059,
0.10327407717704773,
-0.19669608771800995,
0.012820614501833916,
-0.9192216396331787,
-0.2668490409851074,
-0.39091116189956665,
-0.5311026573181152,
0.193621724843... |
def find _ feature ( data, target _ col ) : columns = [ x for x in data. columns if x! = target _ col ] target _ values = list ( set ( data [ target _ col ] ) ) assert len ( target _ values ) = = 2, " number of target values is not 2 " max _ diff = 0 best _ col = columns [ 0 ] for col in columns : data _ temp = data. c... | [
0.1754550039768219,
-0.8330080509185791,
0.6646807193756104,
0.2530190348625183,
0.4323916733264923,
-0.3763173520565033,
0.45887336134910583,
-0.4205160140991211,
-1.1258878707885742,
-0.0935479998588562,
-0.048549819737672806,
1.5116746425628662,
0.601211667060852,
0.07152050733566284,
... |
def move _ to ( self, x, y, theta ) : curr _ theta = self. get _ angle ( ) curr _ pos = self. get _ centre ( ) self. transform ( x - curr _ pos [ 0 ], y - curr _ pos [ 1 ], theta - curr _ theta ) | [
-0.5921977162361145,
-0.9926424026489258,
0.3810802102088928,
-0.9836094975471497,
0.33279889822006226,
-0.5045626759529114,
-0.2552432417869568,
-0.6091774106025696,
-0.5982053875923157,
0.7211739420890808,
-0.7373444437980652,
0.6567502617835999,
-0.18884451687335968,
-1.316853404045105,... |
def get _ from _ cache ( cache _ root, api _ name, api _ version ) : # todo ( b / 263521050 ) : use pathlib for whole function. file = os. path. join ( cache _ root, api _ name, api _ version, _ discovery _ cache _ file ) if not os. path. isfile ( file ) : logging. info ('discovery doc not in cache. % s ', file ) retur... | [
0.10425141453742981,
-0.31334686279296875,
0.3323155641555786,
0.08058585226535797,
-0.9140071868896484,
-0.6881518363952637,
-0.26165440678596497,
-0.5693680047988892,
-0.5748900771141052,
0.5168159604072571,
0.347877562046051,
-0.11240895092487335,
-0.25739970803260803,
-0.61330765485763... |
def set _ 5gnr _ extattn ( self, pwr ) : self. write ( f'conf : nrmm : meas : rfs : eatt { pwr } db') | [
-0.7062345743179321,
0.4869444966316223,
0.4408505856990814,
-0.4337356686592102,
0.3824250102043152,
0.4340391457080841,
-0.05739235505461693,
-0.6763689517974854,
-0.005175426136702299,
0.2121122181415558,
-0.31138038635253906,
-0.7038435935974121,
-0.5568391680717468,
1.0850963592529297... |
def extract _ selection _ vtp ( poly _ in, query = none, l _ cell _ idx = none, field _ type = " cell ", inverse _ selection = false, verbose = false ) : a _ ix _ cell = np. array ( [ ] ) a _ ix _ point = np. array ( [ ] ) wdo _ in = dsa. wrapdataobject ( poly _ in ) wdo _ out = dsa. wrapdataobject ( vtk. vtkpolydata (... | [
-0.6483412384986877,
-0.735878050327301,
0.6577599048614502,
0.18116392195224762,
-0.5086706280708313,
0.05943862348794937,
0.5840345025062561,
-0.12279868870973587,
0.6143777966499329,
0.731739342212677,
0.0026397481560707092,
0.7248880863189697,
-0.08851633220911026,
-0.3482908010482788,... |
def get _ interfaces ( self, simulation _ name ) : u = self. base _ api + " / simengine / rest / interfaces / { } " u = u. format ( simulation _ name ) r = self. get ( u ) return r | [
-0.7879505753517151,
0.9059392213821411,
0.42010757327079773,
1.1935054063796997,
0.5306853652000427,
-0.6779078841209412,
-0.4254440665245056,
-0.6359156370162964,
0.24330775439739227,
0.057281602174043655,
-0.619903564453125,
0.3689637780189514,
-1.6795544624328613,
0.11129499226808548,
... |
def testupdatevaluesforquerieswithwritepermissiondenied ( self ) : userapi ( ). create ( [ ( u'fred ', u'password ', u'fred ', u'fred @ example. com') ] ) user = getuser ( u'fred') permissions = cachingpermissionapi ( user ) tagapi ( user ). create ( [ ( u'fred / bar ', u'description'), ( u'fred / unwritable ', u'descr... | [
-0.5175146460533142,
0.45852312445640564,
0.5378448367118835,
-0.1056012362241745,
0.4833841919898987,
0.36394405364990234,
0.5524714589118958,
-0.5472543835639954,
-0.6737028360366821,
-0.7799712419509888,
0.02134227752685547,
-0.31078264117240906,
-0.08851039409637451,
0.3459140062332153... |
def average _ grade ( self ) : return ects _ grade _ calculator. average _ grade ( self. exam _ results ) | [
-0.8820845484733582,
0.09124433249235153,
0.169189453125,
-0.6112286448478699,
-0.1659010499715805,
0.9033613801002502,
0.3030126094818115,
0.5706149339675903,
-0.9077363610267639,
-0.0733121708035469,
0.586972177028656,
-0.18557436764240265,
-0.004732745233923197,
0.38339751958847046,
-... |
def _ _ init _ _ ( self, name : str, value : any, description : str, max _ width : int = 0 ) - > none : self. name = name or " n / a " try : self. value = value _ to _ bytes ( value ) except typeerror : self. value = b'' self. description = description or " n / a " self. max _ width = max _ width | [
0.24752376973628998,
0.2178570181131363,
0.5619939565658569,
0.3956940472126007,
-0.7434995174407959,
-0.11551297456026077,
-0.6901639699935913,
-0.08378016203641891,
0.5961028933525085,
-0.19890734553337097,
-0.19337381422519684,
0.3810853064060211,
-0.009826680645346642,
0.93898904323577... |
def master _ map ( masters, output, opts ) : host _ key ='host'if not opts. full _ host _ names else'fullhost'output ( [ ('master ', field ('name') ), ('config dir ', field ('dirname') ), ('host ', field ( host _ key ) ), ('web port ', field ('port') ), ('slave port ', field ('slave _ port') ), ('alt port ', field ('al... | [
-1.0736258029937744,
-0.7239308953285217,
0.5630031228065491,
-0.7213245630264282,
-0.7280194759368896,
0.4745202660560608,
-0.056731678545475006,
0.827747106552124,
-0.6416624784469604,
0.2813042104244232,
-0.7874597907066345,
0.07976126670837402,
0.5615976452827454,
0.2014232873916626,
... |
def signal _ cb ( self, watcher, revents ) : self. stop ( ) | [
0.6915637850761414,
-0.8449395895004272,
0.29717639088630676,
-0.5149403810501099,
0.6752272844314575,
0.3432416021823883,
0.2842676639556885,
0.4339708983898163,
-0.13341136276721954,
0.4659876525402069,
-0.8041129112243652,
-0.2041768729686737,
-0.46784842014312744,
0.07793854922056198,
... |
def firstsentence _ heuristic ( doc ) : # todo pass | [
0.7493605613708496,
-0.7282953858375549,
0.3804164528846741,
0.6208340525627136,
0.4456545412540436,
-0.31416574120521545,
0.6170671582221985,
0.5530117154121399,
0.3735150396823883,
0.3023410439491272,
-0.24143855273723602,
-0.5647716522216797,
-0.2651784420013428,
1.0435911417007446,
-... |
def process ( self ) : # step cv _ resize0 : self. _ _ cv _ resize _ src = self. _ _ source0 ( self. cv _ resize _ output ) = self. _ _ cv _ resize ( self. _ _ cv _ resize _ src, self. _ _ cv _ resize _ dsize, self. _ _ cv _ resize _ fx, self. _ _ cv _ resize _ fy, self. _ _ cv _ resize _ interpolation ) # step hsl _ t... | [
-0.04670228436589241,
0.2448948323726654,
0.8594541549682617,
0.9606925249099731,
0.024583278223872185,
-0.6783890724182129,
1.2379704713821411,
-0.5680916905403137,
0.1701284795999527,
-0.5680736303329468,
-1.3142935037612915,
-0.7217732667922974,
0.9312584400177002,
1.4162418842315674,
... |
def test _ gf _ write _ and _ as _ keyword _ if _ not _ first _ step _ of _ keyword _ context ( disabled _ colors, capsys, mocker ) : # given first _ step = mocker. magicmock ( spec = step ) first _ step. keyword = " given " first _ step. used _ keyword = " given " first _ step. text = " there is the first step " first... | [
0.05111675336956978,
-0.6163514852523804,
0.6752887964248657,
0.5569819808006287,
0.7735128402709961,
0.055777132511138916,
0.047599706798791885,
-0.20757167041301727,
-0.885879635810852,
-0.4668377637863159,
-0.4041232466697693,
-0.1065981537103653,
0.16004368662834167,
1.7697402238845825... |
def mean ( x ) : return sum ( x ) / len ( x ) if len ( x ) > 0 else 0. 0 | [
-0.3463621735572815,
0.7737735509872437,
0.1886950582265854,
-0.16500426828861237,
0.5292086005210876,
0.6558143496513367,
-0.7419531345367432,
0.2405930757522583,
1.133423089981079,
0.4906984865665436,
-0.441392183303833,
0.12295802682638168,
-0.43343719840049744,
0.4728999733924866,
-0... |
def add _ arguments ( self, parser ) : parser. add _ argument ('args ', metavar ='app _ label ', nargs ='* ', help = _ ('one or more app labels to evolve.') ) parser. add _ argument ('- - noinput ', action ='store _ false ', dest ='interactive ', default = true, help = _ ('automatically says yes to any prompts. when us... | [
-0.06180903688073158,
0.6973227262496948,
0.8055095076560974,
0.21852408349514008,
0.7300023436546326,
0.36454516649246216,
-0.155457004904747,
-0.02833693102002144,
-0.2620251178741455,
0.41809022426605225,
-0.7662708759307861,
0.0015887938207015395,
0.5971938967704773,
1.104286551475525,... |
def remove _ at _ index ( self, index ) : if self. is _ empty ( ) : raise indexerror ( " list is empty. " ) if index > = self. size : raise indexerror ( " index out of range. " ) if index = = 0 : self. pop _ front ( ) else : current = self. head for num in range ( index ) : current = current. next current. prev. next =... | [
-0.6657349467277527,
0.426691472530365,
0.5113508701324463,
-0.9987462759017944,
-0.017314789816737175,
-0.3144634962081909,
0.7649555802345276,
0.5241754651069641,
0.7674997448921204,
-0.05110704153776169,
-0.9229204058647156,
0.1473562866449356,
-0.7787297964096069,
0.12528719007968903,
... |
def chown ( path, user, group = none, recursive = false ) : if group is none : group = user try : if not recursive or os. path. isfile ( path ) : shutil. chown ( path, user, group ) else : for root, dirs, files in os. walk ( path ) : shutil. chown ( root, user, group ) for item in dirs : shutil. chown ( os. path. join ... | [
0.2433329075574875,
0.06827978789806366,
0.7658646702766418,
1.4163237810134888,
-1.2434332370758057,
0.24402885138988495,
1.586186170578003,
0.05168132483959198,
-0.32241931557655334,
-0.444648802280426,
-0.025002779439091682,
0.3232867419719696,
0.1334621161222458,
0.08489962667226791,
... |
def process ( self, file _ path, x _ index, y _ index, z _ index, t _ index = none ) : return notimplemented | [
0.1535644382238388,
-0.6476702690124512,
0.41388529539108276,
-0.2581712007522583,
0.6498399972915649,
0.36396321654319763,
0.6936406493186951,
-0.11195997893810272,
-0.6661922335624695,
0.19720523059368134,
-0.24703457951545715,
-0.2499454766511917,
0.6248831152915955,
-1.2790372371673584... |
def define _ vorverts ( self ) : logs. log _ info ( " calculating voronoi cells... " ) vcell _ verts = [ ] vor _ verts = [ ] vor _ sa = [ ] vor _ cents = [ ] vor _ edge _ verts = [ ] tri _ sa _ o = [ ] # extended tri _ sa ( with elements for voronoi verts on boundary ) for ti, tc _ indso in enumerate ( self. tverts _ t... | [
0.9244681596755981,
0.1431741863489151,
0.6636687517166138,
0.07138743996620178,
0.18584086000919342,
-0.2323419749736786,
0.5193411111831665,
-0.09422148019075394,
0.42141956090927124,
0.3788764774799347,
0.11728423088788986,
0.29304301738739014,
-0.13814286887645721,
0.5296756625175476,
... |
def delete ( self, context, key _ id, force = false ) : if not key _ id : raise exception. keymanagererror ('key identifier not provided') resp = self. _ do _ http _ request ( self. _ session. delete, self. _ get _ resource _ url ( key _ id ) ) if resp. status _ code = = requests. codes ['not _ found'] : raise exceptio... | [
-0.34493356943130493,
-0.15143096446990967,
0.39319247007369995,
-0.02901235967874527,
0.10522332787513733,
0.541150689125061,
-0.38264966011047363,
0.22768856585025787,
0.36046087741851807,
0.8158787488937378,
0.26285308599472046,
1.120874047279358,
-0.7193849682807922,
0.6403840780258179... |
def connect ( query ) : # simple db connection to refer to in further functions. db = psycopg2. connect ( " dbname = tournament " ) c = db. cursor ( ) c. execute ( query ) db. commit ( ) db. close | [
-0.5682826638221741,
-0.2968665659427643,
0.5653638243675232,
-0.3751222789287567,
-0.31162703037261963,
0.1172139048576355,
-0.5755232572555542,
0.21791358292102814,
-0.12969394028186798,
0.6080774664878845,
0.04629364237189293,
-1.1622674465179443,
-0.00039221110637299716,
-0.74187076091... |
def get _ cookies ( logger ) : if not os. path. isfile ('cookies. txt') : logger. error ('cookies. txt not found') logger. error ('export a cookies. txt file in the same folder of this. py file') cookie _ jar = http. cookiejar. mozillacookiejar ('cookies. txt') cookie _ jar. load ( ignore _ discard = true ) logger. inf... | [
0.020881524309515953,
-0.4870900809764862,
0.5275269150733948,
0.12710174918174744,
-1.2956551313400269,
-0.5613787770271301,
0.3513317108154297,
0.16723312437534332,
-0.5224344730377197,
0.6736254692077637,
-0.8723211884498596,
0.27249008417129517,
-0.06956397742033005,
0.4666118323802948... |
def get _ license _ notifications ( self, uri = none, app _ id = none, startdatetime = none, max _ results = none, * * kwargs ) : if uri is none : uri = self. makelicensenotificationsfeeduri ( app _ id, startdatetime, max _ results ) return self. get _ feed ( uri, desired _ class = gdata. marketplace. data. licensefeed... | [
0.8126533031463623,
0.23518116772174835,
0.3167123794555664,
0.6679196953773499,
0.2590051293373108,
-0.5128757357597351,
-1.1319278478622437,
0.19280722737312317,
0.1931653916835785,
-0.6409667730331421,
0.11032532155513763,
1.2019342184066772,
-0.4353190064430237,
-0.22225989401340485,
... |
def getfigure ( self ) : return self. fig | [
0.36377736926078796,
0.5090590715408325,
0.3701329827308655,
0.4244605600833893,
-0.09819478541612625,
-0.021040914580225945,
0.20546318590641022,
-0.0023588170297443867,
-0.7942038774490356,
-1.9296200275421143,
-0.1507115513086319,
0.8804848194122314,
0.041058655828237534,
-0.08654674887... |
def interval _ contains ( big, small ) : return big [ 0 ] < = small [ 0 ] and small [ 1 ] < = big [ 1 ] | [
-0.18238003551959991,
-0.19706442952156067,
0.5122836232185364,
-0.009340625256299973,
-0.3582025170326233,
0.5555766820907593,
-1.197068214416504,
-0.8904767036437988,
-0.3990713953971863,
0.08738847821950912,
-0.938459038734436,
0.7650641202926636,
-0.8851116895675659,
-0.604635536670684... |
def write _ to _ dataset ( self ) : pass | [
-1.320980191230774,
-0.839488685131073,
0.1498347371816635,
-0.16730211675167084,
1.6283670663833618,
0.7123753428459167,
0.5344759821891785,
0.8598062992095947,
-0.5743599534034729,
-0.5426881909370422,
0.15852214395999908,
0.9917448163032532,
0.07060503214597702,
0.3028942346572876,
-0... |
def _ scenemergefinishedtimeout ( self ) : dispatch. dispatch ('scenemergefinished') | [
0.032874997705221176,
-0.36616507172584534,
0.38025471568107605,
-0.34560492634773254,
0.6609230637550354,
0.1949600726366043,
-0.0853535383939743,
0.678667426109314,
-0.2639355957508087,
0.2031751275062561,
-1.3089303970336914,
-0.5993990898132324,
-0.4215766489505768,
0.9754229784011841,... |
def set _ sub _ acl ( self, tenant, sub, acl ) : project _ name = tenant. upper ( ) url = self. get _ url ( " subscriptions ", sub, project _ name, " modifyacl " ) data = { " authorized _ users " : acl } return self. post _ resource ( url, data ) | [
0.5810275077819824,
0.22489479184150696,
0.5603734850883484,
0.7746905088424683,
-0.6586573123931885,
0.2638990581035614,
-0.6187297105789185,
-0.3724830448627472,
0.20480035245418549,
0.03442675620317459,
-0.18254931271076202,
1.9229726791381836,
0.04586699232459068,
-0.9641553163528442,
... |
def get _ queries ( df : dataframe ) - > set : return set ( df [ col _ query ]. unique ( ) ) | [
0.09183303266763687,
0.7602773904800415,
0.2782188951969147,
-0.01337162870913744,
0.6825259923934937,
0.10936310142278671,
0.007904114201664925,
-0.8722919225692749,
-0.48680323362350464,
-0.3082761764526367,
0.15620572865009308,
0.01286324579268694,
0.48137959837913513,
-1.15452504158020... |
def _ _ get _ billing _ df2 ( spark, closing _ day ) : print'[ info _ _ get _ billing _ df2 ] calculating basic billing ( customer level ) information...'data _ billing _ numcliente _ ori = ( spark. read. parquet ( path _ raw _ billing ). where ( ( concat ( col ('year'), lpad ( col ('month'), 2,'0'), lpad ( col ('day')... | [
0.23242543637752533,
0.2721189558506012,
1.0278984308242798,
0.15666206181049347,
-0.7468268871307373,
0.23932671546936035,
0.4595983028411865,
0.7411477565765381,
-1.4733319282531738,
-0.5416210889816284,
0.915333092212677,
0.167860209941864,
0.54886394739151,
0.33008456230163574,
1.213... |
def parse _ slack _ output ( slack _ rtm _ output ) : output _ list = slack _ rtm _ output if output _ list and len ( output _ list ) > 0 : for output in output _ list : if output and'text'in output and at _ bot in output ['text'] : # return text after the @ mention, whitespace removed return output ['text']. split ( a... | [
0.7616285085678101,
-1.5907115936279297,
0.5988492369651794,
-0.8710069060325623,
-0.691293478012085,
-0.8327541351318359,
-0.0764068141579628,
-0.6530487537384033,
-1.0553468465805054,
0.4083823263645172,
0.05174047127366066,
-0.09242022782564163,
-0.7857837080955505,
0.5082562565803528,
... |
def classdecorator ( decorator, cls = none, * decorator _ args, * * decorator _ kwargs ) : if cls is not none : # check that the view class is a class - based view. this can either be # done by checking inheritance from django. views. generic. view, or by # checking that the viewclass has a ` ` dispatch ` ` method. if ... | [
-0.7190258502960205,
0.1582934409379959,
0.6401351690292358,
-0.1362943798303604,
-0.591453492641449,
-0.6103597283363342,
0.13291528820991516,
0.48468470573425293,
1.6116739511489868,
-0.4729402959346771,
0.7246862053871155,
0.15673929452896118,
1.009392499923706,
0.6614840626716614,
-0... |
def required ( self ) - > bool : return pulumi. get ( self, " required " ) | [
-0.10233765840530396,
0.36094731092453003,
0.38771969079971313,
0.6313981413841248,
0.9112500548362732,
1.3368251323699951,
-0.34479543566703796,
0.2780529856681824,
0.08922288566827774,
0.14083831012248993,
0.27246230840682983,
0.7853881120681763,
-0.4688364863395691,
-0.13008858263492584... |
def df _ first _ valid ( df ) : def func ( x ) : if x. first _ valid _ index ( ) is none : return none else : return x. first _ valid _ index ( ) df2 = df. apply ( func, axis = 0 ) return df2 | [
0.39103105664253235,
0.30525723099708557,
0.41779258847236633,
0.6014576554298401,
0.540679931640625,
-1.0481442213058472,
-0.042644202709198,
-0.209584578871727,
0.08408238738775253,
-0.9267001152038574,
0.745705246925354,
0.598132848739624,
0.43057575821876526,
-0.5740630626678467,
0.8... |
def test _ saved _ owner _ name ( self ) : report _ airflow _ variable = variable. get ( " rb _ status _ " + self. report _ form _ sample. report _ title. data, deserialize _ json = true, ) self. assertequal ( self. report _ form _ sample. owner _ name. data, report _ airflow _ variable [ " owner _ name " ], ) | [
0.5405789017677307,
-0.22600926458835602,
0.3267686665058136,
0.19849726557731628,
0.6477305293083191,
-0.18302255868911743,
-0.03940095379948616,
-0.6811966300010681,
0.38816291093826294,
-0.8002880811691284,
-0.8238364458084106,
0.22417953610420227,
-0.09714637696743011,
-0.6376301050186... |
def test _ all _ data ( category, i _ episode, last _ trial _ key _ path, is _ holdout ) : trial = i _ episode model _ file _ dir = join ( classifier _ root,'snapshots') image _ dir = image _ dir _ holdout if is _ holdout else image _ dir _ train gt _ path = gt _ path _ holdout if is _ holdout else gt _ path test _ all... | [
-0.1577608585357666,
0.18191032111644745,
0.5440738201141357,
0.6670027375221252,
1.0793373584747314,
0.3903732895851135,
-0.48961153626441956,
0.1379534751176834,
-0.08940985798835754,
-0.4283624589443207,
0.4880770742893219,
-0.6361910104751587,
0.823205828666687,
0.1365891396999359,
-... |
def run ( tasks, forced = none, forced _ all = false, forced _ all _ upstream = false, confirm = true, workers = 1, abort = true, execution _ summary = none, * * kwargs ) : if not isinstance ( tasks, ( list, ) ) : tasks = [ tasks ] # if forced _ all _ upstream is true we are going to force run tasks anyway # in the sec... | [
-0.5051093101501465,
0.2956271469593048,
0.7002177834510803,
0.8624506592750549,
-0.43870869278907776,
-0.16748493909835815,
0.10929607599973679,
0.06841105222702026,
0.12306460738182068,
-0.22203418612480164,
-0.6569876074790955,
0.1975242793560028,
-0.6543667912483215,
-0.137508139014244... |
def test _ validate _ partial ( is _ port _ open, is _ hostname _ valid, app _ context ) : is _ hostname _ valid. return _ value = true is _ port _ open. return _ value = true payload = { " engine " : " postgresql ", " parameters " : { " host " : " localhost ", " port " : 5432, " username " : " ", " password " : " supe... | [
0.6882750391960144,
0.5668001770973206,
0.5512455105781555,
0.17749616503715515,
0.3224661946296692,
0.7823107838630676,
0.13046881556510925,
-0.02983184903860092,
-0.7951484322547913,
-0.3890843391418457,
-0.48450803756713867,
0.3001047670841217,
-0.4639075994491577,
0.5282716751098633,
... |
def computehenryconstant ( arr, temp ) : const2 = arr delta _ temp = temp - const2 [ " t0 " ] # uses the following columns : x ( t0 ), a, b, c # this does the equation hc = t + dt * a + dt ^ 2 * b + dt ^ 3 * c henry _ constants = const2 [ " xt0 " ] + delta _ temp * const2 [ " a " ] + \ delta _ temp * * 2 * const2 [ " b... | [
-0.03038696013391018,
-0.5828723311424255,
0.8494561314582825,
-0.3848762810230255,
-0.13372865319252014,
0.43043625354766846,
-0.04469374939799309,
0.8479527235031128,
-1.2091064453125,
0.7220808267593384,
-1.0686185359954834,
-0.4902496337890625,
0.4927509129047394,
0.32595857977867126,
... |
def test _ complain _ if _ unknown _ db ( self ) : def mock _ list _ history _ databases ( ) : return [ " usa - stk - 1d ", " japan - stk - 1d ", " usa - stk - 15min ", " demo - stk - 1min ", " japan - stk - 15min " ] def mock _ list _ realtime _ databases ( ) : return { " demo - stk - taq " : [ " demo - stk - taq - 1h... | [
-0.3805469572544098,
0.9416354298591614,
0.6854281425476074,
-0.007491123862564564,
0.19939926266670227,
-0.1163964718580246,
0.4419022500514984,
-0.28148919343948364,
0.10538528859615326,
0.23878267407417297,
-0.07764275372028351,
0.11613576114177704,
-0.44510695338249207,
1.0443071126937... |
def raw ( text ) : new _ string ='' for char in text : try : new _ string + = escape _ dict [ char ] except keyerror : new _ string + = char return new _ string | [
-0.18861326575279236,
0.0044752140529453754,
0.25836873054504395,
-0.3037378191947937,
-1.000543475151062,
0.2167966663837433,
-1.2131203413009644,
-0.010568300262093544,
-0.16379627585411072,
0.09610841423273087,
-0.2928764522075653,
0.0031107093673199415,
0.5981031656265259,
-0.504960715... |
def serve _ requests ( sock, logger, handler ) : buf = [ ] ctx = context ( logger, none, response ) stream = sock. makefile ('w') while true : formatted _ exception = none try : # try to read a packet ( delimited by \ n ) from the wire buf, packet = get _ next _ packet ( sock, buf ) # we could've received partial data.... | [
-0.004803950898349285,
-0.24704840779304504,
0.9813578128814697,
-0.2530950605869293,
-0.8873152732849121,
-0.8140628933906555,
0.32923367619514465,
-0.7888703346252441,
-0.239841029047966,
-0.16740083694458008,
-0.06806093454360962,
0.6914047002792358,
-0.4142029285430908,
0.4252510666847... |
def verify ( self, jws : acme. jws. jws, ) - > bool : key = josepy. jwk. jwkoct ( key = josepy. b64. b64decode ( self. hmac _ key ) ) return jws. verify ( key ) | [
0.08983264118432999,
0.6226223111152649,
0.4833791255950928,
0.6185490489006042,
-0.525429368019104,
0.05185263603925705,
-0.14217497408390045,
-1.0697513818740845,
0.8902736902236938,
-0.19396179914474487,
-0.5059495568275452,
0.3371420204639435,
-0.45161640644073486,
1.2302906513214111,
... |
def execute _ sp _ singleton0 ( self, sql : str, * params ) - > any : cursor = self. _ _ conn. cursor ( ) cursor. execute ( sql, params ) rows = cursor. fetchall ( ) cursor. close ( ) n = len ( rows ) if n = = 1 : return rows [ 0 ] [ 0 ] elif n = = 0 : return none else : raise resultexception ('0 or 1 ', n, sql ) | [
-0.06640621274709702,
0.49291786551475525,
0.7506678700447083,
1.0084164142608643,
0.44852107763290405,
-0.4493066668510437,
0.08054506778717041,
-0.2910231053829193,
0.40884122252464294,
-0.21330709755420685,
0.9069346785545349,
0.5754414200782776,
-0.990652859210968,
0.7444448471069336,
... |
def user _ stats ( df ) : print ('\ ncalculating user stats... \ n') start _ time = time. time ( ) # display counts of user types user _ counts = df. groupby ('user type'). size ( ). sort _ values ( ascending = false ) for i in range ( len ( user _ counts ) ) : print ('the number of { } ( s ) = { }. '. format ( user _ ... | [
0.49067991971969604,
0.6307739019393921,
0.8250335454940796,
0.12017550319433212,
-0.0790371522307396,
0.17511843144893646,
1.5397449731826782,
-0.7038251161575317,
-0.7371761798858643,
-0.7343754768371582,
0.7779403924942017,
0.8698455691337585,
0.36598241329193115,
0.7397790551185608,
... |
def test _ comparation _ vectors ( self ) : assert ( self. vector = = vector ( [ 1, 2, 3 ] ) ) assert ( self. vector = = [ 1, 2, 3 ] ) assert ( [ 1, 2, 3 ] = = self. vector ) assert ( not ( vector ( [ 3, 2, 1 ] ) = = self. vector ) ) assert ( not ( [ 3, 2, 1 ] = = self. vector ) ) self. assertraises ( differentdimensio... | [
-0.29417845606803894,
-0.27942752838134766,
0.4041585326194763,
0.2961670756340027,
0.5107600092887878,
0.6249324679374695,
1.1349416971206665,
-0.31148725748062134,
0.15972685813903809,
-0.14182503521442413,
-0.580906331539154,
-0.2588686943054199,
-0.03218080848455429,
0.6787428855895996... |
def add _ scheme ( self, scheme ) : scheme = normalizers. normalize _ scheme ( scheme ) return uribuilder ( scheme = scheme, userinfo = self. userinfo, host = self. host, port = self. port, path = self. path, query = self. query, fragment = self. fragment, ) | [
-0.5923917889595032,
0.13565288484096527,
0.5539152026176453,
0.3718588650226593,
-0.22758561372756958,
0.23081393539905548,
-0.1549459546804428,
0.32836848497390747,
1.3767461776733398,
-1.3890633583068848,
0.35980358719825745,
-0.7273234724998474,
-0.8514983654022217,
-0.5440494418144226... |
def parse _ csv _ row ( self, row ) : self. num _ recipes _ processed + = 1 id = row [ 0 ] url _ id = row [ 1 ]. split ( r'/') [ - 3 ] # if the id from the filename does not match the id of the url, redirection # has happened, and the row should be skipped to prevent duplicate entries. if id! = url _ id : return try : ... | [
-0.026844440028071404,
0.06811496615409851,
0.567540168762207,
0.050571296364068985,
0.24540181457996368,
-0.2658507823944092,
0.21242858469486237,
0.48803815245628357,
0.30987057089805603,
-0.00979272834956646,
0.5932696461677551,
-0.4126475155353546,
0.5126976370811462,
0.073486045002937... |
def _ add _ package _ rules ( self, package, requirements = none ) : work _ queue = deque ( ) work _ queue. append ( ( package, requirements ) ) while len ( work _ queue ) > 0 : p, requirements = work _ queue. popleft ( ) p _ id = self. _ pool. package _ id ( p ) if p _ id not in self. added _ package _ ids : self. add... | [
-0.7535383701324463,
0.6711907982826233,
0.4940682351589203,
-0.2898542582988739,
1.1117868423461914,
0.23901022970676422,
-0.23045428097248077,
0.40232017636299133,
0.0415198877453804,
-0.02764577604830265,
-0.06117201969027519,
-0.4892324209213257,
-0.2793412506580353,
0.9487390518188477... |
def load _ numpy _ to _ gdal _ mem ( array, geotransform, wtk _ from, x _ size = none, y _ size = none ) : assert x _ size assert y _ size # now, we create an in - memory raster mem _ drv = gdal. getdriverbyname ('mem') dest = mem _ drv. create ('', x _ size, y _ size, 1, gdal. gdt _ float32 ) # set the geotransform de... | [
0.22939784824848175,
-0.19889923930168152,
0.6208146214485168,
-1.200486421585083,
-0.19757702946662903,
0.2830946445465088,
-0.07757958769798279,
-1.1599990129470825,
0.48414212465286255,
0.5406668186187744,
0.40055689215660095,
0.4049726724624634,
-0.5113220810890198,
0.03293356299400329... |
def set _ value ( self, new _ val : int ) - > none : if new _ val > 1 < < self. width : raise valueerror ( " the input value is out of bitfield range " ) reg _ val = int. from _ bytes ( self. parent. get _ value ( ), " big " ) mask = ( ( 1 < < self. width ) - 1 ) < < self. offset reg _ val = reg _ val & ~ mask value = ... | [
-0.5623853206634521,
0.6823225021362305,
0.7516483664512634,
-0.3849029242992401,
-0.38461923599243164,
0.6822718977928162,
0.6624000072479248,
-0.5933921337127686,
-0.05379815027117729,
-0.1854831576347351,
-0.5613126754760742,
0.8542317152023315,
0.06351162493228912,
0.7414924502372742,
... |
def statetoprediction ( self, state, wqeinstance ) : tags = [ ] for action in state. currentstages [ 0 ]. actionstaken : tags. append ( action. label ) return wqeoutput ( tags ) | [
-0.6282752156257629,
-0.5827258229255676,
0.23555995523929596,
-1.0370864868164062,
-0.19036522507667542,
-0.7459943294525146,
-0.27520740032196045,
0.09461411833763123,
-0.05361394211649895,
1.2791341543197632,
0.5632407069206238,
0.2788570523262024,
0.49710631370544434,
0.514872312545776... |
def newmenuitem ( rest _ id ) : restobj = session. query ( restaurant ). filter _ by ( id = rest _ id ). one ( ) if restobj. user _ id! = login _ session ['user _ id'] : flash ('you are not authorized to modify this menu.') return redirect ( url _ for ('showmenu ', rest _ id = rest _ id ) ) if request. method = ='post'... | [
-0.44370514154434204,
0.02436046302318573,
0.8682803511619568,
1.6580936908721924,
-0.24190905690193176,
0.8759846687316895,
-0.272879958152771,
0.3266555368900299,
-0.08285661786794662,
-0.6592901945114136,
-0.26211628317832947,
-0.5954670906066895,
-0.26617878675460815,
0.573230147361755... |
def _ _ init _ _ ( self, screen : pygame. surface, username : str = none, solo : bool = true, is _ left : bool = true ) : # game settings self. end _ game = false self. username = username self. screen = screen self. is _ left = is _ left self. solo = solo # display settings self. screenwidth, self. screenheight = pyga... | [
-0.5884867310523987,
0.007003074511885643,
1.0001220703125,
0.3240710198879242,
0.09443356096744537,
0.7814329266548157,
0.3233536183834076,
-0.34419816732406616,
-0.16227987408638,
0.5898776054382324,
0.05045938119292259,
-0.06409565359354019,
0.16560369729995728,
0.9072278141975403,
0.... |
def caching _ enabled ( func ) : def wrapped ( self, * args, * * kwargs ) : if not self. enabled : return none return func ( self, * args, * * kwargs ) return wrapped | [
-0.2547643184661865,
-0.10414852201938629,
0.5783619284629822,
0.0776749923825264,
-0.49028223752975464,
0.012921085581183434,
-0.4282592236995697,
0.595393717288971,
1.0883454084396362,
0.39992332458496094,
0.24390138685703278,
0.18958935141563416,
-0.6856960654258728,
0.28806599974632263... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.