text
stringlengths
25
2.19k
embedding
listlengths
768
768
def test _ mac _ vendor _ lookup _ error ( self ) : mac ='b8 : 27 : eb : 00 : 00 : 00'device = device _ tracker. device ( self. hass, timedelta ( seconds = 180 ), true,'test ', mac,'test name') with mock _ aiohttp _ client ( ) as aioclient _ mock : aioclient _ mock. get ('http : / / api. macvendors. com / b8 : 27 : eb ...
[ -0.7738015651702881, 0.3765355348587036, 0.4526030421257019, -0.07837431877851486, 0.19413398206233978, 0.3285450339317322, 0.2090800404548645, 0.15149690210819244, -0.18698489665985107, -0.11993597447872162, -0.0924072265625, 0.3953699767589569, 0.3153286874294281, 0.34780916571617126, ...
def clear _ screen ( self ) : if name = ='nt': _ = system ('cls') else : _ = system ('clear')
[ -0.8917280435562134, 0.35217195749282837, 0.5292417407035828, 0.519172191619873, 0.17947708070278168, 1.0204304456710815, 0.5143945813179016, -1.9473029375076294, 0.18858268857002258, 0.6664211750030518, 0.4998289942741394, 0.9844768047332764, 0.7377426028251648, 1.4141998291015625, 0.24...
def adjust _ learning _ rate ( optimizer, shrink _ factor ) : logging. info ( " \ nadjusting learning rate. " ) for param _ group in optimizer. param _ groups : param _ group [ " lr " ] = param _ group [ " lr " ] * shrink _ factor logging. info ( " the new learning rate is { } \ n ". format ( optimizer. param _ groups ...
[ 0.13603807985782623, -0.3734770119190216, 0.39873814582824707, -0.5855938196182251, -0.033308595418930054, 0.17192359268665314, -0.5438665151596069, 0.33027052879333496, -0.10641470551490784, 0.3101680874824524, 0.9835832715034485, 1.0999590158462524, -0.5693849325180054, 1.46930992603302,...
def _ _ init _ _ ( self, member ) : # list holding category classes self. categories = [ ] # set the member self. setmember ( member ) # get more info on the member self. getperson ( ) # get full info on mp self. getmpinfo ( ) # make sense of the html info, regarding registered intrests self. getmpintrests ( ) print'% ...
[ 0.0780288428068161, -0.5703867673873901, 0.5262419581413269, 0.27266043424606323, 0.03544171527028084, 0.07615121454000473, -0.1966271549463272, -0.4823799431324005, -0.01696178875863552, -1.3502706289291382, -0.3439449667930603, -0.07061143964529037, -0.15692003071308136, 1.29831850528717...
def get _ opt ( name : str, * args : any, * * kwds : any ) - > any : from main. dl. opt import opt _ dict name = name. lower ( ). translate ( str. maketrans ( " ", " ", string. punctuation ) ) return opt _ dict [ name ] ( * args, * * kwds )
[ 0.33512675762176514, -0.035282693803310394, 0.5404423475265503, -1.159253716468811, -0.5496037602424622, -1.2572193145751953, -1.2839943170547485, -0.4276919364929199, -0.44133615493774414, 0.7691247463226318, -0.19451259076595306, 0.44262751936912537, 0.22237692773342133, -0.7671945095062...
def makeextension ( configs = { } ) : return absoluteimageextension ( configs = configs )
[ 0.4698548913002014, -0.010621556080877781, 0.2887824773788452, 0.8332944512367249, -1.112402319908142, 0.13761387765407562, -0.4994478225708008, 0.35215017199516296, 0.9754404425621033, 0.5121247172355652, -0.47285377979278564, 0.5575264096260071, 0.2529979944229126, 0.36667636036872864, ...
def computecenter3d ( points ) : x = 0. y = 0. z = 0. for point in pointlist : x1, y1, z1 = point. getcoordinates ( ) x + = x1 y + = y1 z + = z1 pass den = 1. / len ( pointlist ) x = x * den ; y = y * den ; z = z * den return point3d ( x, y, z )
[ 0.20606912672519684, -0.08425278216600418, 0.5057108998298645, 0.9867812991142273, 0.3054988980293274, 0.7258047461509705, 0.06346532702445984, 0.7545311450958252, 0.9897441864013672, 0.7152154445648193, -0.03170666843652725, -0.45543593168258667, -0.27081775665283203, -0.14398354291915894...
def getobjecttosourcemapping ( source _ files ) : object _ to _ sources = { } for name in source _ files : basename, _ = os. path. splitext ( name ) key = basename + '. o'object _ to _ sources [ key ] = name return object _ to _ sources
[ -1.279933214187622, -0.2585415840148926, 0.7152503728866577, -0.2707185447216034, -0.2550947368144989, 0.08091013878583908, 0.8790043592453003, -0.18984352052211761, 0.1250949651002884, 0.6751808524131775, -1.383626937866211, -0.8855738043785095, 1.1136342287063599, 0.025381097570061684, ...
def parse _ products _ from _ path ( self, infile _ path ) : with open ( infile _ path,'r') as infile : return self. parse _ products ( infile )
[ -0.19913910329341888, -1.2396427392959595, 0.3997195363044739, 0.2790589928627014, -0.38321149349212646, 0.5558144450187683, 0.6026153564453125, -0.3730436861515045, -0.35255321860313416, 0.4101353883743286, -0.7004355788230896, -0.13281118869781494, -0.618965208530426, -0.7713496685028076...
def _ _ attr _ index ( self, attribute : str ) - > optional [ int ] : attr _ index = none for i, ( key _ node, _ ) in enumerate ( self. yaml _ node. value ) : if key _ node. value = = attribute : attr _ index = i break return attr _ index
[ -0.6624323129653931, -0.5898860692977905, 0.3388267457485199, -1.6199551820755005, -0.7146374583244324, -0.9428828954696655, 0.9381011724472046, 0.7884824872016907, -0.5028219819068909, 0.435853511095047, 0.5879485011100769, 0.6890627145767212, 0.7317902445793152, -0.11087770760059357, 0...
def shiftright ( n _ shifts = 1, mode ='train') : def f ( x ) : if mode = ='predict': # do nothing in predict mode, as then the sequence length is 1. return x padded = zero _ pad ( x, ( n _ shifts, 0 ), 1 ) return padded [ :, : - n _ shifts ] return fn ( f'shiftright ( { n _ shifts } ) ', f )
[ -0.7145689129829407, 0.5784654021263123, 0.7323020100593567, 0.867861807346344, -1.0389398336410522, 0.27419570088386536, -0.4190702736377716, -0.9322831034660339, -0.22981159389019012, -0.3292468786239624, 0.15206299722194672, -0.20622049272060394, 0.4475885331630707, 0.10721790045499802,...
def setup _ logging ( ) : log _ format = " % ( levelname ) - 10s % ( asctime ) s % ( funcname ) - 30s % ( lineno ) - 5d : % ( message ) s " log _ level = os. getenv ('log _ level ','info') logging. basicconfig ( level = logging. getlevelname ( log _ level ), format = log _ format )
[ 0.41744711995124817, -0.5115259289741516, 0.608900785446167, -0.17772504687309265, 0.42019662261009216, -0.004150704480707645, -0.633301854133606, 0.1610809564590454, -1.248598575592041, 0.013875377364456654, -0.07418245822191238, -0.055071547627449036, 0.5720074772834778, 1.21958601474761...
def getmove ( self, game, letter ) : raise notimplementederror ( " getmove needs to be implemented! " )
[ -1.3147082328796387, -0.37088459730148315, 0.5861933827400208, 1.0868415832519531, 0.25781160593032837, -0.3912903070449829, -0.5737705230712891, -0.6146604418754578, -0.05418265610933304, 0.49252432584762573, -0.25463181734085083, 0.34209418296813965, -0.5891638994216919, -0.1969831287860...
def load _ community _ levels ( self, force _ update : bool = false ) - > none : community _ levels _ path = os. path. join ( self. dataset, " community. json " ) if not force _ update : try : with open ( community _ levels _ path, " r " ) as flevs : self. community _ levels = json. load ( flevs ) logger. info ( " read...
[ -0.2931429147720337, -0.3002122938632965, 0.5635342597961426, -0.3693496882915497, 0.02882876619696617, -0.29673144221305847, 0.030270665884017944, -0.1546829789876938, -0.5417079329490662, -0.4049839973449707, -0.24227657914161682, -0.5254471898078918, -0.4256880581378937, 0.1739210784435...
def use ( self, caster, scobject ) : return activeability. use ( self, caster, scobject )
[ -0.29005739092826843, -1.6585400104522705, 0.41086509823799133, 0.7452777624130249, -0.5720802545547485, -0.9592984318733215, 0.827553391456604, -0.39613327383995056, 0.9454771876335144, -0.018685994669795036, 0.08354704827070236, 1.0235373973846436, -0.8378590941429138, -0.473371803760528...
def insert _ aligned _ str _ record ( self, device _ id, timestamp, measurements, string _ values ) : if type ( string _ values ) = = str : string _ values = [ string _ values ] if type ( measurements ) = = str : measurements = [ measurements ] data _ types = [ tsdatatype. text. value for _ in string _ values ] request...
[ -0.692298412322998, 0.6140958070755005, 0.503912627696991, -0.6045386791229248, 0.6771280169487, 0.7104368805885315, -0.2077086865901947, -0.03734839707612991, -0.4565678536891937, -0.11294581741094589, 0.04770287126302719, -0.12487170845270157, -1.1370830535888672, 0.5753755569458008, -...
def in _ dir ( self, directory ) : new _ command = copy. deepcopy ( self ) new _ command. _ directory = str ( directory ) return new _ command
[ -0.6448386907577515, -0.7660953402519226, 0.3892638683319092, 0.02945653349161148, -0.6790779232978821, 0.27951547503471375, 0.23738610744476318, -0.21033363044261932, 0.4172586500644684, -0.5526130795478821, 0.1466434895992279, 1.696738839149475, -0.210051491856575, 0.25863954424858093, ...
def update _ ranking ( players ) : elos = [ p. elo for p in players ] rankings = [ sorted ( elos, reverse = true ). index ( elo ) + 1 for elo in elos ] logging. debug ('sum of all elos : { elosum }, elos : { elolist } ranked { r } '. format ( elosum = sum ( elos ), elolist = elos, r = rankings ) ) for p in players : p....
[ -0.7757895588874817, -0.41443461179733276, 0.6814728379249573, -0.029598629102110863, 0.4239167869091034, 0.29153621196746826, 0.09535215049982071, 1.3280795812606812, 0.4985976219177246, 1.2111443281173706, -0.38577157258987427, 0.5365749001502991, 0.23109279572963715, -0.0423415079712867...
def training ( self ) : if self. trainable : return tf. placeholder _ with _ default ( false, shape = ( ) ) return tf. constant ( false )
[ -0.07233451306819916, 1.2691065073013306, 0.27719277143478394, -0.1518295258283615, -0.10101211071014404, 0.5217931866645813, 0.8883728981018066, 0.5378114581108093, -0.8380408883094788, 0.10085923969745636, -0.6430155634880066, -0.9105383157730103, -0.7229853868484497, -1.4318642616271973...
def distort ( xyz _ orig, mean _ sub = " false " ) : print " - - > distorting the lattice " xyz = np. copy ( xyz _ orig ) if mean _ sub : rad = xyz. mean ( ) xyz - = rad if not mean _ sub : rad = max ( sqrt ( sum ( xyz * * 2, 1 ) ) ) # points which will define the triangulation # - careful to ensure that triangulation ...
[ 0.37205299735069275, 0.4682084918022156, 0.8536309003829956, -0.9419317245483398, -0.883060097694397, 0.18094287812709808, 0.0042352634482085705, 0.33375442028045654, 1.2954529523849487, -0.2211793214082718, -0.21029868721961975, -0.054263994097709656, -0.4098156988620758, -0.2804059386253...
def crop ( image, border = 0 ) : left, top, right, bottom = _ border ( border ) return image. crop ( ( left, top, image. size [ 0 ] - right, image. size [ 1 ] - bottom ) )
[ -0.02813335321843624, 0.25129640102386475, 0.40001627802848816, 1.0522960424423218, -0.31458771228790283, 0.07971815764904022, -0.5030993819236755, -1.0332869291305542, 0.4407867193222046, 0.3001544773578644, -0.6524983644485474, -0.23420685529708862, -0.11840733885765076, 0.20587316155433...
def _ calculate _ objective _ weights ( self, point _ with _ higher _ z1 _ value, point _ with _ higher _ z2 _ value ) : w _ 0 = point _ with _ higher _ z2 _ value. z2 ( ) - point _ with _ higher _ z1 _ value. z2 ( ) w _ 1 = point _ with _ higher _ z1 _ value. z1 ( ) - point _ with _ higher _ z2 _ value. z1 ( ) w = w _...
[ -0.31564801931381226, -0.682413637638092, 0.6599345207214355, 0.35118013620376587, -0.7332032322883606, -0.23296160995960236, 1.0582057237625122, -0.9995590448379517, -1.0460857152938843, 1.004919409751892, -0.4866631329059601, -0.1029592752456665, 0.28035178780555725, 0.31387069821357727,...
def readsettings ( self, qsettings, str _ prefix = none ) : # real signature unknown ; restored from _ _ doc _ _ return false
[ -0.7170783877372742, 0.8298325538635254, 0.5510812997817993, 0.23535127937793732, -0.4664541184902191, -0.02482105791568756, 0.17866496741771698, -1.1297932863235474, -0.3666335642337799, -0.14865641295909882, -0.2608385682106018, -0.6166884303092957, -0.8357398509979248, -0.51877850294113...
def get _ approved _ user _ transactions ( cls, user, detailed = false ) : transaction _ details _ list = [ ] user _ transactions = cls. objects. filter ( ( q ( item1 _ _ owner = user ) | q ( item2 _ _ owner = user ) ), is _ approved = true ) for transaction in user _ transactions : transaction _ dict = { " user _ item...
[ -0.10778740048408508, 0.2128179371356964, 0.7107183933258057, 1.0714054107666016, -0.9371942281723022, -0.3342176377773285, -0.3574221432209015, 0.18372780084609985, -0.30717790126800537, 0.818228542804718, -0.698867917060852, 0.20551586151123047, 0.9252148270606995, 0.45050403475761414, ...
def test _ get _ _ anonymous ( self ) - > none : response = self. client. get ( self. path ) self. assertredirects ( response, f'/ auth / login /? next = / subjects / my - subjects / { self. user. pk } / ', )
[ -0.7794029712677002, -0.037808358669281006, 0.41078975796699524, -0.04643604904413223, -0.46644583344459534, 0.8040930032730103, -0.012064643204212189, -0.7510929703712463, 0.1937437504529953, -1.438513994216919, 0.09604353457689285, 1.4588581323623657, 0.41580837965011597, -0.636582434177...
def send _ message ( service, user _ id, message, verbose = false ) : try : message = ( service. users ( ). messages ( ). send ( userid = user _ id, body = message ). execute ( ) ) if verbose : print ('message id : % s'% message ['id'] ) return message except httperror as error : print ('an error occurred : % s'% error...
[ -0.09051728248596191, 0.7054588198661804, 0.34196019172668457, 0.8817286491394043, 0.38910579681396484, 0.13734468817710876, -0.7166495323181152, -0.9388653635978699, -0.49652767181396484, 0.45269888639450073, 1.182005763053894, 1.3377317190170288, -1.3050196170806885, 0.613231360912323, ...
def timetorun ( self ) : pass
[ -0.47251856327056885, -0.05142588168382645, 0.32359176874160767, -0.1842857003211975, 0.8670398592948914, 0.2912777364253998, 0.3123737871646881, 0.18360979855060577, -0.9674175977706909, 0.5136276483535767, -0.6838893890380859, -0.0854112058877945, -0.1777217984199524, 0.6702373027801514,...
def test _ login _ email _ format ( self, * _ ) : # make sure we're logged out self. open ( base _ url +'/ logout') # open / login self. open ( base _ url +'/ login') # enter in a wrong format email and a correct format password self. type ('# email ','notanemail') self. type ('# password ','goodpassword #') # click th...
[ -0.2031985968351364, -0.2777932584285736, 0.6233170628547668, 0.5516209602355957, 0.41327977180480957, 0.3391404151916504, 0.09753363579511642, 0.4150298833847046, -0.2327309101819992, -0.5110346078872681, -0.01230861060321331, 0.5181020498275757, 0.11107444763183594, -0.027386218309402466...
def get _ columns _ for _ table ( self, org _ uuid, table _ uuid ) : # todo ( tony ) enforce check that caller has access to this org q = db. session. query ( columninfo ). filter ( columninfo. table _ info. has ( uuid = table _ uuid ) ) return [ {'uuid': col. uuid,'table _ uuid': table _ uuid,'org _ uuid': org _ uuid,...
[ -0.7911720275878906, -0.6628115773200989, 0.47895029187202454, 0.13089773058891296, 0.9391775131225586, -0.602983295917511, -0.7659217119216919, -0.0420742891728878, -1.2607359886169434, 0.5044431686401367, -1.17532479763031, -0.08356966823339462, 0.48230236768722534, -0.05444599688053131,...
def compute _ distance ( pt _ id _ a, pt _ id _ b ) : pt _ a = np. array ( source. getpoint ( pt _ id _ a ) ) pt _ b = np. array ( source. getpoint ( pt _ id _ b ) ) return np. linalg. norm ( pt _ a - pt _ b )
[ 0.03526902571320534, -0.7352051138877869, 0.32496941089630127, -0.4316490590572357, 0.3224804699420929, 0.09355255216360092, -0.06440635025501251, 0.442350298166275, 0.19278886914253235, 1.0899876356124878, 0.48810023069381714, 0.6041803359985352, -0.051341164857149124, -1.2154453992843628...
def flag _ change ( user _ encoder ) : global control _ flag if user _ encoder = = 1 : control _ flag = true print ( control _ flag ) elif user _ encoder = = 2 : control _ flag = false print ( control _ flag ) else : pass
[ 0.2829139530658722, 0.05527263134717941, 0.39518028497695923, 1.4113796949386597, 0.07343338429927826, 1.2722864151000977, 0.3859073221683502, 0.07299911230802536, -0.6625464558601379, 0.24440981447696686, -1.2371553182601929, 0.8781268000602722, -0.5360921025276184, 0.23146620392799377, ...
def random _ zip ( state ) : global state _ zip if not state in state _ zip : load _ state _ zips ( state ) return random. choice ( state _ zip [ state ] )
[ -0.8979119062423706, -0.7965887188911438, 0.510964572429657, -0.08891187608242035, -0.48118332028388977, -0.19291070103645325, 0.46456342935562134, 0.22809740900993347, 2.0627872943878174, -0.31577667593955994, -0.3294724225997925, 0.005669227335602045, -0.19614720344543457, 0.200664430856...
def insert _ table ( conn, project, sql ) : cur = conn. cursor ( ) cur. execute ( sql, project ) return cur. lastrowid
[ 0.5768024921417236, 0.961687445640564, 0.6572291254997253, 0.5631284713745117, -0.34486550092697144, 0.2407168447971344, -0.34014779329299927, 0.3619994819164276, -0.9833790063858032, 0.02015133574604988, 0.460986465215683, -1.0214818716049194, -1.2113146781921387, 0.1943596601486206, -0...
def find _ prefix ( self, key ) : curr _ node = self. _ root remainder = key for char in key : if char in curr _ node [ 1 ] : curr _ node = curr _ node [ 1 ] [ char ] else : return curr _ node [ 0 ], remainder remainder = remainder [ 1 : ] return curr _ node [ 0 ], remainder
[ -0.49292856454849243, -0.40542319416999817, 0.6459766626358032, -0.3898248076438904, -0.8189340829849243, -0.9361637234687805, -0.28398072719573975, -0.13899590075016022, 0.20083501935005188, 1.1244207620620728, 0.2044626772403717, 0.1600189357995987, -1.4702414274215698, 1.359392881393432...
def use _ echo _ as _ mysqldump ( self ) : self. monkey _ patch ( s3mysqldump,'default _ mysqldump _ bin ','echo')
[ -0.14961165189743042, -0.20559528470039368, 0.4636453688144684, 0.4132576882839203, -0.5058150887489319, 0.865498423576355, -0.614997923374176, -0.2295190542936325, 0.5158843398094177, -0.6973704695701599, -0.3145741820335388, 0.875518798828125, 0.08484958112239838, 0.4379845857620239, 0...
def firefox _ driver ( ) : binary = firefoxbinary ( " / home / sachin / firefox / firefox - bin " ) return webdriver. firefox ( firefox _ binary = binary )
[ 0.5466958284378052, -0.5462905168533325, 0.3246653974056244, 1.2728946208953857, 0.337823748588562, -0.05404016748070717, 0.01021501887589693, 0.04830347001552582, -0.1830749809741974, -1.1573567390441895, -0.5087764859199524, -0.11268144100904465, -0.0036605573259294033, 0.165789589285850...
def rate _ matrix ( self, fr, to ) : if fr! = to : return self. off _ diagional ( fr, to ) diag = 0. for state in self. states : if state! = fr : diag + = self. off _ diagional ( fr, state ) return - diag
[ -0.3851254880428314, 0.27219486236572266, 0.47003573179244995, -0.9315798282623291, 0.9557403326034546, -0.21994812786579132, 0.3873693346977234, -0.35955026745796204, 0.15773847699165344, 0.13835713267326355, 0.7191202044487, 0.31665506958961487, -0.32082274556159973, -0.6214924454689026,...
def csvtoxlsx ( csv _ name, xlsx _ name, directory, floats ) : os. chdir ( directory ) f = open ( csv _ name,'rt') csv. register _ dialect ('commas ', delimiter = ',') reader = csv. reader ( f, dialect ='commas') wb = workbook ( ) dest _ filename = xlsx _ name ws = wb. worksheets [ 0 ] ws. title = xlsx _ name [ : - 5 ]...
[ 0.15736903250217438, -0.38291293382644653, 0.5924839377403259, 0.5031291842460632, -0.711915910243988, 0.46027830243110657, -0.12025701254606247, 0.4733046591281891, 0.5042887926101685, 0.3957751393318176, -0.0886206328868866, 0.3377876579761505, 0.24787697196006775, -0.5232284069061279, ...
def convert _ temperature ( val, old _ scale, new _ scale ) : # convert from ` old _ scale ` to kelvin if old _ scale. lower ( ) in ['celsius ','c'] : tempo = _ np. asanyarray ( val ) + zero _ celsius elif old _ scale. lower ( ) in ['kelvin ','k'] : tempo = _ np. asanyarray ( val ) elif old _ scale. lower ( ) in ['fahr...
[ -0.2842837870121002, -0.6508353352546692, 0.511483907699585, -0.16803328692913055, -0.7894802689552307, -0.5408951640129089, -0.26452991366386414, -0.40541794896125793, -0.9256767630577087, 1.267181634902954, -0.327050119638443, 0.03871694579720497, 0.3104039132595062, 0.6233640909194946, ...
def get _ cog _ help ( cog : commands. cog ) - > discord. embed : out = discord. embed ( title = cog. qualified _ name, description = cog. description ) for cmd _ or _ group in cog. walk _ commands ( ) : # in python 3. 10 this should be a match. if isinstance ( cmd _ or _ group, commands. group ) : out. add _ field ( n...
[ 0.3667457401752472, 0.14434516429901123, 0.5130587816238403, -0.06860541552305222, -0.14140091836452484, -0.374567449092865, 0.5130954384803772, -0.5080813765525818, -0.6418907642364502, 0.22649075090885162, 0.3461979329586029, 0.17931893467903137, 0.6799253821372986, 0.14630843698978424, ...
def writeclustalw ( outfile, mali, line _ width = 60, identifiers = none ) : mali _ width = mali. getwidth ( ) mali _ length = mali. getlength ( ) lines = [ ] for x in range ( 0, mali _ width ) : lines. append ( mali. getrow ( x ). getstring ( ) ) outfile. write ( " clustal w ( 1. 60 ) multiple sequence alignment \ n "...
[ 0.13948792219161987, -0.42689892649650574, 1.0126079320907593, -0.36648428440093994, -0.3868746757507324, -0.1041727289557457, 0.09427914023399353, 0.14967837929725647, 0.1668742597103119, 0.3626192510128021, 0.2905329465866089, 0.3606465756893158, -0.11741361767053604, 0.6061576008796692,...
def solve _ tuple ( expr, vars ) : result = tuple ( solve ( x, vars ). value for x in expr. children ) return result ( result, ( ) )
[ -1.4562433958053589, 0.766663134098053, 0.44704729318618774, -0.040537264198064804, 0.15029488503932953, -1.2505968809127808, -0.7391351461410522, 0.18375343084335327, -1.1322085857391357, 0.031571902334690094, -0.7215856313705444, -1.5669363737106323, -0.0020290391985327005, -0.3216292262...
def test _ depth _ first _ trav _ no _ head ( gr ) : gr. add _ edge ( 1, 2 ) gr. add _ edge ( 1, 3 ) gr. add _ edge ( 2, 4 ) gr. add _ edge ( 2, 5 ) gr. add _ edge ( 3, 6 ) gr. add _ edge ( 3, 7 ) with pytest. raises ( keyerror ) : gr. depth _ first _ traversal ( 12 )
[ -0.23343220353126526, 1.8091446161270142, 0.7541062831878662, 0.1540977507829666, 0.1713225543498993, 0.18576784431934357, 1.3060660362243652, -0.7167609930038452, -0.4232751727104187, -0.49572017788887024, -0.95237135887146, 0.15684382617473602, 0.12884223461151123, 0.35870522260665894, ...
def validate _ password ( self, password ) : if password = = " " : flash ( " the password is empty ", " danger " ) raise validationerror ( " " )
[ 1.5023905038833618, 0.8186561465263367, 0.1726817786693573, 0.7807368040084839, 0.774852454662323, 0.4829622805118561, 0.013543250970542431, 0.4367719888687134, 0.366301953792572, -0.04263373464345932, 0.2592935860157013, 0.28371259570121765, -0.1673622727394104, 1.1957045793533325, -0.3...
def handle _ url ( url, session, res ) : print ( " parsing ", url, file = sys. stderr ) try : data = getpagecontent ( url, session ) except ioerror as msg : print ( " error : ", msg, file = sys. stderr ) return for match in url _ matcher. finditer ( data ) : shortname = match. group ( 1 ) name = unescape ( match. group...
[ 0.0762249305844307, -0.8893527388572693, 0.8097693920135498, -0.3814530670642853, -0.4329781234264374, -0.2894871234893799, -0.1338137984275818, -0.42621666193008423, 0.18215511739253998, -0.3829188048839569, -0.5705918073654175, -1.0249180793762207, 0.11045664548873901, 0.0297134220600128...
def check _ valid _ square ( self, coord ) : # using try, except to make sure indexing out of bounds doesn't crash # the program. try : # makes sure indexes > 0 and < dimensions. check _ lower _ bound = all ( coord _ part > = 0 for coord _ part in coord ) comp _ zip = zip ( coord, self. dimension ) check _ upper _ boun...
[ -0.2991909682750702, -0.45984017848968506, 0.8330134749412537, 0.7697333097457886, -0.2903285026550293, 0.5597543716430664, 0.6087167263031006, -0.7144261002540588, -0.36357468366622925, -0.11679438501596451, -0.43415048718452454, -0.11184126883745193, -0.7920721173286438, 0.64417576789855...
def is _ tty ( ) : if not hasattr ( sys. stdout, " isatty " ) : return false return sys. stdout. isatty ( )
[ -0.20741881430149078, 0.11391187459230423, 0.4562601149082184, 0.10085470229387283, -0.29334864020347595, -1.337222933769226, -0.8174954056739807, -1.0780516862869263, 0.2365318387746811, -0.25884154438972473, 0.19257372617721558, -0.030009441077709198, 0.20631146430969238, 0.0038180511910...
def fill _ iso _ lang ( df ) : df. iso _ lang = df. language. apply ( lambda l : cfg. lang _ map. get ( l, cfg. lang _ map ['default'] ) ) return df
[ -0.2773028016090393, 0.5188547372817993, 0.2552436888217926, 1.1178776025772095, 0.7305348515510559, -0.1294379085302353, -0.38699015974998474, 0.4939078688621521, -0.3128048777580261, 0.5340056419372559, -0.17284643650054932, -0.5506913661956787, 0.5050548911094666, -0.032428059726953506,...
def add _ job ( self, mplmp, name ='noname ', job _ dir = '.') : lmp _ inp = mpintlammpsinput ( mplmp, self. qadapter, self. logger ) job = mpintlammpsjob ( self. job _ cmd, name = name, final = true, parent _ job _ dir = self. parent _ job _ dir, job _ dir = job _ dir, vis = lmp _ inp, wait = self. wait, vjob _ logger...
[ 0.4733876585960388, -0.6560223698616028, 0.6226178407669067, -0.3828037679195404, -0.27029097080230713, 1.3003700971603394, -0.5164820551872253, 0.6172301769256592, 0.8979417681694031, -0.6938245892524719, -0.2974802255630493, -0.18088848888874054, -1.6423143148422241, -0.02750721201300621...
def read _ img ( img _ no ) : return mpimg. imread ('images /'+ str ( img _ no ) + '. jpg')
[ -0.7386870384216309, -0.10570678114891052, 0.5087084770202637, -0.08419011533260345, -1.2000683546066284, 0.025277765467762947, 0.482937753200531, 0.4403899610042572, -0.33468136191368103, -0.2012706845998764, 0.8833754062652588, 0.43150344491004944, 0.3582023084163666, 0.07552795857191086...
def getstatus ( ) : andor _ solis. getstatus. restype = ctypes. c _ uint status = ctypes. c _ int ( ) result = andor _ solis. getstatus ( ctypes. byref ( status ) ) check _ status ( result ) return str ( _ sc [ int ( status. value ) ] )
[ -0.06916124373674393, -0.5136324763298035, 0.3920256495475769, 0.3612675368785858, -0.7724728584289551, -0.6108325719833374, -0.14424565434455872, -0.16737768054008484, 1.1371233463287354, -0.13414104282855988, 0.2872222661972046, 0.4435144066810608, 0.31584203243255615, -0.471408426761627...
def open ( file, mode ='r ', buffering = - 1, encoding = none, errors = none, newline = none, closefd = true, opener = none ) : pass
[ -0.497494101524353, -0.010077414102852345, 0.7373685240745544, 0.5768318772315979, -1.457655429840088, 0.42150789499282837, 0.9951929450035095, 0.8736645579338074, -0.44277310371398926, -1.4770698547363281, -0.09503316134214401, 0.12023471295833588, 0.23777425289154053, -0.0605101250112056...
def _ is _ in _ game _ bounds ( self, block ) : return not ( block [ 0 ] < 0 or block [ 0 ] > self. _ game _ state. get _ width ( ) - 1 or block [ 1 ] < 0 or block [ 1 ] > self. _ game _ state. get _ height ( ) - 1 )
[ -0.9859839677810669, -0.7610338926315308, 0.9117379784584045, 0.45075640082359314, -0.4619063138961792, 0.5030813217163086, -0.8898173570632935, -1.40788733959198, 0.03104725107550621, 0.6373834609985352, -0.46009403467178345, 0.13473671674728394, -1.1548328399658203, 1.0968352556228638, ...
def enabled ( self ) - > pulumi. output [ optional [ bool ] ] : return pulumi. get ( self, " enabled " )
[ 1.0016257762908936, 0.22607803344726562, 0.2956129312515259, 1.1012401580810547, 0.627191960811615, 0.862721860408783, -0.16413545608520508, 1.0674139261245728, 0.4745488166809082, 0.010617299005389214, -0.45156583189964294, 0.6789618730545044, -1.0025514364242554, -0.8480234146118164, -...
def markages ( self ) : self. cid _ ages = self. meta [ ['cohortid ','date ','ageyrs'] ]. \ drop _ duplicates ( ). \ groupby ( ['cohortid'] ). \ apply ( lambda x : x. tail ( 1 ). ageyrs )
[ -0.37392231822013855, 0.2623591125011444, 0.4199499189853668, -0.6597168445587158, 1.1269102096557617, -0.13179755210876465, 0.45320355892181396, 0.38293179869651794, -0.02569311112165451, 1.0427677631378174, 0.6348512172698975, 0.7503415942192078, 0.7040480375289917, 0.44813093543052673, ...
def variablerecurrent ( inner ) : def forward ( input, hidden, weight, batch _ sizes ) : output = [ ] input _ offset = 0 last _ batch _ size = batch _ sizes [ 0 ] hiddens = [ ] flat _ hidden = not isinstance ( hidden, tuple ) if flat _ hidden : hidden = ( hidden, ) for batch _ size in batch _ sizes : step _ input = inp...
[ -0.5772755742073059, -0.08276830613613129, 0.6635331511497498, 0.10930604487657547, -0.7460461854934692, -0.40046170353889465, 0.37791648507118225, -0.11949216574430466, -0.717746913433075, -0.019705865532159805, -0.1571132242679596, 0.35707393288612366, 0.39990127086639404, 0.162958458065...
def _ _ init _ _ ( self, clade, taxons ) : self. parts = list ( ) self. taxons = taxons for child in clade : self. parts. append ( set ( ( term. name for term in child. get _ terminals ( ) ) ) ) self. parts. append ( taxons - reduce ( lambda a, b : a. union ( b ), self. parts ) )
[ 0.6384414434432983, 0.022670505568385124, 0.5430670976638794, -0.09214847534894943, 0.13960115611553192, 0.4795083701610565, -0.01722806878387928, 0.4526728391647339, -0.5035087466239929, 0.03392639756202698, -0.650877833366394, -0.9633767604827881, -0.13926555216312408, -0.199918836355209...
def update _ unmatched _ xref ( self, unmatched ) : player = self. base. classes. player playerxref = self. base. classes. player _ xref for item in unmatched : profile _ path = item. get ( " profile _ path " ) if profile _ path : profile _ id = profile _ path. split ( " / " ) [ - 1 ] try : content = self. _ s. player ...
[ -0.9070534706115723, -0.45523518323898315, 0.7956991791725159, -0.5282387733459473, 0.2946225702762604, 0.07161662727594376, 0.08519598096609116, -0.23748722672462463, 0.3609525263309479, 0.7630753517150879, -0.6973637342453003, -0.45401260256767273, -1.0946502685546875, 0.0427705235779285...
def set _ fields ( self, fields ) : self. _ ind _ fields = { } widths = [ ] ind = 0 for name, width in fields : widths. append ( width ) self. _ ind _ fields [ name ] = ind ind + = 1 self. setfieldscount ( ind ) self. setstatuswidths ( widths )
[ -1.12175714969635, 0.9719234108924866, 0.15008887648582458, -0.9887135624885559, 0.04434781149029732, 0.126779705286026, 0.601080060005188, 0.16838720440864563, -0.18987663090229034, -0.3273047208786011, -1.4485645294189453, -0.811568558216095, -0.42486318945884705, 0.05132487043738365, ...
def referafriend ( self ) : webdriverwait ( self. driver, 10 ). until ( ec. visibility _ of _ element _ located ( ( by. css _ selector, self. css _ referafriendlink ) ) ) referafriendlink = self. driver. find _ element _ by _ css _ selector ( self. css _ referafriendlink ) action = touchactions ( self. driver ) action....
[ 0.09579263627529144, 0.3079112768173218, 0.8707222938537598, 0.3497091829776764, 0.9871652126312256, 0.25513598322868347, 1.1512845754623413, -0.5494045615196228, 0.416570246219635, 0.05593600496649742, 0.4654732644557953, 0.16073670983314514, -0.2804320752620697, 0.5732951760292053, 0.5...
def reduce _ to _ literals ( self, tree, env ) : left = tree. left right = tree. right if self. _ debug : print ( " left, pre eval : " + str ( left ) ) if self. _ debug : print ( " right, pre eval : " + str ( right ) ) # assumes integers. while not ( isinstance ( left, int ) or isinstance ( left, str ) ) : left = self....
[ -0.8287606239318848, -0.44182172417640686, 0.693202555179596, -1.465576410293579, 0.08319690078496933, 0.22668862342834473, -0.9341014623641968, 0.17591722309589386, -0.717613160610199, 0.6201045513153076, -0.005694619845598936, 0.11834056675434113, -0.7439585328102112, 1.51093327999115, ...
def test _ get _ alumno _ curso _ admin _ incorrect ( self ) : self. client. force _ authenticate ( user = self. user _ admin ) response = self. client. get ( f " / api / alumnos / curso / { self. alumno _ curso _ 7. id } / " ) self. assertequal ( response. status _ code, status. http _ 404 _ not _ found ) response = s...
[ 0.2323462814092636, -0.2521897554397583, 0.59135901927948, 0.13975994288921356, 0.7382758855819702, 1.5287379026412964, -0.0954379066824913, -0.06630544364452362, -0.10348154604434967, 0.33709678053855896, -0.2089632898569107, 1.9777963161468506, 0.6125754714012146, 0.3553224503993988, 1...
def attending _ events ( ) : # user login required if'username'not in flask. session : response = flask. make _ response ( json. dumps ('user login required'), 401 ) response. headers ['content - type'] ='application / json'return response try : with db _ session ( ) as db : attended _ events = db. query ( models. atte...
[ 0.018227795138955116, -0.7444307804107666, 0.6276922821998596, 0.3299558758735657, -0.28433483839035034, -0.01265882607549429, 0.1885826736688614, -0.3162265419960022, -0.17487657070159912, 1.176269292831421, 0.33276909589767456, 0.8108340501785278, 0.4333983063697815, 0.5974567532539368, ...
def _ check _ arg _ integer ( arg, name ) : assert is _ int ( arg ) and ( int _ min < = arg < = int _ max ), " argument'{ }'should be an integer in [ int _ min, int _ max ] ". format ( name ) return arg
[ -0.2404574155807495, -0.44507521390914917, 0.5092664361000061, -0.4974384307861328, -0.19817310571670532, 0.7261796593666077, -0.6049605011940002, -0.04452211409807205, -0.22269903123378754, 0.7575896382331848, -0.089161217212677, 0.9369240999221802, -0.5985962152481079, 0.4831764698028564...
def update ( self, request, slug ) : user = request. user try : article = article. objects. get ( slug = slug ) except exception : raise notfound ('an article with this slug does not exist.') # removes the user from the list of disliking users, # nothing changes if the user does not exist in the list of # disliking use...
[ -0.3237747848033905, -0.6925418972969055, 0.5620000958442688, -0.015872711315751076, -0.38330233097076416, 0.15888239443302155, 0.05271283537149429, 0.6475820541381836, 0.08959059417247772, 0.42284682393074036, -0.2377455234527588, 0.5007645487785339, -0.7911328673362732, 0.092332251369953...
def topplayer ( ) : conn = none try : conn = db. connect ('/ users / igal / pycharmprojects / guessgame / scores. db') cur = conn. cursor ( ) cur. execute ('''\ select players. firstname, wins. wins, looses. looses from players join wins on players. id = wins. id join looses on players. id = looses. id order by wins de...
[ -0.24332083761692047, -0.8039084672927856, 1.162302017211914, -0.03476112708449364, -0.025449639186263084, 0.5698918104171753, -0.1787385791540146, -0.47924235463142395, -0.8464765548706055, 0.7364193797111511, 0.10091321170330048, 0.5347462296485901, -1.116849422454834, 0.166364386677742,...
def update _ regions ( self ) : self. _ fitregions [ self. _ start : self. _ end ] = self. _ addsub
[ -0.5865349173545837, -0.5875564217567444, 0.25572001934051514, -0.4861854016780853, 0.26367127895355225, 0.6284061074256897, 0.16391520202159882, -0.15804709494113922, -0.40096741914749146, -0.743625283241272, -0.7489778995513916, 1.4761756658554077, -0.10297008603811264, -0.31667602062225...
def create _ model ( ) : # create the input and target variables input _ var = cntk. sequence. input _ variable ( ( 1, frame _ height, frame _ width ), name ='input _ var') target _ var = cntk. input _ variable ( ( num _ classes, ), is _ sparse = true, name ='target _ var') conv = conv _ model ( ) with cntk. default _ ...
[ 0.12380130589008331, 0.2797265350818634, 0.6019281148910522, -0.09302013367414474, -0.20228458940982819, -0.49651896953582764, 0.06775838881731033, 0.32392656803131104, -0.7617676854133606, 0.3618457615375519, -0.726290225982666, 0.2260144054889679, 0.8235670924186707, 0.06338586658239365,...
def _ add _ left ( self, p, e ) : node = self. _ validate ( p ) if node. _ left is not none : raise ('left child already exists') node. _ left = self. _ node ( e, node ) self. _ size + = 1 return self. _ make _ position ( node. _ left )
[ 0.0641142874956131, 0.557192862033844, 0.729140043258667, -0.8821379542350769, 0.03765890747308731, 0.9170116186141968, -0.811715304851532, -0.18290865421295166, 0.13324180245399475, 0.6473597288131714, -0.5298561453819275, -1.2241034507751465, -0.7008294463157654, -0.09999927878379822, ...
def _ _ len _ _ ( self ) : if self. auto _ flush : self. _ _ fh. flush ( ) self. _ _ fh. seek ( 0, os. seek _ end ) end = self. _ _ fh. tell ( ) return end / / self. record _ size
[ 0.19870586693286896, -0.17485684156417847, 0.7006056308746338, -0.8565594553947449, 0.04906171187758446, 0.45355671644210815, 1.290585994720459, 0.30697956681251526, -0.8900140523910522, -0.10837292671203613, -0.1109137162566185, 0.13121256232261658, -0.5443704128265381, -0.154294028878211...
def sum _ cubes ( n ) : total, k = 0, 1 while k < = n : total, k = total + pow ( k, 3 ), k + 1 return total
[ -0.5041883587837219, 1.0963853597640991, 0.4356192648410797, 0.5130751132965088, -0.14274291694164276, -0.11608109623193741, 0.8064869046211243, -0.163583442568779, 0.24915137887001038, 0.9783681631088257, -1.3489775657653809, -0.4788006842136383, -0.34536394476890564, -0.8953824043273926,...
def white _ noise ( self, nstep = none ) : return ( np. random. standard _ normal ( nstep ) )
[ -0.8704497218132019, 0.22646814584732056, 0.30156534910202026, 0.39886024594306946, -0.5824960470199585, 0.37949109077453613, 0.13371485471725464, -1.0456596612930298, 0.15776427090168, -0.1958397477865219, -0.44981637597084045, 0.5898087024688721, -0.7979890704154968, 1.4804153442382812, ...
def cylinder ( obj, coords, colors, radius ) : for idx, coord in enumerate ( coords ) : r1, g1, b1 = cmd. get _ color _ tuple ( colors [ idx ] [ 0 ] ) r2, g2, b2 = cmd. get _ color _ tuple ( colors [ idx ] [ 1 ] ) x1, y1, z1, x2, y2, z2 = coord obj. extend ( [ cylinder, x1, y1, z1, x2, y2, z2, radius, r1, g1, b1, r2, g...
[ -0.8230094909667969, -0.3483549654483795, 0.7370108962059021, -0.44593408703804016, 0.6168470978736877, 0.4198242723941803, 0.19869640469551086, -0.8158183693885803, -0.932436466217041, 0.22398647665977478, 0.2727755010128021, -0.010831119492650032, 0.3751452565193176, -0.7400503754615784,...
def check _ auth ( username, password ) : return username = = current _ app. config ['admin _ username'] \ and password = = current _ app. config ['admin _ password']
[ -0.3237560987472534, -0.6529126167297363, 0.4598240256309509, 1.1421995162963867, -0.46856480836868286, 0.8614480495452881, -0.49916550517082214, -0.04742681235074997, -0.0029814501758664846, 1.2135895490646362, 0.46438881754875183, 1.517721176147461, -0.693812370300293, 0.4005373120307922...
async def test _ attributes _ dimmer ( hass : homeassistant, mqtt _ mock : mqttmockhaclient, setup _ tasmota ) - > none : config = copy. deepcopy ( default _ config ) config [ " rl " ] [ 0 ] = 2 config [ " lt _ st " ] = 1 # 1 channel light ( dimmer ) mac = config [ " mac " ] async _ fire _ mqtt _ message ( hass, f " { ...
[ -0.026779213920235634, 0.030249010771512985, 0.37875011563301086, -0.6843999624252319, -0.048890016973018646, 0.14290651679039001, -0.13434557616710663, 0.5539345741271973, 0.3338973820209503, -0.8791623711585999, -0.7435824871063232, -0.34451302886009216, 0.2563011348247528, 1.05516731739...
def linked _ space _ id ( self, linked _ space _ id ) : self. _ linked _ space _ id = linked _ space _ id
[ 0.801435112953186, -1.4810290336608887, -0.16744686663150787, -0.304168701171875, -0.28625550866127014, 1.7377681732177734, 0.010670105926692486, 0.03267104551196098, 1.705316424369812, -1.085222601890564, -0.14273643493652344, 0.4713223874568939, -0.5670373439788818, 1.5509523153305054, ...
def test _ create _ user _ with _ email _ successful ( self ) : email = " testfrom @ app. com " password = " testpass123 " user = get _ user _ model ( ). objects. create _ user ( email = email, password = password ) self. assertequals ( user. email, email ) self. asserttrue ( user. check _ password ( password ) )
[ 0.5127081871032715, 0.26053062081336975, 0.21067778766155243, 0.46145641803741455, 0.6632487177848816, 0.963554322719574, -0.3739539086818695, 0.383100301027298, -0.22461634874343872, 0.3072154223918915, -0.8903661370277405, -0.7226895689964294, 0.5746233463287354, -0.11508620530366898, ...
def get _ dsq ( self ) : return self. dsq
[ -1.15373694896698, 0.08456908911466599, 0.513975203037262, 0.3343687951564789, -1.0620414018630981, -0.48816367983818054, -0.2274850457906723, -0.1613234132528305, 0.06630028039216995, -1.1067618131637573, -0.025484012439846992, 0.5488759279251099, 0.29951927065849304, -0.10836063325405121...
def test _ gf _ write _ rule _ header ( disabled _ colors, capsys, mocker ) : # given rule = mocker. magicmock ( spec = rule ) rule. keyword = " rule " rule. short _ description = " my rule " # when write _ rule _ header ( rule ) # then assert _ output ( capsys, dedent _ feature _ file ( " " " (? p < indentation > ) ru...
[ 0.34401965141296387, -0.2660866975784302, 0.42434969544410706, 0.071762315928936, 1.4441893100738525, 0.5856001973152161, -0.10101715475320816, 0.48183366656303406, -0.4951995611190796, -0.05667360499501228, -0.3085365295410156, 0.24602234363555908, -0.36301982402801514, 0.1689900904893875...
def test _ _ sticker _ _ repr ( ) : sticker _ id = 202201070026 guild _ id = 202201070027 available = true description ='komeiji'name ='koishi'pack _ id = 202201070028 sort _ value = 4 sticker _ format = stickerformat. png sticker _ type = stickertype. guild tags = ['rin ','okuu'] user = user. precreate ( 202201070029 ...
[ 0.669501781463623, 0.1759495884180069, 0.44384127855300903, 0.091123066842556, -0.5456562042236328, 0.6731007695198059, 0.14773833751678467, -0.5250997543334961, -0.3703541159629822, -0.051905956119298935, -0.5288870334625244, 0.20181070268154144, -0.8942468762397766, 0.17453575134277344, ...
def get _ stock _ historic _ data ( stockname, data _ scope ) : query _ url = " https : / / query1. finance. yahoo. com / v7 / finance / chart / { }? range = { } d & interval = 1d & indicators = quote & includetimestamps = false " res = requests. get ( query _ url. format ( stockname, data _ scope + 30 ) ) data = res. ...
[ -0.7419113516807556, -0.06720732152462006, 0.7917909622192383, -0.37793466448783875, 0.24614907801151276, -0.1793731302022934, -0.35253089666366577, -0.384476900100708, 0.008848634548485279, 0.4121246337890625, -0.08427482098340988, 1.764172911643982, 0.1281156688928604, 0.3098622262477875...
def is _ snapshot ( self, machine _ id : str, snap _ tag : str ) - > optional [ bool ] : response = self. get _ snapshots ( machine _ id ) if response. ok : snap _ list = response. detail return any ( snap _ tag in value [ " tag " ] for value in snap _ list ) return none
[ -0.14544738829135895, 0.46983328461647034, 0.3268034756183624, 0.8620842099189758, -0.7978454232215881, -0.6429368257522583, -1.9726041555404663, 0.010006421245634556, 0.33429083228111267, -0.2036483734846115, -0.38772279024124146, 0.032332539558410645, 0.25897613167762756, 0.5161144733428...
def avgsyllabledist ( pair ) : tokenpair = map ( gettokenset, pair ) # for each stanza : [ words ] - - > int ( syllables ) sumsyllbles = lambda words : sum ( map ( syllablelen, words ) ) syllablecount = [ sumsyllbles ( s ) for s in tokenpair ] # number of lines for each stanza linecount = [ linelen ( s ) for s in pair ...
[ -0.3343832790851593, 0.08749755471944809, 0.7207391262054443, -1.3507002592086792, -1.4338315725326538, -0.1249212920665741, 0.43291720747947693, 0.5686703324317932, -0.15012019872665405, 0.5879227519035339, -0.1499650925397873, 0.20688994228839874, 0.13280145823955536, 0.7363958358764648,...
def _ get _ status ( self ) : if self. options ['ssl'] : method ='https : / /'else : method ='http : / /'url = ('{ method } { host } : { port } { uri }? json'' '. format ( method = method, host = self. options ['host'], port = self. options ['port'], uri = self. options ['status _ uri'] ) ) try : response = requests. g...
[ 0.0642784908413887, -0.46692541241645813, 0.662788987159729, 0.2161255180835724, 0.8647698760032654, -0.8519126772880554, -0.9984608888626099, -0.11281337589025497, -0.3279568552970886, -0.2641898989677429, -0.07150484621524811, 0.2236364632844925, -0.4555719792842865, 0.6791257262229919, ...
def user _ defined ( self ) : return self ['user _ defined']
[ 0.4788762927055359, -0.3761957585811615, 0.2853744626045227, 1.2835474014282227, 1.0604649782180786, 0.0634334608912468, 0.39890357851982117, -0.2303897887468338, 0.029779525473713875, -0.3233509063720703, -1.2342339754104614, 0.6721189022064209, 0.7282108664512634, -0.16464628279209137, ...
def _ _ init _ _ ( self, value ) : self. _ value = value
[ -0.58526211977005, -0.168440043926239, 0.17635394632816315, -0.310220867395401, -0.7799170017242432, 0.41644182801246643, 0.42830076813697815, -0.35042503476142883, 0.2234847992658615, -0.1334228515625, -0.7340083122253418, -0.1738675832748413, 0.5753991603851318, 0.7680322527885437, 0.6...
def remember ( self, environ, identity ) : return [ ]
[ -0.9195325374603271, -0.2857573926448822, 0.2378322333097458, 0.5691756010055542, 1.9117265939712524, 0.42427289485931396, -0.8328408598899841, -0.07906138896942139, 0.5927022099494934, 0.23075710237026215, -1.6381795406341553, 0.24197842180728912, -0.7108820676803589, 0.3189404606819153, ...
def plot _ images ( images, y _ true = none, y _ pred = none, class _ names = [ 0, 1 ], n _ cols = 5, figsize = ( 12, 8 ) ) : n = len ( images ) n _ rows = n / / n _ cols + 1 plt. figure ( figsize = figsize ) for i, image in enumerate ( images ) : plt. subplot ( n _ rows, n _ cols, i + 1 ) plt. imshow ( image ) plt. ax...
[ -0.2326328456401825, 0.012647991068661213, 0.6377215385437012, 0.06808798760175705, -0.4552939832210541, 0.5182421803474426, 0.10431056469678879, 0.3557925522327423, -0.5740288496017456, 0.5414262413978577, 0.12678836286067963, 0.9848580360412598, 0.6805176734924316, 1.3772634267807007, ...
def _ _ addtyperules ( self, type _, rules ) : # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # here # # # # # # # # # # # # # r = copy. deepcopy ( rules ) for i in xrange ( len ( rules ) ) : rules [ i ]. extend ( [ type _ ] ) rules for rul in r : rules. append ( rul ) return rules
[ -0.8229478597640991, -0.0018799861427396536, 0.8544694185256958, -0.18442033231258392, 0.8268488049507141, 0.5458882451057434, -0.23439368605613708, -0.2728530764579773, -0.42818060517311096, 1.1127606630325317, 0.07717148214578629, 0.4915241301059723, -0.7767104506492615, 0.51963359117507...
def equalize ( im : np. ndarray, fac : float, clip _ limit : float = 2. 0, grid _ size : tuple = ( 8, 8 ) ) - > np. ndarray : # bgr to yuv to bgr im _ dst = cv. cvtcolor ( im, cv. color _ bgr2yuv ) # with clahe # clahe = cv. createclahe ( cliplimit = clip _ limit, tilegridsize = grid _ size ) clahe = cv. createclahe ( ...
[ 0.7986727356910706, 0.6632754802703857, 0.9954469203948975, 0.5517563819885254, 1.1205260753631592, -0.43189671635627747, 0.4735564887523651, -0.08719701319932938, 0.6698622107505798, 0.3761809766292572, 0.3191602826118469, 0.9939555525779724, 0.8913905620574951, 0.6369125843048096, 0.54...
def plot _ elem _ depletion _ vs _ prop ( elems, prop, snaps, bin _ nums = 50, labels = none, foutname ='obs _ elem _ dep _ vs _ dens. png ', std _ bars = true, style ='color ', include _ obs = true, outside _ legend = false ) : # get plot stylization linewidths, colors, linestyles = plt _ set. setup _ plot _ style ( l...
[ -0.11301629990339279, 0.5837154984474182, 1.064494013786316, 0.3506925106048584, -0.5363883376121521, 0.8444600701332092, 1.0006674528121948, -0.2886319160461426, 0.37643754482269287, -0.3529314398765564, 0.4953896999359131, 0.05184851959347725, 0.7672904133796692, 0.34709855914115906, 0...
def cooleroff ( ) : return none
[ 0.4080851078033447, -0.3910023868083954, 0.19671151041984558, 0.7253836989402771, -0.1876734495162964, 0.6589797735214233, 1.158868670463562, 0.7361994385719299, -0.6749646663665771, -1.1726210117340088, -1.1313918828964233, -0.015114307403564453, -1.959294319152832, -0.49958524107933044, ...
def test _ list _ alumno _ con _ anio _ lectivo _ no _ existente ( self ) : self. client. force _ authenticate ( user = self. user _ admin ) response = self. client. get ( f " / api / alumnos / list /? anio _ lectivo = 2000 " ) self. assertequal ( response. status _ code, status. http _ 404 _ not _ found ) self. assert...
[ 0.13872191309928894, -0.4060191214084625, 0.5424207448959351, -0.2788502871990204, 1.1398793458938599, 1.5692952871322632, -1.2310832738876343, -0.06816614419221878, -0.44884636998176575, -0.029027342796325684, -0.8972669839859009, 0.709493100643158, 1.028978943824768, 0.16910506784915924,...
def get _ service _ view ( request ) : service = ar. get _ service _ matchdict _ checked ( request ) service _ info = sf. format _ service ( service, show _ private _ url = true, show _ resources _ allowed = true ) return ax. valid _ http ( httpsuccess = httpok, detail = s. service _ get _ okresponseschema. description...
[ -0.5837571620941162, -0.15668337047100067, 0.40774524211883545, -0.43213045597076416, -0.6701338291168213, -0.3879798352718353, 0.3267004191875458, -0.5983875393867493, 0.06798107177019119, -0.6018597483634949, 1.6406807899475098, 1.3404803276062012, 0.47613194584846497, -0.340034842491149...
def _ year _ to _ python ( self, v, desc = none ) : try : year = int ( v ) except valueerror : raise valueerror ( " failed converting year to int ( % s ) " % v ) return year
[ -0.24328389763832092, -0.2978772819042206, 0.5961877107620239, -0.7396317720413208, -0.44469526410102844, 0.1665273755788803, -0.5214771628379822, 0.18062196671962738, 0.7002542018890381, 0.45257696509361267, -0.43080002069473267, 0.5636772513389587, -0.18566247820854187, -0.24459743499755...
def _ get _ port _ name ( self ) : return self. _ _ port _ name
[ 0.2146236002445221, -1.0061025619506836, 0.47893956303596497, -0.40981608629226685, -0.35085734724998474, 0.1433570832014084, 0.32134467363357544, -0.10258190333843231, -0.2983602285385132, 0.4949091970920563, 0.30811741948127747, -0.03889787942171097, 0.04159796983003616, -0.4443842172622...
def _ check _ rbl ( self, msg, rbl _ server, qtype = " a ", subtest = none ) : if self. ctxt. skip _ rbl _ checks : return false if subtest is not none : try : subtest = regex ( subtest ) except re. error as e : self. ctxt. err ( " invalid regex % s : % s ", subtest, e ) return false for ip in msg. get _ untrusted _ ip...
[ -0.011596768163144588, 0.3123581111431122, 0.6674401164054871, -0.10814523696899414, 0.4234534800052643, 0.48569372296333313, 0.061978280544281006, -0.33752062916755676, 0.00929828081279993, -0.08003898710012436, 0.4803526699542999, 0.43028533458709717, -1.598293662071228, 0.43037405610084...
def sendmessage ( ) : while true : message = input ('you :') if message in'\ n': continue sock. sendall ( message. encode ('utf - 8') )
[ -0.030454711988568306, 0.2926029562950134, 0.41567814350128174, 0.8636131286621094, -0.4627731740474701, 0.14789524674415588, -0.4200458526611328, -1.1837947368621826, -0.7357575297355652, -0.677036464214325, 0.1212034523487091, 0.6383440494537354, -1.6432517766952515, 0.6032648086547852, ...
def expand _ to _ monomials ( inputs, degree ) : expanded _ inputs = [ ] for i in range ( degree + 1 ) : expanded _ inputs. append ( inputs * * i ) return np. array ( expanded _ inputs ). transpose ( )
[ -1.3003908395767212, 0.4170404076576233, 0.5296513438224792, 0.26854103803634644, -0.13888438045978546, 0.16427184641361237, -0.12125371396541595, -0.3221348226070404, 1.0194001197814941, 0.2721257209777832, 0.1407119184732437, 0.5377974510192871, -0.39247629046440125, -0.4368634521961212,...
def get _ fitness _ file ( filename : str, net : neuralnet. ffnn ) : csv = np. genfromtxt ( filename, delimiter = ", ", dtype = str ) return get _ fitness _ ds ( csv, net )
[ 0.3161255121231079, 0.22766759991645813, 0.3295679986476898, 0.37429699301719666, 0.23488040268421173, 0.103101946413517, -0.8895865678787231, 0.6822676062583923, -0.9181954264640808, -0.5083712339401245, 0.06297006458044052, 0.16588348150253296, 0.4435281455516815, -0.05034645274281502, ...