text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def build _ models _ doc ( train _ pos _ vec, train _ neg _ vec ) : y = [ " pos " ] * len ( train _ pos _ vec ) + [ " neg " ] * len ( train _ neg _ vec ) # use sklearn's gaussiannb and logisticregression functions to fit two models to the training data. # for logisticregression, pass no parameters # your code here trai... | [
-0.3178207576274872,
-0.47029390931129456,
0.6080569624900818,
0.302090048789978,
0.7483875155448914,
0.7115350365638733,
-0.8591287136077881,
0.3292950987815857,
-0.4632752537727356,
-0.21518510580062866,
-0.2032364308834076,
0.06595229357481003,
0.0008118610130622983,
-0.2951749861240387... |
def _ writetocache ( self, cache ) : with open ( self. _ cache _ path,'w') as f : json. dump ( cache, f ) | [
-1.6429262161254883,
-0.9121846556663513,
0.34620657563209534,
-0.49938371777534485,
0.5681931376457214,
0.3297964930534363,
0.11514860391616821,
0.3126762807369232,
-0.0788956880569458,
1.0443503856658936,
-0.698742151260376,
0.13173756003379822,
0.3339518904685974,
-0.013596318662166595,... |
def lowpass _ filter ( signal, fs, fc, n _ cycles = none, n _ seconds = none, plot _ frequency _ response = false, return _ kernel = false, remove _ edge _ artifacts = true ) : # set default and throw warning if no filter length provided if n _ cycles is none and n _ seconds is none : n _ cycles = 3 warnings. warn ('''... | [
0.6503863334655762,
0.7196407318115234,
0.6698322296142578,
0.6310436129570007,
-1.034820556640625,
-0.9781020283699036,
0.5702546834945679,
-0.037982676178216934,
0.8048825860023499,
-0.4657290577888489,
0.08429351449012756,
0.8841778039932251,
0.42479589581489563,
0.0750688686966896,
0... |
def reduced _ shape ( input _ shape, axes ) : # todo ( allenl ) : refactor ` reduced _ shape ` to take the tensor corresponding to # ` input _ shape ` rather than ` tf. shape ` of it. then we can check if the shape # is fully defined here, which may be faster executing eagerly than running # ` tf. shape ` and then fetc... | [
0.6181333065032959,
-0.051964085549116135,
0.7028669714927673,
-0.13040952384471893,
-0.11958170682191849,
0.20818611979484558,
1.1569181680679321,
0.40595653653144836,
0.24502213299274445,
0.054538313299417496,
0.2701418399810791,
0.9977688193321228,
0.31054002046585083,
-0.84271419048309... |
def log _ result ( self, logger : logger ) - > none : logger. check _ dependencies ( self. failed + self. still _ failing + self. skipped ) logger. start _ batch ( ) for key in list ( self. monitors. keys ( ) ) : logger. save _ result2 ( key, self. monitors [ key ] ) try : for key in list ( self. remote _ monitors. key... | [
-0.7126754522323608,
0.019517909735441208,
0.472487211227417,
0.029236119240522385,
0.3798756003379822,
0.6325176954269409,
0.018288232386112213,
0.024299385026097298,
-0.5117586851119995,
-0.26675161719322205,
-1.4877524375915527,
-0.5628742575645447,
-0.19942548871040344,
1.2233377695083... |
def transpose _ matrix ( * attrs ) : return _ create _ and _ connect _ node ('transpose _ matrix ', * attrs ) | [
-0.5932540893554688,
0.7545836567878723,
0.3245854377746582,
-0.42413464188575745,
-0.3453739285469055,
-0.926472544670105,
0.8186980485916138,
-0.05499574914574623,
-0.4122617840766907,
0.09295686334371567,
0.05829131603240967,
-0.9344710111618042,
-0.03158506751060486,
-0.668344974517822... |
def set _ dob ( self, value ) : self. dob = value logging. debug ( " user's dob received " ) | [
0.22546638548374176,
0.22172123193740845,
0.3841818571090698,
0.9225289821624756,
0.24669910967350006,
0.9436153769493103,
0.5591481924057007,
-1.1520508527755737,
0.11847707629203796,
-0.30589818954467773,
-1.1591517925262451,
0.18517115712165833,
-0.08440595865249634,
0.8542184829711914,... |
def pow ( x, y, name = none ) : # pylint : disable = redefined - builtin with ops. name _ scope ( name, " pow ", [ x ] ) as name : return gen _ math _ ops. _ pow ( x, y, name = name ) | [
-0.4561007618904114,
0.19929084181785583,
0.8100169897079468,
0.7539187073707581,
-0.8232780694961548,
-0.5173134207725525,
-0.7815555334091187,
-0.7486273646354675,
-0.600809633731842,
0.9348305463790894,
0.04487385228276253,
0.3444102108478546,
0.8928496241569519,
-0.7511976361274719,
... |
def get _ mfcc _ filter _ points ( fmin, fmax, mel _ filter _ num, fft _ size, sample _ rate ) : fmin _ mel = freq _ to _ mel ( fmin ) fmax _ mel = freq _ to _ mel ( fmax ) mels = np. linspace ( fmin _ mel, fmax _ mel, num = mel _ filter _ num + 2 ) hz = mel _ to _ freq ( mels ) freqs = np. floor ( ( fft _ size + 1 ) /... | [
-0.2641104757785797,
-0.14985805749893188,
0.5742563605308533,
0.36914628744125366,
-0.34163105487823486,
-1.3594118356704712,
-0.28553521633148193,
-0.01850488968193531,
0.2868189215660095,
-0.29393306374549866,
0.3529490530490875,
0.4058048129081726,
0.28376153111457825,
0.43254339694976... |
def add _ merge _ variants _ arguments ( parser ) : parser. add _ argument ( " - vp ", " - - vcf _ pepper ", type = str, required = true, help = " path to vcf file from pepper snp. " ) parser. add _ argument ( " - vd ", " - - vcf _ deepvariant ", type = str, required = false, help = " path to vcf file from deepvariant.... | [
-0.30465200543403625,
-0.32960793375968933,
0.9281837344169617,
-0.4342536926269531,
0.12345690280199051,
0.22967149317264557,
0.0030292836017906666,
0.7408806681632996,
0.06673647463321686,
-0.20052026212215424,
-0.3842191994190216,
0.35691455006599426,
-0.30002301931381226,
0.17515744268... |
def read _ string ( self, address : int, strlen : int, encoding : str = " ascii " ) - > str : self. seek ( address ) return self. read ( strlen ). decode ( encoding ) | [
0.1915941834449768,
-0.6594158411026001,
0.2652987837791443,
-0.8683960437774658,
-1.0535740852355957,
-0.3016318678855896,
-0.6279414296150208,
-0.29703959822654724,
0.48086607456207275,
-0.32001233100891113,
0.36422649025917053,
0.7571566700935364,
0.11903930455446243,
-1.676333427429199... |
def subscribe _ to _ camera ( self, camera ) : if camera = = " left " : callback = self. left _ camera _ callback camera _ str = " / cameras / left _ hand _ camera / image " elif camera = = " right " : callback = self. right _ camera _ callback camera _ str = " / cameras / right _ hand _ camera / image " else : sys. ex... | [
-0.2055937498807907,
0.020154694095253944,
0.38984063267707825,
0.830355167388916,
0.499491810798645,
0.09923791140317917,
-0.512274980545044,
-0.6127618551254272,
0.684477686882019,
-0.2758266031742096,
-0.3008878231048584,
0.5855122208595276,
-0.4494679570198059,
1.3056550025939941,
1.... |
async def set _ max _ defrost ( self, state : int ) - > none : # if car is asleep, climate is already off wake _ if _ asleep = state > 0 data = await self. _ send _ command ( " max _ defrost ", on = state, wake _ if _ asleep = wake _ if _ asleep ) if data and data [ " response " ] [ " result " ] is true : self. _ previ... | [
-0.848508894443512,
0.609146773815155,
0.7225072979927063,
0.13127942383289337,
0.48873552680015564,
0.23724223673343658,
-0.24486318230628967,
0.013706277124583721,
-0.389946311712265,
0.1231900304555893,
-0.7671840786933899,
-0.3086133599281311,
-0.14248953759670258,
0.7739561200141907,
... |
def geobuf _ s3 ( mp _ s3 _ tmpdir ) : with processfixture ( testdata _ dir / " geobuf. mapchete ", output _ tempdir = mp _ s3 _ tmpdir, ) as example : yield example | [
0.8432180285453796,
-0.6474764347076416,
0.4386705160140991,
-0.16273438930511475,
-0.1848730891942978,
1.590935230255127,
0.13985274732112885,
-0.09615160524845123,
0.27461764216423035,
-0.07888304442167282,
-0.23839308321475983,
0.26280057430267334,
0.21826906502246857,
-0.11338320374488... |
def import _ data ( keyword, lang, fields ) : params = ( ('language ', lang ), ) headers = {'accept':'application / vnd. github. mercy - preview + json'} link = github _ api _ endpoint + '? q ='+ build _ query ( keyword, * params ) while link : print ('requesting link { } '. format ( link ) ) response = requests. get (... | [
-0.10187479853630066,
1.2013111114501953,
0.6955532431602478,
-0.5538716912269592,
-0.0751357451081276,
0.08058574795722961,
-1.2251287698745728,
0.041542086750268936,
-0.06619008630514145,
0.07610000669956207,
-1.337658166885376,
0.471239298582077,
-0.47752657532691956,
-0.144039705395698... |
def section _ indices ( self, length ) : start = self. pos % self. elements stop = ( self. pos + length - 1 ) % self. elements return start, stop | [
-1.7847487926483154,
-1.333848476409912,
0.4730585217475891,
-0.9307519197463989,
-0.693604588508606,
0.2515649199485779,
0.5385797619819641,
0.19286923110485077,
0.29638752341270447,
0.42437195777893066,
-1.031216025352478,
-0.6795449256896973,
-0.34318485856056213,
0.28563830256462097,
... |
def get _ string ( text = " enter a string ", prompt = none ) : if prompt : clear _ line _ 23 ( ) response = input ( " { } [ { } ] : ". format ( text, prompt ) ) if not response : response = prompt return response else : while true : clear _ line _ 23 ( ) response = input ( " { } : ". format ( text ) ) if not response ... | [
0.17043335735797882,
-0.6287902593612671,
0.3970724940299988,
0.0082754697650671,
-0.15080825984477997,
0.1740848869085312,
0.33518731594085693,
-0.08899088203907013,
0.9169464707374573,
-0.6284809708595276,
0.1548069715499878,
0.8615546226501465,
-1.0596691370010376,
-1.0904728174209595,
... |
def selectmovie ( self, event ) : movie _ title = self. movies _ tree. selection ( ) [ 0 ] self. canvas. forget ( ) self. scrollbar. forget ( ) individualmovies ( self. master, self. movies _ tree. item ( movie _ title, " text " ), mymovies ) | [
-0.39402690529823303,
-0.7546938061714172,
0.24994032084941864,
0.6604441404342651,
-0.3056248724460602,
0.18713191151618958,
0.07640225440263748,
-0.022425325587391853,
0.4523126780986786,
0.5193747878074646,
-0.2815946340560913,
1.5243234634399414,
-0.6640151739120483,
0.5789840221405029... |
def is _ updated _ between ( self, bucket _ name : str, object _ name : str, min _ ts : datetime, max _ ts : datetime ) - > bool : blob _ update _ time = self. get _ blob _ update _ time ( bucket _ name, object _ name ) if blob _ update _ time is not none : if not min _ ts. tzinfo : min _ ts = min _ ts. replace ( tzinf... | [
-0.17886577546596527,
-1.3184901475906372,
1.0268319845199585,
0.6645791530609131,
-0.36344119906425476,
1.0356907844543457,
-1.5586835145950317,
-0.5791785717010498,
-0.11117993295192719,
0.3608505129814148,
-1.1727944612503052,
1.2692874670028687,
-0.20073091983795166,
-0.882018268108367... |
def w2v _ text _ process ( self, mess ) : clean = [ char if char not in string. punctuation else'' for char in mess ] clean =''. join ( clean ) clean = [ word. lower ( ) for word in clean. split ( ) if word. lower ( ) not in stop _ words. english _ stop _ words ] return clean | [
-0.07321618497371674,
-1.4168254137039185,
0.6463347673416138,
-0.2138684093952179,
-0.3792538046836853,
0.3809741735458374,
-0.5765073299407959,
-0.13518549501895905,
-0.30087774991989136,
1.0532138347625732,
0.6229194402694702,
0.1883847415447235,
-0.3237629532814026,
0.7893402576446533,... |
def get _ trivia ( cursor, hpage _ html, movie _ title, movie _ url ) : print ('花...') # 1. fetch trivia page result = etree. html ( hpage _ html ). xpath ('/ / div [ @ id = " trivia " ] / a [ text ( ) = " see more " ] / @ href') trivia _ url = movie _ url + str ( result [ 0 ] ) logger. debug ('trivia _ url :'+ trivia ... | [
0.13740746676921844,
0.1752479374408722,
0.7926200032234192,
0.6874822974205017,
0.7698582410812378,
-0.1638139933347702,
0.20901182293891907,
0.7602442502975464,
-0.0318627804517746,
0.7979244589805603,
-1.0009921789169312,
-0.6700471639633179,
-0.6602978110313416,
-0.06118229031562805,
... |
def test _ callable _ input ( self, adj ) : objective _ return = ( 0, [ 0 ] ) def custom _ method ( * args, * * kwargs ) : " " " mockup of custom - method function fed to ` ` search ` ` " " " return objective _ return result = dense. search ( graph = adj, nodes = 3, iterations = 10, options = { " heuristic " : { " meth... | [
-0.4098438620567322,
1.142945408821106,
0.3146599233150482,
0.10916602611541748,
0.7920638918876648,
-0.07171551883220673,
0.5763568878173828,
-0.29349300265312195,
0.02113003470003605,
-0.08519967645406723,
0.05935555696487427,
0.10380815714597702,
-0.29591625928878784,
0.2291264533996582... |
def is _ datastore _ analysis _ finished ( ) : if not sel. is _ displayed ( tasks. tasks _ table ) or not tabs. is _ tab _ selected ('all other tasks') : sel. force _ navigate ('tasks _ all _ other') host _ analysis _ finished = tasks. tasks _ table. find _ row _ by _ cells ( {'task _ name': " smartstate analysis for [... | [
-0.015431680716574192,
1.2237615585327148,
0.42352578043937683,
0.1343155950307846,
-0.33819809556007385,
-0.4388262629508972,
0.559154212474823,
0.3213317096233368,
-0.36283549666404724,
0.30096200108528137,
-0.6176661252975464,
-0.10917840898036957,
0.7467942237854004,
0.9118956327438354... |
def trace ( x, name = none ) : with ops. name _ scope ( name, " trace ", [ x ] ) as name : x = ops. convert _ to _ tensor ( x, name = " x " ) return reduce _ sum ( array _ ops. matrix _ diag _ part ( x ), [ - 1 ], name = name ) | [
0.09677793085575104,
1.0458251237869263,
0.8730946779251099,
0.4970698058605194,
0.07155361026525497,
-0.4313937723636627,
0.4747196137905121,
-0.7776854634284973,
1.549740195274353,
0.8262127041816711,
-1.0478452444076538,
-0.012675303965806961,
0.49248936772346497,
-0.9852708578109741,
... |
def top _ inf ( self ) : self. source. ids. top _ message. text = " to visit : { } visited : { } ". format ( self. places. unvisited _ number ( ), self. places. visited _ number ( ) ) | [
-0.9612221717834473,
0.5112612843513489,
0.43078193068504333,
-1.215975046157837,
0.13538484275341034,
0.2008228898048401,
1.2131551504135132,
0.33956679701805115,
-0.21922938525676727,
0.16432759165763855,
-0.176957905292511,
1.1130038499832153,
-0.21497498452663422,
0.031237486749887466,... |
async def setup _ teams ( self ) : self. teamlist = [ team ( * team ) for team in self. teamlist ] | [
-0.3586322069168091,
0.8461321592330933,
0.27577000856399536,
0.08820594102144241,
1.000060796737671,
0.2181531935930252,
-0.300909161567688,
0.2447846531867981,
0.11130223423242569,
-0.12100886553525925,
-0.5436785817146301,
-0.13032183051109314,
0.48315829038619995,
0.5997031927108765,
... |
def tensordot ( a, b, axes, name = none ) : def _ tensordot _ reshape ( a, axes, flipped = false ) : " " " helper method to perform transpose and reshape for contraction op. this method is helpful in reducing ` math _ ops. tensordot ` to ` math _ ops. matmul ` using ` array _ ops. transpose ` and ` array _ ops. reshape... | [
-0.12747704982757568,
-0.15904909372329712,
0.9258485436439514,
-0.7588999271392822,
-0.8032025694847107,
-0.12922900915145874,
0.9835151433944702,
-0.2729450762271881,
0.704826831817627,
0.8264951109886169,
0.34374234080314636,
0.2825343608856201,
0.5788065195083618,
-1.1204603910446167,
... |
def _ _ init _ _ ( self, master, system, solid ) : self. master = master self. fonttype = system. fonttype self. version = system. version self. superfont = get _ superfont ( self. fonttype ) # superscript font self. tframe = frame ( master. tframe ) self. frame = frame ( master. frame ) self. bframe = frame ( master. ... | [
0.5883879065513611,
-0.8836871981620789,
0.5389291644096375,
0.06129845231771469,
-0.45623716711997986,
-0.07246654480695724,
-0.20767006278038025,
-0.6344472169876099,
0.3072035014629364,
-0.8044245839118958,
-0.46100717782974243,
0.10282251238822937,
-0.3266959488391876,
1.07925033569335... |
def refresh ( self ) : # time. sleep ( 1 ) unparsed = str ( self. ser. readline ( ) ) unparsed = unparsed. replace ('\ \ r ','' ). replace ('\ \ n ','' ). replace ('b ','' ). replace ( "'",'' ) self. info = unparsed. split ( ',') # if len ( unparsed. split ( ',') ) < 20 : # print ( " timeout occured " ) # self. ser. re... | [
0.6295465230941772,
-0.9219692945480347,
0.5055674314498901,
-0.29832780361175537,
-0.12488369643688202,
0.46336135268211365,
-0.2568219304084778,
-0.30794745683670044,
-0.21934370696544647,
-0.49777740240097046,
-0.24360182881355286,
0.9350239038467407,
-0.8010616302490234,
0.178124785423... |
def test _ epoch ( ) : pytest. debug _ func ( ) now = time. time ( ) yesterday = nldt. moment ( now - ( 24 * 3600 ) ) tomorrow = nldt. moment ( now + ( 24 * 3600 ) ) wobj = nldt. moment ( now ) # payload assert wobj. epoch ( ) = = int ( now ) # payload assert yesterday. epoch ( ) = = int ( now - ( 24 * 3600 ) ) # paylo... | [
-0.7581683993339539,
0.01728929579257965,
0.4697573184967041,
-0.8492885231971741,
0.0585002638399601,
0.29781147837638855,
-0.9919427633285522,
-0.8307766914367676,
-0.7202630043029785,
-0.8171848058700562,
-0.707343339920044,
-0.05303379148244858,
0.3078211843967438,
1.1254323720932007,
... |
def handlepurchase ( self, track, level ) : # protect against purchases in the gag tutorial if self. toon. getmoney ( ) < = 0 : return ret = self. toon. inventory. additem ( track, level ) if ( ret = = - 2 ) : text = ttlocalizer. gagshoptoomanyprops elif ( ret = = - 1 ) : text = ttlocalizer. gagshoptoomanyofthatgag % t... | [
-0.7465419173240662,
-0.1491675078868866,
0.682125449180603,
0.1391737163066864,
0.7229463458061218,
-0.36438533663749695,
0.16952073574066162,
-0.39573708176612854,
-0.22853168845176697,
0.5898171663284302,
0.4466440677642822,
0.2578395903110504,
0.01404145359992981,
-0.2882230281829834,
... |
def _ _ init _ _ ( self, websession, timeout = default _ request _ timeout, settlement _ point = none, ) : self. _ websession = websession self. _ settlement _ point = settlement _ point self. _ timeout = timeout | [
1.0392041206359863,
0.0787079706788063,
0.3519955575466156,
0.8055714964866638,
-0.08174289017915726,
-0.08563246577978134,
-0.5308849215507507,
0.2272295504808426,
1.2632163763046265,
0.0056201396510005,
-0.583214521408081,
-0.18032577633857727,
0.7524720430374146,
-0.17096124589443207,
... |
def get _ bio ( seqs, entities ) : bios = ['o'] * len ( seqs ) for d in entities : for i in range ( d ['relpos'] [ 0 ], d ['relpos'] [ 1 ] ) : if i = = d ['relpos'] [ 0 ] : bios [ i ] ='b - { } '. format ( d ['entity'] ) else : bios [ i ] ='i - { } '. format ( d ['entity'] ) return bios | [
0.24440769851207733,
-0.38025200366973877,
0.6768282055854797,
0.32948604226112366,
0.1867246925830841,
0.0062758042477071285,
0.016168568283319473,
0.4800914227962494,
0.18427586555480957,
1.3855936527252197,
0.45711269974708557,
0.3104366064071655,
0.22907079756259918,
-0.197634682059288... |
def test _ decode ( self ) : decoder = nexradpy. decoder. load _ file ( self. p94 ) product = decoder. decode ( ) self. assertequal ( product ['message _ header'] ['message _ code'], 94, msg ='unexpected product message _ code.') | [
0.32158374786376953,
0.23825494945049286,
0.3996630609035492,
0.6163480877876282,
0.5037232637405396,
0.11468052864074707,
-0.13926883041858673,
-0.26768261194229126,
0.14910227060317993,
-1.1219593286514282,
-0.41683322191238403,
-0.4157966375350952,
-0.16243095695972443,
0.07936936616897... |
def smart _ activity ( self, user _ count = 6, per _ user _ like = 4, comments = [ ], hash _ tag = " # parashar " ) : # get 3 times the user _ name incase of worst case scenario usr _ counter = 0 users = self. _ extract _ users _ from _ tile ( user _ count * 2 ) shuffle ( users ) for user in users : # try : user _ meta... | [
0.12986095249652863,
0.291233092546463,
0.6862010359764099,
1.382127046585083,
-0.22743429243564606,
0.3440793454647064,
1.1923850774765015,
-0.13201142847537994,
-0.0009544822387397289,
0.29820093512535095,
0.3076091408729553,
0.05047595128417015,
-0.13136997818946838,
0.3384392261505127,... |
def parse ( self, input _ ) : return self. _ enum ( input _ ) | [
-1.2510254383087158,
0.03876293823122978,
0.35831671953201294,
-0.29005277156829834,
-0.31633859872817993,
0.023039119318127632,
-0.0585070475935936,
-0.14359420537948608,
0.8130460977554321,
-0.7957429885864258,
-0.7761414647102356,
0.2119394838809967,
-0.273242324590683,
0.25791063904762... |
def convert _ heic _ to _ jpg ( file, out _ filename ) : cmd = " tifig - v - p " + file + " " + out _ filename os. system ( cmd ) | [
0.4429492950439453,
-0.21686333417892456,
0.5169766545295715,
0.46259698271751404,
0.4199146032333374,
0.044646818190813065,
0.5079044699668884,
1.0453686714172363,
-0.9743537902832031,
1.4343429803848267,
-0.3562222421169281,
-0.0329299122095108,
0.39474138617515564,
0.17179690301418304,
... |
def _ _ init _ _ ( self, task : multitask. multitask, model : union [ tf. keras. model, base _ model. multitaskbasemodel ], global _ step : optional [ tf. variable ] = none, checkpoint _ exporter : optional [ train _ utils. bestcheckpointexporter ] = none ) : # gets the current distribution strategy. if not inside any ... | [
0.33964306116104126,
0.02071342058479786,
0.6081279516220093,
0.8469244837760925,
-0.7085960507392883,
0.1272193342447281,
0.39507487416267395,
0.330890029668808,
-0.3065061569213867,
0.01217999029904604,
0.07625485956668854,
0.13105513155460358,
1.0757180452346802,
0.40330785512924194,
... |
def sort ( self, sort ) : self. _ sort = sort | [
-0.35012108087539673,
0.5386866927146912,
-0.06082264706492424,
0.7636696696281433,
-0.9090026021003723,
0.5602796673774719,
-0.12642166018486023,
-0.3066190183162689,
-0.7588850259780884,
-1.1208827495574951,
-0.8220205307006836,
-0.21080942451953888,
-0.586670458316803,
0.699012935161590... |
def login _ time ( self ) : return self. _ login _ time. value | [
-1.0531830787658691,
-0.4801902770996094,
0.34502190351486206,
0.3362613916397095,
-0.08284315466880798,
0.8606200814247131,
-0.5139456987380981,
-0.4907481074333191,
0.4832129180431366,
0.2916688024997711,
-0.6644336581230164,
0.5289886593818665,
-0.6777829527854919,
-0.5539475679397583,
... |
def test _ atomic _ boolean _ pattern _ 1 _ nistxml _ sv _ iv _ atomic _ boolean _ pattern _ 2 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / boolean / schema + instance / nistschema - sv - iv - atomic - boolean - pattern - 2. xsd ", instance = " nistdata / atomic / bo... | [
-0.2974289059638977,
-0.25359827280044556,
0.6263645887374878,
1.007659912109375,
-0.06368567049503326,
0.6765412092208862,
-0.20377787947654724,
0.07700219005346298,
-0.33267369866371155,
0.7541795969009399,
-0.3846915662288666,
0.20228616893291473,
0.08580059558153152,
-0.349865227937698... |
def _ _ enter _ _ ( self ) : self. start _ t = datetime. datetime. now ( ) self. in _ time = time. time ( ) return self | [
-0.1122848242521286,
-0.6496047377586365,
0.5802648067474365,
-0.3293151259422302,
0.6459172964096069,
0.3772604167461395,
0.23281481862068176,
0.2549685537815094,
-0.43145135045051575,
0.3385091722011566,
-0.019333308562636375,
0.7890869975090027,
-0.2940700948238373,
0.1411203294992447,
... |
def _ rset ( self ) : try : self. rset ( ) except smtpserverdisconnected : pass | [
-0.2984171509742737,
0.47983497381210327,
0.1150331124663353,
-0.726005494594574,
-0.2589696943759918,
-0.6752021908760071,
-0.499222993850708,
-0.6794434189796448,
-0.019483080133795738,
0.750501275062561,
-0.05908593162894249,
0.8624448180198669,
-0.9493176341056824,
-0.6648656725883484,... |
def show _ trailer ( self ) : webbrowser. open ( self. trailer _ youtube _ url ) | [
0.14244942367076874,
-0.4544159471988678,
0.1798582524061203,
-0.39426758885383606,
0.09497952461242676,
0.0965753048658371,
0.5503526329994202,
1.173095941543579,
0.17862559854984283,
-0.19600744545459747,
0.04903123527765274,
1.3818882703781128,
0.5147859454154968,
0.23130980134010315,
... |
def dot _ to _ bbox ( self, width = 30, height = false ) : self. dot _ bbox _ width = width self. dot _ bbox _ height = width if not height else height for cls, coords in self. mask _ coords. items ( ) : for idx, coord in enumerate ( coords ) : if len ( coord ) = = 1 : center _ x = coord [ 0 ] [ 0 ] center _ y = coord ... | [
-1.4234678745269775,
-0.6510781645774841,
0.9512913227081299,
-0.6557981967926025,
0.663559079170227,
-0.2650110125541687,
0.8272867202758789,
-0.5392146110534668,
1.068372130393982,
0.06810545921325684,
-0.7882288098335266,
0.46304813027381897,
0.6265301704406738,
0.14585472643375397,
-... |
def _ tolerance _ check ( self, tolerance, value ) : if tolerance! = none and np. linalg. norm ( value ) < tolerance : print ( " variable update tolerance was reached. terminating search. " ) return true return false | [
0.6212160587310791,
-0.37710505723953247,
0.4729084372520447,
0.321559876203537,
-0.7396041750907898,
0.0629739984869957,
-0.48938995599746704,
-0.6615093350410461,
0.150303915143013,
0.624847948551178,
0.5586398839950562,
-0.6263740658760071,
-0.829600989818573,
-0.8095725774765015,
-0.... |
def sparse _ segment _ sqrt _ n _ v2 ( data, indices, segment _ ids, num _ segments = none, name = none ) : return sparse _ segment _ sqrt _ n ( data, indices, segment _ ids, name = name, num _ segments = num _ segments ) | [
-0.3070933222770691,
-0.8077130317687988,
0.18879501521587372,
0.18725404143333435,
0.04644159600138664,
-0.8908188939094543,
-0.6197757124900818,
-0.15298238396644592,
1.2814908027648926,
0.5197283625602722,
-0.6265012621879578,
0.5257379412651062,
-0.13104023039340973,
-0.842837452888488... |
def update ( self, image ) : raise notimplementederror ('subclass did not override update!') | [
-1.192240595817566,
-0.9088767170906067,
0.30159321427345276,
-0.252089262008667,
-0.5750052332878113,
1.0048201084136963,
0.19300426542758942,
-0.3923397958278656,
0.15652166306972504,
0.08385806530714035,
-0.0905790850520134,
0.07593752443790436,
-0.2654571533203125,
0.9673474431037903,
... |
def load _ report ( self, filename ) : if os. path. isfile ( filename ) : report = parser. junit ( filename ) for suite in report. suites : self. suites. append ( suite ) elif os. path. isdir ( filename ) : # try importing all files in this folder for root, dirs, files in os. walk ( filename ) : for filename in files :... | [
0.7520303726196289,
0.4411025941371918,
0.7637110948562622,
0.7435035705566406,
0.28869274258613586,
0.05984044820070267,
0.759133517742157,
0.5392996668815613,
0.17840257287025452,
-0.6623610258102417,
0.1300981044769287,
-1.0991215705871582,
-0.9429495334625244,
0.851839005947113,
-1.2... |
def test _ add _ favorite ( self ) - > none : user : user = user. objects. create _ user ( email = " test @ mail. com ", password = " password8chars ", first _ name = " firstname ", last _ name = " lastname ", ) product _ code : str = " 3068320115160 " code _ substitute : str = " 3068320115161 " for product in config. ... | [
0.11976652592420578,
1.2589054107666016,
0.7029727697372437,
0.40485021471977234,
0.873355507850647,
0.356012761592865,
-0.39697521924972534,
0.050109706819057465,
0.303333580493927,
-0.15142641961574554,
-1.4912387132644653,
0.6146834492683411,
0.28015848994255066,
-0.0690569207072258,
... |
def generate _ cumulative _ func ( batch _ hist : np. ndarray, batch ) : # normalize the histogram cumulative _ func = np. zeros ( ( batch, batch, 256 ) ). astype ( np. float64 ) # calculate cumulative histogram for idx1 in range ( batch ) : for idx2 in range ( batch ) : total = sum ( batch _ hist [ idx1 ] [ idx2 ] ) c... | [
0.8966256380081177,
0.14137524366378784,
0.6697408556938171,
-0.17442680895328522,
-0.21495039761066437,
-0.493360310792923,
0.4908835291862488,
0.5800069570541382,
0.4965701699256897,
0.64017653465271,
-0.4126289486885071,
0.20601311326026917,
0.3551696538925171,
-0.23333679139614105,
0... |
def deleteplayers ( ) : # sql is a variable containing the sql command used with the database to # protect against sql injection. commit _ flag ='yes'with connect ( commit _ flag ) as c : sql = " truncate players cascade " c. execute ( sql ) | [
0.3392093777656555,
0.3136393129825592,
0.6793955564498901,
0.39913564920425415,
1.4190046787261963,
0.16776426136493683,
0.30431291460990906,
0.4240177869796753,
-0.2693055272102356,
0.644519031047821,
-0.5144655108451843,
0.6466065645217896,
-1.0774284601211548,
-0.207089364528656,
0.7... |
def test _ taxa _ with _ special _ characters ( self ) : taxonomy _ fp = get _ tmp _ filename ( ) f = open ( taxonomy _ fp, " w " ) f. write ( rdp _ id _ to _ taxonomy _ special _ chars ) f. close ( ) self. _ paths _ to _ clean _ up. append ( taxonomy _ fp ) app = rdptaxonassigner ( {'id _ to _ taxonomy _ fp': taxonomy... | [
1.079705834388733,
-1.0828279256820679,
0.5704029202461243,
0.12085005640983582,
0.2020929604768753,
0.7357538938522339,
0.09842699766159058,
0.7632810473442078,
-0.24966667592525482,
0.2188951075077057,
-0.41074371337890625,
0.2980211079120636,
-0.07364066690206528,
-0.3318644165992737,
... |
def read _ bladestructure ( filebase ) : def _ check _ file _ version ( st3d, headerline ) :'''checks the version string of the first line in file : param st3d : the dictionary beeing filled : param headerline : first line if the file. : return : version int, i. e. 1 for a header with'# version 1'''' if'version'in [ ch... | [
0.4868723452091217,
-1.094186782836914,
0.9978230595588684,
-0.6163484454154968,
-0.48681047558784485,
0.6996707916259766,
-0.015543736517429352,
-0.020826999098062515,
-1.0458226203918457,
0.2568080425262451,
0.09180200099945068,
-0.1704230159521103,
0.011597424745559692,
-0.4078564941883... |
def unlink ( self, cr, uid, ids, context = { } ) : for rec in self. browse ( cr, uid, ids, context ) : if rec. state! ='draft': raise osv. except _ osv ( _ ('error'), _ ( " you can not delete record not in the draft state! " ) ) return super ( additional _ fuel, self ). unlink ( cr, uid, ids, context ) | [
-0.06359577178955078,
-0.044017307460308075,
0.35454750061035156,
-0.7346489429473877,
0.078620046377182,
-0.5179253220558167,
0.4943251609802246,
0.8992593288421631,
0.6373621821403503,
-0.1559445708990097,
1.1696877479553223,
0.07554487884044647,
-0.3155677318572998,
0.3860473930835724,
... |
def generateboardsidecordinates ( self ) : upperleft = [ ( n, 0 ) for n in range ( self. boardwidth ) ] upperright = [ ( x, x ) for x in range ( 0, self. boardwidth ) ] lowerleft = [ ( x, 0 ) for x in range ( self. boardwidth - 1, self. boardwidth * 2 - 1 ) ] lowerright = [ ( x, y ) for x, y in zip ( range ( self. boar... | [
-0.4380430281162262,
0.7749617099761963,
0.8265034556388855,
-0.4542432129383087,
-0.03092082403600216,
0.3861198425292969,
0.28898054361343384,
0.4072646498680115,
0.4986378252506256,
-0.3404931128025055,
-1.0278435945510864,
-1.0316566228866577,
-1.1842550039291382,
0.8784128427505493,
... |
def get _ tag _ phase ( self, tag ) : if not isinstance ( tag, str ) : raise typeerror ( " tag must be str. " ) phase = qcirc _ get _ tag _ phase ( self, tag ) return phase | [
-0.4829438328742981,
-0.8538165092468262,
-0.08168063312768936,
-0.48583653569221497,
-0.13918383419513702,
-0.6770949959754944,
-0.5670666098594666,
-1.3087681531906128,
-0.15740887820720673,
-0.20804056525230408,
-0.20237286388874054,
-0.6588900685310364,
-1.1995631456375122,
0.072648108... |
def connect ( self, peer ) : if peer is self : return if peer not in self. peers : self. logger. info ('connecting ', to = peer, time = self. env. now ) self. peers. append ( peer ) peer. connect ( self ) | [
-1.0258677005767822,
-0.4144362211227417,
0.5416378974914551,
0.1803329586982727,
0.5232137441635132,
0.43121224641799927,
-0.8098429441452026,
-0.02139117941260338,
0.4434938132762909,
0.123160220682621,
-0.19476550817489624,
-0.23714569211006165,
-0.7676092386245728,
1.225225806236267,
... |
def _ _ init _ _ ( self, p1, p2, p3 ) : self. p1 = p1 self. p2 = p2 self. p3 = p3 | [
-0.2763819396495819,
-0.18500809371471405,
0.44163453578948975,
0.4756088852882385,
0.3400377035140991,
1.499835729598999,
-0.5201931595802307,
0.6843166947364807,
-0.7626606822013855,
0.4350236654281616,
-0.5816383361816406,
-0.6638519763946533,
-0.9180190563201904,
-0.5573616623878479,
... |
def save ( self, * args, * * kwargs ) : self. asset _ type = " insurance " super ( insurance, self ). save ( * args, * * kwargs ) | [
-0.10252423584461212,
-0.02009481005370617,
0.5442057251930237,
-0.6618919968605042,
0.9506579041481018,
0.24195337295532227,
-0.14086522161960602,
0.4927079379558563,
-0.323769211769104,
0.004744513425976038,
-0.6355927586555481,
0.3664657473564148,
-0.3684968650341034,
-0.002751374850049... |
def add _ list _ to _ user ( cls, user _ id : str, nt _ list : notetonlist ) : user _ id = cls. _ _ fix _ id _ type ( user _ id ) cls. instance. db. create _ list ( user _ id, nt _ list ) | [
-0.7439478635787964,
-0.033452779054641724,
0.31770360469818115,
0.21340590715408325,
0.6689409613609314,
1.251355528831482,
-0.7251110076904297,
-0.3322750926017761,
0.6041415929794312,
0.6161826848983765,
-1.5568913221359253,
-0.15431545674800873,
0.05875349044799805,
0.9842605590820312,... |
def sgx _ get _ ps _ cap ( ) : c _ sgx _ get _ ps _ cap = sgx _ uae _ service _ lib. sgx _ get _ ps _ cap c _ sgx _ get _ ps _ cap. argtypes = [ pointer ( c _ sgx _ ps _ cap ) ] c _ sgx _ get _ ps _ cap. restype = c _ uint c _ ps _ cap = c _ sgx _ ps _ cap ( ) ret = c _ sgx _ get _ ps _ cap ( byref ( c _ ps _ cap ) ) i... | [
-0.3201081156730652,
0.5945720076560974,
0.7387710213661194,
0.42669153213500977,
-0.9698100090026855,
-0.44193318486213684,
-0.5988417863845825,
-0.7578073143959045,
0.45634666085243225,
0.548647403717041,
0.49306175112724304,
0.21345655620098114,
-0.3473837971687317,
-0.6720111966133118,... |
def have _ same _ income _ measure ( calc1, calc2 ) : im1 = calc1. array ('expanded _ income') im2 = calc2. array ('expanded _ income') return np. allclose ( im1, im2, rtol = 0. 0, atol = 0. 01 ) | [
-0.030063476413488388,
-0.2506304979324341,
0.794298529624939,
1.1583856344223022,
-0.6485953330993652,
0.765945553779602,
-0.09697949886322021,
-0.7995847463607788,
0.6339330077171326,
-0.08233363181352615,
0.8252485394477844,
0.28587719798088074,
-0.3699239492416382,
0.38432905077934265,... |
def retract ( self, notes ='' ) : if self. state! = states. pending : raise valueerror, " only pending changes my be retracted. " if self. approver is not none : raise valueerror, " only changes with no approver may be retracted. " self. comments. create ( commenter = self. indexer, text = notes, old _ state = self. st... | [
-0.21972376108169556,
-0.2981660068035126,
0.5719126462936401,
-0.35949525237083435,
0.2286391407251358,
0.39119982719421387,
0.6931241154670715,
0.8361859917640686,
-0.14447103440761566,
-0.12718984484672546,
0.23233650624752045,
0.494907945394516,
-0.9445046782493591,
-0.9311875104904175... |
def cluster _ name _ as _ subdomain ( self, cluster _ name _ as _ subdomain ) : self. _ cluster _ name _ as _ subdomain = cluster _ name _ as _ subdomain | [
0.03506002202630043,
0.060256071388721466,
0.32022902369499207,
0.6233305931091309,
-0.7117732763290405,
0.9823538661003113,
-0.5717834234237671,
0.08598047494888306,
0.44878867268562317,
-0.5033276081085205,
-0.7622858285903931,
0.9826244115829468,
0.4598291516304016,
-0.152906134724617,
... |
def _ get _ default _ postname ( self, user ='' ) : opt = self. env. config. get ('fullblog ','default _ postname') if not opt : return'' # perform substitutions try : now = to _ datetime ( none, utc ). timetuple ( ) name = strftime ( opt, now ) name = name. replace ('$ user ', user ) return name except : self. env. lo... | [
-0.45923662185668945,
0.6977493166923523,
0.5921802520751953,
0.8043391704559326,
-0.49104684591293335,
0.26407063007354736,
-0.0322209969162941,
0.29981982707977295,
-1.0079762935638428,
0.32381361722946167,
-0.1288662701845169,
-0.6219262480735779,
-0.5078241229057312,
0.5228327512741089... |
def getdata ( self ) : return self. _ data | [
-0.46831873059272766,
-0.35995784401893616,
0.2248663753271103,
-0.3133007287979126,
0.0001324896584264934,
1.175565481185913,
-0.24790999293327332,
-0.8737148642539978,
0.4584466218948364,
-2.012464761734009,
-0.45326343178749084,
0.9601668119430542,
-0.06865295022726059,
-0.5666733384132... |
def ensure _ connect ( ) : while ( connect ( tcp _ ip, tcp _ port ) ) : print " timeout " print " connected " | [
0.538009762763977,
-0.16788363456726074,
0.19462239742279053,
-0.0787925273180008,
1.1287349462509155,
0.8150875568389893,
-0.5023455619812012,
-0.36213335394859314,
-1.1335946321487427,
0.8103115558624268,
0.519912600517273,
-0.37107864022254944,
0.14092694222927094,
-0.4440905451774597,
... |
def bresenhamtriangle ( p0, p1, p2, doublescan = true ) : # generalization for triangle if p2 = = none : return bresenhamfunction ( p0, p1 ) # in case the last argument is none just use a plane... iscan, iline, borderpts = _ brestribase ( p0, p1, p2 ) # draw bresenham lines to rasterize the triangle ( draw along y'dire... | [
0.22053273022174835,
0.267694890499115,
0.44853153824806213,
0.7953094840049744,
0.22357283532619476,
-0.3746057450771332,
-0.5163187980651855,
0.0548686757683754,
-0.01603919081389904,
-0.8003528714179993,
-0.7911308407783508,
0.6423866152763367,
0.3480449318885803,
-0.530159056186676,
... |
def color _ splash ( image, mask ) : # make a grayscale copy of the image. the grayscale copy still # has 3 rgb channels, though. gray = skimage. color. gray2rgb ( skimage. color. rgb2gray ( image ) ) * 255 # copy color pixels from the original color image where mask is set if mask. shape [ - 1 ] > 0 : # we're treating... | [
-0.4475864768028259,
0.38366150856018066,
0.5756433010101318,
0.2848581373691559,
0.12263116240501404,
0.045284632593393326,
0.515658438205719,
-0.35915493965148926,
0.37443768978118896,
0.4377075433731079,
0.9996207356452942,
1.0113130807876587,
0.012816216796636581,
0.10578641295433044,
... |
def start _ process ( cmd, delaytime = 1. 0, * * kwargs ) : proc = get _ kernel ( ). run ( start _ and _ delay ( cmd, delaytime, * * kwargs ) ) get _ manager ( ). run _ exit _ handlers ( ) return proc | [
1.234997034072876,
-0.3784886598587036,
0.6592434048652649,
0.6206037998199463,
-0.9206389784812927,
0.32801568508148193,
0.0624961219727993,
0.5512928366661072,
0.5093129277229309,
-0.8685948252677917,
-0.2431681603193283,
0.17116543650627136,
-0.1080983355641365,
0.09015078842639923,
0... |
def stopreactor ( self, data = none ) : print " stopping reactor. " reactor. stop ( ) | [
-0.834022045135498,
-0.7980461716651917,
-0.20087702572345734,
-0.6540527939796448,
0.7300741076469421,
-0.09177154302597046,
-0.4682168662548065,
1.2136691808700562,
-0.609805703163147,
-0.9797535538673401,
-0.719771683216095,
0.6742187142372131,
-1.0023727416992188,
-0.7899795174598694,
... |
def putipv6accesslist ( self, access _ list _ name, access _ list ) : query ='' conn = self. get _ connection ( ) headers = {'content - type':'application / json ','authorization':'a10 % s'% self. sessionid } output = ordereddict ( ) output ['access - list'] = serialize _ access _ list _ json ( access _ list ) payload ... | [
-1.2004233598709106,
-1.278411626815796,
0.6165874004364014,
-0.18573994934558868,
-0.9408088326454163,
-0.6884862780570984,
-0.5555722117424011,
0.0882621482014656,
0.6786860227584839,
1.362512230873108,
-0.6516672372817993,
0.05334838479757309,
-0.7795171737670898,
-0.7154902219772339,
... |
def process _ charging ( self, chargings, chargeday ) : for ( cinfo, _ ), chargeinfo in chargings. items ( ) : if cinfo. user _ id = = settings. our _ company _ id : return # do not charge myself price = chargeinfo. pop ('totalprice') currency = thing. objects. get _ default ( ) contractor = companyinfo. objects. get _... | [
0.17143025994300842,
-0.11206615716218948,
0.6213395595550537,
0.05714073032140732,
0.22403182089328766,
0.33932268619537354,
-0.7343992590904236,
-0.6276509761810303,
-0.46566784381866455,
-0.34209951758384705,
0.10831983387470245,
-0.24965143203735352,
-0.25694960355758667,
0.21358884871... |
def delete ( self, engine _ path, path ) : path = self. vault. normalize ( " / " + engine _ path + " / metadata / " + path ) address = self. vault. vault _ adress + " / v1 " + path # actually run vault logging. info ( " deleting the secret : % s ", address ) self. vault. requests _ request ( " delete ", address, header... | [
0.5865380167961121,
-0.40723612904548645,
0.5549575090408325,
0.4117666184902191,
0.8634548783302307,
-0.018023760989308357,
-1.1129313707351685,
0.6171610355377197,
-0.250943660736084,
1.1341571807861328,
-0.18561486899852753,
1.1568188667297363,
-0.35725846886634827,
-0.8361563086509705,... |
def get _ relation _ type _ cluster ( corpus _ relation ) : relation _ type _ cluster = defaultdict ( set ) for i, x in enumerate ( corpus _ relation ) : if len ( x ) = = 0 : continue for d in x : relation _ type _ cluster [ d ['relation'] ]. add ( ( d ['h'] ['name'], d ['t'] ['name'] ) ) for k, v in relation _ type _ ... | [
-0.5711437463760376,
0.5003944039344788,
0.3935069441795349,
-1.6223489046096802,
0.214387446641922,
-0.0207031462341547,
0.551306962966919,
-0.29391375184059143,
-0.5863131880760193,
0.7863755822181702,
-0.24446579813957214,
0.37160247564315796,
-0.8809786438941956,
-0.4759247303009033,
... |
def _ _ str _ _ ( self ) : if self. v _ count = = 0 : return'empty graph \ n'out ='|'out + =''. join ( ['{ : 2 } '. format ( i ) for i in range ( self. v _ count ) ] ) +'\ n'out + ='-'* ( self. v _ count * 3 + 3 ) +'\ n'for i in range ( self. v _ count ) : row = self. adj _ matrix [ i ] out + ='{ : 2 } | '. format ( i ... | [
0.38861018419265747,
-0.06761594861745834,
0.7109224796295166,
-0.31724733114242554,
-0.5697051882743835,
0.7206040620803833,
-0.12449989467859268,
-0.42494332790374756,
-0.19272679090499878,
0.8272523283958435,
0.8266159296035767,
0.3208847939968109,
-0.27950969338417053,
-0.4160988628864... |
def scaled _ score _ ligands ( self, tolerance ) : hs = self. get _ hotspot ( ) all _ ligs = self. get _ ligands ( ) ligs = { } # score only ligands from chains where we have hotspots info for al in all _ ligs : lchains = self. get _ ligand _ chain ( ligand = al, hotspot _ result = hs ) if set ( lchains ) = = set ( sel... | [
0.2669159471988678,
-1.38120698928833,
0.5845020413398743,
-0.6797567009925842,
0.8085998296737671,
0.6313717365264893,
-0.4238610863685608,
0.31378501653671265,
-0.33803990483283997,
0.21556247770786285,
-0.4952039122581482,
-0.08009359240531921,
0.10199597477912903,
-0.08795589953660965,... |
def get ( self, key, category = none, last = true, limit = 20, consistent _ read = false ) : if category is none : stm = " select * from % s where key ='% s'and creation _ date is not null order by creation _ date desc limit % s " % ( self. dname, key, limit ) else : stm = " select * from % s where key ='% s'and catego... | [
-0.4923838973045349,
1.1225543022155762,
0.7359307408332825,
0.3586116433143616,
0.08630089461803436,
-0.5109671354293823,
-1.0481526851654053,
0.11698059737682343,
-0.23590239882469177,
0.14671829342842102,
1.17489492893219,
0.036257077008485794,
-0.10763528198003769,
-0.5335112810134888,... |
def directory _ files _ md5 ( path : str ) - > list : files = [ ] for file _ in os. listdir ( path ) : file _ dir = os. path. join ( path, file _ ) if not os. path. isdir ( file _ dir ) : files. append ( file _ md5 ( file _ dir ) ) return files | [
0.04167816787958145,
-0.06442621350288391,
0.7020130157470703,
0.6593981981277466,
-0.007423921953886747,
-0.2424694299697876,
0.9406318068504333,
0.17385292053222656,
0.020788153633475304,
0.5943350791931152,
-0.6740532517433167,
-0.5923353433609009,
0.15190115571022034,
0.746115624904632... |
def open ( self ) : # close any open connection if not self. comm = = none : if not self. comm = = 1 : self. comm. close ( ) self. comm = none # open conection if len ( self. config ['galil'] ['simulategalil'] ) : self. comm = 1 retmsg ='simulated galil connection open'elif self. config ['galil'] ['comtype'] in ['seria... | [
-1.0100414752960205,
-0.13108980655670166,
0.64516681432724,
-0.3283410668373108,
-0.06238120049238205,
-0.0338326022028923,
-0.09628284722566605,
-0.03161177784204483,
-0.4339534342288971,
-0.013859959319233894,
0.48083075881004333,
0.0785762146115303,
-0.6545549631118774,
-0.114612996578... |
def comment _ list ( ) : return get _ comment _ model ( ). objects. order _ by ( " - submit _ date " ) [ : 4 ] | [
0.0798816829919815,
-0.6728130578994751,
0.6196279525756836,
0.6257215738296509,
1.340406060218811,
0.08396781235933304,
-0.7063027620315552,
-0.020583586767315865,
-0.7251349687576294,
0.5322170257568359,
-0.6164330244064331,
-0.5704590678215027,
0.275242418050766,
0.27436405420303345,
... |
def reset ( self ) : self. moves = 0 self. complete _ suits = 0 self. _ deck = [ [ i [ 0 ], i [ 1 ], false ] for i in self. _ deck ] self. undo = [ ] random. shuffle ( self. _ deck ) self. piles = [ ] self. board = [ [ ] for i in xrange ( 10 ) ] counter = 0 pile = 0 # set up board while counter < 54 : self. board [ pil... | [
-0.10396405309438705,
0.9150857329368591,
0.7581804990768433,
-0.5406765937805176,
0.6242388486862183,
-0.8662154078483582,
1.4346704483032227,
-0.09053932130336761,
0.05887062847614288,
0.46559473872184753,
-0.6461663842201233,
-0.22527901828289032,
-0.04972700774669647,
-0.09607759118080... |
def lcm _ sm ( m ) : # run the sm using wcq functions lm _ sm. lm _ sm ( m ) q = m. query # print ( " debug : icq _ c = ", q. icq _ c ) idx = 0 for crnt _ noisy _ answer in q. noisy _ answer : if crnt _ noisy _ answer - q. icq _ c > 0 : q. selected _ cond _ index. append ( idx ) idx = idx + 1 print ( " selected _ cond ... | [
0.4491986334323883,
-0.7049099802970886,
0.5645275115966797,
-0.6740614175796509,
-0.09944981336593628,
-0.049430642277002335,
0.40571150183677673,
-0.06613386422395706,
0.04899225011467934,
0.45207107067108154,
0.26697856187820435,
0.23699195683002472,
-0.5355175733566284,
0.7366915345191... |
def freeze ( self ) : self. _ frozen = true return self | [
-0.5562426447868347,
0.05400468781590462,
0.3583287298679352,
0.2647459805011749,
0.3923599421977997,
0.8723171353340149,
1.1756216287612915,
-0.33324113488197327,
-0.29638808965682983,
-0.9666458964347839,
-0.40174320340156555,
0.20508478581905365,
-1.2785691022872925,
-0.0320379137992858... |
def with _ train _ uri ( self, uri ) : b = self. _ copy ( ) b. config ['train _ uri'] = uri return b | [
-0.7789505124092102,
0.352824866771698,
0.6045294404029846,
0.734226405620575,
-0.6716675162315369,
0.4091086983680725,
0.005239987280219793,
0.6882404685020447,
-0.1859022080898285,
-0.6214380264282227,
-0.7516594529151917,
0.3074927031993866,
-0.3677149713039398,
-0.8170722723007202,
-... |
def collect _ queues ( self, mode ) : from queue import queue if isinstance ( mode, str ) = = true : if'server :'in mode : pass elif mode = ='ssh': pass elif mode = ='local': import subprocess proc = subprocess. popen ( ['qstat ','- q'], stdout = subprocess. pipe ) out, err = proc. communicate ( ) if err : logger. erro... | [
0.0987357422709465,
-0.6459778547286987,
0.7641141414642334,
-0.3221285343170166,
0.19102054834365845,
0.954718291759491,
-0.5074141025543213,
-0.7982518076896667,
-0.3922581374645233,
-0.17378835380077362,
-0.4274737238883972,
0.43809059262275696,
0.28044265508651733,
1.176445484161377,
... |
def get ( self, request, pk = none ) : if " username " in request. query _ params : if pk is none : # get the ` user ` based on the username provided by the # ` query _ params ` user = user. objects. get ( username = request. query _ params [ " username " ] ) # filter the ` todo ` items based on this ` user ` todo _ it... | [
-0.8631925582885742,
0.712602436542511,
0.6462200880050659,
0.5375334620475769,
0.030632875859737396,
0.09946690499782562,
0.02672475017607212,
0.6819368600845337,
0.19154171645641327,
-0.5350946187973022,
-0.1482379287481308,
-0.08889253437519073,
0.3850474953651428,
-0.20673447847366333,... |
def extract ( self, extract _ from ) : | [
-0.33370786905288696,
-0.8977149724960327,
0.27836930751800537,
1.1534759998321533,
-0.07301850616931915,
-0.3311740458011627,
-0.050964366644620895,
0.5634667873382568,
-0.2056732177734375,
-0.34947043657302856,
-0.275318443775177,
-0.08970906585454941,
0.8065994381904602,
-0.223776146769... |
def reset _ password ( self, frame, username ) : username = username. get ( ) valid _ reset = true if username = = " " : valid _ reset = false messagebox. showerror ( " error! ", " please enter your username " ) else : database = database ( ) sql _ command = " select username from users where username ='{ }'". format (... | [
0.017611561343073845,
0.5658129453659058,
0.7190139889717102,
0.8408230543136597,
-0.1265207976102829,
-0.40930312871932983,
1.301725149154663,
0.3050064444541931,
0.2501410245895386,
0.7567481994628906,
-0.1920618861913681,
0.6484320163726807,
-0.733123779296875,
0.11608853936195374,
0.... |
def set _ metadata ( self, name, metadata ) : if not isinstance ( name, basestring ) : raise typeerror ( " name must be a str " ) if isinstance ( metadata, basestring ) : raise typeerror ( " metadata should not be a str, but another iterable ( set, list, etc ) " ) metadata and iter ( metadata ) # validate that metadata... | [
-1.222861647605896,
0.205845445394516,
0.43334805965423584,
0.2566070556640625,
0.2052813470363617,
0.07661645859479904,
-1.2503688335418701,
-0.30408576130867004,
-0.48574012517929077,
1.2955361604690552,
-0.214442640542984,
0.38104647397994995,
-0.3045392632484436,
-0.14505141973495483,
... |
def _ _ init _ _ ( self, db ) : self. db = db self. connection = sqlite3. connect ('twitch. db') self. cursor = self. connection. cursor ( ) | [
0.26763346791267395,
0.3348008096218109,
0.23822468519210815,
-0.02217753604054451,
-0.12241089344024658,
0.2997190058231354,
-0.3218781352043152,
0.5836441516876221,
0.5085463523864746,
0.07416321337223053,
-0.2745339274406433,
-0.2720721960067749,
-0.21855507791042328,
1.367927074432373,... |
def save _ traj _ xyz ( xs, symbols, filename, texts = none, unit _ conversion = 1. 0 / units. angstrom _ to _ au, format _ str = " %. 11e " ) : if texts is none : texts = [ " frame % d " % i for i in range ( len ( xs ) ) ] with open ( filename,'w') as fout : for i, x in enumerate ( xs ) : xc = x * unit _ conversion sa... | [
-0.5966867804527283,
-0.13987602293491364,
0.3565271496772766,
0.5121496319770813,
0.3217707872390747,
-0.2270524501800537,
0.5694196224212646,
0.14949363470077515,
-0.17516109347343445,
0.14963527023792267,
-0.5503705143928528,
-0.6878952980041504,
0.02651016227900982,
0.2480792999267578,... |
def check ( ) : if request. method = = " get " : result = db. execute ( " select username from users where username = : name ", name = request. args. get ( " username " ) ) # check if username already exists if not result : return jsonify ( true ) else : return jsonify ( false ) # in case of post to check else : return... | [
-1.1272226572036743,
0.16258516907691956,
0.752778172492981,
0.7524603605270386,
0.6038802862167358,
-0.08065705746412277,
-0.027572162449359894,
-0.42497506737709045,
-0.5439454913139343,
0.5462946891784668,
-0.09447939693927765,
-0.8844051361083984,
-0.34168922901153564,
0.48741927742958... |
def do _ set _ server _ action ( self, args ) : if len ( args ) = = 0 or args is none : print ( " usage set _ server _ action < server id > < action > " ) return sid = args. split ( ) [ 0 ] action = args. split ( ) [ 1 ] if sid = ='' : print ( fore. red + " the server id cannot be empty " + style. reset _ all ) return ... | [
-1.0366309881210327,
-0.4150264859199524,
0.767645001411438,
-0.09042585641145706,
0.45783475041389465,
0.3778107762336731,
-0.22668376564979553,
-0.3538888394832611,
0.7576276659965515,
0.9346871972084045,
-0.8400416374206543,
1.9703001976013184,
-0.7428774237632751,
0.821110188961029,
... |
def train _ nn ( sess, epochs, batch _ size, get _ batches _ fn, train _ op, cross _ entropy _ loss, input _ image, correct _ label, keep _ prob, learning _ rate ) : # todo : implement function # # # training training _ losses = [ ] sess. run ( tf. global _ variables _ initializer ( ) ) print ( " training cycle... " ) ... | [
0.19782902300357819,
0.3123777210712433,
0.7259973287582397,
0.6451217532157898,
0.21191918849945068,
-0.5266109704971313,
0.7384301424026489,
0.23024606704711914,
-0.6679311990737915,
0.45422622561454773,
-0.6412267684936523,
0.5665315389633179,
1.204087734222412,
-0.49365055561065674,
... |
def remake _ dir ( d ) : if tf. io. gfile. exists ( d ) : tf. io. gfile. rmtree ( d ) tf. io. gfile. makedirs ( d ) | [
-0.30072224140167236,
0.7945780158042908,
0.5038562417030334,
-1.0837498903274536,
-0.27167126536369324,
0.6993920207023621,
1.038834810256958,
0.4460830092430115,
-0.014818638563156128,
-0.526401162147522,
-0.26958468556404114,
0.1392388939857483,
0.6647870540618896,
-0.6633987426757812,
... |
async def async _ setup _ entry ( hass : homeassistant, config _ entry : configentry, async _ add _ entities : addentitiescallback, ) - > none : instance = hass. data [ advantage _ air _ domain ] [ config _ entry. entry _ id ] entities : list [ coverentity ] = [ ] if aircons : = instance [ " coordinator " ]. data. get ... | [
0.3924286663532257,
0.09945186972618103,
0.5203012228012085,
0.33853402733802795,
0.7786476016044617,
0.23298916220664978,
-0.1299927681684494,
0.06081840395927429,
1.3169888257980347,
0.49925315380096436,
0.2434585839509964,
-0.004465676844120026,
0.4362887144088745,
0.7612561583518982,
... |
def menu _ selection ( title = " title ", description = ( " stuff ", " more stuff " ) ) : x = 20 y = 6 width = 40 height = len ( description ) + 4 # draw menu rectangle draw _ box ( x, y, width, height, menu _ fore, menu _ back ) # draw horizontal line top draw _ box _ horizontal ( x, y + 2, width, 1, menu _ fore, menu... | [
-0.639085590839386,
-0.02423754334449768,
0.8652363419532776,
-0.39472174644470215,
0.5178940296173096,
0.2745472490787506,
0.03584490716457367,
0.11456041783094406,
-0.45936158299446106,
-0.0402042381465435,
-0.3849014639854431,
0.0899481549859047,
-0.23347297310829163,
-0.062326952815055... |
def testgetcluster ( self, mock _ gke _ api ) : cluster _ mock = googlekubernetesenginetest. mock _ gke _ cluster _ object fake _ gke = googlekubernetesenginetest. fake _ gke api _ cluster _ object = mock _ gke _ api. return _ value. projects. return _ value. locations. return _ value. clusters. return _ value api _ cl... | [
-0.3144649565219879,
0.23635701835155487,
0.3646281063556671,
-0.22864602506160736,
1.8961784839630127,
-0.040697015821933746,
0.37207186222076416,
0.017440583556890488,
0.10635079443454742,
-0.17361664772033691,
0.3111107051372528,
0.5278021693229675,
-0.37849822640419006,
-0.417124420404... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.