text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def create _ growth _ transition _ discriminator _ network ( x, from _ rgb _ conv _ layers, blocks, transition _ downsample _ layers, flatten _ layer, logits _ layer, alpha _ var, params, trans _ idx ) : print _ obj ( " \ nentered create _ growth _ transition _ discriminator _ network ", " trans _ idx ", trans _ idx ) ... | [
-0.08435181528329849,
0.1612875610589981,
0.7192925214767456,
0.40298303961753845,
0.4210568368434906,
0.06616975367069244,
0.5426247715950012,
-0.7771369218826294,
0.17396144568920135,
-0.8276572823524475,
-1.0061891078948975,
0.1408012956380844,
0.21810898184776306,
0.5159010887145996,
... |
def init _ max _ array ( self, num _ maxes ) : return [ ( - 1, - 1, - 1 ) ] * num _ maxes | [
-0.9119652509689331,
-0.24292951822280884,
0.3899741470813751,
1.1634360551834106,
0.7542288303375244,
0.22200708091259003,
-0.7332244515419006,
1.0876964330673218,
-0.11778894066810608,
0.5347726345062256,
-0.7987573146820068,
0.1573929488658905,
-0.30285918712615967,
-0.21051065623760223... |
def test _ generate _ proposal _ terms _ and _ data ( self ) : # setup seller = self. skill. skill _ context. agent _ address total _ price = len ( self. data _ for _ sale ) * self. unit _ price sale _ quantity = len ( self. data _ for _ sale ) tx _ nonce = ledgerapis. generate _ tx _ nonce ( identifier = self. ledger ... | [
0.46182242035865784,
0.30493292212486267,
0.5482196807861328,
-1.079752802848816,
0.18050022423267365,
0.06524770706892014,
0.19259338080883026,
0.08890755474567413,
0.557628333568573,
0.3599415123462677,
-0.014713401906192303,
-0.34697815775871277,
0.15592601895332336,
-0.6606855988502502... |
def test _ random _ sample _ histogram ( self ) : hist = metrics. histogram. value with patch. object ( sqaprofilerinterface, " _ convert _ table _ to _ orm _ object ", return _ value = user ) : profiler = profiler ( hist, profiler _ interface = sqaprofilerinterface ( profiler _ interface _ args = profilerinterfaceargs... | [
0.6529514193534851,
0.7156458497047424,
0.4854876697063446,
0.3396414816379547,
0.13726001977920532,
-0.028081906959414482,
0.7322045564651489,
-0.6703201532363892,
0.7915785908699036,
-0.5832775235176086,
0.019010864198207855,
-0.6191573143005371,
-0.40837129950523376,
0.13259445130825043... |
async def check _ employee ( user : str ) : email = user username, _ = user. split ('@') name = username. replace ( '. ','' ). title ( ) exists = await employeeda. get _ employee _ usernames ( ( username, ) ) if exists : return username usernames = await employeeda. get _ employee _ usernames ( ) if not usernames : # n... | [
-0.4465017020702362,
0.7799703478813171,
0.7138987183570862,
0.09968793392181396,
-0.004278229549527168,
0.5233868956565857,
-0.18805895745754242,
0.22317180037498474,
0.2827046513557434,
0.4101390540599823,
0.00028484826907515526,
0.4719007909297943,
-0.6382732391357422,
0.734211921691894... |
def _ calculate _ gains ( predicted _ rank _ vector, original _ rank _ vector, verbose = true ) : # the original calculation r = predicted _ rank _ vector n = len ( original _ rank _ vector ) # the relevance of each rank is inv proportional to its rank index l = [ n - i + 1 for i in original _ rank _ vector ] expn = 2 ... | [
0.21370857954025269,
-1.0218359231948853,
0.9170563817024231,
0.04774615541100502,
-0.017830058932304382,
-0.5226825475692749,
0.2868044972419739,
0.5239695310592651,
-0.2432292103767395,
-0.05632402002811432,
-0.21278011798858643,
1.1778258085250854,
0.07310505211353302,
1.055495738983154... |
def num _ vehicles ( self ) : return self. _ num _ vehicles | [
-0.19274725019931793,
0.3084311783313751,
0.08724123239517212,
0.4856720566749573,
0.6893343925476074,
-0.010227059945464134,
-0.025118045508861542,
0.03430035337805748,
0.41440582275390625,
-0.6093564033508301,
-0.674111545085907,
-0.6882913112640381,
0.4061203598976135,
0.052411708980798... |
def _ _ write _ csv _ to _ stream ( stream, headers, data ) : dict _ writer = csv. dictwriter ( stream, headers ) dict _ writer. writeheader ( ) dict _ writer. writerows ( data ) | [
-0.8588355183601379,
-0.3116566836833954,
0.17044784128665924,
-0.21559713780879974,
0.04996384307742119,
-0.6864862442016602,
-1.0028795003890991,
0.04522785544395447,
-0.5067611932754517,
-0.8419042229652405,
0.0026129824109375477,
0.4403398633003235,
0.766105055809021,
0.166549950838089... |
def test _ _ app _ manager _ get _ existing _ user _ _ succeeds ( am ) : am. create _ user ( username = " uname ", password = " passy ", email = " user @ gmail. com " ) user = am. get _ user ( username = " uname " ) assert user assert user. username = = " uname " | [
0.5516708493232727,
0.08546128869056702,
0.3732026517391205,
0.8924314975738525,
0.09062495082616806,
0.735288143157959,
-0.0990586206316948,
-0.05131692811846733,
-0.07439886778593063,
-0.5015318393707275,
-0.47834548354148865,
0.21203020215034485,
0.5231607556343079,
0.06275677680969238,... |
def estimaterelativecoordinates ( self, blob ) : x = blob. pt [ 0 ] y = min ( 479, blob. pt [ 1 ] + blob. size + self. uppercropvalue ) # plus because high y values mean lower in the image # angles relative to the camera orientation xangle = - ( np. pi / 6 ) * ( x - 320 ) / 320 yangle = - ( np. pi / 8 ) * ( y - 240 ) /... | [
-0.23778633773326874,
-0.7203208208084106,
0.878771185874939,
-0.13875031471252441,
-0.5151861310005188,
0.20735050737857819,
0.16641204059123993,
-0.4163224995136261,
0.8166356086730957,
0.9628623723983765,
-0.8918398022651672,
-0.49640142917633057,
-0.5159142017364502,
-0.019304417073726... |
def validate _ account _ number ( cls, v ) : try : iban ( v ) except valueerror as e : raise validationerror ( e ) return v | [
0.11640430241823196,
-0.05652908235788345,
0.4345126748085022,
0.8099780678749084,
0.30580803751945496,
0.7399721741676331,
1.4540046453475952,
0.14742402732372284,
0.7942793369293213,
-0.46153825521469116,
0.5068556070327759,
0.18307802081108093,
-0.3230660557746887,
-0.1376538723707199,
... |
def game _ playing ( ) : print ( " * " * 80 ) print ( " " ) print ( " " " you are now in a suspiciously empty hospital, having no way back. " " " ) import time time. sleep ( 1 ) print ( " " " in front of you, there are two doors : " " " ) game _ 6 ( ) | [
0.47579365968704224,
-0.21438753604888916,
0.6633551120758057,
0.5554493069648743,
0.2963186204433441,
0.5251601934432983,
-0.2743179202079773,
-0.3197680711746216,
-0.5709847211837769,
0.4335884749889374,
-0.25095561146736145,
0.40992632508277893,
-0.38644513487815857,
-0.0779265537858009... |
def execute _ tests ( self, test _ names ) : # if auto tests the only test and auto tests disabled then return immediately if len ( test _ names ) = = 1 and test _ names [ 0 ] = = " auto " and self. disable _ auto : return self. pre _ tests _ message ( ) for test _ name in test _ names : self. primary _ registry. query... | [
-0.8794227838516235,
0.34191006422042847,
0.4550801217556,
0.7940823435783386,
1.448836088180542,
0.3828161060810089,
0.4171329140663147,
0.004164043813943863,
0.15426282584667206,
0.2661346197128296,
-0.2518647313117981,
-0.3417941629886627,
-1.4626531600952148,
0.4678095281124115,
-0.6... |
def create ( cls ) - > tablestorage : service _ type = processconfig ( ). resource _ storage _ type try : return cls. _ factories [ service _ type ] ( ) except keyerror : raise keyerror ( f " service type { service _ type } is not " " registered for resource storage service " ) | [
0.020822372287511826,
0.1952899545431137,
0.31691405177116394,
0.7785845994949341,
0.03376511484384537,
0.032925643026828766,
-0.129489928483963,
-1.7971272468566895,
-0.9749065041542053,
-0.447858989238739,
0.44454386830329895,
0.05555826425552368,
-0.026483610272407532,
0.912162125110626... |
async def test _ str _ binary ( self ) : xknx = xknx ( ) expose _ sensor = exposesensor ( xknx, " testsensor ", group _ address = " 1 / 2 / 3 ", value _ type = " binary " ) await expose _ sensor. process ( telegram ( destination _ address = groupaddress ( " 1 / 2 / 3 " ), payload = groupvaluewrite ( value = dptbinary (... | [
-0.02881075255572796,
0.7695304751396179,
0.5043437480926514,
-0.06479937583208084,
0.4664331078529358,
0.27812322974205017,
-0.4816281199455261,
-1.1249467134475708,
-0.09229931980371475,
-0.20880746841430664,
-0.6667067408561707,
0.14601543545722961,
-0.6698551177978516,
-0.2891413271427... |
def format _ coords ( self ) : # format coordinates. if self. start = = self. end : return str ( self. start ) else : return " % s _ % s " % ( self. start, self. end ) | [
-0.4378772974014282,
-0.7311629056930542,
0.421384334564209,
-1.0667929649353027,
-0.28698116540908813,
0.3341757655143738,
0.04813351854681969,
-1.1308529376983643,
-0.4242102801799774,
-0.20926746726036072,
1.2170592546463013,
0.3466636836528778,
0.15470026433467865,
-0.4243590235710144,... |
def found _ match ( ) : skip = false for i in range ( 0, len ( cpy ) ) : if skip : skip = false continue if i + 1 < len ( cpy ) and cpy [ i ] [ 1 ] > = cpy [ i + 1 ] [ 0 ] - 1 : cpy [ i ] [ 1 ] = cpy [ i + 1 ] [ 1 ] skip = true nrep. checked. append ( cpy [ i ] ) | [
-0.6889142394065857,
0.49700579047203064,
0.6347535848617554,
-0.13189597427845,
0.16079463064670563,
0.4382276237010956,
1.427427887916565,
-0.25042974948883057,
-0.19767321646213531,
0.6795870065689087,
-0.06949211657047272,
-0.020178277045488358,
-1.120729684829712,
0.08817066252231598,... |
def find _ aruba ( aps, ap ) : for i, v in enumerate ( aps ) : if v [ " sernum " ] = = ap [ " sernum " ] : return i return - 1 | [
-1.032138466835022,
-1.3114972114562988,
0.5981884598731995,
0.156851664185524,
-0.26170068979263306,
-0.03386571258306503,
0.21784143149852753,
0.15662311017513275,
0.561216413974762,
0.30151990056037903,
1.0068453550338745,
0.6741470694541931,
-0.47861194610595703,
-0.49617481231689453,
... |
def distance _ lshforest ( z, k = 4, metric ='cosine') : assert metric is'cosine'lshf = sklearn. neighbors. lshforest ( ) lshf. fit ( z ) dist, idx = lshf. kneighbors ( z, n _ neighbors = k + 1 ) assert dist. min ( ) < 1e - 10 dist [ dist < 0 ] = 0 return dist, idx | [
0.9618156552314758,
-0.595095694065094,
0.4039488732814789,
0.5282817482948303,
-0.5679243206977844,
0.6453112959861755,
-0.09200116991996765,
0.5362812876701355,
0.05556359887123108,
-0.3691790997982025,
-0.7288135290145874,
-0.1682872176170349,
0.14503657817840576,
0.24127085506916046,
... |
def insert _ variants ( conn, dataset, variant _ dict, vars _ to _ beacon ) : insert _ counter = 0 log. info ('inserting variants into database..') # loop over each sample ( key ) of the dictionary : click. echo ( " variants to process : % s " % vars _ to _ beacon ) pbar = enlighten. counter ( total = vars _ to _ beaco... | [
-0.5958330035209656,
0.7832827568054199,
0.7338560223579407,
-0.5360428690910339,
-0.5902755260467529,
-0.19589756429195404,
0.14103293418884277,
-0.023559968918561935,
-0.45268625020980835,
0.5322138667106628,
-0.23517897725105286,
-0.998043954372406,
-0.41978341341018677,
0.2566246986389... |
def _ _ cpu _ update _ ui ( self ) : if self. _ _ ui _ update : for output in self. selected _ outputs : output. ui. cpu = self. _ _ cpu _ combo _ box. current _ index ( ) | [
-0.7798383831977844,
-0.6698849201202393,
0.3421730697154999,
0.059279389679431915,
-0.5109408497810364,
-0.46902015805244446,
1.403698205947876,
-0.11728136241436005,
-0.4143320620059967,
-0.16179907321929932,
0.0006270022713579237,
-0.12844403088092804,
-1.4183602333068848,
-0.2160468697... |
def create _ output ( self ) : f = open ( " output. txt ", " w " ) dt = datastructure ( self. input ) dt. open _ fill ( ) for i in dt. get _ all ( ) : p = resultado ( i ) if type ( p. get _ id ( ) ) = = ( int ) : self. output. append ( p. get _ all ( ) ) f. write ( " { } \ n \ n ". format ( p. get _ all ( ) ) ) f. clos... | [
0.09118630737066269,
-0.48536360263824463,
0.5314168930053711,
0.1991289258003235,
0.3084031343460083,
0.6756607294082642,
0.25630608201026917,
-0.2681545615196228,
-0.6811926364898682,
-0.3978652358055115,
-0.3458714485168457,
-0.48848238587379456,
0.016007674857974052,
0.4461484253406524... |
def test _ form _ preview ( self ) : # pass strings for form submittal and add stage variable to # show we previously saw first stage of the form. self. test _ data. update ( {'stage': 1 } ) response = self. client. post ( self. url, self. test _ data ) # check to confirm stage is set to 2 in output form. stage = self.... | [
-0.4998360574245453,
0.12786969542503357,
0.4956679046154022,
-0.3357701897621155,
-0.8421339392662048,
0.1316685676574707,
0.48418641090393066,
0.25071465969085693,
-0.064437136054039,
-0.8557980060577393,
-0.5071806907653809,
-0.12427443265914917,
0.49980053305625916,
0.832658052444458,
... |
def _ isprocesspresent ( self, sname ) : for oprocess in utils. processlistall ( ) : sbase = oprocess. getbaseimagenamenoexesuff ( ) ; if sbase is not none and sbase. lower ( ) = = sname : return true ; return false ; | [
-0.24992981553077698,
-0.8187963962554932,
0.7003611326217651,
-0.8014227151870728,
0.09774664044380188,
-0.01413156371563673,
-0.563947319984436,
0.08344976603984833,
0.9422506093978882,
0.6595730781555176,
-0.896831214427948,
0.01776065304875374,
-0.6496397256851196,
0.414387047290802,
... |
def total _ expense _ ratio ( self, total _ expense _ ratio ) : self. _ total _ expense _ ratio = total _ expense _ ratio | [
-1.3167815208435059,
-0.7983866930007935,
0.09350252151489258,
-0.6995258331298828,
-0.2152351438999176,
0.15538443624973297,
0.3857026696205139,
1.4132120609283447,
-0.01608860120177269,
1.2884384393692017,
0.134669229388237,
-2.009760618209839,
-0.12526331841945648,
-1.1348917484283447,
... |
def _ _ init _ _ ( self, n _ islands = 2, restart _ file = none, * args, * * kwargs ) : super ( serialislandmanager, self ). _ _ init _ _ ( * args, * * kwargs ) if restart _ file is none : self. n _ isles = n _ islands # make coevolution islands self. isles = [ ] for _ in range ( self. n _ isles ) : self. isles. append... | [
0.5194233059883118,
0.38846489787101746,
0.7101583480834961,
0.24947339296340942,
0.2008581906557083,
0.18010945618152618,
0.1771317720413208,
0.7239626049995422,
0.12007787078619003,
-0.7809476852416992,
-0.49745050072669983,
0.2038799524307251,
-0.2278016358613968,
0.37212935090065,
-0... |
def finishspsexposure ( self, cmd ) : cmdkeys = cmd. cmd. keywords now ='now'in cmdkeys filter ='sunss'if'sunss'in cmdkeys else'sps'try : sequence = self. engine. registry. identify ( cmdkeys, filter = filter ) sequence. dofinish ( cmd, now = now ) except exception as e : cmd. fail ( f'text = " { str ( e ) } "') return... | [
-0.5673162937164307,
-0.6466033458709717,
0.4720926582813263,
0.5615652203559875,
-0.5761430859565735,
0.4230131208896637,
0.10629250109195709,
-0.17721469700336456,
0.24796375632286072,
0.26066553592681885,
-0.14035148918628693,
0.029430542141199112,
-0.48491519689559937,
1.24221575260162... |
def record _ pcap ( hostname : str, lidar _ port : int = 7502, imu _ port : int = 7503, n _ seconds : int = 10 ) - > none : import ouster. pcap as pcap from datetime import datetime # [ doc - stag - pcap - record ] # connect to sensor and record lidar / imu packets with closing ( client. sensor ( hostname, lidar _ port... | [
-0.2030719667673111,
-0.18659862875938416,
0.7470576763153076,
-0.40780970454216003,
0.14466224610805511,
0.09192609041929245,
-0.5549635291099548,
-0.49932563304901123,
-0.12083681672811508,
0.4516366720199585,
-0.394230455160141,
0.9738302230834961,
0.5070990920066833,
0.4358803033828735... |
def restore _ darknet19 _ variables ( sess, imdb, net _ name ='darknet19 ', save _ epoch = true ) : sfiles = get _ ordered _ ckpts ( sess, imdb, net _ name, save _ epoch = save _ epoch ) lsf = len ( sfiles ) if lsf = = 0 : # todo : this is not used because the current weight has deprecated scope names. need to fix this... | [
0.005366898607462645,
-0.46442240476608276,
0.7643375992774963,
-0.04319135472178459,
0.5202507376670837,
-0.3782728910446167,
0.09555841982364655,
0.23213541507720947,
-0.2847842276096344,
0.25416600704193115,
-0.49995046854019165,
-0.135759174823761,
-0.39628487825393677,
-0.090254917740... |
def parse _ metadata _ values ( data ) : metadata _ values = data. get ('metadata ', none ) if ( metadata _ values is not none ) and metadata _ values : return metadata _ values | [
0.29619017243385315,
0.3807138502597809,
0.3770759403705597,
0.13342595100402832,
1.0504677295684814,
-0.5139387249946594,
-1.5390312671661377,
0.12042908370494843,
-0.3347345292568207,
0.5636540651321411,
0.10036768019199371,
-0.1796143501996994,
0.34542450308799744,
1.1839213371276855,
... |
def make _ wallet ( self, name ) : pk, priv = self. _ alloc _ key ( ) w = wallet ( self, name, pk, priv ) self. wallets [ str ( w. pk ( ) ) ] = w return w | [
-0.6163530945777893,
-0.09811709821224213,
0.4293915331363678,
-0.3374043107032776,
-0.3564523458480835,
0.0715678259730339,
-0.5032445788383484,
-0.6463497877120972,
0.370691180229187,
-0.4420011341571808,
-0.9346516728401184,
0.1710297167301178,
-0.03803091123700142,
0.09430812299251556,... |
def mergefrom ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.06280861049890518,
-0.10489790141582489,
0.45908570289611816,
1.001430630683899,
0.7600829005241394,
0.2247180938720703,
-0.10269985347986221,
-0.2024446427822113,
0.23432762920856476,
-1.1697890758514404,
-0.9829989075660706,
-0.39975863695144653,
-0.37335196137428284,
0.28569245338439... |
def variant _ to _ hgvs _ name ( chrom, offset, ref, alt, genome, transcript, max _ allele _ length = 4, use _ counsyl = false ) : # convert vcf - style variant to hgvs - style. chrom, offset, ref, [ alt ] = normalize _ variant ( chrom, offset, ref, [ alt ], genome ). variant chrom, offset, ref, alt, mutation _ type = ... | [
-0.23659199476242065,
-0.26122769713401794,
0.8008013367652893,
-0.4294940233230591,
-0.6901993751525879,
-0.658924400806427,
-0.03284396976232529,
0.00029632015503011644,
-0.03631177544593811,
0.7763071060180664,
0.12646567821502686,
0.6122415065765381,
1.0810848474502563,
-0.577794969081... |
def move _ mock _ file _ to _ repo ( self, playbook _ or _ integration _ id ) : src _ filepath = os. path. join ( self. tmp _ folder, get _ mock _ file _ path ( playbook _ or _ integration _ id ) ) src _ files = os. path. join ( self. tmp _ folder, get _ folder _ path ( playbook _ or _ integration _ id ) + " * " ) dst ... | [
-0.726997435092926,
0.6244233846664429,
0.5623769760131836,
-0.5875831842422485,
1.1900447607040405,
0.5807874202728271,
1.3197981119155884,
0.38948994874954224,
-0.6998963952064514,
0.9596970677375793,
-0.2456151843070984,
-0.2950665354728699,
-0.2222287654876709,
0.3040511906147003,
-0... |
def _ _ init _ _ ( self ) : self. num2freq = dict ( ) self. num2pos = defaultdict ( list ) self. numloc = [ ] self. random = random | [
-0.42638683319091797,
-0.018589282408356667,
0.27325043082237244,
-0.5393561720848083,
0.2770262062549591,
-0.11284803599119186,
0.7435265183448792,
0.7702487111091614,
-0.5107817649841309,
-0.9581214785575867,
-1.2251800298690796,
-1.414872169494629,
0.5241596102714539,
0.895113468170166,... |
def test _ r _ display _ too _ many _ args ( self ) : with self. assertraises ( typeerror ) : self. r1. display ( 1 ) | [
0.06164362654089928,
0.9112760424613953,
0.34389981627464294,
0.0817495658993721,
0.14169248938560486,
0.7654096484184265,
0.882326602935791,
-1.062026023864746,
0.0063357166945934296,
0.8987537026405334,
0.4789549708366394,
-0.24581515789031982,
-0.9123010039329529,
0.8938260078430176,
... |
def assert _ all _ finite ( x : any, keypath = " " ) : path _ description = f " at { keypath } " if keypath else " " if np. isscalar ( x ) : assert np. isfinite ( x ), f " value { path _ description } should be finite, but is { str ( x ) }. " elif isinstance ( x, np. ndarray ) : non _ finite _ indices = np. nonzero ( ~... | [
-0.42641451954841614,
0.20809727907180786,
0.7164884209632874,
0.4233556389808655,
0.2786405384540558,
0.23755180835723877,
-0.1951919049024582,
-0.3543200194835663,
0.05061841383576393,
-0.5567585825920105,
0.23048722743988037,
0.36786121129989624,
0.27757707238197327,
1.008265733718872,
... |
def put _ all ( self, lines = none ) : text _ line = self. top _ line y = 0 while text _ line < len ( self. textlist ) : if ( lines and text _ line in lines ) or ( not lines and self. top _ line < = text _ line < self. top _ line + self. height ) : for x in range ( 0, self. width ) : add _ char = ( self. textlist [ tex... | [
0.06657583266496658,
-0.20774376392364502,
0.7414773106575012,
0.01611911877989769,
-0.475145548582077,
0.26348596811294556,
0.20565977692604065,
0.053808532655239105,
0.06946073472499847,
-0.5632773637771606,
-0.03482457995414734,
-0.08084329962730408,
-0.4786194860935211,
0.7456237673759... |
def export _ to _ csv ( headers, data, filename = none, mode = " w ", newline = " " ) : if filename : with open ( filename, mode, newline = newline ) as output _ file : _ _ write _ csv _ to _ stream ( output _ file, headers, data ) return none stream = io. stringio ( ) _ _ write _ csv _ to _ stream ( stream, headers, d... | [
-0.006855706684291363,
-0.43700388073921204,
0.38674303889274597,
0.8113449811935425,
-0.5289742350578308,
-1.0584341287612915,
-0.8003056049346924,
-0.8386186361312866,
0.18818329274654388,
-0.3400234580039978,
0.25110292434692383,
0.3354261517524719,
-0.5578339099884033,
-0.2990060150623... |
def resamplingwithoriginalratio ( img, required _ size, sample ) : old _ size = img. size # resizing image with original ratio. resampling _ ratio = min ( required _ size [ 0 ] / old _ size [ 0 ], required _ size [ 1 ] / old _ size [ 1 ] ) new _ size = ( int ( old _ size [ 0 ] * resampling _ ratio ), int ( old _ size [... | [
0.1298888623714447,
-0.05966712534427643,
0.7495719790458679,
-0.2055063098669052,
-1.5791257619857788,
-0.5677698254585266,
0.033248014748096466,
0.49331071972846985,
0.07935651391744614,
0.5566067099571228,
0.7842922806739807,
-0.18300704658031464,
0.16839906573295593,
0.0788473784923553... |
def new ( algorithm : str, key : bytearray, mode : int, * * kwargs ) - > cipherobjtype : result : any = none if mode = = mode _ ecb : pad _ mode = kwargs. get ('pad _ mode ', pad _ mode _ 1 ) result = gost34132015ecb ( algorithm, key, pad _ mode ) elif mode = = mode _ cbc : init _ vect = kwargs. get ('init _ vect ', _ ... | [
-0.12641580402851105,
0.2507736086845398,
0.6495076417922974,
-0.2618843913078308,
-0.4245016276836395,
0.24520118534564972,
0.29915574193000793,
-1.3852770328521729,
-0.14467310905456543,
0.5784014463424683,
-0.9557591080665588,
-0.003345091361552477,
-0.3479032516479492,
0.43760117888450... |
def add _ score ( self ) : pass | [
-0.12089604884386063,
-0.5226143002510071,
0.6250401735305786,
0.7493534088134766,
1.4669547080993652,
0.8374903202056885,
-0.6970695853233337,
-0.09291374683380127,
0.016923096030950546,
-0.41254258155822754,
-0.1461796909570694,
-0.3494027853012085,
-0.5530264377593994,
0.536138415336608... |
def get _ da _ bov ( self, sentence ) : da, _ = self. get _ da ( sentence ) dat = da [ 0 ] sv = da [ 1 ] da _ vec = np. zeros ( len ( self. pattern ) ). tolist ( ) da _ vec [ self. dat _ index [ dat ] ] = 1 value _ vectors = [ ] mask = [ ] for slot in self. slots : dic = self. value _ index [ slot ] vec = np. zeros ( l... | [
-0.6966628432273865,
0.6589720845222473,
0.7589932084083557,
0.13199828565120697,
0.3389422595500946,
-0.108108289539814,
1.30826735496521,
-0.3601948916912079,
0.4162096083164215,
0.021346069872379303,
-0.33626091480255127,
0.9182891845703125,
1.468713641166687,
0.4297213554382324,
0.37... |
def all _ by _ natural _ key ( self, user, item _ kind, category ) : hierarchy = category. hierarchy + [ category. id ] # get charges that applies on all item and categories q _ all = q ( item _ kind ='all ', categories _ _ isnull = true ) # get charges that applies only on item _ kind q _ kind = q ( item _ kind = item... | [
0.60853511095047,
-0.191471666097641,
0.7843729853630066,
0.8056014180183411,
0.11085082590579987,
0.20870348811149597,
-1.3764121532440186,
-0.10267788916826248,
-1.004838466644287,
0.21384811401367188,
-0.13926321268081665,
0.8016413450241089,
0.714786171913147,
0.5799610614776611,
-0.... |
def parse _ sts ( data _ file ) : texts = [ ] labels = [ ] return texts, labels | [
-0.5448881387710571,
-0.703447163105011,
0.1694314032793045,
-1.0158885717391968,
-0.6859258413314819,
0.8249456882476807,
-0.6575375199317932,
0.6663671135902405,
-0.45538637042045593,
0.34782910346984863,
-0.4309852123260498,
-0.12931004166603088,
0.076235830783844,
0.5011194348335266,
... |
def setfriendslistbuttonactive ( self, active ) : self. friendslistbuttonactive = active self. refreshonscreenbuttons ( ) | [
-0.9461246132850647,
-1.3122903108596802,
0.29306238889694214,
0.6416694521903992,
0.29980796575546265,
0.7621353268623352,
0.02510872296988964,
-0.2563087046146393,
0.08438372611999512,
-0.12757229804992676,
-1.832850694656372,
-0.0060343146324157715,
-0.2502572238445282,
-0.4900982379913... |
def _ trace _ and _ diagonal ( ntk : np. ndarray, trace _ axes : axes, diagonal _ axes : axes ) - > np. ndarray : if ntk. ndim % 2 = = 1 : raise valueerror ('expected an even - dimensional kernel.') output _ ndim = ntk. ndim / / 2 trace _ axes = utils. canonicalize _ axis ( trace _ axes, output _ ndim ) diagonal _ axes... | [
0.41266492009162903,
0.43402543663978577,
1.0166040658950806,
-0.2856302857398987,
0.05447820574045181,
-1.1572550535202026,
0.6191065311431885,
-0.5811086297035217,
0.09388693422079086,
0.7282122373580933,
0.1092151626944542,
-0.44725289940834045,
0.46448105573654175,
0.042003046721220016... |
def test _ serve _ build _ type _ template ( self ) : pass | [
-0.8299598693847656,
-0.06991316378116608,
0.6118220090866089,
1.0253652334213257,
0.5143772959709167,
0.7642433643341064,
1.9814733266830444,
-0.37867221236228943,
-0.48243361711502075,
0.031999167054891586,
-1.3337669372558594,
0.22012309730052948,
-1.4072144031524658,
-0.017479903995990... |
def empirical _ ntk _ fn ( f : applyfn, trace _ axes : axes = ( - 1, ), diagonal _ axes : axes = ( ), vmap _ axes : vmapaxes = none, implementation : union [ ntkimplementation, int ] = default _ ntk _ implementation, _ j _ rules : bool = _ default _ ntk _ j _ rules, _ s _ rules : bool = _ default _ ntk _ s _ rules, _ f... | [
0.5250375270843506,
0.3288646340370178,
0.48598676919937134,
-0.5867186784744263,
-0.6271830201148987,
-0.4707491099834442,
1.3873608112335205,
0.1842471957206726,
-0.06755737215280533,
1.080353021621704,
-0.15571379661560059,
0.0369529165327549,
1.1242344379425049,
-0.2400219738483429,
... |
def search ( self, word : str ) - > bool : node = self charlist = [ char for char in word ] for char in charlist : if char in node. childlist : index = node. childlist. index ( char ) node = node. children [ index ] else : return false if " end " in node. childlist : return true else : return false | [
-0.312740296125412,
0.6464903354644775,
0.9211655855178833,
0.1802845299243927,
-1.0568188428878784,
0.5106938481330872,
-0.626116156578064,
0.1418609321117401,
-1.0496747493743896,
-0.0010135439224541187,
-0.3570689558982849,
0.4046798050403595,
-1.2221965789794922,
0.18735064566135406,
... |
def _ binary _ clf _ curve ( trues, preds ) : trues = trues = = 1 desc _ idxs = np. argsort ( preds ) [ : : - 1 ] preds = preds [ desc _ idxs ] trues = trues [ desc _ idxs ] unique _ val _ idxs = np. where ( np. diff ( preds ) ) [ 0 ] threshold _ idxs = np. r _ [ unique _ val _ idxs, trues. size - 1 ] tps = np. cumsum ... | [
0.23589655756950378,
-0.013669931329786777,
0.6083568930625916,
-0.38659030199050903,
0.03278776630759239,
-0.5014032125473022,
0.16711574792861938,
0.007876639254391193,
-0.47433021664619446,
0.8608473539352417,
-0.0656072273850441,
1.7071202993392944,
0.3586418628692627,
0.17185728251934... |
def hexdigest ( self, mac _ size : int ) - > str : return self. digest ( mac _ size ). hex ( ) | [
0.5291274785995483,
-0.1137647032737732,
0.6150819063186646,
-0.6682827472686768,
-0.779190182685852,
0.5230469703674316,
-0.7383022308349609,
0.5334751605987549,
0.25432130694389343,
-0.3946499824523926,
0.7056865692138672,
-0.33993104100227356,
-0.22252202033996582,
0.0947367250919342,
... |
def get _ k ( self ) : if self. k : return self. k elif self. is _ tors ( ) : raise valueerror ( " torsion constant undefined for mode ", self. n ) else : raise valueerror ( " spring constant undefined for mode ", self. n ) | [
0.9147568941116333,
-0.015739604830741882,
0.6424749493598938,
0.4557347595691681,
0.29298117756843567,
0.5855560302734375,
0.9508773684501648,
-0.24950943887233734,
0.0907515287399292,
-0.14014525711536407,
0.6498273611068726,
-0.03221308812499046,
-0.11009586602449417,
0.5497971177101135... |
def aws _ gax _ accelerators _ flow _ logs _ enabled _ check ( cache : dict, session, awsaccountid : str, awsregion : str, awspartition : str ) - > dict : # iso time iso8601time = datetime. datetime. now ( datetime. timezone. utc ). isoformat ( ) for accel in list _ gax _ accelerators ( cache, session ) : # b64 encode ... | [
0.3595649302005768,
-0.3449024558067322,
0.6761084198951721,
0.0066512576304376125,
-0.705597460269928,
0.48051732778549194,
0.26653993129730225,
-0.19701391458511353,
0.5788336992263794,
0.23708656430244446,
-0.42593806982040405,
0.5587037205696106,
-0.3731292188167572,
0.3173432052135467... |
def variant _ sample ( project, institution, variant ) : item = { " project " : project [ " @ id " ], " institution " : institution [ " @ id " ], " variant " : variant [ " @ id " ], " call _ info " : " some _ sample ", " file " : " some _ vcf _ file ", } return item | [
0.20882081985473633,
-0.46049484610557556,
0.12173037230968475,
-0.7642696499824524,
-0.5590434074401855,
-0.2565489113330841,
-1.0502792596817017,
0.181773841381073,
-0.2811812460422516,
0.748270571231842,
-0.38870203495025635,
0.14055462181568146,
-0.6317148208618164,
-1.2726386785507202... |
def getkeepcleantime ( ) : andor _ solis. getkeepcleantime. restype = ctypes. c _ uint keepcleantime = ctypes. c _ float ( ) result = andor _ solis. getkeepcleantime ( ctypes. byref ( keepcleantime ) ) check _ status ( result ) return float ( keepcleantime. value ) | [
0.7967039346694946,
-0.0823127031326294,
0.4949413239955902,
0.12448775768280029,
-0.36091312766075134,
0.22703798115253448,
0.17141728103160858,
-0.9220402836799622,
0.1952279806137085,
0.30629125237464905,
-0.13742493093013763,
0.06865130364894867,
-0.9535630941390991,
0.4470012187957763... |
def format _ traceback ( tb, step _ info = none ) : tb = tb. splitlines ( ) [ 1 : ] if step _ info : last _ line = tb [ - 1 : ] [ 0 ] tb = tb [ : - 1 ] try : exc _ name, exc _ message = last _ line. split (':') except valueerror : exc _ message = none exc _ name = last _ line. split (':') [ 0 ] if exc _ message : last ... | [
1.0273704528808594,
-0.8238188028335571,
1.0483810901641846,
0.13663744926452637,
-0.1620858907699585,
-0.6911590695381165,
0.0025007491931319237,
0.25875020027160645,
0.10712695866823196,
0.5262002348899841,
0.6135252714157104,
-0.6677091717720032,
-0.284456729888916,
0.4007701575756073,
... |
def decode _ attributed ( text ) : decoder = get _ decoder ( none,'text / vnd. pyglet - attributed') return decoder. decode ( text ) | [
0.2110115885734558,
-0.8320385813713074,
-0.02292494848370552,
-0.3379362225532532,
-0.9894925355911255,
0.12209933996200562,
-0.8355883359909058,
0.20156724750995636,
0.7329672574996948,
0.41974958777427673,
-0.21032282710075378,
0.4448118805885315,
-0.4235627353191376,
-0.334283739328384... |
def test _ storage ( self ) : cache = cache ( self. wsdir ) cache. set _ object ( " test ", 1, " hello, world " ) self. assertequal ( cache. get _ object ( " test ", 1 ), " hello, world " ) new _ cache = cache ( self. wsdir ) self. assertequal ( new _ cache. get _ object ( " test ", 1 ), " hello, world " ) self. assert... | [
-0.35756707191467285,
0.06712242215871811,
0.6776691675186157,
0.05540941655635834,
0.39957091212272644,
-0.3865310847759247,
0.5476343035697937,
-0.9877915978431702,
0.11772625893354416,
0.2937898337841034,
-0.7119153738021851,
0.32920873165130615,
-0.29587292671203613,
-0.288121461868286... |
def add ( term, offset ) : return generate ( parse ( term ) + offset ) | [
0.035412199795246124,
-0.9506368041038513,
0.5758263468742371,
-1.0779156684875488,
-1.160803198814392,
1.1773282289505005,
-1.9486963748931885,
0.528677761554718,
-0.3769867420196533,
-0.4774695932865143,
-0.23480048775672913,
0.28772470355033875,
-0.08054562658071518,
-1.633408784866333,... |
def find _ elements ( self, locator, timeout = 20 ) : time. sleep ( 0. 5 ) return webdriverwait ( self. driver, timeout ). until ( ec. presence _ of _ all _ elements _ located ( locator ), message = f " can't find elements by locator { locator } " ) | [
-0.19051593542099,
-0.38306280970573425,
0.3275190591812134,
-0.03181425482034683,
0.14071506261825562,
0.47835028171539307,
0.20996832847595215,
0.3546118438243866,
0.622094988822937,
0.04233071953058243,
-0.4710742235183716,
-0.7005903720855713,
-0.1898244023323059,
1.0451666116714478,
... |
def _ _ init _ _ ( self ) : pass | [
0.384575754404068,
-1.1162716150283813,
0.2936498522758484,
0.8026404976844788,
0.5190465450286865,
0.6533650755882263,
0.5970242023468018,
0.30950239300727844,
0.15195979177951813,
-1.2418946027755737,
-0.8523526787757874,
-0.016424469649791718,
-0.05249137803912163,
0.6643484234809875,
... |
def _ fold _ call _ exprs ( self ) - > bool : simplified = false prop = self. _ compute _ propagation ( ) if not prop. model. equivalence : return simplified addr _ and _ idx _ to _ block : dict [ tuple [ int, int ], block ] = { } for block in self. func _ graph. nodes ( ) : addr _ and _ idx _ to _ block [ ( block. add... | [
-0.736178994178772,
0.32438531517982483,
0.9074215888977051,
-0.0900270864367485,
-0.20707754790782928,
-1.0783249139785767,
0.5673508644104004,
0.30874431133270264,
-0.20853014290332794,
0.8639757633209229,
-0.2579023241996765,
0.4430270791053772,
-0.3829216957092285,
0.4845106899738312,
... |
def _ mgui _ get _ height ( self ) - > int : return self. _ qwidget. height ( ) | [
0.6499302387237549,
0.44621512293815613,
0.32165277004241943,
-0.06766442954540253,
-0.6415424942970276,
0.5964058637619019,
0.4425479471683502,
-0.29024046659469604,
-0.9069092869758606,
-0.4503884017467499,
-0.38621485233306885,
-0.06671846657991409,
-0.40227216482162476,
-0.020088659599... |
def runq4 ( ) : random. seed ( seed ) ngames = 20 print ('running your agent % d times to compute the average score...'% ngames ) params ='- l smallclassic - p expectimaxagent - a evalfn = better - q - n % d - c'% ngames games = pacman. rungames ( * * pacman. readcommand ( params. split ('' ) ) ) timeouts = [ game. age... | [
-0.024809803813695908,
0.07618676126003265,
0.7177734971046448,
-1.034257411956787,
0.5279417037963867,
-0.6059496402740479,
-0.3482253849506378,
-0.43289124965667725,
-0.3304137885570526,
0.7294290065765381,
-0.2771426737308502,
0.07757136225700378,
-0.15824778378009796,
0.232390686869621... |
def _ _ getitem _ _ ( self, key ) : if isinstance ( key, slice ) : start, end = ( key. start, key. stop ) start - = self. genome. start end - = self. genome. start return self. genome. genome [ self. genome. seqid ] [ start : end ] else : raise typeerror ('expected a slice object but'' received a { 0 }. '. format ( typ... | [
-0.8325692415237427,
-0.7538937926292419,
0.43644624948501587,
0.5440889000892639,
-0.7737671136856079,
-0.313039630651474,
-0.09994576871395111,
-0.6696844696998596,
-0.02823857218027115,
0.4260627329349518,
0.5185075998306274,
0.8600420355796814,
-0.4117498993873596,
-0.2105143666267395,... |
def reply _ state ( self, state ) : self. logger. debug ( " replying'% s'state ", state ) beef = self. script. request _ beef ( ) for reply in beef. iter _ fsm _ state _ reply ( state ) : self. sender. write ( reply ) yield | [
-0.9118987321853638,
0.32395869493484497,
0.4980672001838684,
-0.7517275214195251,
-0.1727944165468216,
-0.9271817803382874,
-0.20834855735301971,
-1.1003754138946533,
0.510116457939148,
-0.12790367007255554,
-0.7392504811286926,
0.27043265104293823,
-0.03527265414595604,
0.509498894214630... |
def form _ valid ( self, form ) : print ( " valid forms " ) return super ( basetruckform, self ). form _ valid ( form ) # return httpresponseredirect ( self. get _ success _ url ( ) ) | [
-0.5317946672439575,
-0.4449094831943512,
0.45574167370796204,
0.07846270501613617,
0.08647716045379639,
0.9691065549850464,
-0.2733725607395172,
0.6100264191627502,
-0.51910001039505,
-1.3196673393249512,
-0.20243972539901733,
-0.8098704814910889,
0.8998363018035889,
-0.08560778945684433,... |
def is _ prime ( number ) : for element in range ( number ) : if number % element = = 0 : return false return true | [
-1.0213717222213745,
0.880034327507019,
0.2851572334766388,
0.835367739200592,
0.7431816458702087,
0.3768163323402405,
-0.9198183417320251,
0.4383857548236847,
1.4839612245559692,
-0.436400443315506,
-0.24799533188343048,
-1.1614409685134888,
-1.1940549612045288,
0.6620518565177917,
-0.9... |
def _ try _ parse _ pbt ( path : str ) - > optional [ pyrrigateconf ] : if not os. path. isfile ( path ) : return none conf = pyrrigateconf ( ) try : with open ( path,'r') as conf _ file : return tpb. parse ( conf _ file. read ( ), conf ) except tpb. parseerror : logging. warning ('unable to parse protobuf file at " % ... | [
1.185274600982666,
-0.5431125164031982,
0.6536016464233398,
-0.33434373140335083,
0.16325996816158295,
0.2888580560684204,
-0.26787206530570984,
-0.5500425100326538,
-0.8787150979042053,
0.00704557541757822,
-0.3673832416534424,
-1.4553157091140747,
-0.8665956258773804,
-0.2607675194740295... |
def build _ discriminator _ growth _ layer _ block ( conv _ layers, params, block _ idx ) : with tf. variable _ scope ( name _ or _ scope = " discriminator ", reuse = tf. auto _ reuse ) : # get conv block layer properties. conv _ block = params [ " discriminator _ growth _ conv _ blocks " ] [ block _ idx ] # create new... | [
-0.5194340944290161,
-0.4435822367668152,
0.7572225332260132,
0.7548497915267944,
0.01090021152049303,
-0.15781070291996002,
0.6664564609527588,
-0.41993629932403564,
0.016228368505835533,
-0.45209768414497375,
-0.297262966632843,
0.5575641393661499,
0.06102041155099869,
0.0959540754556655... |
def draw ( self ) : self. screen. blit ( self. game _ window, self. rect ) self. bg. draw ( ) self. ship. draw ( ) for pipe in self. pipes : pipe. draw ( ) self. hourglass. draw ( ) text _ font = pygame. font. font ( font [ " bradbunr " ], 25 ) string1 = " score { 0 } : { 1 } ". format ( self. username, self. ship. sco... | [
-0.7088869214057922,
-0.17095035314559937,
0.693784236907959,
-0.5819907188415527,
0.4225420355796814,
0.9213449358940125,
0.2681414484977722,
-0.41270989179611206,
-0.2802768051624298,
-0.06570480018854141,
0.645054280757904,
0.27512818574905396,
-0.1489451676607132,
0.5126233696937561,
... |
def get _ json ( metadata _ filename, report _ fields, parser ) : metadata = { } if os. path. exists ( metadata _ filename ) and os. path. isfile ( metadata _ filename ) : with open ( metadata _ filename, " r " ) as meta _ handle : metadata = json. load ( meta _ handle ) for key in report _ fields : if key not in metad... | [
0.35499778389930725,
-0.26174408197402954,
0.6501146554946899,
-0.12082372605800629,
0.35047510266304016,
0.057642899453639984,
0.38406041264533997,
-0.008811870589852333,
-0.9499011635780334,
0.7438879609107971,
-0.29574018716812134,
0.08522386103868484,
0.06466091424226761,
0.31485578417... |
def _ _ getattr _ _ ( self, name ) : if name. startswith ( " _ " ) : raise attributeerror ( name ) tp = self. _ dispatch _ component ( name ) return tp | [
0.1179557740688324,
-0.6096929907798767,
0.6243708729743958,
-0.8819916248321533,
-0.5239590406417847,
-0.48315128684043884,
0.4561965763568878,
-1.1452586650848389,
0.5071951746940613,
0.41969841718673706,
-0.3776213824748993,
-0.5887306332588196,
1.0853464603424072,
-0.28421905636787415,... |
def parse ( self, response ) : print ( " processing new search page : " + response. url ) # extract data using css selectors sel = scrapy. selector ( response ) yield from self. page _ recipes ( sel, response ) yield from self. load _ next _ page ( sel, response ) | [
-0.545910656452179,
0.10624197870492935,
0.46057525277137756,
-0.00027224677614867687,
0.45713984966278076,
-0.16466332972049713,
-0.7520833611488342,
-0.11900990456342697,
0.849361002445221,
-0.19139251112937927,
0.10174199193716049,
-0.9863215684890747,
0.2797302305698395,
0.675623893737... |
def main ( filelocation ) : sentences = sent _ tokenize ( open ( filelocation ). read ( ) ) output = " " for i in sentences : temp = nonworderrorcorrection ( i ) output + = temp printfile = open ('output. txt ','w') printfile. write ( output ) | [
0.28263047337532043,
-0.8811355233192444,
0.4947660267353058,
0.00005232982221059501,
-0.07162293046712875,
0.014605745673179626,
1.0831482410430908,
0.5088812708854675,
-0.9994906783103943,
0.9488022923469543,
0.02494308538734913,
-0.3447977900505066,
-0.40451547503471375,
0.2916239202022... |
def reverse _ ll ( self ) : new _ head = none n = self. head while n : new _ head = node ( n. data, new _ head ) n = n. next return new _ head | [
-0.502284824848175,
-0.11063119769096375,
0.4989837408065796,
-0.5191953182220459,
-0.08881581574678421,
-0.2551145553588867,
-0.676861584186554,
0.07328805327415466,
-0.0795796811580658,
-0.7798210382461548,
-0.47879016399383545,
1.030815601348877,
-0.7795346975326538,
-0.4948768615722656... |
def choose _ genome _ version ( genome _ version ) : if genome _ version = ='hg19': chromosomes _ dict = chromosomes _ hg19 elif genome _ version = ='hg38': chromosomes _ dict = chromosomes _ hg38 elif genome _ version = = " mm10 " : chromosomes _ dict = chromosomes _ mm10 else : print ( " genome version not included. ... | [
0.2533753216266632,
-0.21473485231399536,
0.6301669478416443,
0.161729097366333,
-1.0065370798110962,
0.28609204292297363,
-0.29096969962120056,
0.38343775272369385,
-0.75418621301651,
0.4230140149593353,
-0.7774459719657898,
0.46474844217300415,
-0.44088032841682434,
0.6731464266777039,
... |
def match _ coarse _ stress _ pattern ( self, pattern : text ) - > bool : return true if re. match ( pattern, " ". join ( self. coarse _ stress ) ) else false | [
0.757838785648346,
0.007283815182745457,
0.412337988615036,
-0.2156049758195877,
-0.3322916626930237,
0.6255638599395752,
-0.3104446232318878,
0.1424301564693451,
0.5481600165367126,
0.2762080430984497,
-0.6241263747215271,
-0.22239826619625092,
-1.182505488395691,
-0.5788708925247192,
-... |
def insert _ source _ index _ children ( self, source _ index ) : for row in range ( self. sourcemodel ( ). rowcount ( source _ index ) ) : child _ index = self. sourcemodel ( ). index ( row, 0, source _ index ) proxy _ index = self. createindex ( child _ index. row ( ), child _ index. column ( ), child _ index. intern... | [
-1.3704878091812134,
0.6457167267799377,
0.6427954435348511,
-1.1687297821044922,
0.0994110032916069,
0.4075377285480499,
1.2104554176330566,
0.25555670261383057,
0.6438140869140625,
-0.37826091051101685,
-1.6840113401412964,
-0.894396960735321,
-0.23512840270996094,
-0.12020038813352585,
... |
def post ( self, request ) : post _ data = request. post. dict ( ) search _ payload = {'key': key,'query': post _ data ['location'] +'bangalore'} search _ req = requests. get ( search _ url, params = search _ payload ) search _ json = search _ req. json ( ) place _ id = search _ json ['results'] [ 0 ] ['place _ id'] de... | [
-0.7687053680419922,
-0.06380881369113922,
0.8094264268875122,
-0.19883248209953308,
0.7615768909454346,
0.8828826546669006,
0.12474647909402847,
0.4616352915763855,
-0.4536442756652832,
-0.44794782996177673,
0.24041910469532013,
0.14311814308166504,
0.025307584553956985,
0.337538748979568... |
def test _ api _ video _ initiate _ upload _ file _ too _ large ( self ) : video = factories. videofactory ( id = " 27a23f52 - 3379 - 46a2 - 94fa - 697b59cfe3c7 ", upload _ state = random. choice ( [ " ready ", " error " ] ), ) jwt _ token = instructororadminltitokenfactory ( playlist = video. playlist ) now = datetime... | [
-0.10865709185600281,
0.46472176909446716,
0.6534520983695984,
-0.34133532643318176,
0.7488416433334351,
0.1584717482328415,
-0.4294202923774719,
0.19906413555145264,
-0.1421029269695282,
0.392345666885376,
-1.0159014463424683,
0.6850458979606628,
-0.22550472617149353,
0.2645730674266815,
... |
def testsettaginstancepermissiondenied ( self ) : userapi ( ). create ( [ ( u'fred ', u'password ', u'fred ', u'fred @ example. com') ] ) user = getuser ( u'username') permissions = cachingpermissionapi ( user ) tagapi ( user ). create ( [ ( u'fred / bar ', u'description') ] ) values = [ ( u'fred / bar ', operation. wr... | [
-0.39619749784469604,
0.9609619379043579,
0.466104656457901,
-0.27292561531066895,
0.2794986069202423,
0.8609185218811035,
0.7332826852798462,
-0.42287036776542664,
-0.6834753751754761,
-0.4336478114128113,
-0.36535173654556274,
-0.12728476524353027,
-0.474468469619751,
0.46381697058677673... |
def doblar ( lista ) : return [ n * 2 for n in lista ] | [
-0.4252852499485016,
0.4352436065673828,
0.47335585951805115,
2.2222399711608887,
0.6345195770263672,
0.10095598548650742,
-0.5381916165351868,
-0.13068366050720215,
0.5452538728713989,
-0.152490496635437,
-1.6247135400772095,
-0.5619975924491882,
0.4079994261264801,
1.6954139471054077,
... |
def get _ inference _ statistics ( self, model _ name : str =..., model _ version : str =..., headers : dict [ str, t. any ] =..., as _ json : t. literal [ false ] =..., ) - > service _ pb2. modelstatisticsresponse : | [
-0.7470064759254456,
0.059217289090156555,
0.5338438153266907,
0.31377115845680237,
0.07438892871141434,
-0.3802473843097687,
-0.3105400800704956,
-1.0926035642623901,
-0.4598158001899719,
-0.20790034532546997,
-1.0502915382385254,
0.3954448103904724,
-0.09985397756099701,
0.19566079974174... |
def save ( self, * args, * * kwargs ) : # if this is a new instance add details from api if not self. id : # connect to api and get the details entry = self. entry ( ) # set the details self. title = entry. media. title. text self. description = entry. media. description. text self. keywords = entry. media. keywords. t... | [
-0.8621322512626648,
-0.28369972109794617,
0.7218542695045471,
0.2555426359176636,
0.6131003499031067,
0.05396943911910057,
-0.29308009147644043,
0.5569137930870056,
0.6654849648475647,
0.05490618571639061,
-0.922753632068634,
0.17254622280597687,
-0.04981549084186554,
1.496317744255066,
... |
def test _ review _ to _ activity ( self, * _ ) : status = models. review. objects. create ( name = " review name ", content = " test content ", rating = 3. 0, user = self. local _ user, book = self. book, ) activity = status. to _ activity ( ) self. assertequal ( activity [ " id " ], status. remote _ id ) self. assert... | [
0.1258668601512909,
-0.25384294986724854,
0.23222318291664124,
-0.3598436117172241,
0.35076919198036194,
0.5358694195747375,
-0.3457236588001251,
-0.06572473049163818,
0.4027951955795288,
0.25388121604919434,
-0.45076674222946167,
-0.2676953673362732,
-0.6519035696983337,
-0.75497025251388... |
def optimize _ local _ expressive ( log _ likelihood, model, data _ var, k = 100, check _ every = 100, sentinel _ thres = 10, n _ flows = 2, debug = false ) : def log _ joint ( x _ logits, x, z ) : " " " log p ( x, z ) " " " zeros = variable ( torch. zeros ( z. size ( ) ). type ( model. dtype ) ) logpz = log _ normal (... | [
0.7528728246688843,
-0.8599453568458557,
0.7094341516494751,
-0.34103161096572876,
-0.732142448425293,
-0.7135008573532104,
0.5808748602867126,
0.00030084638274274766,
0.059087369590997696,
0.45358970761299133,
-0.45543229579925537,
0.32653042674064636,
-0.06492449343204498,
-0.23202940821... |
def update ( self, dummy = ( 0, 0, 0, 0 ) ) : self. t. cancel ( ) pos = self. main. pos # the current position during this update ( ) poi _ r = 5 # poi circles radius ch _ l = 10 # crosshair length # canvas center point center _ x = self. size [ 0 ] / 2 center _ y = self. size [ 1 ] / 2 # pc is the current center point... | [
0.1396971195936203,
-0.6386704444885254,
0.9861875176429749,
-0.39847925305366516,
-0.4824858009815216,
0.2862350642681122,
0.8222252726554871,
0.012377412058413029,
-0.3344915509223938,
0.24757574498653412,
-0.5743433833122253,
-0.010243967175483704,
-0.25931864976882935,
0.16456267237663... |
def get _ tag _ position ( self, model, doc, path ) : pass | [
-0.6583651304244995,
-0.7693113684654236,
0.23158606886863708,
0.5938056707382202,
0.36810100078582764,
0.01651163585484028,
0.5636807680130005,
-0.03684813901782036,
-1.6699203252792358,
0.02878027781844139,
-0.9145738482475281,
-1.0165672302246094,
-0.15088286995887756,
0.261816918849945... |
def get _ filepath ( self ) : return self. path | [
0.21731862425804138,
-1.2512383460998535,
0.25162598490715027,
0.23697851598262787,
0.6601012349128723,
0.660362184047699,
1.445154070854187,
0.3101752996444702,
-0.7846115827560425,
-0.8108910918235779,
0.6706562042236328,
-0.10951323062181473,
-0.3005395531654358,
-0.19240182638168335,
... |
def test _ status ( valid _ predictor _ report _ data ) : report = report. build ( valid _ predictor _ report _ data ) assert report. succeeded ( ) and not report. in _ progress ( ) and not report. failed ( ) | [
0.27915728092193604,
0.3539002537727356,
0.37715086340904236,
0.6070203185081482,
0.2873408794403076,
0.941949725151062,
0.007933873683214188,
1.201409935951233,
-0.1781865656375885,
-1.4809380769729614,
-0.5568464398384094,
-0.34569624066352844,
-0.49768945574760437,
-0.5356499552726746,
... |
def get ( self, item ) : return self. _ items [ item ] | [
-0.842380702495575,
-0.12064813822507858,
-0.04717649891972542,
-0.006837882101535797,
0.5049035549163818,
0.3060528635978699,
-0.5386523008346558,
-1.2330670356750488,
0.2023458182811737,
-0.5601470470428467,
-0.19386646151542664,
0.6066023111343384,
0.051780376583337784,
-1.4451516866683... |
def template _ files ( self, file _ list ) : result = { } for path in file _ list : if self. template _ seperator in path : # capture everything before and after the first " | " k, v = path. split ( self. template _ seperator, 1 ) result = self. util. merge _ dicts ( result, { k : v } ) return result | [
-0.8257948756217957,
0.0955139696598053,
0.37146270275115967,
0.5142143964767456,
-0.9950380325317383,
-0.7925468683242798,
-0.3009531795978546,
0.7766094207763672,
-0.9869244694709778,
-0.0639268234372139,
-1.221053123474121,
-2.1011593341827393,
-0.02568923681974411,
1.455441951751709,
... |
def construction ( resolver : callable, ) - > union [ constructionwithcontainer, constructionwithoutcontainer ] : func _ arity = arity ( resolver ) if func _ arity = = 0 : return constructionwithoutcontainer ( resolver ) if func _ arity = = 1 : return constructionwithcontainer ( resolver ) raise invaliddependencydefini... | [
-0.47921881079673767,
-0.5081697106361389,
0.6648005843162537,
1.2772982120513916,
-0.21136073768138885,
-0.34648996591567993,
0.7919409275054932,
0.5533677339553833,
0.18554390966892242,
-0.9119913578033447,
0.25886932015419006,
-0.8501383662223816,
1.0008625984191895,
1.198583722114563,
... |
def test _ reload ( self ) : tm0 = testmodel. create ( count = 8, text ='123456789') tm1 = testmodel. get ( tm0. vid ) tm1. count = 7 tm1. save ( ) tm0. reload ( ) assert tm0. count = = 7 | [
-0.34543880820274353,
0.05816718935966492,
0.41723406314849854,
0.4001997113227844,
0.37694114446640015,
-0.07468641549348831,
0.4430759847164154,
-0.2771665155887604,
-0.6506566405296326,
-0.049454525113105774,
-0.8570841550827026,
-0.5850197672843933,
-0.01337368879467249,
-0.17058466374... |
def print _ all ( data ) : pp. pprint ( data ) | [
0.866610586643219,
-0.21808511018753052,
0.336463063955307,
-0.2552691400051117,
0.3844928741455078,
0.9430832862854004,
-1.603333830833435,
-0.14187932014465332,
-0.09651242196559906,
-0.6232140064239502,
0.4992470145225525,
1.0875062942504883,
-0.3303283154964447,
1.2417924404144287,
-... |
def run _ plotting ( path _ data, path _ output, title ) : print ('- - reading file :'+ path _ data ) print ('- - output file :'+ path _ output + '. pdf') print ('- - plot title :'+ title ) with open ( path _ data,'r') as infile : lines = infile. readlines ( ) # first line are column names column _ names = lines [ 0 ] ... | [
0.2944178581237793,
-0.09950119256973267,
0.6593424081802368,
-0.384347528219223,
-0.09516826272010803,
0.1491103172302246,
0.3865016996860504,
0.33988088369369507,
-1.2325005531311035,
-0.4682105779647827,
0.6431973576545715,
0.7008454203605652,
0.3727298974990845,
-1.1747997999191284,
... |
def test _ query _ multiple _ eod _ history _ dbs ( self ) : def mock _ get _ history _ db _ config ( db ) : if db = = " usa - stk - 1d " : return { " bar _ size " : " 1 day ", " universes " : [ " usa - stk " ], " vendor " : " ibkr ", " fields " : { " close " : " float ", " open " : " float ", " high " : " float ", " l... | [
-0.5335294604301453,
0.6971534490585327,
0.945235550403595,
-0.11612500995397568,
0.6615208983421326,
0.049773212522268295,
0.7380971908569336,
-0.367413192987442,
-0.2711125314235687,
-0.08601018041372299,
-0.01085910014808178,
0.01564992405474186,
0.031830932945013046,
0.3660463690757751... |
def game _ 3 ( ) : choice _ firstinoffice _ exit = input ( " " " * now, would you like to : \ n 1. check out the safebox 3. go to the lobby \ n > " " " ) if choice _ firstinoffice _ exit = = str ( 1 ) : print ( " $ " * 80 ) print ( " " " on the safebox you can see that it requires a 4 digit number pin in order to open.... | [
0.15938979387283325,
0.44262152910232544,
0.7082255482673645,
0.7817807793617249,
0.4141623079776764,
1.1275078058242798,
0.19782547652721405,
-0.41145503520965576,
-0.37262383103370667,
0.39452049136161804,
-0.4085199534893036,
0.9530701637268066,
-0.3074813783168793,
0.07938646525144577,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.