text
stringlengths
25
2.19k
embedding
listlengths
768
768
def test _ datasamplers _ random ( initial _ guess, covar _ bounds, n _ samp ) : # number of covariates num _ covar = initial _ guess. shape [ 1 ] # define the class cls = datasamplers ( ) # set additional attribute device used to cast to right computational device device = torch. device ( " cuda " if torch. cuda. is _...
[ -0.8025086522102356, -0.6161879301071167, 0.45363953709602356, -0.014887165278196335, 0.34603023529052734, 0.7288492321968079, 0.01819981448352337, 0.17154796421527863, -0.12538227438926697, -0.5062201619148254, -0.5005701184272766, 0.056476179510354996, -0.8402868509292603, 0.388033241033...
def get _ zones _ coordinates ( path ) : coordinates = { } with open ( path, " r ", newline ='' ) as data : # parse data using csv based on ','position. searcher = reader ( data, delimiter = ', ', quotechar ='"') # skip header ( first line ). next ( searcher ) for line in searcher : # select the respective column of li...
[ -0.4081805944442749, -1.048798680305481, 0.5145975351333618, 0.01753777265548706, -0.4222639501094818, -0.16082321107387543, 0.4643171429634094, 0.4225410223007202, -0.27168259024620056, 0.5238401293754578, -1.3642845153808594, -0.5109185576438904, 0.2813221216201782, -0.3400888442993164, ...
def parse _ house ( self, content : str ) - > optional [ str ] : lower = content. lower ( ) is _ senate = " senate " in lower or " senators " in lower is _ reps = " house of representatives " in lower if is _ reps and not is _ senate : house = " house of representatives " elif not is _ reps and is _ senate : house = " ...
[ 0.727726399898529, -0.8367037773132324, 0.5289880037307739, -0.26049312949180603, 1.0194406509399414, 0.02896898239850998, -1.3231019973754883, -0.1138550266623497, 0.5084061622619629, -0.28032350540161133, 0.9135516285896301, 0.5049101114273071, -0.9028333425521851, 0.027609679847955704, ...
def error _ dict _ between _ margin _ functions ( reference : abstractmarginfunction, fitted : abstractmarginfunction ) : assert reference. coordinates = = fitted. coordinates, \'coordinates have either been resampled or the split is not the same'reference _ values = reference. gev _ value _ name _ to _ serie fitted _ ...
[ -0.6393918991088867, -0.6625434160232544, 0.7065578699111938, -0.8900593519210815, 0.11364766955375671, 0.45010751485824585, 0.1255459040403366, -0.13908609747886658, -0.21725985407829285, 0.6969718933105469, 0.37035247683525085, 1.4704155921936035, 0.6538723707199097, 0.2843276560306549, ...
def save _ file _ if _ needed ( fname, fcontent, /, *, debug = false, gitfiles = none, gitmessage = " regenerated ", timeout = 60. 0 ) : # import standard modules... import os import shutil import subprocess # check that " git " is installed... if shutil. which ( " git " ) is none : raise exception ( " \ " git \ " is n...
[ 0.03644569218158722, 0.3693389296531677, 0.6727790236473083, 0.3357727527618408, -0.09332369267940521, -0.18114815652370453, 0.27578985691070557, 0.056936606764793396, -0.7606515288352966, 0.12733887135982513, -0.493770033121109, -0.6470306515693665, -0.8318720459938049, 0.82020503282547, ...
def write ( self, file _ name : optional [ path ] = none ) : if file _ name is none : if self. file _ name is not none : file _ name = self. file _ name else : raise valueerror ('file _ name must be specified') vector _ format ='{ 0 : 20. 10e } { 1 : 19. 10e } { 2 : 19. 10e }'name _ line ='{ 0 : s } \ n '. format ( sel...
[ -0.47379857301712036, -0.6727989315986633, 0.8392382264137268, 0.08916632831096649, 0.7592094540596008, 0.23464804887771606, 0.3164701461791992, 0.14570055902004242, -0.4212971329689026, 0.30858245491981506, 0.03003242053091526, 0.6086167097091675, 0.6157246828079224, 0.28130894899368286, ...
def generate _ creator ( ) : role = all _ models. role. query. filter ( all _ models. role. name = = " creator " ). one ( ) user = factories. personfactory ( ) userrolefactory ( role = role, person = user ) return user
[ 0.21383649110794067, 0.29746854305267334, 0.4959176778793335, 1.0993454456329346, -0.32985830307006836, 0.5226060152053833, -0.30664679408073425, -0.18436139822006226, -0.09002456068992615, -1.254913330078125, -0.504764974117279, -0.8184650540351868, 0.7497167587280273, -0.0403400063514709...
def parse ( self, response ) : custom _ settings = {'item _ pipelines': {'ufcstats. pipelines. ufcstatspipeline': 400 } } today = datetime. datetime. today ( ). strftime ('% y - % m - % d') # prompt user to specify whether to update new events or all events. event _ update = none while event _ update is none : try : ev...
[ -0.38292160630226135, 0.20693320035934448, 0.8211531043052673, 0.29611727595329285, 0.1752578169107437, 0.056643012911081314, 0.6598386168479919, -0.07222558557987213, 0.37540319561958313, -0.25241774320602417, 0.4765302538871765, -0.5591504573822021, 0.09021343290805817, 0.585352063179016...
def maze _ traversal _ dfs ( start, end, maze ) : path = [ ] if maze _ traversal _ dfs _ helper ( start, end, maze, path ) : return path return none
[ 0.00547576230019331, 0.40891265869140625, 0.41587987542152405, 1.4092986583709717, 0.03541984036564827, -1.1464788913726807, 1.2792285680770874, 0.1854354292154312, -0.6787647008895874, 0.4041183590888977, 0.1335243284702301, -0.7547938227653503, -0.8345509767532349, 0.16884155571460724, ...
def next _ move ( self, board ) : start = time. time ( ) self. num _ moves + = 1 assert ( board. is _ full ( ) = = false ) # # # # # # # # # # # # # # # # # # # todo : # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # implement your strategy here. # feel free to call as many as helper functi...
[ -0.4063485264778137, 0.18436266481876373, 1.1304600238800049, 0.2520144581794739, -0.6960733532905579, -0.08392046391963959, 0.8860822916030884, 0.7814308404922485, 0.12424542009830475, 0.11555510759353638, 0.1488828808069229, -0.4453471601009369, 0.003983811009675264, -0.06203610077500343...
def players ( self, response ) : patt = re. compile ( r " / player / ( \ w + / \ d + ) / profile " ) players = [ ] for tr in response. html. find ( " tr " ) : if tr. attrs. get ( " class " ) and tr. attrs. get ( " class " ) [ 0 ] in [ " even ", " odd " ] : player = { } vals = [ el. text for el in tr. find ( " td " ) ] ...
[ -0.8640525937080383, -0.47936028242111206, 0.805343747138977, -0.34417885541915894, 0.7546564936637878, -0.3986976444721222, -0.11548642069101334, -0.03224370628595352, -0.10833746194839478, 0.546332836151123, -0.6827487349510193, -1.5169295072555542, -0.013647782616317272, 0.2694784998893...
def test _ create _ user ( self ) : user = capitaluser. objects. get ( email ='teste @ teste. com') self. assertequal ( user. email,'teste @ teste. com') self. assertequal ( user. name,'teste user') self. assertequal ( user. cpf,'12345678901') self. assertequal ( user. birth _ date, date ( year = 1983, month = 10, day ...
[ 0.16643454134464264, 0.21167929470539093, 0.30129101872444153, 0.7570198178291321, 0.48883935809135437, 1.600334644317627, 0.8563166856765747, -0.31964215636253357, 0.04077502712607384, -1.4096708297729492, -0.8908100724220276, -0.6014523506164551, 0.0831013023853302, 0.08417970687150955, ...
def getsourcefile ( file, sourcepath ) : for root in sourcepath : if file. find ( root ) = = 0 : prefix _ length = len ( root ) if not root. endswith ('/') : prefix _ length + = 1 relative _ file = file [ prefix _ length : ] return relative _ file return none
[ 0.915249228477478, 0.3454613983631134, 0.6877577900886536, 0.23668129742145538, -0.07328619807958603, -0.1541350781917572, 0.8586220741271973, -0.09345236420631409, -0.299336314201355, 0.8517808318138123, 0.5198171734809875, -0.3467206358909607, -0.6912575364112854, -0.26612749695777893, ...
def release ( self, conn ) : return asyncio. async ( self. _ release ( conn ), loop = self. _ loop )
[ -0.45269832015037537, 0.2509303092956543, 0.3834603726863861, 0.0537298284471035, -0.4735155701637268, -1.3214702606201172, -0.49165892601013184, 0.18939200043678284, -0.3816687762737274, 0.16440843045711517, -0.4313948452472687, 0.11380666494369507, -0.5730062127113342, -0.538472533226013...
def setup ( self ) : self. flag _ verbose = 1 self. values = [ [ 1 ], # int [ 0. 2 ], # float [ " fiets " ], # string [ ( 1, 2 ) ], # tuple [ [ 1 ] ], # short list [ [ 1, 2 ] ], # longer list [ numpy. array ( [ 1, 2 ] ) ], # numpy. ndarray [ { " a " : 1, " b " : 2 }, bool ] # dict ]
[ 0.42600908875465393, 0.7405421137809753, 0.3197474181652069, -0.20027422904968262, 0.6496918201446533, -0.18706628680229187, -0.04045400768518448, 0.1352369785308838, -0.4972241520881653, 0.26850488781929016, -0.39101770520210266, 0.30000725388526917, 0.32994869351387024, 1.027869224548339...
def beat _ f ( x ) : beats = torch. longtensor ( np. array ( [ b % notes _ per _ bar for b in range ( x. shape [ 1 ] ) ] ) ) beats = beats. repeat ( ( ( x. shape [ 0 ], x. shape [ 2 ] ) + ( 1, ) ) ) beats = beats. permute ( 0, 2, 1 ). contiguous ( ) return get _ variable ( beats )
[ 0.3272063732147217, 1.0432270765304565, 0.5806196331977844, 0.8443455100059509, -0.1578102856874466, 0.009100575931370258, 0.8884449005126953, -0.9707409739494324, -1.2438551187515259, 0.16597776114940643, -0.16022512316703796, 0.07608359307050705, -0.12245574593544006, -0.9474837183952332...
def runagent ( batchsize, memorysize, rl, numstates = 10, mode = " er " ) : # initialize cstep = 5 # learning transitions extracted from memory every c steps greedy = 0. 9 # the greedy with monotonic increasing maxepisode = 20 total _ steps = 0 env = sle. searchlin _ env ( maxstate = numstates ) target = np. array ( ( ...
[ 0.195414200425148, -0.36241430044174194, 0.9369291663169861, 0.12458893656730652, 0.02147866040468216, 0.6179655194282532, 0.2627545893192291, 0.00921594724059105, 0.20108744502067566, 0.1739901453256607, -0.3546110987663269, 0.42588579654693604, -0.27882832288742065, 0.14443336427211761, ...
def copy _ from ( self, src, dest, verbose = true ) : self. _ raise ( )
[ 0.43435654044151306, 0.2316489815711975, 0.46753203868865967, 1.0827068090438843, -0.3096757233142853, 0.48387640714645386, -0.9715431928634644, -0.09942980110645294, -0.33583304286003113, 0.8639519214630127, 0.3675611913204193, 0.8433836102485657, 0.2053796797990799, -0.001889700884930789...
def get _ codebase ( project = none, poll = none, secrets = { } ) : if poll is none : poll = import _ module ( " % s. poll " % project. _ _ name _ _ ) return { get _ codebase _ name ( poll. repo ) : { " repository " : poll. repo, " branch " : " master ", " revision " : none, } }
[ -0.3053896129131317, 0.21309319138526917, 0.45077893137931824, 0.31952232122421265, -0.22561609745025635, 0.2049030363559723, -1.1419144868850708, -0.5260435938835144, -0.25696632266044617, 0.5179687142372131, -1.0461012125015259, -0.3762982189655304, -0.36134761571884155, 0.34275582432746...
def getinput ( self, message, prompt = none ) : if prompt is none : return input ( message ) else : return input ( prompt + message )
[ 0.2399749457836151, 0.21286886930465698, 0.29997867345809937, 0.6730496883392334, 0.15734277665615082, 0.11701899021863937, 0.19599567353725433, -0.16513456404209137, 0.3974681496620178, -1.3174493312835693, 0.8411083817481995, 0.6865903735160828, -1.3023380041122437, -0.002089236630126834...
def load _ text ( cls, filename _ or _ file _ object ) : if hasattr ( filename _ or _ file _ object,'read') : fi = filename _ or _ file _ object else : fi = open ( filename _ or _ file _ object, encoding ='utf - 8 ', mode = " rt " ) lines = fi. readlines ( ) fi. close ( ) for i in range ( len ( lines ) ) : lines [ i ] ...
[ 0.14059489965438843, -0.35074397921562195, 0.6422863602638245, 0.22371669113636017, -0.05120496451854706, -0.2277047038078308, -0.07884541898965836, 0.46918928623199463, 0.22959157824516296, -0.42942434549331665, 0.4713941812515259, -0.6899346709251404, -0.1697544902563095, -0.061142250895...
def get _ id ( self ) : return self. _ _ id
[ 0.6143975853919983, -1.2983473539352417, 0.36338114738464355, -0.10790259391069412, 1.1786539554595947, 1.2193316221237183, 0.516173779964447, 0.15989674627780914, 1.057407021522522, -1.0458024740219116, -0.17520475387573242, 0.9053770899772644, -0.6216006278991699, -0.3555026948451996, ...
def progress _ tests ( self, recollect = false, skip _ default = false ) : for tid, func in tqdm ( self. _ task _ execs. items ( ) ) : if func = = self. _ exec _ default and not skip _ default : func ( tid ) elif func! = self. iter _ basetf : func ( * tid ) # generator for the test
[ -0.048044875264167786, 0.24886399507522583, 0.5876035690307617, 0.82187420129776, 1.054365873336792, 0.1202898770570755, 1.1621886491775513, 0.0901375561952591, -0.6368533372879028, -0.4160604774951935, 0.4452984035015106, -0.4557439088821411, -0.5245119333267212, 0.7161672711372375, -0....
def test _ get _ feature _ parameters ( self ) : pass
[ -0.26797616481781006, 0.5725273489952087, 0.35816091299057007, 1.8264676332473755, 0.8710936307907104, -0.30471891164779663, 0.9106694459915161, 0.37981393933296204, -0.4062177836894989, -0.1067049503326416, -0.9436125159263611, 0.7366849184036255, -0.5508395433425903, 0.5244947671890259, ...
def rect2d ( x, y, a = 1. 0, b = 1. 0, sharp _ transition = true ) : z = rect ( x / a, sharp _ transition ) * rect ( y / b, sharp _ transition ) return z
[ 0.34581616520881653, -0.3264055550098419, 0.47191286087036133, 0.15427330136299133, -0.36112186312675476, -0.0918181762099266, -0.09038729965686798, -1.0403605699539185, 0.1341431587934494, -0.2202642410993576, 0.1498907506465912, 0.2965148389339447, 1.0218918323516846, -0.3664437830448150...
async def _ find _ addresses ( self, seed : seed, index : int, count : optional [ int ], security _ level : int, checksum : bool ) - > list [ address ] : generator = addressgenerator ( seed, security _ level, checksum ) if count is none : # connect to tangle and find the first unused address. for addy in generator. cre...
[ -0.4033661186695099, 0.17253455519676208, 0.757323145866394, 0.12119027227163315, 1.085309624671936, -1.4564141035079956, 0.5435250997543335, -0.48378995060920715, 0.6895726323127747, 0.13894395530223846, 0.5664746165275574, -0.30722105503082275, -0.12022320926189423, 0.1671888828277588, ...
def test _ normalize _ none _ defined ( self, log _ mock ) : log _ type ='cloudtrail'normalizer. _ types _ config = { } normalizer. normalize ( self. _ test _ record ( ), log _ type ) log _ mock. assert _ called _ with ('no normalized types defined for log type : % s ', log _ type )
[ 0.6224231123924255, 0.7871052622795105, 0.4318256974220276, 0.009961027652025223, 0.9772254228591919, -0.21348953247070312, 0.0011307884706184268, -0.38487154245376587, -0.36883968114852905, -0.6276267766952515, -0.7763045430183411, 0.044511862099170685, -0.5504182577133179, 1.230666041374...
def get _ student ( ) : # raise exception ('pause here, please') github = request. args. get ('github ','jhacks') first, last, github = hackbright. get _ student _ by _ github ( github ) # grades = request. args. get ('github') grades = hackbright. get _ grades _ by _ github ( github ) student _ info = render _ templat...
[ 0.00660904822871089, -0.11668125540018082, 0.5211876630783081, -0.005490172654390335, 0.42227035760879517, -0.24198900163173676, -0.1549515575170517, -0.10341605544090271, -0.775023341178894, 0.1214108020067215, 0.13620617985725403, -0.14538362622261047, -0.32912135124206543, -0.0063353264...
def missing _ num _ sum ( lst, num ) : expected = sum ( range ( lst [ 0 ], num + 1 ) ) # got = sum ( range ( lst [ 0 ], lst [ - 1 ] ) ) return expected - sum ( lst )
[ -0.16358187794685364, 0.3607673645019531, 0.5172129273414612, 0.7770763635635376, -0.23214417695999146, 0.6962789297103882, 0.7358428239822388, 0.551165759563446, 0.6633021831512451, -0.14064903557300568, -1.2634189128875732, 0.22720785439014435, -0.2131127268075943, -0.019487330690026283,...
def as _ html _ page ( self ) : d = document ( title = self. image. image _ name ) with d. head : link ( rel ='stylesheet ', href = '.. /.. /.. / resources / css / styles. css') script ( type ='text / javascript ', src = '.. /.. /.. / resources / js / script. js') header = div ( id = " page - header " ) with header : h...
[ -0.48837149143218994, -0.12931764125823975, 0.6979377269744873, -0.49528712034225464, -0.34705284237861633, 0.3179377317428589, 0.4144890606403351, -0.13543321192264557, 0.5613117218017578, 0.5833257436752319, 1.3724265098571777, -0.4975803792476654, 1.3342026472091675, 0.5532609224319458,...
def showirimagefromcsv ( csvpath ) : df = pd. read _ csv ( csvpath, delimiter = " ; " ) plt. imshow ( df ) plt. show ( )
[ 0.2520635724067688, 0.08328023552894592, 0.5177878737449646, -0.06659398972988129, -0.8333340883255005, 0.18621550500392914, 0.9399223923683167, 0.561729907989502, 0.6885954141616821, 0.9383783340454102, 1.0445334911346436, 1.1419786214828491, 0.2954550087451935, -0.9435712099075317, 0.2...
def do _ find ( self, args ) : args = self. process _ args ( args ) self. element = none self. elements = none countloop = 0 elementfound = false if self. config [ " by " ]! = none : # try 4 times by default, before giving up. or self. config [ " tries " ]. while countloop < = int ( self. config [ " tries " ] ) and not...
[ -0.9837490320205688, -0.30462414026260376, 0.6708734035491943, 0.36975187063217163, 0.285906583070755, -0.3079676330089569, 0.5546278953552246, -0.38151365518569946, -0.310567170381546, 0.03819369897246361, -0.3847445547580719, -0.29461807012557983, -0.8453516960144043, 0.5434792637825012,...
def subclasses ( self ) - > optional [ mapping [ str,'outputs. labelclassresponse'] ] : return pulumi. get ( self, " subclasses " )
[ -0.22475415468215942, -0.5568915009498596, 0.5458395481109619, 0.1295786201953888, 0.7210909128189087, 1.3228803873062134, -0.09127526730298996, -0.8445581793785095, 0.9793094992637634, -0.8389643430709839, -0.8157640695571899, 0.3202145993709564, 0.42310068011283875, -0.5617662668228149, ...
def start _ node ( self, simulation, node ) : u = self. base _ api + " / simengine / rest / update / { } / start? nodes = { } " u = u. format ( simulation, node ) r = self. put ( u, none ) return r
[ -0.9253337979316711, 0.3256288170814514, 0.3336753249168396, -0.06713587045669556, 0.3458928167819977, -0.22526535391807556, -0.349401593208313, 0.21602052450180054, 0.3846662640571594, 0.7271807789802551, -0.7079551815986633, 1.1909233331680298, -0.8813789486885071, -0.5584484338760376, ...
def one _ timestep _ parameters ( simname, nc, dp, coord _ loc = [ 3, 6 ], sidechain = false ) : coord = extract. extract _ unwrapped ( simname, first _ only = true ) x = chain _ orientation _ parameter ( coord ['timestep _ 0'], [ 1, 0, 0 ], nc, dp, sidechain = sidechain ) y = chain _ orientation _ parameter ( coord ['...
[ -0.035378970205783844, 0.4798264801502228, 0.6815806031227112, -0.8171798586845398, 0.5814352631568909, 0.3201289474964142, -0.24908536672592163, -0.49811461567878723, -0.04740123450756073, 0.9127165079116821, -0.363371878862381, -0.2473330944776535, 0.2981920838356018, 0.22906506061553955...
def test _ init _ sets _ attributes ( self, mock _ generic _ frame, mock _ get _ data ) : test _ data = {'metric':'testing'} abstractgenericmodel ( * * test _ data ) with self. subtest ( ) : mock _ generic _ frame. assert _ called _ with ( * * test _ data ) with self. subtest ( ) : mock _ get _ data. assert _ called _ ...
[ -0.31988781690597534, 0.49824830889701843, 0.513048529624939, 0.21825306117534637, 0.9097772836685181, 1.1138447523117065, -0.7315656542778015, -0.71510910987854, -0.5850905776023865, -0.42209118604660034, -0.3844648599624634, 0.35016778111457825, 0.8510314226150513, 0.6456969976425171, ...
def ct _ inc ( id, value ) : return put _ state ( id, { " ct _ inc " : value } )
[ 0.0772208496928215, 0.7793450355529785, 0.15203405916690826, 0.09262090176343918, -0.9552621245384216, 0.5780211091041565, 0.5141664147377014, 0.0587601400911808, 0.022218385711312294, 0.2938702404499054, -0.5609825253486633, -0.4102189838886261, -0.4550683796405792, -1.244389533996582, ...
def get _ position _ index _ in _ concatenated _ position _ data ( self, i _ recording, position _ index ) : return sum ( [ x ['xy']. shape [ 0 ] for x in self. position [ : i _ recording ] ] ) + position _ index
[ -0.5236075520515442, -0.14531166851520538, 0.45150819420814514, -0.3825362026691437, 0.40521207451820374, 0.24019376933574677, -0.0718604028224945, 0.3278310000896454, 0.3488823473453522, 0.5836563110351562, -0.0929422676563263, 0.24420680105686188, -0.1575300395488739, -1.0502821207046509...
def three _ point ( data, center, dr = 1. 0, basis _ dir = '. / ', verbose = false, direction ='inverse') : if direction! ='inverse': raise valueerror ('forward three _ point transform not implemented') # sanity checks for center # 1. if center is tuple, only take the second value inside it if isinstance ( center, int ...
[ -0.12761877477169037, 0.26302555203437805, 0.9570552110671997, -0.2081831395626068, -1.0533066987991333, -0.08280085772275925, -0.29787835478782654, 0.7131974101066589, 0.3372916281223297, 1.2483643293380737, -0.013271073810756207, 0.33058127760887146, -0.13161569833755493, -1.190171480178...
def make _ dataset _ iterator ( self, replay _ client : reverb. client, ) - > iterator [ reverb. replaysample ] : dataset = datasets. make _ reverb _ dataset ( table = self. _ config. replay _ table _ name, server _ address = replay _ client. server _ address, batch _ size = self. _ config. batch _ size, prefetch _ siz...
[ 0.32518479228019714, 0.23980474472045898, 0.34967637062072754, -0.5965871810913086, -0.474141001701355, -0.2431434988975525, 0.16202546656131744, 0.3482677638530731, -0.6509627103805542, -0.40557706356048584, 0.4744563400745392, 1.2924178838729858, -0.2824438810348511, -0.9984917044639587,...
def _ assume _ role _ and _ get _ credentials ( assume _ role _ arn = none ) : import boto3 if not assume _ role _ arn : return { } sts _ client = boto3. client ( " sts " ) sts _ response = sts _ client. assume _ role ( rolearn = assume _ role _ arn, rolesessionname = " mlflow - sagemaker " ) _ logger. info ( " assumin...
[ 0.20651595294475555, -1.0194787979125977, 0.7092692255973816, -0.8809424042701721, -0.2469089776277542, -0.6406167149543762, -0.5216459035873413, 0.40380963683128357, 0.14961500465869904, 0.5363575220108032, -0.8289682865142822, 0.8282827734947205, 0.8295333385467529, 0.42688435316085815, ...
def getperspectiveposition ( self, point ) : if point is not none : c = np. array ( [ np. array ( [ [ point [ 0 ], point [ 1 ] ] ], dtype ='float32') ] ) h = np. array ( self. homo ['homo'], dtype = np. float32 ) tmpc = cv2. perspectivetransform ( c, h ) return ( tmpc [ 0 ] [ 0 ] [ 0 ], tmpc [ 0 ] [ 0 ] [ 1 ] ) return ...
[ 0.06908202916383743, -0.6195836663246155, 0.9663148522377014, 0.1444927603006363, -0.6040946841239929, -0.8073981404304504, -0.8099666833877563, -0.32131487131118774, 0.5167437195777893, 0.33446699380874634, -0.509821355342865, -0.7345114350318909, -0.9009650945663452, -0.20984384417533875...
def mirror ( image ) : return image. transpose ( image. flip _ left _ right )
[ -1.343589425086975, 0.4987739026546478, 0.3641948103904724, -0.4871033728122711, -0.8128210306167603, -0.49236956238746643, -0.2974119782447815, 0.12383375316858292, 0.2507576048374176, 0.8483749628067017, -0.1483296900987625, -0.7512902021408081, 0.0666777715086937, 0.5461661219596863, ...
def load _ requirements ( filename : str ) : line _ iter = ( line. strip ( ) for line in open ( filename ) ) return [ line for line in line _ iter if line and not line. startswith ( " # " ) ]
[ -0.06458829343318939, -1.0240055322647095, 0.6393741965293884, -0.2549663186073303, -0.3889060616493225, 0.9987567067146301, -0.995920717716217, 0.4996444582939148, -0.35971274971961975, 0.5873375535011292, 0.1329834908246994, 0.0007478424231521785, -0.3573004901409149, 0.7089215517044067,...
def test _ pillar _ include _ already _ included ( pillar _ include _ tree, salt _ call _ cli ) : ret = salt _ call _ cli. run ( " pillar. items " ) assert ret. returncode = = 0 assert ret. data assert " element " in ret. data assert " d " in ret. data [ " element " ] assert ret. data [ " element " ] [ " d " ] = = { " ...
[ -0.26329222321510315, 0.3601074814796448, 0.5132673978805542, -0.3457786738872528, 0.8048433661460876, 0.9554322957992554, -0.5569316744804382, 0.1457335203886032, 0.5162590742111206, -0.12239781767129898, -1.0042213201522827, 0.11595017462968826, -0.5965380072593689, -0.017455611377954483...
def perform _ reset _ password ( cls, user : user ) - > pendingaction : pending _ action, created = pendingaction. objects. get _ or _ create ( user = user, category = actioncategory. reset _ password, ) creation _ date, expiration _ date = get _ lapse ( ) pending _ action. creation _ date = creation _ date pending _ a...
[ -0.7572585940361023, -0.2939470410346985, 0.5994657874107361, 0.36873626708984375, 0.5190671682357788, -0.23147955536842346, 0.49405714869499207, 0.43038666248321533, -0.24828751385211945, 0.5357688665390015, 0.0983397513628006, 0.4719795286655426, 0.6124801635742188, 0.28970393538475037, ...
def get _ output _ spec ( self ) - > union [ spec, none ] : return none
[ -0.0675310418009758, -0.19644561409950256, 0.404351145029068, 0.19841957092285156, -0.07589363306760788, -0.7120265960693359, 0.5453776121139526, -0.8219865560531616, -0.2474418580532074, -0.5280508399009705, 0.5107656717300415, 0.06836658716201782, 0.12407686561346054, -0.6281849145889282...
def elements ( self, elements _ dict ) : def stringify ( element, number ) : return element if number = = 1 else element + str ( number ) self. formula = " ". join ( stringify ( e, n ) for e, n in sorted ( iteritems ( elements _ dict ) ) )
[ -0.5111671686172485, 0.10440169274806976, 0.4193226993083954, -0.7330521941184998, -0.1408674716949463, 0.47919049859046936, -0.12074177712202072, 0.43458670377731323, 0.9147247076034546, -0.4403354525566101, 0.5789338946342468, -0.3228286802768707, 0.34560421109199524, 1.1150529384613037,...
def x _ max ( l, rand ) : return rand [ np. argmax ( l ) ]
[ -0.5391765832901001, 0.08758708834648132, 0.3827548921108246, 0.22383390367031097, -0.18708090484142303, 0.17371763288974762, -1.9036952257156372, 0.4983566403388977, 0.7305282354354858, 0.6825401782989502, -0.48850348591804504, 0.26157626509666443, 0.07819560170173645, -0.8852000832557678...
def files ( self ) : return self ['files']
[ -0.08777337521314621, 0.027363639324903488, 0.04581155255436897, -0.27674806118011475, 0.8706932067871094, -0.057574108242988586, -0.10584915429353714, 0.18857139348983765, -0.12687289714813232, -0.5140721201896667, -0.2518480718135834, -0.9370583891868591, -0.09123498946428299, 0.01742242...
def instance _ id ( self ) - > optional [ pulumi. input [ str ] ] : return pulumi. get ( self, " instance _ id " )
[ 0.7896601557731628, 0.009654542431235313, 0.3257511556148529, -0.35873109102249146, 0.5956681966781616, 1.4779211282730103, 0.13210569322109222, 0.7477409839630127, 0.8456955552101135, 0.4829806387424469, 0.7493564486503601, 1.218125820159912, -0.8169788122177124, -0.8101323246955872, 0....
def have _ fp8 ( compute _ version ) : major, minor = parse _ compute _ version ( compute _ version ) # fp8 is suppored in ada lovelace ( 8. 9 ) or later architectures. if major = = 8 and minor = = 9 : return true if major > = 9 : return true return false
[ -0.21719464659690857, 0.2971685230731964, 0.366931676864624, 0.17921365797519684, -0.7005661725997925, 0.6221824288368225, -0.19064274430274963, 0.1895270049571991, 0.17837972939014435, 0.3647884726524353, -0.10239415615797043, -0.36249133944511414, -0.07246477901935577, 0.3594815135002136...
def testloadapplication ( self ) : a = service. application ( " hello " ) baseconfig = {'file': none,'source': none,'python': none } for style in'source pickle '. split ( ) : config = baseconfig. copy ( ) config [ {'pickle':'file'}. get ( style, style ) ] ='helloapplication'sob. ipersistable ( a ). setstyle ( style ) s...
[ -0.5182485580444336, -0.6397073268890381, 0.6193899512290955, 0.12108517438173294, 0.2978363037109375, 0.154648095369339, 0.21529555320739746, 0.29262956976890564, 0.5026487708091736, 0.12818431854248047, -0.8489339351654053, -0.38619303703308105, -0.5965052843093872, 0.35033872723579407, ...
async def test _ availability _ discovery _ update ( 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 ) await help _ test _ availability _ discovery _ update (...
[ 0.32948777079582214, -0.09169639647006989, 0.32907384634017944, 0.4780293405056, 0.17514044046401978, 0.6174154877662659, 0.47908273339271545, 0.9720824956893921, 0.17491468787193298, -0.20883913338184357, -0.40082186460494995, -0.6952071785926819, 0.5219401717185974, 0.5673182010650635, ...
def test _ user _ consent _ response ( self ) : data = {'client _ id': self. client. client _ id,'redirect _ uri': self. client. default _ redirect _ uri,'response _ type':'code ','scope':'openid email ','state': self. state, # pkce parameters.'code _ challenge': fake _ code _ challenge,'code _ challenge _ method':'s25...
[ 0.20281481742858887, -0.01959533989429474, 0.6342223882675171, 0.2656288146972656, -0.2372743785381317, 0.10974704474210739, 0.3984188735485077, -0.1020912155508995, 0.8971896171569824, 0.3316635489463806, -0.17191563546657562, -0.24029764533042908, 0.34839433431625366, -0.6550480723381042...
def _ playout ( self, state ) : node = self. _ root # print ('= = = = = = = = = = = = node visits : ', node. _ n _ visits ) # deep = 0 while ( 1 ) : if node. is _ leaf ( ) : break # greedily select next move. action, node = node. select ( self. _ c _ puct ) # print ('move in tree... ', action ) state. do _ move ( actio...
[ -0.4852824807167053, 0.3079487979412079, 0.7881415486335754, -0.11948727071285248, 0.03224414959549904, -0.370522677898407, 0.6682716012001038, 0.039078958332538605, 0.061632394790649414, 0.4430919587612152, 0.7299948930740356, 0.3175663948059082, 0.14023099839687347, -0.15881915390491486,...
def test _ global _ port _ with _ default _ env ( self ) : eq _ ( normalize ( " localhost " ) [ 2 ], " 666 " )
[ 0.49706220626831055, 0.1675424724817276, 0.3024519979953766, 0.7361530661582947, 1.1006277799606323, 1.0716183185577393, 1.025324821472168, 0.5105738639831543, -0.09565334767103195, 0.4733522832393646, -0.39595741033554077, -0.09914977848529816, -0.4513498842716217, 0.24780383706092834, ...
def _ visualizer _ rllib ( result _ dir, checkpoints, emissions _ output, horizon, video _ dir, gui _ config _ file, tls _ record _ file ) : # start up ray ray. init ( num _ cpus = 1 ) # pylint : disable = no - value - for - parameter agent, gym _ name, config, multiagent, env _ params, result _ dir, sim _ params = get...
[ 0.8893095254898071, -0.11175537109375, 0.8441290259361267, 0.1266590803861618, -0.2557140290737152, 0.007598173338919878, -0.2096000462770462, 0.6374566555023193, -0.036993011832237244, 0.5981062650680542, 0.041148070245981216, 0.14296023547649384, -0.08054564893245697, 0.4699426293373108,...
def _ clean _ up ( takeout _ dir, photos _ dir, delete _ archives = false ) : if delete _ archives : takeout _ archives = _ list _ takeout _ archives ( takeout _ dir ) for archive in takeout _ archives : print ('deleting archive : ', archive ) os. remove ( archive ) else : print ('not deleting archives.') # replace dup...
[ 0.7853729724884033, 0.4701841473579407, 0.9439559578895569, -0.19501937925815582, 0.4964924156665802, 0.311085045337677, 0.8334247469902039, 0.8912523984909058, 1.0068384408950806, 0.3395010828971863, 0.0657552108168602, 0.5348488688468933, -0.0032509909942746162, 0.10418779402971268, 0....
def write _ bit8 ( data ) : return pack ('b ', data ) [ 1 ]
[ -1.0459791421890259, 0.17637503147125244, 0.24838125705718994, 0.37503570318222046, 0.4731287360191345, 0.39388129115104675, 0.06203043460845947, -0.8054789304733276, 1.3051172494888306, 0.1968187540769577, -0.2616613507270813, 0.6985419988632202, -1.7488694190979004, -0.2296578586101532, ...
def test _ delete _ all _ test _ loadbalancers ( self ) : lb _ response = self. lbaas _ client. request ('get ', self. lbaas _ client. url ) lbs = json. loads ( lb _ response. content ). get ('loadbalancers ', ( ) ) lbs _ named _ test = [ lb for lb in lbs if lb ['name'] = ='test'] for lb in lbs _ named _ test : self. l...
[ 0.22246095538139343, -0.9657759666442871, 0.46891945600509644, 0.30489394068717957, 1.0458976030349731, 0.4500066637992859, -0.38398051261901855, -0.9071272611618042, 1.0433733463287354, 0.1700853407382965, -0.4010356664657593, 0.35591554641723633, -1.5307433605194092, 1.0173155069351196, ...
def public _ search ( string ) : pass
[ -0.7113943099975586, -0.27981698513031006, 0.05627542734146118, 0.475669801235199, -0.7927383184432983, 0.061761558055877686, 0.483200341463089, -0.7278273701667786, -0.9056572318077087, -0.8878089785575867, -0.5658520460128784, 0.7283740639686584, -0.9260109663009644, -0.954626739025116, ...
def test _ blog _ apps _ config ( self ) : self. assertequal ( apps. blogconfig. name,'blog')
[ 0.771600067615509, 0.7077112197875977, -0.055227961391210556, 0.9922559261322021, 0.14025044441223145, 1.334885835647583, 0.03704170510172844, 0.4294523298740387, 0.0709100067615509, 0.44425293803215027, -0.9154236316680908, -0.2949119806289673, 0.2612769603729248, 0.7247397899627686, 0....
def quantile ( self, quantile : float ) - > dataframe : return self. select _ all ( ). quantile ( quantile )
[ -0.45132291316986084, 0.9268640279769897, 0.058337703347206116, 0.11826436966657639, -0.06468687951564789, -1.8003039360046387, -0.4223138391971588, -0.5517803430557251, -0.5597249865531921, -0.6282259225845337, 0.36267638206481934, 0.03602401167154312, -0.8243252635002136, -1.219028353691...
def uniquevaluesforcoursesubject ( self ) : portal _ catalog = gettoolbyname ( self,'portal _ catalog') catalog _ subjects = portal _ catalog. uniquevaluesfor ( " getcoursesubject " ) course _ subjects = [ ] for subject _ credit in subject _ credit : if subject _ credit in catalog _ subjects : course _ subjects. append...
[ 0.3549741506576538, -0.293186217546463, 0.4052808880805969, -0.5431525707244873, 0.5688997507095337, 0.9643315076828003, -0.5307164192199707, -0.8496100902557373, -0.5148951411247253, 0.2481233775615692, -0.1745271235704422, 1.2157179117202759, 0.5186084508895874, -0.21692748367786407, -...
def projective _ inverse _ warp ( img, depth, pose, intrinsics, ret _ flows = false ) : batch, height, width, _ = img. get _ shape ( ). as _ list ( ) # construct pixel grid coordinates. pixel _ coords = meshgrid _ abs ( batch, height, width ) # convert pixel coordinates to the camera frame. cam _ coords = pixel2cam ( d...
[ -0.23818781971931458, -0.0927695631980896, 0.8636859059333801, -0.11259549856185913, -0.9370554089546204, -0.0276680625975132, 0.47269687056541443, 0.20466983318328857, 0.04558154568076134, 0.4293002784252167, 0.4181854724884033, 0.6853447556495667, -0.43197476863861084, -0.875863075256347...
def find _ yy ( soln, dir _ raw, parent, fig _ opt, sub _ opt, tp ) : # tp is type # dnr = load _ dr ( path _ r _ npz, soln ) path _ raw = os. path. join ( dir _ raw,'raw. npz') raw = load _ raw ( path _ raw ) xtype = fig _ opt ['xtype'] mf = raw ['mole _ fraction'] mole = [ float ( v ) for v in raw ['mole'] ] xx = [ f...
[ 0.2228778898715973, -0.7037160396575928, 1.0915204286575317, -0.5870960354804993, -0.47222620248794556, -0.7091819643974304, 0.49224570393562317, 0.11112720519304276, -0.6930615305900574, 0.7286626696586609, -0.7652343511581421, -0.08342249691486359, 0.8761115074157715, 0.41083791851997375...
def test _ gf _ write _ rule _ header _ nothing _ for _ default _ rule ( disabled _ colors, capsys, mocker ) : # given rule = mocker. magicmock ( spec = defaultrule ) # when write _ rule _ header ( rule ) # then stdout = capsys. readouterr ( ). out assert stdout = = " "
[ -0.016071045771241188, 0.06354577839374542, 0.28856244683265686, 0.004901363980025053, 2.2353198528289795, 0.7432336211204529, 0.27835312485694885, -0.06648649275302887, -0.49150922894477844, -0.27781617641448975, 0.18772296607494354, -0.15594308078289032, -0.7467129826545715, 0.4288551509...
def logout _ user ( self ) : old _ user = self. user self. user = none if old _ user is not none : message _ hub. send _ message ( " identity : logoutsuccessful : { } ". format ( old _ user [ " _ id " ] ), { " user _ id " : str ( old _ user [ " _ id " ] ), " username " : str ( old _ user [ " username " ] ), } ) self. e...
[ -0.23289531469345093, 0.19638913869857788, 0.41443324089050293, 0.2793859541416168, -0.062155380845069885, -0.22976569831371307, 0.1362532675266266, 0.41434037685394287, 0.3220857083797455, 0.1039259061217308, -0.8481703400611877, 0.7973912954330444, 0.3245561718940735, -0.211488276720047,...
def hold _ any _ to _ py ( self, x, t ) : cyt = self. possibly _ shared _ cython _ type ( t ) cast ='{ 0 }. cast [ { 1 } ] ( ) '. format ( x, cyt ) return self. var _ to _ py ( cast, t )
[ -0.31329572200775146, -0.652077317237854, 0.27315494418144226, -0.418285995721817, 0.7837074398994446, -0.151885986328125, -0.6233270168304443, -1.8902430534362793, -0.15413981676101685, 0.029871655628085136, -0.6672897338867188, 1.3224433660507202, -0.11547093838453293, -0.066211663186550...
def make _ statistics _ file _ output ( self, vertex _ count ) : outstring = " # surface - area \ tcurvature - std \ n " outstring + = " { } \ t { } \ n ". format ( self. current _ state. surface _ area ( ), self. current _ state. curvature _ std ( ) ) outstring + = " # vertex order information \ n " outstring + = str ...
[ 0.7443678975105286, -0.3571222424507141, 0.6617045998573303, -0.64152991771698, -0.5592281818389893, 0.6585119962692261, 0.893187940120697, -0.8189148902893066, -0.8989177346229553, -0.35288119316101074, 0.3204413950443268, -0.1097656711935997, 0.7665940523147583, -0.11255297809839249, 0...
def init _ corpus _ helper ( path, corpus ) : corpus _ path = os. path. join ( path, corpus ) corpora = read _ corpus ( ) if corpus in corpora : raise valueerror ('corpus already exists') if not os. path. exists ( corpus _ path ) : os. mkdir ( corpus _ path ) if not os. path. exists ( os. path. join ( corpus _ path,'re...
[ 0.7758594155311584, -0.43463942408561707, 0.9797111749649048, -0.9954943060874939, 0.7578410506248474, -0.1123218759894371, 0.7777003645896912, -0.43575915694236755, -0.20861957967281342, -0.11718357354402542, 0.056804802268743515, 0.09285500645637512, -0.05887146294116974, 0.1531170904636...
def is _ in ( img, subimg ) : subimg1 = cv2. cvtcolor ( np. array ( subimg ), cv2. color _ bgr2gray ) # need gray image to do the matchtemplate res = cv2. matchtemplate ( img, subimg1, cv2. tm _ ccoeff _ normed ) threshold = 0. 65 # error coef loc = np. where ( res > = threshold ) for pt in zip ( * loc [ : : - 1 ] ) : ...
[ -0.0584527850151062, 0.04295134171843529, 0.796285092830658, 0.4655844569206238, -0.5507574677467346, 0.13741813600063324, -0.03643207624554634, 0.27809953689575195, -0.40192559361457825, 0.1996029168367386, -0.035603802651166916, 0.7029755115509033, -0.29436588287353516, -0.19277238845825...
def remove _ remainder _ session ( self ) : remainder _ ip = sorted ( self. ip _ session _ data, key = lambda x : ( self. ip _ session _ data [ x ]. first _ session _ time, self. ip _ session _ data [ x ]. last _ session _ time ) ) for ip in remainder _ ip : past _ session = self. ip _ session _ data [ ip ] self. write...
[ -0.8060610890388489, -1.4837415218353271, 0.6299166679382324, -0.91361004114151, -0.09242188930511475, -0.05624524503946304, 0.3466480076313019, -0.028432847931981087, 0.5238077044487, 0.598446786403656, -0.2121458500623703, -0.22687837481498718, -0.8411436676979065, -0.45351162552833557, ...
def pronadji _ index _ od _ kanala ( self, kanal ) : msg ='pronadji _ index _ od _ kanala, start. kanal = { 0 } '. format ( str ( kanal ) ) logging. debug ( msg ) # " proseci " stablom u potrazi za indeksom for i in range ( self. stablo. rowcount ( ) ) : ind = self. stablo. index ( i, 0 ) # index stanice, ( parent ) ot...
[ -0.9035439491271973, -0.3791389763355255, 0.6190624237060547, -0.3990193009376526, -0.9407369494438171, -0.114519402384758, 1.0703116655349731, -1.1854119300842285, 0.1275162696838379, 0.02484564110636711, 0.025415992364287376, 0.08530139178037643, -0.5796419978141785, 0.3627251386642456, ...
def draw _ graph ( name, graph, output _ png = false ) : n = nx. nx _ agraph. to _ agraph ( graph ) n. edge _ attr. update ( directed = true ) n = n. unflatten ( f " - f - l6 " ) if output _ png : n. layout ( prog = " dot ", args = " - gratio = compress - grankdir = tb - gnodesep = 0. 5 - gfontsize = 20 " ) n. draw ( f...
[ -0.4603020250797272, 0.5466192960739136, 0.6310558915138245, -0.12745320796966553, -1.208106517791748, 0.11621915549039841, 0.5809568166732788, -0.5749910473823547, 0.20654051005840302, 0.027714241296052933, 0.21262484788894653, -0.3925049304962158, 0.4615529179573059, -0.5190384984016418,...
def log ( self, txt, dt = none ) : dt = dt or self. datas [ 0 ]. datetime. date ( 0 ) iso = dt. isoformat ( ) print ( f " { iso }, { txt } " )
[ -0.06715208292007446, -0.14010007679462433, 0.8369097709655762, 0.03201747685670853, -0.4919988512992859, 1.0071208477020264, -1.3434807062149048, 0.25277167558670044, -0.3995969593524933, -0.20194897055625916, 0.07833026349544525, 0.8178868889808655, 0.28418102860450745, -0.05374887585639...
def add _ node ( self, node ) : # check to see if currency already in graph if node not in self. vertices : self. vertices. append ( node ) # initialize an empty dictionary for currency self. graph [ node ] = { } else : pass
[ -0.19557400047779083, 1.144741177558899, 0.4771336019039154, -0.5058364272117615, -0.33808842301368713, 0.3170345723628998, -0.3105863034725189, -0.11707539111375809, 0.7654187083244324, 0.5074031949043274, -0.6311997771263123, -0.19985778629779816, -0.7667210698127747, 0.4290302097797394,...
def get _ recent _ commits ( self, since = none ) : raise notimplementederror
[ -0.3466958999633789, 1.201146125793457, 0.7800970673561096, 0.6556737422943115, 0.10823904722929001, -0.5859147310256958, -0.6387806534767151, -0.035205695778131485, -1.1837407350540161, -0.7208914160728455, 0.3152386248111725, 0.5070881247520447, -0.4402945339679718, 0.17059604823589325, ...
def rowstopoints ( self, line ) : l = line z = l % 4 y = ( l - z ) / 4 return [ ( i, y, z ) for i in range ( 4 ) ]
[ -0.8020861148834229, -0.02185310237109661, 0.32370349764823914, 0.3541368842124939, 0.6205741763114929, -0.34504827857017517, 0.1463286578655243, 0.18744565546512604, 0.772590696811676, 0.4596758484840393, -1.288807988166809, -1.061273455619812, -0.35470008850097656, -0.29268282651901245, ...
def initial _ data ( n : int = 1000, d : int = 2, k : int = 3, data _ name : str ='data. png') : x = np. zeros ( ( n * k, d ) ) # data matrix ( each row = single example ) y = np. zeros ( n * k, dtype ='int8') # class labels for j in range ( k ) : ix = range ( n * j, n * ( j + 1 ) ) r = np. linspace ( 0. 0, 1, n ) # ra...
[ -0.40664198994636536, 0.06857617199420929, 0.7429209351539612, -1.3144344091415405, -0.49019289016723633, 0.4035869240760803, -0.05074575915932655, 0.1980457901954651, 0.1175658106803894, 0.35477954149246216, -0.22154545783996582, 0.7393643856048584, 0.9981402158737183, 0.6444349884986877,...
def get _ user _ playlists ( sp, username ) : playlists = sp. user _ playlists ( username ) filtered _ playlists = [ ] for playlist in playlists ['items'] : if playlist ['owner'] ['id'] = = username : print ( playlist ) filtered _ playlists. append ( {'name': playlist ['name'],'uri': playlist ['uri'] } ) return filtere...
[ -0.42381787300109863, -0.3181297183036804, 0.3753150701522827, 0.9398091435432434, -0.9398297667503357, -0.09079435467720032, -0.19545382261276245, -0.5371143221855164, 0.4170268774032593, 0.4599442780017853, -0.6480989456176758, 0.5341984629631042, -0.5665737986564636, -0.2762033939361572...
def equalize ( image, mask = none ) : if image. mode = = " p " : image = image. convert ( " rgb " ) h = image. histogram ( mask ) lut = [ ] for b in range ( 0, len ( h ), 256 ) : histo = [ _ f for _ f in h [ b : b + 256 ] if _ f ] if len ( histo ) < = 1 : lut. extend ( list ( range ( 256 ) ) ) else : step = ( functools...
[ -0.09735503792762756, 0.2367858737707138, 0.684977650642395, 0.9479018449783325, 0.41805407404899597, -0.5046662092208862, -0.0031801005825400352, 0.13834092020988464, 0.5054401159286499, 0.07364512979984283, -0.6225703358650208, -0.2448118031024933, -0.6308929920196533, 0.5019007325172424...
def lint _ raises ( page _ info : parser. pageinfo ) - > api _ report _ pb2. raiseslint : raises _ lint = api _ report _ pb2. raiseslint ( ) # extract the raises from the source code. raise _ visitor = raisevisitor ( ) source = _ get _ source ( page _ info. py _ object ) if source is not none : try : raise _ visitor. v...
[ 0.3505936861038208, -0.12054356187582016, 0.6316649317741394, -0.7785328030586243, 0.09627248346805573, -0.5261387228965759, 0.06933010369539261, -0.40314731001853943, 0.12688444554805756, 0.012838119640946388, -0.16566185653209686, -0.3083146810531616, -0.21689064800739288, 0.667368531227...
def _ animhandler ( self ) : # freecad. console. printmessage ('<') # end condition if len ( self. animations ) = = 0 : # freecad. console. printmessage ('-') self. stop ( ) return anim = self. animations [ 0 ] command = anim [ 0 ] if command = ='target': last _ pose = self. animations [ 0 ] [ 1 ] pose = self. animatio...
[ 0.14706745743751526, -0.07565540075302124, 0.6211209297180176, -0.0009915848495438695, -0.13885484635829926, 0.056395720690488815, 0.8273643851280212, -0.3572525382041931, -0.5723305940628052, 0.03800547122955322, -0.0029810417909175158, -0.17559362947940826, -0.3102158010005951, 0.5463317...
def create ( infile, outfile ) : # supported images image _ types = {'app': enumapptype. app,'scd': enumapptype. scd,'scfw': enumapptype. scfw,'cm4 - 0': enumapptype. m4 _ 0,'cm4 - 1': enumapptype. m4 _ 1,'app - a35': enumapptype. a35,'app - a53': enumapptype. a53,'app - a72': enumapptype. a72 } try : with open ( infil...
[ -0.6980239152908325, -0.8217556476593018, 0.6810849905014038, 0.26122352480888367, -0.6263711452484131, -0.5260105133056641, -0.1443878710269928, 0.2286400943994522, -0.3294493556022644, 0.27115681767463684, -0.2952020466327667, 0.42194849252700806, 0.27172181010246277, 0.7954548001289368,...
def itksmoothingrecursivegaussianimagefilterid3id3 _ cast ( * args ) : return _ itksmoothingrecursivegaussianimagefilterpython. itksmoothingrecursivegaussianimagefilterid3id3 _ cast ( * args )
[ 0.20648813247680664, 0.564078152179718, 0.034626495093107224, -1.2572849988937378, -0.0442684106528759, 1.2411551475524902, -1.0684949159622192, -1.5367999076843262, 1.140627145767212, 0.5525368452072144, -0.10298215597867966, 0.4198910892009735, -1.7539563179016113, 0.4338701367378235, ...
def _ loadobject ( self, db, my _ id, identifier ) : cursor = db. cursor ( ) destination = [ ] command ='select distinct tbl. name, tbl. description'\'from { 0 } s as tbl'\'join trials on trials. { 0 } id = tbl. id'\'where trials. datacollectionid =? '. format ( identifier ) cursor. execute ( command, ( my _ id, ) ) fo...
[ -0.6013448238372803, -0.10761164128780365, 0.7046148777008057, -0.9754328727722168, -0.31136834621429443, -0.04680459573864937, -0.48642221093177795, 0.17098253965377808, -0.429157018661499, 0.4157005548477173, -1.0326168537139893, -0.1400979906320572, 0.34172746539115906, 0.17681849002838...
def init _ amb _ connection ( amb _ address ) : notifier. debug ( " connecting to amb % s " % amb _ address ) amb _ connection = false try : amb. mb _ init ( amb _ address ) amb _ connection = true except : error _ message = " could not connect to amb < % s > " % str ( amb _ address. split ('/') [ 0 ] ) notifier. error...
[ 0.14825907349586487, -0.5040690302848816, 0.6547511219978333, 0.012722204439342022, -0.8207689523696899, 0.33139750361442566, -0.09523028135299683, 0.22922970354557037, 0.4684361219406128, 0.4173615276813507, -0.25435104966163635, 0.41281193494796753, -0.5243216156959534, 0.755675137042999...
def _ build _ callback _ request ( code : str, state : str, session : str, ip _ address : str = " 10. 0. 0. 1 ", ) - > mock : request = mock ( spec = [ " args ", " getcookie ", " cookies ", " requestheaders ", " getclientaddress ", " getheader ", ] ) request. cookies = [ ] request. getcookie. return _ value = session r...
[ -0.7235239744186401, 0.06525374203920364, 0.7068646550178528, -0.796312153339386, 0.48640596866607666, -0.941216766834259, -0.268296480178833, 0.13001248240470886, 0.2380332350730896, 0.27750352025032043, 0.4963042736053467, 0.5689594745635986, 0.01637745462357998, -0.2777526080608368, 0...
def validate _ element ( element, validator, schema = schema ) : if validator. validate ( element, schema ) is not true : field, errors = next ( validator. errors. iteritems ( ) ) message _ string = " \ nelement of type'{ 0 }'has the following errors : \ n { 1 } " error _ string = pprint. pformat ( errors ) raise excep...
[ -0.1729784607887268, 0.5803659558296204, 0.27813297510147095, 0.6438380479812622, -0.0322103351354599, 0.13431380689144135, -0.10734366625547409, 0.29766973853111267, 0.2853705883026123, 0.03141634911298752, 0.18794909119606018, 0.4665236473083496, -0.582568883895874, 0.9791656136512756, ...
def next _ states ( cakes, flipper ) : return [ flip _ cakes ( cakes, flipper, i ) for i in range ( len ( cakes ) - flipper + 1 ) ]
[ -1.2464134693145752, 0.45830410718917847, 0.3085169792175293, 0.8841725587844849, -1.9719874858856201, 0.898819088935852, 0.4293561577796936, 0.5217808485031128, 0.18798674643039703, 0.11094731092453003, -1.2679271697998047, -0.2455601990222931, 0.5092130899429321, 0.8298587799072266, 0....
def points _ eq ( pt1, pt2 ) : x _ eq = abs ( pt1 [ 0 ] - pt2 [ 0 ] ) < small y _ eq = abs ( pt1 [ 1 ] - pt2 [ 1 ] ) < small return x _ eq and y _ eq
[ 0.12854121625423431, -0.6145683526992798, 0.532884955406189, 0.37158775329589844, -0.1254563182592392, 0.6093896627426147, -0.759395182132721, -0.20006808638572693, -0.32968032360076904, 0.9664915800094604, -0.5318426489830017, 0.3765740692615509, 0.3731391429901123, -0.23527705669403076, ...
def tokenize ( document ) : # successfully implemented tokens = nltk. word _ tokenize ( document ) perfecttokens = list ( ) for token in tokens : lowertoken = token. lower ( ) if lowertoken in nltk. corpus. stopwords. words ( " english " ) : continue perfecttoken = lowertoken index = 0 for char in string. punctuation :...
[ -0.5220770239830017, -0.7947409749031067, 0.6777992844581604, 0.11057919263839722, -0.2288099080324173, -0.47629329562187195, -0.43902185559272766, 1.291913390159607, -0.2733989953994751, 0.5367202758789062, -1.144285798072815, 0.06611137837171555, -0.37400543689727783, 0.831519603729248, ...
def conveyor ( self, value ) : rospy. wait _ for _ service ('/ eyrc / vb / conveyor / set _ power') try : self. conveyor = rospy. serviceproxy ('/ eyrc / vb / conveyor / set _ power ', conveyorbeltpowermsg ) result = self. conveyor ( value ) # return gripper. result except exception as e : rospy. logerr ( " service cal...
[ -0.08063273131847382, 0.20229901373386383, 0.6629321575164795, 0.0554603636264801, 0.29364123940467834, 0.0757056474685669, -0.31013381481170654, -1.0507748126983643, 0.30515798926353455, -0.11380885541439056, 0.2205473631620407, 0.01987956278026104, -0.7589568495750427, 0.8209090232849121...
def test _ symlink _ outside _ component _ root _ request ( self ) : with mock. patch ( " streamlit. components. v1. components. os. path. isdir " ) : # we don't need the return value in this case. declare _ component ( " test ", path = path ) with mock. patch ( " streamlit. web. server. component _ request _ handler. ...
[ 0.17481811344623566, -0.024991746991872787, 0.5900988578796387, 0.7238801121711731, -0.07455971837043762, 0.5438687205314636, 0.820918083190918, 0.33299893140792847, 0.37357044219970703, -1.3371646404266357, 0.26678183674812317, 0.9988517165184021, -0.2370404154062271, 0.6335430145263672, ...
def partial _ orderbook _ generator ( last _ update _ id : int, symbol : str, level : int = 10, block _ size : optional [ int ] = 5 _ 000 ) - > generator [ partialbook, none, none ] : database = config. db _ name db = database ( config. db _ name ) client = client ( host = config. host _ name ) client. execute ( f " us...
[ -0.6015840172767639, -0.5985546708106995, 0.880483090877533, 0.10316246002912521, -0.40550071001052856, -0.1947706639766693, 0.454952597618103, -0.45301708579063416, -0.4426273703575134, -0.14529481530189514, -0.022839516401290894, -0.014195299707353115, -0.5297389626502991, 0.290956497192...
def get _ sample _ with _ len ( self, i _ ex, length, model _ output, inputs, pruning _ scheme, name = none ) : if self. eval _ matcher is none : self. eval _ matcher = self. _ get _ eval _ matcher ( pruning _ scheme ) return self. eval _ matcher ( model _ output, inputs, length, i _ ex, name )
[ 0.2844330668449402, -0.22261950373649597, 0.4196167290210724, 0.06943132728338242, -0.869236946105957, -0.3879542946815491, -0.483073890209198, 0.13703568279743195, 0.22739894688129425, 0.08514881879091263, -0.3290032744407654, -0.17024163901805878, -0.5830775499343872, -0.7341810464859009...
def enabled ( name, * * kwargs ) : return name in get _ enabled ( )
[ 0.39225414395332336, 0.09274774044752121, 0.29069632291793823, 0.730648398399353, -0.5623568296432495, -0.14460591971874237, -1.6630146503448486, 0.7322596311569214, 0.46673744916915894, 0.3512076735496521, -1.0178725719451904, -0.1051449328660965, -1.247301697731018, 0.11972425878047943, ...
def projects _ from _ parsed ( parsed ) : projects = [ ] projects. extend ( projects _. projects _ from _ requirements ( parsed. requirements ) ) metadata = [ ] for metadata _ path in parsed. metadata : with io. open ( metadata _ path ) as file : metadata. append ( file. read ( ) ) projects. extend ( projects _. projec...
[ 0.1131805032491684, -0.1583622246980667, 0.5559812784194946, -0.731904149055481, -0.6445709466934204, 1.1147297620773315, -0.20819716155529022, 0.2886953353881836, -0.11341775208711624, 0.510507345199585, -0.5844364166259766, -0.44876325130462646, 0.1479291319847107, -0.19267043471336365, ...