text
stringlengths
25
2.19k
embedding
listlengths
768
768
def plot _ solution ( coordinates, original _ labels, predicted _ labels, legend _ colors, legend _ descriptions, uncertainty, save = false, path = none ) : plt. rcparams ['font. serif'] ='times new roman'plt. rcparams ['font. family'] ='serif'plt. rcparams ['figure. figsize'] = [ 9. 69, 6. 27 ] figure = plt. figure ( ...
[ -0.00995666068047285, 0.5060701370239258, 0.9423463344573975, -0.35845643281936646, 0.1322837471961975, 0.4565679132938385, 0.7400907278060913, 0.11921527236700058, -0.9062626361846924, 0.49041426181793213, 0.23408150672912598, 1.117968201637268, 0.5944940447807312, 0.2310512512922287, 0...
def _ decode _ heuristically ( b, allencs, mdb ) : eliminencs = [ ] for enc in allencs : try : # for py3, s may only be a bytes object s = b. decode ( enc ) except ( unicodeerror, lookuperror ) : eliminencs. append ( enc ) continue else : candidenc = may _ do _ better ( b, allencs, enc, mdb ) if candidenc is not none :...
[ 0.05598938837647438, -0.6098787784576416, 0.7255150675773621, 0.11977297067642212, -0.0955730676651001, -0.4656292200088501, -0.3023831844329834, 0.32569167017936707, 0.2875877618789673, -0.00506096426397562, -0.4643133878707886, -0.6031465530395508, 0.16043232381343842, 0.270626038312912,...
def do _ login ( user ) : session [ curr _ user _ key ] = user. username
[ -1.5080324411392212, -0.4855664372444153, 0.2759212553501129, 0.7115105390548706, -0.9907224774360657, -0.020723111927509308, 1.1087706089019775, -0.3763982951641083, 0.33601996302604675, 0.4449332654476166, -1.4713126420974731, 0.20066632330417633, 0.06737519055604935, -0.6605859994888306...
def _ initialize _ non _ array _ out _ parameters _ if _ necessary ( writer, parameters ) : # first, get every out parameter of size 1 non _ array _ out _ params = [ param for param in parameters if param. is _ out and param. sizes [ 0 ] = = 1 ] # add checking if every parameter is passed as an array for param in non _...
[ -0.8969593644142151, -0.6664603352546692, 0.7045460939407349, -0.05753261223435402, -0.30046164989471436, -0.4344112277030945, 0.7318503856658936, -0.5438700914382935, -0.03651772439479828, 0.9313862919807434, -0.20144867897033691, 0.789659857749939, -0.025859951972961426, 1.28248250484466...
def others ( self ) : text _ index = 0 text _ from _ xml, ids, eng _ list = self. util. get _ text _ from _ xml ( self. string _ xml, " others ", " trans - unit ", config. selected _ language. strip ( ) ) xpath = self. util. read _ xpath _ list _ from _ xml ( self. object _ repo, " others ", self. my _ object ) # xpath...
[ -0.850471019744873, -0.11585371941328049, 0.8786674737930298, -0.28281205892562866, -0.30621781945228577, 0.20428700745105743, 0.4132997393608093, -0.67681884765625, 0.011369040235877037, 0.26131826639175415, -0.29230624437332153, -0.5433952808380127, -0.9872625470161438, 0.569189786911010...
def supports _ import ( ) : return false
[ -0.3152969777584076, 0.6894944310188293, 0.19996902346611023, 0.8105957508087158, -0.28953513503074646, 0.9141355156898499, -0.0019719998817890882, 0.5632822513580322, -0.351192831993103, -0.26418548822402954, -1.0636667013168335, -0.48124679923057556, -0.8105544447898865, -0.4842247366905...
def visit ( self, node : ast. program ) : ttypes = self. semantic _ scope. get _ types _ dict ( ). values ( ) klasses = [ klass for klass in ttypes if not klass in node. classes ] for klass in klasses : # print ( klass. parent ) self. visit ( klass ) # we register the entrypoint here. self. build _ entry ( ) self. resu...
[ -0.4844525158405304, 0.13009138405323029, 0.48515674471855164, -0.10993833094835281, 0.2449915111064911, 0.11207995563745499, 0.700779914855957, -0.022110145539045334, 0.9879425764083862, 0.4962361752986908, -0.11831264942884445, 0.8010969161987305, -0.05736147239804268, 0.8261930346488953...
def countries ( ) : idx = country _ codes ['country code']. isin ( countries ) return country _ codes [ idx ]. to _ json ( orient ='records'), 200
[ -0.6418944001197815, -0.027376754209399223, 0.2721172571182251, -0.019456880167126656, 0.3979538381099701, -0.4140976667404175, -0.7597204446792603, 0.5180507898330688, -0.4055369794368744, 0.8209633827209473, 0.09569916129112244, 0.14866353571414948, -0.6113839149475098, -0.32618263363838...
def _ _ add _ _ ( self, other ) : o = self. pub. group. order ( ) g = self. pub. group. generator ( ) if isinstance ( other, int ) : # case for int other new _ b = self. b + ecpt. from _ binary ( binascii. unhexlify ( _ n _ table [ str ( ( o + other ) % o ) ] ), g ) # other * g new _ k, new _ m = none, none if self. k ...
[ -0.06418894976377487, -0.1740596741437912, 0.8074482679367065, 0.30090200901031494, -0.6877172589302063, -0.13768370449543, 0.30256158113479614, -0.5857805609703064, 0.7333205938339233, -0.40075573325157166, 0.2769579291343689, -0.2851986289024353, -0.88578200340271, 0.09186425060033798, ...
def adder ( a, b, c ) : return make _ ternary _ constraint ( a, b, c, add, sub, sub )
[ 0.9668280482292175, -0.043938130140304565, 0.6174141764640808, 0.10678022354841232, 0.07040023058652878, 0.6051544547080994, -0.776114821434021, -0.37276139855384827, -0.2693586051464081, 0.5114930868148804, 0.314263254404068, -0.7873238921165466, -0.8464028239250183, -1.3309234380722046, ...
def create _ screenboard ( self, description ) : return self. http _ request ('post ','/ screen ', description )
[ -1.080299735069275, 1.3390108346939087, 0.3821922838687897, 1.1799421310424805, 0.4277697801589966, 0.5829676985740662, -0.9185987710952759, -0.654984712600708, 0.21314722299575806, -0.15480157732963562, -0.6024578213691711, 0.527045488357544, -1.5253396034240723, 1.3733776807785034, 0.0...
def sum ( elist ) : pub = elist [ 0 ]. pub g = pub. group # w = [ bn ( 1 ) for _ in range ( len ( elist ) ) ] as _ l = [ e. a for e in elist ] bs _ l = [ e. b for e in elist ] ks _ l = [ e. k for e in elist ] ms _ l = [ e. m for e in elist ] # from pprint import pprint # pprint ( ks _ l ) new _ a = g. sum ( as _ l ) ne...
[ 0.06541817635297775, 0.15965738892555237, 0.6668670177459717, 0.3575022518634796, -0.3409119248390198, -0.15218132734298706, 0.36527329683303833, -0.2707517445087433, 0.43137577176094055, -0.2629963457584381, 0.20568087697029114, -0.6761919856071472, -0.1638043373823166, 0.4869039654731750...
def decode _ text ( text ) : decoder = get _ decoder ( none,'text / plain') return decoder. decode ( text )
[ 0.012866383418440819, -0.10088324546813965, 0.008228224702179432, -0.1721038818359375, -1.244036078453064, -0.0867195874452591, -1.005702257156372, 0.1558074653148651, 0.8123822808265686, -0.879666805267334, -0.7319119572639465, -0.18298041820526123, -1.084934949874878, -0.1150608733296394...
def shapetype ( self, * args ) : return _ topods. topods _ shape _ shapetype ( self, * args )
[ -0.6438625454902649, 0.3780980408191681, 0.470140665769577, -0.12490198761224747, 1.161275029182434, 0.38483378291130066, 0.6084195375442505, -0.7433518171310425, 0.4061821699142456, 0.21502110362052917, -0.31781280040740967, 0.27389854192733765, -0.7220989465713501, 0.14043225347995758, ...
def post ( ) : request _ json = request. get _ json ( ) valid _ format, errors = schema _ utils. validate ( request _ json,'org') if not valid _ format : return {'message': schema _ utils. serialize ( errors ) }, http _ status. http _ 400 _ bad _ request try : user = userservice. find _ by _ jwt _ token ( ) if user is ...
[ -0.7578273415565491, 0.20429882407188416, 0.8169559836387634, 0.8547121286392212, -0.25176626443862915, 0.6266400814056396, 0.026517335325479507, -0.20815105736255646, -0.14718611538410187, 0.33779001235961914, -0.8414670825004578, -0.10051467269659042, -0.22834719717502594, -0.00652129948...
def bitwiseand ( a, b ) : return a & b
[ 0.8736551403999329, -0.33063629269599915, 0.594524085521698, -0.7653288841247559, -0.22459633648395538, 0.7413707375526428, -1.0378109216690063, -0.4682171046733856, -0.505778968334198, -0.040581099689006805, 1.1415916681289673, 1.1579221487045288, -0.1576046645641327, -0.35009264945983887...
def create _ path ( self, parent, index, path _ list ) : if parent [ index ] = = - 1 : return path _ list. append ( self. vertices [ parent [ index ] ] ) self. create _ path ( parent, parent [ index ], path _ list )
[ 0.21344785392284393, 0.8764174580574036, 0.38488468527793884, 1.0302534103393555, 0.6805261373519897, 0.4301753342151642, 0.09991952031850815, -0.4760761559009552, 0.48364129662513733, 0.3548598289489746, -0.5491058826446533, -0.7380684018135071, -0.9063210487365723, 0.11548168957233429, ...
def add _ object ( db _ object ) : with session _ manager ( ) as db _ session : db _ session. add ( db _ object ) db _ session. commit ( )
[ -0.39189207553863525, -0.08770739287137985, 0.5689927339553833, 0.6167474389076233, 0.08755507320165634, 0.8075300455093384, 0.2989557981491089, -0.18184688687324524, 1.2590278387069702, 0.055915530771017075, -0.8336021900177002, -0.3120836317539215, -0.4823361337184906, -0.052664555609226...
def sort _ by _ quality ( entity ) : return ( max ( int ( round ( levenshtein. ratio ( text. lower ( ), entity [ " target " ]. lower ( ) ) * 100 ) ), int ( round ( levenshtein. ratio ( text. lower ( ), entity [ " source " ]. lower ( ) ) * 100 ) ), ), len ( entity [ " project _ names " ] ), )
[ -0.15840180218219757, -0.2424255609512329, 0.34581559896469116, -1.8150217533111572, -0.20837125182151794, -0.057168006896972656, -1.1358097791671753, -0.5137112140655518, -0.7998434901237488, 0.15709029138088226, 0.0371757447719574, -0.39114925265312195, 0.3071364462375641, 0.350333213806...
def eval _ perchannel ( ) : return jsonify ( [ x [ " datapoints " ] for x in httpx. get ( graphite _ host, params = { " target " : " keeplastvalue ( integral ( stats _ counts. bot. snekbox _ usages. channels. * ), inf ) ", " from " : time _ frames [ request. args. get ( " frame ", " day " ) ], " format " : " json ", " ...
[ -0.5529362559318542, 0.3398084044456482, 0.3696742057800293, -1.1615626811981201, 0.36861610412597656, -0.2389054000377655, -1.41111159324646, -1.0783929824829102, -0.4222525954246521, 0.4555203914642334, 0.29506081342697144, 0.4035886824131012, 0.000945654755923897, -0.19742107391357422, ...
def predict _ level2 ( path, image, nrows, ncols, model ) : zfile = os. path. splitext ( path ) [ 0 ] + '. zip'if not zf. is _ zipfile ( zfile ) : amflog. warning ( f'cannot read archive { zfile }.') return none with zf. zipfile ( zfile ) as z : if'col. tsv'in z. namelist ( ) : # retrieve root segmentation data. annota...
[ -0.1333404779434204, -0.2944340109825134, 0.834260880947113, 0.6951764225959778, -0.875921368598938, -0.33890748023986816, 0.26178133487701416, 0.12147242575883865, -0.3362044394016266, 0.6487988233566284, -0.25282731652259827, -0.1522875279188156, 0.8698856830596924, 0.49306046962738037, ...
def _ _ init _ _ ( self, id, type, ordered, category, partitions, unit = none ) : self. id = id self. type = type self. ordered = ordered self. category = category self. unit = unit self. partitions = partitions
[ -0.10926494747400284, -0.7217153310775757, 0.4036085903644562, 0.2430742233991623, 0.4066610634326935, -0.184835284948349, -1.1068438291549683, -0.37958526611328125, -0.2935222387313843, -0.7184052467346191, -0.14596015214920044, 0.13979408144950867, -0.018960820510983467, -0.0740604549646...
def createmenu ( self ) : name = raw _ input ('enter contact \'s name :') notes = raw _ input ('enter notes for contact :') primary _ email = raw _ input ('enter primary email address :') new _ contact = gdata. contacts. data. contactentry ( name = gdata. data. name ( full _ name = gdata. data. fullname ( text = name )...
[ 0.1930370330810547, -0.3648301661014557, 0.601502001285553, -0.03086196817457676, 0.8785555958747864, 0.5002579689025879, -0.04941875860095024, -0.82184898853302, -0.9464667439460754, -0.10496677458286285, 0.01585979200899601, 0.3819999098777771, -0.4874817430973053, 0.008903365582227707, ...
def _ self ( self, _ self ) : self. _ _ self = _ self
[ -0.943607747554779, -1.2244699001312256, 0.365319162607193, -1.0514700412750244, -0.4750712811946869, 0.12381771951913834, 1.326744556427002, -0.49702420830726624, -0.14954592287540436, -0.21107837557792664, -1.2540580034255981, 0.40953993797302246, 0.6569349765777588, -0.26669156551361084...
def description ( self ) - > optional [ str ] : return self. _ description
[ 0.9761744737625122, 0.04324368014931679, 0.2430572509765625, 0.503477931022644, 0.18863913416862488, 0.5612571835517883, -0.7518239617347717, -0.6384143829345703, 0.813626766204834, 0.05720285698771477, 0.7005451917648315, 0.03572545200586319, -0.5737841129302979, -0.36932024359703064, -...
def test _ login ( email, password, status _ code, api _ client, db ) : user. objects. create _ user ( email ='testemail @ gmail. com ', password ='admin1600 ', is _ active = true ) url = reverse ('users - api : login') data = {'email': email,'password': password } response = api _ client. post ( url, data = data ) ass...
[ -0.029533809050917625, 0.36454537510871887, 0.4668666422367096, 0.05996576324105263, 0.6380529999732971, 1.104186773300171, -0.5060870051383972, 0.5330724716186523, 0.208854541182518, -0.1703646332025528, -0.9575803875923157, 0.17091691493988037, -0.30004552006721497, -0.7576857805252075, ...
def clean _ data ( self ) : data = pd. read _ csv ( self. _ filename _ in, index _ col = 0 ) if self. _ filter _ cols : # remove any columns from data that we don't need by getting the difference between cols and filter list rm _ cols = set ( data. columns ) - set ( self. _ filter _ cols ) for col in rm _ cols : del da...
[ -0.33059266209602356, -0.05501456931233406, 1.0119514465332031, 0.5054682493209839, -0.8358491063117981, -0.20254619419574738, 1.0246809720993042, 0.18120861053466797, -0.9531739354133606, 0.45417338609695435, 0.5520375967025757, 1.1512341499328613, -0.10728711634874344, 0.9180416464805603...
def reversesub2 ( a ) : n = len ( a ) m = len ( a [ 0 ] ) x = [ 0 ] * n x = [ [ 0 for j in range ( n ) ] for i in range ( n ) ] for g in range ( n, m, 1 ) : for j in range ( n - 1, - 1, - 1 ) : if a [ j ] [ j ]! = 0 : # una manera de evitar una excepcion en matriz singular x [ j ] [ g - n ] = ( a [ j ] [ g ] - sum ( a ...
[ 0.7068360447883606, 0.28977617621421814, 0.7388743162155151, 0.48785924911499023, -0.7221770882606506, -0.37134066224098206, 0.2651761472225189, 1.161394715309143, 0.43684521317481995, 0.36504319310188293, 0.30833902955055237, 0.10432355850934982, 0.20996730029582977, 0.4131768047809601, ...
def _ _ getitem _ _ ( self, item _ filter ) : if isinstance ( item _ filter, int ) : return next ( self. items ( item _ filter ) ) elif isinstance ( item _ filter, str ) or isinstance ( item _ filter, dict ) or item _ filter is none : return self. items ( item _ filter ) else : raise valueerror ( " item _ filter is of ...
[ -0.9494495987892151, 0.04384315758943558, 0.5106713175773621, 0.1326858103275299, 0.10007506608963013, -0.5300206542015076, -0.2993580996990204, -0.8484199047088623, -0.06962490826845169, -0.5836704969406128, 1.0929652452468872, 0.854552149772644, -0.09795472770929337, -0.6250066161155701,...
def _ _ init _ _ ( self, graph ) : self. mapping = collections. defaultdict ( set ) for op in ( op for op in graph. get _ operations ( ) ) : if op. name. startswith ( common. skipped _ prefixes ) : continue for op _ input in op. inputs : self. mapping [ op _ input ]. add ( op )
[ -0.256877601146698, 1.2328922748565674, 0.565399169921875, 0.7052430510520935, -0.5872869491577148, -0.10619957745075226, 1.0511209964752197, 0.2412465363740921, 0.017217224463820457, 0.02450885996222496, 0.026819076389074326, -1.1208072900772095, 0.6575193405151367, -0.1372370719909668, ...
async def get _ stage ( tournament _ id : int, stage _ id : int, tournament : tournament = depends ( visible _ tournament ), stage : stage = depends ( get _ stage _ by _ id ), ) : if not tournament or not stage or stage. tournament! = tournament : raise httpexception ( status _ code = status. http _ 404 _ not _ found, ...
[ -0.14974866807460785, -0.7063547968864441, 0.6993855237960815, 0.2447010576725006, 0.08086898922920227, -0.2430696338415146, -0.32775160670280457, -0.628449559211731, -0.42935627698898315, 0.726473867893219, 1.0459223985671997, 0.903330385684967, 0.4044378399848938, -0.17976239323616028, ...
def appointments ( request ) : if request. user. is _ stylist = ='yes': pending _ appointments = appointment. objects. filter ( stylist = request. user, status = appointment. status _ pending ) accepted _ appointments = appointment. objects. filter ( stylist = request. user, status = appointment. status _ accepted ) de...
[ -0.0663737952709198, -0.6802775859832764, 0.6377391219139099, 0.009306407533586025, -1.3253214359283447, 0.574840247631073, 0.0035606937017291784, 1.4364135265350342, 0.128698468208313, 0.8769382834434509, 0.29651373624801636, 0.03160170465707779, 0.33220311999320984, 0.47178247570991516, ...
def _ _ init _ _ ( self, * * kw ) : self. data = kw
[ 0.1067357063293457, -0.18963780999183655, 0.7187596559524536, 0.4206845164299011, -0.635468065738678, 0.5929865837097168, -1.0636645555496216, -0.2155134677886963, 0.07239697873592377, -0.9796347618103027, -0.6989953517913818, 0.5003180503845215, 0.0869111567735672, 0.6694532632827759, 0...
def welcome ( request ) - > dict : if request. user is not none : raise httpfound ( location = " / " ) return { }
[ 0.19624754786491394, 0.5538190603256226, 0.6061441898345947, 0.39215874671936035, -0.6527360677719116, 0.0035783927887678146, 0.21140585839748383, -0.8614108562469482, 0.06382611393928528, 0.22443974018096924, 0.12895692884922028, -0.21929289400577545, 0.4681643843650818, 0.825745940208435...
def begin _ update _ order _ item ( self, order _ item _ name : str, resource _ group _ name : str, order _ item _ update _ parameter : union [ _ models. orderitemupdateparameter, io ], if _ match : optional [ str ] = none, * * kwargs : any ) - > lropoller [ _ models. orderitemresource ] : api _ version = self. _ get _...
[ -1.483915090560913, -0.7427204847335815, 0.9196949601173401, 0.20138828456401825, -1.1565407514572144, -0.24078170955181122, 0.48167693614959717, -0.46320006251335144, 0.19333940744400024, 0.8506159782409668, 0.12064268440008163, 0.6295536756515503, -0.6484432816505432, -0.1513452678918838...
def testgettaginstancewithfloatvalue ( self ) : result = tagapi ( self. user ). create ( [ ( u'username / tag ', u'description') ] ) [ ( objectid, path ) ] = result tagvalueapi ( self. user ). set ( { objectid : { u'username / tag': 42. 1 } } ) self. store. commit ( ) with login ( u'username ', uuid4 ( ), self. transac...
[ 0.31025001406669617, 0.6748852133750916, 0.4867991507053375, 0.09976425766944885, 0.37186190485954285, 0.6242331266403198, 0.25567999482154846, -0.6175445318222046, -0.8148546814918518, -0.7181297540664673, -0.44480815529823303, -0.3145332634449005, 0.1660221368074417, 0.5727298259735107, ...
def _ download _ tnds _ files ( regions ) : if not regions : return { } user = current _ app. config. get ( " tnds _ username " ) password = current _ app. config. get ( " tnds _ password " ) if not user or not password : raise valueerror ( " the application config requires an username and " " password to access the tn...
[ -0.5624597072601318, -0.4880963861942291, 0.4294341206550598, -0.8528056740760803, -0.29157039523124695, -0.3057177662849426, 0.2931365370750427, -0.5141136050224304, -0.14041152596473694, 0.2830500304698944, 0.10563627630472183, -0.9334685206413269, 0.25305086374282837, 0.4354389905929565...
def _ _ le _ _ ( self, other ) : if type ( other ) is type ( self ) : if self. type! = other. type : return notimplemented elif isinstance ( other, discordentity ) : if self. type not in other. _ _ class _ _. _ _ name _ _ : return notimplemented else : return notimplemented return ( self. id < = other. id )
[ -0.5352092385292053, -0.8179280757904053, 0.845727264881134, -1.1356313228607178, 0.2595573365688324, 0.13934077322483063, -0.5319817662239075, -1.3218644857406616, 0.7272878289222717, -0.04990515485405922, -0.7241191267967224, -0.008025728166103363, -0.1367160677909851, 0.7235607504844666...
def origin _ aa _ samples ( self ) : return self. _ _ aa _ samples
[ 0.1404162049293518, -1.5818219184875488, 0.5239278078079224, -0.5653887391090393, -0.28657299280166626, 1.2254319190979004, 0.7286057472229004, 0.25580301880836487, 0.6120301485061646, 0.6298913955688477, 0.925635576248169, 0.7491509914398193, 0.5222974419593811, 0.46615204215049744, -0....
def export _ data ( request ) : # read file ca = get _ mongo _ client ( uri ='mongodb : / / localhost : 27017 /') with open ( os. path. join ( upload _ folder, " annotation _ data. json " ), " w " ) as f : annotations = ca [ " annotation _ data " ]. find ( { } ). batch _ size ( 50 ) result = [ ] for annotation in annot...
[ -0.6453899145126343, -0.5968825221061707, 0.7043091654777527, 0.03735818713903427, -0.5056849718093872, 0.3909255862236023, -0.20417705178260803, 0.12897904217243195, 0.12654626369476318, 1.37437105178833, -0.4867193102836609, 0.6434058547019958, 0.014036436565220356, 0.5661750435829163, ...
def total _ bought ( self ) : return self. avg _ bought * self. buy _ quantity
[ 0.48550915718078613, -0.29934149980545044, 0.648800253868103, -0.03611987456679344, 0.6449679136276245, 0.4460100531578064, 0.861558198928833, -0.653441309928894, -0.05303092300891876, 0.36259379982948303, -0.11704065650701523, 0.7602757811546326, 0.585725724697113, -0.362664133310318, -...
def cli _ run ( files, data _ dir, optional _ files, return _ correct, return _ optional ) : lists = compare _ files _ and _ folders ( files = files, root _ dir = data _ dir, optional _ files = optional _ files, return _ correct = return _ correct, return _ optional = return _ optional ) print ('root dir ( input ) : ',...
[ 0.4816618263721466, -0.597403347492218, 0.6591480374336243, 0.5603703260421753, 0.5406758785247803, 0.6354162096977234, 0.49052149057388306, 0.4991811513900757, -0.20110562443733215, -0.3081666827201843, 0.5450870990753174, 0.9948777556419373, -0.1609964519739151, 0.8168741464614868, -0....
def plot _ individual _ classes ( coordinates, class _ membership, description, coloration _ mode, coloration, save = false, path = none ) : number _ of _ classes = np. unique ( class _ membership ) plt. rcparams ['font. serif'] ='times new roman'plt. rcparams ['font. family'] ='serif'plt. rcparams ['figure. figsize'] ...
[ -0.4843817353248596, 0.5620976090431213, 0.9830938577651978, -0.07696796953678131, -0.001767149893566966, 0.7493162751197815, 0.608752429485321, 0.32618647813796997, -0.10782244801521301, 0.16170930862426758, 0.2753846049308777, 0.8163698315620422, 0.5204212665557861, 0.06730878353118896, ...
def main ( args ) : if args. gpu and torch. cuda. is _ available ( ) : device = torch. device ('cuda') else : device = torch. device ('cpu') # load data, and define collating function def _ collate ( seqs ) : " " " pack a batch of sequences for training. " " " feats, inseqs, targets = zip ( * seqs ) seqlens = [ len ( f...
[ 0.9100402593612671, 0.5162898302078247, 0.8582350611686707, -0.5676840543746948, 0.11337094753980637, -0.6263693571090698, 0.06107117235660553, -0.36172693967819214, -0.08788467198610306, -0.04351193830370903, 0.13308727741241455, 0.7777000665664673, 0.6381664276123047, 0.5347933769226074,...
def search ( labels, lowercase _ labels, good _ labels, word ) : similar _ words = difflib. get _ close _ matches ( word. lower ( ), lowercase _ labels, n = 10, cutoff = 0. 5 ) # using the lowercase list to compare with the word on an even field # optional parameter n is the max number of matches it looks for, 3 by def...
[ -0.010651723481714725, -0.13612531125545502, 0.7047019600868225, -0.24959729611873627, 0.14020472764968872, 1.0306352376937866, -0.6858739256858826, -0.24100461602210999, -0.06537344306707382, 0.7850517630577087, 0.025154756382107735, 0.7194198369979858, -1.2158464193344116, 0.865143656730...
def order _ detail ( obj ) : url = reverse ('orders : admin _ order _ detail ', args = [ obj. id ] ) # notice we using only single { } in url return mark _ safe ( f'< a href = " { url } " > view < / a >')
[ -0.044638633728027344, 0.8017675876617432, 0.691495418548584, -0.23846639692783356, 0.5239883065223694, -0.13774074614048004, -0.2246302217245102, 0.14492541551589966, 0.8263230919837952, -0.3058631420135498, 0.04548328369855881, 1.0086430311203003, 0.8721423745155334, 0.764150083065033, ...
def _ _ load _ model ( self ) : prints _ types. printprocess ( " [ info ] loading network... " ) self. _ _ model = load _ model ( self. _ _ model _ path ) # loads the trained model self. _ _ lb = pickle. loads ( open ( self. _ _ labels _ path, " rb " ). read ( ) ) # load the label binzrizer
[ -0.2889886498451233, -0.46849822998046875, 0.39455723762512207, -0.4869396388530731, 1.2716131210327148, 0.7950093746185303, -0.12842132151126862, 0.14381006360054016, -1.1721000671386719, -0.1271270513534546, -0.676826000213623, -0.5444583296775818, -0.4689353406429291, -0.154879540205001...
def created _ date _ time ( self, created _ date _ time ) : self. _ created _ date _ time = created _ date _ time
[ 0.5007522106170654, -0.20754891633987427, -0.48367637395858765, 1.007034420967102, 0.7584906816482544, 1.3459241390228271, -0.07628331333398819, 0.22148911654949188, -0.9070098996162415, -0.793650209903717, -1.2793906927108765, -0.399907648563385, 0.6849153637886047, 1.2555482387542725, ...
def test _ grpc _ 04 _ client _ stream ( self ) : for i in range ( len ( self. common _ friends _ iter ) ) : friends = self. common _ friends _ iter [ i ] exp _ friends = self. common _ friends _ exp [ i ] res = self. grpc _ stub. commonfriendscount ( self. common _ friends _ list ( friends ) ) assert res. count = = le...
[ 0.06190181151032448, 0.07262157648801804, 0.6723520755767822, -0.09476839005947113, 1.011345386505127, 0.7170342206954956, 1.1837400197982788, -0.27442666888237, -0.6521725058555603, -0.10304228961467743, -0.28035032749176025, -0.11622386425733566, -1.0250389575958252, 0.09618756175041199,...
def set _ expenses ( self, database _ input ) : self. database = database _ input
[ -0.6155130863189697, 0.22488732635974884, 0.28320223093032837, -0.2678610384464264, 0.40911200642585754, 0.7976858019828796, 0.3917335271835327, 1.0499261617660522, 0.4922207295894623, 0.3462635278701782, -0.9380766153335571, 0.43662795424461365, -0.7174308896064758, 0.9210438132286072, ...
def view _ count ( self ) : vc = defaultdict ( int ) for v in self. views : vc [ v. _ _ class _ _. _ _ name _ _ ] + = 1 return dict ( vc )
[ -0.24513126909732819, -0.059811826795339584, 0.4352508783340454, -0.17870891094207764, -0.8377318978309631, -0.4650554955005646, 0.8980158567428589, -0.20234063267707825, 0.2937910258769989, -0.8490476608276367, -0.8392232656478882, 0.01842038705945015, 0.7746086120605469, 1.05503046512603...
def euclideandistance ( input _ batch, weights, verbose ) : with tf. variable _ scope ('euclideandistance') : # compute the distance _ vectors between each weight ( or som neuron ) and the input _ batch per map. # input tensor shape weights : [ 1, num _ maps, num _ som _ neurons, weight _ vector _ size ] # input tensor...
[ 0.11746693402528763, -0.6418605446815491, 1.127924919128418, 0.6981361508369446, 0.3812842071056366, -0.1402493417263031, 0.17000731825828552, 0.5645551085472107, 0.45017388463020325, 0.3174343407154083, -0.2907651960849762, 0.04698677733540535, -0.15922020375728607, -0.04435667023062706, ...
def player ( self ) : if " b " in self. properties or " ab " in self. properties : return " b " else : return " w "
[ -0.4011201560497284, -1.1729075908660889, 0.6986741423606873, 0.26643437147140503, 0.410317599773407, 0.45962902903556824, 0.378146767616272, -0.6115211844444275, 0.8199042081832886, 0.19985538721084595, 1.35232675075531, 0.3006645739078522, -0.954738199710846, -0.0934358611702919, -0.48...
def calcular _ largo ( self, reticulado ) : ni = self. ni nj = self. nj xi = reticulado. xyz [ ni, : ] # [ xi, yi ] xj = reticulado. xyz [ nj, : ] # [ xj, yj ] largo = np. sqrt ( np. sum ( ( xi - xj ) * * 2 ) ) # print ( f " barra { ni } a { nj } xi = { xi } xj = { xj } " ) return largo
[ 1.2609326839447021, -0.4278748035430908, 0.30502572655677795, -0.6867172718048096, 0.010254775173962116, 0.1300424188375473, 0.6780266165733337, 0.24300824105739594, 0.09390919655561447, 0.3958239257335663, -0.395644873380661, 1.110245704650879, -0.6172319054603577, 0.2989575266838074, 0...
def filter _ diffraction ( self, sigma = none ) : print ('removing diffraction pattern...') if sigma is not none : self. sigma _ tof _ blur = sigma self. processed = self. processed / skfilt. gaussian ( self. processed, sigma = ( self. sigma _ tof _ blur, 0, 0 ) ) self. update _ history ('filter _ diffraction ', f'sigm...
[ 0.34417808055877686, 0.4811456799507141, 0.43717220425605774, 0.35141393542289734, -0.6283127069473267, 0.3670007288455963, 1.8953458070755005, 0.8876122236251831, 0.5565951466560364, 0.06709977239370346, -0.22944946587085724, 0.7520227432250977, -0.14934305846691132, 0.7380592226982117, ...
def multidict ( ordered _ pairs ) : # read all values into lists mdict = collections. defaultdict ( list ) for key, value in ordered _ pairs : mdict [ key ]. append ( value ) return dict ( # unpack lists that have only 1 item ( key, values [ 0 ] if len ( values ) = = 1 else values ) for key, values in mdict. items ( ) ...
[ -0.5838938355445862, 0.058750566095113754, 0.6922912001609802, 0.27812692523002625, -0.902874231338501, -0.14047709107398987, -0.08424738794565201, 0.7037916779518127, 0.3863011598587036, -0.3191148638725281, 0.0716366097331047, -0.9912340641021729, 0.4702553451061249, 1.0220940113067627, ...
def annotate _ proto ( self, text, annotators = none ) : properties = {'annotators': ', '. join ( annotators or self. default _ annotators ),'outputformat':'serialized ','serializer':'edu. stanford. nlp. pipeline. protobufannotationserializer'} r = self. _ request ( text, properties ) buffer = r. content # bytes size, ...
[ 0.12270517647266388, 0.20477642118930817, 0.33392226696014404, 0.29247188568115234, -0.760042130947113, 0.10606902837753296, -0.24972334504127502, 0.000896586338058114, -0.10276038199663162, -0.5320173501968384, -0.3745277523994446, 0.25420162081718445, -1.5846503973007202, -0.242044031620...
def bundlecompressiontopics ( ) : # help. makeitemsdocs ( ) expects a dict of names to items with a. _ _ doc _ _. items = { } # we need to format the docstring. so use a dummy object / type to hold it # rather than mutating the original. class docobject ( object ) : pass for name in compengines : engine = compengines [...
[ 0.05205634608864784, -0.48162171244621277, 0.43543103337287903, -0.14851534366607666, -0.2911401689052582, 0.006355821620672941, 0.14043308794498444, -0.5619701743125916, -0.6588413119316101, -0.08361763507127762, -0.08866024762392044, -0.6558355689048767, 0.27267950773239136, 0.5972179174...
def _ _ init _ _ ( self, document = none, x = 0, y = 0, z = 0, width = none, height = none, anchor _ x ='left ', anchor _ y ='baseline ', multiline = false, dpi = none, batch = none, group = none, rotation = 0 ) : super ( ). _ _ init _ _ ( document, width, height, multiline, dpi, batch, group ) self. _ x = x self. _ y ...
[ 0.5038977265357971, 0.19420190155506134, 0.505508303642273, 0.08994872123003006, -0.8005809783935547, -0.0019357347628101707, 0.407238632440567, 0.1667563021183014, 0.3063760995864868, -0.5497680902481079, -0.6753090620040894, -0.0638490840792656, 0.10845677554607391, -0.36085253953933716,...
def _ constrain ( self, model ) : return self. p _ ann * model. mx / self. f _ eff ( self. x _ kd ) # type : ignore
[ 0.35935133695602417, 0.624550461769104, 0.22032444179058075, 0.2652443051338196, -1.0191656351089478, 0.9997323751449585, 0.19437815248966217, -0.3150550425052643, -0.7642350792884827, 0.46862316131591797, 0.7852570414543152, -0.5296372175216675, -0.14689230918884277, 0.06577542424201965, ...
def query ( self, query _ point, num _ results = none, thresold = none ) : candidates = set ( ) d _ func = lsh _ search _ rp _ cosine. cosine _ dist for i, table in enumerate ( self. hash _ tables ) : binary _ hash = self. _ hash ( self. uniform _ planes [ i ], query _ point ) candidates. update ( table. get _ list ( b...
[ 0.1079433262348175, 0.02868502400815487, 0.6296501755714417, 0.4105543792247772, -0.05988822504878044, 0.3207049071788788, -0.4488271176815033, -0.3523988425731659, 0.04633219912648201, 0.0160945113748312, 0.035676658153533936, -0.09329112619161606, -0.5960640907287598, -0.6635657548904419...
async def profile ( ctx ) : if is _ channel _ block ( ctx ) : return prefix = await bot. get _ prefix ( ctx. message ) message _ string, message _ word _ length, user _ discord _ id, user _ discord _ name = get _ infos _ from _ msg ( ctx ) if message _ word _ length = = 2 and ('help'= = message _ string. split ( ) [ 1 ...
[ 0.35486817359924316, 0.6301103830337524, 1.221277117729187, 0.4294142723083496, 0.23055392503738403, 0.25958144664764404, 0.2650929093360901, -0.5829023718833923, -0.2157658040523529, 0.22780410945415497, -0.3237789571285248, 0.8840066194534302, 0.016781290993094444, 0.5135066509246826, ...
def get _ args ( ) : parser = argparse. argumentparser ( description ='makes an expanded list of variants for checking in suspected mosiac cases ', epilog ='see https : / / github. com / erikwaskiewicz / filter _ potential _ mosiacs / blob / master / readme. md for more details') parser. add _ argument ('run _ folder '...
[ 0.1425812840461731, -0.6361643671989441, 0.6357967853546143, -0.2894938588142395, -0.8779429197311401, -0.6139786839485168, 0.12923218309879303, 0.7330701351165771, -0.8523803353309631, 0.5811587572097778, -0.5076335668563843, 0.9548316597938538, -0.22010119259357452, 0.920448899269104, ...
def setup _ pipeline ( self ) : pass
[ 0.3824315071105957, -0.45836141705513, 0.18147504329681396, 0.09726643562316895, 0.63970947265625, -0.0006646447582170367, 0.3712862730026245, 0.6512507796287537, -0.567652702331543, -0.49085336923599243, 0.07619106769561768, -0.014721665531396866, 0.2795712351799011, 0.5240027904510498, ...
def calculatecpuhours ( program, numseqs, avglen, scale ) : return ( work _ factor [ program ] * float ( numseqs * avglen ) / float ( residues _ per _ core _ per _ hour ) ) * scale + 1
[ -0.2227603942155838, 0.37217870354652405, 0.3729892075061798, -0.4031788408756256, -0.6639740467071533, 0.5032078623771667, 0.5988847613334656, 0.4855993390083313, -0.7386095523834229, 1.4020812511444092, -0.5619056820869446, -0.6734510660171509, -0.833541214466095, 0.05492941290140152, ...
def site2geoloc ( site _ name : str, verbose : bool = false ) : # construct the geoolocation zero _ meter = 0. 0 * meter if site _ name = ='geocenter': geoloc = earthlocation ( x = zero _ meter, y = zero _ meter, z = zero _ meter ) else : geoloc = earthlocation. of _ site ( site _ name ) # report results if required if...
[ 0.738491952419281, 0.12949790060520172, 0.2707855999469757, -0.15277250111103058, -0.23586121201515198, -0.2875015139579773, 0.836605966091156, -0.3914046287536621, 0.3092420697212219, 0.506996214389801, 0.4621574580669403, 0.32268455624580383, 0.3038494884967804, -0.31652238965034485, -...
def setjobid ( self, idn ) : self. _ id = idn
[ -0.10382738709449768, -0.7653330564498901, 0.09822595864534378, 0.08679890632629395, 0.18745125830173492, 0.6293992400169373, -0.689776599407196, 0.2836047410964966, 0.12491186708211899, -0.798915684223175, -1.0053505897521973, 0.9099596738815308, -0.555815577507019, -0.0012041529407724738...
def find _ empty ( self ) : for i, group in enumerate ( self. matrix ) : for j, row in enumerate ( group ) : for x, event in enumerate ( row ) : if event = = " " : return ( i, j, x ) return none
[ -0.44388628005981445, -0.329620361328125, 0.5092145204544067, -0.5268545746803284, -0.28706008195877075, -0.6851956844329834, 0.6487138271331787, -0.6106417179107666, -1.2657252550125122, 0.8405902981758118, -0.09252625703811646, -0.46257710456848145, -1.111112356185913, -0.042619507759809...
def get _ data ( self ) : return self. data
[ -0.5205520987510681, -0.5703324675559998, 0.254232257604599, -0.2781188189983368, 0.2813197672367096, 1.0660920143127441, -0.6059504747390747, -0.6955323219299316, 0.10569999366998672, -1.7714205980300903, -0.3809586465358734, 1.0125470161437988, -0.1515723019838333, -0.44426894187927246, ...
def expected _ zero _ modes ( x0, masses ) : # assume that coordinate vector with 3 * n components belongs to a molecule # with n atoms assert len ( x0 ) % 3 = = 0 nat = len ( x0 ) / 3 # shift the origin to the center of mass x0 _ shift = molco. shift _ to _ com ( x0, masses ) # diagonalize the tensor of inertia to obt...
[ 0.1335860937833786, -0.2670501470565796, 0.7655118107795715, -0.726637065410614, 0.33737263083457947, 0.6071364879608154, 0.01760857366025448, 0.411552757024765, 0.08146288990974426, 0.07576485723257065, -0.18255645036697388, -0.6343717575073242, -0.9136001467704773, -0.21964018046855927, ...
def order _ pdf ( obj ) : url = reverse ('orders : admin _ order _ pdf ', args = [ obj. id ] ) return mark _ safe ( f'< a href = " { url } " > pdf < / a >')
[ -0.22644728422164917, -0.35672682523727417, 0.8034666776657104, -0.7774729132652283, 0.5103497505187988, -0.6305626034736633, -0.26011374592781067, 0.13930639624595642, 0.31335240602493286, -0.40359365940093994, 0.9057164192199707, 1.0186219215393066, 0.6296126842498779, -0.238753169775009...
def tree _ to _ json2 ( self, out _ json ) : tree _ names = [ ] # clf _ tree. feature is a list of indices, e. g. [ 0, 3, - 2, 1,... ] # each index of the list corresponds to a node in the tree # - 2 means the node is a leaf and hence does not have a feature # numbers other than - 2 are indices of self. feature _ names...
[ -0.3346863389015198, -0.49893495440483093, 0.6901533603668213, -0.08463917672634125, 0.2283312827348709, -0.36685287952423096, -0.16975215077400208, 0.48958244919776917, -0.872891366481781, 0.8654171824455261, -0.15582628548145294, 1.1694189310073853, 0.9009679555892944, 0.571612536907196,...
def split ( self, feature ) : outcomes = list ( set ( self. y. unique ( ) ) ) values = list ( set ( feature ) ) # cats if len ( values ) = = 1 : # there's no way to split the data... return 105, 0, 0, false elif len ( values ) < = 5 : # categorical features opts = self. select _ combinations ( values ) # combinations s...
[ -0.8958468437194824, 0.5176300406455994, 0.6288352608680725, 0.17984960973262787, 0.11248704791069031, -0.44154423475265503, 0.08518564701080322, 0.46945202350616455, -0.6543548107147217, 0.2466696798801422, -0.46971428394317627, -0.4019773602485657, -0.4110119342803955, -0.481322586536407...
def _ sign _ create _ validator ( transaction _ dict, private _ key ) : # preliminary steps if transaction _ dict [ " directive " ]! = directive. createvalidator : raise typeerror ( " only createvalidator is supported by _ sign _ create _ or _ edit _ validator " ) # first common step account, sanitized _ transaction = ...
[ 0.11318269371986389, 0.19623622298240662, 0.4971863925457001, -0.4838712215423584, -0.10263365507125854, -0.6617779731750488, 0.17296840250492096, -0.22463801503181458, -0.7187299132347107, 0.5885879993438721, -0.13582709431648254, -0.06238020956516266, -0.014343042857944965, 0.80954056978...
def eval _ gradient ( self, x, surrogate _ grad _ params ) : kernel _ name = self. kernel _ function. _ _ str _ _ ( ) if'nystroem'in self. kernel _ function. _ _ str _ _ ( ) : kernel _ name = self. kernel _ function. kernel _ name if'rationalquadratic'in kernel _ name : return self. grad _ rationalquadratic ( x, surrog...
[ -0.2995036244392395, 0.352684885263443, 0.8051214814186096, -0.008249270729720592, -0.12201192229986191, 0.3228156268596649, -0.7767734527587891, -0.210098534822464, -0.583400309085846, 0.057680726051330566, 0.26185667514801025, 0.9962998032569885, -0.8867281079292297, 0.5195382833480835, ...
def test _ get _ module _ mname _ fname _ default ( self ) : module = " " folder = " planetpopulation " # basic test m = get _ module ( module, folder ) self. validate _ module ( m, folder )
[ -0.18278291821479797, 0.02236049622297287, 0.32397910952568054, 0.8759282827377319, 0.9291797876358032, 0.5132889151573181, -0.2689615786075592, -0.22895587980747223, -0.1990693360567093, -0.6392117142677307, -0.13325007259845734, -0.13315549492835999, 0.06287094950675964, 0.48126450181007...
def set _ environment _ variables ( args ) : credentials = args. service _ account try : json _ credentials = json. loads ( credentials ) fd, path = tempfile. mkstemp ( ) print ( f'storing json credentials temporarily at { path }') with os. fdopen ( fd,'w') as tmp : tmp. write ( credentials ) os. environ ['google _ app...
[ -0.23985886573791504, -0.41174447536468506, 0.5743159651756287, -0.8746708631515503, -0.04119796305894852, 1.2701746225357056, 0.37172257900238037, -0.5762687921524048, -0.9058022499084473, 0.48071834444999695, 0.060170263051986694, 1.042127013206482, -0.2555009424686432, 0.630347371101379...
def _ execute _ child ( self, args, executable, preexec _ fn, close _ fds, cwd, env, universal _ newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite ) : if not isinstance ( args, types. stringtypes ) : args = list2cmdline ( args ) # process startup details if startupinfo...
[ 0.2379726767539978, -0.8235206604003906, 0.8738442063331604, 0.3309003710746765, -0.005173773970454931, 0.3286866247653961, 0.41512390971183777, -0.2466907799243927, -0.6805121302604675, -0.46373164653778076, -0.09395626187324524, -0.6070976853370667, 0.21935805678367615, 0.541598975658416...
def process _ and _ save _ fantasia ( plot = false, signal _ dim = 64 ) : signals _ without _ noise = [ ] signals _ noise = [ ] snr = [ ] full _ paths = get _ fantasia _ full _ paths ( db. fantasia _ ecgs [ 0 ]. directory, list ( range ( 1, 21 ) ) ) for file _ path in full _ paths : # try : print ( " pre - processing s...
[ 0.4740096628665924, 0.8428080081939697, 0.8846191167831421, 0.2914813756942749, -0.18508660793304443, -0.041865598410367966, 0.8716099858283997, 0.32365304231643677, -0.0304361954331398, -0.46724435687065125, -0.35354793071746826, 0.136442631483078, 0.7293853759765625, 1.1989672183990479, ...
def advanced _ heuristic ( board ) : # get the info of cars of the current state cars = board. cars # check if the goal car is at goal place : ( 2, 4 ) for car in cars : if car. is _ goal : if car. fix _ coord = = 2 and car. var _ coord = = 4 : return 0 blocking = - 1 blocking2 = 0 points = board. grid [ 2 ] for i in r...
[ -0.47233647108078003, 0.1814614087343216, 1.1844005584716797, -0.19145382940769196, -0.9856349229812622, -0.6221379041671753, 0.36493220925331116, 0.3818729817867279, -1.2232615947723389, 0.3658398687839508, -0.31943660974502563, 0.07640551775693893, -0.24831277132034302, 0.110039867460727...
def getaction ( self, state ) : action = qlearningagent. getaction ( self, state ) self. doaction ( state, action ) return action
[ -0.2602565586566925, -1.4807014465332031, 0.2861894369125366, -0.27148866653442383, 0.8733027577400208, -0.6029278635978699, -0.09596799314022064, -1.0260146856307983, 1.5006486177444458, -0.15650835633277893, -0.4080542027950287, 0.565944492816925, 0.8518173098564148, 0.0648656040430069, ...
def fetch _ partial _ book ( self, level : int = 10, block _ size : int = 5 _ 000 ) : return partial _ orderbook _ generator ( self. beginning _ update _ id - 1, self. symbol, level, block _ size )
[ -0.4891757369041443, -0.7797400951385498, 0.5123284459114075, 0.4490061104297638, -0.845394492149353, 0.12446559220552444, -0.0180131234228611, -0.7161808609962463, -0.6106358766555786, 0.34077563881874084, 0.09962878376245499, 0.4678817093372345, -1.2821626663208008, -0.21858231723308563,...
def current _ user _ friend ( self ) : return self. _ current _ user _ friend
[ 0.3897272050380707, -0.8594169616699219, 0.42531973123550415, 1.3405194282531738, -0.23366433382034302, 0.8098125457763672, 0.9991205930709839, -0.6569634675979614, -1.235237956047058, -0.46961840987205505, -0.03281230479478836, 0.5856605768203735, 0.13010592758655548, -1.1210925579071045,...
async def _ get _ bulk ( self ) - > " list [ tuple [ t, asyncio. future [ r ] ] ] " : max _ items, queue = self. _ size, self. _ queue # always pull in at least one item asynchronously # this avoids stalling for very low delays and efficiently waits for items results = [ await queue. get ( ) ] queue. task _ done ( ) de...
[ -0.5712326765060425, 0.4948268532752991, 0.8404186367988586, 0.0986609011888504, 0.8498632311820984, -0.4119000732898712, -1.2713327407836914, 0.3887832462787628, -0.8778175115585327, 0.006876369006931782, -0.14379779994487762, -0.6498072743415833, 0.6315116286277771, 0.03352922946214676, ...
def get _ color _ func ( self, word ) : try : color _ func = next ( color _ func for ( color _ func, words ) in self. color _ func _ to _ words if word in words ) except stopiteration : color _ func = self. default _ color _ func return color _ func
[ 0.3473784625530243, 0.19678868353366852, 0.47923144698143005, -0.3797515034675598, 0.4640815854072571, -0.871832549571991, 0.33193865418434143, -0.6020362377166748, -0.01068159006536007, 0.2845578193664551, 0.6255092620849609, 1.5533438920974731, -0.12876830995082855, 0.2654232978820801, ...
async def activate _ scene ( self, scene _ id : str ) : if scene _ id in self. scenes : await self. _ request ( " createrequest ", f " / virtualbutton / { scene _ id } / commandprocessor ", { " command " : { " commandtype " : " pressandrelease " } }, )
[ -0.9331137537956238, -0.6413426399230957, 0.39189624786376953, 0.16646993160247803, 0.7462135553359985, -0.6475130915641785, -0.47915276885032654, 0.5107355117797852, 0.959679126739502, 0.47723856568336487, -0.9069456458091736, 0.929167628288269, -0.7160513997077942, 0.39041292667388916, ...
def test _ valid _ read ( self ) : valid1 ='p00010000000e " hello world " }'message = read _ message ( valid1, _ proto _ version ) self. assertisinstance ( message, streamrequestpartmessage ) self. assertequal ( message. request _ id, " 0001 " ) self. assertequal ( message. payload,'" hello world " }')
[ 0.32544785737991333, -0.19255289435386658, 0.5981216430664062, 0.34909990429878235, -0.3601498603820801, 0.9652091264724731, -0.7785444855690002, -0.5066338181495667, 0.05153452977538109, -1.1041653156280518, 0.9224846959114075, -0.04447522386908531, -1.3496233224868774, -0.633745372295379...
def plot _ defaced ( bids _ dir, subject _ label, session = none, t2w = none ) : from bids import bidslayout from glob import glob from os. path import join as opj from matplotlib. pyplot import figure import matplotlib. pyplot as plt from nilearn. plotting import find _ cut _ slices, plot _ stat _ map layout = bidslay...
[ 0.3760676383972168, 0.37971654534339905, 0.8193562626838684, 0.07757933437824249, -0.15225385129451752, 0.7056121230125427, 1.3730090856552124, -0.6986098289489746, 0.2714853286743164, -0.09165380895137787, 0.24749456346035004, 1.349979281425476, 0.751691460609436, 1.145545244216919, -0....
def greet _ user ( first _ name, last _ name ) : first _ name = first _ name +'' + last _ name return first _ name. title ( )
[ 0.9377983808517456, -0.23527711629867554, 0.590861976146698, -0.4089762270450592, -0.29916539788246155, 0.2269589900970459, -1.9970217943191528, -0.4348158836364746, -0.9922866821289062, -0.325764924287796, 0.35205328464508057, 0.6206528544425964, 0.21253050863742828, 0.32503387331962585, ...
def num _ locations ( self ) : return len ( self. _ demands )
[ -0.32002153992652893, -0.011832128278911114, 0.37484028935432434, -0.061731450259685516, 0.3133741617202759, 0.7242991924285889, 0.14806734025478363, 0.19006142020225525, 0.2602086365222931, -1.495549201965332, -0.02324630320072174, -0.6476343870162964, 0.8789986968040466, -0.6332631707191...
def mstohms ( self, timems ) : s = timems / 1000 m, s = divmod ( s, 60 ) h, m = divmod ( m, 60 ) return h, m, s
[ -0.443842351436615, -0.32210618257522583, 0.4675869345664978, -0.31636250019073486, -0.4298762381076813, -0.31185024976730347, -0.6999062895774841, -0.11567594856023788, 0.102531798183918, 1.1381367444992065, -0.6345699429512024, -0.5714144110679626, -0.6371133327484131, -0.157753929495811...
def lane _ start ( self, h = 0 ) : focalx, focaly = self. focal _ length ('xy') # focal length ( pixels ) centerx, centery = self. get _ center ( ) # optical axis ( pixels ) aheadx, aheady, aheadz = self. ahead # straight ahead direction ( pixels ) width, height = self. get _ size ( ) # image dimensions ( pixels ) angl...
[ -0.21151010692119598, -0.911460816860199, 0.8356714248657227, -0.26019155979156494, 0.09263824671506882, 0.05069908872246742, 0.35474109649658203, -0.04561996087431908, 0.6041916608810425, 0.7851341962814331, -0.6290764808654785, 0.3372338116168976, 0.12049444764852524, 0.6571409702301025,...
def push _ model _ to _ sagemaker ( model _ name, model _ uri, execution _ role _ arn = none, assume _ role _ arn = none, bucket = none, image _ url = none, region _ name = " us - west - 2 ", vpc _ config = none, flavor = none, ) : import boto3 model _ path = _ download _ artifact _ from _ uri ( model _ uri ) model _ c...
[ -0.1415816992521286, 0.4052445888519287, 0.671479344367981, 0.05714934319257736, 0.2362116128206253, 0.08436468243598938, -0.41573449969291687, -0.13459259271621704, 0.07421872019767761, 1.1424341201782227, -0.4970772862434387, 0.7929244637489319, 0.3752829134464264, 0.16716192662715912, ...
def key _ pair _ name ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " key _ pair _ name " )
[ 0.04288165643811226, 0.0601888969540596, 0.3451186418533325, 0.3997412919998169, -0.9533503651618958, 1.4317659139633179, -0.17669889330863953, 0.04011577367782593, 0.0046592457219958305, 0.4798772931098938, 0.4078660309314728, 0.46547672152519226, -0.4413039982318878, -0.5257301926612854,...
def active _ bonds _ no _ rings ( initial _ species, fbonds, bbonds ) : logger. info ('removing breaking bonds that are also in the set of forming'' bonds') graph = initial _ species. graph. copy ( ) # add all the active bonds if they don't already exist for bond in bbonds + fbonds : if bond. atom _ indexes not in grap...
[ 0.0061486223712563515, -0.7363625764846802, 0.7258412837982178, -0.09106073528528214, -0.5281848311424255, 0.5165884494781494, 0.7375763654708862, -0.5835809707641602, -0.3187614381313324, -0.05834124982357025, -0.21724052727222443, -0.059220392256975174, -1.6294152736663818, -0.4689865708...
async def async _ step _ public _ weather ( self, user _ input : dict ) - > flowresult : if user _ input is not none and conf _ new _ area not in user _ input : self. options [ conf _ weather _ areas ] [ user _ input [ conf _ area _ name ] ] = fix _ coordinates ( user _ input ) self. options [ conf _ weather _ areas ] ...
[ -0.24352368712425232, -0.3685051202774048, 0.6031745672225952, 0.04165627807378769, -0.5229091048240662, 0.3971516191959381, 0.34941092133522034, 0.5308915972709656, -0.5659430027008057, 0.4213576018810272, -0.29177552461624146, 0.6358540654182434, 0.40265581011772156, 0.7524779438972473, ...
def getmodelview ( self ) : return self. view. cvalues ( )
[ -0.15292797982692719, -0.9723988771438599, 0.38502150774002075, 0.016332700848579407, -0.17101944983005524, 0.3404912054538727, -0.39474257826805115, -0.2482072114944458, -0.3952135145664215, -1.0466712713241577, -0.12670329213142395, 0.5397156476974487, 0.32310962677001953, 0.372004985809...
def _ _ init _ _ ( self, observations _ space : gym. space, actions _ space : gym. space, actor _ layers : optional [ tuple [ int ] ], critic _ layers : optional [ tuple [ int ] ], lam : float = 0. 1, b : float = 3, * args, * * kwargs ) : super ( ). _ _ init _ _ ( observations _ space, actions _ space, actor _ layers, ...
[ 1.061135172843933, 0.5737361311912537, 0.5620673298835754, 0.698781430721283, 0.7962296605110168, 0.19323663413524628, -0.36227890849113464, -0.19673706591129303, -0.05312611535191536, -0.5273531079292297, 0.20968085527420044, 0.6718226671218872, -0.03586660325527191, 0.7156282067298889, ...
def main ( ) : parser = argparse. argumentparser ( description = " compute all possible " " actions of a cyclic group on a curve. " ) parser. add _ argument ( " genus ", type = int, help = " genus of the starting curve " ) parser. add _ argument ( " branch ", type = int, nargs = " * ", help = " the i - th number is the...
[ 0.4974616467952728, -0.40913692116737366, 0.8258597254753113, 0.6312840580940247, 0.061009086668491364, 0.29934245347976685, 0.3144461512565613, 0.6038483381271362, -1.0789272785186768, 0.07207518070936203, 0.22497530281543732, 1.0901217460632324, -0.21535508334636688, 0.2518473267555237, ...
def set _ type _ async ( self, new _ type :'binaryninja. types. type') - > none : self. _ function. create _ user _ var ( self, new _ type, self. name )
[ -0.3540598750114441, 0.47976166009902954, 0.36535167694091797, 0.7106115221977234, 0.865989089012146, -0.25254490971565247, 0.7944201827049255, -1.1978825330734253, -0.5837292671203613, 0.42054179310798645, -0.9147459268569946, 1.5886682271957397, -0.10923507064580917, 0.3964185416698456, ...