text
stringlengths
25
2.19k
embedding
listlengths
768
768
def convert _ data _ type ( root _ dir _ dataset ) : image _ ids = next ( os. walk ( root _ dir _ dataset ) ) [ 1 ] for image _ id in image _ ids : data _ dir = os. path. join ( root _ dir _ dataset, image _ id, " images " ) image _ name = os. listdir ( data _ dir ) [ 0 ] image _ dir = os. path. join ( data _ dir, imag...
[ -0.7790809869766235, -0.4796934425830841, 0.7854236364364624, -0.006442951504141092, 0.5724833011627197, -0.5500572323799133, 0.278055340051651, 0.24765391647815704, 0.6584447026252747, 0.9731199741363525, 0.46870678663253784, 0.7518972754478455, 0.08268903195858002, 0.9551940560340881, ...
def indices ( cells : list [ cell ] ) - > list [ int ] : return [ cell. index for cell in cells ]
[ -1.132543683052063, 0.09059697389602661, 0.03551982343196869, 1.208678126335144, 0.08519440144300461, 0.2295704185962677, -0.18363739550113678, 1.1697391271591187, -0.24154624342918396, 0.6445856690406799, -0.7007712721824646, -0.6552667021751404, 0.2878986597061157, 0.3631707727909088, ...
def test _ basic ( self ) : called = [ ] class mocktest ( pyunit. testcase ) : def test _ foo ( test ) : called. append ( true ) test = mocktest ('test _ foo') result = reporter. testresult ( ) suite = runner. destructivetestsuite ( [ test ] ) self. assertequal ( called, [ ] ) suite. run ( result ) self. assertequal ( ...
[ -0.5756757855415344, 1.5258581638336182, 0.5329240560531616, 0.2187212109565735, 1.4028453826904297, 0.30213427543640137, -0.01764174923300743, 0.4138273596763611, 0.29314926266670227, -1.0621663331985474, -0.45192182064056396, -0.7424492239952087, -0.4181523323059082, 0.3004361391067505, ...
def remove _ le _ te _ transformations ( degen _ blade : dg. degengeom ) : transform _ inverse = degen _ blade. transmat. get _ inverse _ transform ( ) leading _ edge _ original = np. array ( degen _ blade. sticks [ 0 ]. le ) trailing _ edge _ original = np. array ( degen _ blade. sticks [ 0 ]. te ) leading _ edge _ ch...
[ 0.2228146642446518, -0.22474880516529083, 0.9289966821670532, -0.7852961421012878, 0.18961334228515625, 0.3260003328323364, 0.6594148278236389, 0.1030242070555687, -0.7065675854682922, 0.3350466191768646, -0.5740673542022705, -0.009848562069237232, 0.17592526972293854, -0.5018184185028076,...
def on _ opener _ state _ change ( self, change _ evt ) : if self. is _ disposed : raise objectdisposedexception ( " opener " ) _ t = threading. thread ( target = self. emit, name = event _ state _ changed, args = ( event _ state _ changed, change _ evt ) ) _ t. daemon = true _ t. start ( )
[ -0.31042414903640747, -0.7867336869239807, 0.4749870002269745, -0.4442821741104126, -0.05512871965765953, 0.38978642225265503, 0.2798547148704529, 0.9225596785545349, 0.4313947856426239, -0.5476928949356079, -0.366793692111969, 1.0166553258895874, 0.7014207243919373, 0.513972818851471, 0...
def get _ default _ addresses ( ) : return _ default _ addresses
[ -0.8655585050582886, 0.3423493206501007, 0.24025550484657288, 0.9881098866462708, 0.9059581756591797, -0.3236648738384247, 0.06873376667499542, -0.6098617911338806, 0.32122665643692017, -0.6244906187057495, -1.328931212425232, -0.2112814486026764, -0.906775176525116, -0.1096600741147995, ...
async def startup ( self ) - > none : for handler in self. on _ startup : if is _ async _ callable ( handler ) : await handler ( ) else : handler ( )
[ -0.05118006467819214, -0.15772469341754913, 0.44586944580078125, 1.9151091575622559, 0.861020028591156, -0.47152721881866455, -0.1578734666109085, 0.5540027022361755, 0.2612169086933136, -0.2342553287744522, -0.11971922963857651, 0.344946026802063, 0.2638055384159088, 1.1546911001205444, ...
def play ( piece, bpm ) : server = setup ( ) quarter = 60. 0 / bpm # set quarter note duration in seconds reference _ instrument = piece [ piece. keys ( ) [ 0 ] ] num _ notes = len ( reference _ instrument ) init _ vol = 0. 00001 attack = 0. 0000001 attack _ vol = 0. 21 decay = 0. 035 sustain _ vol = 0. 17 # sustain is...
[ 0.23711898922920227, 0.18387430906295776, 1.041955828666687, -0.2796005606651306, -0.049173496663570404, -0.37410905957221985, 1.181186556816101, -0.9890806674957275, 0.2489866018295288, 0.109948068857193, 0.12372510880231857, -0.11216150969266891, -0.6648929715156555, -0.10410915315151215...
def del _ field _ option ( self, field _ id, context _ id, option _ id, * * kwargs ) : # pylint : disable = unused - argument return self. _ raw _ execution ( path = f'/ field / { field _ id } / context / { context _ id } / option / { option _ id } ', method ='delete')
[ 0.12145469337701797, 0.19972094893455505, 0.2694162130355835, 0.28265270590782166, 0.6923837661743164, -0.29988008737564087, -0.21527792513370514, -0.056061238050460815, 0.6092454195022583, 0.4264625906944275, -0.0995945930480957, 0.3605712652206421, -0.6838122010231018, -0.821766436100006...
def is _ valid ( self ) : return ( self. item1. is _ available = = true and self. item2. is _ available = = true )
[ -0.8586820960044861, -1.128630518913269, 0.7208527326583862, 1.0223710536956787, -0.16076171398162842, 1.3489353656768799, -1.1221284866333008, 1.2307143211364746, -0.5406439900398254, 0.7872624397277832, -0.33293265104293823, -0.20891021192073822, -0.17810630798339844, -0.2160165458917617...
def setstate ( self, value ) : if self. curr _ state = = value : return self. curr _ state = value self. a. state = self. curr _ state # self. a. trigger ( )
[ -0.2193714827299118, -0.5143014788627625, 0.32917240262031555, 0.14358322322368622, -0.48199695348739624, 0.20993056893348694, 1.4240834712982178, -0.061119891703128815, 0.9068880081176758, -0.0543089434504509, -0.2757038176059723, -0.04618488997220993, -0.5661783814430237, 0.3384862542152...
def isvector _ or _ scalar ( a ) : try : return a. size and a. ndim - a. shape. count ( 1 ) < = 1 except : return false
[ -0.7679785490036011, 0.29957127571105957, 0.6459445953369141, 0.537385106086731, 0.0978153720498085, -0.10867945849895477, 0.6189757585525513, -0.1369059681892395, 1.4724887609481812, 0.12088523805141449, 0.6951978206634521, 0.7217099070549011, 0.24503012001514435, 1.4665191173553467, -0...
def update ( self, val, n = 1 ) : val = float ( val ) n = int ( n ) self. val = val self. sum + = val * n self. count + = n self. avg = self. sum / self. count
[ -0.45508208870887756, 0.7273089289665222, 0.316354364156723, 0.15837042033672333, -0.7077309489250183, 0.08640144020318985, 0.5797290205955505, -0.5508759021759033, -0.12028222531080246, 0.007633920293301344, -0.20165295898914337, -0.31495335698127747, 0.2980424463748932, 0.844484686851501...
def to _ ea _ dtypes ( dtypes ) : return [ getattr ( pd, dt + " dtype " ) for dt in dtypes ]
[ -1.5991333723068237, 0.809336245059967, 0.5919959545135498, -0.23431982100009918, 0.5062311887741089, -0.10048077255487442, -0.08933358639478683, -0.11326058954000473, 0.6673874258995056, 1.3634141683578491, -0.1652490496635437, 0.03634504973888397, 1.1564388275146484, 0.005354000255465507...
def plot _ prop _ vs _ prop ( xprops, yprops, snaps, bin _ nums = 50, labels = none, foutname ='prop _ vs _ prop. png ', std _ bars = true, style ='color - line ', include _ obs = true ) : # get plot stylization linewidths, colors, linestyles = plt _ set. setup _ plot _ style ( len ( snaps ), style = style ) # set up s...
[ 0.36275625228881836, 0.15272854268550873, 1.0770033597946167, 0.4829787313938141, 0.022146543487906456, 0.8356719613075256, 0.6436675190925598, -0.603425920009613, 0.11922197788953781, -0.5745683312416077, 0.6564071774482727, 0.2723376750946045, 0.5451146364212036, -0.22728067636489868, ...
def getcomponenttype ( cls ) : return'guide '
[ -0.25158822536468506, -0.010737864300608635, 0.5264113545417786, -0.10587860643863678, 1.1398065090179443, 0.9806582927703857, 0.9677243828773499, -0.05414626747369766, 0.5634855031967163, 0.3304253816604614, -0.7422437071800232, 0.1274043172597885, -0.37494170665740967, 0.6250441074371338...
def test _ cluster _ resizing ( self, resource _ group, location, storage _ account, storage _ account _ key ) : cluster = helpers. create _ cluster ( self. client, location, resource _ group. name, self. cluster _ name,'standard _ d1 ', 1, storage _ account. name, storage _ account _ key ) # verify that one node is al...
[ 0.07937338948249817, 0.94647616147995, 0.5909473896026611, 0.4610940217971802, 0.23832014203071594, 0.06503041833639145, 1.0642679929733276, 0.49876144528388977, 0.017624229192733765, 0.1612517237663269, 0.10640019923448563, 0.20768558979034424, 0.01630927436053753, -0.5256582498550415, ...
def gamesession _ property ( id ) : form = request. get _ json ( ) user = current _ user if form is none : return api _ error ( " invalid request " ) schema = {'user _ id': {'type':'integer ','required': true },'propertydef _ id': {'type':'integer ','required': true },'value': {'required': true } } v = validator ( sche...
[ -0.632676362991333, -0.9312423467636108, 0.8996791839599609, 0.02966511994600296, 0.22109051048755646, 0.33388417959213257, -0.2774479389190674, -0.6918540596961975, 0.4858444035053253, 0.48715561628341675, 0.06094294786453247, 0.22109848260879517, -0.4420722723007202, -0.9960699677467346,...
def download _ pom _ file ( self, mavenlib ) : if mavenlib in self. _ cache : return self. _ cache [ mavenlib ] result = { } for base _ url in self. _ base _ urls : try : url = base _ url +'/'+ mavenlib. relative _ pom _ path ( ) print ( textcolor. green ( " download pom % s " % url ) ) r = requests. get ( url ) if r. ...
[ -0.45299232006073, -0.1794436275959015, 0.5711802244186401, 0.08850056678056717, -0.7504957318305969, -0.14382778108119965, -0.8419864177703857, 0.19251400232315063, -0.8507114052772522, 0.01826159842312336, -1.0924991369247437, -1.1328729391098022, -1.0049806833267212, 0.57310950756073, ...
def getname ( self ) : if self. thebackingmachine! = none : return " failsafe ( " + self. thebackingmachine. _ _ name _ _ + " ) " return " failsafe ( null ) "
[ 0.6111435294151306, -0.1518872231245041, 0.7736539840698242, 0.48128825426101685, 0.2758844792842865, -0.32909753918647766, -0.6642120480537415, -1.0127264261245728, 0.2348267138004303, 0.2720124125480652, 0.5410328507423401, 0.24161769449710846, -0.26041120290756226, 0.05740077421069145, ...
def main ( ) : n = int ( input ( " enter a no. to check it is prime or not - " ) ) if prime ( n ) : print ( " given no. % s is a prime no. " % ( n ) ) else : print ( " given no. % s is not a prime no. " % ( n ) ) num1 = int ( input ( " enter starting point " ) ) num2 = int ( input ( " enter end point " ) ) prime _ rang...
[ -0.20795801281929016, 0.021113267168402672, 0.5540912747383118, 1.3751797676086426, -0.2860228419303894, 0.5818297863006592, 0.4321169853210449, -0.24983447790145874, -0.5321276783943176, -0.20227479934692383, -0.45660170912742615, 0.9157193899154663, -0.40163326263427734, 0.20910596847534...
def ensure _ paths ( ) : global cache _ path global profile _ path global root _ path if not root _ path : root _ path = os. path. abspath ( os. path. dirname ( sys. argv [ 0 ] ) ) if not profile _ path : # the profile path is a bit trickier than the root path, since it can # move depending on the portability flag. if ...
[ 0.4689690172672272, 0.691314697265625, 0.8700990676879883, 0.7412718534469604, 0.9836953282356262, 0.7720818519592285, 0.6454501152038574, -0.5909029841423035, -0.09198150783777237, -0.755691409111023, -0.3403611183166504, -0.5815719962120056, -0.20966945588588715, 0.2071315348148346, 0....
def solve ( constraints ) : solver = nonogram _ solver ( constraints ) dim0 = len ( constraints [ 0 ] ) dim1 = len ( constraints [ 1 ] ) # generate domains for each row of the nonogram for row in range ( dim0 ) : solver. clear _ all _ comb ( ) tidied _ constraint = [ ] for i in constraints [ 0 ] [ row ] : tidied _ cons...
[ -0.8121934533119202, 0.36732417345046997, 1.0987728834152222, 0.32725274562835693, 0.49188297986984253, -0.8798445463180542, 1.077184796333313, 0.021749058738350868, 0.041390884667634964, 0.5553580522537231, 0.09611739963293076, 0.09149062633514404, -0.2213241308927536, -0.0115387439727783...
def push ( self, x ) : self. a. append ( x )
[ -0.12081985175609589, 0.8957729339599609, 0.31504327058792114, -0.34852609038352966, -0.19254325330257416, 1.199061632156372, -0.695707380771637, -0.5398880243301392, 0.6526997685432434, -0.21237638592720032, -0.6117150783538818, 1.3093363046646118, 0.1117982268333435, 0.0781492218375206, ...
def onfootprintselected ( self, e ) : self. enable _ toolbar _ buttons ( self. footprint _ list. getselecteditemscount ( ) > 0 )
[ 0.23390249907970428, 0.08957662433385849, 0.3395085334777832, 0.7867833375930786, 0.7990278601646423, 0.28418129682540894, 0.6200157999992371, 0.16887855529785156, 0.5562357902526855, -0.1701807975769043, -0.3700931668281555, -0.10093677043914795, -0.3068971633911133, 0.39106836915016174, ...
def test _ show _ tags ( self ) : with app. test _ client ( ) as client : resp = client. get ( " / tags " ) html = resp. get _ data ( as _ text = true ) self. assertequal ( resp. status _ code, 200 ) self. assertin ('< h1 class = " display - 1 " > all tags < / h1 > ', html )
[ 0.8874436020851135, 1.0979944467544556, 0.4105016589164734, 0.5377100706100464, 0.45758795738220215, 0.5260508060455322, -0.6154254674911499, 0.4809674322605133, -0.698771059513092, -0.2254641205072403, 0.21092303097248077, 0.5573909878730774, 0.7126471400260925, 0.8863253593444824, -0.3...
def fiber _ analysis ( gt _ fiber, pred _ fiber, gt _ axon, pred _ axon, min _ area = 16, pixel _ size = 0. 11 ) : regions _ fiber _ pred = measure. regionprops ( pred _ fiber ) regions _ axon _ pred = measure. regionprops ( pred _ axon ) centroids = np. array ( [ list ( x. centroid ) for x in regions _ fiber _ pred ] ...
[ 0.5729799866676331, -0.6783409118652344, 0.6271191835403442, -0.014561617746949196, 0.06326187402009964, -0.029377564787864685, 0.39246299862861633, 0.9860904216766357, 0.04622979462146759, 0.1361200213432312, 0.7208297252655029, 0.7490793466567993, 0.41694310307502747, 0.45884913206100464...
def prefix _ lines _ with ( lines, prefix ) : prefixed _ text = [ ] for text in lines : text = prefix + text prefixed _ text. append ( text ) return prefixed _ text
[ 0.4672928750514984, -0.7689120769500732, 0.2320011705160141, -0.01590026542544365, -0.16208189725875854, -0.6517520546913147, -2.1483330726623535, 0.352692574262619, 1.0156480073928833, 0.6758453845977783, 0.5897960066795349, -0.13665534555912018, 0.6790075898170471, 0.929800808429718, -...
def report ( self ) : print ( " { : _ < 80 } ". format ( self ) ) for book in self. books. itervalues ( ) : book. report ( ) print ( " \ n " )
[ -0.4175076484680176, -0.5625147223472595, 0.40379858016967773, -0.03495876118540764, 0.7843307852745056, 0.9113693237304688, 0.9552308917045593, -0.19631190598011017, -1.2477549314498901, -0.5651724934577942, 0.5862180590629578, 0.2831836938858032, -0.13047562539577484, 1.4090385437011719,...
def issmdir ( ) : if not m. ispc ( ) : issm _ dir = os. environ ['issm _ dir'] else : issm _ dir = os. environ ['issm _ dir _ win'] if m. strcmpi ( issm _ dir [ - 1 ],'/') or m. strcmpi ( issm _ dir [ - 1 ],'\ \') : issm _ dir = issm _ dir [ : - 1 ] # shave off the last'/'if not issm _ dir : raise runtimeerror ( " issm...
[ 0.014592478983104229, -0.27716800570487976, 0.9197829365730286, -0.12592056393623352, -0.012280442751944065, 0.05982862412929535, 0.2730116546154022, -0.17477712035179138, 0.4495435953140259, -0.24421262741088867, 0.6376252174377441, 1.0993200540542603, -1.1822901964187622, 0.8764929771423...
async def stream ( self, ctx, *, url ) : async with ctx. typing ( ) : player = await ytdlsource. from _ url ( url, loop = self. bot. loop, stream = true ) ctx. voice _ client. play ( player, after = lambda e : print ('player error : % s'% e ) if e else none ) await ctx. send ('now playing : { } '. format ( player. titl...
[ -0.08517733961343765, 0.16491183638572693, 0.570111870765686, 0.1045912653207779, -0.3285946547985077, 0.8816699385643005, -0.03700772300362587, -0.16081549227237701, 0.319659024477005, -0.4118571877479553, -0.7836560010910034, 1.445953369140625, -0.5363512635231018, 0.2099994271993637, ...
def spectrum ( self, shape, surface _ point, bound ) : wavelengths = [ ] key = shape. surface _ identifier ( surface _ point ) if not self. store. has _ key ( key ) : return none entries = self. store [ key ] if len ( entries ) = = 0 : return none for entry in entries : if entry [ 2 ] = = bound : wavelengths. append ( ...
[ 0.9720556735992432, -0.9756382703781128, 0.5781927108764648, -0.13583000004291534, -0.11261679232120514, 0.030795613303780556, -0.37323009967803955, -0.36173197627067566, 0.17672909796237946, -0.6034596562385559, 0.7561816573143005, 0.8571228384971619, -0.30072805285453796, 0.6197700500488...
def titlify ( title : str ) - > str ( ) : prepositions = [ " and ", " or ", " the ", " a ", " of ", " in ", " at ", " is ", " to " ] return " ". join ( [ " % s " % word. lower ( ) if word in prepositions else " % s " % word. capitalize ( ) for word in str ( title ). lower ( ). split ( ) ] ) [ : - 1 ]
[ -0.10240563005208969, -0.6492525339126587, 0.6890591382980347, -0.6033213138580322, -0.683535635471344, -0.08395959436893463, -0.7736197113990784, -0.28463101387023926, 0.13048790395259857, 1.70687997341156, 0.30767080187797546, -0.06389576196670532, -0.15776002407073975, -0.58170372247695...
def get _ variables _ files _ count _ by _ status ( dataset _ id, variable = none ) : variables = { } c = sddb. conn. cursor ( ) if variable is none : c. execute ( " select variable, status, count ( * ) from file where dataset _ id =? group by variable, status ", ( dataset _ id, ) ) else : c. execute ( " select variabl...
[ 0.27281948924064636, -0.025370784103870392, 0.614414632320404, -0.9164808988571167, -0.4956292510032654, -0.8143949508666992, -0.24276138842105865, 0.42677316069602966, -0.5748687386512756, 0.31921643018722534, -0.27335062623023987, 0.019253069534897804, 0.19375035166740417, 0.995976626873...
def initialize ( self, description ) : self. gamedescription = description if attemptloadinginitialmachine ( ) : return gamerlogger. logerror ( " statemachine ", " failsafe machine : failed to load initial state machine. falling back... " ) if attemptloadingprovermachine ( ) : return gamerlogger. logerror ( " statemach...
[ -0.11216568201780319, 0.2505970895290375, 0.6011360883712769, 0.0989731103181839, 0.5307023525238037, 0.013548345305025578, -0.8719537854194641, -0.3487793803215027, -0.0403507761657238, -0.1102776899933815, 0.17327332496643066, 0.495892196893692, -0.3662634789943695, 0.46248555183410645, ...
def validate _ passcode _ change ( self ) : if len ( self. cump ) > 3 : for symbol in self. cump : if not signal _ is _ digit ( symbol ) : self. led. flash _ all _ leds ( 0. 5 ) return false self. led. logged _ in ( ) return true self. led. flash _ all _ leds ( 0. 5 ) return false
[ -0.005172471981495619, 0.19380946457386017, 0.6939468383789062, 1.0240920782089233, -0.12169840186834335, 0.5205293893814087, 0.9417715072631836, -0.014735190197825432, 0.3765956461429596, 0.5857359766960144, -0.27368324995040894, -0.19484297931194305, -0.8395708203315735, 1.32124781608581...
def exif _ transpose ( image ) : exif = image. getexif ( ) orientation = exif. get ( 0x0112 ) method = { 2 : image. flip _ left _ right, 3 : image. rotate _ 180, 4 : image. flip _ top _ bottom, 5 : image. transpose, 6 : image. rotate _ 270, 7 : image. transverse, 8 : image. rotate _ 90, }. get ( orientation ) if method...
[ -0.3774184584617615, 0.4675849378108978, 0.753340482711792, -0.2995380163192749, 0.24359844624996185, -1.0039453506469727, 0.4226529002189636, -0.326466828584671, 0.29418882727622986, 1.1256186962127686, -0.40605947375297546, -1.2441613674163818, -0.39376363158226013, 0.08383040875196457, ...
def get _ action _ list ( comp _ id ) : action _ list = [ ] # query ='select * from component where comp _ name like " { 0 } " '. format ( comp _ name ) # result = autodb. select _ one _ record ( query ) # comp _ id = result [ 0 ] ['comp _ id'] query ='select * from testcasemanage _ actiongroup where acgr _ comp _ id =...
[ 0.006485927850008011, -0.8223603963851929, 0.6217943429946899, 0.3045211434364319, 0.8808239102363586, -0.46776795387268066, 0.5612623691558838, -0.0345657616853714, 0.3950789272785187, 0.7438492178916931, 0.08883536607027054, 0.486613005399704, -0.20538312196731567, 0.7847039699554443, ...
def match _ patterns ( seqs, patterns ) : import regex as re import pandas as pd arr, unmatched = [ ], [ ] for row in zip ( * seqs ) : matches = [ re. findall ( p, s ) for p, s in zip ( patterns, row ) ] if all ( matches ) : arr + = [ sum ( [ m [ 0 ] for m in matches ], tuple ( ) ) ] else : unmatched + = [ row ] return...
[ -0.3175199627876282, -0.2520887851715088, 0.6112043261528015, 0.23462238907814026, 0.07064307481050491, -0.5167528390884399, 0.6320131421089172, 1.0907686948776245, 0.5853347778320312, 0.34603744745254517, 0.23396384716033936, -0.7593938708305359, -0.0766839012503624, 0.016196973621845245,...
def _ _ init _ _ ( self, * args, * * kwargs ) : super ( matplotlibviewer, self ). _ _ init _ _ ( * args, * * kwargs ) self. subplots _ adjust ( left = 0. 25, bottom = 0. 25 ) self. viewer = self. add _ axes ( [ 0. 25, 0. 25, 0. 7, 0. 7 ] )
[ 1.4644688367843628, 0.1500162035226822, 0.6093393564224243, 0.47056618332862854, -0.5887531638145447, 0.7637211680412292, 0.9278755784034729, 0.10861188173294067, -0.4224693775177002, -1.0826095342636108, -0.3759572505950928, 0.2261514812707901, -0.18500670790672302, 0.6635002493858337, ...
def width ( self ) : return self. _ width
[ -0.5201842188835144, -0.08111049979925156, 0.28176477551460266, 0.9172930121421814, 0.575699508190155, 0.7670711874961853, 1.0797585248947144, 0.1447293758392334, 0.9660181403160095, -1.967265248298645, -0.08800491690635681, 0.12179803848266602, 0.0013701048446819186, -0.2807013690471649, ...
def _ service _ dict _ from _ mongo _ item ( mongo _ item ) : mappings = [ ('last _ chk ','last _ check ', int ), ('last _ state _ change ','last _ state _ change ', float ), ('output ','plugin _ output ', str ), ('problem _ has _ been _ acknowledged ','acknowledged ', bool ), ] for field in mappings : value = mongo _ ...
[ -0.25404825806617737, -0.12271487712860107, 0.2379436194896698, -0.42323440313339233, -0.8602129817008972, -0.32333049178123474, 0.027484320104122162, -0.3379020690917969, 0.23192459344863892, 0.6098968386650085, -0.2154894918203354, -0.12139701843261719, -0.5603041052818298, 0.00754945818...
def _ _ init _ _ ( self, n ) : # we don't care about the board state, only care about the result self. size = n self. rows = [ 0 ] * n self. cols = [ 0 ] * n self. diagnal = 0 self. antidiagnal = 0
[ -0.4029933214187622, 0.7850642204284668, 0.3245047330856323, 0.22614510357379913, 0.2423860877752304, -0.45357558131217957, 0.26916128396987915, -0.2664106488227844, 1.059286117553711, -0.8674962520599365, -1.3164335489273071, -0.7637546062469482, -0.1762986183166504, 1.4783469438552856, ...
def dual _ cross _ val _ score ( estimator1, estimator2, x, y, score _ func, train, test, verbose, ratio ) : estimator1. fit ( x [ train ], y [ train ] ) estimator2. fit ( x [ train ], y [ train ] ) guess = ratio * estimator1. predict ( x [ test ] ) + ( 1 - ratio ) * \ estimator2. predict ( x [ test ] ) guess [ guess <...
[ -0.32338646054267883, -0.16320540010929108, 0.6550382971763611, 1.602547287940979, -0.18646757304668427, 0.03904009610414505, 0.29540491104125977, -0.2715652287006378, -0.6759085655212402, 0.6351475715637207, 0.4292483329772949, 0.6122378706932068, 0.5832393765449524, 0.101407490670681, ...
def discover _ channels ( path, serial _ number, callback, cancellation _ token, channel _ termination _ token, logger ) : try : dest _ addr =': '. join ( path. split ( " : " ) [ : - 1 ] ) dest _ port = int ( path. split ( " : " ) [ - 1 ] ) except ( valueerror, indexerror ) : raise exception ('" { } " is not a valid ud...
[ 0.1435217559337616, 0.19537794589996338, 0.6990737915039062, -0.2992136776447296, -0.036407116800546646, -1.207637906074524, -0.22185733914375305, -0.2880808115005493, 0.3435385823249817, -0.746673583984375, 0.2878269553184509, 0.3292505443096161, 0.5350227355957031, -0.7618536949157715, ...
def dgm _ statfeat ( dgm ) : # dgm = d. diagram ( [ ( 2, 3 ), ( 3, 4 ) ] ) diag = dgm2diag ( dgm ) birthtime = [ p [ 0 ] for p in diag ] deathtime = [ p [ 1 ] for p in diag ] lifetime = [ abs ( p [ 1 ] - p [ 0 ] ) for p in diag ] feat = np. concatenate ( ( statfeat ( birthtime ), statfeat ( deathtime ), statfeat ( life...
[ -0.7053245902061462, 0.1851816326379776, 0.5592252016067505, 0.263845294713974, 0.3055332899093628, -0.5057969093322754, 0.3841509222984314, -0.0028498447500169277, 0.2520263195037842, 0.07221633195877075, -0.6190804839134216, 0.14882750809192657, 0.6728923916816711, 0.1135837584733963, ...
def get _ user _ games ( self, request ) : user = user. query ( user. name = = request. user _ name ). get ( ) if not user : raise endpoints. notfoundexception ('a user with that name does not exist!') games = game. query ( game. user = = user. key ). filter ( game. game _ over = = false ) return gameforms ( items = [ ...
[ -0.7383388876914978, 0.49000105261802673, 0.7567598223686218, 0.3063008487224579, -0.21698275208473206, 0.1492815464735031, -0.7016617059707642, -1.3667278289794922, -0.5260161757469177, 1.213568925857544, -0.4386381208896637, -0.5561228394508362, 0.08707122504711151, -0.5722187161445618, ...
def place _ in _ standings ( standings, team ) : standings _ count = len ( standings ) # upper bound for i in range ( standings _ count ) : if team ['points'] > = standings [ i ] ['points'] : standings. insert ( i, team ) break elif i = = standings _ count - 1 : standings. append ( team ) # last place team else : conti...
[ 0.37960484623908997, -0.049765657633543015, 0.5014784336090088, 0.5660542845726013, 0.08079269528388977, 0.44253310561180115, -0.8039106726646423, -0.04064710810780525, -0.2846580743789673, 0.9800508618354797, -0.06524825841188431, -0.1870107650756836, -0.06929882615804672, -1.276402831077...
def gen ( self, model : basemodel, tknzr : basetknzr, txt : str ) - > str : # get model running device. device = next ( model. parameters ( ) ). device # encode as 1 sequence batch. # we convert token ids to tensor and move tensor to the same running device as model. # shape : ( 1, s ). batch _ cur _ tkids = torch. lon...
[ -0.08032753318548203, -0.01630971021950245, 0.7898603677749634, 0.17471857368946075, -1.2587323188781738, 0.20796553790569305, 0.7135235071182251, 0.3747716248035431, -0.6267173886299133, 0.7633928060531616, -0.3849257230758667, 0.024102337658405304, 0.38113245368003845, 0.3139339089393616...
def serialize ( self ) : return {'name': self. name,'id': self. region _ id, }
[ -0.15848112106323242, -1.6027358770370483, 0.268050879240036, -1.5176541805267334, -1.054122805595398, -0.08550602942705154, -0.8265973329544067, -0.3962275981903076, 0.038546983152627945, -0.174128457903862, -1.789541244506836, 0.24163517355918884, -0.24222949147224426, 0.0894360914826393...
def read6reg _ fake ( self, x _ low, registerz = 6 ) : max = ( 2 * * 10 ) / 2 return [ int ( random. gauss ( 0, max / 3 ) ) for _ in range ( registerz ) ]
[ -0.6162462830543518, 0.3161085247993469, 0.35933834314346313, 0.32457613945007324, 0.03218545764684677, -0.7249494791030884, -0.1972724199295044, 0.5121959447860718, 0.7668682336807251, -0.0729491263628006, -0.9903232455253601, 0.4979529082775116, -0.727914035320282, -0.3126790523529053, ...
def test _ blocked _ ip _ with _ external _ ip ( self ) - > none : # hardcode the url resolving to the ip we want. self. lookups [ " example. com " ] = [ ( ipv4address, " 1. 1. 1. 2 " ), ( ipv4address, " 10. 1. 2. 3 " ), ] channel = self. make _ request ( " get ", " preview _ url? url = http : / / example. com ", short...
[ -0.6844292879104614, 1.4436743259429932, 0.518132209777832, 0.377567321062088, -0.36635997891426086, -0.3292720317840576, -0.8128557801246643, 0.02405540645122528, 0.15964064002037048, -0.3710176348686218, -0.6820249557495117, 0.22605851292610168, 0.16086000204086304, -0.23923110961914062,...
def _ _ init _ _ ( self, host, user ='root ', port = 22, ssh _ options = [ ] ) : self. host = host self. user = user self. target ='% s @ % s'% ( user, host ) self. port = port # set ssh and scp options. this code is needed because - p vs - p, and # because ssh needs - t in many cases, but scp doesn't take - t. self. s...
[ 0.6701756119728088, 0.38815081119537354, 0.7765288352966309, 1.1283023357391357, 0.5348525643348694, -0.48233893513679504, -0.8863139748573303, 0.25712764263153076, -0.5774548649787903, -0.6441800594329834, -0.04252922162413597, 0.2991552948951721, 0.9944734573364258, 0.5078991651535034, ...
def gf _ irreducible ( n, p, monic = true ) : while true : f = gf _ random ( n, p, monic ) h = h = gf _ pow _ mod ( [ 1, 0 ], p, f, p ) for i in xrange ( 1, n / 2 + 1 ) : g = gf _ sub ( h, [ 1, 0 ], p ) if gf _ gcd ( f, g, p ) = = [ 1 ] : h = gf _ compose _ mod ( h, h, f, p ) else : break else : return f
[ -0.007285584229975939, 1.2354388236999512, 0.45435482263565063, 0.45337769389152527, 0.08949501812458038, -0.10660210996866226, -0.0816236361861229, 0.2583295702934265, -0.6613423228263855, 0.691145658493042, 0.10553994029760361, 0.38781651854515076, -1.4354422092437744, -0.153652936220169...
def is _ valid _ hex _ str ( hex _ str ) : try : int ( hex _ str, 16 ) return true except ( valueerror, typeerror ) : # throws typeerror for none else valueerror return false
[ 0.28741124272346497, -0.3123796284198761, 0.5495133996009827, -0.16770495474338531, 0.40193992853164673, 0.7831693291664124, -0.9085491895675659, 0.35814380645751953, -0.10357342660427094, -0.6869611740112305, 0.19263197481632233, -0.7472550272941589, -0.8281288146972656, 0.053484555333852...
def handle ( self, * args, force = none, * * options ) : registered _ fixtures = fixture. all ( ) all _ fixtures = ( * shared _ fixtures, * events _ fixtures, * registered _ fixtures, ) if not force : _ ensure _ no _ existing _ data ( all _ fixtures ) call _ command ('loaddata ', * all _ fixtures, )
[ 0.15622344613075256, 1.1091690063476562, 0.4608497619628906, 0.3436049520969391, 1.707574725151062, 0.13476206362247467, 1.1645593643188477, 0.22017551958560944, 0.0039952537044882774, -1.1613317728042603, -0.7518748641014099, 0.7716078758239746, 0.1050010696053505, 0.6424045562744141, -...
def event ( self, ev ) : if self. linksenabled and ev. type ( ) in ( qevent. tooltip, qevent. whatsthis ) : page, link = self. linkat ( ev. pos ( ) ) if link : self. linkhelpevent ( ev, page, link ) return true return super ( ). event ( ev )
[ 0.10320843756198883, -0.10727040469646454, 0.7988172173500061, 0.038331061601638794, 0.6338196992874146, 0.3804869055747986, -0.170038640499115, 0.32673755288124084, 0.7125442624092102, -0.2725484371185303, 0.07207150757312775, -0.7393367290496826, 0.6749265193939209, 0.6971592903137207, ...
def _ _ init _ _ ( self, status, reservation _ id ) : super ( reservation, self ). _ _ init _ _ ( ) self. status = status self. reservation _ id = sessionid ( reservation _ id )
[ 0.8193466663360596, -0.6446903944015503, 0.3435940146446228, 0.5232107639312744, -0.16220833361148834, 0.0285333339124918, -1.491294503211975, 1.420520305633545, 0.7002370953559875, 1.062495470046997, -0.5271791219711304, 0.16929344832897186, 0.6131848096847534, -0.08324754983186722, 1.0...
async def scan ( dc _ infos ) : async for dc in dc _ infos : logger. info ( f'model { dc. name } with version { dc. latest _ version } is'f'updated. gathering the model metadata.') async with aiohttp. clientsession ( ) as session : url = f'http : / / { dc. name } : { model _ rest _ port } / v1 / models / { dc. name }'i...
[ -1.136199712753296, -0.2586721181869507, 0.6708834171295166, 0.2981031537055969, 0.538906991481781, 0.22333133220672607, -0.4677395224571228, -1.1824003458023071, -0.49567511677742004, 0.37228327989578247, -0.8742237687110901, 0.8436222672462463, 0.17932163178920746, 0.5858789682388306, ...
def is _ object ( self, bucket _ name : str, object _ name : str ) - > dict : return self. objectdata. is _ object ( bucket _ name, object _ name )
[ -0.49292194843292236, -0.7361062169075012, 0.6410501003265381, -0.16322456300258636, -0.41615667939186096, 0.11633838713169098, -0.9085791707038879, -0.3820321261882782, -0.3212321102619171, 0.507388710975647, -1.3053383827209473, 0.9659183025360107, 0.6517525315284729, -0.8064929246902466...
def parse _ toa _ line ( line, fmt = " unknown " ) : mjd = none fmt = toa _ format ( line, fmt ) d = dict ( format = fmt ) if fmt = = " princeton " : fields = line. split ( ) d [ " obs " ] = get _ obs ( line [ 0 ]. upper ( ) ) d [ " freq " ] = float ( fields [ 1 ] ) d [ " error " ] = float ( fields [ 3 ] ) ii, ff = fie...
[ -0.270477294921875, -1.1081616878509521, 0.8077937960624695, -0.7837609648704529, -1.101314902305603, -0.7123449444770813, 0.14749355614185333, -0.17193038761615753, -0.03801661357283592, -0.1721864938735962, 0.21664901077747345, -0.13251501321792603, 0.5538631677627563, 0.8368274569511414...
def headers ( self ) : hdrs = find _ headers ( " hypre ", self. prefix. include, recursive = false ) return hdrs or none
[ -0.016501381993293762, 0.1902385652065277, 0.6409229636192322, 0.8783633708953857, 0.7365596890449524, -0.9645591378211975, -0.3855130076408386, -0.6938620805740356, 0.21104586124420166, -0.1326822191476822, 0.35791370272636414, -0.570546567440033, -1.1606318950653076, -0.33667588233947754...
def bind _ router ( ) : router _ endpoint = opts. broker _ router _ endpoint ( router, auth ) = bind _ endpoint ( router, router _ endpoint, setup _ curve = true, ) log ( " bind router at < % s > " % router _ endpoint ) return ( router, auth )
[ -0.29217225313186646, -1.021497130393982, 0.5501021146774292, 0.46049419045448303, 0.36879366636276245, -0.2984703481197357, -0.4295257031917572, 0.15523576736450195, 0.22482430934906006, 0.23119044303894043, -0.1449914276599884, 1.407679557800293, -0.4555725157260895, 0.47466152906417847,...
def get _ msm _ thresholds ( self, adduct, fdr _ target, n _ reps = 10, col ='msm') : fdr _ curves, target _ hits, score _ vects = self. get _ fdr _ curve ( adduct, n _ reps, col ) msm _ vals = [ ] for n in range ( n _ reps ) : crossing _ idx = find _ crossing ( fdr _ curves [ n ], fdr _ target ) if crossing _ idx > - ...
[ -0.6247799396514893, 0.5510472059249878, 0.5936814546585083, -0.25391054153442383, 0.32221734523773193, -0.2823140621185303, -0.46186262369155884, -0.5913248658180237, 0.06609075516462326, 0.9633359313011169, 0.2269209921360016, 0.5439143180847168, 0.39369675517082214, 0.4698771834373474, ...
def der ( x ) : return np. cosh ( x )
[ 0.5463660359382629, -0.2529577314853668, 0.3814854621887207, 0.24286118149757385, -0.4037703573703766, 1.2393261194229126, -0.8916836977005005, -0.0444318987429142, -0.5301276445388794, -1.43119215965271, 0.3546341061592102, 0.15200068056583405, 0.6228248476982117, -1.5251996517181396, 1...
def _ _ getitem _ _ ( self, name ) : return self. get ( name, select = true )
[ -0.8565166592597961, -0.6321925520896912, 0.37200236320495605, -0.5500611066818237, -0.34735748171806335, -0.4766722619533539, -0.9014805555343628, -1.3243145942687988, -0.08891626447439194, 0.5210743546485901, -0.007522640284150839, -0.05615805462002754, 0.038428567349910736, -1.537153959...
def value _ from _ datadict ( self, data, files, name ) : # this is a little bit sketchy because it means we're reaching into # data owned by a different form field ( the tool ). that said, i don't # know that there's a clean way to do this otherwise. selected _ tool = int ( data ['tool'] or 0 ) result = { } for i, wid...
[ -0.6190264225006104, -0.22027309238910675, 0.1851610392332077, -1.4288474321365356, -0.8067464232444763, -1.1949833631515503, -0.5077625513076782, -0.7981876134872437, -1.041407585144043, -0.19796492159366608, -1.204910397529602, -0.07296061515808105, 0.805736780166626, 0.6253988742828369,...
def collect ( self ) : # create the subselecter functions : def subselect ( ds, props ) : " " " chain all selection methods ds = subselect ( ds, lon = [ - 180, 180 ], lat = [ - 90, 90 ], nmin = 10, hmin = 1000 ) " " " def subselect _ nmin ( ds, props ) : " " " " remove profiles with not enough data we keep only profile...
[ 0.41040658950805664, -0.5759208798408508, 0.7532557845115662, -0.13173678517341614, -0.1366732120513916, 0.5856008529663086, 0.17281140387058258, -0.6822100281715393, 0.06626658886671066, 0.0032841626089066267, 0.2518821656703949, 0.5287789106369019, 0.2451457530260086, 0.08346626162528992...
def test _ booking _ list ( self ) : self. client. login ( username = self. user. username, password ='test') resp = self. client. get ( self. url ) self. assertequal ( booking. objects. all ( ). count ( ), 4 ) self. assertequal ( resp. status _ code, 200 ) self. assertequal ( resp. context _ data ['bookings']. count (...
[ -1.0318678617477417, 1.1052523851394653, 0.5629569888114929, 1.3887302875518799, 0.33710208535194397, 1.2905478477478027, -0.33960774540901184, 1.6713334321975708, 0.041586983948946, -0.3318861424922943, -1.1904817819595337, -0.9609744548797607, 0.010219967924058437, 0.28643998503685, -0...
def _ _ eq _ _ ( self, other ) : must _ be _ equal = ['_ _ class _ _ ','required'] + self. _ arguments for attr in must _ be _ equal : if getattr ( self, attr, none )! = getattr ( other, attr, none ) : return false return true
[ -1.5210416316986084, -0.4261682331562042, 0.7661964297294617, 0.4713851511478424, 1.2882236242294312, 0.5768285393714905, -0.12036404013633728, -0.31592127680778503, -0.023768523707985878, 0.38683968782424927, -0.752314567565918, -0.3323303461074829, 0.02382620982825756, 0.9633790850639343...
def stop _ display _ loop _ thread ( self ) : with self. buffer _ lock : self. running = false
[ -0.105945885181427, -1.1226097345352173, 0.16488708555698395, -0.7347562909126282, -0.4212326109409332, 1.805578351020813, 1.0561915636062622, -0.7804850935935974, -0.7007752060890198, -0.6567886471748352, -0.4782957136631012, 1.0001569986343384, -2.0116469860076904, 0.19027037918567657, ...
def recognize ( ) : if app. image is none : logging. debug ( " app. image is none, redirecting " ) return redirect ( " / " ) # get cropper data data = request. form. get ( " secret " ) # if cropper data is available if data is not none : coords = json. loads ( data ) # get coordinates of the cropper x0 = int ( coords [...
[ -1.0607244968414307, -0.06726774573326111, 0.8281142115592957, 0.0980842337012291, 0.1570737361907959, -0.21574756503105164, 0.18875055015087128, 0.3204224109649658, -0.24106329679489136, 0.08101579546928406, 0.39411047101020813, -0.09951556473970413, 1.3136066198349, 0.8946389555931091, ...
def hint _ pose _ y ( self, y ) : if not number. is _ real _ number ( y ) : raise validationerror ( " y coordinate must be a number ( value is % s ) " % y ) elif not number. is _ finite ( y ) : raise validationerror ( " y coordinate must be a finite number " " ( value is % s ) " % y ) else : self. set _ input ( " hint ...
[ -0.5516115427017212, 0.28511229157447815, 0.8295704126358032, 0.450492262840271, -0.4276942014694214, 0.9319772124290466, 1.233264684677124, -1.0524801015853882, 0.08264493942260742, -0.3952730894088745, -0.38393935561180115, -0.23102614283561707, -0.2927486002445221, 0.6437475681304932, ...
def load _ data _ explore ( ) : ticket _ data = pd. read _ sql _ query ( " select * from ticket _ data ", con = conn, parse _ dates = ['tickissuedate'] ) address _ data = pd. read _ sql _ query ('select * from address _ data ', conn ) ticket _ data = ticket _ data. merge ( address _ data, left _ on ='address ', right _...
[ 0.04379194602370262, 0.8115752339363098, 0.7398765683174133, -0.6002704501152039, 0.017806611955165863, 0.2821420133113861, -0.7558157444000244, 0.12679852545261383, -0.22628092765808105, -0.31768274307250977, 0.21370574831962585, 0.18338452279567719, 0.034598447382450104, -0.4800951778888...
def get ( self, request, movie _ id = 0 ) : if int ( movie _ id ) > 0 : queryset = movie. objects. filter ( id = int ( movie _ id ) ) else : queryset = movie. objects. all ( ) results = self. paginate _ queryset ( queryset ) serializer = movieserializer ( results, many = true ) return self. get _ paginated _ response (...
[ -0.8659877181053162, -0.34645819664001465, 0.5776088833808899, 0.8731598258018494, 0.9165432453155518, -0.570521891117096, -0.42153292894363403, -0.03176801651716232, 0.21194027364253998, -0.055490076541900635, 0.677160382270813, 0.83174729347229, -0.3227120637893677, 1.2329280376434326, ...
def _ _ len _ _ ( self ) - > int : return len ( self. filenames )
[ 0.07974722236394882, -0.4377795159816742, 0.16596831381320953, -1.4871731996536255, 0.7176478505134583, 0.04546809569001198, 0.45281028747558594, 1.3254021406173706, 0.4345090985298157, -0.7841503024101257, -0.7418620586395264, -0.3007172644138336, 0.6490655541419983, 0.26774895191192627, ...
def unregister _ target ( self, event : fileevent, tag : str = " < unknown > " ) - > bool : if event not in self. _ event _ targets or tag not in self. _ event _ targets [ event ] : return false del self. _ event _ targets [ event ] [ tag ] return true
[ -0.474507212638855, 0.006817634683102369, 0.4787057936191559, -0.46852123737335205, 0.17182938754558563, -0.46934202313423157, -0.8098285794258118, 0.8869670629501343, -0.8214116096496582, -0.08785419911146164, 0.11524606496095657, 0.3136337101459503, -0.29340946674346924, 0.22550687193870...
async def download ( self, ctx, *, url ) : async with ctx. typing ( ) : player = await ytdlsource. from _ url ( url, loop = self. bot. loop ) ctx. voice _ client. play ( player, after = lambda e : print ( f'player error : { e }') if e else none ) await send ( ctx, f'now playing : { player. title }')
[ -0.2232607901096344, -0.11826425045728683, 0.607896089553833, 0.10320393741130829, -0.3187803626060486, 0.4822176694869995, -0.11076319217681885, 0.07489058375358582, 0.4570004642009735, -0.3767087757587433, -0.8146011829376221, 0.9267654418945312, -0.30210986733436584, -0.0778138935565948...
def test _ empty _ everything ( self ) : with settings ( use _ ssh _ config = false ) : with settings ( key _ filename = " " ) : eq _ ( key _ filenames ( ), [ ] ) with settings ( key _ filename = [ ] ) : eq _ ( key _ filenames ( ), [ ] )
[ -0.10913484543561935, 0.08128368854522705, 0.3260779082775116, 0.2702927887439728, 1.2423194646835327, 0.9873043298721313, -0.6933663487434387, -0.30554014444351196, -0.5582808256149292, 0.29749786853790283, -0.826209545135498, 0.24970704317092896, -0.1527557522058487, 0.7976848483085632, ...
def file _ candidates ( base, prefix, match _ ext ) : return ( p for ( p, n ) in candidates ( base, match _ ext ) if n. startswith ( prefix ) )
[ 0.29132580757141113, -1.7326775789260864, 0.5700634121894836, 0.6861836910247803, -0.239157035946846, -0.3360184133052826, -1.3039785623550415, 1.0895655155181885, -0.4256424009799957, 0.25475621223449707, 0.1966419816017151, 0.8162229657173157, -0.27040138840675354, -0.6247521042823792, ...
def check _ binomial _ n _ defined _ if _ binomial ( params, distributions ) : if'binomial'in distributions : if isinstance ( params, dict ) : if'binomial _ n'not in params : raise nameerror ('binomial _ n needs to be defined in params') elif not isinstance ( params ['binomial _ n'], float ) : raise nameerror ('binomia...
[ 0.4260903000831604, -0.5275855660438538, 0.6392302513122559, 0.5614075064659119, 1.0326087474822998, 0.3161446154117584, -0.66350919008255, 0.22728347778320312, -0.877103328704834, 0.2712537348270416, 0.03519824147224426, 0.5496031045913696, 0.0017554626101627946, 1.733951449394226, -0.2...
def load _ bot ( self, source _ file ) : seat = self. bot _ count ( ) self. log ( " loading bot { l } from { f } ". format ( l = seat, f = source _ file ) ) bot = loadedbot ( source _ file, seat, print _ bot _ output = self. print _ bot _ output ) if bot and not bot. process. exploded : self. bots. append ( bot )
[ -0.24416543543338776, 0.4677879810333252, 0.39805275201797485, -0.027958914637565613, -0.47740474343299866, 1.041642427444458, -0.39845508337020874, 0.1358688622713089, -0.5537163019180298, -0.498631089925766, -0.8142361044883728, 0.32750803232192993, -0.5100744962692261, 0.603623449802398...
def move _ to ( self, target ) : target = path ( target ) if isinstance ( target, directory ) : target = target. join ( self. basename ) else : target = target if target. exists : target. remove ( recursive = true ) shutil. move ( self. absolute. path, target. path ) return path ( target )
[ -0.7905946373939514, -0.5463611483573914, 0.700455904006958, -0.14656540751457214, -0.15547046065330505, 0.07035669684410095, 0.6205278635025024, -0.4174753725528717, 0.07136080414056778, -0.020493915304541588, 0.6823168396949768, 0.2345103919506073, 0.10613732784986496, -0.905972778797149...
def compress ( uncompressed : list ) - > list : # build the dictionary. dict _ size = 256 dictionary = { chr ( i ) : chr ( i ) for i in range ( dict _ size ) } w = " " result = [ ] for c in uncompressed : wc = w + c if wc in dictionary : w = wc else : result. append ( dictionary [ w ] ) # add wc to the dictionary. dict...
[ -0.5985423922538757, 0.360351026058197, 0.6730923652648926, 0.2331250160932541, -1.0684969425201416, -0.9527979493141174, 0.3792620301246643, -0.26945385336875916, -0.06729385256767273, 0.4353559613227844, -1.3182530403137207, -0.5826862454414368, -0.579860508441925, 1.2035009860992432, ...
def update ( self, row : int, col : int, val : int ) - > none : upper = self. total _ sum [ row - 1 ] [ col ] if row > 0 else 0 left = self. total _ sum [ row ] [ col - 1 ] if col > 0 else 0 diagonal = self. total _ sum [ row - 1 ] [ col - 1 ] if ( row > 0 and col > 0 ) else 0 diff = self. total _ sum [ row ] [ col ] -...
[ 0.30189409852027893, -0.2231246531009674, 0.8418355584144592, -0.36161917448043823, -0.7265874147415161, 0.4500654637813568, 0.6887332201004028, -0.7116342782974243, 0.6626389622688293, 0.8064160943031311, 0.12110824882984161, 0.4127126634120941, 0.29626452922821045, -0.25154751539230347, ...
def compare _ generated _ samples ( y _ new, y _ ref, title ) : f, ( ax1, ax2 ) = plt. subplots ( 1, 2, sharey = true, figsize = ( 15, 5 ) ) f. suptitle ( title ) ax1. scatter ( y _ new ['measurement - 1'], y _ new ['measurement - 3'] ) ax1. scatter ( y _ ref ['measurement - 1'], y _ ref ['measurement - 3'] ) ax1. set ...
[ 0.5755482316017151, -0.48352429270744324, 0.8569161891937256, -0.39717915654182434, -0.2638130187988281, 0.8160516619682312, 0.8514377474784851, -0.23021221160888672, -0.21861153841018677, 0.1400619000196457, 0.4873250424861908, 0.8283988237380981, 0.3973960280418396, 0.3301407992839813, ...
def split _ data ( dataset, ratio = 0. 9 ) : # create the index that splits into respective ratios split _ index = int ( ratio * dataset. shape [ 0 ] ) # print ( " the index to split is ", split _ index ) test = dataset [ : split _ index, : ] # first split become test set train = dataset [ split _ index :, : ] # last s...
[ -0.7116482257843018, 0.6156133413314819, 0.2806771397590637, -0.847763180732727, -0.06073130667209625, -0.4505145847797394, 0.39524605870246887, 0.7017136216163635, 0.1530275046825409, 0.018506024032831192, 0.049823496490716934, -0.5229541063308716, -0.573998749256134, -1.0294896364212036,...
def quantile ( self, quantile : float ) - > dataframe : if self. downsample : raise valueerror ( " quantile operation not supported during downsample " ) return wrap _ df ( self. _ df. groupby _ quantile ( self. by, self. selection, quantile ) )
[ -0.707953155040741, 0.6643602848052979, 0.3486535847187042, -0.04956723749637604, -0.22678528726100922, -1.3507882356643677, 1.033514380455017, -0.9690297842025757, -0.15997840464115143, -0.42654722929000854, 1.0911190509796143, 0.5277568101882935, -1.2568548917770386, -1.2260558605194092,...
def on _ close ( self ) : cls = self. _ _ class _ _ if self. connection _ id in cls. _ connections : self. log. info ('connection % s is closed'% self. connection _ id ) del cls. _ connections [ self. connection _ id ] for channel in self. channels : if channel in cls. _ channels : if len ( cls. _ channels [ channel ] ...
[ 0.589137852191925, -1.1881545782089233, 0.7333340048789978, -0.5234567523002625, 0.3810322880744934, -0.35806456208229065, -0.5695043802261353, -0.6229491829872131, 0.16749942302703857, -0.04943257197737694, 0.5245410799980164, 0.0565519854426384, -0.6251596212387085, 1.4127013683319092, ...
def group ( self, chains, alignments, discrepancies ) : mapping = { } for chain in chains : mapping [ chain ['id'] ] = chain groups = [ ] graph = self. connections ( chains, alignments, discrepancies ) for ids in self. build _ groups ( graph ) : self. validate ( graph, list ( ids ) ) group = [ mapping [ id ] for id in ...
[ -0.5119372606277466, -0.40194159746170044, 0.3244912922382355, -0.06862657517194748, 0.6393947005271912, 0.09463993459939957, -0.0935438796877861, 0.04849645122885704, -0.2808193862438202, -0.6288377642631531, 0.8034703135490417, 0.48269930481910706, -0.7980917096138, 0.03848515823483467, ...
def parse ( cls, spec ) - > " wagtailsizespec " : ops = " | ". join ( wagtailsizeoperation. _ member _ names _ ) # noqa exp = re. compile ( rf " (? p < op > { ops } ) - (? p < width > \ d + ) x (? p < height > \ d + )? ( - c (? p < zoom > \ d + ) )? " ) if not ( m : = exp. match ( spec ) ) : raise valueerror ( f'provid...
[ 0.2321862429380417, 0.3945646286010742, 0.5896421670913696, -0.38004961609840393, -1.052390694618225, -0.5383469462394714, 0.6116125583648682, 0.1492280215024948, 0.44583359360694885, 0.11214376240968704, -0.7869940996170044, -0.16950486600399017, 0.2544632852077484, -0.02744012139737606, ...
def deltaintegrate ( f, x ) : if not f. has ( diracdelta ) : return none # g ( x ) = diracdelta ( h ( x ) ) if f. func = = diracdelta : h = f. expand ( diracdelta = true, wrt = x ) if h = = f : # can't simplify the expression # fixme : the second term tells whether is deltadirac or derivative # for integrating derivati...
[ 1.1084545850753784, 0.8920132517814636, 0.9192072749137878, 0.24014896154403687, -0.2703482508659363, -0.21739493310451508, -0.17940831184387207, 0.12924911081790924, -0.2092008888721466, -0.695002555847168, -0.23001597821712494, -0.49702513217926025, -0.6074692010879517, -0.73607808351516...
def get _ fashion _ tips ( page = 1 ) : try : # validates the page validated _ page = validate ( page ) # gets the list of fashion items for the page rows = get _ fashion _ items ( validated _ page, 20 ) # converts rows to fashion items fashion _ items = convert _ to _ fashion _ item ( rows ) # randomizes the page of i...
[ -1.750048041343689, -0.29472607374191284, 0.5683201551437378, 0.029171960428357124, 0.8704490661621094, -0.7520670890808105, -0.3543686270713806, 0.05775358900427818, 0.7258963584899902, 0.3392544984817505, -0.20190086960792542, 0.0588434562087059, 0.22028253972530365, 0.26358190178871155,...
def main ( ) : # parse the command line - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - parser = argumentparser ( ) parser. add _ argument ('- j ','- - justshow ', action ='store _ true ', help ='show options and exit') # language abbreviation ( < = characters ) parser. add _ argument ('...
[ 0.5753018260002136, 0.1348387449979782, 1.5560489892959595, 0.8913471698760986, -0.41391828656196594, 0.2884010374546051, 0.07808089256286621, 0.14697009325027466, -0.19178926944732666, 0.5860850811004639, 0.353043794631958, 0.38532936573028564, 0.49387967586517334, -0.2514757215976715, ...
def api _ definition _ url ( self ) - > optional [ str ] : return pulumi. get ( self, " api _ definition _ url " )
[ 0.45351335406303406, -0.152933269739151, 0.36095279455184937, 0.58327317237854, 1.393504023551941, 1.0651130676269531, -0.5189438462257385, 0.7693799138069153, -0.017765730619430542, -0.21105915307998657, -0.17915023863315582, 0.33258000016212463, 0.1171497255563736, -0.3873770534992218, ...
def test _ init _ without _ static _ or _ templates ( self ) : vis _ dir = galaxy _ mock. mockdir ( {'config': {'vis1. xml':'' } } ) plugin = self. plugin _ class ( galaxy _ mock. mockapp ( ), vis _ dir. root _ path,'myvis ', dict ( ) ) self. assertfalse ( plugin. serves _ templates ) # not sure what this would do, but...
[ -0.6951754093170166, -0.13029465079307556, 0.2970332205295563, 0.037914302200078964, -0.2576024830341339, 0.7807942032814026, 0.9354886412620544, 0.24293985962867737, 0.7049845457077026, -1.169981837272644, -0.7369422316551208, 0.10882477462291718, -0.3024885356426239, 0.9560948014259338, ...
async def _ ping ( self ) : try : while true : await asyncio. sleep ( ping _ interval ) await self. _ request ( " readrequest ", " / server / 1 / status / ping " ) except asyncio. timeouterror : _ log. warning ( " ping was not answered. closing connection. " ) self. _ leap. close ( ) except asyncio. cancellederror : pa...
[ -0.5227186679840088, 0.2920810878276825, 0.6181120872497559, 0.17982445657253265, 0.44772520661354065, 1.0074630975723267, -0.6375913023948669, 0.1703946590423584, -0.7992978692054749, 0.20825250446796417, 1.2120707035064697, -0.520542562007904, -0.08170963823795319, -0.41852355003356934, ...
def meny ( ) : valg = input ( " \ n \ nhva onsker du aa gjore? \ n legg til en film ( 1 ) \ n fjern en film ( 2 ) \ n oversikt over alle filmer ( 3 ) \ n informasjon om en film ( 4 ) \ n finn hylleplassering ( 5 ) \ n vis filmhylle ( 6 ) \ n avslutt ( 7 ) \ n \ n \ n \ n > " ) muligheter = [ " 1 ", " 2 ", " 3 ", " 4 ",...
[ -0.18930044770240784, 0.21931155025959015, 0.6860074996948242, 0.3069516122341156, -1.3013954162597656, 0.05816459655761719, 0.4348508417606354, -0.7872565388679504, -0.3091817796230316, -0.4322200417518616, -0.46847423911094666, 0.1622740924358368, -0.3989437520503998, 1.0219672918319702,...
def totalno ( scores ) : total = 0 if len ( scores ) = = 0 : # if no scores avoid div by zero! return 0 for score in scores : total = total + 1 return total
[ -0.8153336048126221, 0.3665963411331177, 0.7138264179229736, 0.640495240688324, 0.6111969351768494, -0.42771831154823303, 1.971337914466858, 0.2847149074077606, 0.614511251449585, 0.16347867250442505, -0.916022002696991, -0.9413869380950928, -0.5114393830299377, -0.08835618197917938, -0....
def get _ cache _ value ( self, key : str ) - > str : return self. sqldata. get _ cache _ value ( key )
[ -1.0893150568008423, 0.7478839755058289, 0.30562227964401245, 0.03757280111312866, -1.5338027477264404, 0.10448092222213745, -1.4990097284317017, -0.5844334959983826, -0.7352419495582581, 1.1221212148666382, 0.3714071214199066, 0.3798871338367462, 0.24744398891925812, 0.19072899222373962, ...