text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def volume _ set ( amount ) : key. _ _ track ( ) if key. current _ volume ( ) > amount : for i in range ( 0, int ( ( key. current _ volume ( ) - amount ) / 2 ) ) : key. volume _ down ( ) else : for i in range ( 0, int ( ( amount - key. current _ volume ( ) ) / 2 ) ) : key. volume _ up ( ) | [
-0.11660706251859665,
-0.4424307346343994,
0.6720417141914368,
0.28171053528785706,
0.034439194947481155,
-0.46668702363967896,
0.08925360441207886,
-1.4313905239105225,
-0.6580137610435486,
0.8130375146865845,
0.37827885150909424,
-0.1273471564054489,
-0.2860735058784485,
0.18564224243164... |
def get _ image _ num ( self ) : return int ( self. _ entry [ 2 ] ) | [
-0.9931595325469971,
0.10215423256158829,
0.5748651623725891,
0.25707677006721497,
0.6079416871070862,
-0.3989073634147644,
1.0685105323791504,
0.7682026028633118,
-0.2815035581588745,
-0.45827847719192505,
-0.5763657093048096,
0.8876809477806091,
0.47697821259498596,
0.15085738897323608,
... |
def with _ path ( self, path ) : new _ command = copy. deepcopy ( self ) new _ command. _ paths. append ( str ( path ) ) return new _ command | [
-0.12434189766645432,
-1.0106149911880493,
0.5598582029342651,
0.37171974778175354,
-0.6560836434364319,
0.5570390820503235,
0.0861121118068695,
-0.8431099653244019,
0.4163872301578522,
-0.6780158281326294,
0.02602994814515114,
0.18892981112003326,
-0.35766348242759705,
-0.0825314894318580... |
def marshal ( self ) : return self. _ marshal ( [ self. fragment ] ) | [
0.18447288870811462,
-0.4277288615703583,
0.2889271080493927,
-0.948479413986206,
-0.3292709290981293,
0.008357077836990356,
-1.0608106851577759,
0.08583482354879379,
1.00840163230896,
-1.6467900276184082,
-0.1378035992383957,
0.30525392293930054,
-0.7033554911613464,
-0.5815460085868835,
... |
def get _ roi ( image ) : return image [ 270 : 450, 140 : 480 ] | [
-0.35799747705459595,
-0.2441781759262085,
0.2984262704849243,
-0.5253697633743286,
0.5987969636917114,
-0.599570095539093,
0.15845291316509247,
-0.506023108959198,
0.2587372660636902,
0.43628963828086853,
-0.09084612876176834,
0.4728025197982788,
-0.9351868629455566,
-1.134015679359436,
... |
def do _ what ( self, args ) : args = self. process _ args ( args ) try : print getattr ( self, " config " ) ['% s'% ( args ) ] except : pass | [
-0.7781580686569214,
-0.5963057279586792,
0.692833423614502,
-0.3648538887500763,
0.9672992825508118,
-0.14296497404575348,
-0.3490791320800781,
-0.6876240968704224,
-0.6117055416107178,
0.5757102966308594,
0.3240014910697937,
0.7260773777961731,
-0.05032668635249138,
0.47679445147514343,
... |
def openfile ( fl, type _ str ) : # import pdb ; pdb. set _ trace ( ) if not os. path. isfile ( fl ) : msg. printandexit ('file does not exist : % s'% fl ) fp = util. opencompressfile ( fl ) if fp = = none : err _ msg ( type _ str + fl ) return fp | [
0.45508408546447754,
-0.5232927203178406,
0.622215986251831,
0.4026051461696625,
-0.22746264934539795,
0.9602519869804382,
0.9925639033317566,
-0.10732433944940567,
-1.150757908821106,
-0.21422375738620758,
0.9540584683418274,
0.009443017654120922,
-0.8891053199768066,
-0.4707496464252472,... |
def getnetworklist ( self, session ) : self. getlogger ( ). debug ('getnetworklist ( )') return session. query ( networks ). all ( ) | [
-0.48530879616737366,
0.1630629152059555,
0.27303430438041687,
0.6287973523139954,
0.5829179883003235,
-0.38461193442344666,
-0.6063686609268188,
-0.1693088561296463,
1.473230242729187,
-0.4917352795600891,
-0.8066749572753906,
-0.5678134560585022,
0.6353616714477539,
0.3933640718460083,
... |
def clear _ current _ layer ( ) : layer = rs. currentlayer ( ) clear _ layer ( layer ) | [
-0.3985723555088043,
-1.2662200927734375,
0.2338426411151886,
0.48794373869895935,
-0.051798347383737564,
-0.0004754118272103369,
0.7180845141410828,
-0.8705381155014038,
-0.27110472321510315,
0.26474231481552124,
0.34841078519821167,
1.5109676122665405,
-0.34806907176971436,
0.50252646207... |
def read _ metric ( self ) : return int ( self. traffic _ dropdown. text ( ). split ( '.') [ 0 ] ) | [
-0.23885759711265564,
0.47875452041625977,
0.46036452054977417,
-0.6574060916900635,
-0.49553442001342773,
0.21888203918933868,
0.7729254961013794,
-0.3067713677883148,
-0.6035369038581848,
0.5575974583625793,
1.297385811805725,
-0.4770716726779938,
-0.6053386330604553,
-1.1860095262527466... |
def value ( self, x ) : if x is none : self. _ value = none elif self. type _ cast is not none : self. _ value = self. type _ cast ( x ) else : self. _ value = str ( x ) or none | [
-0.9364999532699585,
-0.30642586946487427,
0.5038954019546509,
-0.7334700226783752,
0.0241603534668684,
-0.4464210569858551,
-0.4361771047115326,
-1.0440700054168701,
0.6764776110649109,
0.2941477298736572,
-1.0488139390945435,
1.4864436388015747,
0.1817288100719452,
0.3161771297454834,
... |
def _ _ repr _ _ ( self ) - > str : # delegate to list, takes care of printing really big lists. # don't return original, it requires inverse op. return repr ( self. _ st ) | [
-0.7060623168945312,
0.10176700353622437,
0.521863579750061,
-0.8366988897323608,
-0.854461669921875,
0.5626773238182068,
0.16011974215507507,
0.18707053363323212,
0.6539934277534485,
0.42547839879989624,
0.03307643532752991,
0.5450506210327148,
0.580504298210144,
-0.41533777117729187,
-... |
def split _ range ( range _ str ) : ranges = [ ] for sub in range _ str. split ( ',') : if'-'in sub : subrange = sub. split ('-') for i in range ( int ( subrange [ 0 ] ), int ( subrange [ 1 ] ) + 1 ) : ranges. append ( i ) else : ranges. append ( int ( sub ) ) return ranges | [
-1.4994782209396362,
-0.16697773337364197,
0.11061619967222214,
0.763696014881134,
0.5546442866325378,
0.19400742650032043,
0.1884794384241104,
0.8607713580131531,
0.07533825933933258,
0.06428852677345276,
-0.7785862684249878,
0.040950365364551544,
-0.6596748232841492,
-0.5953302383422852,... |
def predict ( self, query, threshold = 0. 3, top _ k = none ) : input _ features = convert _ single _ example ( inputexample ( guid = none, text _ a = query, text _ b = none, label = none ), self. params. max _ seq _ len, self. tokenizer ) feed _ dict = { self. model. input _ ids : np. array ( input _ features. input _... | [
-0.9547198414802551,
-0.9088442325592041,
0.7113045454025269,
0.02398335561156273,
-0.5330590009689331,
-0.1844823956489563,
-0.23949962854385376,
0.06696052104234695,
-0.2938750088214874,
-0.04383028671145439,
0.40916141867637634,
0.5149951577186584,
0.10843707621097565,
-0.00358598562888... |
def test _ user _ cannot _ register _ with _ existing _ username ( self ) : res = self. client ( ). post ( self. full _ url ('auth / signup'), data = json. dumps ( self. data [ " user " ] ), content _ type ='application / json') res = self. client ( ). post ( self. full _ url ('auth / signup'), data = json. dumps ( sel... | [
-0.6371226906776428,
1.1789050102233887,
0.546450138092041,
-0.039992738515138626,
0.591610848903656,
0.6283358335494995,
0.5091801881790161,
-0.25123631954193115,
-0.15321581065654755,
0.6103292107582092,
-1.1882431507110596,
0.027231162413954735,
-0.39280515909194946,
0.2578479051589966,... |
def get _ text _ from _ subnode ( self, subnode _ xpath _ expr ) : sub _ node = self. node. find ( subnode _ xpath _ expr ) if sub _ node is not none : return sub _ node. text return none | [
0.668228268623352,
0.07089037448167801,
0.524043619632721,
0.19909873604774475,
-0.9857202172279358,
-0.2614818215370178,
-0.49051544070243835,
-0.10233213007450104,
0.04810534417629242,
0.36434319615364075,
-0.17314395308494568,
1.2380961179733276,
-0.1438073217868805,
-0.8754240870475769... |
def flush _ buffer ( self ) : rc = self. config. resource game _ id = datetime. now ( ). strftime ( " % y % m % d - % h % m % s. % f " ) path = os. path. join ( rc. play _ data _ dir, rc. play _ data _ filename _ tmpl % game _ id ) logger. info ( f " save play data to { path } " ) save _ as _ pickle _ object ( path + "... | [
-0.5929832458496094,
-0.01926710084080696,
0.6191758513450623,
-0.42835280299186707,
1.2892783880233765,
0.9179257154464722,
0.713666558265686,
-0.9392580986022949,
-0.26987406611442566,
0.1924968808889389,
-0.8525437116622925,
0.6800829768180847,
-0.2978981137275696,
0.13007734715938568,
... |
def _ _ eq _ _ ( self, other ) : return self. real = = other. real and self. imag = = other. imag | [
-0.369660347700119,
-1.2004278898239136,
0.5180591344833374,
0.23227329552173615,
-0.011193354614078999,
0.6227090954780579,
0.7450259327888489,
-0.16416184604167938,
0.6476287841796875,
-0.12185700982809067,
-1.0090928077697754,
0.16111576557159424,
-0.25353020429611206,
0.100045837461948... |
def post ( self, request : request ) - > response. response : try : encounter : models. encounter = models. encounter. create _ from _ json ( data = request. data, patient _ profile = request. user. patient _ profile ) except custom _ exceptions. datafornewencounternotprovidedexception as e : return response. response ... | [
0.08629455417394638,
-0.831696093082428,
0.7014835476875305,
0.15135513246059418,
0.45381808280944824,
0.4550505578517914,
0.27970588207244873,
-0.17820043861865997,
0.2635290026664734,
-0.021404895931482315,
-0.3736172914505005,
0.00632419902831316,
-0.04945593327283859,
0.022765368223190... |
def taskflow _ upstream ( task, only _ complete = false ) : tasks = d6tflow. utils. traverse ( task ) if only _ complete : tasks = [ t for t in tasks if t. complete ( ) ] return tasks | [
-0.577423632144928,
0.13368993997573853,
0.6038232445716858,
0.7389686703681946,
-0.9455310106277466,
-0.05332034081220627,
0.8696778416633606,
0.41230979561805725,
-0.2204991579055786,
0.6173733472824097,
-0.23061445355415344,
-0.4876346290111542,
0.7886504530906677,
0.09641487151384354,
... |
def _ get _ props ( name, prop _ map, * * kwargs ) : # look up properties associated with this specific sensor props = prop _ map. setdefault ( name, { } ) # look up properties associated with this class of sensor for key, val in prop _ map. items ( ) : if'*'in key : regex = '. * '. join ( re. escape ( part ) for part ... | [
-0.45452648401260376,
-1.212666630744934,
0.4279276132583618,
-0.09779484570026398,
-0.15932615101337433,
-0.7271766662597656,
-0.5889521241188049,
-0.2703748047351837,
-0.03833219036459923,
-0.1706022173166275,
0.48599088191986084,
-0.8287941813468933,
-0.1315741240978241,
0.1406306326389... |
def target _ design _ member ( self, target _ design _ member ) : self. _ target _ design _ member = target _ design _ member | [
-0.7388138175010681,
0.13959172368049622,
-0.28349173069000244,
0.3685712516307831,
-0.12275282293558121,
1.2483882904052734,
0.6244030594825745,
-0.3521786332130432,
0.011193648912012577,
-0.8039655685424805,
-0.735864520072937,
0.6469771265983582,
1.351580262184143,
-0.5491228699684143,
... |
def has _ non _ source _ parents ( self, asset _ key : assetkey ) - > bool : if self. is _ source ( asset _ key ) : return false return any ( not self. is _ source ( parent _ key ) for parent _ key in self. get _ parents ( asset _ key ) - { asset _ key } ) | [
-1.013674259185791,
0.626294732093811,
0.31386011838912964,
-0.5641911029815674,
-0.728858232498169,
0.3189653754234314,
0.11262970417737961,
-0.7955365180969238,
-0.30205342173576355,
0.47872260212898254,
-0.5558291077613831,
-0.4469567537307739,
-0.6861375570297241,
1.8473793268203735,
... |
def id ( self ) : return self ['id'] | [
0.3267516493797302,
-1.1575915813446045,
0.11428666114807129,
-0.24138711392879486,
1.0130292177200317,
1.009895920753479,
-0.2189236730337143,
0.42012515664100647,
1.504729986190796,
-0.3809349238872528,
-0.4194413721561432,
0.2891385555267334,
-0.2616940140724182,
-0.6510176062583923,
... |
def merge ( g1, g2 ) : g3nslst = list ( set ( g1. vs ['name'] [ : ] ) | set ( g2. vs ['name'] [ : ] ) ) g3 = graph ( 0, directed = true ) g3. add _ vertices ( g3nslst ) g3elst = [ ] for e in g1. get _ edgelist ( ) : g3elst. append ( ( g1. vs ['name'] [ e [ 0 ] ], g1. vs ['name'] [ e [ 1 ] ] ) ) for e in g2. get _ edgel... | [
-0.24073925614356995,
0.14142099022865295,
1.007381558418274,
-0.33577078580856323,
-0.8831419944763184,
0.9315168261528015,
-1.0643079280853271,
0.014516239985823631,
-0.17092308402061462,
0.6804168820381165,
-0.85601806640625,
0.14775171875953674,
0.1582275629043579,
-0.19445136189460754... |
def _ read ( self, command, length, retry _ count = 3 ) : assert hasattr ( self,'_ i2c _ read'), ( " programming error, the read stream has not been initialized " ) assert hasattr ( self. _ i2c _ read,'read'), ( " programming error, the read stream object is not a stream. " ) for i in range ( retry _ count ) : self. _ ... | [
-0.4552024006843567,
-0.793634295463562,
0.5590794086456299,
-0.5136489868164062,
-0.02993600256741047,
-0.5606870055198669,
-0.09534406661987305,
-0.7791844010353088,
-0.18723447620868683,
-0.08964444696903229,
0.39087775349617004,
0.8259905576705933,
-0.7863786220550537,
-0.5567911863327... |
def unbroadcast ( array ) : if array. ndim = = 0 or not hasattr ( array,'strides') : return array new _ shape = np. where ( np. array ( array. strides ) = = 0, 1, array. shape ) return as _ strided ( array, shape = new _ shape ) | [
0.6848287582397461,
-0.4141107201576233,
0.8211778998374939,
-0.19497668743133545,
-0.8704840540885925,
0.536509096622467,
0.6824504733085632,
-0.12333685904741287,
1.4828145503997803,
0.38584068417549133,
0.8413922786712646,
1.0992660522460938,
-0.4872441291809082,
0.9101240634918213,
-... |
def get _ products _ by _ user ( self, user ) : products = self. db. query ( user. select _ sql _ query _ prod ) return products | [
-0.7237945199012756,
0.335586279630661,
0.2837025225162506,
1.4924172163009644,
0.10868310183286667,
0.328506201505661,
0.5757226943969727,
-1.410772442817688,
0.2983247935771942,
0.5951468348503113,
-0.5272009968757629,
0.3016795516014099,
0.03845111280679703,
-0.03414057195186615,
-0.1... |
def getlist ( self, key, default = _ unset ) : if not self. cf. has _ option ( self. main _ section, key ) : if default is _ unset : raise nooptionerror ( key, self. main _ section ) return default s = self. get ( key ). strip ( ) res = [ ] if not s : return res for v in s. split ( ", " ) : v = v. strip ( ) if v : res.... | [
-0.27291378378868103,
0.21131166815757751,
0.5831502079963684,
0.19628524780273438,
0.5685344338417053,
-0.4567388594150543,
-1.2438806295394897,
0.28254544734954834,
-0.02166195586323738,
1.022646427154541,
-0.2891356945037842,
-0.1411011815071106,
-0.551525354385376,
0.5703216195106506,
... |
def get _ road _ mapping ( self, response ) : data = json. loads ( response. body _ as _ unicode ( ) ) for r in data [ " data " ] : item = eventspideritem ( ) rdname = r [ u'roadlinename'] rdid = int ( r [ u'code'] ) content = r [ u'name']. encode ('utf8') occurtime = [ str ( content ). split (',') ] [ 0 ] xy = " { 0 }... | [
-0.7958817481994629,
-0.65934157371521,
1.1612361669540405,
-0.6474614143371582,
-0.14159148931503296,
0.029357807710766792,
-0.13582634925842285,
0.03197498619556427,
-0.43597981333732605,
0.4222704768180847,
-0.6138105988502502,
-0.09649402648210526,
-0.2897934913635254,
0.41752833127975... |
def test _ shuffle ( self ) : n _ tests = 10000 # results [ n _ cards ] [ n _ cards ] rows are each card ( i. e the ace of spades ) and # columns are counts of the number of times the card was shuffled # into that index ( order ) of the deck by the knuth shuffle algo. results = [ [ 0 for n in range ( n _ cards ) ] for ... | [
0.2183406949043274,
0.534119725227356,
0.6317234039306641,
0.32326045632362366,
0.11873632669448853,
-0.07370366901159286,
0.010092325508594513,
0.16750165820121765,
0.21842506527900696,
-0.6122369766235352,
-0.4136865735054016,
0.006565862335264683,
0.5014638304710388,
0.33821210265159607... |
def group _ by ( func, values ) : groups = defaultdict ( list ) for value in values : groups [ func ( value ) ]. append ( value ) return dict ( groups ) | [
0.013877778314054012,
1.3571140766143799,
0.17576849460601807,
-0.10488585382699966,
-0.2586064338684082,
-0.7435699701309204,
0.1757185161113739,
0.3333248198032379,
-1.1289561986923218,
-0.4872281849384308,
0.14723096787929535,
-0.019976485520601273,
0.6561760902404785,
0.924476444721221... |
def test _ email ( self ) : res = self. client ( ). post ( self. full _ url ('auth / signup'), data = json. dumps ( self. data [ " invalid _ email " ] ), content _ type ='application / json') self. assertequal ( res. status _ code, 400 ) | [
-0.28463542461395264,
0.8819558620452881,
0.5959712266921997,
-0.12581129372119904,
0.708545446395874,
1.0390357971191406,
-1.005614161491394,
0.7569347620010376,
-0.07296017557382584,
-0.1394302248954773,
-0.14459870755672455,
0.47961029410362244,
-0.5576282143592834,
-0.412248820066452,
... |
def apply ( self, posting _ id, data ) : response = self. session. post ( self. _ endpoint ( f'/ v0 / postings / { self. site _ name } / { posting _ id }'), data = data ). json ( ) if'ok'in response. keys ( ) and response ['ok'] is false : raise levererror ( response ['error'] ) return response ['applicationid'] | [
-0.09090235084295273,
0.028278319165110588,
0.6032097339630127,
-0.12672065198421478,
-0.6661145091056824,
0.830767035484314,
-0.39568793773651123,
0.15570950508117676,
0.33683785796165466,
0.4930911362171173,
-0.018950410187244415,
0.20141471922397614,
-0.9229679703712463,
0.6921783685684... |
def snapshot _ get _ all _ by _ project ( context, project _ id ) : return impl. snapshot _ get _ all _ by _ project ( context, project _ id ) | [
-0.3012937903404236,
1.1567118167877197,
0.379779577255249,
0.9120372533798218,
-0.04356692358851433,
-0.008733588270843029,
-0.617250919342041,
-0.3948870301246643,
0.17388245463371277,
-0.1878008097410202,
0.042778074741363525,
-0.17013542354106903,
0.4687942564487457,
0.5756305456161499... |
def test _ upload _ attachment ( self ) : perform _ attachment _ upload _ test = libmonzotests. config [ " perform _ attachment _ upload _ test " ] if not perform _ attachment _ upload _ test : return file _ path = os. path. realpath ( _ _ file _ _ ) folder _ path = os. path. dirname ( file _ path ) image _ path = os. ... | [
0.0690261572599411,
-0.1729544699192047,
0.6768336892127991,
-0.1540171504020691,
0.1875160038471222,
0.28163373470306396,
1.0058561563491821,
-0.6886361837387085,
0.276845782995224,
-0.09041067957878113,
0.005490760784596205,
-0.19417907297611237,
-0.12575267255306244,
0.10790639370679855... |
def provision _ blueprint ( self ) : # we don't really deploy the new blueprint. as a poc hack we look for # a running app instance that was created from the blueprint that we're # interested in. name = self. job ['environment'] ['blueprint'] apps = self. client. get _ applications _ metadata ( ) for app in apps : if a... | [
0.5661154389381409,
-0.9947105050086975,
0.4932365119457245,
0.4189234972000122,
0.6270824670791626,
0.41093558073043823,
-0.6821737885475159,
0.11682350188493729,
-0.4169505536556244,
0.957434892654419,
0.019551832228899002,
1.132381796836853,
-0.5539537072181702,
-0.016889002174139023,
... |
def test _ gsuites _ patch ( self ) : pass | [
0.2676531672477722,
0.05225556716322899,
0.3571314513683319,
0.3137567341327667,
0.2931479811668396,
2.3511195182800293,
2.2361254692077637,
0.20548950135707855,
0.3928496241569519,
-0.6463425159454346,
-0.41440197825431824,
0.6541106700897217,
-0.9383396506309509,
0.09585651010274887,
0... |
def get _ nodes ( self, request ) : nodes = [ ] nodes. append ( navigationnode ( _ ('authors'), reverse ('objectapp _ author _ list'),'authors') ) for author in author. published. all ( ) : nodes. append ( navigationnode ( author. username, reverse ('objectapp _ author _ detail ', args = [ author. username ] ), author.... | [
-0.8949753642082214,
0.3908153772354126,
0.2681216895580292,
0.31939560174942017,
0.7562690377235413,
0.4284144639968872,
0.19213974475860596,
0.78875732421875,
0.4195190370082855,
0.15854871273040771,
0.5650720596313477,
0.7408263683319092,
0.9500735402107239,
0.2258685976266861,
-0.520... |
async def recover _ deleted _ key ( self, name : str, * * kwargs : " any " ) - > keyvaultkey : polling _ interval = kwargs. pop ( " _ polling _ interval ", 2 ) recovered _ key = keyvaultkey. _ from _ key _ bundle ( await self. _ client. recover _ deleted _ key ( self. vault _ endpoint, name, * * kwargs ) ) command = pa... | [
-0.2169281244277954,
-0.06490792334079742,
0.7381635308265686,
0.8380069732666016,
-0.34196576476097107,
-0.3401597738265991,
-0.8572403788566589,
-0.7623434662818909,
0.3907707631587982,
-0.37413427233695984,
-0.40559715032577515,
0.2049669474363327,
0.2262144386768341,
-0.546789169311523... |
def return _ adj ( nominal _ group ) : # init k = 1 adj _ list = [ ] # if nominal _ group is empty if not nominal _ group : return [ ] # we assumed that the noun represented by 1 element at the end if nominal _ group [ 0 ] in resourcepool ( ). determinants : while k < len ( nominal _ group ) : if is _ an _ adj ( nomina... | [
-0.8459430932998657,
0.1736568957567215,
0.3586152195930481,
-0.0382351279258728,
-0.7645367383956909,
0.11543834209442139,
-0.45448434352874756,
-0.6302282214164734,
0.41994407773017883,
0.6946038007736206,
0.870305597782135,
0.48350170254707336,
-1.4904216527938843,
1.2433756589889526,
... |
def interval _ var _ dict ( keys, start = none, end = none, length = none, size = none, intensity = none, granularity = none, optional = false, name = none ) : start = _ check _ arg _ interval ( start, " start " ) end = _ check _ arg _ interval ( end, " end " ) length = _ check _ arg _ interval ( length, " length " ) s... | [
-0.6247186064720154,
-0.3090904653072357,
0.7346484065055847,
-0.49917200207710266,
-1.0159993171691895,
0.20144230127334595,
-0.09966682642698288,
-0.09752632677555084,
-1.1594252586364746,
1.349886178970337,
-0.7864596247673035,
0.025944648310542107,
-0.5844106078147888,
0.09889315813779... |
def remove _ bad _ flow _ masks ( masks, flows, threshold = 0. 4 ) : merrors, _ = metrics. flow _ error ( masks, flows ) badi = 1 + ( merrors > threshold ). nonzero ( ) [ 0 ] masks [ np. isin ( masks, badi ) ] = 0 return masks | [
-0.20449961721897125,
-0.9444421529769897,
0.30420970916748047,
0.5970939993858337,
0.23836207389831543,
0.1444084495306015,
-0.016881363466382027,
-0.23370857536792755,
0.20398421585559845,
-0.4145098030567169,
0.17433807253837585,
0.6993278861045837,
-0.23763638734817505,
-0.285091251134... |
def tal _ to _ mni ( foci ) : trans = np. array ( [ [ 0. 9254, 0. 0024, - 0. 0118, - 1. 0207 ], [ - 0. 0048, 0. 9316, - 0. 0871, - 1. 7667 ], [ 0. 0152, 0. 0883, 0. 8924, 4. 0926 ], [ 0. 0, 0. 0, 0. 0, 1. 0 ] ] ). t trans = linalg. pinv ( trans ) foci = np. hstack ( ( foci, np. ones ( ( foci. shape [ 0 ], 1 ) ) ) ) ret... | [
-0.49544793367385864,
-0.7986617088317871,
0.7530809044837952,
-0.4615325927734375,
-0.3313629925251007,
-0.013853832148015499,
-0.014186486601829529,
-0.06277535110712051,
1.2311453819274902,
0.9653687477111816,
-0.6213147044181824,
-0.46365517377853394,
0.811363697052002,
-0.659910976886... |
def _ write _ checkpoint _ metrics ( checkpoint _ path, metrics _ and _ values, eval _ name, current _ metrics ='current. metrics') : path = checkpoint _ metrics _ path ( checkpoint _ path, eval _ name ) experiment _ metrics _ path = checkpoint _ metrics _ path ( checkpoint _ path, eval _ name, file _ name = current _ ... | [
-0.23974041640758514,
-0.481575071811676,
0.32658061385154724,
0.03480437397956848,
0.436204731464386,
0.45458677411079407,
0.547238826751709,
0.25126469135284424,
-1.385018229484558,
0.5134885907173157,
0.21899661421775818,
-0.25787001848220825,
0.5739907026290894,
-0.02844427153468132,
... |
def plot _ nll ( nll _ dict, xlims = none, nstep = 50, ylims = none, decay = false ) : if xlims is none : xmin = 1e - 28 xmax = 1e - 24 else : xmin = xlims [ 0 ] xmax = xlims [ 1 ] xvals = np. logspace ( np. log10 ( xmin ), np. log10 ( xmax ), nstep ) fig = plt. figure ( ) axis = fig. add _ subplot ( 111 ) axis. set _ ... | [
0.7558953166007996,
0.2638032138347626,
0.8527625799179077,
-0.9696519374847412,
-0.9883461594581604,
0.6742152571678162,
-0.9658136963844299,
-0.527493417263031,
0.22737537324428558,
-0.337837815284729,
-0.12735621631145477,
0.16329921782016754,
0.18150420486927032,
0.48090988397598267,
... |
def movecharacter ( self, x, y ) : self. character. move ( x, y ) self. allcharacters. update ( ) | [
-1.195665955543518,
-1.6579482555389404,
0.28458520770072937,
-0.3481141924858093,
-0.9051690697669983,
0.3718946874141693,
-0.9925414323806763,
-0.5707492828369141,
-0.21391308307647705,
0.13813646137714386,
-1.237505555152893,
1.1303740739822388,
-0.06890692561864853,
-0.8571674823760986... |
def _ test ( self, method ) : stream = nativestringio ( ) trialrunner = runner. trialrunner ( reporter. reporter, stream = stream ) test = malformedmethodtests. containmalformed ( method ) result = trialrunner. run ( test ) self. assertequal ( result. testsrun, 1 ) self. assertfalse ( result. wassuccessful ( ) ) self. ... | [
-0.25493377447128296,
0.29913756251335144,
0.3966965079307556,
-0.24447676539421082,
0.28677898645401,
0.3776332437992096,
0.03921546787023544,
0.22551178932189941,
-0.10629302263259888,
-1.0530643463134766,
0.20974960923194885,
-0.34560245275497437,
-0.458520770072937,
0.7167931795120239,... |
def setup _ expt ( expt, ftype ='yaml') : if ftype = ='yaml': cfg = yaml. load ( expt ) else : cfg = expt home = expanduser ('~') expt _ dir ='{ } / energy - py - results / { } '. format ( home, cfg ['expt'] ['name'] ) makedirs ( expt _ dir, exist _ ok = true ) expt _ logger = make _ new _ logger ('expt ', expt _ dir )... | [
-0.42777493596076965,
0.7004144787788391,
0.5042767524719238,
-0.12363515794277191,
-0.6960588097572327,
-0.736431360244751,
0.23079955577850342,
0.48143270611763,
0.6713109612464905,
0.7113731503486633,
0.11557696759700775,
-0.21976524591445923,
-0.45972177386283875,
1.0054558515548706,
... |
def disconnect ( self, conn ) : self. hold ( ) self. clear ( true ) self. labels. pop ( conn, none ) self. inputs. remove ( conn ) self. leninputs = len ( self. inputs ) | [
-0.7718963623046875,
-0.49753788113594055,
0.43316712975502014,
-0.6950333118438721,
-0.21728794276714325,
0.49190381169319153,
-0.28483444452285767,
0.0986180230975151,
-0.022197552025318146,
-0.3852123022079468,
-0.1945185512304306,
-0.6193283796310425,
-0.7268692255020142,
-0.1936604827... |
def testcrosstablerule ( indata, ruledict ) : errors = [ ] if type ( ruledict ['total'] ) = = list : totals = [ indata [ x ] for x in ruledict ['total'] ] x ='{ 0 :. 6f } '. format ( totals [ 0 ] ) minicmplist = [ x for y in totals if'{ 0 :. 6f } '. format ( y )! = x ] if not any ( minicmplist ) : total = totals [ 0 ] ... | [
-0.15574528276920319,
0.3992185592651367,
0.9842891693115234,
-0.8668285608291626,
0.04746061563491821,
0.5181682705879211,
0.42482706904411316,
0.11184113472700119,
-0.17076446115970612,
0.3740065097808838,
-0.0604509599506855,
0.02716176025569439,
-0.28373998403549194,
0.3539622724056244... |
def main ( ) : obj = generalobjectdetection ( ) obj. run _ images ( ) | [
-0.011820661835372448,
-0.026137137785553932,
0.3418789803981781,
1.6114734411239624,
1.1535120010375977,
0.4335411787033081,
1.0970516204833984,
0.25963643193244934,
-0.29156431555747986,
-0.7585775256156921,
-0.3094087541103363,
0.665800154209137,
0.35910168290138245,
0.6400954723358154,... |
def macos _ open _ header ( infile ) : if infile is not none : return open ( infile, " rb " ) # the headers may be in one of these places. bases = [ " / ", ( " / applications / xcode. app / contents / developer / platforms " + " / macosx. platform / developer / sdks / macosx. sdk " ), " / library / developer / commandl... | [
0.386353075504303,
0.09042920172214508,
0.8504615426063538,
0.6985213160514832,
-0.7111296653747559,
0.07649916410446167,
0.6623427867889404,
-0.3650067150592804,
-0.9518722295761108,
-0.6233611702919006,
0.3555806577205658,
-0.47616252303123474,
-0.6496330499649048,
-0.028226453810930252,... |
def _ git ( self, cmd ) : self. ensure _ one ( ) # _ logger. debug ( " git command : git - - git - dir = % s % s ", self. path,''. join ( cmd ) ) _ logger. debug ( " git command : git - - git - dir = % s % s ", self. path, cmd ) cmd = ['git ','- - git - dir = % s'% self. path ] + cmd return subprocess. check _ output (... | [
-0.005690245423465967,
-0.2535940110683441,
0.5162670016288757,
-0.42934930324554443,
-0.15807516872882843,
0.125091090798378,
-0.43600955605506897,
-0.9012517333030701,
-0.03700276091694832,
-0.10380299389362335,
0.4537065029144287,
0.3220070004463196,
-0.3703683912754059,
0.0750753581523... |
def setupclass ( cls ) : cls. _ cluster _ spec = multi _ worker _ test _ base. create _ in _ process _ cluster ( num _ workers = num _ workers, num _ ps = 0 ) | [
0.39371851086616516,
-0.1357717663049698,
0.44045186042785645,
0.2070832997560501,
1.3193755149841309,
-0.0198221355676651,
0.9979784488677979,
0.633211612701416,
-0.09207505732774734,
0.08475209027528763,
0.32351741194725037,
0.3351250886917114,
-0.551953911781311,
0.2720198929309845,
-... |
def smape ( actual, forecast, ae, nan _ flag = true ) : if nan _ flag : return ( np. nansum ( ( ae / ( abs ( forecast ) + abs ( actual ) ) ), axis = 0 ) * 200 ) / np. count _ nonzero ( ~ np. isnan ( actual ), axis = 0 ) else : return ( np. sum ( ( ae / ( abs ( forecast ) + abs ( actual ) ) ), axis = 0 ) * 200 ) / actua... | [
-0.284251868724823,
0.3392738699913025,
0.6535975337028503,
-0.07636810839176178,
-0.8318721055984497,
0.4126143455505371,
-0.25798216462135315,
0.5594397783279419,
0.7977936863899231,
1.4536548852920532,
0.5448927879333496,
-0.04044455289840698,
1.2051522731781006,
-0.0382179394364357,
... |
def gengabor ( sz, omega, theta, func = np. cos, k = np. pi ) : radius = ( int ( sz [ 0 ] / 2. 0 ), int ( sz [ 1 ] / 2. 0 ) ) [ x, y ] = np. meshgrid ( range ( - radius [ 0 ], radius [ 0 ] + 1 ), range ( - radius [ 1 ], radius [ 1 ] + 1 ) ) x1 = x * np. cos ( theta ) + y * np. sin ( theta ) y1 = - x * np. sin ( theta )... | [
0.18161490559577942,
-0.09643696248531342,
0.8132122159004211,
-0.40895456075668335,
-0.33498096466064453,
0.5496088266372681,
0.42135089635849,
0.2164565771818161,
-0.1729702204465866,
0.8685469031333923,
-0.7418328523635864,
0.5309613347053528,
-0.28957292437553406,
0.008750064298510551,... |
def test _ elem _ volume ( ) : # test tet elements recognition and calculation filename = os. path. join ( os. path. dirname ( _ _ file _ _ ), " files _ mesh _ test / unstr. h5m " ) tetmesh = mesh ( mesh = filename ) vols = list ( ) for _ _, _ _, ve in tetmesh : vols. append ( tetmesh. elem _ volume ( ve ) ) assert np.... | [
0.4449957013130188,
-0.0028211495373398066,
0.6073992848396301,
0.31497037410736084,
0.41253626346588135,
0.9933757781982422,
0.44339340925216675,
0.2809007167816162,
-0.01599442958831787,
-0.8207032680511475,
-0.39177748560905457,
-0.5043393969535828,
0.26667073369026184,
0.76214396953582... |
def _ _ init _ _ ( _ _ self _ _, *, classes : mapping [ str,'outputs. labelclassresponse'], allow _ multi _ select : optional [ bool ] = none, display _ name : optional [ str ] = none ) : pulumi. set ( _ _ self _ _, " classes ", classes ) if allow _ multi _ select is not none : pulumi. set ( _ _ self _ _, " allow _ mul... | [
-0.5762247443199158,
-0.37366044521331787,
0.5180245637893677,
-0.1918814778327942,
0.25959256291389465,
0.8438448905944824,
-0.26262542605400085,
-0.47231951355934143,
1.0070114135742188,
-0.009902700781822205,
-0.4640806019306183,
0.08709225058555603,
0.7961371541023254,
-0.5880447030067... |
def filter _ types ( self, types ) : # real signature unknown ; restored from _ _ doc _ _ pass | [
0.0840577632188797,
1.2863552570343018,
0.32720947265625,
0.6660605072975159,
-0.20748260617256165,
0.30562344193458557,
1.0296165943145752,
-1.180842638015747,
-0.02935425378382206,
0.26977360248565674,
-0.11778979003429413,
-0.27717483043670654,
-0.9157810807228088,
0.6467989683151245,
... |
def expand _ sets ( children : sequence [ " rxnode " ] ) - > set [ str ] : values : set [ str ] = set ( ) for child in children : values | = expand _ set ( child ) return values | [
0.17842575907707214,
0.8479039072990417,
0.6245834827423096,
-0.3142454922199249,
-0.5983003973960876,
-0.72440505027771,
-0.32056868076324463,
-0.7200217843055725,
-0.1855217069387436,
-0.15678812563419342,
0.0955808162689209,
-0.6078773140907288,
-0.06767020374536514,
0.190191850066185,
... |
def parse _ slack _ output ( slack _ rtm _ output ) : print slack _ rtm _ output output _ list = slack _ rtm _ output if output _ list and len ( output _ list ) > 0 : for output in output _ list : if output and'text'in output and at _ bot in output ['text'] : # return text after the @ mention, whitespace removed return... | [
0.7624846696853638,
-1.6555699110031128,
0.5989867448806763,
-0.8943480253219604,
-0.6769104599952698,
-0.7675866484642029,
-0.10677031427621841,
-0.7776241898536682,
-1.0441113710403442,
0.33781933784484863,
0.015404793433845043,
-0.09681373089551926,
-0.8075676560401917,
0.51651561260223... |
def mills _ number ( self, player ) : hero _ mills = [ ] villain _ mills = [ ] for l in range ( state. board _ size ) : for r in range ( state. board _ size ) : for c in range ( state. board _ size ) : mill _ cows = self. get _ mill _ coords ( player, l, r, c ) if mill _ cows! = false and mill _ cows not in hero _ mill... | [
-0.26634296774864197,
-0.2711048424243927,
0.9240233302116394,
-0.12435371428728104,
0.3504502773284912,
-0.06768672913312912,
1.1545000076293945,
0.2934023439884186,
0.2553322911262512,
-0.06038295105099678,
-0.917616069316864,
-0.606183648109436,
-0.23752529919147491,
0.483805775642395,
... |
def getconfig ( self, argobjects = [ ], configfilepaths = [ ], config = config ( ), complementpaths = true ) : config = config # print ( " [ debug ] [ configsetup ] ", configfilepaths ) self. initializeconfigwithdefaultvalues ( config ) for configfilepath in configfilepaths : if os. path. exists ( configfilepath ) : se... | [
-0.2960081696510315,
-0.409959614276886,
0.7133578062057495,
0.7305753231048584,
0.9527959227561951,
0.293104350566864,
0.7173648476600647,
0.21770013868808746,
-0.7973941564559937,
0.4819047152996063,
-0.11749511957168579,
-1.1392185688018799,
-0.3443165421485901,
1.0044111013412476,
-0... |
def append _ next _ digit ( self, digit ) : self. cump + = digit | [
0.21132393181324005,
-0.16444845497608185,
0.38147684931755066,
-0.2125595062971115,
-0.19760850071907043,
1.2676212787628174,
0.4529450535774231,
-0.5758827924728394,
1.1333613395690918,
-0.8049522638320923,
-0.0015813231002539396,
0.35638195276260376,
0.19353607296943665,
0.9515671730041... |
def get _ valid _ sources ( model ) : if model in _ valid _ sources _ : return list ( _ valid _ sources _ [ model ]. keys ( ) ) return none | [
-0.5433054566383362,
0.08056146651506424,
0.11432506889104843,
0.28983432054519653,
-0.43534907698631287,
0.10234197229146957,
-0.7018314003944397,
-0.349439412355423,
0.5813049674034119,
-0.00580578064545989,
-1.36676824092865,
-0.5246092677116394,
-0.4889363944530487,
0.07596079260110855... |
def separate _ index ( ix ) : x = lambda ( lambda x : x [ :, : - 1 ] ) ( ix ) index = lambda ( lambda x : x [ :, - 1 ] ) ( ix ) return x, k. cast ( index, dtype ='int32') | [
-1.2498682737350464,
0.343340665102005,
0.41165149211883545,
-0.2531526982784271,
-0.1312965303659439,
-0.22500434517860413,
0.29775407910346985,
-0.5633932948112488,
0.8724227547645569,
0.24592188000679016,
-0.8491560220718384,
0.6313156485557556,
-0.05398352071642876,
-1.1278349161148071... |
def setup ( self ) : self. test _ dir = tempfile. mkdtemp ( ) | [
0.6433863043785095,
-0.3762510418891907,
0.307010680437088,
-0.2977893352508545,
1.4222992658615112,
0.4320409297943115,
1.807098388671875,
0.6359039545059204,
0.2794789969921112,
-0.9115053415298462,
-0.25223851203918457,
-0.39969000220298767,
-0.29421383142471313,
0.2484532594680786,
-... |
def import _ packages ( self, sequence, cur = none ) : pkgs = [ ] pkgdescs = [ ] # the fields that are to be read. other fields are ignored for control in debian. deb822. packages. iter _ paragraphs ( sequence ) : # check whether packages with architectue'all'have already been # imported t = control ['package'] +'_'+ c... | [
-0.5983684659004211,
-0.0501660518348217,
0.5949880480766296,
-0.9663461446762085,
-0.49384257197380066,
-1.0815095901489258,
-0.26524093747138977,
0.6349256634712219,
-0.09716568142175674,
0.7939223051071167,
-1.1169666051864624,
-0.062226735055446625,
0.24888809025287628,
0.4553738236427... |
def run _ pygame ( self ) : running = true pygame. init ( ) # pygame library initialization pygame. key. set _ repeat ( 100, 100 ) # moving player while long pressing on keys pygame. time. clock ( ). tick ( 40 ) # refresh rate self. window = pygame. display. set _ mode ( ( config. window _ size, 600 ) ) # pygame window... | [
-0.6639440655708313,
-0.2847209572792053,
1.0019843578338623,
0.6470251679420471,
0.2600240707397461,
0.8725373148918152,
0.5923473238945007,
-0.48312196135520935,
-0.4398173689842224,
0.5481998324394226,
-0.05892963707447052,
-0.5186362862586975,
-0.6459680795669556,
1.755952000617981,
... |
def generate _ transaction _ hash ( transaction ) : value = str ( transaction. time ) value + = str ( transaction. version ) for tx _ in in transaction. inputs : value + = str ( tx _ in. data. value ) value + = str ( tx _ in. script. _ script ) value + = str ( tx _ in. tx _ hash ) value + = str ( tx _ in. utxo _ idx ) ... | [
0.2681369483470917,
-0.06505493074655533,
0.6023774743080139,
-0.7375813126564026,
-0.8930639624595642,
0.30513709783554077,
-0.6143726110458374,
-0.5433778762817383,
-0.5728985667228699,
0.8332258462905884,
-1.0361260175704956,
-0.22102820873260498,
0.4160066246986389,
-0.3527182340621948... |
def update _ time _ dependent ( self, dt ) : self. current _ time + = dt if self. current _ time > = self. animation _ time : self. current _ time = 0 self. index = ( self. index + 1 ) % len ( self. images ) self. image = self. images [ self. index ] | [
-1.1249362230300903,
-0.10603879392147064,
0.5129734873771667,
0.07561056315898895,
-0.4558263421058655,
0.7422058582305908,
0.6649448275566101,
-0.7643809914588928,
-0.33018815517425537,
0.43702080845832825,
-0.033315304666757584,
0.03747755289077759,
0.046592917293310165,
1.4997898340225... |
def guess _ letter ( self, letter ) : if letter in self. guessed _ letters : return " you have already guessed the letter { }. ". format ( letter ) elif letter not in self. word : self. tries - = 1 self. hangman = data. stages [ self. tries ] self. guessed _ letters. append ( letter ) if self. tries! = 0 : return ( " t... | [
-0.03387130796909332,
0.3661523759365082,
0.6594242453575134,
0.04268697276711464,
0.09175599366426468,
-0.4858642518520355,
0.3329782783985138,
-0.3972250819206238,
0.09912538528442383,
0.879649817943573,
-0.1369842290878296,
0.3689102232456207,
-1.0822608470916748,
0.5000630617141724,
... |
def get _ roc ( scores _ with _ gt, n _ threshs = 400 ) : thresholds = np. linspace ( 0., 4., n _ threshs ) fp _ rates = [ ] tp _ rates = [ ] for threshold in thresholds : fp = 0 tp = 0 for score _ with _ gt in scores _ with _ gt : predict _ same = score _ with _ gt ['score'] < threshold actual _ same = score _ with _ ... | [
0.17121535539627075,
0.17251746356487274,
0.6004497408866882,
0.2072255164384842,
0.9149574041366577,
-0.3286031186580658,
0.08081138879060745,
-0.8566839098930359,
-0.48076343536376953,
1.0204176902770996,
-0.34520119428634644,
-0.42798352241516113,
-0.18140336871147156,
0.058030921965837... |
def to _ var ( tensor, cuda = true ) : if cuda and torch. cuda. is _ available ( ) : return variable ( tensor. cuda ( ) ) else : return variable ( tensor ) | [
0.19213208556175232,
0.3961044251918793,
0.268079936504364,
0.3026290833950043,
-0.3308313488960266,
-0.043908342719078064,
-0.060527198016643524,
-0.8656273484230042,
0.21470828354358673,
0.33804911375045776,
-0.39379560947418213,
1.2577078342437744,
0.6739843487739563,
-0.657588005065918... |
def main ( dataset ) : while true : s = raw _ input ('select : \ n 1. import data array \ n 2. import variable names \ t \ t \ t ( optional ) \ n 3. set uncertainty array \ t \ t \ t ( optional ) \ n 4. assign independent variable \ t \ t ( optional ) \ n 5. assign dependent variable \ t \ t \ t ( optional ) \ n - 0. e... | [
-0.22092951834201813,
-0.5842155814170837,
0.983292818069458,
0.2843635678291321,
-0.5110991597175598,
0.2990611493587494,
0.7718369960784912,
-0.25374457240104675,
-0.24351583421230316,
-0.03552932292222977,
-0.3009297549724579,
0.5967794060707092,
-0.12046138942241669,
-0.654844760894775... |
def _ is _ matching _ arguments ( sgn, args ) : params = sgn. parameters if params is any _ arguments : return true for a, p in zip _ longest ( args, params ) : if a is not none : # accepted if there is a parameter descriptor that is compatible with argument type if not ( p and a. type. is _ kind _ of ( p. type ) ) : r... | [
-0.12720094621181488,
0.34235289692878723,
0.4985734224319458,
0.27578234672546387,
1.0157238245010376,
-0.4007090628147125,
-1.219390869140625,
0.2556060254573822,
-0.8142386078834534,
0.6741171479225159,
0.49564361572265625,
0.41601690649986267,
-0.544630229473114,
1.2148891687393188,
... |
def _ parse _ fend _ pairs ( self, fend _ pairs ) : if not self. silent : print > > sys. stderr, ( " parsing fend pairs... " ), # convert counts into array fend _ array = numpy. empty ( ( len ( fend _ pairs ), 3 ), dtype = numpy. int32 ) i = 0 for name, count in fend _ pairs. iteritems ( ) : fend _ array [ i, 0 ] = nam... | [
-0.14466649293899536,
-0.31616151332855225,
0.732866108417511,
-0.6170922517776489,
-0.5646122694015503,
-0.24072794616222382,
0.6118438243865967,
-0.2836798429489136,
-0.2250066101551056,
-0.017122503370046616,
-0.5684120059013367,
0.37886425852775574,
-0.2056088000535965,
0.3764990568161... |
def winbio _ winbiogetenabledsetting ( jitter ) : ret _ ad, args = jitter. func _ args _ stdcall ( [ " value ", " source " ] ) raise runtimeerror ('api not implemented') jitter. func _ ret _ stdcall ( ret _ ad, ret _ value ) | [
0.15242594480514526,
0.6540638208389282,
0.4331637918949127,
0.6850215792655945,
-0.5816136002540588,
-0.08121998608112335,
0.7722024321556091,
-0.10255728662014008,
0.27364304661750793,
0.5225256681442261,
-0.6855342388153076,
0.28577056527137756,
-1.6069369316101074,
1.0073879957199097,
... |
def test _ hostname _ alias ( self ) : eq _ ( normalize ( " localhost " ) [ 1 ], " localhost " ) eq _ ( normalize ( " myalias " ) [ 1 ], " otherhost " ) | [
0.19691486656665802,
-0.24428929388523102,
0.38160955905914307,
-0.1875639110803604,
0.03885600343346596,
0.7113124132156372,
-0.13357263803482056,
1.1378380060195923,
-0.3027094006538391,
-0.13774622976779938,
-0.3301304280757904,
-0.011126084253191948,
0.06438682973384857,
0.553055584430... |
def kubernetes _ manifest ( ) : exit _ with _ error _ if _ not _ editable _ install ( ) template = template ( ( prefect. _ _ module _ path _ _ / " cli " / " templates " / " kubernetes - dev. yaml " ). read _ text ( ) ) manifest = template. substitute ( { " prefect _ root _ directory " : prefect. _ _ development _ base ... | [
0.21259705722332,
-0.8547241687774658,
0.5953436493873596,
-0.42727744579315186,
-0.00734246801584959,
0.4338148832321167,
-0.7438986897468567,
-0.09211160987615585,
0.0639227032661438,
0.391032874584198,
-0.2601376175880432,
0.8314228653907776,
0.5567247271537781,
0.7213804125785828,
0.... |
def query _ group ( self, options, group _ dn ) : group = self. ldap _ connection. search _ s ( group _ dn, ldap. scope _ subtree, " ( objectclass = * ) ", none ) if group : group = group [ 0 ] if len ( group ) = = 2 and group [ 0 ] and group [ 1 ] : group = group [ 1 ] members = [ ] for member in group [ self. setting... | [
-0.7025121450424194,
0.08026310801506042,
0.5788184404373169,
0.26514965295791626,
0.3274546265602112,
-0.6298613548278809,
-0.3623999357223511,
-0.5440921783447266,
0.20332705974578857,
0.48457401990890503,
0.6026957035064697,
0.7441429495811462,
-0.5607936382293701,
-0.21438345313072205,... |
def find _ sn _ pos ( sentence, begin _ pos ) : if begin _ pos > = len ( sentence ) : return [ ] end _ pos = 1 # if it is a pronoun if sentence [ begin _ pos ] in resourcepool ( ). pronouns : return [ sentence [ begin _ pos ] ] # if there is a nominal group with determinant if sentence [ begin _ pos ] in resourcepool (... | [
-0.4011083245277405,
-1.17963707447052,
0.8440707921981812,
0.15027134120464325,
-0.721458911895752,
-0.4977888762950897,
-0.9082487225532532,
-0.42013201117515564,
0.3235083520412445,
0.6177417635917664,
-0.4710374176502228,
0.18041858077049255,
-0.2135765105485916,
0.2649259865283966,
... |
def write _ predictions ( predictions, folder = predictions _ save _ dir ) : if not os. path. isdir ( folder ) : os. mkdir ( folder ) print ( f " writing predictions in folder { folder } " ) for i, pred in enumerate ( predictions ) : mpimg. imsave ( f " { folder } test _ { i + 1 }. png ", pred, cmap ='gray') | [
-1.8929574489593506,
-0.09941478818655014,
0.44352757930755615,
0.6379387378692627,
0.7512887716293335,
0.8939920663833618,
1.2368030548095703,
0.7237879037857056,
-0.521441638469696,
0.4391899108886719,
-0.5591008067131042,
-0.22149893641471863,
0.02755449339747429,
1.2947009801864624,
... |
def _ _ init _ _ ( self, tool _ inp _ desc, wf _ param _ values, wf _ steps, level, should _ be _ there = false, force _ default = false ) : self. name = tool _ inp _ desc [ " name " ] if " type " not in tool _ inp _ desc : raise valueerror ( f " no type for the parameter { tool _ inp _ desc ['name'] } " ) self. type =... | [
0.2611410617828369,
-0.2723703682422638,
0.41255685687065125,
-0.1007169634103775,
0.4210032522678375,
0.450035035610199,
-0.02153899148106575,
-0.09137309342622757,
-1.283321499824524,
0.4500897228717804,
0.2047813981771469,
0.9789068102836609,
0.0975908562541008,
0.9616761207580566,
-0... |
def quantile ( self, quantile : float ) - > " dataframe " : return wrap _ df ( self. _ df. quantile ( quantile ) ) | [
-0.8410440683364868,
1.0896130800247192,
0.18176749348640442,
0.007595155853778124,
-0.07462970912456512,
-1.3562607765197754,
-0.38274291157722473,
-1.2236828804016113,
-0.38961076736450195,
-0.8929632306098938,
0.8152047395706177,
0.42425021529197693,
-0.4378229081630707,
-1.140572190284... |
def allow _ origins ( self ) - > sequence [ str ] : return pulumi. get ( self, " allow _ origins " ) | [
0.4684213697910309,
0.09785939753055573,
0.5743941068649292,
0.7342473268508911,
0.35299941897392273,
2.229113817214966,
-0.055270735174417496,
0.37878772616386414,
0.6720178127288818,
0.5744693875312805,
-0.46161919832229614,
1.0812476873397827,
0.515485405921936,
-0.45494982600212097,
... |
def setup ( self, main _ config _ location, report _ config _ location ) : self. setup _ analysis _ tool _ portfolio ( main _ config _ location ) self. setup _ report _ gen ( report _ config _ location ) | [
0.27838248014450073,
0.03309160843491554,
0.3396316170692444,
0.10430224239826202,
0.990860104560852,
0.39305296540260315,
1.7006675004959106,
0.33508560061454773,
-0.7921281456947327,
0.14986248314380646,
0.026724187657237053,
-0.4645572006702423,
0.5561612248420715,
-0.03822559863328934,... |
def _ _ init _ _ ( self ) : self. _ username = none self. _ password = none self. _ meters = [ ] self. _ tariff = none self. _ meter _ id = none | [
0.060461658984422684,
-0.7191675901412964,
0.41062232851982117,
0.10347167402505875,
0.6226029396057129,
-0.11571071296930313,
-0.47466710209846497,
-0.3331146836280823,
-0.15594150125980377,
-0.5889994502067566,
-0.9768843054771423,
-0.3495677411556244,
-0.3393397033214569,
1.154632091522... |
def create _ device ( ) : props = dict ( ) props [ " petal " ] = - 1 props [ " device " ] = - 1 props [ " petal _ id " ] = - 1 props [ " device _ id " ] = " none " props [ " device _ type " ] = " none " props [ " cable " ] = - 1 props [ " conduit " ] = " na " props [ " fwhm " ] = 0. 0 props [ " frd " ] = 0. 0 props [ "... | [
-0.36318328976631165,
-0.5569827556610107,
0.7047173380851746,
-0.7040339112281799,
-0.0808715969324112,
0.5381948351860046,
0.18124224245548248,
-0.3978138864040375,
-0.4351309537887573,
-0.4007435441017151,
-0.4241621494293213,
0.15265260636806488,
0.33017998933792114,
0.3122163414955139... |
def assign _ node _ type ( self ) : ds = self. ds rank = ds. mpi. rank size = ds. mpi. size ds. nsmds = int ( os. environ. get ('ps _ smd _ nodes ', np. ceil ( ( size - 1 ) * percent _ smd ) ) ) if rank = = 0 : ds. nodetype ='smd0'elif rank < self. ds. nsmds + 1 : ds. nodetype ='smd'else : ds. nodetype ='bd ' | [
-0.4448050856590271,
0.3029841482639313,
0.3953477144241333,
-0.017458895221352577,
0.06848764419555664,
0.28964054584503174,
0.670648992061615,
-0.07471447438001633,
-0.4144159257411957,
0.28442248702049255,
0.34102863073349,
1.841996192932129,
-0.5119004845619202,
1.6587345600128174,
0... |
def study _ c _ and _ sigma _ gridcv ( c _ range, sigma _ range ) : best _ c, best _ sigma = 0, 0 # placeholders # load the data data = skl. datasets. load _ breast _ cancer ( ) x, y = data [ " data " ], data [ " target " ] # shuffle the data x, y = skl. utils. shuffle ( x, y, random _ state = 1 ) # todo start paramete... | [
0.27121061086654663,
-0.5243397355079651,
0.7628576755523682,
0.11814309656620026,
0.694144606590271,
-0.05884557589888573,
0.027463708072900772,
0.3035812973976135,
-0.4374924898147583,
-0.35487237572669983,
0.04681478440761566,
1.7006810903549194,
-0.1559353470802307,
0.3981272280216217,... |
def retrieve _ target _ handles ( self ) : handles = [ ] if self. contact = ='_ _ all _ _': self. add _ all _ handles ( ) else : for entry in self. chat _ table : number = entry [ 6 ] if re. match ( rf " \ + 1 { self. contact } ", number ) : handles. append ( ( entry [ 0 ], entry [ 6 ], entry [ 1 ] ) ) if len ( handles... | [
-0.6657583117485046,
-0.3232266902923584,
0.47163668274879456,
0.5116696357727051,
0.6949250102043152,
-0.182559534907341,
0.4763290286064148,
-0.5090034008026123,
-0.543790876865387,
-1.1229671239852905,
0.18279863893985748,
-0.28667306900024414,
-0.24321214854717255,
0.1626751720905304,
... |
def worker ( self, batch _ samples = none ) : batch = [ ] for sample in batch _ samples : sample = self. _ sample _ transforms ( sample ) batch. append ( sample ) if len ( batch ) > 0 and self. _ batch _ transforms : batch = self. _ batch _ transforms ( batch ) if len ( batch ) > 0 and self. _ fields : batch = batch _ ... | [
0.16330936551094055,
-0.3001842200756073,
0.683211624622345,
0.8406219482421875,
0.5968842506408691,
-0.3090707063674927,
0.19075579941272736,
0.1491716504096985,
-0.16944654285907745,
-1.1570206880569458,
-0.5405281186103821,
-0.6960407495498657,
-0.5660372376441956,
0.4509214758872986,
... |
def makemove ( self, movable _ statement ) : # # # student code goes here tile = movable _ statement. terms [ 0 ] initx = movable _ statement. terms [ 1 ] inity = movable _ statement. terms [ 2 ] finx = movable _ statement. terms [ 3 ] finy = movable _ statement. terms [ 4 ] # if ( initx = = finx and inity = = finy ) :... | [
-0.0018722200766205788,
-0.5833202600479126,
0.8111544251441956,
-0.029369695112109184,
-0.11258645355701447,
0.13804937899112701,
0.4557534456253052,
0.3537502884864807,
0.3011736273765564,
-0.2887084484100342,
-0.00977223552763462,
0.5067161917686462,
-0.380644291639328,
-0.1892981976270... |
def start ( self ) : schedule. every ( self. configuration. data ['frequency'] ). seconds. do ( self. execute ) | [
-0.022784123197197914,
0.1814015507698059,
0.40847089886665344,
0.8459091186523438,
1.020627737045288,
-0.4684152603149414,
-0.3363998234272003,
0.5260313153266907,
-0.9364669919013977,
0.038581375032663345,
0.33683985471725464,
0.41798481345176697,
0.10638516396284103,
0.5573087334632874,... |
def addoption ( self, option ) : self. options [ option. varname. parametervalue ] = option | [
-0.35212457180023193,
0.051115695387125015,
0.1988593339920044,
0.45275893807411194,
1.0145158767700195,
0.31167280673980713,
0.0022727774921804667,
-0.4152027368545532,
0.7241497039794922,
0.1610233336687088,
-0.25081154704093933,
0.07066824287176132,
-0.378309428691864,
0.798978805541992... |
def bin _ centers ( x ) : return [ ( a + b ) / 2. 0 for a, b in zip ( x [ : - 1 ], x [ 1 : ] ) ] | [
-0.2697905898094177,
-0.6633776426315308,
0.5006336569786072,
0.18131811916828156,
0.8449344635009766,
0.0328066423535347,
-0.4168548583984375,
-0.5112922787666321,
0.6875749826431274,
1.167985439300537,
-0.8282595872879028,
0.422119140625,
0.19909577071666718,
0.04390370100736618,
-0.30... |
def new ( ) : return { " rows " : [ ], " cols " : none } | [
-0.32558879256248474,
-0.729901134967804,
0.3032400906085968,
-0.9983765482902527,
-0.9403880834579468,
-0.779303252696991,
-0.14426492154598236,
-0.5974543690681458,
-0.5081870555877686,
-0.6943448185920715,
-1.243769645690918,
-0.1317042112350464,
0.6907786130905151,
0.6828293800354004,
... |
def magnitude _ orientation ( gx, gy ) : magnitude = np. hypot ( gx, gy ) orientation = ( np. arctan2 ( gy, gx ) * 180 / np. pi ) % 180 return magnitude, orientation | [
-0.8448441028594971,
-0.4073728024959564,
0.43338343501091003,
-1.2229515314102173,
0.27759554982185364,
-0.39056819677352905,
-1.2648979425430298,
-0.9519463181495667,
-0.3631454408168793,
0.6531151533126831,
0.2664373219013214,
0.34024855494499207,
1.1345614194869995,
-0.8373785614967346... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.