text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def rotate _ around _ point ( self, radians, origin = ( 0, 0 ), rounding = 7 ) : offset _ x, offset _ y = origin adjusted _ x = ( self. x - offset _ x ) adjusted _ y = ( self. y - offset _ y ) cos _ rad = math. cos ( radians ) sin _ rad = math. sin ( radians ) qx = offset _ x + ( cos _ rad * adjusted _ x ) + ( sin _ ra... | [
-0.49253711104393005,
-0.25819721817970276,
0.477780818939209,
-1.6556750535964966,
0.18617330491542816,
0.5682884454727173,
-0.5660619735717773,
-0.13292565941810608,
0.6062577962875366,
-0.18824981153011322,
0.19923163950443268,
0.5404511094093323,
0.1434183418750763,
-0.5968173146247864... |
def tile _ pixel _ to _ location ( tile, dx, dy ) : assert 0 < = dx < = 1 and 0 < = dy < = 1, " x and y offsets must be in [ 0, 1 ] " w, s, e, n = mercantile. bounds ( tile ) def lerp ( a, b, c ) : return a + c * ( b - a ) return lerp ( w, e, dx ), lerp ( s, n, dy ) # lon, lat | [
-0.5622469782829285,
0.028961103409528732,
0.4420640468597412,
-1.3196423053741455,
-0.7335397601127625,
0.22526317834854126,
-0.34934917092323303,
-0.5893860459327698,
0.27073904871940613,
0.6748967170715332,
0.22114692628383636,
0.1871955543756485,
0.7185657024383545,
-0.3369862139225006... |
def extract _ files ( self, folders = ['vuzix /'] ) : data _ file = [ ] for folder in folders : class _ folders = glob. glob ( folder +'*') for vid _ class in sorted ( class _ folders ) : class _ files = glob. glob ( vid _ class +'/ *. mp4') for video _ path in class _ files : # get the parts of the file. video _ parts... | [
-0.8467926979064941,
0.530390739440918,
0.8509432673454285,
0.7424612045288086,
0.4375974237918854,
-0.898087739944458,
0.5192202925682068,
0.3528135418891907,
0.25789034366607666,
-0.0890229195356369,
-0.18798129260540009,
-0.2616287171840668,
0.21326866745948792,
1.1729865074157715,
-0... |
def main ( ) : directed = false try : opts, args = getopt. getopt ( sys. argv [ 1 : ], " " ) except : usage ( sys. argv [ 0 ] ) for opt, arg in opts : usage ( sys. argv [ 0 ] ) if len ( args )! = 1 : usage ( sys. argv [ 0 ] ) runnumber = int ( args [ 0 ] ) estimatealaamee. run _ on _ network _ attr ( '.. / data / simul... | [
0.0724412202835083,
-0.8478731513023376,
0.9658685922622681,
0.5038052201271057,
-0.5361815690994263,
0.34085163474082947,
0.7284741997718811,
0.3958466351032257,
-0.6523700952529907,
0.8763256669044495,
0.1673312932252884,
0.5179659128189087,
-0.1573188304901123,
0.56107097864151,
0.613... |
def _ _ init _ _ ( self, fig, max _ time, min _ time = 0, time _ step = 1, axcolor ='lightgoldenrodyellow ', hovercolor ='0. 975') : self. min _ time = min _ time self. max _ time = max _ time self. time _ step = time _ step self. axcolor = axcolor self. hovercolor = hovercolor self. next _ cid = 0 mpl _ ver = distutil... | [
0.637600302696228,
0.33943992853164673,
0.8953951597213745,
0.1856975257396698,
-0.5180457234382629,
0.33164966106414795,
0.4780471622943878,
0.0350307933986187,
-0.43225428462028503,
0.18360799551010132,
-1.0712333917617798,
0.37913551926612854,
0.3317205011844635,
0.5378925204277039,
0... |
def _ does _ quack ( explanation ) : has _ eval _ y _ pred = hasattr ( explanation, explainparams. eval _ y _ pred ) has _ eval _ y _ pred _ proba = hasattr ( explanation, explainparams. eval _ y _ pred _ proba ) has _ ys = has _ eval _ y _ pred and has _ eval _ y _ pred _ proba has _ init _ data = hasattr ( explanatio... | [
-0.13601741194725037,
-0.17145128548145294,
0.6787760853767395,
-0.3574449419975281,
-0.27956920862197876,
0.1441352218389511,
0.8668513298034668,
0.7518149018287659,
0.24907293915748596,
-0.3907999098300934,
0.09603625535964966,
0.18028117716312408,
1.015454649925232,
1.1795806884765625,
... |
def _ solve _ slice _ problem ( self, iteration _ index, region, selected _ point _ solution ) : # create a slice problem result from the selected solution. if slice problem is infeasible # ( which is supposed to be always feasible, but may be infeasible due to tolerances used ), use this result start = time ( ) projec... | [
-0.15021373331546783,
-0.17840486764907837,
0.4893311560153961,
0.20595769584178925,
0.00009465809853281826,
-0.40427106618881226,
0.31037598848342896,
0.00343474093824625,
0.16592010855674744,
0.7886322736740112,
0.3979003429412842,
0.3705614507198334,
0.06468614935874939,
-0.275637507438... |
def character ( self ) : result ='' while self. current _ char is not none and self. current _ char. isalpha ( ) : result + = self. current _ char self. advance ( ) return result | [
0.01738312840461731,
-0.6518680453300476,
0.42560720443725586,
-0.34486404061317444,
-0.11242182552814484,
0.4133584797382355,
0.8183854818344116,
-0.0194404274225235,
0.14438872039318085,
-0.6337730884552002,
0.694245457649231,
0.20378801226615906,
-1.1780632734298706,
-0.3614967763423919... |
def addkit ( self, session, kit ) : try : self. getkit ( session, kit. getname ( ), kit. getversion ( ), kit. getiteration ( ) ) raise kitalreadyexists ('kit [ % s ] already exists'% ( kit ) ) except kitnotfound : # ok. pass self. getlogger ( ). debug ('installing kit [ % s ]'% ( kit ) ) dbkit = kits ( name = kit. getn... | [
-0.5526570677757263,
0.2765532433986664,
0.4915350079536438,
-0.2138366997241974,
0.47982367873191833,
0.016400856897234917,
-0.5078337788581848,
-0.3217144012451172,
0.6971852779388428,
-0.38508933782577515,
0.19437526166439056,
-0.6054929494857788,
-0.41801247000694275,
0.687749326229095... |
def upload _ sounds ( observation _ id : int, sounds : multifile, * * params ) - > listresponse : responses = [ ] params ['observation _ sound [ observation _ id ]'] = observation _ id for sound in ensure _ list ( sounds ) : response = post ( url = f'{ api _ v0 } / observation _ sounds ', files = sound, raise _ for _ s... | [
-1.1020078659057617,
-0.022446323186159134,
0.6819457411766052,
-0.3613227903842926,
1.0406678915023804,
-0.031163817271590233,
-0.5065250396728516,
-1.6434937715530396,
0.16907259821891785,
0.9996309876441956,
-0.7872071266174316,
0.0931222066283226,
-0.966249942779541,
1.1249827146530151... |
def metadata ( self, metadata ) : self. _ metadata = metadata | [
-0.1908247470855713,
0.14274905622005463,
0.13973084092140198,
0.5012419819831848,
0.8484720587730408,
0.8602955937385559,
-0.5327686667442322,
0.5879949927330017,
-0.8405383229255676,
0.3341096341609955,
-0.7743438482284546,
-0.17766186594963074,
0.1547316014766693,
0.20878876745700836,
... |
def keypressevent ( self, event ) : if event. key ( ) = = qtcore. qt. key _ f : self. fitinview ( self. scene ( ). scenerect ( ), qtcore. qt. keepaspectratio ) if event. key ( ) = = qtcore. qt. key _ x : cursor = qtgui. qcursor ( ) self. centeron ( qtcore. qpointf ( self. maptoscene ( self. mapfromglobal ( cursor. pos ... | [
0.23526446521282196,
-0.8856227397918701,
0.9721183180809021,
0.37423884868621826,
-0.43351587653160095,
0.5870550274848938,
1.0396184921264648,
-0.5304261445999146,
0.5931093692779541,
0.1002851128578186,
-0.5394641160964966,
-0.40577492117881775,
0.2758566737174988,
0.4235055148601532,
... |
def _ insert _ row _ with _ id ( self, instance _ name : str, stream _ id : int ) - > none : def _ insert ( txn : loggingtransaction ) - > none : txn. execute ( " insert into foobar values (?,? ) ", ( stream _ id, instance _ name, ), ) txn. execute ( " select setval ('foobar _ seq ',? ) ", ( stream _ id, ) ) txn. execu... | [
0.054062701761722565,
0.38677510619163513,
0.7367547750473022,
-0.36338257789611816,
0.13549648225307465,
-0.44343292713165283,
-0.19633427262306213,
-0.41511213779449463,
-0.3377470076084137,
0.5657345652580261,
-0.9233629703521729,
-0.29050612449645996,
-0.606335461139679,
0.791179478168... |
def test _ func _ called ( self ) : @ deprecated ( ) def f ( a, b ) : return a, b with warnings. catch _ warnings ( ) : warnings. simplefilter ( " ignore " ) self. assertequal ( f ( 1, b = 2 ), ( 1, 2 ) ) | [
-0.27332648634910583,
0.5976974368095398,
0.4848451614379883,
0.36157259345054626,
0.09191273897886276,
0.2904821038246155,
-0.6673787236213684,
-0.999883234500885,
-0.556861937046051,
-0.5137710571289062,
-0.6184396743774414,
0.13378168642520905,
0.3516812026500702,
-0.49752795696258545,
... |
def test _ directory _ clean _ require _ with _ name ( modules, tmp _ path, state _ tree ) : name = tmp _ path / " a - directory " name. mkdir ( ) good _ file = name / " good - file " wrong _ file = name / " wrong - file " wrong _ file. write _ text ( " foo " ) sls _ contents = f " " " some _ dir : file. directory : - ... | [
-0.22298839688301086,
-0.35487329959869385,
0.5648424625396729,
-0.49708130955696106,
-0.30864548683166504,
0.13257023692131042,
-0.24981434643268585,
-0.40677109360694885,
0.5441936254501343,
0.6357082724571228,
-0.6016490459442139,
0.06385783851146698,
0.4597149193286896,
0.8061467409133... |
def redditjson ( suburl ) : url = " http : / / www. reddit. com " + suburl + " /. json? limit = 100 " page = getdatafromurl ( url ) if page = = none : return none try : pagedict = json _ to _ dict ( page ) except valueerror : return none return [ s for s in linkgen ( pagedict ) ] | [
-0.8389787077903748,
-0.03476588428020477,
0.8138374090194702,
-0.3790011703968048,
-0.3769518733024597,
-0.308944970369339,
-1.2576415538787842,
-0.09769977629184723,
0.33413293957710266,
0.4349401295185089,
-1.057530403137207,
0.639357328414917,
0.16922736167907715,
0.4667958617210388,
... |
def get _ ssh _ client ( self, ssh _ client, ssh _ server _ config, client _ type ='plink') : if client _ type = ='plink': if ssh _ client is not none : return ssh _ client if client _ type = ='paramiko': if ssh _ client is not none and ssh _ client. _ transport. is _ active ( ) : return ssh _ client return get _ ssh _... | [
0.3523288369178772,
-0.5376523733139038,
0.5238233804702759,
0.45447930693626404,
0.05224616453051567,
0.4276038110256195,
0.10898254811763763,
0.13494648039340973,
-0.3562091886997223,
-0.06491153687238693,
-0.17848239839076996,
1.1643617153167725,
-0.5139797925949097,
-0.1981472820043563... |
def detect _ intent _ audio ( project _ id, session _ id, audio _ file _ path, language _ code ) : import dialogflow _ v2 as dialogflow session _ client = dialogflow. sessionsclient ( ) # note : hard coding audio _ encoding and sample _ rate _ hertz for simplicity. audio _ encoding = dialogflow. enums. audioencoding. a... | [
0.30198168754577637,
-1.4436142444610596,
0.5657784938812256,
0.29975584149360657,
0.25415775179862976,
0.16586075723171234,
0.23802626132965088,
-0.35724082589149475,
0.5155553817749023,
0.24330803751945496,
-0.14831234514713287,
0.34962189197540283,
-0.563786506652832,
-0.312611311674118... |
def value _ to _ bytes ( value : any, align _ to _ 2n : bool = true ) - > bytes : def bytes _ cnt ( value : int, align _ to _ 2n : bool = true ) - > int : val = 1 if value = = 0 else int ( log ( value, 256 ) ) + 1 if align _ to _ 2n and val > 2 : val = int ( ceil ( val / 4 ) ) * 4 return val if isinstance ( value, byte... | [
-0.48063427209854126,
0.19117020070552826,
0.8344104290008545,
0.3964294493198395,
0.1100810319185257,
-0.3237207233905792,
0.3101803958415985,
-0.6010363101959229,
0.4336708188056946,
-0.8664309978485107,
-0.3455456495285034,
0.2541096806526184,
0.33141615986824036,
1.0586557388305664,
... |
def smart _ coin ( self ) : return contractwrapper ( default _ constants. genesis _ challenge, self. source ) | [
-0.6483935117721558,
0.5364992022514343,
0.2534397840499878,
-0.2535739541053772,
-0.2517453134059906,
-0.09154204279184341,
-0.8636466264724731,
0.29666975140571594,
-0.11802913248538971,
-0.23558607697486877,
-0.29018592834472656,
0.5191361308097839,
0.3868664503097534,
-0.67497187852859... |
def makemove ( self, row, col, mark = moves. na ) : if self. gameover : raise exception ( " game is finished. can't make any new moves! " ) if self. board [ row ] [ col ]! = moves. na : raise inputerror ( ( row, col ), " this spot is already taken! " ) self. board [ row ] [ col ] = mark self. checkgameover ( ) | [
-0.09155169874429703,
0.4534647464752197,
0.39623114466667175,
0.7627280354499817,
0.12429234385490417,
0.730512797832489,
0.3256276547908783,
0.11904990673065186,
-0.2918691337108612,
0.4214552938938141,
0.03286687284708023,
0.10302837938070297,
0.1544494330883026,
-0.6949838995933533,
... |
def nutrition _ data ( self ) : data = dict ( ) data ['cost'] = self. cost # basic doesn't include cost ; we don't want grams here either for k in settings. nutrition _ data _ items _ basic : data [ k ] = getattr ( self, k ) return add _ nutrition _ ratios ( data ) # todo most of these ratios not useful to target... | [
-0.9868227243423462,
0.11202240735292435,
0.5182851552963257,
0.35560116171836853,
-0.03985843434929848,
-0.05026264861226082,
-1.3848943710327148,
-0.7010236978530884,
-0.9292448163032532,
0.614932656288147,
-0.09531079232692719,
-0.6977760195732117,
0.9686359167098999,
0.3669950366020202... |
def _ _ sub _ _ ( self, other ) : if isinstance ( other, array ) : result = self. _ new _ like _ me ( _ get _ common _ dtype ( self, other, self. queue ) ) self. _ axpbyz ( result, self. dtype. type ( 1 ), self, other. dtype. type ( - 1 ), other ) return result else : # subtract a scalar if other = = 0 : return self. c... | [
0.15834476053714752,
0.19034713506698608,
1.0457743406295776,
0.8050481677055359,
-1.0828018188476562,
0.15632346272468567,
0.5633857250213623,
-0.8569520711898804,
0.5054052472114563,
-0.07646434754133224,
-0.2714420258998871,
0.8885166049003601,
-0.7824809551239014,
0.05930011719465256,
... |
def story _ info ( self, story _ pk : int, use _ cache : bool = true ) - > story : if not use _ cache or story _ pk not in self. _ stories _ cache : story = self. story _ info _ v1 ( story _ pk ) self. _ stories _ cache [ story _ pk ] = story return deepcopy ( self. _ stories _ cache [ story _ pk ] ) | [
-0.41508471965789795,
0.4855802059173584,
0.17149101197719574,
0.6246137619018555,
0.11670447140932083,
-0.022072168067097664,
0.07231244444847107,
-0.7850465774536133,
0.17465513944625854,
-0.30986618995666504,
-0.25109854340553284,
-0.6826533079147339,
0.45247480273246765,
-0.33329927921... |
def _ hash ( self, planes, input _ point ) : try : input _ point = np. array ( input _ point ) # for faster dot product projections = np. dot ( planes, input _ point ) except typeerror as e : print ( " " " the input point needs to be an array - like object with numbers only elements " " " ) raise except valueerror as e... | [
0.5616883635520935,
-0.302375465631485,
0.49126410484313965,
0.30902308225631714,
0.0012146008666604757,
1.0724976062774658,
-0.601316511631012,
-0.21773140132427216,
-0.35481905937194824,
0.6266914010047913,
0.8803013563156128,
-0.6103389859199524,
-0.6945322155952454,
-0.2534531950950622... |
async def apply _ theme ( collector, target, reference, artifact, * * kwargs ) : def errors ( e ) : log. error ( e ) msg = applytheme. msg ( collector. photons _ app. extra _ as _ json ) await target. send ( msg, reference, error _ catcher = errors, message _ timeout = 2 ) | [
-0.17781059443950653,
0.1796373426914215,
0.5566044449806213,
-0.6595926880836487,
-0.23373299837112427,
-0.41502809524536133,
-0.3483554422855377,
-0.268581360578537,
0.8557759523391724,
0.25335031747817993,
0.09904004633426666,
1.2258340120315552,
0.01450122520327568,
0.5073868632316589,... |
def parseoptions ( ) : parser = optparse. optionparser ( usage ='usage : % prog [ options ] dir') parser. add _ option ('- s ','- - source _ dir ', dest ='source _ dir ', default = '. ', metavar ='dir ', help ='ffmpeg source directory.') parser. add _ option ('- b ','- - build _ dir ', dest ='build _ dir ', default = '... | [
-0.5210651159286499,
-0.7003350853919983,
0.6359995007514954,
-0.18559110164642334,
0.40717822313308716,
-0.577149510383606,
0.038797762244939804,
0.42676079273223877,
0.23698125779628754,
0.4604600667953491,
-0.3519923686981201,
0.8157641887664795,
0.28079238533973694,
1.386102318763733,
... |
def _ _ init _ _ ( self, act _ fun, * layer _ dimensions ) : if len ( layer _ dimensions ) < 2 : raise exception ( " at least an input _ and output layer must be given " ) self. _ act _ fun = act _ fun self. _ layer _ dimensions = layer _ dimensions # the net _ input value for each non input _ neuron, # each list eleme... | [
0.05454706400632858,
0.08697827160358429,
0.8924906253814697,
0.6725051999092102,
0.23793812096118927,
-0.04399282485246658,
1.2807667255401611,
0.6702609658241272,
-0.5409589409828186,
-0.2159069925546646,
-0.08343632519245148,
0.4748949706554413,
-0.22480624914169312,
0.6128405928611755,... |
async def download _ file ( self, file : filemeta ) - > bytes : url = " { } { } : { } / api / v { } / files / download / { } ". format ( self. _ http, self. server _ ip, self. _ server _ port, self. _ server _ api _ version, file. agent _ file _ id, ) resp = await self. get _ file ( url ) return resp | [
-0.1885831505060196,
0.06696265935897827,
0.5415977239608765,
0.19923076033592224,
0.6909379363059998,
-0.7769022583961487,
-0.25491583347320557,
-0.03446289151906967,
-0.6392704844474792,
-0.07071322947740555,
0.018246063962578773,
0.2666240632534027,
-0.349518358707428,
0.23147052526474,... |
def configure ( self, opts, ports ) : conf = super ( self. _ _ class _ _, self ). configure ( opts, ports ) return conf | [
0.06477711349725723,
0.28096386790275574,
0.331318199634552,
0.0651228129863739,
0.24903778731822968,
-0.9526666402816772,
-0.11554229259490967,
0.4376748502254486,
0.2434617131948471,
-0.47591888904571533,
-0.30262503027915955,
-0.228984072804451,
-0.20507511496543884,
0.3712485730648041,... |
def _ confirm _ execute ( self ) : prompt = self. _ wrap _ paragraphs ( _ ('you have requested a database upgrade. this will alter'' tables and data currently in the " % s " database, and may'' result in irreversable data loss. upgrades should be'' * thoroughly * reviewed and tested prior to execution. \ n'' \ n'' make... | [
-0.08202140033245087,
0.6170898079872131,
0.8183859586715698,
0.5707207918167114,
-0.2148427963256836,
0.16669775545597076,
-0.6960916519165039,
-0.2354690581560135,
-0.20915813744068146,
0.5337254405021667,
-0.44607895612716675,
0.7603513598442078,
-0.44891276955604553,
-0.075731590390205... |
def _ _ iter _ _ ( self ) : yield self. match raise stopiteration | [
-0.7518064379692078,
-0.8610963225364685,
0.5456686615943909,
-0.3251379132270813,
-0.21866050362586975,
0.9040814638137817,
0.9083441495895386,
-0.31530138850212097,
-0.8204395174980164,
-0.5099714398384094,
0.7284003496170044,
-0.6218869090080261,
-0.3879503905773163,
-0.7729132771492004... |
def random _ h1 _ color _ decorator ( func ) : def wrapper ( * args, * * kwargs ) : return f'< style > h1 { { color : rgb ( { random. randint ( 0, 255 ) }, { random. randint ( 0, 255 ) }, { random. randint ( 0, 255 ) } ) } } < / style >'\ f'{ func ( * args, * * kwargs ) }'return wrapper | [
-1.1324185132980347,
-0.4793940484523773,
0.5369499325752258,
-0.30603283643722534,
-0.7133680582046509,
0.6698687672615051,
-0.11780589818954468,
0.09686173498630524,
0.231901615858078,
0.319017231464386,
0.6429590582847595,
0.3407759964466095,
0.650708019733429,
0.2087746411561966,
-0.... |
def register _ system _ shared _ memory ( self, name : str, key : str, byte _ size : int, offset : int =..., headers : dict [ str, t. any ] =..., ) - > none : | [
-0.13103929162025452,
-0.12350406497716904,
0.6615936160087585,
-0.07346649467945099,
-0.24453239142894745,
-0.01757354848086834,
-0.6999478936195374,
0.47884276509284973,
0.4479973316192627,
-0.3646882176399231,
-1.598536729812622,
0.40851256251335144,
-0.35853952169418335,
0.300405621528... |
def referafriend _ displays ( self ) : webdriverwait ( self. driver, 10 ). until ( ec. visibility _ of _ element _ located ( ( by. css _ selector, self. css _ referafriendlink ) ) ) self. driver. find _ element _ by _ css _ selector ( self. css _ referafriendlink ). is _ displayed ( ) | [
0.2595835328102112,
0.29849162697792053,
0.9093175530433655,
0.18742063641548157,
0.8560395836830139,
0.19246000051498413,
1.0260881185531616,
-0.6988567113876343,
0.41333043575286865,
0.6733261942863464,
0.21987657248973846,
0.28504422307014465,
-0.06080285459756851,
1.0628783702850342,
... |
def critic ( self, fake _ sequence, embedder ) : fake _ sequence = embedder ( fake _ sequence ) fake _ sequence = fake _ sequence. detach ( ) seq _ len = fake _ sequence. size ( ) [ 1 ] values = [ ] hidden _ size = none for t in range ( seq _ len ) : if t = = 0 : input = torch. zeros _ like ( fake _ sequence [ :, 0 ]. ... | [
-0.43977463245391846,
-0.16919612884521484,
0.5088492631912231,
0.568565309047699,
-0.44507521390914917,
-0.8456767201423645,
0.3548524081707001,
-0.10200446844100952,
-0.37689828872680664,
0.9700232148170471,
-0.5842345356941223,
-0.06421173363924026,
0.31048959493637085,
1.20502746105194... |
def probability ( self, point ) : if not self. contains ( point ) : raise valueerror ( " invalid point " ) return self. root. probability _ at ( point, self. origin, self. width ) | [
0.5406398773193359,
-0.25361377000808716,
0.5562577247619629,
0.4517194628715515,
-0.5235552787780762,
0.5502592325210571,
-0.05384562909603119,
-0.10044116526842117,
0.4751198887825012,
0.2415846884250641,
0.5806698203086853,
-0.511745810508728,
-0.3579235076904297,
0.09434975683689117,
... |
def grayscale ( img ) : return cv2. cvtcolor ( img, cv2. color _ bgr2gray ) # or use bgr2gray if you read an image with cv2. imread ( ) # return cv2. cvtcolor ( img, cv2. color _ bgr2gray ) | [
-0.07465729117393494,
-0.09211207926273346,
0.46318191289901733,
-0.0220453180372715,
0.5448123216629028,
0.06288202852010727,
-1.0950146913528442,
-0.46038347482681274,
0.28748685121536255,
0.33954164385795593,
0.6829098463058472,
0.18989558517932892,
-0.011630360968410969,
1.033066630363... |
def set _ value ( self, value ) : self. observed. value = value | [
0.13600797951221466,
0.2990362048149109,
0.40491747856140137,
-1.0659834146499634,
0.21976768970489502,
0.8302195072174072,
0.18604247272014618,
-0.12343726307153702,
-0.2681659758090973,
0.2272963970899582,
-0.9666159152984619,
0.9207563996315002,
0.5195857286453247,
0.8848637342453003,
... |
def to _ one _ hot ( df, columns ) : return pd. get _ dummies ( df, columns = columns, prefix = columns ) | [
-0.5455904006958008,
0.8113811612129211,
0.44142699241638184,
0.01577315852046013,
0.7260444164276123,
-0.5573024749755859,
-0.40050554275512695,
0.0017607762711122632,
0.3197304308414459,
0.5815111994743347,
-0.14276123046875,
1.3336246013641357,
0.9114148020744324,
-0.9480255842208862,
... |
def calc _ heart _ rate ( self, ir _ data, sample _ rate = 25, ma _ size = 4 ) : # sampling frequency * 4 ( in algorithm. h ) buffer _ size = len ( ir _ data ) # get dc mean # ir _ mean = int ( np. mean ( ir _ data ) ) ir _ mean = int ( sum ( ir _ data ) / float ( len ( ir _ data ) ) ) # remove dc mean and inver signal... | [
0.0031127389520406723,
0.40695884823799133,
1.0874779224395752,
0.48066815733909607,
-0.6302974820137024,
0.20402808487415314,
0.08813707530498505,
0.17338840663433075,
0.39000487327575684,
0.849539577960968,
-0.3026415705680847,
-0.2618259787559509,
-0.5506159663200378,
0.0103820711374282... |
async def drop _ table _ event _ manager _ application ( self, ctx ) - > none : if not await self. table _ event _ manager _ application _ exists ( ) : return await ctx. send ( " * * table ` eventmanagerapplication ` doesn't exist! * * " ) mycursor, db = await the _ database ( ) await mycursor. execute ( " drop table e... | [
0.023447982966899872,
-0.2601814568042755,
0.4896840751171112,
0.6152350306510925,
0.3006244897842407,
0.8266208171844482,
0.14366935193538666,
0.1248105838894844,
-0.7222562432289124,
0.39152228832244873,
0.3981006443500519,
0.36620381474494934,
-0.3005495071411133,
1.0794260501861572,
... |
def _ _ init _ _ ( self, modification _ date = none, modifier = none, object _ id = none, version _ number = none, version _ pid = none, version _ state = none ) : # noqa : e501 # noqa : e501 self. _ modification _ date = none self. _ modifier = none self. _ object _ id = none self. _ version _ number = none self. _ ve... | [
0.5416863560676575,
-0.79888916015625,
0.6050519347190857,
0.10870321094989777,
-0.0020011740271002054,
-0.21675989031791687,
-0.46187958121299744,
0.7112247347831726,
0.9432581663131714,
0.05071219429373741,
-0.7269130945205688,
0.8396487236022949,
0.6478331685066223,
-0.00520490063354373... |
def _ _ contains _ _ ( self, other ) : if isinstance ( other, point ) : in _ x = self. pt1. x < = other. x < = self. pt2. x in _ y = self. pt1. y < = other. y < = self. pt2. y return in _ x and in _ y elif isinstance ( other, segment ) : return other. pt1 in self and other. pt2 in self else : raise valueerror ( ) | [
0.0031426367349922657,
-1.0121846199035645,
0.8901271820068359,
0.6234003305435181,
-0.006328278686851263,
0.7661925554275513,
-0.003847743384540081,
-0.8271167278289795,
0.035062678158283234,
-0.13807600736618042,
0.38546690344810486,
0.2701776921749115,
-0.508567750453949,
-0.28976261615... |
def _ fast _ merge ( self, hist _ dict, new _ hists, weight ) : keys = hist _ dict. keys ( ) for key in keys : subgroup = hist _ dict [ key ] if not key in new _ hists : raise histadderror ( " node { } not found in new hists ". format ( key ) ) if isinstance ( subgroup, dict ) : self. _ fast _ merge ( hist _ dict [ key... | [
0.0644005835056305,
0.022558080032467842,
0.6632842421531677,
0.3345751464366913,
-0.202860489487648,
-0.09533045440912247,
-0.6528717279434204,
0.2319728136062622,
-0.15258511900901794,
-0.2493448406457901,
0.6842935085296631,
0.35129502415657043,
-0.2311391979455948,
1.4811112880706787,
... |
def _ generate _ time _ values ( self ) : # populate time values log ('writing times ','info') total _ seconds = 0 d1970 = datetime ( 1970, 1, 1 ) time _ array = [ ] for index, time _ len in enumerate ( self. time _ len _ array ) : if index > 0 : total _ seconds + = self. time _ step _ array [ index ] secs _ start = in... | [
-0.5726069808006287,
0.8976603746414185,
0.7749244570732117,
-0.1517316848039627,
0.7142292857170105,
0.2649170458316803,
0.07852514088153839,
-0.5636260509490967,
-1.2459677457809448,
0.29492950439453125,
-0.2770906984806061,
-0.7675170302391052,
0.5546174049377441,
1.6660606861114502,
... |
def _ extract _ expression _ effective _ size ( self, statement, expr ) - > tuple [ optional [ int ], optional [ tuple [ expression,... ] ] ] : walker = expressionnarrowingwalker ( expr ) walker. walk _ statement ( statement ) if not walker. operations : if expr is none : return none, none return expr. size, ( expr, ) ... | [
-0.24204134941101074,
-0.09392619878053665,
0.9495084881782532,
0.0960228219628334,
-0.5259454250335693,
-1.1539256572723389,
0.870658278465271,
-0.2379622906446457,
0.03627343848347664,
0.5702984929084778,
-0.5234153270721436,
-0.14139322936534882,
-0.01569991186261177,
0.6190194487571716... |
def act ( self, obs, reward, cost ) : " " " paper : https : / / arxiv. org / pdf / 1802. 08365. pdf algorithm : 1. get previous state s _ prev from agent, get previous timestamp 2. get current timestamp, t _ current ( from current obs ) update reward, cost, winning, etc if t _ current! = s _ prev and still in current e... | [
-0.45320382714271545,
-0.7517076730728149,
0.9690367579460144,
0.38927140831947327,
-0.1088709682226181,
0.1710416078567505,
0.41396328806877136,
0.1477252095937729,
0.08550402522087097,
0.2508527636528015,
0.1903725415468216,
0.8200890421867371,
0.4302559792995453,
-0.5315008163452148,
... |
def data2q _ atom ( mol ='', data _ file ='' ) : data2b _ atom ( mol, data _ file, property ='q') | [
0.39241737127304077,
-0.7454379796981812,
0.27740779519081116,
0.12383119761943817,
0.288316935300827,
0.23322837054729462,
-0.22234055399894714,
0.31541094183921814,
-0.570280134677887,
-0.8707475662231445,
-1.0933935642242432,
1.0412349700927734,
0.15305520594120026,
-0.806763768196106,
... |
def test _ register _ input _ and _ post _ and _ passwords _ bad _ no _ spec _ chars ( self, * _ ) : self. open ( base _ url +'/ logout') # go to main page self. open ( base _ url +'/ register') # validate that the user is taken to / login assert self. get _ current _ url ( ) = = base _ url +'/ register'self. type ('# ... | [
-0.6849625706672668,
0.6010566353797913,
0.38900190591812134,
0.5598167181015015,
0.37618616223335266,
0.48779696226119995,
-0.0625137984752655,
-0.1671275645494461,
-0.47276002168655396,
-0.7572377920150757,
-0.65730220079422,
0.618988037109375,
-0.09269937872886658,
0.9060972929000854,
... |
def _ update ( self, event ) : if self. ignore ( event ) : return if event. button! = 1 : return if event. name = ='button _ press _ event'and event. inaxes = = self. ax : self. drag _ active = true event. canvas. grab _ mouse ( self. ax ) if not self. drag _ active : return elif ( ( event. name = ='button _ release _ ... | [
-0.1851787567138672,
-0.8306899666786194,
0.8318126201629639,
-0.05041605606675148,
-1.2392148971557617,
0.20224376022815704,
0.06021865829825401,
-0.6919038891792297,
-0.0335504449903965,
-0.6908745765686035,
-0.12781840562820435,
-0.12449303269386292,
0.39651259779930115,
-0.073383517563... |
async def listen _ for _ all _ files ( self, callback _ function = none, timeout = none ) : url = " { } { } : { } / ws / files / current _ operation ". format ( self. _ ws, self. _ server _ ip, self. _ server _ port ) if callback _ function : task = await self. stream _ output ( url, callback _ function, timeout ) else... | [
0.351439505815506,
0.04422604292631149,
0.7330275177955627,
0.17470332980155945,
-0.30370932817459106,
-0.7693577408790588,
0.7202903032302856,
0.526064395904541,
-0.356035441160202,
-0.0928802490234375,
0.3408263325691223,
0.32801681756973267,
-0.49642252922058105,
0.7727513909339905,
-... |
def main ( ) : # return render _ template ('index. html') # query ganzi db ( limit 20 ) conn, cursor = init _ db ( ) cursor = conn. execute ('select id, foundationname from foundations where deleted =? ', ( 0, ) ) items = cursor. fetchall ( ) items = sorted ( items, key = itemgetter ( 1 ) ) if session. get ('logged _ i... | [
0.29896098375320435,
0.36379170417785645,
0.5211192965507507,
0.9974836111068726,
-0.08698738366365433,
-0.24380281567573547,
0.4777994155883789,
0.4152439534664154,
0.16870807111263275,
-0.02644394151866436,
0.10919833183288574,
-0.7124252319335938,
-0.10094741731882095,
0.534968376159668... |
def lookup _ transform ( to _ frame, baxter, from _ frame ='base') : # if to _ frame = ='pawn': # to _ frame ='ar _ marker _ 9'if not baxter : print ('i am the lookup transform function!'\ +'you \'re not using ros, so i \'m returning the identity matrix.') tag _ pos = [ 0. 642, - 0. 132, - 0. 023 ] tag _ rot = [ - 0. 0... | [
0.33013927936553955,
-0.7961902022361755,
0.7821962833404541,
-0.5840604305267334,
0.9151163101196289,
-0.5023570656776428,
0.10742326825857162,
-0.6830534338951111,
0.912462592124939,
0.10056634247303009,
-0.22666312754154205,
-0.26943671703338623,
-0.41545364260673523,
-0.868451952934265... |
def matrix _ combinatorial _ adjoint ( mat ) : dim = mat. nrows ( ) m = list ( ) mat _ space = matrixspace ( combinatorialscalarring ( ), dim ) prnt = mat _ space. base _ ring ( ) # create list l of lists of sets, dimension is increased by one to mitigate index confusion l = list ( ) for i in range ( dim + 1 ) : l. app... | [
0.4006020426750183,
0.5752800107002258,
0.6624659299850464,
0.4192103445529938,
-0.691876232624054,
0.2828751504421234,
0.6428467035293579,
-0.5101363658905029,
0.3098084032535553,
-0.0584074966609478,
0.0768943801522255,
0.33955317735671997,
0.242995947599411,
-0.6071310639381409,
-0.10... |
def get _ sim _ score ( word _ 1, word _ 2, info _ content ) : if word _ 1 = = word _ 2 : return 1 else : max _ sim = - 1. 0 synsets _ 1 = wn. synsets ( word _ 1 ) synsets _ 2 = wn. synsets ( word _ 2 ) if synsets _ 1 and synsets _ 2 : for synset _ 1, synset _ 2 in product ( synsets _ 1, synsets _ 2 ) : try : sim = wn.... | [
0.0921669453382492,
0.4423556923866272,
0.7676683664321899,
0.6043803691864014,
-0.25531962513923645,
-0.42147353291511536,
-0.5489146113395691,
-0.22488150000572205,
-0.0976819396018982,
-0.13169685006141663,
-0.016424257308244705,
-0.034137941896915436,
-0.36802375316619873,
0.0697566196... |
def test _ gf _ write _ step _ explicit _ indentation _ without _ doc _ string _ without _ data _ table ( disabled _ colors, capsys, mocker ) : # given step = mocker. magicmock ( spec = step ) step. keyword = " given " step. used _ keyword = " given " step. text = " there is a step " step. doc _ string = none step. dat... | [
-0.03738751634955406,
-0.24379679560661316,
0.4238170385360718,
0.3012464642524719,
0.45808836817741394,
0.08531301468610764,
-0.11772114038467407,
0.3224863111972809,
-1.2627544403076172,
-0.7175071239471436,
-0.6567720770835876,
-0.1913316547870636,
0.23647281527519226,
0.725853800773620... |
def make _ continuity _ filter ( neighborhood _ freq _ hz, neighborhood _ time _ ms, spec _ bin _ hz, hop _ length _ ms ) : n _ bin _ freq = int ( neighborhood _ freq _ hz / spec _ bin _ hz ) n _ bin _ time = int ( neighborhood _ time _ ms / hop _ length _ ms ) return np. ones ( ( n _ bin _ freq, n _ bin _ time ) ) / n... | [
0.7790087461471558,
0.3028329312801361,
0.6727772951126099,
0.6513804197311401,
0.58162522315979,
0.3726264238357544,
0.9485292434692383,
0.5994827151298523,
-0.12402807921171188,
0.47470933198928833,
0.5428479909896851,
0.0763884112238884,
-0.4266960322856903,
0.1906958669424057,
0.2817... |
def get _ targets ( self, uuid = none, * * kwargs ) : return self. request ('targets ', uuid = uuid, * * kwargs ) | [
-1.5315501689910889,
0.38474300503730774,
0.3209359049797058,
0.7557766437530518,
1.1548038721084595,
-1.1451826095581055,
-1.1765621900558472,
0.4586840569972992,
-0.09772657603025436,
-0.26377731561660767,
-0.03321117162704468,
1.082011103630066,
-0.8929306268692017,
-0.4014735221862793,... |
def hgvs _ justify _ dup ( chrom, offset, ref, alt, genome ) : if len ( ref ) = = len ( alt ) = = 0 : # it's a snp, just return. return chrom, offset, ref, alt,'>'if len ( ref ) > 0 and len ( alt ) > 0 : # complex indel, don't know how to dup check return chrom, offset, ref, alt,'delins'if len ( ref ) > len ( alt ) : #... | [
-0.4669046103954315,
-0.17740009725093842,
0.8792659640312195,
-0.33671635389328003,
-0.26574233174324036,
0.14586152136325836,
0.24076586961746216,
0.04248053580522537,
0.6073321104049683,
0.7167720198631287,
0.541644275188446,
0.8985354900360107,
0.09349264204502106,
-0.4335409700870514,... |
def add _ instances ( self, dom, design ) : for ci in design. component _ instances : for symattr in ci. symbol _ attributes : dom. instance. append ( self. make _ instance ( ci, symattr ) ) | [
-0.8892501592636108,
0.6835601329803467,
0.33809757232666016,
-0.5408222675323486,
0.10253792256116867,
0.5699576139450073,
0.5349271297454834,
0.023618657141923904,
0.14524632692337036,
-0.6617404222488403,
0.07980870455503464,
0.23937591910362244,
0.4163467586040497,
0.4521681070327759,
... |
def test _ invalid _ email ( self ) : invalid _ email = " not an email " with self. assertraises ( exception ) as context : reportformsaver. validate _ email ( reportformsaver, invalid _ email ) self. asserttrue ( ( f " email ( { invalid _ email } ) is not valid. " " please enter a valid email address. " ) in str ( con... | [
0.7295739650726318,
0.6957017183303833,
0.343650221824646,
0.10180367529392242,
0.31221356987953186,
0.32951822876930237,
-0.10077407956123352,
1.3560118675231934,
0.11668102443218231,
-0.7353785037994385,
-0.005160012748092413,
-0.009229089133441448,
-1.04557466506958,
-0.0456276051700115... |
def random _ claim _ id ( begin _ id = 0, end _ id = 99999 ) : return randint ( begin _ id, end _ id ) | [
0.621569037437439,
-1.1078569889068604,
0.5122433304786682,
-0.9741769433021545,
-0.010979543440043926,
1.0153306722640991,
-1.0464707612991333,
0.7941452264785767,
0.6195969581604004,
-0.8422054648399353,
0.6869615316390991,
1.5127140283584595,
-0.7614312171936035,
-0.8221010565757751,
... |
def _ start _ new _ bracket ( self ) : # start new bracket self. iteration _ counter + = 1 # iteration counter gives the bracket count or bracket id n _ configs, budgets = self. get _ next _ iteration ( self. iteration _ counter ) bracket = shbracketmanager ( n _ configs = n _ configs, budgets = budgets, bracket _ id =... | [
0.0022375057451426983,
-0.3432843089103699,
0.47541412711143494,
0.2739279270172119,
-0.0531584732234478,
0.11923892796039581,
-0.31756824254989624,
-0.049115944653749466,
0.40789511799812317,
-0.9354770183563232,
-0.1916072815656662,
0.9050858616828918,
-0.3803408145904541,
0.518783569335... |
def parse _ time ( timestamp ) : parsed = parse _ time _ rp. fullmatch ( timestamp ) if parsed is none : sys. stderr. write ( f'cannot parse timestamp : ` { timestamp } `, returning ` discord _ epoch _ start ` \ n') return discord _ epoch _ start year = int ( parsed. group ( 1 ) ) month = int ( parsed. group ( 2 ) ) da... | [
0.2645869255065918,
0.519756555557251,
0.7476170063018799,
-0.6203754544258118,
-0.3459559679031372,
-1.0939966440200806,
-0.24468757212162018,
0.01891232654452324,
0.5675421357154846,
0.49110162258148193,
-0.6030094623565674,
-0.540542483329773,
-0.49654850363731384,
-0.7455704808235168,
... |
def closeness _ centrality ( g, u = none, distance = none, wf _ improved = true ) : if g. is _ directed ( ) : g = g. reverse ( ) # create a reversed graph view if distance is not none : # use dijkstra's algorithm with specified attribute as edge weight path _ length = functools. partial ( nx. single _ source _ dijkstra... | [
-0.13689395785331726,
0.329202264547348,
0.5284444093704224,
0.027853917330503464,
-1.1838244199752808,
0.3329869210720062,
0.6301665306091309,
0.8789660930633545,
-0.23128025233745575,
0.07898394018411636,
-0.10782405734062195,
0.7289475798606873,
-0.34183669090270996,
0.2628647983074188,... |
def _ get _ commands ( self ) : results = [ ] if self. is _ amplicon : # skip this step for amplicon runs since raw and processed are the # same file. project _ names = [ ] else : # gather the parameters for processing all relevant raw fastq # files. params, project _ names = self. _ scan _ fastq _ files ( true ) for f... | [
-0.3749227821826935,
0.040839169174432755,
0.7167089581489563,
-0.5985554456710815,
0.5191864967346191,
-0.5171146988868713,
0.3876294791698456,
-0.8362948298454285,
-0.3514287769794464,
-0.24031780660152435,
0.33485668897628784,
-0.17427760362625122,
0.4090302586555481,
0.5070170164108276... |
def regex _ len ( patt, star _ len = 10, plus _ len = none ) : if plus _ len is none : plus _ len = star _ len patt = getattr ( patt,'pattern ', patt ) # return len ( patt ) return len ( exrex. getone ( exrex _ pattern ( patt, star _ len = star _ len, plus _ len = plus _ len ) ) ) | [
0.3812517523765564,
0.6865185499191284,
0.5090336203575134,
-0.911318838596344,
-0.43443727493286133,
-0.03176791965961456,
0.6481544375419617,
1.585646152496338,
1.6042511463165283,
-0.4654771387577057,
-0.6324018239974976,
0.09659432619810104,
0.2220715433359146,
-0.32408177852630615,
... |
def active _ index _ from _ block _ config ( config ) : assert config ['name'] = ='mobileinvertedresidualblock'layer _ config = config ['mobile _ inverted _ conv'] if layer _ config ['name'] = ='mbinvertedconvlayer': return proxylessnasblockspec. op _ choices ['conv _ candidates']. index ('{ a } x { a } _ mbconv { b } ... | [
0.04072241112589836,
-0.46078869700431824,
0.6029234528541565,
0.06818259507417679,
-0.37203237414360046,
-0.40097692608833313,
0.912257969379425,
0.5152041912078857,
0.09655328840017319,
0.05123577266931534,
-0.4151662290096283,
0.18629905581474304,
-0.9588756561279297,
-0.117127701640129... |
def update _ tenant _ configuration ( self, tenant, config ) : # get tenant's section in argo configuration section _ tenant = " tenants : " + tenant # update tenant ams project ams _ project = self. get _ tenant _ project ( tenant ) if ams _ project is not none : if ams _ project [ " name " ]! = config. get ( section ... | [
0.3692769408226013,
-0.6940672397613525,
0.7782729268074036,
-0.19286248087882996,
-0.5237769484519958,
0.1474577635526657,
-0.2241138070821762,
0.4277675151824951,
-0.8695682287216187,
0.9497084617614746,
-0.1699676513671875,
0.47658464312553406,
0.8166554570198059,
0.8842223882675171,
... |
def stop ( self, host ) : log, barreleye _ instance = init _ env ( self. _ bac _ config _ fpath, self. _ bac _ logdir, self. _ bac _ log _ to _ file ) host = cmd _ general. check _ argument _ str ( log, " host ", host ) hostnames = cmd _ general. parse _ list _ string ( log, host ) if hostnames is none : log. cl _ erro... | [
-0.7452543377876282,
-0.7019932866096497,
0.5843236446380615,
-0.026118053123354912,
0.08365616947412491,
0.22947177290916443,
0.13905078172683716,
0.481098473072052,
-1.1365747451782227,
0.7608093619346619,
-0.5630059242248535,
0.24393323063850403,
-0.28780031204223633,
0.3205147087574005... |
def target _ team _ member ( self, target _ team _ member ) : self. _ target _ team _ member = target _ team _ member | [
-0.6827794909477234,
-0.29505565762519836,
-0.38786453008651733,
-0.25905224680900574,
0.06867897510528564,
1.0735671520233154,
0.29486769437789917,
-0.4589548110961914,
-1.1746464967727661,
-0.17062678933143616,
-0.34487977623939514,
0.10400280356407166,
0.7537549138069153,
-0.98120081424... |
def options ( self ) : return self. _ options | [
-0.31391265988349915,
-0.19949211180210114,
0.1496194303035736,
-0.10888845473527908,
1.4053107500076294,
0.4125126004219055,
0.36952200531959534,
-0.7265642285346985,
0.6906147599220276,
-0.7314357161521912,
-0.37424764037132263,
0.022482091560959816,
-0.24158447980880737,
-0.168917074799... |
def test _ string _ showed _ by _ matrix ( self ) : self. assertequals ( " [ 1, 2 ] \ n [ 4, 3 ] \ n ", str ( self. matrix ) ) | [
0.7415724992752075,
-0.9110978245735168,
0.14567072689533234,
-0.3356929123401642,
-0.5424103736877441,
0.2156105935573578,
0.7244345545768738,
-0.4033876359462738,
0.5575370192527771,
0.2009555548429489,
0.5530668497085571,
0.6430851221084595,
-0.12053526937961578,
-0.32189232110977173,
... |
def test _ module _ coords _ to _ tile ( args ) : epix, ( nrow, ncol ), pxsz, cls = args css, cfs = nrow / / 176, ncol / / 192 slow _ scan = np. array ( [ 5, 200, 15, 255 ] ) * css fast _ scan = np. array ( [ 10, 215, 225, 30 ] ) * cfs tileno, tile _ ss, tile _ fs = epix. _ module _ coords _ to _ tile ( slow _ scan, fa... | [
-0.04857023432850838,
0.3826586604118347,
0.44138938188552856,
-0.6044041514396667,
0.32644253969192505,
0.20799466967582703,
0.5636961460113525,
-0.6148761510848999,
0.4463411271572113,
-1.110020399093628,
-0.40361931920051575,
0.011224509216845036,
0.40534794330596924,
0.1989416033029556... |
def amount ( self ) : if not self. _ _ cached : self. _ _ calc _ amount ( ) return self. _ _ amount | [
-0.03854847326874733,
-0.32228341698646545,
0.6398045420646667,
0.2072950154542923,
-0.7070278525352478,
0.1764492690563202,
0.8968582153320312,
-0.2595060467720032,
1.1756219863891602,
-0.2819264829158783,
0.09924043715000153,
0.06556861102581024,
-0.048344872891902924,
0.4489454627037048... |
def export _ to _ db ( headers, data, filename ) : field _ list = " " table _ name = " screener _ results " # name of the table to be created conn = create _ connection ( filename ) c = conn. cursor ( ) for field in headers : field _ cleaned = re. sub ( r " [ ^ \ w \ s ] ", " ", field ) field _ cleaned = field _ cleane... | [
-0.16157540678977966,
0.1127077266573906,
0.9058128595352173,
0.1131313368678093,
-0.24151800572872162,
0.004136676900088787,
-0.3538073003292084,
-0.35717543959617615,
-0.5688517689704895,
0.33375075459480286,
-0.047786712646484375,
-0.6925667524337769,
-0.851757287979126,
0.9869943857192... |
def players ( self ) : return self. _ players | [
-1.137883186340332,
-0.8786716461181641,
0.21897315979003906,
0.24660834670066833,
1.216605544090271,
0.4450518488883972,
0.012762757949531078,
-0.1213516965508461,
0.3610917329788208,
0.03206801041960716,
-0.4251701235771179,
0.6575846076011658,
-0.9824867248535156,
-0.022174715995788574,... |
def install _ cache ( cache _ filename : str = none ) : if not cache _ filename : directory = default _ cache _ storage _ base _ dir cache _ filename = os. path. join ( default _ cache _ storage _ base _ dir, " requests _ cache " ) else : directory = os. path. dirname ( cache _ filename ) mkdir ( directory ) check _ wr... | [
-0.23382389545440674,
0.33635324239730835,
0.8443065285682678,
0.7630100846290588,
0.772470235824585,
0.5463266968727112,
0.08894946426153183,
0.4514905512332916,
-0.5737130045890808,
-0.05769514665007591,
0.6257654428482056,
-0.8330147862434387,
-0.4750903248786926,
0.12943053245544434,
... |
def push _ back ( self, item ) : if self. _ size = = self. _ capacity : self. _ resize _ to _ new _ capacity ( self. _ capacity * self. growth _ factor ) self. _ data [ self. _ size ] = item self. _ size + = 1 | [
-0.7236302495002747,
0.8301005363464355,
0.7446653246879578,
-0.024469872936606407,
0.4732166528701782,
0.06993002444505692,
0.9663437604904175,
-0.44749072194099426,
0.009161855094134808,
0.2582283318042755,
-0.6307796239852905,
0.098554328083992,
-0.6924194693565369,
-1.0247360467910767,... |
def _ run _ batched _ receiver ( self ) : try : self. logger. debug ( " running batched receiver " ) batch = self. channel. receive _ batch ( self. max _ batch _ size ) self. logger. debug ( " % s metrics received " % len ( batch ) ) self. publisher. publish ( batch ) self. channel. complete ( batch ) except : self. lo... | [
0.2809997797012329,
-0.25090453028678894,
0.5357266068458557,
-0.1704673022031784,
0.23972658812999725,
0.35118183493614197,
-0.4801386296749115,
1.0007493495941162,
-0.584405243396759,
-0.429862916469574,
0.036643411964178085,
0.3367036283016205,
-0.42861488461494446,
0.7186992168426514,
... |
def assign _ value ( values, box, value ) : # don't waste memory appending actions that don't actually change any values if values [ box ] = = value : return values values [ box ] = value if len ( value ) = = 1 : assignments. append ( values. copy ( ) ) return values | [
-1.148036003112793,
-0.1580362319946289,
0.3395306468009949,
0.7284550070762634,
0.3463136553764343,
-0.47823232412338257,
-0.4574698209762573,
-0.33133989572525024,
0.4478338956832886,
0.2149120718240738,
0.17507898807525635,
0.6285281777381897,
0.014973594807088375,
1.144408106803894,
... |
def _ _ init _ _ ( self, mimetype ) : self. mimetype = mimetype self. full _ type, self. params = self. _ _ parse _ mimetype ( mimetype ) self. main _ type, sep, self. sub _ type = self. full _ type. partition ('/') | [
0.36760541796684265,
-0.29638028144836426,
0.5890116691589355,
0.493924081325531,
-0.25487232208251953,
-0.16167481243610382,
0.6541264057159424,
0.17638778686523438,
-0.10541798919439316,
0.16528332233428955,
-0.5617653727531433,
-0.6558241844177246,
-1.0451765060424805,
0.253124117851257... |
def constant ( value : int ) - >'possiblevalueset': result = possiblevalueset ( ) result. _ type = registervaluetype. constantvalue result. _ value = value return result | [
-0.07540230453014374,
0.6748162508010864,
0.41302913427352905,
-0.17218030989170074,
-0.45101791620254517,
-0.09770681709051132,
0.7290952205657959,
-0.14728178083896637,
0.5337985754013062,
-0.3658983111381531,
-0.20522424578666687,
0.20868340134620667,
-0.7529706954956055,
0.039587311446... |
def from _ file ( self, filename ) : f = open ( filename ) ret = self. from _ string ( f. read ( ) ) f. close ( ) return ret | [
0.39446547627449036,
-1.317530632019043,
0.338067889213562,
-0.2080933004617691,
-0.3350996971130371,
0.4908457398414612,
-0.2019268125295639,
0.25389063358306885,
-0.8440737724304199,
-0.5946623682975769,
-0.02442055195569992,
-0.19609041512012482,
-0.1810021698474884,
-0.921383261680603,... |
def to _ tuple ( self ) : return self. _ return _ tuple ( self ) | [
-1.627962350845337,
0.42941993474960327,
0.36869898438453674,
-0.1400921791791916,
0.4537965655326843,
-0.39588600397109985,
0.07208923250436783,
-0.2607329785823822,
-0.43252086639404297,
-0.10083775222301483,
-0.5717439651489258,
-0.5151621103286743,
-0.5399768948554993,
-0.8467677831649... |
def setmeanandvariance ( self, mean, var ) : # - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | - - - - + - - - - | return binomialdistbase. setmeanandvariance ( self, mean, var ) | [
-1.671517014503479,
-0.7868573665618896,
0.6497723460197449,
-0.33128008246421814,
-0.2177658975124359,
0.21226879954338074,
-0.550872266292572,
0.42498403787612915,
-0.4750610291957855,
0.66869056224823,
-0.800889790058136,
1.3847230672836304,
-1.55088210105896,
0.8340759873390198,
0.17... |
def comparevalsbasecase ( x, y, model, params, var, decimals, lowerarg, upperarg ) : searchstep, lowerarg, upperarg = setsearchstepandargs ( lowerarg, upperarg, decimals ) timesandscores = [ ] start _ time = time. perf _ counter ( ) lowerval = model ( x, y, { * * params, * * { var : lowerarg } }, ) end _ time = time. p... | [
-0.1284933239221573,
-0.26730790734291077,
0.8332170844078064,
0.5682694911956787,
0.10131508111953735,
-0.15466256439685822,
-0.18681637942790985,
-1.047719955444336,
-1.2383601665496826,
0.1909017264842987,
0.17026209831237793,
0.40116003155708313,
-0.3162158131599426,
1.0207653045654297... |
def get _ permissions ( self ) : if self. action in ['update ','partial _ update'] : " " " only reviewers can edit reviews. " " " permissions = [ isauthenticated, isreviewer, isreviewowner ] else : permissions = [ allowany ] return [ p ( ) for p in permissions ] | [
-1.191454529762268,
-0.32957035303115845,
0.4367867410182953,
1.1569263935089111,
0.2991812229156494,
0.2778179347515106,
-0.9437227249145508,
0.29313501715660095,
0.36105236411094666,
0.5205795168876648,
0.6942720413208008,
0.39123138785362244,
-0.8002607822418213,
-0.1650829017162323,
... |
def test _ single _ plot _ 10 ( self ) : inch _ per _ unit = 1 x _ units = 4 y _ units = 4 left = 1 bottom = 1 width = 2 height = 2 figsize, coords = pt. make _ coordinates ( inch _ per _ unit, x _ units, y _ units, left, bottom, width, height ) self. assertequal ( figsize, ( 4, 4 ) ) self. assertequal ( coords, [ ( 0.... | [
-0.008897804655134678,
1.3111406564712524,
0.45010828971862793,
-0.40123501420021057,
0.23222090303897858,
1.2200220823287964,
1.2824245691299438,
-0.07503296434879303,
-0.5523459315299988,
-1.0101165771484375,
-0.545616626739502,
-0.4462816119194031,
-0.060579169541597366,
-0.592445194721... |
def lanczos ( l, x, k ) : m, n = x. shape assert l. dtype = = x. dtype def basis ( l, x, k ) : " " " lanczos algorithm which computes the orthogonal matrix v and the tri - diagonal matrix h. " " " a = np. empty ( ( k, n ), l. dtype ) b = np. zeros ( ( k, n ), l. dtype ) v = np. empty ( ( k, m, n ), l. dtype ) v [ 0,...... | [
1.0739496946334839,
0.08239468187093735,
1.034936785697937,
0.038683921098709106,
-0.6384932994842529,
-0.1578206717967987,
0.10043995827436447,
0.17966486513614655,
0.44881922006607056,
0.5483347177505493,
-0.8321431875228882,
-0.3627217411994934,
0.6302213668823242,
0.08190618455410004,
... |
def asts ( ast ) : return [ x for x in ast if isinstance ( x, ast ) ] | [
0.04132985323667526,
-0.29679927229881287,
0.365052193403244,
-0.4259450137615204,
-1.1102721691131592,
0.11584726721048355,
-0.7449105381965637,
-0.17954455316066742,
1.4580519199371338,
0.7109200358390808,
0.042072393000125885,
0.9035442471504211,
0.36659276485443115,
0.7067465782165527,... |
def test _ progress _ with _ one _ weighted _ multiple _ auto ( self ) : task1 = statussimulatingtaskproxy ( ) task2 = statussimulatingtaskproxy ( ) task3 = statussimulatingtaskproxy ( ) ctask = taskcontainer ('tester') ctask. add _ task ( task1, 80 ) ctask. add _ task ( task2 ) # should default to 10 % of the overall ... | [
0.47665247321128845,
0.5666918754577637,
0.851674497127533,
0.6953985095024109,
0.5372944474220276,
0.839422881603241,
0.7541917562484741,
-0.3305363655090332,
-0.8605231046676636,
-0.10596923530101776,
-0.16571946442127228,
-0.9575467109680176,
-0.09892980009317398,
1.1212784051895142,
... |
def removewidget ( self, widget ) : if isinstance ( widget, qscintilla. editor. editor ) : widget. cursorlinechanged. disconnect ( ) widget. captionchanged. disconnect ( ) self. editors. remove ( widget ) index = self. indexof ( widget. parent ( ) ) else : index = self. indexof ( widget ) if index > - 1 : self. removet... | [
-0.4996761083602905,
-0.04708906263113022,
0.46387070417404175,
-0.5791079998016357,
-0.10953451693058014,
0.32326266169548035,
-0.17765314877033234,
0.21520061790943146,
0.6682031750679016,
-0.22348542511463165,
-0.18419840931892395,
-0.8530371785163879,
-0.5285170078277588,
0.49498510360... |
def result ( board, action ) : p = player ( board ) if board [ action [ 0 ] ] [ action [ 1 ] ] = = empty : b1 = [ [ ], [ ], [ ] ] for i in range ( 3 ) : for j in range ( 3 ) : if i = = action [ 0 ] and j = = action [ 1 ] : b1 [ i ]. append ( p ) else : b1 [ i ]. append ( board [ i ] [ j ] ) return b1 else : raise excep... | [
-0.434355229139328,
0.23795866966247559,
0.7600537538528442,
0.7806538343429565,
0.3301715552806854,
-0.07562252134084702,
0.28815704584121704,
-0.5351908802986145,
0.4695427715778351,
1.3057193756103516,
-0.25291183590888977,
0.1491110622882843,
-0.9790105223655701,
-0.9714280366897583,
... |
def positivetime ( self, type, amount ) : if amount is none : return getattr ( self. partytime, type ) if type = = " hour " or type = = " minute " : if amount < 0 : return self. timetypetomaxvalue [ type ] + 1 + self. timetypetochangeamount [ type ] [ 1 ] elif amount > self. timetypetomaxvalue [ type ] : return 0 retur... | [
-0.7844575643539429,
-0.9219857454299927,
0.9320181012153625,
0.27822479605674744,
-0.4251536726951599,
-0.17870759963989258,
-1.4570618867874146,
-0.8689789175987244,
-0.09024602174758911,
1.247410774230957,
0.5433873534202576,
-0.049940817058086395,
-0.10518775880336761,
1.29777729511260... |
def available _ currencies ( ) : url = requests. get ( config. supported _ currencies ). json ( ) currencies = url ['symbols'] currencies _ list = " " for k, v in currencies. items ( ) : currencies _ list + = str ( k ) + " : " + str ( v ['description'] ) + " \ n " return currencies _ list | [
-0.6947714686393738,
-0.051956623792648315,
0.23588129878044128,
-1.1490745544433594,
0.16018375754356384,
-0.05148141831159592,
-1.2502824068069458,
0.6486837267875671,
0.14639660716056824,
1.6176676750183105,
-0.6216638684272766,
0.5659169554710388,
0.013914267532527447,
0.49674364924430... |
def validate _ add _ user ( user, add _ user ) : if user. is _ candidate : return add _ user. is _ professor elif user. is _ professor : return add _ user. is _ candidate else : return false | [
-0.48474669456481934,
-0.6196544766426086,
0.5916150808334351,
1.7743066549301147,
-0.1789780855178833,
1.7723690271377563,
-0.5348353385925293,
-0.5054684281349182,
0.324798047542572,
0.008787737227976322,
1.6897426843643188,
0.5446804761886597,
-0.4426179528236389,
0.013699519447982311,
... |
def use _ sample _ service ( ) : req _ json = request. get _ json ( ) try : # for authentication api _ key _ str = req _ json [ " api _ key " ] # for the service size = req _ json [ " size " ] except keyerror : app. logger. error ( " could not find the necessary keys in the request's body " ) return not _ found _ error... | [
-0.6839433908462524,
0.36813175678253174,
0.7606022953987122,
-0.6127139925956726,
-0.5173872113227844,
-0.27577075362205505,
0.16568922996520996,
-0.13185817003250122,
0.26546573638916016,
0.15785594284534454,
0.07973878085613251,
0.31576913595199585,
-0.8927534818649292,
0.55401891469955... |
def dict _ product ( d ) : pairs = it. product ( * d. itervalues ( ) ) return ( dict ( it. izip ( d, p ) ) for p in pairs ) | [
-1.1945892572402954,
1.1670392751693726,
0.46161940693855286,
-0.29236167669296265,
-1.3442513942718506,
0.24081723392009735,
0.10796532779932022,
-0.40058401226997375,
0.10760413110256195,
-0.032661132514476776,
0.07384786754846573,
-1.3855335712432861,
0.5440381765365601,
-0.391276031732... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.