text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def test _ unit _ login _ username _ notexist ( self ) : with patch ('user _ auth. auth _ forms. forms') as forms : forms. charfield = magicmock ( return _ value = " username " ) forms. charfield = magicmock ( return _ value = " password " ) ins = loginform ( ) ins. cleaned _ data = magicmock ( return _ value = " clean... | [
-0.9348282814025879,
0.07903211563825607,
0.6333905458450317,
-0.272973895072937,
0.8096094727516174,
1.1367701292037964,
-0.12347625195980072,
-0.34344905614852905,
0.4473896324634552,
-0.7784252166748047,
-0.9656186103820801,
-0.16075295209884644,
-0.5668196082115173,
-0.1660817116498947... |
def get _ tenant _ user ( self, tenant, role ) : if role = = " project _ admin " : username = " ams _ { } _ admin ". format ( tenant. lower ( ) ) else : username = " ams _ { } _ { } ". format ( tenant. lower ( ), role ) return self. get _ user ( username ) | [
0.24869199097156525,
0.07511404156684875,
0.20899517834186554,
0.027210241183638573,
-0.18364623188972473,
0.1856212168931961,
-0.7123266458511353,
-0.621637761592865,
0.06475450098514557,
0.6770275831222534,
0.5982345938682556,
0.8743247389793396,
0.6206914782524109,
-0.6598802804946899,
... |
def read _ examples ( input _ file, unique _ id = 0 ) : examples = [ ] _ unique _ id = unique _ id with tf. gfile. gfile ( input _ file, " r " ) as reader : while true : line = tokenization. convert _ to _ unicode ( reader. readline ( ) ) if not line : break line = line. strip ( ) text _ a = none text _ b = none m = re... | [
-0.1527380645275116,
-0.08863282948732376,
0.45777854323387146,
-0.026542115956544876,
-0.5582861304283142,
0.2499811351299286,
0.08687077462673187,
1.3825327157974243,
-0.6329683661460876,
0.4102804958820343,
-0.5510066747665405,
0.13277165591716766,
-0.22061382234096527,
0.14470903575420... |
def test _ valid _ email ( self ) : valid _ email = " jdoe @ raybeam. com " self. assertequal ( none, reportformsaver. validate _ email ( reportformsaver, valid _ email ) ) | [
1.0191117525100708,
0.545464038848877,
0.26741737127304077,
0.10096419602632523,
0.512352705001831,
0.2070608139038086,
0.09594769030809402,
0.9616230726242065,
-0.016183096915483475,
-1.3900679349899292,
-0.5669863820075989,
-0.4308503568172455,
-0.7728400826454163,
-0.8914883732795715,
... |
def showtoptopdnsserver ( ) : labels, sizes = pie _ chart. _ _ gettoptendnsserver ( ) pie _ chart. _ _ show ( labels, sizes ) | [
-1.1382989883422852,
0.8224427103996277,
0.38109344244003296,
-1.396643877029419,
-1.2490965127944946,
0.019115936011075974,
0.23706713318824768,
0.07171390950679779,
1.2131701707839966,
0.04848899319767952,
-0.6575900912284851,
1.1402913331985474,
0.31671732664108276,
-0.01386304665356874... |
def set _ region ( region = none ) : local _ region = cliauth. get _ var ('os _ region _ name') if not region : if projvar. get _ var ('is _ dc') : region ='systemcontroller'else : region = local _ region tenant. set _ region ( region = region ) projvar. set _ var ( region = region ) if re. search ( subcloud _ pattern,... | [
0.20260971784591675,
0.9247608184814453,
0.5956858396530151,
0.7093014121055603,
0.2738324701786041,
0.552757203578949,
0.4721645712852478,
0.13362237811088562,
-0.19546940922737122,
-0.3552258014678955,
0.44918254017829895,
0.4013892710208893,
-0.5079827904701233,
0.8203611373901367,
0.... |
def load _ config ( self, configid, configdir ) : # config = cvxconfig. read ( configid, self. configdir ) # if config is not none : # self. configs. append ( solverconfig ) # else : # warn ( userwarning ( " { } configuration specified but not installed. ". format ( configid ) ) ) self. configs. append ( ( configid, co... | [
0.3443843424320221,
-0.3048928380012512,
0.42978349328041077,
0.20738403499126434,
-0.22131803631782532,
-0.6834409236907959,
-0.47493216395378113,
0.07235103845596313,
0.4855613112449646,
0.042330145835876465,
-0.6847678422927856,
-0.5236132144927979,
-0.23960904777050018,
0.8130630850791... |
def islast ( self ) : if ( self. storage ). index ( self. storage [ self. currentitem ] ) = = len ( self. storage ) - 1 : return true return false | [
-0.2390407770872116,
-1.1009576320648193,
0.7386269569396973,
0.18113045394420624,
0.40535569190979004,
0.06464850902557373,
-0.7780520915985107,
-0.22078166902065277,
0.579892635345459,
0.37040334939956665,
-0.7163422703742981,
-0.4817288815975189,
-1.3660132884979248,
0.21394404768943787... |
def flushmessagesold ( self ) : if self. pt : self. pt. flushmessagequeue ( ) | [
0.4789663255214691,
-0.15528477728366852,
0.5572915077209473,
-0.49408605694770813,
0.5072470903396606,
0.02609200030565262,
0.4088209867477417,
-0.6763354539871216,
0.10788226872682571,
0.431829035282135,
0.9382745027542114,
1.2166982889175415,
-0.7184756994247437,
1.7625958919525146,
-... |
def _ get _ comparisons ( self ) : random _ state = np. random. randomstate ( self. seed ) similarities = self. metric ( self. x, self. x ) comparisons _ array = np. zeros ( ( self. n _ examples, self. n _ examples, self. n _ examples, self. n _ examples ), dtype ='int8') # this is to take into account the symmetry eff... | [
-0.2171308845281601,
0.10310286283493042,
0.5919741988182068,
-0.7473152279853821,
0.35569602251052856,
0.28295937180519104,
1.0183587074279785,
-0.700386643409729,
0.5109705328941345,
0.42402082681655884,
0.5512999892234802,
0.18099486827850342,
-0.5658934116363525,
0.012072741985321045,
... |
def feedforward ( self, datum : list [ float ] ) - > list [ int ] : # can also be represented by the dot product. datum = np. array ( datum ). transpose ( ) # this function represents an activation function classify = np. vectorize ( lambda a, r : 1 if a > r else 0 ) return classify ( np. matmul ( self. perceptron, dat... | [
-0.7614669799804688,
0.3792380094528198,
0.7496030926704407,
-0.6666498780250549,
0.1414339542388916,
-0.7744536399841309,
0.2181519716978073,
0.0923369750380516,
0.903022289276123,
-0.4535270929336548,
-0.29382479190826416,
1.7722446918487549,
0.39428138732910156,
-0.17750078439712524,
... |
def test _ multiplication _ matrix _ by _ matrix ( self ) : matrix = matrix ( [ [ 1, 2, 3 ], [ 2, 2, 2 ] ] ) assert ( self. matrix * matrix = = [ [ 5, 6, 7 ], [ 10, 14, 18 ] ] ) assert ( self. matrix * [ [ 1, 2, 3 ], [ 2, 2, 2 ] ] = = [ [ 5, 6, 7 ], [ 10, 14, 18 ] ] ) self. assertraises ( differentdimensionerror, \ sel... | [
-0.19146981835365295,
0.5962193608283997,
0.5256195664405823,
0.5150728225708008,
-0.28218188881874084,
0.1098807081580162,
0.8685396909713745,
-0.03915734589099884,
0.47755345702171326,
-0.1312355101108551,
-0.38759830594062805,
-0.5494168996810913,
-0.3340212106704712,
0.4800019562244415... |
def set _ created _ by ( self, created _ by ) : try : from zcrmsdk. src. com. zoho. crm. api. users import user except exception : from.. users import user if created _ by is not none and not isinstance ( created _ by, user ) : raise sdkexception ( constants. data _ type _ error,'key : created _ by expected type : user... | [
-0.2652578055858612,
0.30908888578414917,
0.23845599591732025,
0.9777405261993408,
0.4482823312282562,
0.0950310230255127,
1.238559603691101,
0.04625239968299866,
-1.102905035018921,
-0.1458006501197815,
-0.7700139880180359,
0.26852232217788696,
0.09723516553640366,
0.8046634197235107,
0... |
async def add ( self, ctx, user : discord. member, amount ) : if amount! = int ( float ( amount ) ) : return await ctx. send ( " uh oh, amount has to be an integer. " ) if amount < = 0 : return await ctx. send ( " uh oh, amount has to be more than 0. " ) user _ points = int ( await self. config. member ( user ). chars ... | [
0.2913384437561035,
0.3707049787044525,
0.6653321385383606,
0.852527916431427,
-0.40925514698028564,
1.079702377319336,
-0.48504939675331116,
-0.5925235152244568,
0.6000673174858093,
0.23639163374900818,
-0.4576466679573059,
0.8700982928276062,
-0.656647264957428,
-0.10807105153799057,
1... |
def activate _ rule ( self, key, profile _ key, reset = false, severity = none, * * params ) : # build main data to post data = {'rule': key,'key': profile _ key,'reset': reset and'true'or'false'} if not reset : # no reset, add severity if given ( if not default will be used? ) if severity : data ['severity'] = severit... | [
0.08618418872356415,
0.28370967507362366,
0.5781486630439758,
-0.05766846984624863,
1.4493021965026855,
-0.11439893394708633,
-0.4986741840839386,
0.747545599937439,
-0.7717460989952087,
0.9784794449806213,
-0.1663714051246643,
1.1866604089736938,
-1.0293859243392944,
-0.17330868542194366,... |
def _ _ initmenu ( self ) : self. _ _ menu = qmenu ( self ) self. leftmenuact = self. _ _ menu. addaction ( ui. pixmapcache. geticon ( " 1leftarrow. png " ), self. tr ('move left'), self. _ _ contextmenumoveleft ) self. rightmenuact = self. _ _ menu. addaction ( ui. pixmapcache. geticon ( " 1rightarrow. png " ), self. ... | [
-1.0646886825561523,
-0.4958895742893219,
1.0465223789215088,
0.48787087202072144,
0.12255983799695969,
-0.11675532162189484,
0.6684640049934387,
0.04160149767994881,
0.49740350246429443,
-0.25632235407829285,
-0.8947926163673401,
-0.7574177980422974,
0.024752791970968246,
0.61066579818725... |
def plus ( f ) : res = f. copy ( ) res. repeat _ plus ( ) res. minimize ( ) return res | [
-0.27187076210975647,
0.6222530007362366,
0.20600605010986328,
0.9771799445152283,
-0.9423655867576599,
-0.22472941875457764,
0.2743595838546753,
-0.1689072996377945,
1.2546206712722778,
-0.6212812066078186,
-0.4673197269439697,
-0.44813409447669983,
0.5853342413902283,
-1.3648817539215088... |
def evaluate _ predicted _ answers ( use _ image = true ) : print ( " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " ) if use _ image : print ( " evaluate model ( text + image ) : " ) else : print ( " evaluate model ( text only ) : " ) print ( " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " )... | [
-0.8566661477088928,
-0.5420066714286804,
0.8140546679496765,
-0.6590127348899841,
-0.645675778388977,
0.8260388374328613,
0.8905379176139832,
0.24383385479450226,
-0.7231873869895935,
-0.13335315883159637,
0.5297015309333801,
0.4589582681655884,
0.33070218563079834,
0.4643775522708893,
... |
def push _ front ( self, data ) : node = doublylinkedlistnode ( data ) if self. is _ empty ( ) : self. head = node else : node. next = self. head self. head. prev = node self. head = node self. size + = 1 | [
-0.29958829283714294,
1.612402081489563,
0.604667067527771,
-0.6218183636665344,
0.20940160751342773,
-0.5021473169326782,
-0.2940233647823334,
0.11248606443405151,
1.0613638162612915,
0.008636058308184147,
-0.668329656124115,
1.0740139484405518,
-0.5152148008346558,
1.1534472703933716,
... |
def test _ addbothsuccess ( self ) : l = [ ] sd = synchronousdeferred ( " foo " ) self. assertequals ( sd. addboth ( l. append ), sd ) self. assertequals ( l, [ " foo " ] ) | [
0.6286904811859131,
0.602285623550415,
0.8022797703742981,
0.1271984577178955,
0.3513043522834778,
1.21257483959198,
-1.134002447128296,
0.3373905122280121,
0.3431234657764435,
-1.1658962965011597,
-1.0178955793380737,
0.4489175081253052,
0.3881073296070099,
1.337136149406433,
0.85148584... |
def lambert ( attractor, rr _ i, vv _ i, rr _ f, vv _ f, epoch _ start, epoch _ stop, tof _ steps _ start : int, tof _ steps _ stop : int, m _ max = 2, numiter = 35, rtol = 1e - 8, ) : assert rr _ i. shape = = rr _ f. shape = = vv _ i. shape = = vv _ f. shape assert 0 < tof _ steps _ start assert tof _ steps _ start < ... | [
-0.0233924500644207,
0.005975098814815283,
0.7112500667572021,
-0.138871967792511,
-0.2585814595222473,
-0.1258867383003235,
0.24439702928066254,
0.5337049961090088,
-0.6746166944503784,
1.0355422496795654,
0.28218215703964233,
0.677446186542511,
0.9420922994613647,
-0.4895826280117035,
... |
def sampler ( self, images, max _ len = 20 ) : # data parallelism if multiple gpus if torch. cuda. device _ count ( ) > 1 : device _ ids = range ( torch. cuda. device _ count ( ) ) encoder _ parallel = torch. nn. dataparallel ( self. encoder, device _ ids = device _ ids ) v, v _ g = encoder _ parallel ( images ) else :... | [
0.24314281344413757,
-0.7239359617233276,
0.7220272421836853,
0.05008135363459587,
-0.37207716703414917,
-0.2539275586605072,
0.3796280026435852,
-0.3259889483451843,
-0.7035853862762451,
0.3491186201572418,
-0.6382367014884949,
0.09095242619514465,
0.1675826460123062,
0.6645194292068481,
... |
def ordered _ indices ( self ) : return np. arange ( len ( self ), dtype = np. int64 ) | [
-1.3135911226272583,
-0.26968979835510254,
0.29561343789100647,
0.06866300106048584,
0.3871695101261139,
0.1100861057639122,
-0.06330562382936478,
-0.6833218336105347,
0.32645565271377563,
-0.1378760188817978,
0.2262454628944397,
0.6686084270477295,
-0.20615680515766144,
-0.579298615455627... |
def test _ _ rolling _ forward _ abort ( client ) : res = client. start _ job _ update ( get _ job _ update _ request ('test _ dc _ labrat. yaml'),'create job') key = res. key # sleep for sometime to let peloton transition workflow state # from initialized - > rolling _ forward or let it be as - is time. sleep ( 5 ) cl... | [
0.4114935100078583,
0.058648452162742615,
0.43285220861434937,
-0.32289355993270874,
-0.4689624607563019,
1.072920799255371,
-0.49733543395996094,
-0.13793624937534332,
-0.2571963667869568,
0.055852215737104416,
0.2404802143573761,
-0.1779555380344391,
-0.28682148456573486,
-0.035211764276... |
def get _ sales _ tax ( cls, address ) : try : tax = taxrate. objects. get ( country = address. country. code, zip _ code = address. zip _ code ) except taxrate. doesnotexist : return 0 except attributeerror : return 0 else : return tax. rate | [
0.6229115724563599,
0.27979832887649536,
0.45418208837509155,
-0.3956613540649414,
0.34163689613342285,
-0.6935157775878906,
-0.4125610589981079,
0.12369585037231445,
0.3755926787853241,
0.5351799726486206,
0.7716717720031738,
0.01453263871371746,
-0.4219764173030853,
0.1895819902420044,
... |
def insertnodeatstart ( self, value = none ) : node = node ( value ) node. nextnode = self. nextnode ; self. nextnode = node | [
-1.0330063104629517,
0.7866815328598022,
0.4313071668148041,
-0.8409433364868164,
0.027565062046051025,
0.48577719926834106,
0.38039731979370117,
0.43125829100608826,
0.44171077013015747,
0.25926750898361206,
-0.687395453453064,
0.4264513850212097,
-1.1088263988494873,
0.6366791725158691,
... |
def note _ list _ selected _ offset ( self, offsets : list ) : pure _ notes = [ ] urls _ index = 0 for score, path in zip ( self. scores, self. paths ) : parts = score. getelementsbyclass ( stream. part ) for part in parts : measures = part. getelementsbyclass ( stream. measure ) for measure in measures : voices = meas... | [
-0.7650556564331055,
-1.1020663976669312,
0.7064541578292847,
-0.23122061789035797,
-0.04681229963898659,
0.9827741384506226,
0.03177044168114662,
-0.46266844868659973,
0.6821486353874207,
0.10485923290252686,
-0.4866921901702881,
0.6166204810142517,
-0.011091255582869053,
0.03124476782977... |
def make _ text ( chains ) : words = [ ] # keys _ chain = chains. keys ( ) # makes a list of the keys in chains # keys _ chain = list ( keys _ chain ) # made keys _ chain into an iterable list keys _ chain = list ( chains ) bigrm = choice ( keys _ chain ) # randomly chooses a tuple from keys if bigrm [ 0 ] [ 0 ] = = bi... | [
-0.24869756400585175,
-0.7077791690826416,
0.7763117551803589,
-0.44126296043395996,
-0.36190059781074524,
-0.8482210040092468,
-0.2522979974746704,
-0.29555168747901917,
0.03620534762740135,
0.6204817891120911,
0.16966032981872559,
-0.03110634908080101,
-0.9566041827201843,
-0.58673787117... |
def formular _ in ( ) : now = datetime. datetime. now ( ) today = now. strftime ( " % d. % m. % y " ) if request. args. get ('id') : get _ id = request. args. get ('id') conn = get _ db ( ) conn. row _ factory = sqlite3. row cursor = conn. execute ('select * from foundations where id =? ', ( get _ id, ) ) items = curso... | [
-0.7494826316833496,
0.07913379371166229,
0.6636396646499634,
0.24574682116508484,
-0.004657215438783169,
-0.3900212049484253,
0.07262570410966873,
0.27388516068458557,
-0.8996539115905762,
-0.3617035448551178,
0.9514456987380981,
-0.643107533454895,
0.3089456558227539,
1.211073398590088,
... |
def set _ dispatch ( self ) : generators = self. app. getcalcrelevantobjects ('*. elmsym') loads = self. app. getcalcrelevantobjects ('*. elmlod') # create keys for generator dictionary form all names of generators keys = [ ] values = [ ] for key in generators : keys. append ( key. loc _ name ) active _ loads = [ ] for... | [
0.21261657774448395,
-0.7393805980682373,
0.5344941020011902,
-0.21060578525066376,
-0.021440286189317703,
0.6804468631744385,
0.2108396291732788,
0.18046095967292786,
-0.9204609990119934,
-0.03820861130952835,
-0.8222470283508301,
-0.18155083060264587,
0.680753767490387,
0.594909012317657... |
def draw _ circle ( binarized _ frame : np. ndarray, mouse _ info : mouseinfo ) - > none : binarized _ frame = cv2. circle ( binarized _ frame, ( mouse _ info. centerx [ - 1 ], mouse _ info. centery [ - 1 ] ), 10, ( 150, 150, 150 ), thickness = 4 ) | [
-0.17876088619232178,
-0.6094035506248474,
0.5775561332702637,
-0.2230648249387741,
0.651059091091156,
0.08580406755208969,
0.29322248697280884,
-0.09074172377586365,
-0.46061792969703674,
0.24613001942634583,
-0.3048335611820221,
0.8411227464675903,
0.11847974359989166,
-0.004890241660177... |
def _ _ init _ _ ( self, inner, * args, * * kwargs ) : if not isinstance ( inner, field ) : raise typeerror ( " inner field must be an instance of field " ) self. inner = inner self. args = args self. kwargs = kwargs super ( ). _ _ init _ _ ( * args, * * kwargs ) | [
-0.7258955240249634,
0.3966268002986908,
0.6972783207893372,
-0.4593805968761444,
0.4272015690803528,
0.496020644903183,
-0.7726821899414062,
-0.13874617218971252,
-0.2076479196548462,
-1.135169267654419,
-0.7034664750099182,
0.4424484372138977,
-0.8153080940246582,
0.5682410001754761,
0... |
def run _ random ( n, s ) : nseed ( s ) rseed ( s ) print n print " ". join ( map ( lambda x : choice ( " qwertyuiopasdfghjklzxcvbnm " ), range ( n ) ) ) | [
-0.20679548382759094,
-0.1441793441772461,
0.38675957918167114,
-0.12881681323051453,
0.17373967170715332,
0.16298319399356842,
-0.1904660314321518,
-0.684895396232605,
0.7844477891921997,
-0.5149297118186951,
-0.48247572779655457,
1.0648683309555054,
-0.02296614646911621,
0.05510050430893... |
def test _ image _ upload _ to _ recipe ( self ) : url = recipe _ image _ upload _ url ( self. recipe. id ) with tempfile. namedtemporaryfile ( suffix = '. jpg') as ntf : img = image. new ('rgb ', ( 10, 10 ) ) img. save ( ntf, format ='jpeg') ntf. seek ( 0 ) res = self. client. post ( url, {'image': ntf }, format ='mul... | [
-0.33005574345588684,
0.7127165198326111,
0.6092253923416138,
-0.057107772678136826,
0.4687884747982025,
-0.23086856305599213,
-0.3261900246143341,
0.5127406716346741,
-0.532833993434906,
0.3152715265750885,
-0.5742977261543274,
-0.7742757201194763,
0.47086456418037415,
0.5737258195877075,... |
def print _ help ( topic : str ) : # user needs help choosing a crib if topic = = " crib " : print ( " " " help : \ na crib is a word that we suspect would appear in either one of our cipher texts, \ nor our target. a common strategy is to guess common english words as the crib, \ nand check that the output makes sense... | [
0.6705686450004578,
-0.08786846697330475,
0.7489354014396667,
-0.012178491801023483,
0.14360304176807404,
0.5675866007804871,
1.010733723640442,
-0.820823609828949,
-0.7173439860343933,
0.08877493441104889,
0.26440492272377014,
0.815320611000061,
-0.7615278959274292,
0.29683515429496765,
... |
def smart _ str ( s, fallback = u'' ) : if isinstance ( s, basestring ) : return s return fallback | [
0.37658950686454773,
0.2469593733549118,
0.4300181567668915,
0.149183452129364,
-0.8913747668266296,
-0.5799841284751892,
-0.0790826827287674,
-0.2346985787153244,
1.398505687713623,
-0.6952545046806335,
0.8302264213562012,
0.3378579616546631,
-0.6752661466598511,
-0.6164109110832214,
-0... |
def _ format _ date ( self, date _ string, default = " * " ) : try : date = self. _ strptime ( date _ string, self. input _ date _ format ) except valueerror : self. log. warn ( " invalid date format : % s " % date _ string ) return default return date | [
0.6087771654129028,
0.2792746126651764,
0.37828177213668823,
0.41940104961395264,
-0.5820583701133728,
0.13078409433364868,
-0.9656326174736023,
0.018613338470458984,
-0.25416818261146545,
-0.23789885640144348,
1.0890346765518188,
0.02875090390443802,
-0.7643595337867737,
-0.11656812578439... |
def test _ unit _ logout _ user ( self ) : with patch ('user _ auth. views. logout') as logout : request = magicmock ( ) with patch ('user _ auth. views. render _ to _ response') as render : logout _ user ( request ) logout. assert _ called _ with ( request ) self. asserttrue ( render. called ) | [
-0.661350667476654,
0.3556566834449768,
0.5374306440353394,
0.27290236949920654,
0.09950593113899231,
0.32838746905326843,
0.719312846660614,
-0.3884882628917694,
1.5521241426467896,
-1.0238734483718872,
-0.4803784489631653,
0.175819531083107,
0.8206393718719482,
-0.6535254716873169,
-0.... |
def remove _ small _ elements ( elements, min _ element _ size ) : # get unique points unique _ elements = np. unique ( elements [ elements! = 0 ]. astype ( int ) ) print ( min _ element _ size ) for element in unique _ elements : # if the size of the cluster is smaller than the minimum, remove it if np. sum ( elements... | [
-0.0482618510723114,
-0.36523202061653137,
0.38842639327049255,
0.11630827188491821,
-0.13930940628051758,
0.3892974853515625,
0.07578545808792114,
0.03917832672595978,
1.2269303798675537,
0.10844215750694275,
-0.7008389830589294,
0.2924976944923401,
-1.2747961282730103,
-0.380601286888122... |
def test _ status _ to _ activity ( self, * _ ) : status = models. status. objects. create ( content = " test content ", user = self. local _ user ) activity = status. to _ activity ( ) self. assertequal ( activity [ " id " ], status. remote _ id ) self. assertequal ( activity [ " type " ], " note " ) self. assertequal... | [
0.2697303295135498,
-0.6278735399246216,
0.14097978174686432,
-0.16734890639781952,
0.46078723669052124,
0.26423388719558716,
0.3924785554409027,
-0.3660476803779602,
0.8492100834846497,
0.05810408294200897,
-0.9173345565795898,
0.2003822773694992,
-0.1843348890542984,
-0.7089110612869263,... |
def lists ( ) : # make sure our user is logged in if check _ if _ user _ logged _ in ( ) : # get email from session var and use it to query user email user = session ['user _ email'] user = shopping _ list _ app. get _ user _ detail ( user ) # get all shopping lists associated with this user my _ lists = shopping _ lis... | [
-0.11474913358688354,
0.29744598269462585,
0.2757660448551178,
0.5830784440040588,
-0.07585282623767853,
0.2874354124069214,
-0.026223838329315186,
1.044612169265747,
1.4672775268554688,
-0.18401065468788147,
0.07286008447408676,
0.045843761414289474,
0.514394223690033,
0.7955763339996338,... |
def insert _ row ( self, data ) : fields, values = zip ( * data. items ( ) ) n = len ( values ) query = " insert into dunkelziffer _ radar ( { 0 } ) values ( { 1 } ) ". format ( ", ". join ( fields ), ", ". join ( [ " % s " ] * n ) ) self. cursor. execute ( query, values ) self. conn. commit ( ) | [
-0.29319849610328674,
2.007596492767334,
0.47966712713241577,
-0.30652129650115967,
0.5952320694923401,
0.19712139666080475,
-0.5068366527557373,
0.14769086241722107,
-0.8514535427093506,
-0.263858824968338,
-0.7729449272155762,
-1.532877802848816,
-0.668263852596283,
0.8685003519058228,
... |
def index _ lookup ( data, items ) : # np. searchsorted doesn't work on mixed types in python3 ndata, ncat = len ( data ), len ( items ) data = pd. dataframe ( {'data': data,'row': np. arange ( ndata ) } ) cats = pd. dataframe ( {'items': items,'cat _ row': np. arange ( ncat ) } ) m = pd. merge ( data, cats, left _ on ... | [
-0.7228527069091797,
0.27087152004241943,
0.5995025634765625,
-0.9671621918678284,
0.42830243706703186,
-0.2234632819890976,
-0.5828654766082764,
-0.19780027866363525,
-0.2773589491844177,
-0.12922440469264984,
0.6175744533538818,
0.25645196437835693,
0.610900342464447,
-0.9885393977165222... |
def check _ maxperiod ( max = 10, season ='2017 - 18 ', season _ type ='regular season ', sleep _ for = none ) : for period in range ( 5, max + 1 ) : if type ( scrape _ teamgamelogs ( period, season ='2017 - 18 ', season _ type ='regular season ', sleep _ for = none ) ) = = int : return period - 1 | [
-0.9617257118225098,
0.3532739579677582,
0.7599278092384338,
0.49377578496932983,
-0.574295163154602,
0.44270452857017517,
0.11501073837280273,
-0.8049644827842712,
0.18149061501026154,
0.6495762467384338,
0.3195294439792633,
0.667375385761261,
-0.47422999143600464,
-0.19346486032009125,
... |
def test _ prepare ( vasp _ calc, vasp _ chgcar, vasp _ wavecar, vasp _ inputs, sandbox _ folder ) : from aiida _ vasp. calcs. vasp import vaspcalculation wavecar, _ = vasp _ wavecar chgcar, _ = vasp _ chgcar inputs _ dict = {'gga':'pe ','gga _ compat': false,'lorbit': 11,'sigma': 0. 5,'magmom':'30 * 2 * 0. ','icharg':... | [
0.5041638016700745,
-0.24609705805778503,
0.5742159485816956,
-0.1073559895157814,
0.10929781198501587,
0.24209481477737427,
0.24923230707645416,
-0.36327046155929565,
-0.051414854824543,
-0.7985368371009827,
0.06855116039514542,
-0.3058627247810364,
0.3371615409851074,
0.38504141569137573... |
def write ( self, data ) : if not isinstance ( data, ( bytes, bytearray ) ) : raise valueerror ( " write takes bytes " ) data = bytes ( data ) # make sure it can't change. self. logger. info ( f'astrohavenserialsimulator. write ( { data! r } )') count = 0 timeout _ obj = serialutil. timeout ( self. write _ timeout ) fo... | [
-1.3629870414733887,
1.018359899520874,
0.535618782043457,
0.7219283580780029,
0.8862520456314087,
-0.2936750650405884,
0.29257580637931824,
0.23928245902061462,
0.3542789816856384,
0.16403768956661224,
-0.8426424264907837,
-0.10524987429380417,
-0.9686615467071533,
0.46182531118392944,
... |
def on _ data _ received ( self, data : dict, version : int ) : super ( ). on _ data _ received ( data, version ) self. _ _ attachments = data. copy ( ) | [
-0.3353438973426819,
-0.5302871465682983,
0.5213470458984375,
-0.7587344646453857,
-0.5376041531562805,
0.6077497601509094,
-0.7516040205955505,
0.07357924431562424,
0.46748679876327515,
0.2719341516494751,
-1.1947494745254517,
0.5441752672195435,
0.2344745695590973,
-0.2875364422798157,
... |
def get _ bus _ voltages ( self ) : voltages = { } # collect all bus elements for voltages buses = self. app. getcalcrelevantobjects ('*. elmterm') # store as dictionary for bus in buses : if bus. iusage = = 0 : voltages [ bus. loc _ name ] = bus. getattribute ('m : u') return voltages | [
-0.5160336494445801,
-0.22486497461795807,
0.185845747590065,
0.6250571012496948,
-1.0461304187774658,
0.307927668094635,
-0.26552489399909973,
0.21231472492218018,
-0.06771000474691391,
0.07312608510255814,
-0.6240759491920471,
-0.5200203657150269,
-0.2663070559501648,
0.8437294363975525,... |
def test _ code _ idtoken _ token _ response ( self ) : response = self. _ auth _ request ('post ', self. data, is _ user _ authenticated = true ) self. assertin ('# ', response ['location'] ) self. assertin ('access _ token ', response ['location'] ) self. assertin ('id _ token ', response ['location'] ) self. asserti... | [
-0.14846225082874298,
-0.36111611127853394,
0.3404829204082489,
-0.6279115676879883,
0.5648995637893677,
0.2780066132545471,
-0.42750173807144165,
-0.0843016728758812,
0.56691974401474,
-1.2864444255828857,
-0.8057126998901367,
-0.062054965645074844,
-0.07871942967176437,
-0.78862375020980... |
def _ _ contextmenusaveall ( self ) : self. vm. saveeditorslist ( self. editors ) | [
-1.4668179750442505,
-0.6822949647903442,
0.3243870437145233,
0.021410180255770683,
0.34692132472991943,
-0.36892226338386536,
-0.5282748937606812,
0.9262218475341797,
0.2515200078487396,
0.7922523021697998,
-0.344112753868103,
-0.1024981439113617,
-0.7049998044967651,
0.768147349357605,
... |
def _ translateerror ( error, detail ='' ) : if ( isinstance ( error, int ) and error > = taskqueue _ service _ pb2. taskqueueserviceerror. datastore _ error ) : from google. appengine. api import datastore datastore _ exception = datastore. _ datastoreexceptionfromerrorcodeanddetail ( error - taskqueue _ service _ pb2... | [
-0.4080028533935547,
-0.10357585549354553,
0.4432768225669861,
-0.7108443975448608,
-0.7042974829673767,
-0.5172372460365295,
0.03276405483484268,
0.398664653301239,
0.7147875428199768,
-0.25984159111976624,
0.483269602060318,
0.03800223767757416,
0.3958820104598999,
-0.28695008158683777,
... |
def masked _ sigmoid _ cross _ entropy ( self, logits, labels, mask ) : labels = tf. cast ( labels, dtype = tf. float32 ) loss = tf. nn. sigmoid _ cross _ entropy _ with _ logits ( logits = logits, labels = labels ) loss = tf. reduce _ mean ( input _ tensor = loss, axis = 1 ) mask = tf. cast ( mask, dtype = tf. float32... | [
-0.8567596077919006,
-0.7412658929824829,
0.2358906865119934,
-0.010642590001225471,
0.0035510393790900707,
-0.02662765234708786,
0.26341283321380615,
-0.3675609827041626,
0.08935465663671494,
1.5023133754730225,
0.3583841919898987,
-0.022173797711730003,
-0.6127017140388489,
-1.3500508069... |
def setup ( self ) : self. plugincalls = [ ] self. pluginresults = [ ] self. originalfunction = reactors. getplugins reactors. getplugins = self. _ getplugins | [
0.030518071725964546,
-0.2999951243400574,
0.40297451615333557,
-0.35278818011283875,
1.366274356842041,
-1.837811827659607,
0.04011288657784462,
0.015888379886746407,
0.6203626990318298,
-0.20785245299339294,
-0.444540798664093,
0.7348430752754211,
-0.48442548513412476,
-0.472853869199752... |
def _ setup _ fixtures ( inlinetest _ item : inlinetestitem ) - > fixturerequest : def func ( ) - > none : pass inlinetest _ item. funcargs = { } # type : ignore [ attr - defined ] fm = inlinetest _ item. session. _ fixturemanager inlinetest _ item. _ fixtureinfo = fm. getfixtureinfo ( # type : ignore [ attr - defined ... | [
-0.5542846322059631,
-0.25379642844200134,
0.4033171534538269,
-0.46443819999694824,
0.6286595463752747,
-1.2938603162765503,
0.5819219350814819,
-0.30300602316856384,
0.7174192070960999,
-0.7237241864204407,
-0.3212190270423889,
0.2881127595901489,
0.15917278826236725,
-0.1012438833713531... |
def _ _ init _ _ ( self, vec = none, children = none, similarity = 0. 0, id = none ) : # for drawing picture of clusters self. children = children # feature vector self. vec = vec # id label for locating label self. id = id self. similarity = similarity | [
0.6821060180664062,
-0.1972329467535019,
0.4866066575050354,
0.6040209531784058,
0.18991364538669586,
0.6767787933349609,
0.6004069447517395,
0.11818622052669525,
0.2938745319843292,
-0.5997796058654785,
-0.7143166661262512,
0.3764173090457916,
-0.05520552396774292,
-0.057313475757837296,
... |
def _ add _ export _ visible ( self, buttons ) : try : for b in buttons : b. update ( {'exportoptions': {'columns':': visible'} } ) except attributeerror : buttons = [ {'extend': b,'exportoptions': {'columns':': visible'} } for b in buttons ] return buttons | [
-0.2767372727394104,
0.5215631127357483,
0.7769500017166138,
0.6621925830841064,
-0.48188623785972595,
0.07359307259321213,
-0.643202543258667,
-0.2656985819339752,
1.3563863039016724,
1.1159300804138184,
-1.3368271589279175,
-0.26203277707099915,
0.49213334918022156,
0.1813325583934784,
... |
def f ( x, alpha = 0. 5 ) : n _ particles = x. shape [ 0 ] j = [ f _ per _ particle ( x [ i ], alpha ) for i in range ( n _ particles ) ] return np. array ( j ) | [
-0.30055633187294006,
0.12954749166965485,
0.5717012882232666,
-0.29386982321739197,
-0.212358757853508,
-0.37206175923347473,
0.11463204026222229,
0.11930601298809052,
-0.35516974329948425,
0.21926075220108032,
-0.2969241440296173,
-0.4286946654319763,
-0.08793079853057861,
0.675575256347... |
def test _ single _ instance ( self ) - > none : id _ gen = self. _ create _ id _ generator ( ) async def _ get _ next _ async ( ) - > none : async with id _ gen. get _ next ( ) as stream _ id : self. _ insert _ row ( " master ", stream _ id ) self. get _ success ( _ get _ next _ async ( ) ) self. assertequal ( id _ ge... | [
-0.9523837566375732,
0.8498636484146118,
0.8235330581665039,
-0.5128933787345886,
0.5299645066261292,
0.038330163806676865,
0.7862372994422913,
0.4131506383419037,
-0.23362986743450165,
-0.18211254477500916,
-1.1804817914962769,
-0.6805019974708557,
-0.17039434611797333,
0.7209972739219666... |
def checkout ( self, dm, user, login ) : if login : try : dm. sleep ( 2 ) dm. confirm _ alert ( dm. click _ by, ( by. xpath, " / / div [ @ id ='shipping - existing'] / select / option [ 1 ] " ) ) dm. click _ by ( ( by. id, " button - payment - continue " ) ) dm. wait ( 15, ec. element _ to _ be _ clickable ( ( by. name... | [
-0.10807565599679947,
0.8121214509010315,
1.2750214338302612,
0.5722192525863647,
-0.12985438108444214,
-0.04231979697942734,
1.3542038202285767,
0.06228445842862129,
0.0631222128868103,
0.5317095518112183,
0.37547364830970764,
0.08216637372970581,
0.2898009717464447,
0.5603693127632141,
... |
def _ get _ data _ files ( self ) : pass | [
-0.5075170397758484,
-0.16073070466518402,
0.3627176284790039,
0.46245190501213074,
0.44363704323768616,
0.9541457295417786,
-0.2995251715183258,
0.022143268957734108,
-0.7877492904663086,
-0.7247845530509949,
-0.6818601489067078,
-0.08744081109762192,
0.31557998061180115,
0.07256663590669... |
def winbio _ winbioverifywithcallback ( jitter ) : ret _ ad, args = jitter. func _ args _ stdcall ( [ " sessionhandle ", " identity ", " subfactor ", " verifycallback ", " verifycallbackcontext " ] ) raise runtimeerror ('api not implemented') jitter. func _ ret _ stdcall ( ret _ ad, ret _ value ) | [
1.0997470617294312,
-0.3854215145111084,
0.40982386469841003,
1.393791675567627,
-0.16680924594402313,
0.6158966422080994,
0.5898940563201904,
-0.7871023416519165,
1.5664315223693848,
-0.23846668004989624,
-1.145509958267212,
-0.07858040928840637,
-1.08853280544281,
0.7630425095558167,
-... |
def toanttask ( self, doc ) : node = doc. createelementns ( " ", " delete " ) node. setattributens ( " ", " verbose ", " true " ) node. setattributens ( " ", " failonerror ", " false " ) if self. _ filename! = none : node. setattributens ( " ", " file ", self. _ filename ) elif self. _ dir! = none : node. setattributen... | [
0.4952908158302307,
-0.07299578189849854,
0.6904666423797607,
-0.9613944888114929,
-0.3746897578239441,
0.09949379414319992,
0.38160133361816406,
0.5703308582305908,
0.17870967090129852,
0.7002906799316406,
0.08017206192016602,
-0.21413633227348328,
0.9844920039176941,
-0.0166668351739645,... |
def gcd ( n1, n2 ) : assert isinstance ( n1, int ) and isinstance ( n2, int ) while true : u, v = n1, n2 while v! = 0 : r = u % v u = v v = r return u | [
-0.30105480551719666,
0.4113375246524811,
0.6210176348686218,
0.03265143185853958,
-0.17783114314079285,
0.980732798576355,
-0.17500340938568115,
-0.8977742195129395,
-0.5295146703720093,
-0.7701482176780701,
0.6808822751045227,
0.31823262572288513,
-0.8132423162460327,
0.38177162408828735... |
def get _ selected _ assets ( self ) : with preserve _ expanded _ rows ( self. view ) : with preserve _ selection ( self. view ) : self. clear ( ) nodes = commands. get _ selected _ nodes ( ) items = commands. create _ items _ from _ nodes ( nodes ) self. add _ items ( items ) | [
-0.5361079573631287,
0.3164723515510559,
0.4400838613510132,
-0.1228068470954895,
0.6791079044342041,
-0.29968971014022827,
0.6132921576499939,
-1.2065008878707886,
0.408037394285202,
-0.25218304991722107,
0.22940592467784882,
1.1425962448120117,
0.7311145663261414,
-0.5980878472328186,
... |
def path ( self, path ) : self. _ path = [ ] # reset for command in path. commands : typ = command [ 0 ] if typ = = " target " : pos = command [ 1 ] rot = command [ 2 ] inter = command [ 3 ] dur = command [ 4 ] self. _ path. append ( ('target ', pose ( pos, rot ), dur, self. linspeed _ curr, self. rotspeed _ curr ) ) e... | [
-0.3379668891429901,
-0.11449865251779556,
0.5920184254646301,
0.05704908072948456,
-0.19376987218856812,
0.23464606702327728,
0.9997135400772095,
-1.037867784500122,
-0.2762451767921448,
-0.7176581025123596,
-0.5237047672271729,
-0.10379305481910706,
-0.09078611433506012,
0.65803569555282... |
def test _ converter _ error ( ) : with pytest. raises ( typeerror ) as excinfo : distanceconverter ( ) assert ( " abstract methods from _ uniform _ parameter, to _ uniform _ parameter " in str ( excinfo. value ) ) | [
-0.4795082211494446,
-0.12237448990345001,
0.5171281099319458,
-0.14983220398426056,
0.48873159289360046,
1.3353132009506226,
0.11071180552244186,
-0.04916723445057869,
-0.333027720451355,
0.5881261229515076,
-0.22151324152946472,
-0.37644705176353455,
0.31624892354011536,
0.45124447345733... |
def gputhread ( gpucanvas, gputm, gpuam, gpuum, gputemp ) : if maingraph. gpu = = true : " " " for checking threads print ( speedlist ) for thread in threading. enumerate ( ) : print ( thread. name ) " " " try : gpucanvas. delete ( " all " ) drawgraphdetails ( gpucanvas, " gpu " ) gpus = gputil. getgpus ( ) gputm. conf... | [
0.2678465247154236,
0.35530927777290344,
1.0386525392532349,
0.64625084400177,
0.08311955630779266,
0.5932169556617737,
0.6765058040618896,
-0.14454951882362366,
-0.34741640090942383,
-0.2529638111591339,
0.9218980669975281,
0.5592696070671082,
-1.1817561388015747,
-0.021922864019870758,
... |
async def say ( self, text : str, voice _ id : str, * * kwargs ) - > bytes : with tempfile. namedtemporaryfile ( suffix = ". wav " ) as wav _ file : nanotts _ cmd = [ " nanotts ", " - v ", voice _ id, " - o ", shlex. quote ( wav _ file. name ) ] _ logger. debug ( nanotts _ cmd ) proc = await asyncio. create _ subproces... | [
0.35460174083709717,
0.39550870656967163,
0.5014698505401611,
-0.30904412269592285,
-0.5623525977134705,
0.026764702051877975,
-1.3793354034423828,
-1.1322433948516846,
-0.06198043003678322,
0.5135950446128845,
0.09276657551527023,
0.3002432584762573,
-0.8740181922912598,
0.210467532277107... |
def prepare ( before ) : @ decorator def f ( decorated, * args, * * kwargs ) : return decorated ( * before ( * args ), * * kwargs ) return f | [
-0.5869473218917847,
0.19888286292552948,
0.45494604110717773,
-0.6917038559913635,
-0.5134133696556091,
-0.7723667621612549,
-0.49780312180519104,
-0.3399358093738556,
0.9920527935028076,
-0.42683932185173035,
-0.05325406417250633,
0.5173866748809814,
0.44159042835235596,
-0.2477292418479... |
def get ( args, attr ) : if hasattr ( args, attr ) : return getattr ( args, attr ) return none | [
0.25433680415153503,
-0.5530148148536682,
0.38915833830833435,
-0.8512579798698425,
0.6842226386070251,
-1.2389723062515259,
-0.10870005190372467,
-0.7324968576431274,
-0.41517454385757446,
-0.11125107109546661,
1.289979338645935,
0.4163905382156372,
0.5362250208854675,
0.14661052823066711... |
def isinitialized ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.7164085507392883,
-0.6269298791885376,
0.42760196328163147,
0.9881442189216614,
0.9226600527763367,
-0.43560004234313965,
0.38856449723243713,
0.055270031094551086,
0.25732553005218506,
-0.5056865811347961,
-1.790268063545227,
0.09801199287176132,
0.01335933804512024,
0.9951023459434509... |
def get _ aggrement _ object ( request ) : all _ objects = aggrement. objects. all ( ) data = serializers. serialize ('json ', all _ objects ) data = json. dumps ( json. loads ( data ), indent = 4 ) response = httpresponse ( data, content _ type ='application / json') response ['content - disposition'] ='attachment ; f... | [
-0.8921723961830139,
-1.2585663795471191,
0.7932015657424927,
-0.49145686626434326,
-0.030298009514808655,
-0.21493284404277802,
0.4892915189266205,
-0.48017409443855286,
-0.5386199951171875,
0.7115277647972107,
0.24625948071479797,
0.16714972257614136,
0.5015038251876831,
0.06980705261230... |
def process _ gff _ file ( in _ file ) : handle = open ( in _ file ) outdict = { } outdict ['genes'] = { } for line in handle : if line. startswith ('#') : items = line. split ('' ) outdict ['genome'] = items [ 1 ]. strip ( ) outdict ['genome _ start'] = 0 outdict ['genome _ end'] = items [ - 1 ]. strip ( ) elif line. ... | [
0.4460035264492035,
-0.26015496253967285,
0.796480119228363,
-0.6753143668174744,
-0.9600655436515808,
-0.28469711542129517,
-0.19065554440021515,
-0.029254039749503136,
-1.7367907762527466,
0.2328965663909912,
-0.8942473530769348,
0.20639586448669434,
-0.05272969976067543,
0.2902934253215... |
def all _ commands ( self ) - > list [ str ] : return list ( documentation. load ( ). keys ( ) ) | [
-0.06061432883143425,
-0.5217745900154114,
0.41468673944473267,
1.1311973333358765,
0.4694676399230957,
-0.06192588433623314,
-0.9682555794715881,
0.2674190402030945,
0.9603457450866699,
-0.49362707138061523,
-0.11565311998128891,
0.13759635388851166,
0.4944861829280853,
1.453022837638855,... |
def _ _ init _ _ ( self, parent : frame ) - > none : super ( ). _ _ init _ _ ( parent ) # create a frame ( self ) self. canvas = canvas ( self, borderwidth = 0 ) # place canvas on self # place a frame on the canvas, this frame will hold the child widgets self. viewport = frame ( self. canvas ) # place a scrollbar on se... | [
1.5513641834259033,
0.37915515899658203,
1.1613714694976807,
0.21577852964401245,
-0.34850069880485535,
-0.3072824478149414,
0.15348920226097107,
-0.8400706052780151,
0.9401950836181641,
-1.0781450271606445,
-0.7660124897956848,
-0.16824032366275787,
-0.20407070219516754,
1.135988473892212... |
def draw _ point ( axis, point2d, color ) : axis. scatter ( point2d [ 0 ], point2d [ 1 ], c = color, marker ='o') | [
-0.10164199024438858,
-0.5856975317001343,
0.33296823501586914,
-0.06476983428001404,
-0.15266422927379608,
1.5693409442901611,
-0.8151096105575562,
0.10299692302942276,
-0.6263514757156372,
0.2579572796821594,
0.3082767724990845,
1.5170873403549194,
0.9691250920295715,
-0.9127165079116821... |
def build _ default _ model ( self, num _ classes : int, in _ channels : int, img _ sz : int ) - > fasterrcnn : backbone _ arch = self. get _ backbone _ str ( ) pretrained = self. pretrained weights ='default'if pretrained else none backbone = resnet _ fpn _ backbone ( backbone _ name = backbone _ arch, weights = weigh... | [
0.10858133435249329,
-0.06846699863672256,
0.6037942171096802,
0.10039623826742172,
0.6632645726203918,
-0.5621998906135559,
0.14317449927330017,
0.12570540606975555,
0.2563081681728363,
-0.728355884552002,
-0.12132785469293594,
-0.28060275316238403,
0.0751238614320755,
0.2726011276245117,... |
def _ act _ attempts ( self ) : puzzle _ state, move = self. _ current _ tree. return _ subtrees ( ) if len ( puzzle _ state ) = = 0 : return'you have never reached this state before. ', false else : for i in range ( len ( puzzle _ state ) ) : print ('you attempted... \ n'+ str ( puzzle _ state [ i ] ) + " \ nyour move... | [
-0.7635038495063782,
-0.2743225693702698,
0.5362950563430786,
-0.5518965721130371,
-0.06306902319192886,
-0.19869057834148407,
0.5462228655815125,
-0.6255120635032654,
-0.3519119620323181,
1.0307507514953613,
0.4642103314399719,
0.883396565914154,
-0.46463993191719055,
-0.00941353663802146... |
def reformat _ baseline _ clusters ( series ) : logging. info ('reformatting baseline clusters') result = pd. series ( list ( string. ascii _ uppercase ) ) [ series - 1 ] result. index = series. index return result | [
-1.152179479598999,
-0.530837893486023,
0.40805312991142273,
-0.5196531414985657,
0.22833740711212158,
0.1880827695131302,
0.30881038308143616,
-0.5511515736579895,
0.2654532492160797,
0.45883607864379883,
0.8882383108139038,
1.6638801097869873,
-0.9651579260826111,
-2.255979537963867,
0... |
def region _ of _ interest ( img, vertices ) : # defining a blank mask to start with mask = np. zeros _ like ( img ) # defining a 3 channel or 1 channel color to fill the mask with depending on the input image if len ( img. shape ) > 2 : channel _ count = img. shape [ 2 ] # i. e. 3 or 4 depending on your image ignore _... | [
0.5510501265525818,
0.0972198024392128,
0.693876326084137,
0.015424567274749279,
0.1953219622373581,
-0.1330060511827469,
0.2186986654996872,
-1.2591041326522827,
0.7947074770927429,
0.5667509436607361,
0.325950026512146,
0.9481536149978638,
-0.5278902649879456,
-1.1501884460449219,
-0.9... |
def append ( self, data ) : self. ptr. append ( data ) | [
-0.07539425045251846,
-0.02950971946120262,
0.11954786628484726,
-0.8351297378540039,
0.007250578608363867,
1.3464006185531616,
-1.0792218446731567,
-0.5569679141044617,
0.8509839773178101,
-0.7630099058151245,
-0.17812782526016235,
0.9936121106147766,
-0.7039085030555725,
0.80002665519714... |
def _ get _ motor ( self, command ) : motor = 1 if command = = self. command _ get _ a else 2 try : recv = self. _ read ( command, self. _ i2c _ read _ len ) except keyboardinterrupt as e : # pragma : no cover self. _ log. warning ( " keyboard interrupt, % s ", e ) raise e except ioerror as e : # pragma : no cover msg ... | [
0.06444945931434631,
-0.32308879494667053,
0.45267581939697266,
-0.1657719612121582,
-0.16207727789878845,
0.22673535346984863,
0.5353388786315918,
-0.15153998136520386,
-0.9388260245323181,
-0.5664434432983398,
0.7527256608009338,
0.6698895692825317,
-0.9604005217552185,
0.301840841770172... |
def pulsercal ( self, q ) : q. setdac ( 7, 1925 ) bias = q. getdac ( 7 ) q. pulseron ( ) thresh = [ ] pulse = [ ] for disc in ( 525, 550, 575, 600, 625, 650, 675, 700, 750, 800, 900, 1000 ) : q. setdac ( 9, disc ) time. sleep ( 0. 25 ) a, b = hunt ( q, 0, 1000 ) q. setdac ( pulser _ dac, a ) time. sleep ( 0. 25 ) c = q... | [
0.6687082648277283,
-0.18338917195796967,
0.7071031332015991,
-0.0879550501704216,
-0.06495918333530426,
0.705696702003479,
-0.06099388748407364,
-0.404969722032547,
0.017331918701529503,
-0.36454612016677856,
-0.3563089668750763,
0.7626646161079407,
-0.3074883222579956,
0.401562362909317,... |
def train _ gridsearch ( self, choice = 0, verbose = 0 ) : if choice = = 0 : parameters = {'max _ depth': range ( 4, 8, 1 ),'min _ samples _ split': range ( 25, 35, 1 ),'min _ samples _ leaf': range ( 2, 7, 1 ) } clf = gridsearchcv ( tree. decisiontreeclassifier ( criterion ='gini'), parameters, cv = 5 ) elif choice = ... | [
-0.46200239658355713,
0.7689126133918762,
0.8683793544769287,
0.4995298385620117,
1.038711667060852,
-0.01362988818436861,
0.6213090419769287,
-0.6251311898231506,
-0.6378183960914612,
0.12911373376846313,
-0.04121195152401924,
1.1717132329940796,
-0.39469775557518005,
0.573159396648407,
... |
def lp _ distance ( self, order ) : if isinstance ( order, str ) : if not order. lower ( ) = = " inf " : raise valueerror ( " only the infinity norm is supported " ) else : distance = metrics. linf _ distance ( self ) elif isinstance ( order, int ) and order! = 0 : distance = metrics. lp _ distance ( self, order ) retu... | [
0.06676813215017319,
-0.6010359525680542,
0.4678240418434143,
0.2257138043642044,
-0.5125897526741028,
0.5579219460487366,
-0.9398886561393738,
0.14275456964969635,
1.0509984493255615,
0.7012506127357483,
0.6453043222427368,
-0.10653224587440491,
-1.5151524543762207,
0.33436715602874756,
... |
def _ color _ warning ( string ) : return " \ u001b [ 33m " + string + " \ u001b [ 0m " | [
0.4660515785217285,
-0.33382803201675415,
0.5058076977729797,
-0.26970741152763367,
-0.40354683995246887,
0.5710914731025696,
-1.1963577270507812,
-0.564010739326477,
-0.16187386214733124,
0.4626293182373047,
0.6440814137458801,
1.0471817255020142,
0.0533752515912056,
-0.5087062120437622,
... |
def validate ( self, * args, * * kwargs ) - > none : if hasattr ( self. validator,'is _ valid') : self. _ vaa _ validation ( * args, * * kwargs ) else : self. _ simple _ validation ( * args, * * kwargs ) | [
-0.3863789439201355,
0.3343266546726227,
0.453383207321167,
0.6532021164894104,
0.3561481535434723,
0.22046533226966858,
0.0709436908364296,
0.1603052020072937,
0.2812561094760895,
-0.593311607837677,
0.7458435893058777,
-0.30468669533729553,
-0.012046118266880512,
0.7164350152015686,
-0... |
def _ set _ one _ proba _ fire _ season ( self, n _ ignitions, seed = 8 ) : np. random. seed ( seed ) proba _ fires = sparse. lil _ matrix ( np. zeros ( ( n _ ignitions, self. centroids. size ) ) ) for i in range ( n _ ignitions ) : if np. mod ( i, 10 ) = = 0 : logger. info ('created % s fires ', str ( i ) ) centr _ bu... | [
-0.5322454571723938,
-0.4753991961479187,
0.38764771819114685,
0.8498613834381104,
0.4369475543498993,
-0.3883155584335327,
0.12841205298900604,
0.4253107011318207,
0.8014302849769592,
0.1188473105430603,
0.579694926738739,
-0.20720042288303375,
-1.0350812673568726,
0.2756707966327667,
0... |
def _ connection _ lost ( self, link _ uri, msg ) : print ('connection to % s lost : % s'% ( link _ uri, msg ) ) | [
0.07220582664012909,
-0.8945375680923462,
0.4544258117675781,
-0.763716995716095,
0.7484686970710754,
-0.6019279360771179,
-0.4030882716178894,
0.03742944449186325,
-0.027435069903731346,
-1.4070041179656982,
0.9521654844284058,
0.6010473370552063,
-0.46632933616638184,
0.11385215818881989... |
def unmunge _ to _ mediafile ( self, in _ name, base _ name, suffix ) : # n. b. : we can ’ t use the downloadentry in here because the # normalizing processor may move the temp file because pysox # can ’ t handle mp3 files. ( another reason to get rid of pysox ) media _ path, media _ file _ name = free _ media _ name (... | [
0.32582026720046997,
-0.697118878364563,
0.527901291847229,
-0.4448678493499756,
-0.5508240461349487,
0.3197159171104431,
0.3862745761871338,
0.3263982832431793,
-0.042974069714546204,
0.24914202094078064,
-0.24401238560676575,
0.4962148368358612,
-0.776647686958313,
-0.12298717349767685,
... |
def partition _ datetime _ from _ path ( path, regex, format ) : if isinstance ( regex, basestring ) : regex = re. compile ( regex ) match = regex. search ( path ) if match : return datetime. datetime. strptime ( match. group ( 1 ), format ) else : logger. debug ('no path matching { 0 } was found in { 1 }. '. format ( ... | [
0.32461705803871155,
-0.5819451212882996,
0.6594997644424438,
-0.2621718645095825,
-0.6424946784973145,
-0.5048539042472839,
-0.3760016858577728,
0.5192196369171143,
-0.07134097069501877,
0.23430928587913513,
1.118840217590332,
-0.32928285002708435,
-0.4442889988422394,
-1.2287938594818115... |
def pad _ subtokens ( seq, pad _ symb ) : max _ len = max ( [ len ( elem ) for elem in seq ] ) seq = [ elem + [ pad _ symb ] * ( max _ len - len ( elem ) ) for elem in seq ] return seq | [
0.30693912506103516,
0.4060211479663849,
0.44480934739112854,
-0.06149137020111084,
-0.21625836193561554,
0.35414132475852966,
-0.44376617670059204,
0.9082424640655518,
0.5530579090118408,
0.4941435754299164,
-0.8759626746177673,
0.3828873336315155,
0.4287000596523285,
0.6031468510627747,
... |
def cchunkify ( lines, lang ='', limit = 2000 ) : if limit < 500 : raise valueerror ( f'minimal limit should be at least 500, got { limit! r }.') starter = f'` ` ` { lang }'limit = limit - len ( starter ) - 5 result = [ ] chunk _ ln = 0 chunk = [ starter ] for line in lines : while true : ln = len ( line ) + 1 if chunk... | [
0.17656530439853668,
0.04743485152721405,
0.920202374458313,
-0.12313252687454224,
-0.5274654626846313,
-1.0127947330474854,
-0.32655489444732666,
0.32674309611320496,
-0.6147738695144653,
0.5188928842544556,
-0.7249872088432312,
0.2990080714225769,
0.31883421540260315,
-0.246883362531662,... |
def ensure _ pil ( im : union [ image. image, np. ndarray ] ) - > image : return np2pil ( im ) if is _ np ( im ) else im | [
-0.02337591163814068,
0.230772465467453,
0.5418583750724792,
0.3397882580757141,
-0.14872461557388306,
0.6413601040840149,
-0.6500925421714783,
-1.2943520545959473,
1.5898535251617432,
1.017464280128479,
1.3345006704330444,
0.1589931696653366,
-0.09340845048427582,
-0.4863780438899994,
0... |
def shape ( self, template = none ) : is _ root = template is none if is _ root : if hasattr ( self,'_ shape') and self. _ shape is not none : return self. _ shape template = self. first ( ) if isinstance ( template, list ) : shape = [ self. shape ( item ) for item in template ] elif isinstance ( template, np. ndarray ... | [
-1.0147570371627808,
0.18240168690681458,
0.7504504919052124,
-0.04044682905077934,
-0.4238690137863159,
-0.54278165102005,
0.2775403559207916,
0.7780035138130188,
0.2179386019706726,
-0.3699410855770111,
-0.3487872779369354,
-0.7537372708320618,
0.006587301380932331,
0.5076808929443359,
... |
def test _ add _ tag ( self ) : with app. test _ client ( ) as client : d = { " name " : " tag2 " } resp = client. post ( f " / tags / new ", data = d, follow _ redirects = true ) html = resp. get _ data ( as _ text = true ) self. assertequal ( resp. status _ code, 200 ) self. assertin ('< span class = " badge badge - ... | [
0.2433900237083435,
0.8184205293655396,
0.5433737635612488,
0.24828897416591644,
1.316409707069397,
0.8737080693244934,
-0.6901265382766724,
-0.26857882738113403,
-0.3671347498893738,
-0.6159604787826538,
-0.5366623401641846,
0.32450732588768005,
0.35879606008529663,
0.9636675715446472,
... |
def _ _ init _ _ ( self, client, data, user _ id ) : self. user = create _ partial _ user ( user _ id ) self. type = relationshiptype. get ( data ['type'] ) client. relationships [ user _ id ] = self | [
0.17333370447158813,
-0.022628767415881157,
0.2552608549594879,
0.14946730434894562,
0.06736045330762863,
0.6051554679870605,
0.3166733980178833,
-0.6332418322563171,
0.6624224185943604,
-0.9700685739517212,
-0.4024532735347748,
0.3024488687515259,
-0.9136053323745728,
-0.08675917983055115... |
def to _ dict ( self ) : result = { } for attr, _ in six. iteritems ( self. swagger _ types ) : value = getattr ( self, attr ) if isinstance ( value, list ) : result [ attr ] = list ( map ( lambda x : x. to _ dict ( ) if hasattr ( x, " to _ dict " ) else x, value ) ) elif hasattr ( value, " to _ dict " ) : result [ att... | [
-0.9094414710998535,
-0.098284050822258,
0.8153085112571716,
-0.7851378917694092,
-0.7695807814598083,
-0.5765321254730225,
0.46994149684906006,
-0.6274848580360413,
-0.14983513951301575,
0.24656341969966888,
-0.8070284128189087,
-0.27363064885139465,
0.268658310174942,
0.8282499313354492,... |
def resource _ node ( element, resources ) : for attendee in resources : element. append ( t. attendee ( t. mailbox ( t. emailaddress ( attendee. email ) ) ) ) return element | [
-0.013843532651662827,
-0.2541821300983429,
0.41415202617645264,
-1.164059042930603,
-0.1468074917793274,
0.6654964089393616,
-0.5624740719795227,
0.6307975649833679,
0.8012463450431824,
0.9759194254875183,
0.5481247305870056,
0.4956282079219818,
0.532898485660553,
-0.6960335373878479,
-... |
def text ( self ) : return self. document. text | [
0.15269048511981964,
-0.744703471660614,
0.23999817669391632,
0.11681928485631943,
-0.8183007836341858,
0.5484209656715393,
0.18424564599990845,
-0.6162380576133728,
0.46428200602531433,
-0.06405160576105118,
0.19163016974925995,
0.0030755922198295593,
-0.8335332870483398,
-0.9579975605010... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.