text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def generate _ api _ key ( request ) : new _ key = apiuser. objects. get _ unique _ key ( ) return httpresponse ( json. dumps ( {'token': new _ key } ), content _ type = " application / javascript " ) | [
-1.1323697566986084,
-0.5890798568725586,
0.27762672305107117,
-0.2625422179698944,
-0.3326197564601898,
-0.5054138898849487,
-0.005737914703786373,
0.11819551140069962,
-0.11895032227039337,
0.6205626130104065,
-0.9462608695030212,
-0.24682505428791046,
0.20276929438114166,
-0.26129555702... |
def set _ mlflow _ events _ and _ warnings _ behavior _ globally ( disable _ event _ logs, disable _ warnings, reroute _ warnings ) : with _ setmlfloweventsandwarningsbehaviorglobally ( disable _ event _ logs, disable _ warnings, reroute _ warnings ) : yield | [
0.8342604041099548,
-0.1266726553440094,
0.6175886392593384,
1.3199214935302734,
0.6314886212348938,
-0.2401973009109497,
0.714575469493866,
0.17625537514686584,
-0.05536217242479324,
0.45901593565940857,
-0.18814904987812042,
1.1770116090774536,
0.02917899750173092,
0.5241976976394653,
... |
def load _ config ( conf _ file ) : config = load _ conf ( conf _ file ) globals ( ) ['config'] = config # config file read set global vars # setting ov _ config ov _ config = dict ( config. items ('oneview _ config') ) ov _ config ['credentials'] = dict ( config. items ('credentials') ) ov _ config ['api _ version'] =... | [
-0.6284229159355164,
0.4992620646953583,
0.6796936392784119,
-0.11122345179319382,
-0.4424428641796112,
0.11402929574251175,
1.1745548248291016,
0.6132879257202148,
0.4225884974002838,
0.2626667618751526,
-0.362857848405838,
0.10892469435930252,
-0.2755565345287323,
1.465245246887207,
1.... |
def termscheck ( self ) : request = self. request response = request ['response'] acceptstatus = request. form. get ('terms') or'' url = request. form. get ('came _ from') or self. absolute _ url _ path ( ) if acceptstatus! ='accept': self. resetcredentials ( request, response ) if '?'in url : url + ='&'else : url + = ... | [
-0.6685549020767212,
0.3018554747104645,
0.8369086384773254,
0.12150832265615463,
-0.04661141708493233,
0.8014363646507263,
-0.125547856092453,
0.4366905987262726,
-0.15405331552028656,
-0.2902173399925232,
0.8958732485771179,
-0.04947632551193237,
-0.25311279296875,
0.5638373494148254,
... |
def test _ carn _ ttest _ without _ feeding ( self ) : samples = [ ] for seed in range ( 1, 20 ) : sim = biosim ( self. geogr, self. ini _ carns, seed = seed, vis _ years = 0 ) herbivores, carnivores = sim. simulate ( 100 ) samples. append ( carnivores ) sample1, sample2 = random. sample ( samples, 2 ) assert stats. tt... | [
0.3105301558971405,
-0.09971246868371964,
0.13634423911571503,
-0.11273419857025146,
0.17787186801433563,
0.16870613396167755,
-0.33144575357437134,
-0.6325403451919556,
-0.8111764192581177,
-0.31509286165237427,
-0.17125698924064636,
0.4593922793865204,
-0.3600357174873352,
-0.33185815811... |
def encode ( self, options, program = " mencoder " ) : # these options set up mplayer to read raw rgb frames. the fourcc there is # hex for ('r ','g ','b ', 24 ). all other parameters should be supplied by the caller. # we use popen to pipe video into mencoder's stdin. cmdline = " % s - - rawvideo on : fps = % s : w = ... | [
-0.4558798372745514,
-0.3048160672187805,
0.7199269533157349,
1.1739426851272583,
0.028284769505262375,
0.2757628858089447,
0.296739786863327,
-0.5174686908721924,
0.0411699041724205,
-0.20631442964076996,
-0.5747144222259521,
0.34224048256874084,
-0.8839279413223267,
0.8308693766593933,
... |
def readimagenames ( self, imagelistfile ) : f = open ( imagelistfile,'r') filenames = [ ] transcriptions = [ ] for line in f : data = line. strip ( ). split ('|') filename = data [ 0 ]. strip ( ) transcription = data [ 1 ]. strip ( ) filenames. append ( filename ) transcriptions. append ( transcription ) return filena... | [
-1.2042949199676514,
-0.732628583908081,
0.6204383373260498,
-0.46890661120414734,
-0.8972160816192627,
-0.27698010206222534,
-0.04734646901488304,
0.9171673655509949,
-0.20809389650821686,
0.8021349310874939,
-0.6794262528419495,
-0.32709839940071106,
0.40778180956840515,
1.05152583122253... |
def plot _ ellipses _ area ( params, depth = " none ", imin = 0, imax = 398, jmin = 0, jmax = 898, figsize = ( 10, 10 ) ) : phi = 0 fig, ax = plt. subplots ( 1, 1, figsize = figsize ) k = np. zeros ( ( 898, 398 ) ) m = np. zeros ( ( 898, 398 ) ) scale = 10 for q in np. arange ( jmin, jmax ) : for l in np. arange ( imin... | [
-0.14220891892910004,
0.06136418506503105,
1.0567435026168823,
-0.9724525809288025,
-0.6154226064682007,
0.46849802136421204,
0.4266422688961029,
0.269584059715271,
0.6819975972175598,
0.5233805775642395,
0.5731574296951294,
0.8947262167930603,
-0.03081132099032402,
0.6066405177116394,
-... |
def load _ volume ( self, db, m ) : " " " arguments : db : databaseisles m : image modality returns : volume as numpy array " " " volume _ path = os. path. join ( db. db _ path, self. relative _ path, self. modalities _ dict [ m ], self. modalities _ dict [ m ] + '. nii') volume = nib. load ( volume _ path ). get _ dat... | [
0.17349599301815033,
-0.7630893588066101,
0.49742230772972107,
-0.6681004762649536,
-0.023324916139245033,
-0.27461427450180054,
-0.589059054851532,
-0.1678251177072525,
-0.21668212115764618,
0.5743429660797119,
0.36210763454437256,
-0.2393961101770401,
-0.7697170972824097,
0.5358785986900... |
def read _ spatial _ file ( spatial _ file ) : if spatial _ file : cube = iris. load _ cube ( spatial _ file ) else : cube = none return cube | [
0.5725852251052856,
-0.34872880578041077,
0.6117616891860962,
0.7609537839889526,
-0.1812157928943634,
0.567819356918335,
0.0484595000743866,
0.5791590809822083,
-0.988881528377533,
0.459429532289505,
0.6189256310462952,
0.6129361391067505,
-0.2740011215209961,
-0.8556402921676636,
0.731... |
def write ( self, file _ name : optional [ path ] = none ) : if file _ name is none : if self. file _ name is not none : file _ name = self. file _ name else : raise valueerror ('file _ name must be specified') size _ scale _ format ='{ : > 3d } { :. 7f } size, scale ( km ) \ n'sig _ format ='{ : 16e } { : 16e } sigkm,... | [
0.04276134818792343,
-0.9477714896202087,
1.103749394416809,
-0.19354121387004852,
0.46000272035598755,
0.865342378616333,
0.6036582589149475,
0.2245485633611679,
-0.5517048239707947,
0.12092357873916626,
-0.4851144850254059,
-0.3257995843887329,
0.03689732030034065,
0.18582068383693695,
... |
def on _ init ( self, config : dict ) - > bool : return self. on _ update ( config ) | [
0.05829465761780739,
-0.4366895854473114,
0.3798099756240845,
0.16648194193840027,
-0.6018674969673157,
0.011014488525688648,
-0.9876741170883179,
0.10771197080612183,
0.047448717057704926,
0.7540076375007629,
-1.6274141073226929,
-1.0150467157363892,
-0.03952078893780708,
0.31726235151290... |
def optimize ( tree ) : if isinstance ( tree, dict ) : return { " operator _ add " : _ bin _ numeric _ op ( operator. add ), " operator _ subtract " : _ bin _ numeric _ op ( operator. sub ), " operator _ multiply " : _ bin _ numeric _ op ( operator. mul ), " operator _ divide " : _ bin _ numeric _ op ( operator. truedi... | [
-0.521896481513977,
-0.10964050143957138,
1.1260162591934204,
-0.339490681886673,
-1.1730437278747559,
-0.4757497310638428,
0.4262894093990326,
-0.7071536779403687,
0.32797253131866455,
0.20481842756271362,
-1.229811668395996,
-0.634366512298584,
0.07934532314538956,
0.434723824262619,
0... |
def test _ match _ between ( self, basic _ logfile ) : matcher = logmatcher ( log _ path = basic _ logfile ) matcher. match ( regex = re. compile ( r " second " ), timeout = 0. 5 ) matcher. mark ( " start " ) matcher. match ( regex = re. compile ( r " fourth " ), timeout = 0. 5 ) matcher. mark ( " end " ) match = match... | [
0.5166812539100647,
-0.6398777365684509,
1.0274956226348877,
-0.319635808467865,
0.28230035305023193,
0.34271669387817383,
-0.5701608061790466,
-0.3188367486000061,
-1.1039289236068726,
-1.0717239379882812,
-0.5086599588394165,
-0.51606684923172,
-0.919347882270813,
-0.6386978626251221,
... |
def dwt _ onset ( times, counts ) : x = times y = counts dwt = bl. dwt _ breakdown ( x, y, wavelet ='db4') bin3 = dwt ['components'] [ 3 ] bin6 = dwt ['components'] [ 5 ] # identify regions of increasing activity maxs6 = signal. argrelextrema ( bin6, np. greater, order = 15 ) [ 0 ] mins6 = signal. argrelextrema ( bin6,... | [
0.14238418638706207,
0.09985417872667313,
0.5226361155509949,
-0.5424096584320068,
-0.486188143491745,
-0.7399353981018066,
-0.26440081000328064,
-0.4461902678012848,
-0.16707828640937805,
0.5836321711540222,
-0.8984548449516296,
-0.028311491012573242,
0.499250203371048,
0.4367752373218536... |
def min _ span _ tree ( graph ) : start = next ( iter ( graph. adj _ list ) ) visited = set ( ) edges = set ( ) heap = [ ( 0, edge ( none, start, 0 ) ) ] while heap : # add dest to network if not already visited _, edge = heapq. heappop ( heap ) if edge. dest in visited : continue visited. add ( edge. dest ) if edge. s... | [
0.38087204098701477,
0.35182541608810425,
0.7120157480239868,
-0.6061177849769592,
-0.7223306894302368,
0.1079670786857605,
-0.30579984188079834,
-0.48235100507736206,
1.093769907951355,
0.1126919835805893,
0.0778784528374672,
-0.2775682806968689,
-0.2086292952299118,
0.28016719222068787,
... |
def write _ events ( self, events, async _ enable = true, callback = none, * * kwargs ) : if not events : return storage _ uri = kwargs. pop ('storage _ uri ', self. _ storage _ uri ) if not async _ enable : return self. _ do _ write _ events ( events, storage _ uri ) def safe _ call ( * args, * * kwargs ) : try : retu... | [
-1.0897620916366577,
0.39347583055496216,
0.844343900680542,
1.1142199039459229,
1.0166563987731934,
-0.6424027681350708,
0.5033524632453918,
-0.09266706556081772,
0.4829753339290619,
0.5089521408081055,
-0.089107446372509,
-0.36898544430732727,
-1.0013070106506348,
0.01685689575970173,
... |
def get _ cache ( model _ name ) : timetable _ models = { " module " : [ modulea, moduleb ], " students " : [ studentsa, studentsb ], " timetable " : [ timetablea, timetableb ], " weekmapnumeric " : [ weekmapnumerica, weekmapnumericb ], " weekstructure " : [ weekstructurea, weekstructureb ], " lecturer " : [ lecturera,... | [
-1.4970320463180542,
-0.3444119095802307,
0.7628189921379089,
0.6105806231498718,
-0.2714824080467224,
0.3929199278354645,
0.33775603771209717,
-0.4109305143356323,
-0.05244554951786995,
0.6708850264549255,
-0.33373209834098816,
0.050924982875585556,
0.05798792466521263,
0.5520817637443542... |
def test _ convert _ openapi _ to _ json _ schema ( ) : openapi = { " type " : " array ", " items " : { " type " : " object ", " properties " : { " firststation " : { " type " : " string ", " nullable " : true }, " guid " : { " type " : " string " }, " laststation " : { " type " : " string ", " nullable " : true }, " m... | [
-1.0639729499816895,
-1.0891021490097046,
0.6862702369689941,
-0.7513454556465149,
-0.42610037326812744,
-0.0896056517958641,
-0.3327769339084625,
-0.29749593138694763,
0.044350091367959976,
-0.1791965514421463,
-0.6107916831970215,
0.006095872260630131,
0.11648140847682953,
-0.39280605316... |
def getgoal ( self, state, role ) : if self. thebackingmachine = = none : return 0 try : return self. thebackingmachine. getgoal ( state, role ) except goaldefinitionexception as ge : raise ge except exception as e : self. failgracefully ( e, none ) except threaddeath as d : raise d except outofmemoryerror as e : raise... | [
0.06708896160125732,
0.8782441020011902,
0.6179853677749634,
0.2722508907318115,
0.31894758343696594,
-0.7926559448242188,
-0.47366267442703247,
-0.14806491136550903,
-0.8551913499832153,
0.6488535404205322,
0.8323298096656799,
0.485039621591568,
-0.2303301841020584,
0.40678462386131287,
... |
def test _ job _ enum ( self ) : self. assertequal ( jobenum ('gaussian'). value,'gaussian') self. assertequal ( jobenum ('molpro'). value,'molpro') self. assertequal ( jobenum ('orca'). value,'orca') self. assertequal ( jobenum ('psi4'). value,'psi4') self. assertequal ( jobenum ('qchem'). value,'qchem') self. asserte... | [
-0.09228327125310898,
-0.6376348733901978,
0.8200017213821411,
-0.23246507346630096,
0.16874685883522034,
0.8115136623382568,
-0.3800080418586731,
0.21937739849090576,
-0.19750452041625977,
-0.05433954298496246,
-1.3078359365463257,
0.03607766330242157,
0.08949381858110428,
0.0319429002702... |
def test _ redirect _ request ( self ) - > none : req = mock ( spec = [ " cookies " ] ) req. cookies = [ ] url = urlparse ( self. get _ success ( self. provider. handle _ redirect _ request ( req, b " http : / / client / redirect " ) ) ) auth _ endpoint = urlparse ( self. fake _ server. authorization _ endpoint ) self.... | [
-0.3008536398410797,
0.26702937483787537,
0.6077871322631836,
0.18767111003398895,
0.3493410348892212,
-0.4467761218547821,
0.4331166744232178,
0.014282559044659138,
1.1738110780715942,
-0.8338342308998108,
0.13091754913330078,
0.2820488512516022,
0.2018761783838272,
-0.16506904363632202,
... |
def get _ type ( self ) : return self. type | [
-0.2687514126300812,
0.07734940201044083,
0.2565765380859375,
0.4269929826259613,
1.5778614282608032,
0.5338931679725647,
0.8224886059761047,
-0.4624903202056885,
0.4556213915348053,
-0.8867092132568359,
-0.10542821139097214,
1.0517210960388184,
-1.2001577615737915,
0.08010481297969818,
... |
def send _ cmd ( port, cmd, read = false, timeout = 0. 1 ) : iface = serial. serial ( port = port, baudrate = 9600, bytesize = 8, parity = " n ", stopbits = 1, timeout = timeout ) hello = b " \ x87 \ x83 " # command prefix msg = hello + bytes ( [ cmd ] ) iface. write ( msg ) blob = b " " if read : while true : byte = i... | [
0.5148552656173706,
-0.11610453575849533,
0.7677890062332153,
0.13321766257286072,
-0.21242670714855194,
0.27567964792251587,
-0.6404634714126587,
-0.9402608275413513,
-0.19539088010787964,
0.16714777052402496,
-0.014285278506577015,
0.005502881016582251,
-1.1222035884857178,
-0.1722668856... |
def _ github ( self, url, payload = none, ignore _ errors = false, nb _ tries = 2 ) : for repo in self : if not repo. token : return match _ object = re. search ('( [ ^ / ] + ) / ( [ ^ / ] + ) / ( [ ^ /. ] + (. git )? ) ', repo. base ) if match _ object : url = url. replace (': owner ', match _ object. group ( 2 ) ) ur... | [
-1.0510298013687134,
0.5152791738510132,
0.8823359608650208,
0.054461728781461716,
-0.0993083268404007,
-0.7678493857383728,
-0.9859288930892944,
-0.8757643103599548,
-0.29070040583610535,
0.4260769784450531,
-0.25791308283805847,
-0.04130234196782112,
-0.4555443525314331,
0.23314839601516... |
def amadeus _ low _ fare _ request ( origin, destination, departure _ date, * * kwargs ) : url _ params = {'origin': origin,'destination': destination,'departure _ date': departure _ date, } url _ params. update ( kwargs ) url = low _ fare _ url + '?'+ ('apikey = % s &'% amadeus _ api _ key ) +'& '. join ( ['% s = % s'... | [
-0.7487459182739258,
0.06229359284043312,
1.0350075960159302,
-0.3934362530708313,
-0.09007244557142258,
-0.9682769775390625,
-1.46876859664917,
-0.5716167092323303,
-0.8552820086479187,
-0.4040994942188263,
-0.3603041172027588,
1.234959363937378,
-0.6104861497879028,
0.49105989933013916,
... |
def distinct _ words ( corpus ) : corpus _ words = sorted ( list ( set ( [ word for sentence in corpus for word in sentence ] ) ) ) num _ corpus _ words = len ( corpus _ words ) return corpus _ words, num _ corpus _ words | [
0.904338002204895,
0.41708827018737793,
0.3404562771320343,
-0.4046361744403839,
0.6903599500656128,
0.21961665153503418,
0.832067608833313,
1.072457194328308,
0.23169752955436707,
0.5041978359222412,
-0.9542845487594604,
0.04608163982629776,
-0.2417803853750229,
1.4050291776657104,
0.58... |
def fpar2parint ( self, fpar _ serie ) : setattr ( self, " parint _ % s " % ( fpar _ serie, ), getattr ( self, fpar _ serie ) * self. radpar ) return none | [
-0.7535194754600525,
-0.4963056445121765,
0.6285024881362915,
-1.0204403400421143,
-0.4203142523765564,
0.16528581082820892,
-0.16742628812789917,
-0.758010983467102,
0.09887447953224182,
0.21244387328624725,
-0.34169915318489075,
-0.06402350962162018,
-0.891893208026886,
-0.70369571447372... |
def test _ propagate _ anchors _ custom _ parameter _ off ( ufo _ module ) : font = generate _ minimal _ font ( ) font. customparameters [ " propagate anchors " ] = 0 glyphs = ( ( " sad ", [ ], [ ( " bottom ", 50, - 50 ), ( " top ", 50, 150 ) ] ), ( " dotabove ", [ ], [ ( " top ", 0, 150 ), ( " _ top ", 0, 100 ) ] ), (... | [
-0.5006278157234192,
0.2689807415008545,
0.6528467535972595,
-1.3834993839263916,
0.6756824851036072,
0.5805680155754089,
1.1341882944107056,
-0.49508628249168396,
0.7365018129348755,
-0.5634959936141968,
-0.24910034239292145,
1.2277673482894897,
-0.1970975250005722,
-0.024529099464416504,... |
def fit _ gaussian ( samples ) : mu, sigma = norm. fit ( samples ) return ( mu, sigma ) | [
-0.6410843133926392,
-0.8491025567054749,
0.4111105501651764,
0.5270525217056274,
-0.510890007019043,
0.21306702494621277,
0.158035010099411,
0.2464887499809265,
-0.25368934869766235,
0.13859745860099792,
-0.4923970103263855,
0.8669484853744507,
-1.0868279933929443,
-0.0728839784860611,
... |
def _ _ init _ _ ( self, *, estimator, modifier, r _ ess = 1, sample _ col = none ) : self. _ proposal = modifier self. _ log _ likelihood = estimator self. _ r _ ess = r _ ess if isinstance ( sample _ col, str ) : self. sample _ col = [ sample _ col ] elif hasattr ( sample _ col,'_ _ len _ _') : self. sample _ col = s... | [
-0.25152549147605896,
-0.14276136457920074,
0.6684989333152771,
0.329889714717865,
-0.4769825339317322,
-0.5031436681747437,
-0.7489815354347229,
0.6199852824211121,
0.4154760539531708,
0.6990857124328613,
-0.11768326908349991,
0.17628954350948334,
0.3866752088069916,
-0.04087666794657707,... |
def update _ actor ( self, advantages : torch. tensor, buffer : memory ) : advantage _ dataset = advantagedataset ( advantages, buffer, self. normalize _ adv ) dataloader = dataloader ( advantage _ dataset, batch _ size = self. ppo _ batch _ size, shuffle = true ) kl _ div = 0. 0 self. loss [ " actor " ] = 0 self. loss... | [
-0.5808347463607788,
-0.9286108016967773,
0.686246395111084,
0.23228560388088226,
-0.9240224957466125,
0.08997295051813126,
-0.2977394461631775,
0.49390366673469543,
0.20633253455162048,
0.48944926261901855,
-0.43433913588523865,
0.5211480855941772,
0.37112292647361755,
0.5303238034248352,... |
def expected _ utility ( a, s, u, mdp ) : return sum ( p * u [ s1 ] for ( p, s1 ) in mdp. t ( s, a ) ) | [
-0.047790106385946274,
0.29228049516677856,
0.3486567735671997,
-0.9364462494850159,
-0.4080420136451721,
-0.1610744446516037,
0.20417062938213348,
1.8429324626922607,
0.795351505279541,
0.2559205889701843,
0.3815394639968872,
0.5896260738372803,
0.8248733878135681,
-1.4435136318206787,
... |
def apology ( message, code = 400 ) : def escape ( s ) : " " " escape special characters. https : / / github. com / jacebrowning / memegen # special - characters " " " for old, new in [ ( " - ", " - - " ), ( " ", " - " ), ( " _ ", " _ _ " ), ( "? ", " ~ q " ), ( " % ", " ~ p " ), ( " # ", " ~ h " ), ( " / ", " ~ s " ),... | [
0.21987293660640717,
0.5687563419342041,
0.9164798855781555,
-0.8037788271903992,
-0.9086252450942993,
-0.680526077747345,
-0.22252914309501648,
0.8860995769500732,
-0.1629987359046936,
0.9802866578102112,
0.4359172582626343,
0.6566293835639954,
-0.11271088570356369,
0.41221970319747925,
... |
def is _ torch _ cuda _ available ( ) : force _ cuda = os. getenv ( " force _ cuda ", " 0 " ) = = " 1 " return force _ cuda or torch _ cuda _ available ( ) | [
-0.9825475215911865,
0.5872656106948853,
0.27051669359207153,
1.1158322095870972,
0.4674157202243805,
-0.18467704951763153,
-0.2712503969669342,
0.06426463276147842,
-0.7570074796676636,
0.7257814407348633,
0.6575098633766174,
0.7430394887924194,
0.4378778040409088,
0.7983958125114441,
0... |
def test _ update _ recipe ( self ) : pass | [
-0.21762791275978088,
0.09520165622234344,
0.2251531183719635,
1.137181043624878,
-0.2612239122390747,
-0.038609206676483154,
0.5339944958686829,
1.125165581703186,
-0.0969473347067833,
-0.10077886283397675,
-0.5695922374725342,
-0.6243205666542053,
-0.6608597040176392,
-0.5349263548851013... |
def test _ str _ format ( self ) : my _ obj = user ( ) str _ format = " [ user ] ( { } ) { } ". format ( my _ obj. id, my _ obj. _ _ dict _ _ ) self. assertequal ( str _ format, str ( my _ obj ) ) | [
0.19559228420257568,
-1.9192116260528564,
0.2596006393432617,
-0.2962651252746582,
-0.21401254832744598,
0.3744426965713501,
-0.007109699305146933,
-0.36679941415786743,
0.6387366056442261,
-0.5572974681854248,
0.2977128028869629,
0.6185203194618225,
0.004288915079087019,
0.053846050053834... |
def get _ specializations ( self, * ids ) : return self. _ request ( " specializations ", ids = ', '. join ( str ( id ) for id in ids ) ) | [
-1.4233804941177368,
1.0978009700775146,
0.1428408920764923,
0.9017699956893921,
0.7619014382362366,
-0.7971667647361755,
-1.1549599170684814,
-0.6180187463760376,
0.6477566957473755,
0.4852140545845032,
-0.791217565536499,
1.4298977851867676,
-0.19210921227931976,
-0.9594982862472534,
-... |
def get _ json _ config ( self ) : self. update _ config ( ) return json. dumps ( self. config, indent = 2 ) | [
-1.4259446859359741,
-1.3943827152252197,
0.40960970520973206,
-0.23656049370765686,
-0.8366348147392273,
-0.5457180142402649,
-0.3617411255836487,
-0.23188242316246033,
-0.4007743000984192,
0.7760546803474426,
-1.044740080833435,
0.7268732786178589,
-0.0975075364112854,
0.5796764492988586... |
def _ v _ press _ cb ( self, * args ) : autoaxis _ y = self. settings ['autoaxis _ y'] = ='vis'self. settings ['autoaxis _ y'] ='off'if autoaxis _ y else'vis ' | [
0.12774233520030975,
-0.15342523157596588,
0.5045651793479919,
0.7784724235534668,
0.057408541440963745,
-0.17139756679534912,
1.2401378154754639,
-0.17256352305412292,
0.33543169498443604,
0.8460337519645691,
-0.2699146270751953,
0.8142988085746765,
0.22835488617420197,
-0.300087273120880... |
def _ _ repr _ _ ( self ) : return f " { self. q _ value :. 2f } / { self. num _ visits } " # return f " { self. q _ value } / { self. num _ visits } / { self. evaluation _ score } " | [
-0.04108601063489914,
-0.9271240234375,
0.5699764490127563,
-1.1118086576461792,
-0.6160287857055664,
0.7859532833099365,
0.6456371545791626,
-0.27878525853157043,
-0.15571752190589905,
0.2666882872581482,
0.8396363258361816,
0.827440619468689,
0.8642613291740417,
-0.41981929540634155,
-... |
def randomized _ quick _ sort ( lst, start, end ) : if start < end : p = randomized _ partition ( lst, start, end ) randomized _ quick _ sort ( lst, start, p ) randomized _ quick _ sort ( lst, p + 1, end ) return lst | [
-0.25536224246025085,
-0.13138163089752197,
0.3930419683456421,
0.27359738945961,
-0.30951783061027527,
0.16312824189662933,
-0.9181915521621704,
-0.32161739468574524,
0.6566948890686035,
-0.16755998134613037,
-1.0608937740325928,
-0.1758858561515808,
-0.5426558256149292,
-0.01731749065220... |
def _ _ init _ _ ( self, description = none, exclude _ dir _ with _ filename = none, file _ begin _ mtime _ epoch = none, file _ end _ mtime _ epoch = none, min _ file _ size _ bytes = none, max _ run _ time _ secs = none, include _ paths = none, exclude _ paths = none, exclude _ file _ with _ extensions = none, _ conf... | [
0.8391512632369995,
0.07683434337377548,
0.6783447265625,
0.031223813071846962,
-0.5861555933952332,
-0.08285892009735107,
0.4019409120082855,
0.6318992972373962,
0.2275901436805725,
0.17921562492847443,
-0.488386869430542,
0.45188426971435547,
0.3873087465763092,
0.20534144341945648,
0.... |
def insert _ received _ message ( conn : sqlite3. connection, received _ timestamp, sender _ contact, content, sent _ timestamp ) : statement ='insert into receivedmessage ( received _ timestamp, sender _ contact, content, sent _ timestamp )'\'values (?,?,?,? )'with conn : conn. execute ( statement, ( received _ timest... | [
0.10178586095571518,
0.45854249596595764,
0.6363970637321472,
-0.7039808630943298,
0.657886266708374,
-0.4907379150390625,
-0.18736208975315094,
-0.310992568731308,
-0.3140249252319336,
-0.06078902259469032,
-0.6843181252479553,
-0.3181339502334595,
-1.1720070838928223,
-0.3524999916553497... |
def delete ( self ) : condition = self. _ get _ filter ( ) self. driver. remove _ elements ( [ ast ('filter ', condition. get _ ast ( ) ) ] ) | [
-0.2061316817998886,
0.32413893938064575,
0.15352898836135864,
0.10568425804376602,
0.2246202528476715,
-0.2878396809101105,
0.6461001038551331,
1.0464097261428833,
0.254638135433197,
0.6497631072998047,
0.5486870408058167,
0.7035157680511475,
-0.5878888368606567,
0.7971624732017517,
0.0... |
def main ( ) : system = sys. argv [ 1 ] step = sys. argv [ 2 ] properties _ file = sys. argv [ 3 ] prop = settings. yamlreader ( properties _ file, system ). get _ prop _ dic ( ) [ step ] sdf2pdb ( input _ sdf _ path = sys. argv [ 4 ], output _ pdb _ path = sys. argv [ 5 ], properties = prop ). launch ( ) | [
-0.41666287183761597,
-0.5675507187843323,
0.9347631335258484,
1.3193824291229248,
0.3382748067378998,
0.16484656929969788,
0.44358766078948975,
0.5893881320953369,
-1.34437894821167,
-0.6029258966445923,
0.13437023758888245,
0.210850328207016,
0.12813833355903625,
0.0023411698639392853,
... |
def get _ data ( station _ ids = none, sensor _ ids = none, resolutions = none, start = none, end = none ) : if start is none : start _ date = util. convert _ date ( default _ start _ date ) else : start _ date = util. convert _ date ( start ) if end is none : end _ date = util. convert _ date ( default _ end _ date ) ... | [
-0.9429740905761719,
0.06121661141514778,
0.601647675037384,
0.013118746690452099,
-0.5267776250839233,
-0.27442318201065063,
-1.0153461694717407,
-0.4269900619983673,
-0.566167950630188,
-0.1627909541130066,
-0.48520511388778687,
-0.017758315429091454,
0.3712759017944336,
0.14472205936908... |
def metric _ variable ( shape, dtype, validate _ shape = true, name = none ) : return variable _ scope. variable ( lambda : array _ ops. zeros ( shape, dtype ), trainable = false, collections = [ ops. graphkeys. local _ variables, ops. graphkeys. metric _ variables, ], validate _ shape = validate _ shape, name = name, ... | [
0.7788171768188477,
0.3728324770927429,
0.37695416808128357,
-0.39914223551750183,
-0.46671539545059204,
-0.2526473104953766,
0.33860650658607483,
-0.7806137800216675,
-0.8279372453689575,
0.48441293835639954,
-0.24479597806930542,
1.3100135326385498,
0.7887704968452454,
-0.905965209007263... |
def print _ backwards ( num ) : # could turn into a string and reverse and join str _ lst = str ( num ). split ( " " ) new _ str ='' i = 1 while i < len ( str _ lst ) : new _ str + = str _ lst [ - i ] i + = 1 return new _ str | [
-0.5321836471557617,
-0.13125869631767273,
0.7749708890914917,
-0.3308556377887726,
-0.27865925431251526,
0.2762923538684845,
-0.002293101279065013,
0.1680874228477478,
0.1994188129901886,
-0.6438102126121521,
0.6118687987327576,
0.856186032295227,
-1.723321795463562,
-0.7304440140724182,
... |
def qreig ( ah, count, tri = true, zerotol = 1e - 15 ) : a = ah. copy ( ) n = a. shape [ 0 ] if n = = 1 : return a, count if tri : a = tridiag ( a ) while 1 : count = count + 1 mu = a [ - 1, - 1 ] # mu = a [ math. trunc ( n / 2 ), math. trunc ( n / 2 ) ] q, r = sla. qr ( a - mu * eye ( n ) ) a = dot ( r, q ) + mu * eye... | [
0.10775350034236908,
0.11533346027135849,
0.9721046686172485,
-0.9119805097579956,
-0.6060975790023804,
-0.8124094605445862,
1.1031471490859985,
0.5191766023635864,
0.8648341298103333,
0.4039038121700287,
0.06657582521438599,
0.07937903702259064,
-0.09848634153604507,
-0.029338674619793892... |
def generate _ news _ feed ( self, rows ) : header = ('id |'' title |'' text |'' datetime |'' source _ url') output = [ header ] with open ('{ } news _ feed. csv '. format ( self. directory ),'w +') \ as output _ file : for feed _ id in range ( 1, rows + 1 ) : title = self. fake. format ('sentence ', nb _ words = 5, va... | [
-0.39019113779067993,
0.515964686870575,
0.5117523670196533,
0.20947657525539398,
0.2791595757007599,
-0.32559844851493835,
-0.7212396860122681,
-0.44483280181884766,
-0.2732095718383789,
-0.11025243252515793,
-1.0062150955200195,
0.26555976271629333,
-0.12655775249004364,
1.19378888607025... |
def convert ( cmdlist, filename, outputtype = " ant " ) : writer = _ _ writerconstructors [ outputtype ] ( filename ) writer ( cmdlist ) | [
-0.9986432790756226,
-1.4724297523498535,
0.14193958044052124,
0.7831544876098633,
0.39397621154785156,
-0.6642747521400452,
-0.13365867733955383,
-0.1941891312599182,
-0.5443372130393982,
-0.25414472818374634,
-0.2095174491405487,
-0.8127638697624207,
1.1016788482666016,
0.670952558517456... |
def instance _ update ( context, instance _ uuid, values ) : return impl. instance _ update ( context, instance _ uuid, values ) | [
-1.5540945529937744,
-0.4556187391281128,
0.17056883871555328,
-0.683159589767456,
-0.4420907497406006,
0.34076863527297974,
-0.2067888379096985,
1.0229572057724,
-0.30506277084350586,
0.6473743915557861,
-0.543493390083313,
0.07637552917003632,
-0.6597263216972351,
-1.149247646331787,
-... |
def islegalmove ( self, row, col ) : if row = = 8 and col = = 8 : # pass is 8, 8 self. _ currentplayer = self. player _ b if self. _ currentplayer = = \ self. player _ a else self. player _ a return false if self. occupiedby ( row, col ) is not 0 : return false # first - search by moving from the cell towards the verti... | [
-0.14963142573833466,
0.18358787894248962,
1.0233474969863892,
0.23970845341682434,
0.02324608899652958,
0.5521090030670166,
0.4827894866466522,
-0.3795759677886963,
-0.12521974742412567,
1.194289207458496,
0.5497128963470459,
-0.3098660409450531,
-1.1001473665237427,
-0.2266836017370224,
... |
def initial _ conditions ( self, ell _ mode = false ) : radial _ landing _ space = var. dia * np. random. random ( ) angle = 2 * np. pi * np. random. random ( ) x = radial _ landing _ space * np. cos ( angle ) y = radial _ landing _ space * np. sin ( angle ) z = 1. r = np. array ( [ x, y, z ] ) incon = r vx = 0 vy = 0 ... | [
0.820699155330658,
-0.7152655720710754,
1.0378226041793823,
-0.7883685827255249,
-0.258200466632843,
0.9852453470230103,
0.2890016436576843,
0.32391056418418884,
-0.15322427451610565,
0.3107788860797882,
-0.6161606907844543,
-0.350595086812973,
0.14053063094615936,
0.39734646677970886,
-... |
def check _ constrains ( self, a _ min = - 1. 0, a _ max = 100. 0, b _ min = - 1. 0, b _ max = 100. 0, c _ min = - 1. 0, c _ max = 100. 0, alpha _ min = 0. 0, alpha _ max = 360. 0, beta _ min = 0. 0, beta _ max = 360. 0, gamma _ min = 0. 0, gamma _ max = 360. 0 ) : return ( a _ min < self. struct _ dict [ " lattice " ]... | [
-0.47472071647644043,
-0.6318103075027466,
0.8171743154525757,
-0.7680471539497375,
-0.03760593384504318,
0.7404744625091553,
-0.7165608406066895,
-0.1787876933813095,
-0.7527917623519897,
0.15200135111808777,
-0.5071920156478882,
0.332343727350235,
-0.8836073875427246,
0.5062121748924255,... |
def _ _ init _ _ ( self, * args, * * kwargs ) : super ( jsonldspider, self ). _ _ init _ _ ( * args, * * kwargs ) urls = kwargs. get ( " sitemap _ urls " ) self. sitemap _ urls = urls. split ( " " ) self. lastmod _ filter = kwargs. get ( " lastmod ", none ) if len ( self. sitemap _ urls ) < 1 : raise valueerror ( " at ... | [
-1.073750376701355,
0.07928410172462463,
0.6660544276237488,
-0.2404620200395584,
0.12802928686141968,
-0.2653174102306366,
-0.4060138761997223,
0.5901982188224792,
0.3714848756790161,
0.2706955373287201,
-0.3588458001613617,
-0.16186262667179108,
-0.03279263898730278,
1.6824169158935547,
... |
def _ translate _ _ interfaces _ interface _ encapsulation _ dot1q _ vlan _ second _ tag ( input _ yang _ obj, translated _ yang _ obj = none ) : if input _ yang _ obj. tag _ type. _ changed ( ) : input _ yang _ obj. tag _ type = input _ yang _ obj. tag _ type if input _ yang _ obj. vlan _ id. _ changed ( ) : input _ y... | [
0.5571893453598022,
-0.5932484865188599,
0.2597593069076538,
0.03405678644776344,
0.07788112759590149,
-0.32283544540405273,
0.4119725823402405,
-1.3732898235321045,
0.11007867008447647,
0.9615758657455444,
-0.9251792430877686,
0.41778135299682617,
0.3898434042930603,
1.4943313598632812,
... |
def plotadcp ( grid _ m, grid _ o, day, station, profile ) : # get grids into unstaggered and masked velocities at the chose depths u _ e, v _ n, dep _ t = load _ vel ( day, grid _ m, " model ", station, profile ) u, v, dep = load _ vel ( day, grid _ o, " observation ", station, profile ) # begin figure fig, ( [ axmu, ... | [
0.6970048546791077,
0.5461739301681519,
0.955277144908905,
-0.18580855429172516,
-0.2290695160627365,
0.6014880537986755,
-0.052561622112989426,
-0.4291166365146637,
-0.7953878045082092,
0.006912236101925373,
0.4032723903656006,
0.884734034538269,
0.3732505142688751,
0.589146614074707,
0... |
def show _ tab _ menu ( self, event ) : self. show _ nontab _ menu ( event ) | [
0.34462055563926697,
-0.3376988470554352,
0.409924179315567,
1.0196681022644043,
-0.21180123090744019,
0.5343286395072937,
0.3914647102355957,
0.22461645305156708,
-0.37554383277893066,
0.6407821774482727,
0.28198912739753723,
0.671759307384491,
1.2724360227584839,
0.8510802388191223,
0.... |
def set _ input ( self, index, value ) : if isinstance ( self. leads [ index ], connector ) : self. leads [ index ]. untap ( self,'input') if index < = 4 : if isinstance ( value, connector ) : self. leads [ index ] = value else : self. leads [ index ]. state = int ( value ) if isinstance ( self. leads [ index ], connec... | [
-0.8767126202583313,
-0.36290034651756287,
0.6423313617706299,
-0.28003329038619995,
-0.17716579139232635,
0.532474160194397,
0.6752053499221802,
-1.072487711906433,
1.058577299118042,
-0.5846361517906189,
-0.07907092571258545,
0.13638587296009064,
-0.9984689950942993,
-0.28478527069091797... |
def test _ comment _ to _ pure _ activity ( self, * _ ) : status = models. comment. objects. create ( content = " test content ", user = self. local _ user, book = self. book ) activity = status. to _ activity ( pure = true ) self. assertequal ( activity [ " id " ], status. remote _ id ) self. assertequal ( activity [ ... | [
-0.18824973702430725,
-1.4442111253738403,
0.5816385746002197,
-0.43293455243110657,
0.7726926803588867,
0.5533290505409241,
0.9095280766487122,
-0.28422027826309204,
0.39513108134269714,
-0.09821748733520508,
-0.6956843137741089,
0.11668998003005981,
-0.32797592878341675,
-0.6341549754142... |
def main ( server = true, local = false ) : global sensor _ dict, lock, vs, logger, c _ status # create logger logger = hl. create _ logger ( _ _ name _ _ ) # initial status c _ status = " disconnected " # initialize the dictionary containing our sensor values sensor _ dict = { " frame " : none, " us _ front " : none, ... | [
-0.01170287560671568,
0.00815416406840086,
0.9231611490249634,
0.5615125894546509,
-0.02918996661901474,
0.29267069697380066,
0.2915704548358917,
0.1357143372297287,
0.2733575105667114,
-0.5593123435974121,
-0.06636151671409607,
0.0037405856419354677,
-0.25449395179748535,
0.78320866823196... |
def open ( self, mode = none, flags = none ) : # user provided flags should not be used with a user given mode because # certain combinations of modes and flags will raises very unhelpful # " invalid argument " type errors. besides, modes can be generated # from the flags given. if flags is none : if not mode : mode ='... | [
0.16476838290691376,
-0.31945279240608215,
0.5606306791305542,
-0.009766297414898872,
-0.23893588781356812,
0.7535139322280884,
0.7950656414031982,
0.349951833486557,
-0.23105479776859283,
-1.13247549533844,
0.5225960612297058,
-0.7638121247291565,
-0.593555212020874,
-0.0650588646531105,
... |
def getdatabasestatus ( self, outdict, con ) : with con : cur = con. cursor ( mdb. cursors. dictcursor ) for key, value in outdict. iteritems ( ) : cur. execute ('select count ( id ) as count from rss where id = { } ; '. format ( key ) ) count = cur. fetchall ( ) [ 0 ] ['count'] if count = = 1 : logging. warning ('in d... | [
-0.7542885541915894,
0.5225107073783875,
0.5676077008247375,
-0.4030035436153412,
-0.11346328258514404,
-0.207594096660614,
-0.5633424520492554,
0.7148768901824951,
-0.758062481880188,
0.43554145097732544,
-0.38294607400894165,
-0.32006457448005676,
-0.9020121097564697,
0.5636729598045349,... |
def inverse _ transform ( self, y, threshold = none ) : self. _ check _ fitted ( ) if threshold is none : half = ( self. pos _ label - self. neg _ label ) / 2. 0 threshold = self. neg _ label + half if self. multilabel _ : y = np. array ( y > threshold, dtype = int ) # return the predictions in the same format as in fi... | [
-1.1821759939193726,
-0.8362993001937866,
0.8954095840454102,
0.37500831484794617,
-0.5239402651786804,
0.2203907072544098,
-0.5903581380844116,
0.46705323457717896,
-0.14358371496200562,
0.23999090492725372,
-0.0913662388920784,
0.19676043093204498,
-0.16144973039627075,
-0.14922873675823... |
def append _ to _ history ( self ) : # validate first. if not valid, set validation exception. if not self. validate ( ) : return # save at the tail of the history. ( but don't if the last entry the # history is already the same. ) if self. text and ( not len ( self. history ) or self. history [ - 1 ]! = self. text ) :... | [
0.16933956742286682,
0.4067099690437317,
0.6380190253257751,
0.3189602196216583,
0.49713775515556335,
0.7662403583526611,
-0.022097811102867126,
-0.4458044469356537,
0.5982826352119446,
-0.1912807822227478,
0.1605110615491867,
0.8085843920707703,
-0.5313104391098022,
0.9829107522964478,
... |
def get _ config ( args ) : # return a clone so that the defaults will not be altered # this is for the " local variable " use pattern config = _ c. clone ( ) update _ config ( config, args ) return config | [
-0.17031989991664886,
0.32136303186416626,
0.3852977156639099,
0.28246527910232544,
0.26927798986434937,
-0.5804294347763062,
0.3165692985057831,
0.08296040445566177,
-0.5243666768074036,
0.31341326236724854,
-0.3424991965293884,
0.0912570059299469,
-0.6538179516792297,
0.1908944547176361,... |
def test _ delete _ all _ servers _ on _ account ( self ) : all _ servers = ( self. server _ client. list _ servers ( ) ). entity server _ id _ list = [ ] for each _ server in all _ servers : server _ id _ list. append ( each _ server. id ) for each _ server _ id in server _ id _ list : self. server _ client. delete _ ... | [
0.08875831961631775,
-0.3293060064315796,
0.5485665202140808,
0.5884930491447449,
1.4963260889053345,
0.4073575437068939,
0.8809359073638916,
-0.3149249255657196,
1.4394252300262451,
0.22739921510219574,
-0.46004796028137207,
1.0592881441116333,
-0.45637327432632446,
1.1129450798034668,
... |
def async _ stream _ infer ( self, model _ name : str, inputs : list [ inferinput ], model _ version : str =..., outputs : list [ inferrequestedoutput ] =..., request _ id : str =..., sequence _ id : str | int =..., sequence _ start : bool =..., sequence _ end : bool =..., priority : int =..., timeout : int =..., ) - >... | [
-0.7123749256134033,
-0.31751859188079834,
0.8136862516403198,
0.966339111328125,
0.3034313917160034,
-0.3011336028575897,
-0.4227347671985626,
0.022987125441432,
-0.6763015985488892,
0.19171801209449768,
-0.5413556694984436,
0.7453672289848328,
-0.7663083672523499,
0.6031106114387512,
-... |
def build _ model ( params, pretrain ) : if params. model _ type = ='baseline': mapping = mapping _ base ( params, pretrain ). to ( device ) else : mapping = mapping _ bert ( params, pretrain ). to ( device ) optimizer = torch. optim. adam ( filter ( lambda p : p. requires _ grad, mapping. parameters ( ) ), lr = params... | [
0.22711342573165894,
-0.3960256278514862,
0.8377386331558228,
0.33959171175956726,
-0.5156323909759521,
0.27515020966529846,
-0.23356635868549347,
0.3125472366809845,
-0.7631362676620483,
0.3266545832157135,
-0.09457473456859589,
0.35188114643096924,
0.49180614948272705,
-0.054779645055532... |
def get _ modelblock _ info ( self ) : blockmerges _ x = [ [ int ( val ) for val in line. strip ('\ n'). split ( ) ] for line in self. parameters _ inmodel ['lo _ modelblockstrings'] ] print ( blockmerges _ x [ 0 ] ) blockmerges _ z = self. parameters _ inmodel ['lo _ merged _ lines'] meshlocations _ z = np. array ( [ ... | [
-0.6159496903419495,
-0.005838238634169102,
0.9090625047683716,
-0.13701145350933075,
0.19012926518917084,
0.09416037052869797,
1.1719563007354736,
0.13111497461795807,
0.20613212883472443,
-0.15819716453552246,
-0.7061330080032349,
-0.10570133477449417,
-0.0900171622633934,
0.543408334255... |
def number _ of _ nets ( self ) : return len ( self. nets ) | [
0.28529754281044006,
0.5974016785621643,
0.1708042323589325,
-0.052027326077222824,
0.44808530807495117,
1.074518084526062,
0.6456283330917358,
-0.13018381595611572,
0.6404585242271423,
-1.4010400772094727,
-0.9766522645950317,
0.20056603848934174,
0.8072447776794434,
0.42850255966186523,
... |
def _ _ init _ _ ( self, * args : str, redirect : bool = true, * * kwargs : any ) - > none : self. redirect = redirect if " soft _ wrap " not in kwargs : kwargs [ " soft _ wrap " ] = true # unless user already mentioning terminal preference, we use our # heuristic to make an informed decision. if " force _ terminal " n... | [
0.15415766835212708,
0.22943426668643951,
0.7593644857406616,
-0.014103655703365803,
-0.6966806054115295,
-0.10268574208021164,
-0.4844852387905121,
0.42549389600753784,
0.5136104226112366,
-0.7638797760009766,
0.11812574416399002,
0.7552035450935364,
0.3562959134578705,
0.602677583694458,... |
def build _ logger ( name, * * kwargs ) : # set default arguments kwargs. setdefault ('format ','% ( levelname ) s : % ( name ) s : % ( message ) s') kwargs. setdefault ('level ', logging. critical ) kwargs. setdefault ('propagate ', false ) kwargs. setdefault ('stream ', none ) # build logger logger = logging. getlogg... | [
0.249330535531044,
-1.0702378749847412,
0.9054778814315796,
-0.20109371840953827,
-0.7432108521461487,
-0.01155993901193142,
-0.7366116642951965,
0.30937859416007996,
0.14755423367023468,
-0.3447617292404175,
0.09132147580385208,
-0.28777092695236206,
-0.48052090406417847,
0.65337330102920... |
def cal _ hidden _ layer _ of _ units ( hidden _ layers, _ encoding _ dim ) : count = 1 _ unit = _ encoding _ dim h _ l _ units = [ ] while count! = hidden _ layers + 1 : h _ l _ units. append ( int ( _ unit ) ) _ unit / = 2 count + = 1 return h _ l _ units | [
-0.8795279860496521,
0.21889442205429077,
0.48385652899742126,
0.7365815043449402,
-0.016756869852542877,
0.3732856214046478,
0.48778727650642395,
-0.10843008756637573,
-0.21950183808803558,
0.24317075312137604,
-1.1219619512557983,
0.06050274148583412,
-0.17362450063228607,
0.719530463218... |
def direction ( self, origin, destination ) : offset = ( destination [ 0 ] - origin [ 0 ], destination [ 1 ] - origin [ 1 ] ) scale = float ( max ( abs ( offset [ 0 ] ), abs ( offset [ 1 ] ) ) ) if scale = = 0 : return ( 0, 0 ) direction = ( offset [ 0 ] / scale, offset [ 1 ] / scale ) # handle special cases if directi... | [
-1.6769694089889526,
-0.9907565116882324,
0.8663254976272583,
-0.4446345865726471,
-0.7640535235404968,
0.43714454770088196,
-0.1591431051492691,
-0.11735430359840393,
0.36489611864089966,
0.6745882034301758,
0.15246810019016266,
0.212601900100708,
0.27759596705436707,
-0.2520311772823334,... |
def test _ negative ( self ) : self. spawn ( ". / digits " ). stdin ( " - 1 " ). stdin ( " - 2 " ). stdin ( " - 3 " ). stdout ( " digits : 3 \ n ", " digits : 3 \ n " ). exit ( 0 ) | [
-0.8111297488212585,
0.9296501278877258,
0.7167738676071167,
0.7548099756240845,
0.6857900619506836,
1.3757230043411255,
-0.6098014116287231,
-0.46977147459983826,
-0.6931896209716797,
-0.07697580754756927,
-0.1044357642531395,
0.689606785774231,
-0.23457664251327515,
0.768191397190094,
... |
def test _ exit _ program ( self ) : pass | [
0.23814557492733002,
0.028691096231341362,
0.3153856098651886,
0.6950719356536865,
0.8942428827285767,
1.5050638914108276,
1.4009045362472534,
0.03044077567756176,
-0.11168590188026428,
-0.25460103154182434,
-0.9067491888999939,
-0.11174973845481873,
-0.6649848818778992,
-0.531281173229217... |
def get _ products _ by _ category ( self, category ) : products = self. db. query ( category. select _ sql _ query _ products ) return products | [
-0.5908925533294678,
0.6100313663482666,
0.183059960603714,
0.5873756408691406,
0.9135702848434448,
-0.35806357860565186,
0.18407268822193146,
-1.3055013418197632,
0.08447498828172684,
0.9483414888381958,
0.003607445862144232,
-0.3706342577934265,
0.29294586181640625,
0.3254011273384094,
... |
def enable _ top _ buttons ( self, state ) : for b in [ self. generate _ button, self. download _ button, self. layer _ selection, ] : if state : b. enable ( ) else : b. disable ( ) | [
-0.8225196599960327,
-0.2982400357723236,
0.5679670572280884,
0.5529607534408569,
0.1526404321193695,
0.6203455328941345,
0.1460568755865097,
0.0759686678647995,
0.9659554958343506,
-0.17622271180152893,
-1.1702048778533936,
-0.084205262362957,
0.23789922893047333,
0.6770012974739075,
0.... |
def add _ address ( self, name, ipstr ) : self. get _ object ( name ) # assert that the object exists if isinstance ( ipstr, list ) : ipstrs = ipstr if not len ( ipstrs ) : raise exception ('empty list of addresses to add') else : ipstrs = [ ipstr ] to _ add = [ ] for ipstr in ipstrs : begin, end = _ addr _ to _ n ( ip... | [
-1.3605824708938599,
-0.028453856706619263,
0.7756844162940979,
0.34131866693496704,
-0.3132043480873108,
0.06172361969947815,
-0.03319506347179413,
-0.22660915553569794,
0.8934992551803589,
0.3006146252155304,
-0.41544604301452637,
0.026827534660696983,
-0.3854256868362427,
-0.19627095758... |
def includeme ( config ) : config. add _ view ( list _ view, route _ name ='home') config. add _ view ( detail _ view, route _ name ='detail') config. add _ view ( create _ view, route _ name ='new') config. add _ view ( update _ view, route _ name ='edit') config. add _ view ( delete _ view, route _ name ='delete') co... | [
0.6884825229644775,
0.7042927145957947,
0.676552951335907,
0.4509355127811432,
-0.16953045129776,
0.8455599546432495,
0.09488319605588913,
1.0520883798599243,
1.2505779266357422,
-0.38791826367378235,
-1.0270353555679321,
-0.14048440754413605,
0.1467275321483612,
0.9618647694587708,
-0.1... |
def get _ size _ toolbaricons ( self ) : return self. toolbar. gettoolbitmapsize ( ) | [
-0.6131735444068909,
0.02157263644039631,
0.4881916344165802,
-0.3974687159061432,
-0.1467103213071823,
-0.1251334249973297,
0.8174146413803101,
-1.763226866722107,
-0.2977256774902344,
0.1616019904613495,
-1.2244306802749634,
-1.119189977645874,
0.045957453548908234,
0.3553464412689209,
... |
def test _ func ( self ) : self. rol _ nu = rol _ get _ huidige ( self. request ) return self. rol _ nu! = rollen. rol _ none | [
-0.2481321096420288,
-0.10943584144115448,
0.36326897144317627,
0.5756971836090088,
0.8648656010627747,
-0.3452756702899933,
0.6418307423591614,
-0.3793444335460663,
0.2673152983188629,
-0.7358725666999817,
-0.27574238181114197,
0.4507136344909668,
-0.5415697693824768,
-0.4895919859409332,... |
def take _ cards ( self ) : output = [ ] output. extend ( self. _ cards ) for card in output : card. reset ( ) self. _ cards = [ ] return output | [
-0.5926607251167297,
-0.17750385403633118,
0.4229890704154968,
0.2607143223285675,
0.4279630184173584,
-0.5664757490158081,
-0.35067808628082275,
0.036231186240911484,
0.04533218592405319,
0.33265796303749084,
-1.268333077430725,
0.27568453550338745,
-0.38886159658432007,
-0.19519762694835... |
def _ get _ weight ( self ) : return self. _ _ weight | [
-0.3245145082473755,
-0.646698534488678,
0.4617632031440735,
-0.03020082227885723,
0.09210842102766037,
0.06342269480228424,
0.5976099371910095,
-0.5009205341339111,
-0.6783298254013062,
-0.3647061586380005,
0.22868536412715912,
-0.023264924064278603,
-0.06512925028800964,
-0.2957288026809... |
def test _ get _ parameter _ 0 ( self ) : pass | [
-0.1915690004825592,
-0.5031415224075317,
0.19570156931877136,
1.040581464767456,
1.259513020515442,
0.5068299770355225,
1.0842792987823486,
0.1745157092809677,
-0.1335504651069641,
-0.524482786655426,
0.06712309271097183,
1.4336060285568237,
-0.5699738264083862,
0.5854189395904541,
-0.2... |
def create _ kernel ( self, ) - > pyabc. stochastickernel : | [
0.2857113480567932,
0.2460862696170807,
0.13191142678260803,
1.4882389307022095,
0.09329155832529068,
-0.00966501235961914,
0.1915862113237381,
-0.11164762824773788,
-0.35935741662979126,
-0.6375353336334229,
-0.008136001415550709,
0.24785944819450378,
0.17943307757377625,
0.75867569446563... |
def histogram ( a, bins = range ( 0, 256 ) ) : fa = a. flat n = gdalnumeric. searchsorted ( gdalnumeric. sort ( fa ), bins ) n = gdalnumeric. concatenate ( [ n, [ len ( fa ) ] ] ) hist = n [ 1 : ] - n [ : - 1 ] return hist | [
0.5024045705795288,
0.7715262770652771,
0.3391542136669159,
-0.30242472887039185,
-0.06521879136562347,
0.271392285823822,
0.9455108642578125,
0.0763055831193924,
0.9617028832435608,
0.24234844744205475,
0.5334206223487854,
0.12577810883522034,
0.3791320323944092,
-0.5474081635475159,
0.... |
def best _ reply ( self, move, position ) : test = cp ( position ) test. update ( move ) reply = self. best _ move ( test, move. color. opponent ( ) ) return reply, test. advantage _ as _ result ( reply [ 0 ], self. piece _ scheme ) | [
-0.25407952070236206,
-0.5882390737533569,
0.6436343193054199,
-0.7682982683181763,
0.04864978790283203,
-0.9656962156295776,
-0.5951414108276367,
-0.49794483184814453,
0.43206262588500977,
0.9110914468765259,
-0.6958564519882202,
0.6959304809570312,
-0.3283165991306305,
-0.302656412124633... |
def occupiedby ( self, row, col ) : return self. _ grid [ row, col ] # 0 is filled to denote empty, 1 to denote # player a, and 2 to denote player b | [
-0.6028871536254883,
0.8244673609733582,
0.5813761353492737,
-0.19515888392925262,
0.6909897923469543,
-0.7494797706604004,
0.7989007234573364,
-0.6792359352111816,
-0.5888082981109619,
0.7654814720153809,
0.21693770587444305,
0.18187114596366882,
-0.4354264438152313,
-0.7995158433914185,
... |
def addcharacter ( self, book _ id, character _ id, name, gender, descent _ country, descent _ city, living _ country, living _ city, age, education, profession ) : self. allcharacters [ character _ id ] = character ( book _ id, character _ id, name, gender, descent _ country, descent _ city, living _ country, living _... | [
-0.45571470260620117,
-1.2283995151519775,
0.5452426671981812,
0.03211389482021332,
0.1937071681022644,
0.9748454093933105,
-1.1275084018707275,
0.6864182353019714,
0.050435855984687805,
-0.44379279017448425,
-0.15671584010124207,
0.8076273202896118,
-0.7795608639717102,
0.5028752684593201... |
def add _ y ( self, file _ path, col _ name, sep ='\ t ', index _ col = 0, normalize = false, remove = none, ensure _ balanced = false, nan _ strategy ='remove ', * * kwargs ) : # assumes index corresponds to self. common _ subjects df = self. _ read _ behav _ file ( file _ path = file _ path, sep = sep, index _ col = ... | [
0.18674863874912262,
-0.40763890743255615,
0.9875547289848328,
0.07012320309877396,
0.44978779554367065,
0.19148918986320496,
0.5670405030250549,
-0.19440777599811554,
-0.36514735221862793,
-0.05938485637307167,
0.2985483407974243,
1.0843510627746582,
-0.3776041269302368,
-0.49263763427734... |
def join _ next _ line ( self, separator ='' ) : if not self. document. on _ last _ line : self. cursor _ position + = self. document. get _ end _ of _ line _ position ( ) self. delete ( ) # remove spaces. self. text = ( self. document. text _ before _ cursor + separator + self. document. text _ after _ cursor. lstrip ... | [
0.49903473258018494,
0.3137536346912384,
0.5664425492286682,
0.24235476553440094,
-0.6596207022666931,
0.11917727440595627,
-0.5716590881347656,
0.23844298720359802,
0.37863969802856445,
0.11939883232116699,
0.03321393206715584,
-1.1202309131622314,
-0.3842817544937134,
0.11615292727947235... |
def pivot ( self, pivot _ column : str, values _ column : str ) - > " pivotops " : if self. downsample : raise valueerror ( " pivot not supported in downsample operation " ) return pivotops ( self. _ df, self. by, pivot _ column, values _ column ) | [
0.0850718542933464,
0.40829628705978394,
0.3983737826347351,
0.3087334632873535,
0.32622477412223816,
-0.49117666482925415,
0.2527356445789337,
-0.5847604870796204,
-0.1166183203458786,
-0.04439111799001694,
0.7325335144996643,
-0.11182688176631927,
-0.7102881669998169,
-1.1484708786010742... |
def _ _ len _ _ ( self ) : return len ( self. data ) | [
0.07594836503267288,
-0.5984961986541748,
0.1701604574918747,
-2.0113446712493896,
0.38412147760391235,
0.5237301588058472,
-0.24025404453277588,
0.7935556769371033,
0.6797017455101013,
-1.1838339567184448,
-1.2481101751327515,
0.15416371822357178,
0.5844287872314453,
-0.4799167513847351,
... |
def filter _ queryset ( self, queryset ) : cleaned _ data = self. form. cleaned _ data return queryset. filter ( * * cleaned _ data ) | [
-0.5653426647186279,
-0.21039247512817383,
0.273428350687027,
-0.6639364957809448,
-0.5302330255508423,
1.0407130718231201,
-0.7596302628517151,
-0.004040437284857035,
-0.12065698206424713,
-0.8027976155281067,
0.13412699103355408,
0.4475967586040497,
0.1747017502784729,
0.1105781421065330... |
def sigmoid ( x ) : answer = np. where ( x > = 0, 1. / ( 1. + np. exp ( - x ) ), np. exp ( x ) / ( 1. + np. exp ( x ) ) ) return answer | [
-0.4107446074485779,
-0.20602074265480042,
0.5475435256958008,
0.1448250114917755,
-0.20576870441436768,
0.5528584718704224,
-0.29629281163215637,
0.09629249572753906,
1.423856496810913,
0.5396068096160889,
-0.07455745339393616,
0.13371703028678894,
-0.3429080545902252,
-0.2445922195911407... |
def create _ bucket _ fun ( sd, ed ) : return lambda x : sd < = x [ 0 ] < ed | [
-0.22977401316165924,
-0.10051513463258743,
0.376444935798645,
0.4097738564014435,
-0.6040600538253784,
0.6802434325218201,
-0.172165185213089,
-0.9293956160545349,
-0.5911238193511963,
-0.5130885243415833,
-0.21867704391479492,
1.042558193206787,
1.343381643295288,
-0.9674121141433716,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.