text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def is _ valid _ choice ( choice ) : if choice = ='rock': return true if choice = ='paper': return true if choice = ='scissors': return true return false | [
-0.9788925647735596,
0.10353640466928482,
0.5574456453323364,
-0.19369620084762573,
-0.05356670171022415,
1.2838865518569946,
-0.4220082759857178,
-0.9323458671569824,
1.2803281545639038,
0.47016289830207825,
-0.4867500066757202,
0.07783237099647522,
-0.8506786823272705,
-0.782037019729614... |
def get _ total _ number _ of _ registered _ units _ by _ admission _ and _ year ( self, admission _ no ) : self. curr. execute ( " " " select count ( * ) from subjects as s inner join academic _ year as a on s. year = a. year _ id inner join units as un on s. unit = un. unit _ name inner join users as us on s. student... | [
0.16288034617900848,
-0.5446147918701172,
0.7691414952278137,
-0.3452974557876587,
0.2734515070915222,
0.06115902587771416,
1.1109504699707031,
0.3936392366886139,
0.09044434875249863,
0.15537258982658386,
0.2818627655506134,
0.7402244806289673,
0.4649381935596466,
0.15522466599941254,
0... |
def stringsinfunc ( self, func _ ea ) : results = [ ] for line in sark. function ( func _ ea ). lines : # string constants data _ refs = list ( line. drefs _ from ) for ref in data _ refs : # check for a string ( finds un - analyzed strings too ) str _ const = self. disas. stringat ( ref ) if str _ const is not none an... | [
0.657254695892334,
-0.5746856331825256,
0.4632349908351898,
-0.8400121927261353,
0.16420868039131165,
-0.45896482467651367,
0.3444192111492157,
-0.1225045695900917,
-0.19535398483276367,
-0.45758146047592163,
1.1632959842681885,
1.0029215812683105,
0.6183605790138245,
0.9005182385444641,
... |
def arms ( self ) : return self. _ q _ values. shape [ 0 ] | [
-0.049847595393657684,
0.32857978343963623,
0.3554205894470215,
-0.2081296294927597,
1.256205677986145,
1.3699626922607422,
-0.28359949588775635,
-0.2417016625404358,
0.5463610887527466,
-0.6628653407096863,
0.20118707418441772,
0.8388779759407043,
-0.350387305021286,
-0.006321532651782036... |
def read ( self, * * msg _ filter ) : return [ msg. text for msg in self. messages ( * * msg _ filter ) ] | [
-0.8588711619377136,
-0.5906616449356079,
0.5247465968132019,
0.7769492268562317,
-0.3355591595172882,
-0.42726147174835205,
-0.8729120492935181,
-0.0567251555621624,
-0.7068470120429993,
-0.142533078789711,
0.47133174538612366,
0.4455752968788147,
-0.4985288381576538,
0.7046722173690796,
... |
def backstab ( ) - > int : stab _ chance = random. randint ( 1, 10 ) if stab _ chance = = 1 : # 10 % chance of backstabbing print ('the monster stabbed you in the back!') damage = random. randint ( 1, 4 ) print ('you took ', damage,'damage before escaping.') return damage else : print ('you got away safely!') return 0 | [
0.11374752968549728,
0.30862900614738464,
0.6705486178398132,
-0.19023127853870392,
0.5425006747245789,
-0.38308337330818176,
0.6352803707122803,
-0.1301792562007904,
-0.10721214860677719,
0.2919166386127472,
-0.03926462680101395,
0.1970532238483429,
-1.2685397863388062,
-0.331009894609451... |
def create _ auth _ token ( sender, instance = none, created = false, * * kwargs ) : if created : token. objects. create ( user = instance ) | [
0.2625546455383301,
0.02517881989479065,
0.10726682096719742,
0.4691731333732605,
0.5145488977432251,
0.8394981622695923,
0.3098497688770294,
0.3727157711982727,
0.028465289622545242,
-0.9566648602485657,
-1.5324065685272217,
0.028760937973856926,
1.0139226913452148,
0.04803922772407532,
... |
def _ reload ( self, event, opts ) : self. smtp _ config _ section = opts. get ( config _ data _ section, { } ) | [
-0.7959975004196167,
0.13003715872764587,
0.30847907066345215,
-0.3408980369567871,
-0.6312440633773804,
-0.5431300401687622,
-0.4683731496334076,
0.37502795457839966,
-0.03784341737627983,
1.1269936561584473,
-0.7006603479385376,
0.8941926956176758,
0.4361284673213959,
-0.0501735210418701... |
def dequeue ( self ) - > object : if self. is _ empty ( ) : # queue underflow return - 1 else : self. size - = 1 if self. size = = 0 : self. front = self. rear = 0 else : self. rear = self. size - 1 return self. queue. pop ( 0 ) | [
-0.44038617610931396,
-0.6079350709915161,
0.9488474726676941,
-0.8256955742835999,
-0.3769698739051819,
-1.1589624881744385,
0.416303813457489,
0.038218602538108826,
-0.13873538374900818,
-0.5641086101531982,
-0.3665359616279602,
0.5498941540718079,
-0.712266206741333,
0.22500528395175934... |
def _ convert _ staking _ percentage _ to _ number ( value, ) : assert isinstance ( value, ( str, decimal ) ), " only strings or decimals are supported " if isinstance ( value, decimal ) : value = str ( value ) value1 = value if value [ 0 ] = = " - " : raise valueerror ( " negative numbers are not accepted " ) if value... | [
-0.14870385825634003,
0.19651052355766296,
0.9480069279670715,
0.1403978019952774,
-1.3794562816619873,
0.01460034865885973,
0.14305700361728668,
-0.25819018483161926,
-0.27877023816108704,
0.09773305803537369,
0.6889693737030029,
-0.09873565286397934,
-0.5589580535888672,
-0.7065711021423... |
def send _ event ( self, event ) : if not self. is _ connected or not self. conn : return data = struct. pack ( " < iiii ", event. msg _ type, event. where [ 0 ], event. where [ 1 ], event. extra ) self. conn. send ( data ) | [
-0.0953240841627121,
0.5356860160827637,
0.7229689359664917,
0.780516505241394,
0.0484691821038723,
0.5725638270378113,
-0.8682991862297058,
-0.14253050088882446,
0.3261767625808716,
0.4421631693840027,
-1.0710865259170532,
0.5213270783424377,
-0.8224731087684631,
-0.025362525135278702,
... |
def deterministic _ random ( input _ string ) : if isinstance ( input _ string, str ) : input _ string = input _ string. encode ('utf - 8') return float. fromhex ( hashlib. md5 ( input _ string ). hexdigest ( ) ) / math. pow ( 2, 128 ) | [
0.06425988674163818,
0.3421790301799774,
0.22212883830070496,
0.3930191099643707,
-0.7816573977470398,
0.5113760232925415,
-0.6619830131530762,
0.4857577681541443,
0.1473158448934555,
-0.7561538219451904,
0.1363551765680313,
-0.4671500623226166,
-0.7142869830131531,
0.1619023233652115,
-... |
def tftransform ( jet, tf ) : jet [ " content " ] = tf. transform ( jet [ " content " ] ) return ( jet ) | [
0.08187191933393478,
-0.5068342685699463,
0.08579599857330322,
-2.221978187561035,
-0.0362606942653656,
0.31312891840934753,
-1.3940250873565674,
-0.00732426205649972,
-1.2360819578170776,
-0.18375782668590546,
-0.8732099533081055,
-0.7442691922187805,
0.054495178163051605,
0.0537819266319... |
def fileno ( self ) : return 0 | [
0.14942960441112518,
-0.5189346075057983,
0.48055341839790344,
0.645362377166748,
0.4490266442298889,
0.6410062909126282,
1.2188689708709717,
1.4160795211791992,
-0.9879258275032043,
-2.045318126678467,
-0.4559348523616791,
0.12493228912353516,
0.4257678985595703,
0.9571993350982666,
-0.... |
def _ translate _ _ interfaces _ interface _ ipv6 _ autoconf ( input _ yang _ obj, translated _ yang _ obj = none ) : if input _ yang _ obj. create _ global _ addresses. _ changed ( ) : input _ yang _ obj. create _ global _ addresses = input _ yang _ obj. create _ global _ addresses if input _ yang _ obj. create _ temp... | [
-0.4831649959087372,
-0.25967639684677124,
0.24629946053028107,
-0.39875492453575134,
-0.35639095306396484,
-0.46179884672164917,
1.3670454025268555,
-0.5157105326652527,
0.5286604762077332,
0.6730850338935852,
-1.1147090196609497,
-0.3464299142360687,
-0.4010462462902069,
0.03436642512679... |
def display _ message ( ) : msg = " i'm learning to store code in functions. " print ( msg ) | [
0.845198929309845,
0.5786987543106079,
0.33916378021240234,
0.23693402111530304,
-0.015102686360478401,
0.11441189050674438,
0.46337130665779114,
-0.4698565900325775,
-0.23727673292160034,
-1.1246880292892456,
0.4983331859111786,
1.6980410814285278,
-0.514661967754364,
0.9790276288986206,
... |
def main ( instance _ type, max _ price _ overhead, hours, aws _ access _ key, aws _ secret _ key ) : averages = get _ avg _ price ( instance _ type, hours, aws _ access _ key, aws _ secret _ key ) zone, price = averages [ 0 ] ami = ( instance _ type, zone [ : - 1 ] ) print ('\ ninstances of type { instance _ type } ar... | [
0.12422773987054825,
-0.4857180118560791,
0.7239382266998291,
-0.2404521107673645,
0.3243162930011749,
0.08016000688076019,
0.5383096933364868,
-0.2455471307039261,
-0.3884126842021942,
1.101721167564392,
0.11010690033435822,
1.115858793258667,
0.6192094683647156,
0.2262435108423233,
0.8... |
def conn _ recv ( ) : client _ recv = client _ socket. recv ( buffer ). decode ('utf8') logging. info ( client _ recv ) | [
1.3058586120605469,
-0.802497148513794,
0.34711042046546936,
-0.8548368811607361,
-0.2771947383880615,
0.04816535487771034,
-0.5812736749649048,
0.5718652009963989,
-1.2584271430969238,
-0.16421590745449066,
-0.9286551475524902,
0.5872099995613098,
0.8844799995422363,
-1.2879680395126343,
... |
def shift _ pixel ( self, x, sf, upper _ left = true ) : h, w = x. shape [ : 2 ] shift = ( sf - 1 ) * 0. 5 xv, yv = np. arange ( 0, w, 1. 0 ), np. arange ( 0, h, 1. 0 ) if upper _ left : x1 = xv + shift y1 = yv + shift else : x1 = xv - shift y1 = yv - shift x1 = np. clip ( x1, 0, w - 1 ) y1 = np. clip ( y1, 0, h - 1 ) ... | [
-0.2944801151752472,
0.24877895414829254,
0.8306530117988586,
0.46616673469543457,
-0.5232034921646118,
1.0576677322387695,
-0.06383085250854492,
-0.14072377979755402,
0.22474320232868195,
-0.0086373807862401,
0.6456934213638306,
0.20224010944366455,
0.16897399723529816,
0.0558534115552902... |
def test _ gf _ write _ scenario _ header _ with _ tags ( given _ rule _ type, expected _ indentation, disabled _ colors, capsys, mocker ) : # given scenario = mocker. magicmock ( spec = scenario ) scenario. keyword = " scenario " scenario. rule = mocker. magicmock ( spec = given _ rule _ type ) scenario. short _ descr... | [
-0.028444988653063774,
-0.7872872352600098,
0.662320077419281,
0.6891258955001831,
0.7480136156082153,
-0.18146353960037231,
-0.20248891413211823,
-0.0036109236534684896,
-0.9617010951042175,
-0.016795961186289787,
-0.45423832535743713,
-0.41124531626701355,
-0.058179453015327454,
0.187901... |
def manual _ blocks ( redis _ host, namespace ) : # manual blocks conn = redis. redis ( redis _ host ) l _ namespace = len ( namespace ) blocks = { } log = logging. getlogger ('stats. blocks') keys = conn. keys ( namespace +'* : block') if keys : for wholekey in keys : # remove namespace and : block ttl = conn. ttl ( w... | [
-0.25454747676849365,
0.3815962076187134,
0.6552227139472961,
-0.6335850954055786,
-0.579302191734314,
-0.565028190612793,
-0.8669857382774353,
-1.0474716424942017,
-0.38001003861427307,
1.3000383377075195,
-0.9436870813369751,
0.25710102915763855,
0.5135802030563354,
1.1424163579940796,
... |
def test _ get _ vcs _ root _ entries ( self ) : pass | [
0.8614819645881653,
-0.09801648557186127,
0.14287617802619934,
1.5825392007827759,
0.5662407875061035,
0.009349390864372253,
0.6373594999313354,
-0.48592597246170044,
0.556239128112793,
-0.584693193435669,
-0.5908662676811218,
0.5936591029167175,
-1.460157871246338,
0.47967010736465454,
... |
def replace _ chain ( self ) : # get network to search for longest chain network = self. nodes # initialize ` longest _ chain ` variable longest _ chain = none # get the current max length max _ length = len ( self. chain ) # search network for longer chains for nodes in network : # get response from node response = re... | [
-0.5693353414535522,
0.4304334223270416,
0.6825948357582092,
-0.7158643007278442,
0.8695080280303955,
-0.04366364702582359,
-1.048519253730774,
-0.09049975126981735,
-0.3247138559818268,
-0.5614537596702576,
-0.6897059679031372,
0.2140735536813736,
-0.6096826195716858,
-0.00833203922957182... |
def rnn _ cell ( self, n _ cells ) : activation = self. activation ( name = self. rnn _ activation ) with tf. device ('/ cpu : 0') : with tf. name _ scope ('rnn _ cell') : if self. rnn _ cell _ type = ='blstm': rnn _ cell = tf. contrib. rnn. basiclstmcell ( n _ cells, activation = activation ) elif self. rnn _ cell _ t... | [
0.2665894627571106,
0.12809929251670837,
0.5570725202560425,
0.4348963499069214,
0.3949522376060486,
-0.019383905455470085,
0.463590532541275,
-0.8790409564971924,
-0.20436173677444458,
0.24964438378810883,
0.14210593700408936,
0.07232403010129929,
0.0495217926800251,
0.3767540156841278,
... |
def get _ step ( self, q, qd = none ) : if self. _ last _ q is none : self. _ last _ q = q self. _ init _ event. set ( ) return q # todo, just for testing here, not neccessary else : self. _ last _ q = q if not self. _ has _ target : return q # calculate next step self. _ step _ count + = 1 if self. _ step _ count < = ... | [
-0.7516381144523621,
0.08302437514066696,
0.7228023409843445,
-0.2535213828086853,
-0.4636678695678711,
0.17658165097236633,
0.1706649661064148,
-0.18952713906764984,
-0.7352015376091003,
-0.8271499872207642,
0.4869717061519623,
-0.20738179981708527,
-0.3097839057445526,
0.0751699805259704... |
def sql ( ctx, environment, resource ) : resource _ id = ctx. obj. get _ resource ( environment, resource ) ctx. obj = metrics. create _ interface ( client = get _ client _ from _ cli _ profile ( monitormanagementclient ), resource _ id = resource _ id, interface = sqlmetrics, ) | [
1.3308480978012085,
0.7418215274810791,
0.7401394844055176,
-0.6367315053939819,
0.26088982820510864,
0.5414104461669922,
-0.4727303087711334,
-1.2703145742416382,
-0.45012903213500977,
0.1282760500907898,
0.5615125298500061,
0.5864294767379761,
-0.28887197375297546,
-0.31881895661354065,
... |
def processrules ( cf, is _ quiet ) : out = { } for name in ('incoming ','outgoing') : out [ name ] = processrules ( cf, name ) if not is _ quiet : out [ name ]. print _ records ( f'{ name } - { cf. outdirs [ " rules " ] [ name ] }') return out | [
-0.2587665319442749,
0.5109493732452393,
0.4114440679550171,
-1.3227322101593018,
0.33846786618232727,
-0.4478481709957123,
0.035418685525655746,
-0.4423643946647644,
-1.1561061143875122,
0.48160868883132935,
-0.3825065493583679,
-0.009729038923978806,
-0.28999337553977966,
1.0166161060333... |
def download _ courses ( driver, base _ dir = ". / downloads / ", verbose = false ) : try : courses _ list = driver. find _ element _ by _ xpath ('/ / * [ @ id = " main " ] / div [ 3 ] / div / ul'). find _ elements _ by _ tag _ name ( " li " ) courses _ list = list ( map ( lambda c : c. text. split ( " " ) [ 0 ], cours... | [
-0.24949580430984497,
-0.4911566376686096,
0.727486789226532,
1.4148656129837036,
1.2951856851577759,
-0.5373029708862305,
0.16924957931041718,
0.2567217946052551,
0.5426225066184998,
0.7441756129264832,
-0.09675164520740509,
0.4405771493911743,
-0.14662741124629974,
0.7469879984855652,
... |
def calc _ iffilt _ ratio _ actual ( self, model ) : model. vars. iffilt _ ratio _ actual. value = self. iffilt _ ratio [ model. vars. rac _ iffiltctrl _ centfreq. value ] | [
-0.07227719575166702,
-0.5443288087844849,
0.4469020962715149,
-0.43119651079177856,
-0.06285550445318222,
-0.10921137779951096,
0.5517264604568481,
-0.29704734683036804,
-0.8625636696815491,
0.41948074102401733,
0.10406386107206345,
-0.5557436943054199,
-0.5925734639167786,
0.060491234064... |
def read _ lines ( filename = " ", nb _ lines = 0 ) : with open ( filename,'r ', encoding = " utf - 8 " ) as file : lines = file. readlines ( ) if nb _ lines < = 0 or nb _ lines > = len ( lines ) : for line in lines : print ( line, end ='' ) else : lines = lines [ 0 : nb _ lines ] for line in lines : print ( line, end ... | [
0.9235767722129822,
0.027999982237815857,
0.6396751999855042,
0.8414069414138794,
0.6557736396789551,
0.7909612655639648,
-0.8053581118583679,
0.31525087356567383,
-0.8418852090835571,
-0.09655572474002838,
1.330703616142273,
0.02613767422735691,
0.19189900159835815,
0.4808265268802643,
... |
def bypass _ deepmergedcoaddid _ bits ( self, * args, * * kwargs ) : return 64 - ztfmapper. _ nbit _ id | [
-0.9631231427192688,
0.4961322247982025,
0.49359872937202454,
0.2586940824985504,
0.39000359177589417,
1.2617061138153076,
1.6882253885269165,
-1.157541275024414,
0.443105012178421,
-0.8700302243232727,
-0.501852810382843,
1.231056571006775,
-1.4244375228881836,
1.074175477027893,
-0.381... |
def fetch ( self, fname ) : if fname not in self. registry : raise valueerror ( " file'{ }'is not in the registry. ". format ( fname ) ) full _ path = self. abspath / fname in _ storage = full _ path. exists ( ) update = in _ storage and file _ hash ( str ( full _ path ) )! = self. registry [ fname ] download = not in ... | [
0.05897406488656998,
-0.4244416356086731,
0.5869364142417908,
0.4039562940597534,
-0.48256099224090576,
0.36392030119895935,
0.2508935034275055,
-0.6791072487831116,
-0.11687866598367691,
0.48755982518196106,
0.874187171459198,
-0.5531911849975586,
0.20186592638492584,
0.21197882294654846,... |
def delete _ expense ( self, username, id _ item ) : # look if the key " id _ item " is inside the dictionary first if id _ item in self. database [ username ] : # delete the key from the dictionary del self. database [ username ] [ id _ item ] | [
-0.6633467674255371,
-0.2550279200077057,
0.26780691742897034,
0.15240158140659332,
-0.21342624723911285,
0.08456408977508545,
-0.33298343420028687,
1.1744059324264526,
0.5977810025215149,
1.0137993097305298,
-0.3080889880657196,
-0.5236311554908752,
-1.065088152885437,
-0.3499841988086700... |
def _ post _ and _ getattr ( self, i ) : attr = _ getattr ( i ) self. _ post ( ) return attr | [
-0.8351284265518188,
-0.3156927227973938,
0.545309841632843,
-0.08343897014856339,
-0.5037861466407776,
-0.4831516146659851,
0.3136323392391205,
-0.8179898262023926,
-0.0832509994506836,
-0.783332884311676,
-0.4356987774372101,
-0.641687273979187,
-0.024360140785574913,
0.3790683150291443,... |
def test _ missing _ parameters ( self ) : response = self. _ auth _ request ('get') self. assertequal ( response. status _ code, 200 ) self. assertequal ( bool ( response. content ), true ) | [
-0.44339653849601746,
-0.15595872700214386,
0.5297403931617737,
-0.14060108363628387,
0.8297066688537598,
1.3489148616790771,
-0.8558236360549927,
-0.10732924193143845,
-0.39900606870651245,
0.2735787630081177,
-0.45668140053749084,
0.03826780244708061,
-0.051484350115060806,
-0.0394052527... |
def test _ get _ current _ vcs _ instances ( self ) : pass | [
-0.8708993792533875,
-0.09755861014127731,
-0.11716526746749878,
0.644151508808136,
0.34783652424812317,
0.5323632955551147,
1.0232679843902588,
-0.34861254692077637,
-0.44797033071517944,
-0.5001930594444275,
-0.2098914533853531,
-0.10681033134460449,
-1.8831195831298828,
-0.3941875398159... |
def test _ find _ branch ( self ) : query = query ('fakeyfakeyfakefake') series = self. finder. get _ all _ series ( query ) seen _ branches = set ( ) split _ pattern = query. pattern. split ( '.') branches = [ b for b in [ self. finder. find _ branch ( split _ pattern, path. split ( '.'), path, query, seen _ branches ... | [
0.1832442581653595,
0.5944949984550476,
0.7458385825157166,
-0.0899786427617073,
1.2066094875335693,
0.4596371054649353,
0.5070948004722595,
-0.404911607503891,
-0.5204923152923584,
0.05925670638680458,
-0.14060497283935547,
-0.05105729028582573,
-0.12886589765548706,
-0.19186080992221832,... |
def rocreset ( self ) : self. pgset ( ( dtb. pg _ rest + 60, ) ) self. pg _ single ( ) | [
0.38870352506637573,
0.8651987314224243,
0.30197423696517944,
-0.5745362043380737,
1.2126972675323486,
-0.1935654878616333,
0.6528335809707642,
-0.42352956533432007,
-0.511752724647522,
0.2945321202278137,
-0.10666174441576004,
0.7682545781135559,
-1.1972506046295166,
-1.70790696144104,
... |
def show ( self ) : raise notimplementederror ( ) | [
0.466693639755249,
-0.189143568277359,
0.3144112825393677,
-0.2606159448623657,
-0.4363914132118225,
1.1119492053985596,
0.6174374222755432,
0.47757986187934875,
0.33305180072784424,
-0.31465399265289307,
0.5373587608337402,
0.9394598007202148,
0.5574912428855896,
0.6648370027542114,
-0.... |
def test _ invalid _ type _ channel _ presence ( ) : with pytest. raises ( typeerror ) : mob. channel _ presence ('invalid type input') | [
0.4706542491912842,
-0.8055804371833801,
0.5963598489761353,
0.29654237627983093,
1.3579678535461426,
1.162118911743164,
0.057554323226213455,
-0.3372739553451538,
-0.2848512828350067,
0.09672487527132034,
0.3406907618045807,
0.11584195494651794,
-0.8734723925590515,
0.8600140810012817,
... |
def is _ maze _ path ( start, end, maze ) : # base case : at end point if start = = end : return true # mark current point as visited maze [ start. x ] [ start. y ] = 0 for pos in [ coordinate ( start. x + 1, start. y ), coordinate ( start. x, start. y + 1 ), coordinate ( start. x - 1, start. y ), coordinate ( start. x... | [
-0.10433033108711243,
0.02696191519498825,
0.6948872804641724,
1.1871358156204224,
0.006034192629158497,
-0.1027124747633934,
1.0713725090026855,
-0.004305709153413773,
-0.3573524057865143,
0.9884095191955566,
-0.31188955903053284,
0.19972297549247742,
-0.9236631393432617,
0.03871193528175... |
def infer ( self, model _ name : str, inputs : list [ inferinput ], model _ version : str =..., outputs : list [ inferrequestedoutput ] =..., request _ id : str =..., sequence _ id : str =..., sequence _ start : bool =..., sequence _ end : bool =..., priority : int =..., timeout : int =..., client _ timeout : int =...,... | [
-0.8437744379043579,
-0.3950822651386261,
0.8724517822265625,
0.7967140674591064,
-0.16679728031158447,
-0.29243436455726624,
-0.7485352158546448,
-0.3305591940879822,
-0.7109209895133972,
0.15020963549613953,
-1.0753138065338135,
0.019326556473970413,
-0.8432233929634094,
0.22005805373191... |
def resource _ group _ name ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " resource _ group _ name " ) | [
0.4544117748737335,
0.7019188404083252,
0.17967993021011353,
-0.5626401901245117,
-0.42462530732154846,
0.7665671706199646,
0.1944749355316162,
-0.13457730412483215,
-0.02691560797393322,
0.1521996557712555,
0.7909400463104248,
0.4696037471294403,
0.10001365095376968,
-0.1683320701122284,
... |
def testupdatevaluesforquerieswithuncreatablepaths ( self ) : tagapi ( self. user ). create ( [ ( u'username / bar ', u'description') ] ) # fixme replace this with securetagvalueapi once the index is # integrated values = { uuid4 ( ) : { u'username / bar': 42 } } securetagvalueapi ( self. user ). set ( values ) rundata... | [
-0.3455624282360077,
0.7216699719429016,
0.3529488742351532,
-0.03892946243286133,
0.39493754506111145,
0.6730737686157227,
0.13442663848400116,
-0.3062407970428467,
-0.8072831034660339,
-0.22653962671756744,
-0.46149101853370667,
-0.8150540590286255,
0.2209583818912506,
0.4408378899097442... |
def dealwithfile ( self, file _ path ) : # parse file incident _ entry _ df = self. incidentwrapper. parseincidentfromfile ( file _ path ) print ( incident _ entry _ df ) # deal with file id = self. deal ( incident _ entry _ df ) os. remove ( file _ path ) self. inform ('[ main ] : dealwithfile ( ) : file was dealt - w... | [
1.0288642644882202,
-0.9741888046264648,
0.5544869899749756,
0.19323033094406128,
0.44960543513298035,
0.2536020576953888,
0.54923415184021,
0.7076416015625,
-0.2932431995868683,
-0.5497725605964661,
-0.055927012115716934,
-1.1028826236724854,
-0.7437940239906311,
-0.2087155431509018,
0.... |
def update _ group ( self, group _ id, title, description, logged _ in _ user _ id, access _ token, client _ token, * * kwargs ) : kwargs ['_ return _ http _ data _ only'] = true if kwargs. get ('callback') : return self. update _ group _ with _ http _ info ( group _ id, title, description, logged _ in _ user _ id, acc... | [
-1.0538218021392822,
-0.10500822961330414,
0.6101307272911072,
0.4642724394798279,
-0.9937132000923157,
0.179258331656456,
-0.648516833782196,
-0.7967749834060669,
0.3723495602607727,
0.09837094694375992,
0.6264606714248657,
1.2690165042877197,
-0.883111298084259,
0.6498078107833862,
0.3... |
def getfkvshiftspeedf ( index ) : andor _ solis. getfkvshiftspeedf. restype = ctypes. c _ uint speed = ctypes. c _ float ( ) result = andor _ solis. getfkvshiftspeedf ( ctypes. c _ int ( index ), ctypes. byref ( speed ) ) check _ status ( result ) return float ( speed. value ) | [
-0.04875819757580757,
0.4727645814418793,
0.33233731985092163,
0.6050527691841125,
0.1865755170583725,
-1.3278027772903442,
0.22203165292739868,
-1.0930660963058472,
0.4626814126968384,
-0.3415036201477051,
-0.4196827709674835,
0.06819158792495728,
-1.2803977727890015,
0.26840347051620483,... |
def or _ today ( date ) : return date if date is not none else datetime. date. today ( ) | [
0.00027211508131586015,
0.5466945171356201,
0.5019543766975403,
0.016535332426428795,
0.36897146701812744,
-0.38072624802589417,
-0.9631779789924622,
-0.6829739212989807,
0.31022241711616516,
-0.5325621962547302,
0.6527361273765564,
-0.3914189040660858,
0.5398266315460205,
0.32599669694900... |
def nothing ( self, x ) : pass | [
-0.9144965410232544,
-0.17409713566303253,
0.13185657560825348,
-0.05251235514879227,
0.6983916759490967,
0.8740435838699341,
-0.05837684124708176,
-1.1738961935043335,
0.04748719185590744,
-0.9964962005615234,
-1.7324819564819336,
0.9394282102584839,
-0.21699412167072296,
-0.5430874824523... |
def test _ milestone _ view _ project _ exists _ with _ milestones ( self ) : project = create _ project _ and _ milestones ( " title ", 3 ) milestone = milestone. objects. get ( id = 1 ) response = self. client. get ( reverse ('projects : milestone ', args = ( 1, 1 ) ) ) self. assertnotequal ( response. status _ code,... | [
-0.02223316952586174,
0.501593828201294,
0.39875251054763794,
-0.11390271037817001,
0.6060824394226074,
1.3637621402740479,
0.29281964898109436,
0.28005626797676086,
0.5004621744155884,
-0.22582444548606873,
0.40753042697906494,
-0.2553301453590393,
-0.8485019207000732,
0.03892676532268524... |
def battle ( character : dict, monster : dict ) : combatants = [ character, monster ] # index 0 is attacker, 1 is defender random. shuffle ( combatants ) continue _ battle = true while continue _ battle : modify _ hp ( combatants [ 1 ], attack ( combatants [ 0 ], combatants [ 1 ] ) ) print ('\ n') temp = combatants [ 0... | [
-0.1137276440858841,
-0.8063985705375671,
0.7844853401184082,
-0.13833372294902802,
1.011973261833191,
0.4034122824668884,
-0.7364345192909241,
0.6420527696609497,
-0.15252090990543365,
0.33005836606025696,
0.08299295604228973,
0.6585193276405334,
-0.7265706062316895,
0.39666491746902466,
... |
def _ _ init _ _ ( self, part _ id = none, part _ type = none, properties = none, href = none, is _ mesh = none, thumbnail = none ) : # noqa : e501 # noqa : e501 self. _ part _ id = none self. _ part _ type = none self. _ properties = none self. _ href = none self. _ is _ mesh = none self. _ thumbnail = none self. disc... | [
0.9799209237098694,
-0.20291273295879364,
0.6292371153831482,
0.26229923963546753,
0.29730576276779175,
0.07799646258354187,
-0.2946520447731018,
0.16070963442325592,
0.7044098973274231,
-0.7388683557510376,
-0.39713966846466064,
0.3674051761627197,
-0.4051418900489807,
0.41861116886138916... |
def _ _ init _ _ ( _ _ self _ _, *, additional _ services : optional [ pulumi. input [ sequence [ pulumi. input [ str ] ] ] ] = none, app _ id : optional [ pulumi. input [ str ] ] = none, custom _ namespaces _ per _ services : optional [ pulumi. input [ sequence [ pulumi. input ['integrationcustomnamespacesperservicear... | [
0.2542736232280731,
0.9501568675041199,
0.8437631130218506,
-0.3246155381202698,
0.09643400460481644,
0.38059380650520325,
-0.5239189267158508,
-0.172944575548172,
0.7299346327781677,
0.792443573474884,
-0.5147573351860046,
0.06300487369298935,
0.07379946112632751,
-0.38359716534614563,
... |
def _ augment _ image _ and _ bbox ( self, image, bbox ) : image _ shape = tf. cast ( tf. shape ( image ), tf. float32 ) image _ height, image _ width = image _ shape [ 0 ], image _ shape [ 1 ] image = augmentations. random _ exterior _ exclusion ( image ) bbox = augmentations. random _ bbox _ jitter ( bbox, image _ he... | [
-0.5893232822418213,
0.1463608741760254,
0.7840019464492798,
-0.7722315192222595,
0.5259251594543457,
0.06758300960063934,
-0.4416138231754303,
-0.22033943235874176,
0.6876840591430664,
-0.029382705688476562,
0.14492365717887878,
0.4147273302078247,
0.4008725583553314,
0.5523014068603516,
... |
def get _ server ( self ) : if self. server is none : # todo : rewrite this to use ids or something? return empty ( ) for ip in self. manager. ips : if ip. address = = self. address : return ip return none # line should only be reached if above'if'never came true. | [
-0.7601701021194458,
-0.42578279972076416,
0.45004960894584656,
0.20871494710445404,
-0.17369477450847626,
-0.6002038717269897,
-0.5390653610229492,
-0.2401329129934311,
0.7475683689117432,
-0.6786139607429504,
0.5695652365684509,
0.10157814621925354,
-0.8232545852661133,
0.069911919534206... |
def test _ get _ metric _ annotation ( self ) : self. assertisinstance ( get _ metric _ annotation ( ), dict ) self. assertisinstance ( get _ metric _ annotation ( ). get ('status'), str ) | [
0.8810656070709229,
0.14376500248908997,
0.18548396229743958,
0.5551711320877075,
-0.05053725093603134,
0.6114827990531921,
-0.5007230043411255,
0.42584407329559326,
-0.1906304657459259,
-0.050268255174160004,
-0.22390851378440857,
0.2662051320075989,
0.4752868711948395,
0.0305250771343708... |
def _ _ repr _ _ ( self ) : return " uf ( " + str ( self ) + " ) " | [
-0.4598763883113861,
-0.6130438446998596,
0.5279966592788696,
-1.2865593433380127,
-0.30620867013931274,
0.06693284958600998,
0.5329846143722534,
0.7664221525192261,
0.24000778794288635,
-0.2192053645849228,
0.2555708885192871,
0.13636286556720734,
0.4635128378868103,
-0.780885636806488,
... |
def _ _ new _ _ ( * args, * * kwargs ) :... | [
-0.0436173751950264,
-0.8444678783416748,
0.5263926982879639,
0.2011795938014984,
-0.08454181253910065,
-0.46563097834587097,
-0.13516585528850555,
-0.8261533379554749,
-0.8478197455406189,
-0.5367724299430847,
-0.7461814284324646,
0.2921355962753296,
0.38878145813941956,
0.298933863639831... |
def get _ status _ type ( line ) : return is _ status _ line ( line ) and get _ field ( status _ type _ field, line, status _ field _ count ) | [
0.2918739318847656,
0.2223857343196869,
0.33389076590538025,
1.024025321006775,
0.7668288350105286,
-0.10488634556531906,
-0.15939192473888397,
0.021284818649291992,
0.12636889517307281,
-0.20236137509346008,
-0.9105991721153259,
-0.5209522247314453,
-0.14251910150051117,
0.022553378716111... |
def register _ errors _ handler ( self, callback, *, exception = none, func = none ) : filters _ list = [ ] if func is not none : filters _ list. append ( func ) if exception is not none : filters _ list. append ( exceptionsfilter ( exception ) ) self. errors _ handlers. register ( callback, filters _ list ) | [
-0.6766852140426636,
0.696700930595398,
0.5658939480781555,
0.2627656161785126,
0.2421441376209259,
-0.24552960693836212,
-0.7029868960380554,
0.9478820562362671,
0.6253879070281982,
-0.26873522996902466,
-0.41535794734954834,
0.9760120511054993,
-0.26762139797210693,
0.7443782687187195,
... |
def label1on ( self ) : # noqa : n802 return self. _ label1on and self. _ need _ lower ( ) | [
0.04215655103325844,
-0.6294509172439575,
0.1877279132604599,
0.54240882396698,
-0.0271188672631979,
1.4804075956344604,
-0.3630368709564209,
-0.3879709541797638,
0.539548397064209,
0.655966579914093,
0.31964102387428284,
0.1443118304014206,
-1.8197736740112305,
0.9571820497512817,
-0.97... |
def _ make _ testval _ params ( self, test _ split, val _ split ) : if test _ split > 0. 0 : self. test = { " split " : test _ split } if val _ split > 0. 0 : self. validation = { " split " : val _ split } self. train = { " split " : 1. 0 - ( val _ split + test _ split ) } else : self. validation = false self. train = ... | [
-0.4749089479446411,
0.2977989912033081,
0.47945156693458557,
-0.46122047305107117,
-0.4166090786457062,
0.13096000254154205,
0.3206522464752197,
0.5191940665245056,
-0.7344942092895508,
-0.05045613646507263,
-0.26308727264404297,
-0.5153579115867615,
0.020976589992642403,
0.09987732768058... |
def calculate _ shortest _ hop _ path ( self, topology, src, dst ) : if topology is not none : total _ cost = 0 self. topology. database [ dst ] [ src ] ['cost'] = self. weighted _ cost * self. topology. database [ dst ] [ src ] ['cost'] self. topology. database [ src ] [ dst ] ['cost'] = self. weighted _ cost * self. ... | [
-0.31833183765411377,
0.14639073610305786,
0.6407905220985413,
0.3176663815975189,
-0.5507588386535645,
-0.319455087184906,
0.6731216311454773,
0.45145800709724426,
0.41954702138900757,
0.43864279985427856,
0.2890334725379944,
-0.46687957644462585,
-0.09777277708053589,
-0.1344608962535858... |
def preprocess _ tweet _ text ( tweet _ text ) : # remove " rt " tags. preprocessed _ tweet _ text = re. sub ( " rt ", " ", tweet _ text ) # remove url's. preprocessed _ tweet _ text = re. sub ( " http [ s ]? : / / \ s + ", " slo _ url ", preprocessed _ tweet _ text ) # remove tweet mentions. preprocessed _ tweet _ tex... | [
1.0434339046478271,
-0.8962821364402771,
0.6420957446098328,
-0.5987589955329895,
0.001113571343012154,
0.07696180045604706,
-0.035613659769296646,
1.0098979473114014,
0.46687430143356323,
-0.027256745845079422,
-0.8136231303215027,
-0.17426025867462158,
-0.24780139327049255,
0.51723164319... |
def _ split ( self ) : if not self. is _ leaf ( ) : return self. _ children = ( occupancyoctonode ( self. probability ), occupancyoctonode ( self. probability ), occupancyoctonode ( self. probability ), occupancyoctonode ( self. probability ), occupancyoctonode ( self. probability ), occupancyoctonode ( self. probabili... | [
-0.23420646786689758,
0.1349678635597229,
0.5729485750198364,
-0.3642187714576721,
0.5722341537475586,
0.30653512477874756,
0.45531752705574036,
0.31199488043785095,
-0.09250231087207794,
0.10443434119224548,
0.07204951345920563,
-0.6672296524047852,
0.0023100366815924644,
-0.6212155818939... |
def downsample _ 2d ( hidden _ states, kernel = none, factor = 2, gain = 1 ) : assert isinstance ( factor, int ) and factor > = 1 if kernel is none : kernel = [ 1 ] * factor kernel = torch. tensor ( kernel, dtype = torch. float32 ) if kernel. ndim = = 1 : kernel = torch. outer ( kernel, kernel ) kernel / = torch. sum (... | [
0.2747558355331421,
-0.11827850341796875,
0.8708282709121704,
0.12738564610481262,
-0.8386268615722656,
-0.20238544046878815,
0.048769041895866394,
-0.40086060762405396,
0.009481251239776611,
-0.7644826173782349,
-0.023996736854314804,
0.1078970730304718,
0.007798303849995136,
0.3245865106... |
def date _ sql2iso ( datefirst ) : # strftime ( " % y - % m - % dt % h : % m : % s. % fz " ) # there is no rfc for xml datetime? # rather based on iso 8601 # it is expressed in the format [ - ] [ y * ] yyyy - mm - ddthh : mm : ss [. s [ s * ] ] [ tzd ]. # 2002 - 03 - 21t19 : 47 : 35z yy = atpic. log. setname ( xx,'get ... | [
0.8621464371681213,
0.3275657594203949,
1.0237177610397339,
0.2816416323184967,
-1.075693130493164,
-0.2926362156867981,
-0.7636669874191284,
-0.7999210357666016,
-0.12141210585832596,
0.776136577129364,
-0.5066208839416504,
-0.20572488009929657,
0.42693597078323364,
-0.4819496273994446,
... |
def haspipedbrowser ( self ) : return len ( self. pipedbrowsers ) > 0 | [
-1.3478177785873413,
-0.1566917449235916,
0.43276649713516235,
0.1710050255060196,
0.2117188274860382,
-0.18397343158721924,
-0.5348556637763977,
0.5702381730079651,
-0.24211788177490234,
0.1229853630065918,
-0.04237944632768631,
0.03704296424984932,
-1.295466661453247,
1.4102647304534912,... |
def get _ utr5p _ size ( transcript ) : transcript _ strand = transcript. tx _ position. is _ forward _ strand exons = get _ exons ( transcript ) # find the exon containing the start codon. start _ codon = ( transcript. cds _ position. chrom _ start if transcript _ strand else transcript. cds _ position. chrom _ stop -... | [
0.40709829330444336,
0.022495148703455925,
0.7311096787452698,
-1.1970150470733643,
-1.1603436470031738,
-0.41255059838294983,
0.47777611017227173,
0.16724631190299988,
0.5405124425888062,
0.48774176836013794,
-0.6823489665985107,
0.15508872270584106,
-0.4813598096370697,
-0.48397350311279... |
def advance ( self ) : self. pos + = 1 if self. pos > len ( self. text ) - 1 : self. c _ char = none else : self. c _ char = self. text [ self. pos ] | [
0.10252916067838669,
-0.5276398658752441,
0.6666698455810547,
-0.4979231655597687,
-0.6493529081344604,
-0.2031189501285553,
0.4519338607788086,
0.47638100385665894,
-0.5096067190170288,
-0.7366243600845337,
-0.7076616883277893,
0.2769860625267029,
-0.3545415699481964,
0.35072243213653564,... |
def get ( self ) : dataset = ( tf. data. tfrecorddataset ( self. filename ). map ( self. _ parse _ sample, num _ parallel _ calls = self. num _ readers ). map ( self. _ augment _ sample, num _ parallel _ calls = self. num _ readers ). map ( self. _ preprocess _ sample, num _ parallel _ calls = self. num _ readers ) ) i... | [
0.1877346932888031,
-0.09077524393796921,
0.4196864068508148,
-0.7191872596740723,
0.20303639769554138,
-0.2913891077041626,
0.14924591779708862,
0.07835641503334045,
-0.539720356464386,
-1.306132197380066,
0.8580607175827026,
0.7554494142532349,
-0.49602392315864563,
-0.663732647895813,
... |
def forward _ with _ state ( self, x, weights, state, rng ) : del weights n _ heads, dropout, mode = self. _ n _ heads, self. _ dropout, self. _ mode q, k, v, mask = x d _ feature = q. shape [ - 1 ] assert d _ feature % n _ heads = = 0 d _ head = d _ feature / / n _ heads nbatch = jnp. shape ( q ) [ 0 ] # nbatch, seqle... | [
-0.2684311866760254,
0.2573264241218567,
0.6448526978492737,
-0.5645027756690979,
-0.6611636877059937,
-0.2943418622016907,
0.5832076668739319,
-0.2886527180671692,
1.2278118133544922,
0.45763689279556274,
-0.8933032751083374,
0.17973639070987701,
0.73746657371521,
-0.4243046045303345,
-... |
def prime _ cassandra ( replication ) : if not isinstance ( replication, int ) : raise typeerror ('replication must be an integer') if int ( replication ) < = 0 : raise dbconstants. appscalebadarg ('replication must be greater than zero') hosts = appscale _ info. get _ db _ ips ( ) cluster = none session = none remaini... | [
0.4324532151222229,
0.33251839876174927,
0.8594192862510681,
0.267357736825943,
0.40264126658439636,
0.16854168474674225,
0.008603915572166443,
-0.22835063934326172,
0.3982129991054535,
0.40611931681632996,
-0.046606071293354034,
-0.2824079394340515,
0.6066474318504333,
0.04292465001344681... |
def on _ bt _ del _ edge _ clicked ( self ) : start = self. ui. cb _ starting _ node. currenttext ( ) end = self. ui. cb _ ending _ node. currenttext ( ) weight = self. ui. sb _ weight _ edge. value ( ) if start and end and self. graph. has _ edge ( start, end ) : self. graph. remove _ edge ( start, end ) self. redraw ... | [
0.36149129271507263,
-0.38719722628593445,
0.9164958000183105,
0.25495901703834534,
-0.33895212411880493,
0.39814266562461853,
0.1424293965101242,
0.7457965016365051,
-0.04754423722624779,
0.7022074460983276,
0.4334542453289032,
0.07395724207162857,
-0.8550540208816528,
0.3478599190711975,... |
def logout ( request ) : all _ backends = settings. authentication _ backends # django > 1. 8 : the session cookie will be deleted on `. flush ( ) ` request. session. flush ( ) request. session. clear _ expired ( ) # look for'cas'to be passed on logout. request _ data = request. get if request _ data. get ('force ', fa... | [
-0.7708380818367004,
-0.18233563005924225,
0.7094606161117554,
0.5740780234336853,
0.07310522347688675,
0.27715978026390076,
0.6031233072280884,
-0.5137085914611816,
0.6816892027854919,
0.06666910648345947,
0.6501315236091614,
0.7997498512268066,
0.3953792154788971,
-0.29715263843536377,
... |
def test _ check _ config _ params _ missing _ analysis _ mode ( gitdelver _ config _ params _ fixture : callable [ [ none ], dict [ str, str ] ] ) : config _ params = gitdelver _ config _ params _ fixture. pop ( " analysis _ mode ", none ) with pytest. raises ( systemexit ) : gitdelver. _ check _ config _ params ( con... | [
0.2930731475353241,
0.5598220825195312,
0.4350496530532837,
0.3914549648761749,
0.42586642503738403,
0.7894006967544556,
0.3657643795013428,
0.3560548424720764,
-0.7968959808349609,
0.7202063202857971,
-0.5789305567741394,
-0.38105976581573486,
0.1443912386894226,
0.7901403307914734,
0.7... |
def sfc _ sfcfileexception ( jitter ) : ret _ ad, args = jitter. func _ args _ stdcall ( [ " dwunknown0 ", " lpwszfile ", " dwunknown1 " ] ) raise runtimeerror ('api not implemented') jitter. func _ ret _ stdcall ( ret _ ad, ret _ value ) | [
0.11158833652734756,
0.33897191286087036,
0.38783711194992065,
-0.41659438610076904,
0.3140850365161896,
-0.06591678410768509,
0.9746272563934326,
0.2587262988090515,
-0.924868643283844,
-0.6496953368186951,
-0.2677529752254486,
-0.4506671726703644,
0.07998531311750412,
1.2226035594940186,... |
def matrix _ identity _ multiply _ scalar ( scal, nrows, ncols ) : if nrows! = ncols : raise valueerror, " check dimensions " else : l = list ( ) for i in range ( nrows ) : l. append ( list ( ) ) for j in range ( ncols ) : if i = = j : l [ i ]. append ( scal ) else : l [ i ]. append ( combinatorialscalarwrapper ( set (... | [
-0.3954869210720062,
0.47890886664390564,
0.6272408366203308,
1.3003597259521484,
0.04958933964371681,
0.19853103160858154,
-0.24115267395973206,
-0.4914003908634186,
1.2517415285110474,
-0.3135817050933838,
0.24616749584674835,
-0.2102062702178955,
0.34449660778045654,
0.6249966025352478,... |
def getparams ( self ) : # change thresholds self. params. minthreshold = cv2. gettrackbarpos ('minthresh ','bars') self. params. maxthreshold = cv2. gettrackbarpos ('maxthresh ','bars') self. params. thresholdstep = cv2. gettrackbarpos ('step ','bars') # filter by area. self. params. filterbyarea = true self. params. ... | [
-0.1591089814901352,
-0.37480634450912476,
0.6969171166419983,
-0.2219429463148117,
0.2403496503829956,
0.3017408549785614,
0.565643310546875,
-0.6791059374809265,
-1.1912580728530884,
0.4044873118400574,
-0.6755715012550354,
0.026553582400083542,
-0.33705848455429077,
1.0336785316467285,
... |
def iterm ( a, b, n, m ) : if ( n % 2 = = 0 ) or ( m % 2 = = 0 ) : hmn = 0 else : hmn = 0. 64 / ( ( m * * 3 ) * ( n * * 3 ) * ( pi * * 6 ) ) return hmn | [
0.5663127899169922,
-0.06614470481872559,
0.3703900873661041,
0.2529405355453491,
0.06204741448163986,
0.1146831139922142,
-0.4313042461872101,
0.7416176795959473,
-0.47283393144607544,
0.385418564081192,
0.7017784118652344,
-0.04986976087093353,
-1.4329129457473755,
-0.2168838232755661,
... |
def add ( self, mylist ) : self. size + = 1 if mylist [ 0 ] not in self. main _ dict : self. main _ dict [ mylist [ 0 ] ] = [ ] self. main _ dict [ mylist [ 0 ] ] + = [ mylist [ 1 : ] ] | [
-0.8620655536651611,
0.23598474264144897,
0.49922502040863037,
-0.3895898759365082,
-0.4640673100948334,
0.49821749329566956,
-0.3726949691772461,
0.9978259801864624,
0.7816408276557922,
0.13146677613258362,
-1.4313938617706299,
-0.34693095088005066,
-1.1462713479995728,
1.3972513675689697... |
def matrix _ comparison ( mata, matb ) : nrows = mata. nrows ( ) ncols = matb. ncols ( ) if mata. ncols ( )! = matb. ncols ( ) or mata. nrows ( )! = matb. nrows ( ) : raise valueerror, " check dimensions of input " else : for i in range ( nrows ) : for j in range ( ncols ) : if mata [ i, j ]! = matb [ i, j ] : return f... | [
0.5381481051445007,
0.23472359776496887,
0.8171593546867371,
-0.008981713093817234,
-0.8001348376274109,
0.9711010456085205,
-0.21255052089691162,
-0.42977720499038696,
-0.018491510301828384,
0.8332183957099915,
0.772818386554718,
0.18810124695301056,
-0.477812260389328,
0.5630810260772705... |
def get _ plant _ id _ in _ loadzones ( loadzones, grid ) : areas = _ check _ areas _ are _ in _ grid _ and _ format ( { " loadzone " : loadzones }, grid ) plant = grid. plant plant _ id = plant [ ( plant. zone _ name. isin ( areas [ " loadzone " ] ) ) ]. index return set ( plant _ id ) | [
0.2843124270439148,
-0.7716749310493469,
0.2654609978199005,
0.5033106207847595,
0.1252918392419815,
-0.14791567623615265,
0.14100363850593567,
-0.48855140805244446,
0.31067726016044617,
0.8038671016693115,
-0.03236622363328934,
0.6000093817710876,
-0.5857145190238953,
-0.5570668578147888,... |
def _ trace _ id _ to _ bytes ( trace _ id : int ) - > bytes : return trace _ id. to _ bytes ( 16, " big " ) | [
0.7618651390075684,
0.8367210626602173,
0.34925350546836853,
-0.5275526642799377,
1.4344232082366943,
-0.20703274011611938,
-0.40861549973487854,
-1.106044054031372,
1.0221463441848755,
-0.11531073600053787,
-0.9709793925285339,
-0.16597983241081238,
-0.1392371654510498,
-0.270909249782562... |
def lineage _ parent _ id ( run _ id : str, task _ instance : taskinstance ) : job _ name = openlineageadapter. build _ task _ instance _ run _ id ( task _ instance. task. task _ id, task _ instance. execution _ date, task _ instance. try _ number ) return f " { _ job _ namespace } / { job _ name } / { run _ id } " | [
0.6358648538589478,
-0.5160651803016663,
0.6049918532371521,
-0.7754938006401062,
-0.5675009489059448,
0.5115493535995483,
0.03212499991059303,
-0.8303989768028259,
-0.5828258395195007,
-0.20035363733768463,
0.45643582940101624,
0.9252187013626099,
0.1873299777507782,
-0.08848632127046585,... |
def _ _ init _ _ ( self, design _ matrix, weights _ prior = none, name = none ) : init _ parameters = dict ( locals ( ) ) with tf. name _ scope ( name or'linearregression') as name : if not isinstance ( design _ matrix, tfl. linearoperator ) : design _ matrix = tfl. linearoperatorfullmatrix ( tf. convert _ to _ tensor ... | [
0.6487400531768799,
0.6318413615226746,
0.8878910541534424,
-0.40776553750038147,
-0.42386847734451294,
-0.3253534138202667,
0.35493114590644836,
0.42354705929756165,
0.2639591693878174,
-0.1351255625486374,
-0.39124390482902527,
-0.27349016070365906,
0.034709181636571884,
-0.2662177383899... |
def render ( self ) : for r in range ( self. y _ size ) : line ='' for c in range ( self. x _ size ) : symbol = self. free _ glyph if self. obstacle _ map [ r ] [ c ] = = self. obstacle _ symbol : symbol = self. obst _ glyph if ( r, c ) in self. tgt _ positions : symbol = self. tgt _ glyph # box or player overwrites tg... | [
-0.19714166224002838,
-0.6538137793540955,
0.5783882737159729,
-1.2527918815612793,
0.21278099715709686,
-0.12493503838777542,
0.2055596560239792,
-0.4338652193546295,
-0.16829361021518707,
0.4579550325870514,
0.48470064997673035,
-0.09286195784807205,
0.31517547369003296,
0.02834977954626... |
def get _ authors ( soup ) : author _ name _ class = soup. find _ all ( class _ = " author - name " ) author _ titles = [ h. get ('title') for h in author _ name _ class ] list _ of _ authors = [ ] for title in author _ titles : firstname = title. split ( " " ) [ 2 ] lastname = title. split ( " " ) [ 3 ] authorname = f... | [
-1.084741473197937,
-1.1302605867385864,
0.6004729270935059,
0.0855095162987709,
0.39157769083976746,
-0.4725841283798218,
-0.6401877999305725,
1.0068763494491577,
0.6877586245536804,
0.3632517158985138,
0.22758981585502625,
0.1293581873178482,
0.4967648386955261,
0.37731173634529114,
0.... |
def stdoutio ( stdout = none ) : old = sys. stdout if stdout is none : stdout = stringio ( ) sys. stdout = stdout yield stdout sys. stdout = old | [
0.871090292930603,
-0.3063468337059021,
0.6466310620307922,
-0.6243497729301453,
-0.4845418632030487,
-0.9751664996147156,
-0.13452178239822388,
-0.721633791923523,
-0.18159916996955872,
-0.8911726474761963,
-0.7929081320762634,
0.2217976450920105,
0.19928662478923798,
-0.07618290930986404... |
def test _ graph _ g _ suite _ traverse _ user ( self ) : pass | [
-0.467644065618515,
0.9646698236465454,
0.27277594804763794,
1.918603777885437,
0.05663184076547623,
0.7194808721542358,
2.685530185699463,
-0.9968507289886475,
-0.5071092247962952,
-0.9046052694320679,
-0.0749170184135437,
1.009973168373108,
-0.7683587670326233,
0.010411595925688744,
-0... |
def setimage ( self, image ) : raise notimplementederror | [
-1.2891901731491089,
0.05941237881779671,
0.23077546060085297,
0.31143882870674133,
0.1813504993915558,
0.792393684387207,
-0.0674944818019867,
0.1493789553642273,
-0.12429797649383545,
0.07155080139636993,
0.31123530864715576,
0.5185572504997253,
0.35642555356025696,
1.3537487983703613,
... |
def test _ get _ alumno _ docente ( self ) : self. client. force _ authenticate ( user = self. user _ docente ) id _ alumno = alumno. objects. get ( dni = 1 ). id response = self. client. get ( f " / api / alumnos / { id _ alumno } / " ) self. assertequal ( response. status _ code, status. http _ 200 _ ok ) | [
0.2773902714252472,
0.6209871172904968,
0.48621565103530884,
0.3695414662361145,
0.024724800139665604,
0.6041315197944641,
-0.5076372027397156,
0.2213786542415619,
0.34406009316444397,
-0.5805028676986694,
-0.04994136467576027,
1.2437314987182617,
1.784910798072815,
-1.0642502307891846,
... |
def destroy _ jail ( self ) : self. lgr. info ( " destroying { } ( { } ) ". format ( self. uuid, self. jail ) ) self. path = self. path. replace ( self. iocroot, " / iocage " ) popen ( [ " zfs ", " destroy ", " - r ", self. pool + self. path ] ). communicate ( ) try : self. destroy _ snapshot ( ) self. destroy _ tag ( ... | [
-0.8310487270355225,
-0.5337645411491394,
0.17121124267578125,
0.01869313232600689,
0.7328190207481384,
-0.4670715928077698,
1.2168196439743042,
0.11077693104743958,
-0.6396611928939819,
0.06597548723220825,
0.35257789492607117,
-0.48861876130104065,
-0.9947503209114075,
0.3997703194618225... |
def draw ( self, file _ name : str ) - > none : width = self. boundary _ box. point2. x height = self. boundary _ box. point2. y file _ = open ( file _ name, " w + " ) file _. write ( " <? xml version = \ " 1. 0 \ " encoding = \ " utf - 8 \ " " " standalone = \ " no \ "? > \ n \ n " ) file _. write ( " < svg version = ... | [
0.29157841205596924,
0.23076879978179932,
0.8486670851707458,
0.19654321670532227,
0.045481372624635696,
1.1585336923599243,
0.21354110538959503,
0.31235814094543457,
-0.5029953122138977,
-0.2073288857936859,
-0.03097487799823284,
0.45619073510169983,
0.08334828168153763,
0.482993930578231... |
def test _ connectionlost ( self ) : self. xmlstream. dispatch ( self. xmlstream, xmlstream. stream _ authd _ event ) self. xmlstream. dispatch ( none, xmlstream. stream _ end _ event ) self. assertnotin ('component. example. org ', self. router. routes ) | [
0.6165807843208313,
-0.3187447786331177,
0.41504135727882385,
-0.1218607947230339,
0.4023076295852661,
0.6060895323753357,
-0.17316284775733948,
-0.18154531717300415,
0.5111836194992065,
-0.9478428959846497,
0.0442328155040741,
0.00952833704650402,
-0.42246299982070923,
0.406725138425827,
... |
def summarize _ article ( self, url : str ) - > str : smmry _ api _ url ='https : / / api. smmry. com'params = {'sm _ api _ key': creds. get _ smmry _ key ( ),'sm _ length': 1,'sm _ ignore _ length': true,'sm _ url': url, } response = requests. get ( smmry _ api _ url, params = params ). json ( ) # todo : check here ( ... | [
-0.9420965909957886,
0.40510880947113037,
0.5843417048454285,
-0.43962568044662476,
-0.866672933101654,
-0.7010916471481323,
-0.4909796416759491,
-0.3353779911994934,
0.9617189168930054,
1.3998591899871826,
-0.43400201201438904,
0.4870927333831787,
-0.3042219877243042,
0.21231305599212646,... |
def forecast _ legal _ moves ( game, player, opponent ) : legal _ moves = game. get _ legal _ moves ( player ) opp _ moves = game. get _ legal _ moves ( opponent ) num _ moves = 0 for move in legal _ moves : # don't consider moves that could be blocked by opponent occupying them on their ply if move in opp _ moves : pa... | [
0.41302892565727234,
0.512111485004425,
0.7077987194061279,
0.13812100887298584,
-0.8484697937965393,
0.09843990206718445,
0.3817199468612671,
0.7393468022346497,
-0.404954195022583,
0.4743604063987732,
-0.42689138650894165,
0.05126511678099632,
0.6565534472465515,
-0.06467188149690628,
... |
def write _ files ( self, lc ) : # - - define output path. outpath = lc. path _ out _ = start ( " files to be written to { } ". format ( outpath ) ) # - - empty list to save bigoff dfs. bigoffs _ df = [ ] # - - loop over each unique day in lc. meta. index. for dd in lc. meta. index. unique ( ) : lc. loadnight ( dd, loa... | [
-0.35039108991622925,
0.3202526271343231,
0.6798930168151855,
-0.9436995983123779,
0.748775064945221,
0.661594569683075,
0.49547454714775085,
0.048771608620882034,
-0.0524013414978981,
-0.0926879495382309,
-0.4188232421875,
0.033450961112976074,
0.5242782235145569,
0.13051170110702515,
-... |
def getgeniemapping ( syn, synid ) : table _ ent = syn. tablequery ('select * from % s'% synid ) table = table _ ent. asdataframe ( ) table = table. fillna ( " " ) return ( table ) | [
-0.5571609139442444,
0.6414483189582825,
0.44808971881866455,
-0.22176890075206757,
0.15452860295772552,
-0.5402858853340149,
-0.604626476764679,
0.4994581341743469,
-0.30161336064338684,
0.09776446968317032,
0.4371103346347809,
-0.21297773718833923,
0.8994056582450867,
-0.2260555177927017... |
def get _ sandwich ( text ) : bread ='chleb'is _ bread = false inside ='' if bread in text : is _ bread = true if is _ bread : first _ bread = text. find ( bread ) last _ bread = text. rfind ( bread ) inside = text [ first _ bread + len ( bread ) : last _ bread ] return inside | [
0.553205132484436,
0.13815991580486298,
0.8134025931358337,
1.0490083694458008,
-0.5615399479866028,
-0.20277276635169983,
0.21974457800388336,
0.05894825607538223,
0.27082639932632446,
0.09006530046463013,
-0.47084692120552063,
0.6557371616363525,
-0.9563050270080566,
0.27895045280456543,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.