text
stringlengths
25
2.19k
embedding
listlengths
768
768
def amplitude _ ring _ score ( seq, nb _ pers = np. inf ) : if nb _ pers is none : nb _ pers = np. inf seq = sorted ( seq, reverse = true ) if len ( seq ) = = 0 : return 0 if len ( seq ) = = 1 : return 1 if nb _ pers = = np. inf : mass = sum ( seq ) max _ score = 1 else : mass = sum ( seq [ : nb _ pers ] ) max _ score ...
[ 0.0935031995177269, -0.3320314884185791, 0.7085949778556824, 0.22835631668567657, -0.22152258455753326, 0.10212350636720657, 0.16746027767658234, 0.11810745298862457, 0.5041144490242004, 0.9859910607337952, -0.03999579697847366, -0.45145383477211, -0.6579771041870117, 0.8735756278038025, ...
async def _ get _ shortcut _ target ( self, message : message ) : # if the command replied to a message, then use that to get the message to edit. if message. reference is not none : target = message. reference. resolved # get full message. target = await message. channel. fetch _ message ( target. id ) # otherwise, as...
[ 0.16371777653694153, 0.27936428785324097, 0.7840803861618042, -0.24515879154205322, 1.2908179759979248, -1.2348827123641968, 0.2513035833835602, -0.8482474088668823, 0.19287504255771637, -0.6225199103355408, 1.6879535913467407, 1.321451187133789, -0.7153737545013428, 0.1387317180633545, ...
def is _ empty ( self ) : return len ( self. cards ) = = 0
[ -0.8128851652145386, -0.43222516775131226, 0.527848482131958, -0.3337213099002838, 1.0851958990097046, 0.08578629046678543, -0.9995034337043762, 0.45603859424591064, -0.17225486040115356, -0.06457696110010147, -0.8136999607086182, -0.12783987820148468, -0.24517753720283508, 0.1156638488173...
async def refresh _ token ( self ) : request = request ( method ='post ', endpoint ='/ _ open / auth ', data = {'username': self. _ username,'password': self. _ password } ) host _ index = self. _ host _ resolver. get _ host _ index ( ) resp = await self. _ http. send _ request ( session = self. _ sessions [ host _ ind...
[ -0.43666934967041016, -0.2580951452255249, 0.515576958656311, 0.3901331126689911, -0.2755637466907501, -0.2700268030166626, -0.3704753518104553, 0.018188035115599632, -0.28408029675483704, -0.39165037870407104, -0.5091777443885803, 1.3510030508041382, 0.5935990810394287, -0.369644761085510...
def dial _ url ( self ) : url = self. api _ url +'/ v2 / project /'+ self. api _ key +'/ dial'return url
[ -0.6490541100502014, -0.15235309302806854, 0.45206233859062195, 0.21998228132724762, 0.6048191785812378, 1.2302879095077515, -1.0458608865737915, 0.8603230714797974, 0.06525170803070068, 0.5410577058792114, 0.4407806396484375, 0.5222402215003967, -0.07779358327388763, 0.1206105425953865, ...
def vac _ id _ list ( ) : con = sqlite3. connect ( " testdb. db " ) # open database cur = con. cursor ( ) id _ list = [ ] sql = " select id from vacancies " try : cur. execute ( sql ) # print ( type ( ( cur. fetchall ( ) [ 0 ] ) [ 0 ] ) ) for n in cur. fetchall ( ) : id _ list. append ( n [ 0 ] ) except sqlite3. integr...
[ -0.05426590517163277, -0.7264783978462219, 0.4603692591190338, -0.14634698629379272, 1.1369307041168213, 0.8939008116722107, -0.6126068830490112, 0.6862848997116089, 0.6608521342277527, 0.508716344833374, -0.5814009308815002, -0.3504137694835663, -0.5835886597633362, 0.10515616834163666, ...
def test _ steps _ modify ( self ) : response = support. create _ project ( self,'lindsey') self. assertfalse ( response. failed, message ('should not have failed to create project ', response = response ) ) project = cauldron. project. get _ internal _ project ( ) directory = project. source _ directory r = support. r...
[ 0.1735084354877472, 0.3598397374153137, 0.7282013893127441, 0.3036908209323883, 1.097038984298706, 0.8547425866127014, 0.03196200728416443, -0.002582790330052376, 0.16012807190418243, -0.46643581986427307, -0.4437771439552307, -0.3264414966106415, -0.16800044476985931, 1.025773048400879, ...
def _ _ repr _ _ ( self ) : return " orf ( { } ". format ( self. _ _ dict _ _ )
[ -0.469432532787323, -1.6027977466583252, 0.683539867401123, -2.1171371936798096, -0.8459406495094299, -0.17544454336166382, 0.8356270790100098, -0.1769130378961563, 0.7550667524337769, 0.19709213078022003, 0.6755341291427612, 0.3349215090274811, 0.2074500024318695, -0.6827534437179565, 0...
def current ( ) : env = rave. execution. current ( ) if not env or not env. game : return none return env. game
[ -0.025426356121897697, -0.9237514138221741, 0.966435432434082, 0.46535128355026245, 0.8588857650756836, 0.33738356828689575, 0.19404827058315277, -0.5941023230552673, -0.913353443145752, 0.5613782405853271, 1.1730866432189941, 0.4336950182914734, -0.7876685857772827, 0.1427975296974182, ...
def commandlines ( self ) : raise notimplementederror
[ -0.05125563591718674, -0.45473575592041016, 0.4589383900165558, 0.6945817470550537, 0.6268416047096252, 0.7162086367607117, -0.004172808025032282, -0.8501237630844116, 0.3807545304298401, -0.6469360589981079, 0.2378939986228943, -0.325942724943161, 0.30764350295066833, 0.45950138568878174,...
def test _ atomic _ hex _ binary _ pattern _ 3 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ pattern _ 4 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - pattern - 4. xsd ", instance = " nistdata...
[ -0.3672272861003876, 0.003863109042868018, 0.5566186308860779, 0.995374858379364, 0.11319807916879654, 0.6824514269828796, -0.10907997190952301, 0.26025229692459106, -0.062014415860176086, 0.4603336751461029, -0.3661305606365204, -0.6467486619949341, -0.28752830624580383, -0.15679696202278...
def add _ airpick _ commands ( self ) : path = os. path. join ( os. path. dirname ( os. path. dirname ( _ _ file _ _ ) ), " scripts " ) program _ file = os. path. join ( path, " airpick _ methods. script " ) program _ str = read _ file _ to _ string ( program _ file ) self. add _ line ( program _ str, 2 )
[ -0.08172348886728287, -0.4496939480304718, 0.7533897757530212, 0.07400667667388916, 0.9316432476043701, 0.5616600513458252, 0.710113525390625, -0.3422812521457672, -0.18992392718791962, -0.5588150024414062, 0.054910797625780106, 0.8239386677742004, 0.581965982913971, 0.6421013474464417, ...
def _ new _ entry ( self, home _ coordinates, feed _ data ) : return feedentry ( home _ coordinates, feed _ data )
[ 1.1712687015533447, -0.9278036952018738, 0.20931148529052734, -0.5325506329536438, 0.4457782208919525, -0.3004346787929535, -1.0711824893951416, -0.6935606598854065, -0.5970668792724609, -0.7342267632484436, 0.4000224471092224, 1.0666297674179077, 0.38288938999176025, 0.03121201880276203, ...
def go ( func, * args, * * kwargs ) : def safe _ wrapped ( f ) : # noinspection pybroadexception try : f ( * args, * * kwargs ) except : on _ panic ( * sys. exc _ info ( ) ) _ be. start ( safe _ wrapped, func )
[ 0.7327930331230164, 1.2027519941329956, 0.5189002752304077, 0.8990811705589294, 0.43474850058555603, 0.1622527837753296, -0.3458136022090912, -0.3539520502090454, -0.3618364930152893, 0.4759296476840973, 0.09921759366989136, 1.162926197052002, 0.10548610985279083, -0.4380472004413605, 0....
def create _ cluster ( role _ arn ) : try : _ response = redshift. create _ cluster ( clustertype = dwh _ cluster _ type, nodetype = dwh _ node _ type, numberofnodes = int ( dwh _ num _ nodes ), # identifiers & credentials dbname = dwh _ db, clusteridentifier = dwh _ cluster _ identifier, masterusername = dwh _ db _ us...
[ -0.1021980345249176, 0.48506462574005127, 0.4953925609588623, -0.4255501627922058, 1.6159673929214478, 0.3365355432033539, 0.0344855897128582, -0.028197871521115303, 0.662563145160675, -0.24988937377929688, -0.16850848495960236, 0.7953275442123413, 0.04380401223897934, -0.05592554807662964...
def calc _ v _ err ( ch, line ) : w = ch. refined _ box [ 2 ] - ch. refined _ box [ 0 ] thr = w * 0. 25 x, y = center _ of _ char ( ch ) yv = ( 1 - line [ 0 ] * x ) / line [ 1 ] if abs ( yv - y ) > thr : return 1. else : return abs ( yv - y ) / w
[ 0.5958911776542664, -0.5382329225540161, 0.5322521328926086, 0.14345096051692963, -0.18867875635623932, -0.1051703691482544, 0.0069097839295864105, -0.6288924217224121, 0.26589563488960266, 0.1958421766757965, 0.30032867193222046, 0.745561957359314, -0.03769398108124733, 0.4547668695449829...
def last _ updated ( self, path ) : raise notimplementederror
[ -0.4787011742591858, -1.0107436180114746, 0.6462898254394531, -0.4589439928531647, -0.11274518072605133, 0.33198198676109314, -0.09287406504154205, -0.11973544955253601, 0.09424817562103271, 0.34204423427581787, 0.014176445081830025, -0.2103482037782669, 0.2879689037799835, -0.458320498466...
def updatetargetangle ( self ) : samps = getsamples ( " wavfile. wav " ) ang = - sampletoangle ( samps ) self. target _ angle = self. theta + math. radians ( ang ) self. publishangle ( )
[ -0.4846869707107544, -1.0847828388214111, 0.3310917019844055, -0.6733068823814392, 0.37463679909706116, 0.07492748647928238, 0.40546730160713196, 0.6770593523979187, 0.26160091161727905, 0.6465686559677124, 0.4944392740726471, 1.2634119987487793, -0.23020458221435547, -0.8555812239646912, ...
def go _ back ( self ) : if self. month > 1 : self. month - = 1 else : self. month = 12 self. year - = 1 # self. selected = ( self. month, self. year ) self. reset ( ) self. setup ( self. year, self. month )
[ -0.2675369083881378, -0.34575217962265015, 0.6923789381980896, -0.20099006593227386, 0.4280455410480499, 0.2098710834980011, 1.246371865272522, -0.007563022430986166, 0.29888540506362915, 0.20016303658485413, 0.2233094424009323, 0.998799741268158, -1.0803606510162354, -0.5737496018409729, ...
def has _ hash _ of ( self, destpath, code, package _ level ) : if destpath is not none and os. path. isfile ( destpath ) : with univ _ open ( destpath, " r " ) as opened : compiled = readfile ( opened ) hashash = gethash ( compiled ) if hashash is not none and hashash = = self. comp. genhash ( code, package _ level ) ...
[ 0.5590494275093079, -0.15346145629882812, 0.7619184255599976, 0.4679126739501953, 0.24362175166606903, 0.7426983714103699, -0.3141067922115326, 0.5590457320213318, -0.7222773432731628, -0.1677747219800949, -0.1797112375497818, -0.32089486718177795, 0.1976628601551056, 0.24591980874538422, ...
def run _ crt _ with _ notifications ( self, institute = none, path _ to _ crt = none, cms _ file = none, collab _ file = none, user _ settings _ file = none, output _ directory = none, log _ file = none ) : config = self. config m = messenger ( config = config ) m. send _ email ( from _ email = config. from _ email, f...
[ 0.38815978169441223, 0.008319426327943802, 0.8706793785095215, 0.41617581248283386, 0.6395015716552734, 0.018412191420793533, 0.19563794136047363, -0.28868475556373596, -0.586798906326294, 0.6781337261199951, -0.5682810544967651, 0.9830676317214966, 0.09483247250318527, -0.2664467692375183...
def test _ implicit _ token _ response ( self ) : self. assertequal ( parse _ implicit _ response ( self. implicit _ response ), self. implicit _ dict ) self. assertraises ( missingtokenerror, parse _ implicit _ response, self. implicit _ notoken ) self. assertraises ( missingtokentypeerror, parse _ implicit _ response...
[ 0.3779211640357971, -0.3686756193637848, 0.3855075240135193, -0.8107265830039978, 0.18163804709911346, 0.26900824904441833, 0.28881049156188965, -0.09476424008607864, 0.25924837589263916, -0.4408131539821625, -0.7598479986190796, -0.23625561594963074, -0.6564181447029114, -0.56346690654754...
def new ( * args, * * kargs ) : obj = itksubtractconstantfromimagefilterius3dius3 _ superclass. _ _ new _ orig _ _ ( ) import itktemplate itktemplate. new ( obj, * args, * * kargs ) return obj
[ 1.276934027671814, 0.4128214716911316, 0.48079049587249756, -0.31596750020980835, -1.025795578956604, 0.675055742263794, -0.4679529368877411, 0.9870334267616272, 0.273072749376297, -0.6353196501731873, -0.8452945351600647, -0.2983987331390381, 0.0222284235060215, -0.28288400173187256, -0...
def page _ should _ have _ number _ of _ elements ( self, count, name ) : element = self. get _ element _ from _ repo ( name ) self. xpath _ should _ match _ x _ times ( element [ 1 ], count )
[ 0.15107782185077667, 0.5985590219497681, 0.6243142485618591, 0.2765491008758545, 0.7091806530952454, 0.416233092546463, -0.35043781995773315, 0.3992129862308502, 0.5127850770950317, -0.02534165419638157, -0.3010774552822113, -0.8753975629806519, 0.15462680160999298, 0.20091372728347778, ...
def getnode ( self, nodes, node ) : try : return nodes. getelementsbytagname ( node ) [ 0 ]. firstchild. data except indexerror : return " undef "
[ -0.08306419104337692, 0.7777380347251892, 0.6220996379852295, -0.3604264259338379, 0.6471347212791443, -0.6820957064628601, -1.2820113897323608, -0.2735925614833832, -0.23860667645931244, 0.03816722333431244, 0.937992513179779, 0.637307345867157, 0.7713106274604797, 0.36887410283088684, ...
def _ add _ registry _ writes ( self, node, calls ) : regwrites = calls [ ( ( calls ['api'] = ='regsetvalueexa') | ( calls ['api'] = ='regsetvalueexw') | ( calls ['api'] = ='ntsetvaluekey') ) & ( calls ['status'] = = true ) ] for i, regwrite in regwrites. iterrows ( ) : regname = none regbuff = none for arg, val in reg...
[ -0.7427911162376404, 0.15137715637683868, 0.5023912191390991, -0.6686993837356567, 1.5766230821609497, -0.08959060907363892, 0.43591219186782837, 0.15861012041568756, 0.03447813168168068, 0.5388074517250061, 0.331229567527771, 0.5755513310432434, -0.5338501930236816, 0.5509559512138367, ...
def info ( self, comment ) : self. logger. log ( 20, comment )
[ 0.27049732208251953, -0.7341187000274658, 0.39283326268196106, -0.9543691873550415, 0.9436764717102051, -0.2787969410419464, 0.9829238057136536, -0.20853473246097565, -0.8930665254592896, 0.08225252479314804, -0.8584187030792236, -0.16013991832733154, 0.7921665906906128, 0.6276331543922424...
def update _ board ( self, window ) : unoccupied = pygame. image. load ('images / unoccupied. png') black _ stone _ image = pygame. image. load ('images / resize _ black. png') white _ stone _ image = pygame. image. load ('images / resize _ white. png') # iterate through columns, drawing a circle and adding the center ...
[ -0.6898202300071716, -0.19442054629325867, 0.9841052293777466, -0.6849892735481262, -0.4872541129589081, -0.15904176235198975, 1.4288135766983032, -0.14502014219760895, -0.845741868019104, 1.294764518737793, -0.29315412044525146, -0.011765485629439354, 0.10713852196931839, 0.32981675863265...
def test _ edit _ question ( self ) : response = self. client. post ('/ api / v2 / questions ', data = json. dumps ( self. questions ), headers = self. authheaders ) self. assertequal ( response. status _ code, 201 ) response = self. client. put ('/ api / v2 / questions / 1 ', data = json. dumps ( self. questions _ 1 )...
[ -0.7667034268379211, -0.456781804561615, 0.5505633354187012, -0.17134931683540344, 0.5106903314590454, 0.6556549668312073, -0.19439156353473663, 0.03672335296869278, -0.24236027896404266, 0.18506059050559998, -0.3450811803340912, 0.05352334305644035, -0.003709266195073724, -0.7143607139587...
def visulaizeeigen3d ( v1, v2, v3 ) : x = ( v1 - np. min ( v1 ) ) / ( np. max ( v1 ) - np. min ( v1 ) ) y = ( v2 - np. min ( v2 ) ) / ( np. max ( v2 ) - np. min ( v2 ) ) z = ( v3 - np. min ( v3 ) ) / ( np. max ( v3 ) - np. min ( v3 ) ) threed = plt. figure ( ). gca ( projection ='3d') threed. scatter ( x, y, z ) plt. s...
[ 0.7472885847091675, 0.17458023130893707, 0.7834652066230774, -0.5080779790878296, -0.3879607617855072, 1.1024110317230225, -0.3860495984554291, 0.3217942416667938, 1.0894280672073364, 0.7437617778778076, 0.1784886121749878, 0.8281417489051819, -0.14656800031661987, -0.6657880544662476, -...
async def obama ( self, ctx, *, text : str ) : text = ctx. message. clean _ content [ len ( f " { ctx. prefix } { ctx. invoked _ with } " ) : ] if len ( text ) > 280 : msg = " a maximum character total of 280 is enforced. you sent : ` { } ` characters " return await ctx. send ( msg. format ( len ( text ) ) ) async with...
[ -0.5413193702697754, 0.9083446860313416, 0.7571022510528564, 0.07757005095481873, -0.1893019676208496, -0.18491365015506744, -0.2940651774406433, -0.4167982041835785, 0.14216193556785583, -0.23333211243152618, -0.7700360417366028, 1.4169034957885742, -0.8693509697914124, 0.4122351706027984...
def nucs2d _ pileup ( self ) : reload ( nucspileup ) self. busy _ indicator ( ) qtwidgets. qapplication. processevents ( ) qtwidgets. qapplication. processevents ( ) try : self. nucs _ 3d _ det = nucspileup. nucspileup ( self. nucs _ 2d _ sgm ). nucs _ lbls _ piled self. nucs _ 3d _ det = removebordernuclei. removebord...
[ -0.6756792664527893, -0.19168180227279663, 0.6940940022468567, -0.38426774740219116, 0.41277867555618286, 0.5470136404037476, 0.338782399892807, -0.3626371920108795, 0.3600914776325226, -0.1509976089000702, -0.33006682991981506, 0.3570263087749481, 0.7171525359153748, 0.43521207571029663, ...
def is _ cusp _ collapsed ( self, cusp ) : return self. is _ branch _ or _ cusp _ collapsed ( cusp, cusp )
[ -1.065288782119751, -0.8749966621398926, 0.46239349246025085, 0.9349828958511353, -0.4590124487876892, 0.07559263706207275, 0.38180026412010193, 0.4337790012359619, 1.197854995727539, 0.12295069545507431, -0.39794623851776123, -0.7817168831825256, -1.005680799484253, 0.7299793362617493, ...
def solve ( data ) : ops = { " + " : ( lambda a, b : a + b ), " - " : ( lambda a, b : a - b ), " * " : ( lambda a, b : a * b ), " / " : ( lambda a, b : a / b ) } tokens = data. split ( " " ) stack = [ ] for token in tokens : if token in ops : arg2 = stack. pop ( ) arg1 = stack. pop ( ) result = ops [ token ] ( arg1, ar...
[ -0.7933956384658813, 0.7530490756034851, 0.7808170914649963, -0.002422291086986661, -0.5359761714935303, -1.4886497259140015, 0.3884914517402649, -1.0238384008407593, -0.3043326437473297, 0.1618594080209732, -1.325472354888916, -1.1296714544296265, -0.17459681630134583, 0.1692976951599121,...
def _ calculate _ max _ min _ bitrate ( self ) : self. max _ bitrate = max ( self. _ collect _ chunks ( ) ) self. min _ bitrate = min ( self. _ collect _ chunks ( ) ) return self. max _ bitrate, self. min _ bitrate
[ 0.16162024438381195, -0.9014790058135986, 0.5366680026054382, -0.398406982421875, -0.6093006730079651, -0.8067115545272827, -1.5600111484527588, -0.7467471361160278, -0.8243184089660645, 0.5137887001037598, -0.5846303701400757, 0.5497366189956665, -0.7636464834213257, 0.77618408203125, 0...
def scenariosfrombootstrap ( self, addtoset, numtomake, seed = none ) : assert isinstance ( addtoset, scenarioset ) bootstrap _ thetas = self. pest. theta _ est _ bootstrap ( numtomake, seed = seed ) addtoset. append _ bootstrap ( bootstrap _ thetas )
[ -0.5162844061851501, -0.1253877431154251, 0.2626814544200897, 0.3515740931034088, 0.5849102139472961, -0.6667309999465942, 0.05989301577210426, -0.5438228249549866, 0.12974324822425842, 0.1622200757265091, 0.25662505626678467, -0.05890494957566261, 0.3337576389312744, -0.07734904438257217,...
def from _ string ( self, repo, name, string ) : try : log. debug ('creating new item : % s'% name ) blob = blob. from _ string ( string ) item = item ( parent = repo, sha = blob. sha, path = name ) item. blob = blob return item except assertionerror, e : raise itemerror ( e )
[ 1.5825402736663818, -0.8954070210456848, 0.1422460675239563, 0.1653439700603485, -0.630712628364563, 1.2682701349258423, -1.0537588596343994, -0.20885244011878967, -0.48705726861953735, 0.4150145649909973, -0.8024875521659851, -0.04236767068505287, -0.4139268398284912, -1.5815504789352417,...
def get _ actual _ value ( value ) : if isinstance ( value, futures. future ) : return futures. get _ result _ or _ raise ( value ) return value
[ -0.3582113981246948, 0.997259795665741, 0.5279750227928162, 0.7662194967269897, -0.7950438261032104, -1.3679314851760864, -0.3407158851623535, -0.5184273719787598, 0.4278084933757782, -0.28836652636528015, 0.5543473362922668, -0.3894713222980499, 0.10420548170804977, 0.4938359260559082, ...
def replace _ neighbours ( classes, classified, classified _ id, org _ neighbours ) : # set up dictionary for replacement of unique neighbour values to classified neighbour values listv = np. unique ( classes ). tolist ( ) keys = [ ] values = [ ] for i in listv : keys. append ( classified _ id [ classified = = i ] ) le...
[ -0.41281241178512573, 0.06402311474084854, 0.9410064816474915, -0.364622563123703, -0.5264958143234253, 0.06014305353164673, 0.5390914082527161, 0.8640807867050171, -0.6746927499771118, 0.6483508944511414, -0.030706729739904404, 1.1798906326293945, 0.34510064125061035, 0.7174854874610901, ...
def init _ windows ( self ) : self. panels = [ scipanel ( self. frame, idx, self. config ) for idx in range ( 0, 6 ) ] self. buttons = scipanelbuttons ( self. frame, 0, self, self. config ) self. frame. sizer. add ( self. buttons, 0, flag = wx. expand ) self. menu _ open = false self. current = none self. switch _ to (...
[ -0.1708223521709442, 0.22872328758239746, 0.6175931096076965, 0.16941480338573456, 0.6122643947601318, -0.0020552293863147497, 0.50773686170578, 0.0913376435637474, 0.5464223623275757, -0.6335241794586182, -0.5891425013542175, 0.02550937794148922, -1.2563202381134033, 1.1949890851974487, ...
def generate _ cars _ train _ val _ test ( cars _ dir, annotation _ file ) : n _ classes _ in _ train = 98 n _ val _ classes = 15 train = [ ] val = [ ] test = [ ] # choose n _ val _ classes of the training classes to be in the validation set val _ classes = np. random. choice ( np. arange ( n _ classes _ in _ train ), ...
[ -0.42885398864746094, -0.12924963235855103, 0.8832364678382874, -0.30331265926361084, 0.070313960313797, 0.7270857095718384, -0.3392859101295471, 0.42894431948661804, -0.750440776348114, -0.15550324320793152, -0.11945135146379471, -0.25562939047813416, 0.6421783566474915, 0.136568069458007...
def skeleton _ bw ( thresh ) : # convert mask to boolean image, rather than 0 and 255 for skimage to use it # convert an image from opencv to skimage # thresh _ sk = img _ as _ float ( thresh ) # image _ bw = img _ as _ bool ( ( thresh _ sk ) ) # skeleton = morphology. medial _ axis ( image _ bw ) # # # # # # # # # # #...
[ 0.5438461303710938, 0.3535282015800476, 0.9250725507736206, 0.5952338576316833, -0.13827840983867645, -0.6379370093345642, 0.9068348407745361, -0.2925495207309723, 0.10627758502960205, 0.576987087726593, -0.1290791779756546, 0.7274216413497925, 0.2228786051273346, 0.4401581585407257, 0.4...
def parse ( self, text ) : return self. dict. txt2vec ( text )
[ -0.3324047029018402, -0.020357059314846992, 0.356111079454422, -1.1715500354766846, -0.36102813482284546, 0.48218974471092224, -0.7016758918762207, 0.7452574968338013, -0.22800657153129578, -0.08278288692235947, 0.137716144323349, 0.10541339218616486, -0.3680393695831299, -0.69991284608840...
def _ _ init _ _ ( self, mu _ params = np. array ( [ 0. 05, 0. 05 ] ), sigma _ params = np. array ( [ 0. 25, 0. 25 ] ), ar _ params = np. array ( [ [ 0. 50, 0 ], [ - 0. 50, 0 ] ] ), gamma = float ('inf'), c = 0. 0 ) : self. gamma, self. c, self. mu _ params, self. sigma _ params, self. ar _ params = gamma, c, mu _ para...
[ 0.7849158048629761, -0.4149118661880493, 0.7847749590873718, 0.49011752009391785, 0.4169984757900238, 0.12230159342288971, 0.23136287927627563, -0.028680620715022087, -1.0903292894363403, 0.6189355850219727, -0.1851627081632614, 0.7117257714271545, -0.2729957699775696, 0.7480857968330383, ...
def save _ images ( zip _ file, save _ dir = none, train _ test _ split _ file = none ) : print ( " extracting zip file " ) root = osp. dirname ( osp. abspath ( zip _ file ) ) if save _ dir is none : save _ dir = root may _ make _ dir ( osp. abspath ( save _ dir ) ) with zipfile ( zip _ file ) as z : z. extractall ( pa...
[ -0.574770450592041, -0.11750511825084686, 0.7568641901016235, 0.40996816754341125, -0.33766239881515503, -0.496334969997406, 1.1546653509140015, -0.16290603578090668, 0.53748619556427, 0.3842228949069977, -0.5762362480163574, -0.5942577719688416, -0.03179642930626869, 0.6257205009460449, ...
def test _ title ( self ) : print ( f'{ self. test _ title. _ _ name _ _ }'f': executing unit test for property " title " of class " slashnexthostreport ".') self. assertequal ( self. host _ report _ action. title, self. title )
[ 0.8137585520744324, 0.3612106442451477, 0.3093605637550354, 0.2077401578426361, 1.4148914813995361, 0.9225500822067261, 0.43874669075012207, -0.29620999097824097, -0.21666763722896576, -0.4563588798046112, 0.057813454419374466, 0.21109528839588165, -1.0310955047607422, -0.3009320795536041,...
def search _ and _ cancel _ inventory _ adjustment ( self ) : stock _ inventory _ obj = self. env [ " stock. inventory " ] inventory _ adjustments = stock _ inventory _ obj. search ( [ ( " is _ shopify _ product _ adjustment ", " = ", true ), ( " state ", "! = ", " done " ) ] ) for inventory _ adjustment in inventory _...
[ -0.40600696206092834, -0.7812734842300415, 0.5200932621955872, 0.582477331161499, 0.22984552383422852, 0.16475877165794373, 0.6005109548568726, -0.17989836633205414, 0.2909518778324127, 0.8169967532157898, 0.006994839757680893, 0.35306301712989807, -0.001510552247054875, 0.2363267540931701...
def _ tag _ sha ( self, owner, repo, tag ) : url = " % s / repos / % s / % s / tags " % ( self. _ api _ url, owner, repo ) data = self. get _ all _ pages ( url ) if data : for t in data : if t [ " name " ] = = tag : return t [ " commit " ] [ " sha " ] self. _ add _ error ('failed to find tag " % s " in % s.'% ( tag, ur...
[ 0.21949443221092224, 0.33036404848098755, 0.46128374338150024, -0.44297876954078674, -0.014780222438275814, -0.8671740889549255, -0.9349879026412964, -0.417244017124176, -0.7038750648498535, 0.7137371897697449, 0.16784214973449707, -0.19926556944847107, -0.05418900027871132, 0.570213675498...
def configure _ remote ( name, package _ path, destination _ name = none ) : destination _ name = destination _ name or name repo _ dest _ prefix ='/ opt / calamari / webapp / content'package _ source = get _ package _ source ( package _ path, name ) # overwrite the repo with the new packages overwrite _ dir ( package ...
[ -0.13889993727207184, 0.39407676458358765, 0.5398008227348328, -0.41811603307724, -0.49737071990966797, 0.019727256149053574, -0.6312952637672424, 0.568739116191864, 0.2977520823478699, 1.0590616464614868, -0.6110957264900208, -0.4744173586368561, 0.7368593215942383, -0.6300308108329773, ...
def imagetransformer2d _ base _ 8l _ 8 _ 32 _ big ( ) : hparams = image _ transformer2d _ base ( ) hparams. num _ heads = 16 hparams. hidden _ size = 1024 hparams. filter _ size = 2048 hparams. num _ decoder _ layers = 8 hparams. batch _ size = 1 hparams. layer _ prepostprocess _ dropout = 0. 3 hparams. query _ shape =...
[ -0.5935931205749512, 0.11477764695882797, 0.7597366571426392, -0.5744550824165344, 0.12865422666072845, -0.42241162061691284, -0.5447936058044434, -0.14130891859531403, -0.27040159702301025, 0.03116672672331333, -1.035522222518921, 0.3091844916343689, -0.06685075163841248, 0.85745263099670...
def extract _ json _ data ( table _ name, dt1, dt2 ) : try : # connect database conn = psycopg2. connect ( * * pg _ config ) conn. set _ session ( autocommit = true ) table _ name ='themoviedb'logger. debug ( " get tmdb _ data " ) date _ fmt = " % y - % m - % d " smt = " select content from { } where ts > ='{ }'and ts ...
[ -1.1478602886199951, 0.01831502467393875, 0.9927853345870972, 0.6720251441001892, -1.2567009925842285, -0.16716128587722778, -0.8111127614974976, -0.6719565987586975, -1.2701541185379028, 1.2204482555389404, -0.25402840971946716, 1.0240099430084229, -0.2446897178888321, 0.5253443717956543,...
def prepare _ request _ uri ( self, * args, * * kwargs ) : raise notimplementederror ( " must be implemented by inheriting classes. " )
[ -1.555387020111084, -0.3144584894180298, 0.9969657063484192, 0.8959500193595886, -0.06981237977743149, 0.6157068610191345, -0.32212555408477783, 0.012032415717840195, 0.31629976630210876, -1.0331224203109741, -0.0717235878109932, -0.0947091206908226, 0.15770554542541504, 0.1042830199003219...
def mask2boxorellipse ( mask, mode = " box ", n _ jobs = 1 ) : idxes = [ ] output = [ ] for i in range ( mask. shape [ 0 ] ) : for j in range ( mask. shape [ 1 ] ) : if mask [ i, j ] = = 1 : idxes. append ( [ i, j ] ) idxes = np. array ( idxes ) idx _ clusters = dbscandenoise ( idxes, epsilon = 20, minimum _ samples = ...
[ -0.9167023301124573, -0.0033151768147945404, 1.0978072881698608, 0.6691530346870422, -0.06977343559265137, -0.37247195839881897, 0.23094460368156433, -0.933660089969635, 0.45112374424934387, 0.8866279721260071, -0.3468610644340515, -0.1178460344672203, -0.005698919761925936, -0.46520736813...
def create ( options, args ) : try : with context _ managers. mkdtemp ( ) : if not os. isatty ( sys. stdin. fileno ( ) ) : try : b = blueprint. blueprint. load ( sys. stdin, args [ 0 ] ) except valueerror : logging. error ('standard input contains invalid blueprint json') sys. exit ( 1 ) else : b = blueprint. blueprint...
[ 0.462800532579422, -0.2993081510066986, 0.9224985241889954, 0.7938998341560364, 0.325690358877182, 0.8544211983680725, 0.15818794071674347, -0.5033910274505615, -0.36755460500717163, 0.11172286421060562, -0.09683752059936523, 0.05552045255899429, -1.677566409111023, -0.09019848704338074, ...
def uses _ database ( func ) : @ wraps ( func ) def decorated _ function ( * args, * * kwargs ) : with models. db. session _ scope ( ) as session : flask. g. db _ session = session return func ( * args, * * kwargs ) return decorated _ function
[ -0.5894612073898315, 0.23732198774814606, 0.8103777170181274, 0.034811221063137054, 0.1836225986480713, -0.2323809713125229, 0.4435020089149475, -0.592515230178833, 0.6191208362579346, 0.7632395625114441, 0.42169082164764404, 1.24144446849823, 0.6716359257698059, 0.09755110740661621, 0.5...
def ww3 _ grid ( in _ ww3 _ grb = none ) : if in _ ww3 _ grb is none : # read file in _ ww3 _ grb = pygrib. open ( ww3 _ f ) # get gribmessage grb = in _ ww3 _ grb. read ( 1 ) [ 0 ] lat, lon = grb. latlons ( ) # reset in _ ww3 _ grb. seek ( 0 ) return lat, lon
[ 0.09583549946546555, -0.6984002590179443, 0.6804527044296265, 0.1132381334900856, 0.26936134696006775, 0.4040079414844513, 0.10558785498142242, 0.524671196937561, -0.8270626068115234, 0.8562067747116089, 0.3443019986152649, 0.4437777101993561, -0.7485066652297974, -0.1869841068983078, 0....
def get _ anno ( pths ) : ims = [ ] lbl _ bbox = [ ] for pth in anno _ pths : for dirpath, dirnames, filenames in os. walk ( pth ) : for file in filenames : file = path ( file ) if file. suffix = = ". xml " : try : name, bbs = read _ content ( dirpath / file ) ims. append ( name ) lbl _ bbox. append ( bbs ) except : pr...
[ 0.08206865936517715, -1.0159467458724976, 0.6476597785949707, 0.5917871594429016, -0.16382591426372528, 0.6161816716194153, 0.5055609941482544, -0.5632290840148926, -0.3126698136329651, 0.4843336045742035, 0.414176881313324, -0.11720092594623566, -0.03789528086781502, 1.4016236066818237, ...
def main ( ) : # start the option parser. p = optparse. optionparser ( ) p. add _ option ('- v ','- - verbose ', default = false, action = " store _ true ", help = " turn on verbose output [ default : % default ] " ) p. add _ option ('- s ','- - sys ', default = " xf : 23id1 - va ", type = " string ", help = " system p...
[ 0.797398567199707, 0.0038780353497713804, 1.1555601358413696, 0.37113460898399353, 0.7398922443389893, 0.018994038924574852, 0.1861121654510498, 0.30634257197380066, -0.2250249832868576, 0.5160104632377625, -0.4798358082771301, 0.2506849467754364, -0.21962079405784607, -0.2915859520435333,...
def islicensed ( self ) : return true
[ 1.691400170326233, -0.7890327572822571, 0.47407951951026917, 1.2398014068603516, 0.1485494077205658, 0.6698654890060425, -0.07171747833490372, 0.6869485974311829, 1.922116994857788, -1.413377285003662, -0.47138500213623047, 0.20550993084907532, -1.0401276350021362, 0.4226303994655609, -2...
def get _ next _ event _ id ( self, event, filter ) : raise notimplementederror
[ -0.17775483429431915, -0.19733184576034546, 0.6483690142631531, 0.7398244738578796, -1.1506034135818481, 0.6021731495857239, 0.39338067173957825, 0.09690019488334656, 0.39390072226524353, 0.4048670828342438, 0.14788179099559784, 0.9505829215049744, 0.11897221952676773, 0.06212584301829338,...
def test _ random ( ) : min _ qty = 5 max _ qty = 25 quota = quotas. random ( min _ qty, max _ qty ) for i in range ( 0, 1000 ) : qty _ int = int ( quota ) qty _ float = float ( quota ) # check the quantity falls between the given min / max range assert qty _ int > = min _ qty and qty _ int < = max _ qty assert qty _ f...
[ -0.5487546324729919, -0.9238784909248352, 0.5263704657554626, -0.2716229259967804, 0.09520600736141205, 0.5880416035652161, -0.8096304535865784, -0.9678509831428528, 0.22408033907413483, -0.6501836180686951, -0.34092095494270325, 0.34997355937957764, 0.30329158902168274, -0.269723683595657...
def get _ app ( app ) : if isinstance ( app, ( str, unicode ) ) : # if it's a string, use the models module app = models. get _ app ( app ) mod = _ _ import _ _ ( app. _ _ name _ _ [ : - 7 ], { }, { }, ['migrations'] ) if hasattr ( mod,'migrations') : return getattr ( mod,'migrations')
[ -0.022073805332183838, 0.6594982147216797, 0.40353161096572876, 0.7586392164230347, -0.6301953196525574, 0.08709220588207245, -0.21547387540340424, -1.139026165008545, 0.6949116587638855, 0.7706995606422424, 0.16553257405757904, -0.23232580721378326, 0.3845234513282776, 0.18268975615501404...
async def author _ icon ( self, ctx : context, author _ icon : t. union [ member, str ] ) - > none : if isinstance ( author _ icon, member ) : author _ icon = author _ icon. avatar _ url _ as ( format = " png " ) embed = self. embeds [ ctx. author ]. embed embed. set _ author ( name = embed. author. name, url = embed. ...
[ -0.060238514095544815, -0.5089116096496582, 0.508394181728363, 0.4904320240020752, -0.5873499512672424, 0.3797518312931061, 0.10030390322208405, 1.08971107006073, 0.1622617393732071, 0.4351012706756592, -1.0314220190048218, 0.8892626762390137, 0.5018750429153442, -0.6764159202575684, 0.1...
def augment _ scalyr _ client _ user _ agent ( self, fragments ) : # type : ( list [ six. text _ type ] ) - > none pass
[ -0.023781336843967438, -0.14761416614055634, 0.23968952894210815, 0.6530014872550964, 0.8865020871162415, 0.331140398979187, 0.5223162174224854, -0.14099536836147308, 0.936377227306366, -0.5532472133636475, -0.5396536588668823, 0.4979446828365326, -0.06904031336307526, -0.7339575290679932,...
def test _ atomic _ hex _ binary _ enumeration _ 1 _ nistxml _ sv _ iv _ atomic _ hex _ binary _ enumeration _ 2 _ 3 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / hexbinary / schema + instance / nistschema - sv - iv - atomic - hexbinary - enumeration - 2. xsd ", instance ...
[ -0.8000330924987793, -0.47393447160720825, 0.7014070749282837, 0.8040611743927002, 0.0037165365647524595, 0.5510274767875671, -0.3086407482624054, 0.1423436403274536, -0.13296084105968475, 0.2893584072589874, -0.5871569514274597, -0.2608685791492462, 0.1977805495262146, 0.4360501170158386,...
def collect _ metrics ( self, group _ name = none, data = none ) : # pylint : disable = too - many - branches self. log. debug ('entry') if data is none : data = list ( ) if group _ name is none : group _ metrics = list ( self. pm _ group _ metrics. values ( ) ) else : group _ metrics = [ self. pm _ group _ metrics. ge...
[ 0.07873503863811493, 0.4070815145969391, 0.6260659694671631, 0.21258781850337982, -0.14638465642929077, 0.10591492056846619, 0.14566859602928162, -0.7537485361099243, -0.40052613615989685, 0.17898033559322357, 0.5243950486183167, 0.3110963702201843, -0.6380532383918762, 1.0831282138824463,...
def day _ func ( index ) : day = 0 for patch in self. value. values [ index ] : day + = self. value. values [ index ] [ patch ] * \ self. areas [ patch ] return day / self. total _ area
[ -0.5979371070861816, 0.012209367007017136, 0.4405239224433899, -1.0827312469482422, 0.0956396758556366, 0.4770256280899048, 1.154950737953186, -1.1532713174819946, 0.440292090177536, -0.6732563376426697, 0.38756829500198364, -0.3905651569366455, 0.7922901511192322, 0.07352487742900848, 0...
def get _ adj _ rib _ in ( afi _ safi, peer _ ip ) : prefix = flask. request. args. get ('prefix') community = flask. request. args. get ('community') if prefix or community : if prefix : return flask. jsonify ( {'attr': api _ utils. get _ adj _ rib _ in ( peer _ ip, afi _ safi, prefix ) } ) else : return flask. jsonif...
[ -0.2701549232006073, 0.07716607302427292, 0.4610944986343384, 0.19731280207633972, 0.23575983941555023, -0.6039701700210571, -0.30617058277130127, 0.23071348667144775, -0.3332024812698364, 0.41211479902267456, 1.7056068181991577, 0.19693368673324585, -0.2207755446434021, 0.826337993144989,...
def local _ cech _ matrix ( self, n _ dim, deg, nerve _ spx _ index, nerve _ face _ index, nerve _ coeff ) : deg _ sign = ( - 1 ) * * deg if deg = = 0 : # save space for boundary matrix boundary = np. zeros ( ( self. subcomplexes [ n _ dim - 1 ] [ nerve _ face _ index ] [ deg ], self. subcomplexes [ n _ dim ] [ nerve _...
[ 0.6863670349121094, -0.19673967361450195, 0.6624507904052734, -0.19465960562229156, -0.358974426984787, 0.5486785769462585, 1.3137561082839966, 0.4800716042518616, 0.397319495677948, -0.16273047029972076, -0.4359302520751953, 0.44540324807167053, 0.012974284589290619, -0.14057406783103943,...
def chi2func ( params, nmax, im, nm ) : betax = params [ 0 ] betay = params [ 1 ] xc = params [ 2 ] yc = params [ 3 ] if betax < 0. : print'warning : betax going negative, setting to 0. 0'betax = 0. if betay < 0. : print'warning : betay going negative, setting to 0. 0'betay = 0. print'beta : ( % f, % f ) \ txc : ( % f,...
[ 0.4188200831413269, -0.3665250539779663, 0.4548783004283905, -0.3725920021533966, 0.19895170629024506, -0.1742800921201706, -0.21887707710266113, -0.39121589064598083, -0.7949213981628418, 0.42180731892585754, -0.21665018796920776, 0.16394518315792084, -0.3806644082069397, 0.10934765636920...
def resolve _ command ( cmd _ ) : try : if cmd _. find (':') < 0 : cmd _ ='system : % s'% cmd _ ns, cmd _ = cmd _. split (': ', 1 ) obj = get _ command ( ns ) cmd = getattr ( obj,'cmd _ % s'% cmd _ ) return obj, cmd, ns, cmd _ except ( keyerror, attributeerror ) : print ('error! command % s does not exist'% cmd _, file...
[ 0.08609862625598907, -0.7518864870071411, 0.7727667689323425, 0.4601197838783264, 0.48503655195236206, -0.516428530216217, -0.160935178399086, -0.39172300696372986, -0.32976970076560974, -0.46555766463279724, -0.14395873248577118, 0.09890194237232208, 0.7710878849029541, 0.7543856501579285...
def clipdata ( datadf, startdate, enddate ) : # clip data - frame to desired period, since index is already datetime series, # simply using pd. loc to subset / clip datadf = datadf [ startdate : enddate ] # report missing value counts missingvalues = datadf [ " discharge " ]. isna ( ). sum ( ) return ( datadf, missingv...
[ -0.1305708885192871, -0.3651210367679596, 0.44438016414642334, -0.7969614267349243, 0.09695760160684586, 0.854850709438324, -0.14386266469955444, 0.5745943784713745, -0.5419655442237854, -0.16491690278053284, 0.7043808698654175, 1.4373561143875122, 1.4850049018859863, -0.3641660809516907, ...
def remove _ identation _ multiline _ string ( text ) : pass
[ 0.03504223749041557, -1.524273157119751, 0.3806317150592804, 0.555130660533905, -0.9156931042671204, -0.3339443802833557, 0.07408975064754486, 0.924494743347168, 0.9127389192581177, 0.7481316924095154, -0.38327446579933167, -0.5742480158805847, -0.7500417232513428, -0.16683827340602875, ...
def indexwordslocation ( words _ rc ) : logger = logging. getlogger ( logger _ name ) config = words _ rc. config ( ) location _ categories = ['occurrences ','false _ positives'] index = { name : { } for name in location _ categories } for word in config : word _ obj = config [ word ] for location _ category in word _ ...
[ 0.12771934270858765, -0.5129679441452026, 0.4447369873523712, -1.1741466522216797, -0.30263638496398926, -0.03165724501013756, 1.0895370244979858, 0.6982388496398926, -0.3776032626628876, 0.9187270998954773, 0.4390171766281128, -0.37136706709861755, -0.39625969529151917, 0.0774849504232406...
def test ( input _ image _ path, output _ image _ path, checkpoint _ dir ) : # placeholder to pass raw image into raw _ image = tf. placeholder ( tf. string ) # decode image, resize, and standardize ( as in training ) image = tf. image. decode _ png ( raw _ image, 3 ) image = tf. image. resize _ images ( image, ( image...
[ -0.2024850845336914, -0.2767171263694763, 0.9167265295982361, 0.586550235748291, 0.7675644755363464, 0.05730723217129707, 0.7385509014129639, -0.34745675325393677, 0.0004024786176159978, -0.784702479839325, -0.002086426131427288, -0.37652096152305603, 0.6785562038421631, -0.809839963912963...
def get _ object ( table, object _ id ) : log. info ('get % s from object _ id : % s'% ( table. _ _ name _ _, object _ id ) ) try : tbl = table. objects. get ( pk = int ( object _ id ) ) return tbl except table. doesnotexist : raise http404
[ 0.5965921878814697, -0.03658519685268402, 0.5770031809806824, 1.0040141344070435, 0.45882126688957214, 0.20830266177654266, 0.2854098975658417, -0.7460200190544128, -0.42091667652130127, 0.4599832594394684, 0.3805936574935913, 1.0378222465515137, 0.7916901707649231, -0.477647602558136, -...
def clean _ str ( string ) : string = re. sub ( r " [ ^ a - za - z0 - 9 ( ),!? \'\ ` ] ", " ", string ) string = re. sub ( r " \'s ", " \'s ", string ) string = re. sub ( r " \'ve ", " \'ve ", string ) string = re. sub ( r " n \'t ", " n \'t ", string ) string = re. sub ( r " \'re ", " \'re ", string ) string = re. sub...
[ 0.8242310881614685, -1.3044049739837646, 1.0701793432235718, -0.6050919890403748, -0.8499029278755188, 0.04370803013443947, 0.22021208703517914, -0.34857961535453796, 0.3682587146759033, 0.4203914701938629, 0.08766751736402512, -0.1363062858581543, -0.6673347353935242, -0.06197372078895569...
def switchscenedelaytimer ( scene, seconds ) : counter = 0 while counter < seconds : time. sleep ( 1 ) counter + = 1 parent. setobscurrentscene ( scene, callbacklogger ) return
[ -0.3569697439670563, 0.084162637591362, 0.6276872754096985, -0.22266694903373718, -1.231342077255249, -0.3601001799106598, -0.5624943375587463, -1.3294765949249268, 0.2749960124492645, -0.2079973816871643, -0.2591196596622467, 0.866921067237854, 0.6149241924285889, 0.7557751536369324, 0....
def get _ manager ( ) : global _ manager if _ manager is none : _ manager = processmanager ( ) atexit. register ( _ manager. close ) return _ manager
[ -0.2110268473625183, -0.44873708486557007, 0.42184799909591675, -0.44304943084716797, 0.49830663204193115, -0.31255337595939636, -0.6402985453605652, 0.2563130259513855, -0.042513877153396606, -1.0820951461791992, 0.39188775420188904, 0.7855068445205688, -1.6031569242477417, 0.618102848529...
def get _ data ( self ) : materials = [ ] for row in self. df. iterrows ( ) : material = { } for column _ name in self. get _ column _ names ( ) : material [ column _ name. replace ( '. ','' ). replace ('$ ','' ) ] = row [ 1 ] [ column _ name ] materials. append ( material ) return materials
[ -0.8621260523796082, -0.6315746307373047, 0.5034845471382141, -0.3918132483959198, -0.28538164496421814, -0.37141770124435425, -1.1489287614822388, 0.1983281672000885, -0.768429696559906, -0.0760967880487442, -0.23725521564483643, 0.3044999837875366, 0.4283921718597412, 0.345969557762146, ...
def tmat ( q ) : t = np. array ( [ [ - 2. 0 * q [ 4 ], 2. 0 * q [ 3 ], - 2. 0 * q [ 6 ], 2. 0 * q [ 5 ] ], [ - 2. 0 * q [ 5 ], 2. 0 * q [ 6 ], 2. 0 * q [ 3 ], - 2. 0 * q [ 4 ] ], [ - 2. 0 * q [ 6 ], - 2. 0 * q [ 5 ], 2. 0 * q [ 4 ], 2. 0 * q [ 3 ] ] ] ) return t
[ 0.13996621966362, -0.7687219977378845, 0.940990149974823, -1.4788089990615845, 0.18777844309806824, 0.665165901184082, -0.22093379497528076, -0.4068630635738373, 0.0498095341026783, 0.4575701653957367, -0.6578490734100342, -0.4377676546573639, -0.11348707973957062, -0.24396687746047974, ...
def binary _ search _ recur ( arr, target ) : if len ( arr ) = = 0 : return false mid _ point = len ( arr ) / 2 if target = = arr [ mid _ point ] : return true elif target > mid _ point : return binary _ search _ recur ( arr [ mid _ point : ], target ) else : return binary _ search _ recur ( arr [ : mid _ point ], targ...
[ -0.31635648012161255, -0.04977385699748993, 0.47732967138290405, 0.7086012363433838, -0.32426348328590393, -0.1243823915719986, -0.16139714419841766, -0.609555721282959, 0.6802354454994202, 0.06744737178087234, 0.27543288469314575, 0.4463365375995636, -0.382476806640625, 0.5465903282165527...
def concat ( dfs : " list [ dataframe ] ", rechunk = true ) - > " dataframe " : assert len ( dfs ) > 0 df = dfs [ 0 ] for i in builtins. range ( 1, len ( dfs ) ) : try : df = df. vstack ( dfs [ i ], in _ place = false ) # could have a double borrow ( one mutable one ref ) except runtimeerror : df. vstack ( dfs [ i ]. c...
[ -0.3881964385509491, 1.4967149496078491, 0.7163159251213074, 2.0657453536987305, 0.38498786091804504, -0.8052537441253662, 0.6183430552482605, -0.23397816717624664, 0.17961561679840088, -0.1854030340909958, 0.4840811491012573, -0.22932471334934235, -0.3731917142868042, 0.46915900707244873,...
def _ _ get _ next _ add _ events _ task ( self, bytes _ allowed _ to _ send, for _ pipelining = false ) : log. log ( scalyr _ logging. debug _ level _ 1, " getting batch of events to send. ( pipelining = % s ) " % six. text _ type ( for _ pipelining ), ) start _ time = time. time ( ) # we have to iterate over all of t...
[ -0.3676726520061493, 0.624068558216095, 0.9535444378852844, -0.09181042015552521, 0.13631415367126465, -0.8830019235610962, 0.12380698323249817, -0.4003303349018097, -0.41522014141082764, -0.13907460868358612, -0.16018462181091309, 1.025892972946167, -0.8307643532752991, 0.1753469109535217...
def readcharattributes ( self, inputevent = none ) : attrs, start, end = self. utilities. textattributes ( orca _ state. locusoffocus, none, true ) # get a dictionary of text attributes that the user cares about. [ userattrlist, userattrdict ] = self. utilities. stringtokeysanddict ( _ settingsmanager. getsetting ('ena...
[ 0.1799985021352768, -0.22797539830207825, 0.4683353304862976, -0.23175592720508575, -0.9381502270698547, -0.6531367301940918, 0.13031549751758575, 0.10051146149635315, 0.3797602653503418, 0.18787305057048798, 0.495114803314209, 0.12151704728603363, -0.32015442848205566, 0.07673734426498413...
def addinput ( self, frame ) : self. input _ queue. put ( ( self. preprocess _ frame, frame ) )
[ -0.5053864121437073, 0.15950700640678406, 0.6925702691078186, -0.3586241900920868, 0.6024090647697449, 0.8124651908874512, 0.09206560999155045, -0.2411458045244217, 0.6378207802772522, -0.9399333000183105, -1.0562416315078735, 1.0867820978164673, -0.7739900350570679, 1.1114659309387207, ...
def is _ board _ full ( board ) : for x in range ( 3 ) : for y in range ( 3 ) : if not board [ 0, x, y ] and not board [ 1, x, y ] : return false return true
[ -0.027964100241661072, 0.7748475074768066, 0.5796562433242798, 0.621160626411438, -0.14688217639923096, 0.7685108780860901, -0.8474225997924805, 0.5693095326423645, 0.19216373562812805, 0.2148836851119995, -0.5427765250205994, -0.7760934233665466, -0.7421153783798218, -0.10209370404481888,...
def validate _ access _ token ( self, client _ key, token, request ) : raise notimplementederror ( " subclasses must implement this function. " )
[ -0.1672726422548294, -0.6794577240943909, 0.5487451553344727, 0.17241841554641724, -0.5100541114807129, 0.678654670715332, 0.12288015335798264, -0.3375689387321472, -0.7057158946990967, -0.051752012223005295, 0.9098051190376282, 0.7740515470504761, 0.5967111587524414, 0.31212562322616577, ...
def get _ previous _ region _ searches ( to _ page ) : data = searches. get _ previous _ regions ( ) page ='submissions'if to _ page = ='checklists'else'sightings'return render _ template ('previous _ regions. html ', data = data, page = page )
[ 0.13573551177978516, 0.9450470805168152, 0.37862083315849304, -0.29568782448768616, 1.2747620344161987, -0.07900000363588333, 0.12605774402618408, -0.1378510445356369, 0.00146125303581357, 0.07612909376621246, 0.9013355374336243, -0.0034664759878069162, -0.007795055862516165, 1.05429184436...
def check _ all _ boundary ( self, y ) : if np. sum ( y = = self. maj _ label ) < = np. sum ( y = = self. min _ label ) : raise valueerror ( " too many majority samples identified as boundary " )
[ 0.35032427310943604, -0.49471497535705566, 0.6665787100791931, 0.9135190844535828, 0.6696428060531616, 1.2561527490615845, -0.28463128209114075, -0.8663821816444397, 0.3146607279777527, 0.11072028428316116, 0.5049728155136108, 0.445605993270874, -0.2703925371170044, 1.2586480379104614, -...
def cech _ diff ( self, n _ dim, deg, start _ chains ) : image _ chains = local _ chains ( self. nerve _ spx _ number [ n _ dim ] ) # cech differential for nerve _ spx _ index in range ( self. nerve _ spx _ number [ n _ dim ] ) : loc _ im _ ref, loc _ im _ coord = self. cech _ diff _ local ( start _ chains, n _ dim, de...
[ 0.025109607726335526, -0.29577577114105225, 0.3083169460296631, 0.5881810188293457, 0.14297229051589966, 0.41539427638053894, 0.37428954243659973, -0.3471072316169739, -0.32114356756210327, -0.16514496505260468, -0.05200852081179619, 0.038380593061447144, 0.31639042496681213, 0.62288737297...
def _ validate ( self, job : job, *, raise _ on _ failure : bool = false, * * kwargs # pylint : disable = unused - argument ) - > validationresult : git _ code _ validation _ result = schemavalidatablemixin. _ create _ empty _ validation _ result ( ) # todo : move this check to job. _ validate after validation is suppo...
[ 0.10996255278587341, 0.5946123003959656, 0.8007752895355225, 0.11852819472551346, -0.05345192551612854, -0.32498636841773987, -0.2214970886707306, 0.054509010165929794, -0.6211130619049072, -0.0029998517129570246, 0.2426992952823639, -0.11941568553447723, -0.5475811958312988, 0.91642087697...
def score ( hand ) : list _ hand = list ( hand ) if len ( list _ hand ) = = 0 : return 0 else : ilosci = [ dummy _ x * list _ hand. count ( dummy _ x ) for dummy _ x in list _ hand ] return max ( ilosci )
[ 0.07504864037036896, 0.740801990032196, 0.5524118542671204, 0.7579734325408936, 0.4175085425376892, 0.19697870314121246, -0.6222306489944458, 0.8163397312164307, 0.5940585136413574, 0.3190932273864746, -1.0038671493530273, -0.5934849977493286, 0.07574217021465302, 1.1199942827224731, -0....
def to _ double ( x, name = " todouble " ) : return cast ( x, dtypes. float64, name = name )
[ -0.7824907302856445, 0.6154989004135132, 0.6609052419662476, 0.8896335363388062, -0.5038446187973022, -0.3029383420944214, -0.858977198600769, -1.3720675706863403, 0.3594508767127991, 0.5625060796737671, -1.3759911060333252, 0.517770528793335, 1.1547927856445312, -0.4726991355419159, -0....
def logistic ( weights, data, targets, parameters ) : # todo : finish this function # extract dimension parameter n f = 0 n = data. shape [ 0 ] m = data. shape [ 1 ] new _ col = np. ones ( n ) newdata = np. column _ stack ( ( data, np. ones ( np. shape ( data ) [ 0 ] ) ) ) # add extra colum to accomudate for w0 z = np....
[ 0.39835870265960693, 0.006938474252820015, 0.7870326638221741, 0.19872860610485077, 0.27739083766937256, -1.1171579360961914, 0.6780850887298584, 0.11961164325475693, -0.6669801473617554, 0.4833929240703583, 0.22919175028800964, 0.3088972866535187, 0.09103556722402573, -0.22150664031505585...
def askdate ( ) : askeddays = list ( ) thisday = datetime. datetime. today ( ) dayanswers = dict ( ) for i in range ( 3 ) : askeddays. append ( thisday ) dayanswers [ str ( i ) ] = formatdatestring ( thisday ) thisday + = datetime. timedelta ( days = 1 ) dayanswers ['o'] ='jokin muu paiva'daymenu = multimenu ( dayanswe...
[ -0.707566499710083, 0.16138993203639984, 0.6149134635925293, 0.49881279468536377, -0.7881417870521545, 0.5302823185920715, -0.34437474608421326, -0.04479369893670082, 0.41432252526283264, -1.1192901134490967, -0.3240956962108612, 0.0001563137338962406, 0.04576484486460686, 0.41235390305519...
def geometric ( ctx : probctx ) - > int : sample = ctx. sample ( uniform ( 0. 0, 1. 0 ), is _ cont = false ) ctx. constrain ( sample, 0. 0, 1. 0 ) if sample < 0. 2 : return 1 else : return 1 + geometric ( ctx )
[ 0.14305496215820312, 0.44921353459358215, 0.6257579326629639, 0.478598028421402, -0.19301839172840118, 0.976473331451416, 0.6609592437744141, -0.7199222445487976, -0.17784790694713593, -0.2688288986682892, 0.6436221599578857, 0.9948990345001221, -0.03473779559135437, -0.46017175912857056, ...
def trove _ dashboard _ relation _ broken ( ) : juju _ log ('trove - plugin - relation - broken hook run')
[ 0.475818932056427, 0.3485877811908722, 0.3938027024269104, 0.35038405656814575, 1.2452332973480225, -0.34248480200767517, 1.1178058385849, 0.18843849003314972, -0.42661017179489136, 0.1052880734205246, 0.15132947266101837, 0.37406355142593384, -0.2806035280227661, -0.7200475931167603, 0....
def _ _ eq _ _ ( self, other ) : if not isinstance ( other, stackrequest ) : return false return self. _ _ dict _ _ = = other. _ _ dict _ _
[ -0.8166825175285339, 0.08556272834539413, 0.7480603456497192, 0.5742558240890503, -0.10721896588802338, -0.10752703994512558, -0.05529925227165222, -1.234555959701538, 0.2721138894557953, -0.04750785604119301, -0.7159450054168701, 0.08824446052312851, -0.12369709461927414, 0.60611224174499...
def _ _ init _ _ ( self, user ) : self. user = user self. s1 = models1. query. filter _ by ( user = user ). first ( ) self. s2 = models2. query. filter _ by ( user = user ). first ( ) self. s2 _ products = models2products. query. filter _ by ( user = user ). all ( ) self. s3 = models3. query. filter _ by ( user = user ...
[ -0.35026001930236816, 0.18225887417793274, 0.5666038393974304, 1.415015697479248, 0.12345388531684875, 0.13809020817279816, 1.3955152034759521, -0.5461689829826355, -0.14108410477638245, 0.05863279849290848, -0.7777020335197449, 0.0075531005859375, 0.3114026188850403, 0.32086265087127686, ...