text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def process _ all _ info ( trajs ) : enter _ time = [ ] finish _ time = [ ] job _ len = [ ] for traj in trajs : record _ len = len ( traj ['info']. record ) enter _ time. append ( np. array ( [ traj ['info']. record [ i ]. enter _ time for i in range ( record _ len ) ] ) ) finish _ time. append ( np. array ( [ traj ['i... | [
-0.1338168978691101,
-0.14812839031219482,
0.7617191076278687,
-1.1791136264801025,
0.47635534405708313,
-0.3878619372844696,
0.20737166702747345,
-0.08544636517763138,
-0.8233623504638672,
1.3650010824203491,
-0.43362441658973694,
-0.0611669160425663,
0.044516146183013916,
0.8781830072402... |
def get _ songs ( sp, username, playlist ) : track _ count = playlist ['tracks'] ['total'] songs = [ ] limit _ spotipy _ request = 100 for i in range ( ceil ( track _ count / limit _ spotipy _ request ) ) : # get the tracks from the playlist. # since spotipy has a limit on the number of tracks you can get per request. ... | [
-0.7435774207115173,
0.45558473467826843,
0.47403115034103394,
1.0355857610702515,
0.7523525953292847,
0.1256507784128189,
-0.7799331545829773,
-0.16137054562568665,
-0.2630755305290222,
0.3937074542045593,
0.08232139050960541,
-0.30718377232551575,
-0.8175622224807739,
-0.4737346470355987... |
def process _ media ( self, media ) : if media is none or media. handle in self. referenced [ " mediaobject " ] : return self. referenced [ " mediaobject " ]. add ( media. handle ) self. process _ citation _ ref _ list ( media ) self. process _ attributes ( media ) self. process _ notes ( media ) | [
0.03233487531542778,
-0.7167556285858154,
0.5047129392623901,
-0.11232230812311172,
1.0036952495574951,
0.33765700459480286,
0.6039502024650574,
-0.9467594623565674,
0.6888041496276855,
-0.6381903290748596,
0.15227214992046356,
0.04236563295125961,
-0.6550722718238831,
1.2933424711227417,
... |
def get _ close _ residues ( coordinates, protein, max _ distance, atom _ type ) : if atom _ type = = " donor " : atoms = [ a for a in protein. atoms if a. is _ acceptor ] elif atom _ type = = " acceptor " : atoms = [ a for a in protein. atoms if a. is _ donor ] else : print ( " unsupported interaction type in ligandfe... | [
-0.4738917052745819,
-0.6947157382965088,
0.7920776605606079,
-0.7637569308280945,
-0.23854008316993713,
0.741503119468689,
-1.1935714483261108,
-0.12338482588529587,
-0.3502075970172882,
0.9290853142738342,
0.24053917825222015,
0.23792311549186707,
-0.3455794155597687,
-0.3497183322906494... |
def thaipusam _ date ( self, year : int ) - > date : leap _ month = self. _ get _ leap _ month ( year ) return self. lunar _ to _ gre ( year, 1 if leap _ month < = 6 else 2, 1 ) + td ( days = - 15 ) | [
0.03778652846813202,
0.8830621242523193,
0.4915647506713867,
0.10625915229320526,
-0.5126936435699463,
0.7052261233329773,
-0.30482712388038635,
-0.4389646053314209,
0.6868404746055603,
0.3293702304363251,
0.5517466068267822,
-0.38390135765075684,
0.43893203139305115,
-0.008625715970993042... |
def test _ list _ decimal _ length _ 2 _ nistxml _ sv _ iv _ list _ decimal _ length _ 3 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / decimal / schema + instance / nistschema - sv - iv - list - decimal - length - 3. xsd ", instance = " nistdata / list / decimal / schem... | [
-0.0455452986061573,
-0.16657915711402893,
0.4760981798171997,
0.342013418674469,
0.03524088114500046,
0.17481034994125366,
-0.7284404039382935,
0.5195602178573608,
0.8324720859527588,
0.31726714968681335,
-1.1280595064163208,
-0.21677598357200623,
0.23903514444828033,
0.28265270590782166,... |
def render ( self, data : dict ) - > str : pass | [
-0.32919222116470337,
-0.32295775413513184,
0.2367166131734848,
-0.9035210609436035,
-0.6442601680755615,
0.4551039934158325,
-1.61142897605896,
0.3105778992176056,
0.08339348435401917,
-0.45820432901382446,
-0.07558268308639526,
-0.39604294300079346,
-0.22216002643108368,
-0.1303860694169... |
def _ _ analyse _ ir ( self ) : ir _ activations = self. _ _ ir _ sensors. get _ activations ( ) ir _ weight = self. _ _ compute _ ir _ weight ( ir _ activations ['current'] ) speed = self. _ _ compute _ general _ speed ( ir _ activations ['current'] ) if sum ( ir _ activations ['current'] ) = = 8 : self. _ _ set _ wan... | [
-0.3086996078491211,
0.008257522247731686,
0.474541574716568,
0.2516944706439972,
0.4816681742668152,
-0.35553666949272156,
1.0242877006530762,
-0.17629066109657288,
-0.47964951395988464,
0.12838752567768097,
0.722460925579071,
-0.12456042319536209,
-0.9114603996276855,
0.8195651769638062,... |
def test _ authentication _ required ( self ) : self. mock _ validator. authenticate _ client. return _ value = false self. mock _ validator. authenticate _ client _ id. return _ value = false self. request. code ='waffles'self. assertraises ( errors. invalidclienterror, self. auth. validate _ token _ request, self. re... | [
-1.0992145538330078,
0.8381397128105164,
0.275539368391037,
0.02891611121594906,
0.29748061299324036,
0.8861154913902283,
-0.019237710162997246,
-0.31433138251304626,
-0.009331213310360909,
-0.2931523323059082,
-0.7236858606338501,
0.4374288022518158,
-0.17503908276557922,
0.70234692096710... |
def _ objects _ to _ human _ segment _ message ( self, hx _ hsh, hx _ os, objects _ mask, direction : str, ho _ dists = none ) : hidden _ size = self. human _ segment _ rnn _ fcell. hidden _ size batch _ size, dtype, device = objects _ mask. size ( 0 ), objects _ mask. dtype, objects _ mask. device grab _ state _ fn = ... | [
-0.3361985981464386,
0.06741435825824738,
0.6867246031761169,
-0.19038842618465424,
0.7032420635223389,
-0.20941700041294098,
0.6747345328330994,
-0.7851119637489319,
-0.39041343331336975,
0.3232227861881256,
-0.26360270380973816,
0.3708219528198242,
0.8176600933074951,
0.03611474111676216... |
def react ( self, i ) : # empty input is skipped if i : print ('unrecognized command : ', repr ( i ) ) | [
-0.08212031424045563,
0.04076496139168739,
0.34195226430892944,
-0.20257174968719482,
0.5468701720237732,
0.4155977666378021,
1.3289812803268433,
0.017109164968132973,
0.9702655673027039,
-1.1833027601242065,
-0.6667575836181641,
0.21966218948364258,
-0.3052651882171631,
-0.662328064441680... |
def test _ d _ user _ dir ( self ) - > none : # unexisting directory type, on any system with self. assertraises ( keyerror ) : _ = user _ dir ('fake _ dir _ type ', app _ name ='fake _ app') with self. assertraises ( keyerror ) : _ = user _ dir ('fake _ dir _ type ', app _ name ='fake _ app ', ensure _ exists = true )... | [
-0.7758952379226685,
0.9744997620582581,
0.42581573128700256,
1.0009106397628784,
0.10279157012701035,
0.5188465714454651,
0.7143542170524597,
-0.5880172848701477,
0.1854168325662613,
-0.4039611220359802,
-0.5853967666625977,
-0.023793276399374008,
0.8789035677909851,
0.7155346870422363,
... |
def trigger _ cutover ( self ) - > optional [ str ] : return pulumi. get ( self, " trigger _ cutover " ) | [
0.7320886254310608,
-0.28323352336883545,
0.601012647151947,
0.32281923294067383,
0.23076365888118744,
0.8115043640136719,
0.5504069328308105,
0.0797264575958252,
0.5925260782241821,
0.4246513843536377,
-0.14294230937957764,
-0.04646993800997734,
0.28233444690704346,
-1.5336639881134033,
... |
def _ varimax _ reofs _ impl ( * arrays, n _ modes = none, n _ rotated _ modes = none, scale _ eofs = true, kaiser _ normalize = true, t0 = none, tol = 1e - 6, max _ iter = 500, center = true, bias = false, ddof = none, skipna = true ) : varimax _ gamma = 1. 0 n _ arrays = len ( arrays ) eofs _ results, pcs, lambdas, e... | [
-0.13260594010353088,
0.280103862285614,
0.8788138628005981,
-0.001161264954134822,
0.14662404358386993,
-1.1507666110992432,
0.4926393926143646,
0.2724376618862152,
-0.1299031674861908,
0.4008038640022278,
0.26508402824401855,
-0.07107558101415634,
0.8621103167533875,
-0.3493712246417999,... |
def save _ log ( message ) : logging. info ( message ) | [
0.245192751288414,
0.1392427235841751,
0.3341515362262726,
0.04667430371046066,
0.5970160365104675,
-0.0642969161272049,
-0.12675611674785614,
-0.47584328055381775,
-0.7896437048912048,
0.16376855969429016,
-1.1248681545257568,
-0.23304185271263123,
-0.33126235008239746,
1.000885248184204,... |
def test _ atomic _ hex _ binary _ max _ length _ 4 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ max _ length _ 5 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - maxlength - 5. xsd ", instance ... | [
-0.017953630536794662,
0.13734354078769684,
0.27146604657173157,
1.0617802143096924,
-0.43700361251831055,
0.3881113529205322,
-0.3619588613510132,
-0.1125943586230278,
-0.09782791882753372,
0.554795503616333,
-0.722344160079956,
-0.637588620185852,
-0.4719884991645813,
0.5552054047584534,... |
def calculate _ stats ( images ) : # flatten first since the images might not be the same size flat = np. concatenate ( [ img for img in images ] ) return np. mean ( flat ), np. std ( flat ), ( np. count _ nonzero ( flat ) * 100. 0 ) / flat. size | [
-0.5478952527046204,
0.3117498457431793,
0.32636702060699463,
-0.3827579617500305,
0.27079394459724426,
-0.11865126341581345,
0.5159327983856201,
-0.09878747165203094,
0.06520121544599533,
0.8136280179023743,
-0.01652219519019127,
-0.3326488137245178,
0.17048780620098114,
1.031911969184875... |
def moveto ( self, center ) : self. checker. moveto ( center ) | [
-0.43436136841773987,
-0.6528517007827759,
0.38719290494918823,
0.5604132413864136,
1.3197259902954102,
0.5711727142333984,
0.14748775959014893,
0.579795241355896,
-0.4792487919330597,
0.6343443989753723,
-0.26627421379089355,
0.7939054369926453,
-0.6504390835762024,
0.42586061358451843,
... |
def get _ positions ( self ) : url = " { 0 } / { 1 } / accounts / { 2 } / positions ". format ( self. domain, self. api _ version, self. account _ id ) try : return self. _ client _ _ call ( uri = url, method = " get " ) except requestexception : return false except assertionerror : return false | [
-1.1302834749221802,
0.7029708027839661,
0.4676075577735901,
0.057363636791706085,
1.2097276449203491,
0.004391636233776808,
-0.02446439117193222,
0.03156469389796257,
-0.30667972564697266,
0.1488884687423706,
-0.20272554457187653,
-0.39492878317832947,
-1.0466477870941162,
-0.401743382215... |
def code ( self, code ) : if code is none : raise valueerror ( " invalid value for ` code `, must not be ` none ` " ) self. _ code = code | [
0.032845985144376755,
0.917953610420227,
-0.04998946562409401,
0.13339245319366455,
0.7682590484619141,
0.13918454945087433,
0.22348573803901672,
0.8208032846450806,
0.3415539264678955,
0.09862907230854034,
-0.11781235039234161,
-0.5177974700927734,
-0.18064197897911072,
0.6474431753158569... |
def middleware _ distributed _ labeled _ abp ( filename, d, n, nodes _ list, cores, m _ out, l _ out, m _ in, l _ in, alpha, k ) : x, labels, queries, query _ labels = get _ dataset _ and _ queries _ from _ pickles ( filename ) d = len ( queries [ 0 ]. point ) n = len ( labels ) # execute parallel code. table _ log, qu... | [
0.5458216071128845,
-0.2434661090373993,
0.7188803553581238,
-0.555121898651123,
-0.030774975195527077,
0.5458716154098511,
-0.18632625043392181,
0.1949828714132309,
-0.15068137645721436,
0.7870562672615051,
1.1812615394592285,
0.7854517102241516,
-0.08441878855228424,
0.25326913595199585,... |
def _ _ init _ _ ( self, name ) : self. name = name | [
-0.2143441140651703,
-1.1978416442871094,
0.3842499554157257,
-0.4794149398803711,
-0.982975423336029,
0.22261899709701538,
-0.16782192885875702,
0.041316352784633636,
0.20781134068965912,
0.4006579518318176,
-1.3544188737869263,
-0.22119903564453125,
0.44346731901168823,
0.658432841300964... |
def _ _ init _ _ ( _ _ self _ _, *, role : optional [ pulumi. input [ str ] ] = none, token _ id : optional [ pulumi. input [ str ] ] = none ) : if role is not none : pulumi. set ( _ _ self _ _, " role ", role ) if token _ id is not none : pulumi. set ( _ _ self _ _, " token _ id ", token _ id ) | [
0.5112744569778442,
0.1775982826948166,
0.6034297347068787,
-0.7509481906890869,
1.0051860809326172,
-0.039072975516319275,
-1.1787002086639404,
0.5784209966659546,
0.5904594659805298,
-0.45068177580833435,
-0.9102510809898376,
1.1694161891937256,
0.7166427373886108,
-0.5657848715782166,
... |
def _ _ repr _ _ ( self ) : buffer = [ list ( map ( repr, [ " row _ id " ] + [ name for index, name, data _ type in self. _ _ columns ], ) ) ] width = [ 0 ] * len ( buffer [ 0 ] ) for row in sorted ( self. _ _ data _ area ) : buffer. append ( list ( map ( repr, [ row ] + [ self. _ _ data _ area [ row ] [ index ] for in... | [
-0.04032376408576965,
-0.47475293278694153,
1.0269715785980225,
-1.3269811868667603,
-0.8899842500686646,
0.4251159429550171,
-0.07742616534233093,
-0.3843183219432831,
-0.10702969878911972,
0.14479084312915802,
0.5792816281318665,
0.2233520746231079,
0.21847529709339142,
0.536702275276184... |
def greedy _ policy ( q _ values, valid _ actions : list ) - > th. tensor : for agent _ id in range ( q _ values. size ( 0 ) ) : inv _ actions _ agent = ~ valid _ actions [ agent _ id ] q _ values [ agent _ id, inv _ actions _ agent ] = float ('- inf') best _ actions = q _ values. argsort ( descending = true, dim = 1 )... | [
0.32754215598106384,
-0.30397841334342957,
0.46958455443382263,
0.34509819746017456,
0.733416736125946,
0.7839487791061401,
-0.01774960570037365,
-0.026444246992468834,
-0.06329052895307541,
-0.02178182080388069,
0.5100242495536804,
0.8776949048042297,
0.24709691107273102,
-0.4172024428844... |
def test _ example _ input _ one _ add _ frontend _ validation ( self, ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) : input _ page = inputpage ( ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) input _ page. create _ new _ input. select ( " example input one " ) input _ page. entity1... | [
-0.027013186365365982,
0.7411887049674988,
0.7955666184425354,
0.43583330512046814,
0.668774425983429,
0.8107044100761414,
0.4920857846736908,
-0.28798672556877136,
0.2526918649673462,
0.22463130950927734,
-0.6333942413330078,
0.029162917286157608,
0.3973180055618286,
0.3655957281589508,
... |
def upsample ( x, k ) : assert k > = 1,'k must be equal or greater than 1'mn = x. shape if len ( mn ) = = 2 : m = mn [ 0 ] n = mn [ 1 ] elif len ( mn ) = = 1 : m = 1 n = mn [ 0 ] else : raise valueerror ( " x is greater than 2d " ) nn = int ( n * k ) xt = np. linspace ( 1, n, n ) xp = np. linspace ( 1, n, nn ) return i... | [
-0.1642083078622818,
0.39358195662498474,
0.9337101578712463,
0.09086929261684418,
-1.2768595218658447,
0.09152626246213913,
-0.3718687891960144,
0.1318790167570114,
0.19541797041893005,
1.026961088180542,
-0.11725842952728271,
-0.22504675388336182,
-0.08082663267850876,
-0.642514765262603... |
def board _ x ( x ) : return ( win _ width - board _ size _ x * tile _ size ) + int ( x ) * tile _ size | [
-0.041223857551813126,
1.3813525438308716,
0.4926750957965851,
0.1742723435163498,
-0.6917273998260498,
0.4503321647644043,
-0.028791004791855812,
0.37722325325012207,
1.1822271347045898,
0.0001576885988470167,
-0.6440463066101074,
0.16599255800247192,
-0.325782835483551,
-0.05199320986866... |
def test _ atomic _ hex _ binary _ pattern _ 4 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ pattern _ 5 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - pattern - 5. xsd ", instance = " nistdata... | [
-0.2365574836730957,
0.03550214692950249,
0.502095103263855,
0.6606189012527466,
-0.2625977396965027,
0.47471773624420166,
-0.11410758644342422,
-0.2608414888381958,
-0.18310171365737915,
0.4027261734008789,
-0.8020318746566772,
-0.6289709210395813,
-0.6796755194664001,
0.27807730436325073... |
def datetime ( self, datetime = none ) : if datetime is none : buf = self. i2c. readfrom _ mem ( self. addr, datetime _ reg, 7 ) return ( self. _ bcd2dec ( buf [ 6 ] ) + 2000, # year self. _ bcd2dec ( buf [ 5 ] ), # month self. _ bcd2dec ( buf [ 4 ] ), # day self. _ bcd2dec ( buf [ 3 ] - self. weekday _ start ), # week... | [
-0.5201924443244934,
0.6198542714118958,
1.0153206586837769,
-0.4389205276966095,
-0.07172887027263641,
-0.453454852104187,
-0.15921109914779663,
-0.4282672107219696,
-0.2954363226890564,
0.08646998554468155,
-0.6246195435523987,
-0.36048102378845215,
-0.6845670342445374,
0.272312998771667... |
def arn ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " arn " ) | [
0.20569594204425812,
-0.7274563312530518,
0.34914469718933105,
0.6968464851379395,
1.3851077556610107,
0.5421022772789001,
0.34137770533561707,
1.0425776243209839,
0.8396877646446228,
-0.5267665386199951,
0.07459182292222977,
1.4436564445495605,
0.4793280065059662,
-0.8951220512390137,
0... |
def _ handle _ timeout ( self ) : # if a command is currently running, check for timeout condition if self. running _ cmd and self. running _ cmd. expiration and time. time ( ) > self. running _ cmd. expiration : self. _ set _ error ( anttimeouterror ( " no reply to command. % s " % self. running _ cmd ) ) | [
0.6432680487632751,
-0.5283257365226746,
0.4717797338962555,
-0.9357919692993164,
0.32320356369018555,
0.0566992312669754,
-0.6169400215148926,
0.22373199462890625,
-0.458598256111145,
0.5049651265144348,
1.5971322059631348,
-0.2235320657491684,
0.09359323233366013,
0.40903547406196594,
... |
def usage ( ) : print " weatherstation application - greg sharpe ( gds2 ) " print print " usage :. / weatherstation. py - d ( output the sensor information to the current window ) " print ". / weatherstation. py - e { endpoint } - r { rootca } - c { certification } - k { private key } " print ". / weatherstation. py - ... | [
-0.4980733096599579,
-0.8295237421989441,
0.7383787035942078,
-0.09005561470985413,
-0.10236654430627823,
0.528501570224762,
0.6663287281990051,
-0.7027202844619751,
-0.4680435061454773,
0.36153486371040344,
0.730904757976532,
0.7107131481170654,
0.12116453051567078,
1.123859167098999,
0... |
def selectvalues ( self, stream _ id, channel _ id ) : return self. cursor. execute ( ( " select * from top _ spam where channel _ id = { } and stream _ id = " + stream _ id + " order by spam _ occurrences desc, spam _ user _ count desc " ", spam _ text " ). format ( channel _ id ) ) | [
0.6979167461395264,
-0.689956784248352,
0.3523005247116089,
-0.7645216584205627,
0.07483213394880295,
-0.4469042420387268,
-1.4406216144561768,
0.03746815025806427,
0.06028691679239273,
-0.1576537936925888,
0.025552736595273018,
1.672131061553955,
-0.2805953621864319,
0.20280615985393524,
... |
def read _ cities _ file ( ) : cities = [ ] with open ( " biggest _ cities. txt ", " r ", encoding = " utf - 8 " ) as f : for line in f : line = line. strip ( ). split ( ) cities. append ( line ) return cities | [
0.2510664761066437,
-0.6705476641654968,
0.45595666766166687,
-0.6839805841445923,
0.3348611295223236,
1.3426541090011597,
-1.0776697397232056,
1.5456727743148804,
-0.8879855275154114,
0.3670368194580078,
-0.14116907119750977,
0.3566773235797882,
0.34404900670051575,
0.003628660226240754,
... |
def welcome ( ) : return ( f " available routes : < br / > " f " / api / v1. 0 / precipitation < br / > " f " / api / v1. 0 / stations < br / > " f " / api / v1. 0 / tobs < br / > " ) | [
-0.11379293352365494,
-0.4425366520881653,
0.6027988791465759,
-0.7072016000747681,
0.14313456416130066,
0.071650929749012,
-1.4189482927322388,
0.5065659880638123,
-0.5142765045166016,
0.8463065028190613,
-0.191148042678833,
0.5019242167472839,
0.39966046810150146,
0.547938883304596,
-0... |
def _ _ get _ role _ info ( self, roles, assertion ) : info _ file _ path = os. path. expanduser ( " ~ " ) + " /. okta - alias - info " info _ file = open ( info _ file _ path, " r " ) okta _ info = info _ file. read ( ) if okta _ info = = " " : okta _ info = { } else : okta _ info = json. loads ( okta _ info ) info _ ... | [
-0.3628803789615631,
-1.045167088508606,
0.7711166739463806,
-0.5454049110412598,
0.11786495894193649,
0.07464943081140518,
0.06852554529905319,
-0.594165563583374,
-0.5188761353492737,
0.332196444272995,
0.15016865730285645,
0.27358996868133545,
1.0055217742919922,
0.3754018247127533,
0... |
def datasetname ( self ) : if self. _ datasetname is none : raise notimplementederror ('must define _ datasetname property') return self. _ datasetname | [
-0.4273426830768585,
-0.2020544558763504,
0.42126405239105225,
-0.350577712059021,
-1.3411320447921753,
0.4992983639240265,
0.24192176759243011,
0.4178815186023712,
0.4107150733470917,
-0.5831268429756165,
0.4522477090358734,
0.8427148461341858,
0.8650128841400146,
-0.241299569606781,
-0... |
def test _ atomic _ id _ pattern _ 2 _ nistxml _ sv _ iv _ atomic _ id _ pattern _ 3 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / id / schema + instance / nistschema - sv - iv - atomic - id - pattern - 3. xsd ", instance = " nistdata / atomic / id / schema + instance... | [
-0.0399664007127285,
-0.08366957306861877,
0.5728883147239685,
0.890795886516571,
-0.29945337772369385,
0.8219665884971619,
-0.16833451390266418,
0.1465817093849182,
0.7142757773399353,
1.3578860759735107,
-0.05212489515542984,
0.4612114429473877,
0.1987166851758957,
-0.7222990393638611,
... |
def send _ reply ( self, activityrequestobject, result _ string, non _ reply = false ) : try : print ('activity request object ', activityrequestobject ) headers = self. get _ headers ('application / x - www - form - urlencoded') activityresponseobject = {'type':'message ','from': {'id': activityrequestobject ['recipie... | [
-1.0813602209091187,
-0.3854467570781708,
1.0133987665176392,
-0.13941751420497894,
-0.006499962881207466,
0.1620255559682846,
-0.22254648804664612,
-1.0000852346420288,
1.078392505645752,
0.8056989908218384,
-0.3893571197986603,
0.3816221356391907,
-1.3536708354949951,
-0.4232868850231170... |
def convert _ to _ solar _ system _ frame _ simple ( system, final _ height _ above _ surface, final _ upward _ speed, launch _ duration ) : # insert awesome code here... # you will probably also need these quantities : # const. au # const. day # const. yr # system. radii # system. initial _ positions # system. initial... | [
-0.4385022819042206,
-0.5427373051643372,
0.8470617532730103,
-0.12185145169496536,
-0.3838874101638794,
-0.008610871620476246,
-0.33452582359313965,
-0.3323707580566406,
0.058004893362522125,
0.030202103778719902,
-0.14102989435195923,
0.4272870421409607,
0.4046834707260132,
0.85070270299... |
def test _ atomic _ id _ enumeration _ 4 _ nistxml _ sv _ iv _ atomic _ id _ enumeration _ 5 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / id / schema + instance / nistschema - sv - iv - atomic - id - enumeration - 5. xsd ", instance = " nistdata / atomic / id / schem... | [
-0.22510819137096405,
-0.8908318281173706,
0.3498111963272095,
0.21941512823104858,
-0.35034701228141785,
-0.21700440347194672,
0.4816807508468628,
-0.8316888809204102,
-0.03082527220249176,
0.9260015487670898,
-0.5849698781967163,
0.0666886568069458,
-0.43817785382270813,
0.13000039756298... |
async def list _ products _ as _ end _ user _ with _ options _ async ( self, request : servicecatalog _ 20210901 _ models. listproductsasenduserrequest, runtime : util _ models. runtimeoptions, ) - > servicecatalog _ 20210901 _ models. listproductsasenduserresponse : utilclient. validate _ model ( request ) query = { }... | [
-1.9713765382766724,
0.351723313331604,
0.8191478848457336,
0.04216259345412254,
0.09217407554388046,
-0.22194646298885345,
-0.19773580133914948,
-1.350093126296997,
0.339624285697937,
0.9635317921638489,
-0.10868306457996368,
0.8776612281799316,
-0.13151521980762482,
0.4324202239513397,
... |
def ticket _ list ( request ) : tickets = ticket. objects. filter ( published _ date _ _ lte = timezone. now ( ) ) bugs = [ ] features = [ ] for ticket in tickets : if ticket. ticket _ type = ='b': bugs. append ( ticket ) else : features. append ( ticket ) def bugs _ srt ( bug ) : return bug. upvotes. count ( ) bugs. s... | [
0.33852919936180115,
-0.4788678288459778,
0.508095920085907,
0.47896164655685425,
0.08741080015897751,
0.01724991947412491,
-0.44882750511169434,
0.7905354499816895,
-0.2877497673034668,
-0.3221815824508667,
0.2376990020275116,
-0.36916226148605347,
0.45507094264030457,
0.9200314283370972,... |
def ground _ truth _ normalizer ( bc01, k, n, alpha, beta ) : def ground _ truth _ normalize _ row ( row, k, n, alpha, beta ) : assert row. ndim = = 1 out = np. zeros ( row. shape ) for i in range ( row. shape [ 0 ] ) : s = k tot = 0 for j in range ( max ( 0, i - n / / 2 ), min ( row. shape [ 0 ], i + n / / 2 + 1 ) ) :... | [
0.7898076176643372,
0.018725533038377762,
0.8064868450164795,
-0.4459201991558075,
-0.15020234882831573,
-0.028782133013010025,
0.6430445909500122,
0.4596489667892456,
-0.354602575302124,
0.9347208142280579,
-0.27298703789711,
-0.5541799068450928,
-0.5679783821105957,
0.5222154259681702,
... |
def get _ demand ( conn ) : # get all trips trips = pd. read _ sql _ query ( " select * from trip ; ", con = conn ) station _ info = pd. read _ sql _ query ( " select * from station ; ", con = conn ) # convert to date station _ info ['installation _ date'] = pd. to _ datetime ( station _ info ['installation _ date'] ) ... | [
-0.5674772262573242,
-0.04884703829884529,
0.8592691421508789,
-0.02029266394674778,
0.4706680476665497,
0.2965517044067383,
-0.5467212200164795,
0.21062502264976501,
-0.8395199179649353,
-0.12609368562698364,
-0.21637004613876343,
-0.21928557753562927,
1.041963815689087,
0.533531248569488... |
def api _ url _ for ( view _ name, _ absolute = false, _ xml = false, _ internal = false, * args, * * kwargs ) : renderer ='xmlrenderer'if _ xml else'jsonrenderer'url = url _ for ('{ 0 } _ _ { 1 } '. format ( renderer, view _ name ), * args, * * kwargs ) if _ absolute : # we do not use the url _ for's _ external kwarg ... | [
-0.9283277988433838,
0.855043351650238,
0.6544048190116882,
-0.32223424315452576,
-0.607661783695221,
-0.3466574549674988,
-0.4250124990940094,
-0.0350092351436615,
-0.0029068647418171167,
-0.6001017093658447,
0.4645063877105713,
0.012775177136063576,
0.4827349781990051,
0.6705528497695923... |
def validinput ( self, col ) : return ( ( col < self. col _ range ) & ( self. board [ 0 ] [ col ] = = 0 ) ) | [
-0.5324746966362,
-0.2121811807155609,
0.5177205801010132,
0.5387444496154785,
-0.5715848803520203,
1.3915417194366455,
0.30944308638572693,
-0.29393914341926575,
0.19226689636707306,
-0.04983280226588249,
0.13018785417079926,
-0.07233855873346329,
-0.5800529718399048,
0.09450051933526993,... |
def make _ move ( request, game _ id ) : game = get _ object _ or _ 404 ( game, pk = game _ id ) if'row'not in request. post or'column'not in request. post : # can't do anything if we don't know which cell was clicked. return render _ to _ response ( " game / _ board. html ", {'game': game } ) row, column = int ( reque... | [
-0.7671306133270264,
0.9069134593009949,
0.7776962518692017,
0.446588933467865,
-0.03799380734562874,
-0.5692294239997864,
0.011678025126457214,
-0.34170547127723694,
0.06964469701051712,
0.614829957485199,
0.6397989988327026,
-0.9417898058891296,
0.6423776149749756,
-0.07111861556768417,
... |
def test _ list _ integer _ length _ 3 _ nistxml _ sv _ iv _ list _ integer _ length _ 4 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / integer / schema + instance / nistschema - sv - iv - list - integer - length - 4. xsd ", instance = " nistdata / list / integer / schem... | [
-0.46163123846054077,
0.2048005312681198,
0.33772042393684387,
0.16785652935504913,
-0.16429241001605988,
0.08886786550283432,
-0.5529035329818726,
0.4328001141548157,
1.2555582523345947,
0.6803018450737,
-0.9412930011749268,
-0.7969462871551514,
-0.5963178277015686,
0.33378884196281433,
... |
def event _ receive ( self, event ) : if len ( event ) > 0 : type = event [ 0 ] # # determine if its an event we care about.... else : return | [
-0.06565899401903152,
-0.08459219336509705,
0.5967791676521301,
0.46307921409606934,
1.0569673776626587,
0.08992458879947662,
-0.248708114027977,
0.211888387799263,
0.9280478954315186,
-0.12261830270290375,
-0.23903518915176392,
0.590472936630249,
-0.43379974365234375,
0.7868669033050537,
... |
def get _ migration _ names ( app ) : if getattr ( settings, " south _ use _ pyc ", false ) : allowed _ extensions = ( ". pyc ", ". py " ) ignored _ files = ( " _ _ init _ _. pyc ", " _ _ init _ _. py " ) else : allowed _ extensions = ( ". py ", ) ignored _ files = ( " _ _ init _ _. py ", ) return sorted ( set ( [ os. ... | [
0.46217408776283264,
0.07903347909450531,
1.0102945566177368,
0.6332266926765442,
-0.6725624203681946,
0.592520534992218,
-0.19671441614627838,
-0.9532720446586609,
0.43930569291114807,
0.6822898387908936,
-0.2622232437133789,
0.2561185359954834,
0.5119727849960327,
0.4907681345939636,
0... |
def _ _ eq _ _ ( self, other ) : # type : ( object ) - > bool if not isinstance ( other, inskillproductsummary ) : return false return self. _ _ dict _ _ = = other. _ _ dict _ _ | [
-0.6653794050216675,
-0.2424604296684265,
0.8230624198913574,
0.2594008147716522,
0.15597417950630188,
0.7974986433982849,
0.310168594121933,
-1.2968095541000366,
1.4037232398986816,
0.630525529384613,
-0.5575664639472961,
0.5996472239494324,
0.4029273986816406,
-1.406103253364563,
-0.10... |
def main ( json _ file ) : json _ array = get _ json ( json _ file ) if not json _ array : print ('json file not specified') return print ('[ * ] importing analysis data from { } '. format ( json _ file ) ) import _ functions ( json _ array ['functions'], json _ array ['sections'] ) import _ function _ comments ( json ... | [
0.18234096467494965,
-0.43415185809135437,
0.9497857689857483,
-0.23462830483913422,
-0.2308994084596634,
0.7869552373886108,
0.9550400972366333,
-0.6284999251365662,
-0.3906131088733673,
0.6473420262336731,
-0.42577993869781494,
0.40056437253952026,
0.5324133634567261,
0.06192530691623688... |
def small _ hb _ to _ large _ hb ( self, small _ branch ) : small _ sw = self. _ small _ tt. branch _ endpoint ( - small _ branch ) click = self. small _ switch _ to _ click ( small _ sw ) total = self. paths _ left _ or _ right _ of _ click ( click, left ) for branch in self. _ small _ tt. outgoing _ branches ( small ... | [
0.3020264208316803,
0.19207189977169037,
0.9050295948982239,
-0.17607542872428894,
-0.5706833600997925,
0.041828613728284836,
0.9597458243370056,
0.03457626327872276,
0.8161831498146057,
0.1622164249420166,
-1.0464708805084229,
-0.5965887308120728,
-0.4556073248386383,
0.5127103328704834,
... |
def make _ flat ( elems, get, common = { } ) : # prepend the common part to all elements elems = [ { * * common, * * elem } for elem in elems ] # loop over all elements as long as the set is not flat while true : any _ flatten = false output = [ ] for elem in elems : flatten = false for k, vs in get ( elem ). items ( )... | [
-1.096214771270752,
-0.1643773466348648,
0.8252726197242737,
0.12049289047718048,
-0.28506046533584595,
0.1348816305398941,
0.22827625274658203,
0.03651685640215874,
-0.07203099876642227,
-0.09584183990955353,
0.6671419143676758,
-0.19243143498897552,
-0.8485865592956543,
-0.00374562945216... |
def findcircles ( img _ color, ccolor ='r ', bdebug = false, bfindsmall = false ) : if ( bdebug ) : brender = true ; else : brender = false ; img = cv2. cvtcolor ( img _ color, cv2. cv. cv _ bgr2gray ) ; if ( ccolor = ='g') : img = cv2. gaussianblur ( img, ( 3, 3 ), 5 ) ; else : if ( img. shape [ 1 ] < = 160 ) : img = ... | [
0.5488486886024475,
-0.06171279400587082,
1.0748696327209473,
0.03927919641137123,
0.5711408853530884,
-0.582281231880188,
0.5532941818237305,
-0.4136173725128174,
0.46736666560173035,
0.6002218127250671,
-0.3675893247127533,
0.25649702548980713,
-0.4937339127063751,
1.142199993133545,
0... |
def _ _ eq _ _ ( self, mtrx ) : if not isinstance ( mtrx, matrix ) : return false if not ( self. m = = mtrx. m and self. n = = mtrx. n ) : return false for i in range ( self. m ) : for j in range ( self. n ) : if self [ i, j ]! = mtrx [ i, j ] : return false return true | [
-0.8399110436439514,
-0.279121458530426,
0.44823604822158813,
-0.4232238531112671,
-0.12842752039432526,
0.30936259031295776,
0.040102768689394,
-0.5489625334739685,
0.5529677867889404,
-0.05737396329641342,
-0.7072353959083557,
-0.0653630718588829,
-1.0447813272476196,
0.02971578761935234... |
def get ( self, size = 1 ) : if self. ptrread + size > self. len : # no more data raise ioerror self. ptrread + = size data = self. buf [ self. ptrread - size : self. ptrread ] if ( self. ptrread > = self. len ) and ( self. ptrpush < 0 ) : # empty buffer self. empty ( ) return data | [
0.012163320556282997,
-0.005293617956340313,
0.929800808429718,
-0.3230990171432495,
-0.11661176383495331,
0.4345780313014984,
0.0382382906973362,
-1.4944169521331787,
-0.039799101650714874,
-1.194460391998291,
-0.00939273927360773,
0.6338024735450745,
-1.157971739768982,
-0.83359009027481... |
def skip _ upcoming _ action ( # pylint : disable = inconsistent - return - statements self, project _ name : str, dev _ box _ name : str, upcoming _ action _ id : str, user _ id : str = " me ", * * kwargs : any ) - > none : error _ map = { 401 : clientauthenticationerror, 404 : resourcenotfounderror, 409 : resourceexi... | [
-1.7853456735610962,
-0.3001268208026886,
0.6966137290000916,
0.1740996241569519,
-0.3850823640823364,
-0.06708133965730667,
0.4825272262096405,
-1.2909566164016724,
-0.16870173811912537,
-0.16997377574443817,
-0.05277454853057861,
1.2918779850006104,
0.252584844827652,
-0.4886664748191833... |
def arg _ parse ( ) : parser = argparse. argumentparser ( description = " yolo v3 video detection module " ) parser. add _ argument ( " - - video ", dest = " video ", help = " video to run detection upon ", default = " / home / fs / data / video _ for _ test _ reid / 192. 168. 123. 64 _ 01 _ 20190529141711976. mp4 ", t... | [
0.5983452200889587,
-0.3697987496852875,
0.9738346934318542,
-0.025976061820983887,
0.64252769947052,
0.26814568042755127,
-0.22183170914649963,
0.15684176981449127,
-0.24739345908164978,
-0.0376412533223629,
-0.5974786877632141,
-0.000790196645539254,
-0.6473910808563232,
0.69737786054611... |
def skipif ( condition, reason ) : if condition : return _ skipper ( reason ) return lambda x : x | [
-0.05401204898953438,
0.26135075092315674,
0.1818016767501831,
-0.33557385206222534,
-0.6129453778266907,
-0.1654142439365387,
0.3396565020084381,
-0.5012689828872681,
0.4161147177219391,
0.24889133870601654,
0.8320857882499695,
0.7629854083061218,
0.3594895303249359,
-0.9688068628311157,
... |
def test _ undirected _ edge _ set ( self ) : v0 = undirectedvertex ( val ='v0') v1 = undirectedvertex ( val ='v1') e01 = undirectededge ( ( v0, v1 ) ) e01. set ('weight ', 5 ) self. assertequal ( e01. attrs, {'weight': 5 } ) e01. set ( 0, 1 ) self. assertequal ( e01. attrs, {'weight': 5, 0 : 1 } ) | [
-0.45024043321609497,
-0.22890213131904602,
0.5216206908226013,
-0.4248204231262207,
-0.0683775395154953,
0.8412776589393616,
0.2428041398525238,
0.16461212933063507,
-0.5400775671005249,
-0.1379048079252243,
-0.048318833112716675,
-0.16250094771385193,
0.13733385503292084,
-0.007423142902... |
def test _ atomic _ hex _ binary _ length _ 1 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ length _ 2 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - length - 2. xsd ", instance = " nistdata / ... | [
0.08978628367185593,
-0.6708056926727295,
0.452845960855484,
0.7041818499565125,
-0.06291743367910385,
0.24008561670780182,
-0.31006309390068054,
0.2639896273612976,
-0.6741864085197449,
0.13625064492225647,
-0.7379104495048523,
-0.15421903133392334,
0.43804931640625,
0.9644554853439331,
... |
def distribute ( self, item ) : self. known _ items. add ( item ) self. fetched _ items. add ( item ) | [
-0.11454113572835922,
-0.2496771365404129,
0.47910553216934204,
0.14058269560337067,
1.4045257568359375,
1.3961578607559204,
-0.14400115609169006,
0.6793752908706665,
0.4932284951210022,
-0.16337254643440247,
-0.520189106464386,
-0.17596760392189026,
0.7535444498062134,
0.3949970304965973,... |
def flatreviewappend ( self, inputevent ) : if self. flatreviewcontext : clipboard = gtk. clipboard. get ( gdk. atom. intern ( " clipboard ", false ) ) clipboard. request _ text ( self. _ appendtoclipboard, self. currentreviewcontents ) self. presentmessage ( messages. flat _ review _ appended ) else : self. presentmes... | [
-0.7241950631141663,
-0.10197295248508453,
0.5156916379928589,
-0.14960449934005737,
-0.7901319861412048,
1.5357450246810913,
-0.6647577881813049,
0.1286848783493042,
0.4209422469139099,
0.033148203045129776,
1.1735718250274658,
-0.20045705139636993,
-0.9246032238006592,
0.7618361115455627... |
def update _ prop ( self, element _ id, path, value ) : return self. _ request ('put ','/ elements / { } / props '. format ( element _ id ), body = {'path': path,'value': value } ) | [
-0.7440381050109863,
-0.855527400970459,
0.4282648265361786,
0.18174375593662262,
-0.24296359717845917,
0.5090460777282715,
-0.44701504707336426,
-0.025096198543906212,
0.24368557333946228,
0.8639059662818909,
0.13589483499526978,
0.18504410982131958,
-1.061022400856018,
-1.087355494499206... |
def test _ item _ at _ location ( self ) : lvl = level ( 1, 10, 10, none ) lvl. add _ room ( 0, room ( pos ( 0, 0 ), pos ( 7, 7 ) ) ) assert lvl. items _ at ( pos ( 5, 5 ) ) = = [ ] gold = gold ( count = 10, pos = pos ( 5, 5 ), parent = lvl ) lvl. add _ item ( gold ) # gold is present at level at ( 5, 5 ) assert gold. ... | [
-0.10651548206806183,
-0.6708008646965027,
0.7176632881164551,
-0.8074621558189392,
1.00570547580719,
0.8756853342056274,
0.2428932934999466,
-0.36832720041275024,
-0.2066308706998825,
0.44629862904548645,
-1.3766368627548218,
0.005691375583410263,
-0.26086583733558655,
0.06128723174333572... |
def find _ nearest ( array, value ) : array = np. asarray ( array ) idx = ( np. abs ( array - value ) ). argmin ( ) return array [ idx ], idx | [
-0.6190863251686096,
-1.6727161407470703,
0.6541090607643127,
0.2423204630613327,
-1.4159725904464722,
0.11611231416463852,
-0.4507654905319214,
-0.6841804385185242,
0.004160741809755564,
0.9361127018928528,
0.5841243267059326,
0.6512235999107361,
0.3978138864040375,
1.156151294708252,
1... |
def set _ logging _ basic _ config ( main _ python _ file _ name : str, level : int = logging. info, format : str = " % ( asctime ) s - % ( name ) s - % ( levelname ) s - % ( message ) s ", log _ dir : optional [ str ] = none, ) : main _ python _ file _ name _ root = get _ file _ name _ root ( main _ python _ file _ na... | [
-0.0518934540450573,
-0.9047130346298218,
0.7906430959701538,
-0.3104389011859894,
-0.13834598660469055,
0.4240792393684387,
-0.5110445022583008,
0.4502392113208771,
-1.235769271850586,
-0.5630427598953247,
-0.17924846708774567,
0.21951214969158173,
0.454633891582489,
0.6516816020011902,
... |
def primary _ connection _ string ( self ) - > str : return pulumi. get ( self, " primary _ connection _ string " ) | [
0.536672055721283,
-0.880242109298706,
0.5301500558853149,
0.3248736560344696,
-0.009888154454529285,
0.7920892834663391,
-0.3646140694618225,
-0.41416135430336,
0.22024425864219666,
-0.4635581374168396,
1.2920461893081665,
0.4273999035358429,
-0.2459203600883484,
-1.179190754890442,
-1.... |
def pytorch _ dtype _ to _ type ( dtype ) : import torch _ type _ map = { torch. int8 : int [ 8 ], torch. int16 : int [ 16 ], torch. int32 : int [ 32 ], torch. int64 : int [ 64 ], torch. uint8 : uint [ 8 ], torch. float16 : float [ 16 ], torch. float32 : float [ 32 ], torch. float64 : float [ 64 ], torch. bool : bool, ... | [
-0.48266565799713135,
0.6510399580001831,
0.4985812306404114,
-0.2260206937789917,
-0.21672140061855316,
0.29678788781166077,
0.257018119096756,
-1.0882072448730469,
0.34230896830558777,
0.6046560406684875,
-1.1357142925262451,
0.002459011971950531,
0.13135641813278198,
-0.2381936162710189... |
def is _ bot _ owner ( user : union [ discord. member, discord. user ] ) : return user = = bot. owner | [
-0.1421555131673813,
0.2749267518520355,
0.155183807015419,
1.8399666547775269,
-0.3778722882270813,
0.7492577433586121,
-0.4873005449771881,
-0.5675916075706482,
0.06665884703397751,
-0.8563368916511536,
-0.2779647707939148,
0.777688205242157,
-0.22658638656139374,
-0.5918697714805603,
... |
def test _ bye ( name, expected ) : assert bye ( name ) = = expected | [
0.023305535316467285,
0.44684451818466187,
0.5500596165657043,
0.3224674463272095,
0.6039685010910034,
0.6489316821098328,
0.19930176436901093,
-0.04683803766965866,
-0.2133316844701767,
-0.7304751873016357,
-0.5483881235122681,
0.6288802027702332,
-0.5608941316604614,
-0.1972103714942932,... |
def setup _ platform ( hass, config, add _ devices, discovery _ info = none ) : va = visonicalarm ( hass, 1 ) # listener to handle fired events def handle _ event _ switch _ status ( event ) : _ logger. info ('alarm state panel received update event') if va is not none : va. doupdate ( ) hass. bus. listen ('alarm _ pan... | [
0.4481140971183777,
0.1264166533946991,
0.6493236422538757,
1.2396029233932495,
0.6052496433258057,
0.4212777018547058,
0.35752788186073303,
0.13747566938400269,
0.3798576593399048,
0.23117417097091675,
-0.025745699182152748,
-0.6795815825462341,
0.1559360772371292,
1.1470059156417847,
0... |
def demo ( device, circuit _ original, do _ measure, *, use _ qsim = false ) : print ('source circuit :') print ( circuit _ original ) print ( ) # construct a new quantum circuit respecting adonis'properties circuit _ transformed = device. map _ circuit ( circuit _ original ) print ('decomposed circuit :') print ( circ... | [
0.5398268699645996,
0.9453309774398804,
0.8649746775627136,
0.050218094140291214,
-0.24753324687480927,
-0.3099115490913391,
0.2656934857368469,
0.384558767080307,
0.49416884779930115,
-0.24329563975334167,
-0.37528350949287415,
0.48914527893066406,
-0.1590934842824936,
0.35873469710350037... |
def serialize ( self, obj ) : return self. _ serializer ( obj ) | [
-0.8680289387702942,
-0.32733336091041565,
0.18371932208538055,
0.013982078060507774,
-1.079160451889038,
0.1814364790916443,
0.3592415452003479,
-0.6931616067886353,
1.281257152557373,
-1.0097242593765259,
-1.5129961967468262,
-0.2685321271419525,
-0.30701547861099243,
-0.1241472214460372... |
async def on _ step ( self, iteration ) : await self. distribute _ workers ( ) await self. train _ probe ( ) | [
-0.16581439971923828,
0.7873653769493103,
0.22223126888275146,
0.5606134533882141,
1.1075931787490845,
0.5101971626281738,
0.8029419183731079,
0.1722462922334671,
-0.4609810709953308,
0.37078115344047546,
0.638016402721405,
-0.7312098145484924,
-0.13360409438610077,
0.2549479007720947,
-... |
def example _ event ( request ) : with open ( os. path. join ( base _ dir, ".. ", " test _ data ", " example _ event. json " ) ) as f : request. cls. example _ event = json. load ( f ) yield | [
0.1678481101989746,
-0.5915935635566711,
0.6941231489181519,
-0.6306845545768738,
0.02069011703133583,
0.32095497846603394,
-0.15149587392807007,
0.10197769105434418,
-0.13190849125385284,
0.3910782039165497,
-0.8251013159751892,
0.38941487669944763,
0.9268466234207153,
-0.4060307145118713... |
def testlistinstances ( self, mock _ gce _ api ) : instances = mock _ gce _ api. return _ value. instances. return _ value. aggregatedlist instances. return _ value. execute. return _ value = mock _ instances _ aggregated list _ instances = fake _ analysis _ project. compute. listinstances ( ) self. assertequal ( 1, le... | [
-0.9550894498825073,
1.0615419149398804,
0.3240995407104492,
-0.9400580525398254,
0.9216198325157166,
0.7524023652076721,
-0.13203047215938568,
0.2929481565952301,
0.5655975937843323,
0.610654354095459,
-0.44618862867355347,
-0.16026119887828827,
-0.5737725496292114,
0.34054505825042725,
... |
def get _ motif _ id _ to _ filename _ dict ( motifs _ dir : str, motifs _ list _ filename : str, motif _ md5 _ to _ motif _ id _ filename : optional [ str ] = none ) - > dict [ str, str ] : motif _ id _ to _ filename _ dict = dict ( ) motif _ md5 _ to _ motif _ id _ dict = dict ( ) motif _ id _ to _ motif _ md5 _ dict... | [
0.12917932868003845,
-0.596497654914856,
0.5411239862442017,
-0.9278098940849304,
-0.2650813162326813,
-0.34470251202583313,
0.5512533783912659,
0.19790463149547577,
-0.11336923390626907,
0.6318989396095276,
-0.7856024503707886,
0.1579718142747879,
0.06254909187555313,
0.26885664463043213,... |
def test _ list _ decimal _ length _ 3 _ nistxml _ sv _ iv _ list _ decimal _ length _ 4 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / decimal / schema + instance / nistschema - sv - iv - list - decimal - length - 4. xsd ", instance = " nistdata / list / decimal / schem... | [
0.025116633623838425,
-0.07037622481584549,
0.44570955634117126,
0.32499030232429504,
-0.034486543387174606,
-0.027145730331540108,
0.038834720849990845,
0.42448142170906067,
0.3240968585014343,
0.19428987801074982,
-1.560349464416504,
-0.9094305634498596,
-0.21940338611602783,
0.231550067... |
def listify ( object _ or _ list ) : if not isinstance ( object _ or _ list, ( list, tuple ) ) : object _ or _ list = [ object _ or _ list ] return object _ or _ list | [
-1.4589591026306152,
-0.06161359325051308,
0.606867790222168,
0.5366866588592529,
0.7846719622612,
0.36121413111686707,
-0.2948911786079407,
0.7115545868873596,
1.1050461530685425,
0.45453470945358276,
-0.6629459857940674,
0.22116157412528992,
-0.08661527931690216,
0.22200307250022888,
-... |
def shade _ meta ( ) : metas = [ ] for fhours in np. arange ( cfg. shade _ start _ hour, cfg. shade _ stop _ hour, cfg. shade _ interval _ hour ) : meta = { } meta ['hour'] = math. floor ( fhours ) meta ['minute'] = math. floor ( ( fhours - meta ['hour'] ) * 60 ) meta ['top'] = f'{ cfg. shade _ top _ prefix } { meta [ ... | [
-0.45669668912887573,
-0.05109092965722084,
0.8601264953613281,
-0.5470574498176575,
-0.2574821412563324,
-0.01809663698077202,
-1.165509819984436,
-0.6238966584205627,
-0.6757054924964905,
1.3053594827651978,
-0.57123863697052,
0.747000515460968,
1.354143500328064,
0.6141970157623291,
0... |
def get _ steam _ url ( self ) : attr = " title " # get self. title _ xx where xx is the default language, if any. # get self. title otherwise. return build _ steam _ url ( self. role, getattr ( self, attr, none ) or self. title ) | [
-0.39163726568222046,
0.6737242937088013,
0.6781935691833496,
0.2920060455799103,
0.368539422750473,
0.3204813003540039,
-0.4011130928993225,
-0.09044601768255234,
-0.8098704814910889,
-0.01763988845050335,
0.4762013256549835,
0.6127803921699524,
0.45807012915611267,
0.11299198120832443,
... |
def evaluate ( self, values : dict [ str, any ] ) - > any :... | [
-1.0078799724578857,
-0.03233220800757408,
0.08406423777341843,
-0.4913729429244995,
0.20577821135520935,
-0.019230013713240623,
-0.7914291620254517,
0.5182962417602539,
-0.738222062587738,
-0.716118335723877,
-0.6126807332038879,
-0.015022451058030128,
-0.017456093803048134,
0.93442577123... |
def convert ( self ) : return self. data | [
-0.7510722279548645,
-1.092888593673706,
0.37250861525535583,
-0.8783165216445923,
-0.19887809455394745,
0.9468614459037781,
-0.8484399914741516,
-0.6852810978889465,
0.6450958251953125,
-1.2439978122711182,
-0.42178019881248474,
0.8055175542831421,
-0.47735729813575745,
-0.471359074115753... |
def get _ saliency _ map ( self, step _ size = 8 ) : self. instance. computesaliency ( step _ size ) out _ m = self. instance. getsaliencymap ( ) return np. array ( out _ m ) | [
-0.6894019842147827,
-0.382763534784317,
0.3812020421028137,
0.8384493589401245,
0.01223723217844963,
-0.023826442658901215,
0.0790385827422142,
0.4907715618610382,
0.8687904477119446,
-0.1649084836244583,
-0.13705764710903168,
0.21908855438232422,
-0.16876175999641418,
-0.0198604930192232... |
def clearstatusregisters ( self ) : pass | [
-0.23609955608844757,
0.33459076285362244,
0.06872836500406265,
0.8937163352966309,
0.6658154129981995,
0.4456590712070465,
-0.08929643779993057,
0.9311941266059875,
0.08329489827156067,
0.2617241442203522,
-1.1500625610351562,
1.3109294176101685,
-0.46329620480537415,
1.041454792022705,
... |
def get _ table _ entry ( self, name ) : if name = ='creator': return self. creator elif name = ='file': return self. filename elif name = ='org': return self. organization elif name = ='observer': return self. observer elif name = ='operator': return self. operator else : return super ( ). get _ table _ entry ( name ) | [
-0.45480960607528687,
0.0245553869754076,
0.5869258046150208,
0.3972729444503784,
-0.5003894567489624,
-0.6355020999908447,
-0.26027682423591614,
-0.9506115913391113,
-0.752199113368988,
0.08780042082071304,
0.06272702664136887,
-0.06509266793727875,
0.20112009346485138,
0.5950859189033508... |
def brute _ force _ cow _ transport ( cows, limit = 10 ) : names = cows. keys ( ) # sorted ( cows. keys ( ), key = lambda key : key ) best _ partition = names for partition in get _ partitions ( names ) : for list _ of _ names in partition : sum _ of _ weights = 0 is _ bad _ partition = false for name in list _ of _ na... | [
-0.4741193652153015,
0.2798646092414856,
0.874997615814209,
0.1414465308189392,
-0.053691133856773376,
-0.44977834820747375,
-0.3722008168697357,
-1.0274714231491089,
-0.48369133472442627,
0.6502939462661743,
-0.5685778260231018,
-0.5363684296607971,
-0.3078266978263855,
0.0578334741294384... |
def args ( ) : parser = argparse. argumentparser ( ) parser. add _ argument ('- - env ', type = str, default = " cartpole - v1 ", help ='environment id') return parser. parse _ args ( ) | [
-0.2196093499660492,
-0.4905782639980316,
0.6108884811401367,
-0.7597752213478088,
0.9836938977241516,
0.3953458070755005,
-1.231086254119873,
0.34678593277931213,
-0.9201149344444275,
0.8158087134361267,
-0.15534232556819916,
0.16342908143997192,
-0.5397711396217346,
0.17951980233192444,
... |
def pitch _ and _ yaw ( num _ directions ) : if num _ directions = = 22 : # 3 rows of 7 plus one over head pitch _ angles = [ 60, 30, 0 ] yaw _ angles = [ - 90, - 60, - 30, 0, 30, 60, 90 ] if num _ directions = = 37 : # 4 rows of 9 plus one over head pitch _ angles = [ 60, 30, 0, - 15 ] yaw _ angles = [ - 120, - 90, - ... | [
-0.14667707681655884,
-0.3921356201171875,
0.570007860660553,
-0.21591924130916595,
-0.21990491449832916,
-0.19741448760032654,
0.8368339538574219,
0.2909115254878998,
0.9148638844490051,
0.8193221688270569,
0.12815169990062714,
0.37840536236763,
0.07651474326848984,
-0.10637753456830978,
... |
def advance _ step ( self, event _ data = none ) : if not self. active : self. start ( ) return if self. step _ duration is none and self. _ delay _ complete : self. _ step _ complete = true self. next _ step ( ) | [
0.3368281424045563,
0.02931966260075569,
0.7498748898506165,
0.9337405562400818,
-0.06817430257797241,
0.4628439247608185,
0.018413765355944633,
0.9723234176635742,
-0.6511342525482178,
-1.0801339149475098,
-0.2568523585796356,
-0.26852282881736755,
0.25605878233909607,
1.0609036684036255,... |
def load _ mask ( self, image _ id ) : info = self. image _ info [ image _ id ] mask _ path = info ['mask'] masks = [ ] orig _ mask = cv2. imread ( mask _ path, cv2. imread _ grayscale ) # resized _ mask = cv2. resize ( orig _ mask, ( self. w, self. h ) ) masks. append ( orig _ mask ) class _ id = 1 # self. map _ sourc... | [
-1.8205195665359497,
-0.6532021760940552,
0.6922090649604797,
-0.014497830532491207,
0.5119300484657288,
-0.01374891772866249,
0.19285759329795837,
-0.3065728545188904,
0.5536245107650757,
0.8595312833786011,
-0.27908632159233093,
0.18841776251792908,
0.5452010035514832,
0.730587899684906,... |
def switch _ covered ( old _ config, new _ config ) : covering = [ ] for r1 in old _ config : if not covered ( r1, new _ config ) : return false cover = covers ( r1, new _ config ) covering + = cover for r2 in new _ config : if not r2 in covering : return false return true | [
-0.10991460084915161,
-0.43098393082618713,
0.7606213688850403,
1.2318443059921265,
-0.6571592092514038,
0.7317946553230286,
-0.20007885992527008,
0.21344666182994843,
0.3612832725048065,
0.7878737449645996,
-0.8645879030227661,
-0.06846348941326141,
-0.09325152635574341,
0.670980930328369... |
def _ catch _ error ( err _ name : literal ['notfittederror ','thresholdnotinferrederror'] ) - > callable : error _ type = globals ( ) [ err _ name ] def decorate ( f ) : @ wraps ( f ) def applicator ( self, * args, * * kwargs ) : try : return f ( self, * args, * * kwargs ) except error _ type as err : raise error _ ty... | [
-0.46442389488220215,
-0.9054228067398071,
0.3893670439720154,
0.1285187304019928,
-1.0211268663406372,
0.27601733803749084,
-0.12308342754840851,
-0.4491123855113983,
0.5599188208580017,
0.42729634046554565,
0.3236487805843353,
0.3859994113445282,
0.8319093585014343,
1.1301424503326416,
... |
def cluster ( self, points ) : clustered = self. _ _ dbscan ( points ) splitted = self. _ _ split _ by _ cluster ( clustered ) return splitted | [
-0.5531406998634338,
1.0502912998199463,
0.3066479563713074,
1.4179810285568237,
0.5291672945022583,
-0.3147245943546295,
0.40006378293037415,
-0.3081189692020416,
0.9153119921684265,
0.28501254320144653,
-0.11661684513092041,
-0.02130427211523056,
-1.0320872068405151,
-0.23290129005908966... |
def is _ instructor ( self, user, course _ key ) : try : course = get _ course _ with _ access ( user, " load ", course _ key ) return bool ( has _ access ( user,'instructor ', course ) ) except exception : return false | [
-0.7475951910018921,
0.1177595928311348,
0.5702124238014221,
0.9762455224990845,
-0.4504798352718353,
0.04738355055451393,
-0.19897541403770447,
0.587825357913971,
-0.09065556526184082,
0.7886967658996582,
0.3967098891735077,
0.6865140199661255,
-0.702776312828064,
0.12340201437473297,
-... |
def test _ atomic _ language _ enumeration _ 3 _ nistxml _ sv _ iv _ atomic _ language _ enumeration _ 4 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / language / schema + instance / nistschema - sv - iv - atomic - language - enumeration - 4. xsd ", instance = " nistda... | [
-0.48616307973861694,
-0.5282365679740906,
0.4748009741306305,
0.6930074691772461,
-0.24106808006763458,
0.21753749251365662,
0.25480416417121887,
0.1310133934020996,
0.31295809149742126,
0.9332089424133301,
-0.15607430040836334,
-0.5095568895339966,
-0.022767389193177223,
-0.5012030005455... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.