text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def greedy _ cow _ transport ( cows, limit = 10 ) : trips = [ ] # transform the dictionary to sorted list cow _ list = [ [ k, cows [ k ] ] for k in sorted ( cows, key = cows. get, reverse = true ) ] while len ( cow _ list ) > 0 : totalweight = 0 temp = [ ] temp _ list = cow _ list. copy ( ) for cow in temp _ list : if ... | [
-0.7873181700706482,
0.09348110109567642,
0.8538679480552673,
-0.28643715381622314,
0.4392585754394531,
-0.447120726108551,
-0.37272751331329346,
-0.6345223784446716,
-0.4678966701030731,
1.023508906364441,
-0.7919266223907471,
-0.12644776701927185,
0.5820176005363464,
0.12373113632202148,... |
def test _ atomic _ base64 _ binary _ length _ 3 _ nistxml _ sv _ iv _ atomic _ base64 _ binary _ length _ 4 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / base64binary / schema + instance / nistschema - sv - iv - atomic - base64binary - length - 4. xsd ", instance = "... | [
0.4101068377494812,
-0.11406275629997253,
0.3893890082836151,
0.9553084373474121,
0.06283999979496002,
0.16585493087768555,
0.41431015729904175,
-0.02299288474023342,
-0.5037745237350464,
0.5447309613227844,
-0.9595385789871216,
-0.3044101297855377,
-0.609347403049469,
0.023231834173202515... |
def agg _ maxabs _ sign _ at _ n ( m, n = 1 ) : m _ = np. copy ( m ) m _. sort ( ) a = np. array ( [ m _ [ : n ]. mean ( ), m _ [ - n : ]. mean ( ) ] ) return max ( a, key = lambda x : abs ( x ) ) | [
-0.7626462578773499,
0.2666887044906616,
0.783662736415863,
0.4616725742816925,
-0.993279218673706,
0.3854081332683563,
-0.43202000856399536,
-0.45675691962242126,
-0.6847225427627563,
1.2024800777435303,
0.45612573623657227,
0.1686372011899948,
0.4836619198322296,
1.1385219097137451,
-0... |
def register ( ) : req = request. get _ json ( ) if'username'not in req or'password'not in req or'email'not in req : abort ( 400,'missing credentials') username = req ['username'] password = req ['password'] email = req ['email'] credential _ checking ( password ) email _ checking ( email ) user = user ( username = use... | [
-0.6072651147842407,
0.38631805777549744,
0.9842274188995361,
0.5365151762962341,
0.5923962593078613,
0.0767885372042656,
-0.3138025403022766,
0.5328945517539978,
-0.7348099946975708,
0.11922714859247208,
-0.2792418897151947,
0.4173424541950226,
-0.09678716212511063,
-0.22412323951721191,
... |
def _ check _ eofs _ input _ arrays ( arrays ) : # all inputs must have the same number of samples, i. e., # same size for the first dimension. n _ samples = none for a in arrays : if n _ samples is none : n _ samples = a. shape [ 0 ] else : if a. shape [ 0 ]! = n _ samples : raise valueerror ('numbers of samples do no... | [
0.5046883225440979,
0.0639973133802414,
0.6833640933036804,
0.3469601273536682,
0.48731496930122375,
0.4243294894695282,
0.661357045173645,
-0.3226429224014282,
0.20883262157440186,
0.6169635653495789,
0.7297265529632568,
-0.544512152671814,
0.05127726495265961,
1.669426679611206,
0.0329... |
def filter _ matches ( user _ data ) : # user _ data : [ id, age, min _ age, max _ age, sex, interest, lat, long, max _ dist ] user _ age = user _ data [ 0 ] [ 1 ] min _ age = user _ data [ 0 ] [ 2 ] max _ age = user _ data [ 0 ] [ 3 ] user _ sex = user _ data [ 0 ] [ 4 ] interest = user _ data [ 0 ] [ 5 ] latitude = u... | [
-0.40974271297454834,
-0.5046650171279907,
0.6841943860054016,
-0.1597163826227188,
-0.7687205672264099,
0.4090732932090759,
-0.3503679931163788,
-0.11176729947328568,
-0.6579540967941284,
-0.2871526777744293,
-0.1853310614824295,
0.49576863646507263,
0.14342378079891205,
-0.25463020801544... |
def print _ number _ served ( self ) : print ( f " \ nthere are { str ( self. number _ served ) } people come today. " ) | [
0.21284504234790802,
-0.4759387969970703,
0.6676473617553711,
-0.2639014422893524,
0.43641793727874756,
1.0640398263931274,
0.44557952880859375,
0.18248692154884338,
-1.4197938442230225,
-0.1891142725944519,
0.04186294972896576,
1.1782981157302856,
0.059038419276475906,
0.5599763989448547,... |
def simulate _ engine _ performance ( number _ of _ particles _ in _ box, box _ side _ length, temperature, box _ hole _ area ) : # return thrust _ per _ box, \ # mass _ loss _ rate _ per _ box return gasbox. simulate ( number _ of _ particles _ in _ box, box _ side _ length, temperature, box _ hole _ area ) | [
-0.2715432643890381,
0.3633837401866913,
0.39148518443107605,
-1.0161659717559814,
0.2672257721424103,
-0.4229600131511688,
-0.4508857727050781,
-0.5010427236557007,
-0.5579825043678284,
0.06654182076454163,
0.28865963220596313,
0.11116199940443039,
0.08202146738767624,
0.3129812777042389,... |
def dispatch _ ace _ alert ( alert ) : if saq. config ['slack']. getboolean ('enabled') : try : dispatch _ slack _ ace _ alert ( alert ) except exception as e : logging. error ( f " unable to dispatch slack ace alert { alert } : { e } " ) return true | [
0.5970708131790161,
0.4471806585788727,
0.6695910096168518,
0.6159566044807434,
-0.07456512004137039,
0.2076762169599533,
-0.38866108655929565,
0.10845748335123062,
0.5272386074066162,
0.8253878355026245,
-0.4279368221759796,
0.4860088527202606,
0.10098131746053696,
0.34581395983695984,
... |
def _ may _ reduce _ to _ scalar ( keepdims, axis, output ) : if not _ has _ fully _ defined _ shape ( output ) and ( not keepdims ) and ( axis is none ) : output. set _ shape ( ( ) ) return output | [
0.3920228183269501,
0.3741949796676636,
0.5491713285446167,
0.19288678467273712,
-0.14153189957141876,
-0.4008314907550812,
0.6148849725723267,
-0.5821825861930847,
0.09871790558099747,
-0.1472148895263672,
0.29343992471694946,
0.032897576689720154,
-0.06473185122013092,
0.4334829151630401... |
def score _ ligands ( self ) : hs = self. get _ hotspot ( ) all _ ligs = self. get _ ligands ( ) ligs = { } # score only ligands from chains where we have hotspots info for al in all _ ligs : lchains = self. get _ ligand _ chain ( ligand = al, hotspot _ result = hs ) if set ( lchains ) = = set ( self. chains ) : ligs [... | [
0.10522130131721497,
-1.4657866954803467,
0.6336445212364197,
-0.5765400528907776,
0.8878574371337891,
0.3272983729839325,
-0.5544010400772095,
0.3196414113044739,
-0.17097938060760498,
0.07123184949159622,
-0.3938460648059845,
-0.1212627962231636,
-0.004827117547392845,
0.4522267580032348... |
def step ( self, name ) : step = step ( name, self ) step _ exec = stepexecution ( step ) if not hasattr ( self, " steps " ) : self. steps = [ ] self. steps. append ( step ) return step _ exec | [
0.10480287671089172,
0.23341326415538788,
0.4032798409461975,
0.739509105682373,
0.5137260556221008,
-0.45218175649642944,
-0.2668178677558899,
-0.4674637019634247,
0.038096774369478226,
-1.1659729480743408,
-1.2998480796813965,
-0.6074551939964294,
-0.1633952409029007,
1.0560535192489624,... |
def properties ( self ) : return self. _ properties | [
-0.6412662863731384,
-1.1350330114364624,
-0.015890588983893394,
-0.04302976280450821,
0.12902231514453888,
0.42078712582588196,
0.044346440583467484,
-0.0196379367262125,
0.2181411236524582,
-1.2110915184020996,
-0.17324431240558624,
-0.1308618038892746,
-0.2871860861778259,
-0.4460766017... |
def test _ is _ secure _ transport ( self ) : if'oauthlib _ insecure _ transport'in os. environ : del os. environ ['oauthlib _ insecure _ transport'] self. asserttrue ( is _ secure _ transport ('https : / / example. com') ) self. assertfalse ( is _ secure _ transport ('http : / / example. com') ) os. environ ['oauthlib... | [
-0.5523520708084106,
-0.24737100303173065,
0.5181218385696411,
0.5531591773033142,
0.420137494802475,
0.27027347683906555,
-0.23054340481758118,
-0.19718681275844574,
0.6898130178451538,
-0.4216389060020447,
-1.318493366241455,
0.24241600930690765,
-0.5901563763618469,
-0.6499414443969727,... |
def create ( self, * args, * * kwargs ) : if not args and not kwargs : raise exception ('attributes for voucherseries are missing') initial _ attributes = args [ 0 ] if args else kwargs attributes = dict ( ( k, v ) for k, v in initial _ attributes. items ( ) ) attributes. update ( {'service': self. service } ) _, _, vo... | [
-0.8764729499816895,
0.1598413586616516,
0.3179894685745239,
0.1556932032108307,
0.2168234884738922,
0.2474338263273239,
-0.7753967642784119,
0.07096449285745621,
-0.4673868715763092,
0.010567962191998959,
-0.012379991821944714,
1.3354629278182983,
-0.803941547870636,
0.8259387016296387,
... |
def itksubtractconstantfromimagefilterif2dif2 _ cast ( * args ) : return _ itksubtractconstantfromimagefilterpython. itksubtractconstantfromimagefilterif2dif2 _ cast ( * args ) | [
0.16976381838321686,
-0.7827576994895935,
0.1206137016415596,
-0.38344886898994446,
-0.6518501043319702,
-0.13919688761234283,
0.628231942653656,
-0.13515540957450867,
-1.1171692609786987,
-0.02422635443508625,
-0.42380404472351074,
0.4423817992210388,
0.6574493646621704,
-0.00716230552643... |
async def changing _ dictionary ( call : callbackquery, callback _ data : dict, state : fsmcontext ) : name _ selected _ dictionary = callback _ data ['dictionary _ name'] user _ id = call. from _ user. id id _ selected _ dictionary = int ( callback _ data ['dictionary _ id'] ) try : # # # # # # # # # # # # # # # # # #... | [
-0.4549211263656616,
0.024338936433196068,
0.8406089544296265,
-0.16946284472942352,
-0.49369731545448303,
-0.4234081506729126,
0.5208333730697632,
-0.1768084466457367,
0.19695746898651123,
0.8498806357383728,
-0.14357171952724457,
0.852021336555481,
-0.34921976923942566,
0.745289981365203... |
def save ( self, * args, * * kwargs ) : self. asset _ type = " realestate " super ( realestate, self ). save ( * args, * * kwargs ) | [
-0.16362632811069489,
-0.0055671874433755875,
0.4218059480190277,
-0.43956267833709717,
0.5189161896705627,
-0.24590420722961426,
0.23256446421146393,
0.6087085008621216,
0.3439386188983917,
-0.000022221356630325317,
-1.061003565788269,
-0.047544270753860474,
-0.3444961607456207,
0.1236455... |
def removemetadata ( self, block, metadatakey, owningplugin ) : if block. getworld ( ) = = self. owningworld : super ( blockmetadatastore, self ). removemetadata ( block, metadatakey, owningplugin ) else : raise illegalargumentexception ( " block does not belong to world " + self. owningworld. _ _ name _ _ ) | [
0.27075549960136414,
-0.37946248054504395,
0.3900226950645447,
0.6227570176124573,
-0.5589634776115417,
0.28766652941703796,
0.25806543231010437,
-0.02447928488254547,
-0.2291320413351059,
0.8294916152954102,
-0.09773674607276917,
0.7505762577056885,
-0.7633181810379028,
0.7086309194564819... |
def test _ atomic _ id _ pattern _ 1 _ nistxml _ sv _ iv _ atomic _ id _ pattern _ 2 _ 1 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / id / schema + instance / nistschema - sv - iv - atomic - id - pattern - 2. xsd ", instance = " nistdata / atomic / id / schema + instance... | [
-0.07141605019569397,
-0.6485181450843811,
0.5572957992553711,
0.9492015242576599,
-0.22668541967868805,
0.2347549945116043,
0.3489941656589508,
0.030873287469148636,
0.0694328248500824,
0.8019810914993286,
-0.14167040586471558,
0.6053590774536133,
0.5408755540847778,
-0.10430071502923965,... |
def setup ( job, args, input _ file _ ids ) : job. filestore. logtomaster ('beginning align transcripts run on { } '. format ( args. genome ), level = logging. info ) # load all filestore files necessary annotation _ gp = job. filestore. readglobalfile ( input _ file _ ids. annotation _ gp ) ref _ genome _ db = job. fi... | [
0.3111765682697296,
-0.636724054813385,
0.7681029438972473,
-0.3699887692928314,
-0.8868367075920105,
-0.38948166370391846,
0.33719781041145325,
0.3433159291744232,
-0.8603746294975281,
0.8804076910018921,
0.31530851125717163,
0.061156872659921646,
-0.005352701060473919,
0.8972152471542358... |
def test _ right _ channel _ 2 ( ) : assert numpy. array _ equal ( harvard. right _ channel ( ), harvard. data [ :, 1 ] ) | [
0.11978285759687424,
-0.07013032585382462,
0.26889726519584656,
-0.02565828524529934,
1.500285029411316,
0.18234041333198547,
-0.20904651284217834,
-1.3346664905548096,
-0.1294344812631607,
-0.07407185435295105,
-0.5591915249824524,
1.4774200916290283,
-0.34996357560157776,
0.5886983871459... |
def render _ datastore ( ) : urls = { " json " : " https : / / api. scraperwiki. com / api / 1. 0 / datastore / sqlite? format = json & name = cell _ values _ of _ zero & query = select + * + from + ` 0 ` & apikey = ", " csv " : " https : / / api. scraperwiki. com / api / 1. 0 / datastore / sqlite? format = csv & name ... | [
-1.043748140335083,
0.48802798986434937,
0.46703729033470154,
-0.6751555800437927,
0.009812964126467705,
-0.25513800978660583,
-1.1347004175186157,
1.37191641330719,
-0.15001335740089417,
0.1704220026731491,
-0.30272620916366577,
-0.5901853442192078,
0.24585607647895813,
0.8126944899559021... |
def print _ square ( size ) : if not isinstance ( size, int ) : raise typeerror ( " size must be an integer " ) elif size < 0 : raise valueerror ( " size must be > = 0 " ) else : if size = = 0 : return else : for _ in range ( size ) : [ print ( " # ", end = " " ) for _ in range ( size ) ] print ( " " ) | [
-0.19912071526050568,
0.10058647394180298,
0.726318359375,
0.49311724305152893,
0.14477133750915527,
-0.06705423444509506,
-0.250469446182251,
-0.6773784756660461,
0.30074095726013184,
-0.043207425624132156,
0.1671895980834961,
0.9024436473846436,
-0.7602480053901672,
1.1572703123092651,
... |
def dummy ( scores _ filename ) : scores _ df = pd. read _ csv ( scores _ filename, sep = " \ t " ) x = scores _ df. drop ( [ " class ", " score " ], 1 ) y = scores _ df [ " class " ] ( x _ train, x _ test, y _ train, y _ test ) = train _ test _ split ( x, y, test _ size = 0. 3, random _ state = 0 ) model = dummyclassi... | [
-0.8392860293388367,
0.020808227360248566,
0.8659011721611023,
-0.5049764513969421,
1.1567792892456055,
0.5654404163360596,
0.9129196405410767,
0.42163974046707153,
-0.17827071249485016,
0.7702534198760986,
-1.1715081930160522,
0.7020475268363953,
0.8674893975257874,
-0.46312594413757324,
... |
def update _ template ( template, title, data, is _ clonable, backside _ template _ id = none, clear _ background = false ) : if template. data ['width']! = data ['width'] or template. data ['height']! = data ['height'] : query = designertemplate. query. filter ( designertemplate. backside _ template = = template ) for... | [
-0.6817981600761414,
-0.08869598805904388,
0.7966811656951904,
-0.3278333246707916,
-0.23278047144412994,
-0.22545161843299866,
-0.3266501724720001,
-0.4684114456176758,
-0.10077062249183655,
0.9769309759140015,
-0.6899136900901794,
0.3463898301124573,
-0.5276657938957214,
-0.0827266275882... |
def test _ atomic _ any _ uri _ pattern _ 4 _ nistxml _ sv _ iv _ atomic _ any _ uri _ pattern _ 5 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / anyuri / schema + instance / nistschema - sv - iv - atomic - anyuri - pattern - 5. xsd ", instance = " nistdata / atomic / ... | [
-0.276889830827713,
-0.6839079260826111,
0.43943727016448975,
0.9433231353759766,
-0.6503793597221375,
-0.35152289271354675,
0.3744315505027771,
-0.49064090847969055,
-0.7463933229446411,
0.08019889891147614,
-0.23951128125190735,
-0.24179670214653015,
-0.47800010442733765,
0.3105331063270... |
def find _ markers ( ocr ) : result = [ ( left, top ) for text, left, top, width, height in ocr if ( re. match ( r " ( # / cs ). * ", text ) ) ] return result | [
-0.7378418445587158,
-0.4717714786529541,
0.491485595703125,
0.2344846874475479,
-0.19034706056118011,
-0.1572382152080536,
0.23958329856395721,
0.226651132106781,
-0.03123404085636139,
1.2105344533920288,
-0.4632611572742462,
-1.6333433389663696,
-0.4274034798145294,
0.5807581543922424,
... |
def rotate _ point _ y ( xyz, theta, radians = false ) : if not radians : theta = np. radians ( theta ) cost = np. cos ( theta ) sint = np. sin ( theta ) ry = np. array ( [ [ cost, 0. 0, - sint ], [ 0. 0, 1. 0, 0. 0 ], [ sint, 0. 0, cost ] ] ) return np. matmul ( xyz, ry ) | [
-0.6366223096847534,
0.36069074273109436,
0.38040876388549805,
-0.36107924580574036,
0.7327483296394348,
-0.9238271713256836,
-0.7392250895500183,
0.34690073132514954,
0.3501850664615631,
0.09396665543317795,
-0.33044561743736267,
0.016040673479437828,
-0.4437735974788666,
-0.6719741821289... |
def test _ create _ custom _ gradebook _ column ( self ) : # this method utilises the post request method and will make changes to the canvas instance. this needs consideration. pass | [
-0.3954673707485199,
0.13646534085273743,
0.3053847551345825,
0.13404299318790436,
0.904552161693573,
0.8347377181053162,
1.4002618789672852,
-1.3253557682037354,
-0.5454236268997192,
-0.3861742615699768,
-1.3271758556365967,
0.12095960229635239,
-0.8874180912971497,
-0.1358526200056076,
... |
def cost ( self, parent, child ) : cost = 0 for name in child : first, second = parent [ name ], child [ name ] dtheta = math. fabs ( first [ 2 ] - second [ 2 ] ) dtheta = min ( dtheta, 2 * math. pi - dtheta ) cost + = math. sqrt ( ( first [ 0 ] - second [ 0 ] ) * * 2 + ( first [ 1 ] - second [ 1 ] ) * * 2 + dtheta * *... | [
0.19706274569034576,
-0.5226763486862183,
0.5333840250968933,
-0.8036015033721924,
-0.9327253699302673,
-0.6017661094665527,
-0.018309568986296654,
-0.09555211663246155,
-1.0486960411071777,
0.6780354380607605,
-0.9768111109733582,
-0.7350094318389893,
-0.12438502162694931,
-0.141149297356... |
def test _ duplicate _ params ( self ) : v = requestvalidator ( ) e = baseendpoint ( v ) self. assertraises ( errors. invalidrequesterror, e. _ create _ request,'https : / / a. b /? oauth _ version = a & oauth _ version = b ','get ', none, urlencoded ) self. assertraises ( errors. invalidrequesterror, e. _ create _ req... | [
-0.7254140973091125,
-0.1546483337879181,
0.4512794613838196,
0.5521298050880432,
0.82243812084198,
0.8565610647201538,
-0.6924514770507812,
-0.0932115912437439,
0.17533932626247406,
-0.15455801784992218,
-0.40976327657699585,
0.38240042328834534,
-0.1394626945257187,
0.723918616771698,
... |
def new ( * args, * * kargs ) : obj = itksubtractconstantfromimagefilterif2dif2. _ _ new _ orig _ _ ( ) import itktemplate itktemplate. new ( obj, * args, * * kargs ) return obj | [
0.3209778964519501,
-0.9454907774925232,
0.23649629950523376,
-0.3086954653263092,
-1.0755784511566162,
-0.341575026512146,
0.7429224252700806,
-0.13207121193408966,
-1.1225440502166748,
-0.36515405774116516,
-0.8077473044395447,
0.027659455314278603,
0.6182008981704712,
0.6824502348899841... |
def ambari _ version ( self ) : return self. _ ambari _ version | [
0.616418182849884,
-0.9333709478378296,
-0.28615477681159973,
0.599716067314148,
-0.17219270765781403,
1.8503684997558594,
1.059659481048584,
-0.19147196412086487,
0.07429651916027069,
1.044926404953003,
-0.7867392897605896,
0.27803942561149597,
-0.1859630048274994,
-0.25685033202171326,
... |
def keep _ last _ and _ only ( authors _ str ) : last _ author = authors _ str. split ( " and " ) [ - 1 ] without _ and = authors _ str. replace ( " and ", ", " ) str _ ok = without _ and. replace ( ", " + last _ author, " and " + last _ author ) return str _ ok | [
0.0798528715968132,
-1.5523649454116821,
0.6773041486740112,
-0.4204150140285492,
-0.20728333294391632,
0.040676116943359375,
-0.2889423370361328,
1.3901125192642212,
0.6686251759529114,
0.4379555583000183,
0.8272519111633301,
0.7678321599960327,
-0.921105682849884,
-0.3286953568458557,
... |
def shipping _ address1 ( self ) : return self. _ shipping _ address1 | [
-0.2749786972999573,
-0.005932849831879139,
0.5777329802513123,
0.8110342621803284,
-0.004271801561117172,
0.7605426907539368,
1.1137871742248535,
0.33109185099601746,
0.20566946268081665,
0.378682404756546,
0.09786400198936462,
0.8877850770950317,
-0.13619473576545715,
-0.7123486995697021... |
def load _ config _ file ( config _ file, child _ name = " dockerconfiguration " ) : with open ( config _ file,'r') as fid : res = { } if config _ file. endswith ( ". yaml " ) : res = yaml. load ( fid ) elif config _ file. endswith ( ". json " ) or config _ file. endswith ( " json " ) : res = json. load ( fid ) return ... | [
0.29550185799598694,
-0.5193616151809692,
0.6829245686531067,
0.020476875826716423,
-0.971424400806427,
-0.6102308034896851,
0.04904821515083313,
0.30579710006713867,
-1.1555358171463013,
0.5537808537483215,
-0.8870233297348022,
-0.4970923662185669,
0.6508723497390747,
0.8020281195640564,
... |
def weight _ mtow ( self ) : if self. weight _ target = ='payload': mtow = 4. 7551 * self. target _ value + 0. 59962 # estimation of mtow from payload mass from dse midterm report. # it is valid for uavs with payload masses between 0 and 50 kg. return mtow elif self. weight _ target = ='mtow': return self. target _ val... | [
-0.34530147910118103,
-0.14858607947826385,
0.6308478116989136,
0.03428572043776512,
-0.6373831629753113,
-0.08371064811944962,
-0.1368808150291443,
-0.5690819025039673,
0.1924542337656021,
0.07180651277303696,
0.9476080536842346,
0.46796321868896484,
0.20022106170654297,
1.298907160758972... |
def take _ childs ( d, mask ) : lev _ mask = len ( mask. split ( " : " ) ) + 1 l _ mask = list ( ) for k, v in d. items ( ) : if len ( k. split ( " : " ) ) = = lev _ mask and k. startswith ( mask ) : l _ mask. append ( k ) if l _ mask : return l _ mask else : return false | [
0.16247935593128204,
-0.29327404499053955,
0.6809983849525452,
0.29156941175460815,
-1.0162781476974487,
0.20772971212863922,
-0.28274527192115784,
0.12666238844394684,
-0.166329488158226,
0.7771150469779968,
-0.5786582231521606,
-0.5006963610649109,
-0.2707041800022125,
-0.973056733608245... |
def update ( self, train _ loss : float, val _ loss : float, step : int ) - > none : self. _ train. append ( train _ loss ) self. _ val. append ( val _ loss ) self. _ steps. append ( step ) if self. _ client : new _ data : ndarray = np. array ( [ train _ loss, val _ loss, step ], dtype = np. float32 ) self. _ client. u... | [
-0.8614081144332886,
0.26746252179145813,
0.32673588395118713,
0.02444964274764061,
-0.4843747019767761,
0.42186373472213745,
-0.6670278310775757,
-0.6595085859298706,
-1.0262125730514526,
-0.3959995210170746,
-0.28157010674476624,
0.6342039108276367,
0.6061031222343445,
-0.039925847202539... |
def calc _ pure _ python ( draw _ output, desired _ width, max _ iterations ) : x _ step = ( float ( x2 - x1 ) / float ( desired _ width ) ) y _ step = ( float ( y1 - y2 ) / float ( desired _ width ) ) x = [ ] y = [ ] ycoord = y2 while ycoord > y1 : y. append ( ycoord ) ycoord + = y _ step xcoord = x1 while xcoord < x2... | [
-0.3093225359916687,
0.3127939701080322,
0.8337358236312866,
0.4889250099658966,
-0.8222000002861023,
-0.4923771619796753,
0.8663540482521057,
-0.26326435804367065,
0.2454465627670288,
-0.36712774634361267,
-0.4944562017917633,
0.47297409176826477,
0.1377391368150711,
-0.16438323259353638,... |
def render ( self, data, accepted _ media _ type = none, renderer _ context = none ) : if data is none : return'' fg = feedgenerator ( ) feed _ url = settings. api _ url + reverse ('api : veroeffentlichung - list') feed _ title ='offenegesetze. de'feed _ description ='feed fur veroffentlichungen des bundesgesetzblatts'... | [
-0.37297341227531433,
0.20702260732650757,
0.6709960103034973,
0.06631294637918472,
-0.12080404162406921,
-0.4300626516342163,
-0.832391083240509,
-0.3124461770057678,
0.27877798676490784,
-0.2340184897184372,
0.4972997307777405,
0.22585614025592804,
-0.7106378674507141,
1.0210667848587036... |
def remote _ ssh _ execcommand ( command, hostname, username, password, port = 22, timeout = 3 ) : try : with _ _ new _ logined _ sshclient ( hostname = hostname, username = username, password = password, port = port, timeout = timeout ) as client : _, out _ fp, err _ fp = client. exec _ command ( command = command, ti... | [
0.08470868319272995,
-0.7910365462303162,
0.7689974904060364,
0.46127408742904663,
-1.0675203800201416,
1.242225170135498,
-0.7187728881835938,
0.22139325737953186,
-0.6266708970069885,
0.5245961546897888,
-0.43246981501579285,
0.5154445171356201,
-0.36876973509788513,
-0.5859186053276062,... |
def list _ dev _ boxes _ by _ user ( self, project _ name : str, user _ id : str = " me ", *, filter : optional [ str ] = none, top : optional [ int ] = none, * * kwargs : any ) - > iterable [ json ] : _ headers = kwargs. pop ( " headers ", { } ) or { } _ params = kwargs. pop ( " params ", { } ) or { } cls : clstype [ ... | [
-1.8052585124969482,
0.6064643263816833,
0.7086131572723389,
0.47418174147605896,
-0.7094939351081848,
-0.39546698331832886,
0.19086386263370514,
-1.3722821474075317,
0.0636710524559021,
-0.39780744910240173,
-0.44829800724983215,
1.108008861541748,
-0.05192099139094353,
0.1993026584386825... |
def db _ name ( self ) : return self. _ db _ name | [
0.007188429590314627,
0.036281902343034744,
0.3276205062866211,
0.8659247756004333,
-0.5447583794593811,
0.8857222199440002,
0.017771275714039803,
0.06667924672365189,
0.377650648355484,
0.27785491943359375,
0.2521880567073822,
0.08546987920999527,
-0.13150116801261902,
0.22830891609191895... |
def destroy ( self ) : self. overlaylist. removelistener ('overlays ', self. name ) self. displayctx. removelistener ('selectedoverlay ', self. name ) self. displayctx. removelistener ('displayspace ', self. name ) self. removelistener ('cropbox ', self. name ) self. _ _ xcanvas. getannotations ( ). dequeue ( self. _ _... | [
0.28099972009658813,
-1.0342762470245361,
0.4732756018638611,
-0.49254629015922546,
-0.025790417566895485,
0.030320165678858757,
0.8371421694755554,
-0.9792717695236206,
0.7392557263374329,
-0.3803824782371521,
-0.4887015223503113,
-0.40407589077949524,
-0.12375449389219284,
0.894704103469... |
def sne _ lds _ similarities _ fast ( dsm _ lds, arr _ den _ s _ i = none, compute _ log = true ) : n = dsm _ lds. shape [ 0 ] if arr _ den _ s _ i is none : arr _ den _ s _ i = np. ones ( shape = n ) # extracting the values on the diagonal of dsm _ lds for the search of the smallest nonzero distance for each dot diago... | [
0.11446191370487213,
0.6410534381866455,
0.8409920334815979,
-0.38553953170776367,
-0.18819090723991394,
-0.7275041341781616,
-0.014721588231623173,
-0.13743893802165985,
0.36710378527641296,
0.19121505320072174,
-0.11901737004518509,
0.38090723752975464,
0.9823384881019592,
0.209806680679... |
def _ _ init _ _ ( self, tube, variables, modes ) : self. tube = tube self. variables = variables self. modes = modes # build the raw string representation so user can print it self. raw = " " for line in tube : if isinstance ( line, str ) : self. raw + = line + " \ n " else : self. raw + = " ". join ( map ( str, line ... | [
-0.29866939783096313,
-1.5538318157196045,
0.6948909163475037,
-0.9129959344863892,
-0.5642444491386414,
0.062245894223451614,
-0.9163092374801636,
0.4612421691417694,
-1.1014395952224731,
0.5607995986938477,
-0.43738898634910583,
-0.5015680193901062,
0.17552733421325684,
0.146814614534378... |
def split _ data ( images, labels ) : train _ percent = 0. 7 count = math. floor ( len ( images ) * train _ percent ) images, labels = unison _ shuffled _ copies ( images, labels ) train _ images, test _ images = images [ : count ], images [ count : ] train _ labels, test _ labels = labels [ : count ], labels [ count :... | [
-1.164829134941101,
-0.002269279444590211,
0.3588258922100067,
-0.6373198628425598,
0.5664564371109009,
0.19713695347309113,
0.21344764530658722,
-0.06360813975334167,
-0.261558473110199,
0.35100996494293213,
0.3901650309562683,
-0.45620888471603394,
-0.2913980185985565,
-0.417617499828338... |
def test _ outside _ intercept _ error _ in _ constructor ( self ) : # create a variable for the standard arguments to this function. standard _ args = [ self. fake _ old _ df, self. alt _ id _ column, self. situation _ id _ column, self. choice _ column, self. fake _ spec ] # create a variable for the kwargs being pas... | [
-0.04793849214911461,
-0.3199619650840759,
0.7799950242042542,
-0.7524244785308838,
-0.22571390867233276,
0.5566635131835938,
-0.24572110176086426,
0.5848147869110107,
-0.5506347417831421,
-0.29610639810562134,
-0.46897271275520325,
0.10776393860578537,
-0.37134531140327454,
0.375874757766... |
def _ search _ re ( self, string, expressions ) : for e in expressions : m = re. search ( string, e, re. ignorecase ) if m : return true return false | [
-0.3522585928440094,
-0.3330555856227875,
0.5293319821357727,
0.4392467439174652,
0.2519776225090027,
-0.2010444700717926,
0.46962255239486694,
0.6425672769546509,
-1.031753420829773,
0.10888047516345978,
0.4120883047580719,
-0.6283332705497742,
-1.590804934501648,
-0.9539402723312378,
-... |
def get _ start _ date ( self ) : event = get _ marriage _ or _ fallback ( self. dbstate. db, self. obj ) return event. get _ date _ object ( ) if event else none | [
1.320299744606018,
0.10225790739059448,
0.5952083468437195,
0.7635954022407532,
-0.034518882632255554,
-0.268838107585907,
0.028226599097251892,
-0.028434589505195618,
1.4525269269943237,
-0.30929598212242126,
0.21305672824382782,
0.2990865409374237,
-0.3148382902145386,
0.4277846813201904... |
def img2img _ transformer _ base ( ) : hparams = image _ transformer2d _ base ( ) # learning related flags hparams. layer _ preprocess _ sequence = " n " hparams. layer _ postprocess _ sequence = " da " # this version seems to benefit from a higher learning rate. hparams. learning _ rate = 0. 2 hparams. layer _ prepost... | [
-0.28844690322875977,
-0.5819050669670105,
0.6806963086128235,
-0.3064730763435364,
-0.12878452241420746,
-0.9179947376251221,
0.315594881772995,
-0.008168713189661503,
-0.7112612724304199,
-0.06657315045595169,
-0.4400104582309723,
0.12682801485061646,
0.24470247328281403,
1.5128287076950... |
def create _ access _ token ( self, request, credentials ) : request. realms = self. request _ validator. get _ realms ( request. resource _ owner _ key, request ) token = {'oauth _ token': self. token _ generator ( ),'oauth _ token _ secret': self. token _ generator ( ), # backport the authorized scopes indication use... | [
-1.0459719896316528,
-1.194699764251709,
0.39142465591430664,
-0.2209399789571762,
-0.42322850227355957,
-0.15780407190322876,
-0.30435460805892944,
0.3519425392150879,
-0.007998873479664326,
-0.6582581400871277,
0.7488137483596802,
0.7887055277824402,
0.9875121712684631,
0.020089335739612... |
def prereleaser _ middle ( self, data ) : # get the authors out of the setup. cfg cfg = configparser ( ) cfg. read ('setup. cfg') authors = cfg. get ('metadata ','author') authors = [ a. strip ( ) for a in authors. split ( ',') ] update _ docs _ config ( data ['new _ version'], authors ) | [
-0.9137048721313477,
-0.436357706785202,
0.16843611001968384,
0.09018510580062866,
-0.007097293622791767,
-0.6936513781547546,
0.05188683420419693,
1.0559899806976318,
-0.09929553419351578,
1.2436151504516602,
-0.3480948209762573,
0.4002356231212616,
-0.20674924552440643,
0.100791193544864... |
def deal ( self ) : if len ( self. piles ) > 0 : for i in xrange ( 10 ) : self. board [ i ]. append ( self. piles [ 0 ] [ i ] ) self. undo. append ( ( _ deal, self. piles [ 0 ] ) ) self. piles = self. piles [ 1 : ] for i in xrange ( 10 ) : self. checkcomplete ( i ) | [
0.05225951969623566,
0.8003639578819275,
0.858159601688385,
-0.18747998774051666,
1.6668527126312256,
0.1875164657831192,
0.8911775350570679,
0.41790369153022766,
0.3617264926433563,
0.08317623287439346,
-0.30439576506614685,
-0.9641230702400208,
-0.5256515741348267,
0.004286111798137426,
... |
async def test _ step _ user _ already _ configured ( hass : homeassistant ) - > none : with patch ( " pynina. baseapi. baseapi. _ makerequest ", wraps = mocked _ request _ function, ) : result : dict [ str, any ] = await hass. config _ entries. flow. async _ init ( domain, context = { " source " : source _ user }, dat... | [
-0.26129773259162903,
1.098338007926941,
0.3724411725997925,
0.8637607097625732,
0.5060577392578125,
0.32400649785995483,
0.937508225440979,
-0.29776543378829956,
0.34656086564064026,
-0.28747859597206116,
-0.7820817232131958,
0.691063642501831,
0.6573734283447266,
0.512968897819519,
0.9... |
def removephysicalinterfacefromdevicetype ( self, typeid ) : req = apiclient. onedevicetypephysicalinterfaceurl % ( self. host, " / draft ", typeid ) body = { } resp = requests. delete ( req, auth = self. credentials, headers = { " content - type " : " application / json " }, data = json. dumps ( body ), verify = self.... | [
-2.0389230251312256,
0.013122377917170525,
0.44950568675994873,
0.08322163671255112,
-0.8570280075073242,
0.011766278184950352,
0.012956167571246624,
-1.2267433404922485,
0.05375143140554428,
0.2137526124715805,
-0.07261351495981216,
-0.3365369737148285,
-2.434512138366699,
0.2182209044694... |
def test _ example _ input _ one _ clone _ valid _ title ( self, ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper, add _ input _ one ) : input _ page = inputpage ( ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) input _ page. table. clone _ row ( " dummy _ input _ one " ) self. assert _ u... | [
0.326663076877594,
0.5680797696113586,
0.7002958059310913,
1.1271716356277466,
-0.29307809472084045,
0.7696589231491089,
-0.6265736222267151,
-0.6362279057502747,
1.0716956853866577,
0.6582248210906982,
0.3805469572544098,
-0.2515541911125183,
-0.38249918818473816,
-0.5668208003044128,
-... |
def _ copy _ binder _ notebooks ( gallery _ conf, mkdocs _ conf ) : gallery _ dirs = gallery _ conf. get ( " gallery _ dirs " ) binder _ conf = gallery _ conf. get ( " binder " ) notebooks _ dir = os. path. join ( mkdocs _ conf [ " site _ dir " ], binder _ conf. get ( " notebooks _ dir " ) ) shutil. rmtree ( notebooks ... | [
-0.5932283401489258,
-0.1328076422214508,
0.6506439447402954,
1.0830668210983276,
-0.7217337489128113,
1.014140009880066,
1.6018327474594116,
-0.1815369427204132,
0.3676779270172119,
0.7744203209877014,
-0.3616116940975189,
0.33797240257263184,
-0.16321194171905518,
0.5692421197891235,
0... |
def test _ background _ scan ( self ) : import time self. _ setup _ generic _ advertisement ( ) self. scn _ ad. droid. bluetoothtogglestate ( false ) try : self. scn _ ad. ed. pop _ event ( bluetooth _ off, self. default _ timeout ) except empty : self. log. error ( " bluetooth off event not found. expected { } ". form... | [
-0.23675332963466644,
0.61089688539505,
0.9180199503898621,
0.5021272897720337,
-0.1646583080291748,
0.15233825147151947,
0.3825588822364807,
-0.06551477313041687,
-0.0005978997214697301,
0.3525790572166443,
-0.7977653741836548,
0.142501100897789,
-1.020266056060791,
-0.053392890840768814,... |
def read _ excel _ input ( nts _ alph = args. nts _ light ) : mod _ origin, mod _ alphabet = { }, { } if nts _ alph : # checking that the nts _ light file given in argument exists if not os. path. exists ( nts _ alph ) : print ( " error! file { } does not exist. execution terminated without output ". format ( nts _ alp... | [
-0.6120392680168152,
-0.2942148447036743,
0.8361912965774536,
-0.6347692608833313,
-1.0715453624725342,
0.49686816334724426,
-0.3093564212322235,
0.7007228136062622,
-0.4585714042186737,
0.07689086347818375,
-0.1596217006444931,
-0.00892667006701231,
-0.43180906772613525,
0.100430190563201... |
def to _ adj _ list ( adj _ matrix : list [ list [ int ] ] ) - > list [ list [ int ] ] : | [
-0.6803489327430725,
0.5209073424339294,
0.28871849179267883,
-0.028561610728502274,
0.08199373632669449,
0.5297046899795532,
0.3742416799068451,
0.6855723261833191,
0.9652583003044128,
1.3865437507629395,
0.09518896788358688,
0.20906898379325867,
-0.1266365945339203,
0.6213591694831848,
... |
def bio ( self ) : div = self. _ soup _ profile. find ( " div ", { " class " : " bio module " } ) if div is none : return " " blockquote = div. find ( " blockquote ", { " class " : " userstuff " } ) return blockquote. gettext ( ) if blockquote is not none else " " | [
0.53146892786026,
-0.0017626358894631267,
0.7375200390815735,
1.1017323732376099,
0.5976271629333496,
-0.10737063735723495,
0.458848774433136,
-0.9421077370643616,
0.3201744556427002,
0.39850926399230957,
0.23661212623119354,
-0.10340477526187897,
-0.33794379234313965,
0.314054936170578,
... |
def ambiguous _ words ( self, n ) : # work here!! | [
-0.5247825980186462,
0.16095249354839325,
0.10851497948169708,
0.6785823702812195,
1.2089461088180542,
-0.11831841617822647,
0.0752737820148468,
-0.2169935256242752,
-0.007159513421356678,
0.6922944188117981,
-0.54180908203125,
-0.24039630591869354,
-0.816014289855957,
1.8974851369857788,
... |
async def kill _ later ( proc, waittime ) : await sleep ( waittime ) proc. interrupt ( ) | [
1.073651671409607,
-0.43577897548675537,
0.2648569345474243,
0.5777116417884827,
0.38271233439445496,
0.528225839138031,
-0.40347373485565186,
0.709145724773407,
-0.6385242342948914,
-0.03489801660180092,
0.01100910548120737,
0.02450091764330864,
-0.19829638302326202,
-0.862957239151001,
... |
def test _ list _ integer _ min _ length _ 4 _ nistxml _ sv _ iv _ list _ integer _ min _ length _ 5 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / integer / schema + instance / nistschema - sv - iv - list - integer - minlength - 5. xsd ", instance = " nistdata / list / ... | [
-0.35502395033836365,
-0.7810683250427246,
0.2690560221672058,
0.22103692591190338,
-0.9008299112319946,
-0.40784454345703125,
-0.1894066333770752,
-0.5116665959358215,
0.5622679591178894,
0.5496158599853516,
-1.4040881395339966,
-0.07619684934616089,
-0.8522452712059021,
0.796171128749847... |
async def toggle ( self, ctx ) : server = ctx. message. server. id if self. json [ server ] ['toggle'] is true : self. json [ server ] ['toggle'] = false await self. bot. say (': white _ check _ mark : toggle disabled! you can no longer recover roles on this server.') else : self. json [ server ] ['toggle'] = true awai... | [
-1.1664972305297852,
0.2424306422472,
0.6891103982925415,
-0.49766579270362854,
0.6877439618110657,
0.7194920778274536,
-0.10356788337230682,
1.2231210470199585,
0.8618426322937012,
0.22270630300045013,
-1.1488196849822998,
0.9401869773864746,
-1.2649426460266113,
0.06812703609466553,
0.... |
def processevent ( self, caller = none, event = none ) : return | [
-0.28800010681152344,
-0.11691945791244507,
0.6190042495727539,
0.7739229202270508,
0.916793704032898,
0.6155391335487366,
-0.3169276714324951,
0.4258788526058197,
0.9122732877731323,
-0.9126086235046387,
-0.8378809690475464,
0.4650525152683258,
-0.4361800253391266,
0.5902713537216187,
0... |
def run _ o ( cmd, cwd = none ) : if cwd : popen = subprocess. popen ( cmd, stdout = subprocess. pipe, shell = true, cwd = cwd ) else : popen = subprocess. popen ( cmd, stdout = subprocess. pipe, shell = true ) popen. wait ( ) return'\ n '. join ( popen. stdout. readlines ( ) ) | [
0.2125270515680313,
-0.45772239565849304,
0.9630560874938965,
-0.315199613571167,
-0.7507538795471191,
-0.2527492940425873,
0.0582645945250988,
-0.03556371480226517,
-0.05207867920398712,
0.021652011200785637,
0.5498226284980774,
0.04529165104031563,
0.7133005261421204,
-0.2709827721118927... |
def sample _ examples _ by _ class ( x, y, sample _ fraction, sample _ distribution ='proportional') : logging. info ('sampling a'+ str ( sample _ fraction ) +'fraction of the examples') if sample _ fraction > = 1 : return x, y # convert features and labels into list form feature _ vectors, label _ vectors = _ feature ... | [
-0.34332701563835144,
-0.16363751888275146,
0.5971750617027283,
-0.301393061876297,
-0.7140660881996155,
-0.2645646333694458,
0.01658540591597557,
-0.552480161190033,
0.561529815196991,
0.27358806133270264,
0.8456029295921326,
0.0676523968577385,
0.701562225818634,
-0.17074134945869446,
... |
def _ setup _ dut _ label ( self ) : checksum _ file ='/ usr / local / osimage _ checksum _ file'try : rv, checksum, _ = command _ executer. getcommandexecuter ( ). \ crosruncommandwoutput ('cat'+ checksum _ file, chromeos _ root = self. _ sched. get _ labels ( 0 ). chromeos _ root, machine = self. _ dut. name, print _... | [
-0.08620554208755493,
-0.6615191698074341,
0.6738398671150208,
-0.307975172996521,
0.8961629867553711,
0.19339868426322937,
0.488202303647995,
-0.0547654889523983,
-0.2455512434244156,
1.0910691022872925,
-0.317308634519577,
0.6767924427986145,
0.4387700855731964,
1.171142578125,
-0.3754... |
def followers ( self ) : return _ type = clientresult ( self. context, clientvaluecollection ( socialactor ) ) qry = serviceoperationquery ( self, " followers ", none, none, none, return _ type ) self. context. add _ query ( qry ) return return _ type | [
-0.7515978813171387,
0.4757162928581238,
0.34967556595802307,
0.7308124899864197,
-0.016019226983189583,
-0.22970403730869293,
0.5586886405944824,
-0.5350009202957153,
0.5425300002098083,
-0.7947391271591187,
-0.370150089263916,
0.5910061001777649,
-1.175957441329956,
0.266684889793396,
... |
def copy _ annotations ( self, annotations ) : annotations = annotations. filter ( width = self. width, height = self. height, area _ _ gt = 0 ). exclude ('events') for annotation in annotations : clone = annotation. clone ( ) clone. dataset _ id = self. dataset _ id clone. image _ id = self. id clone. save ( copy = tr... | [
-0.7056761980056763,
-0.31128939986228943,
0.5801985263824463,
0.36239710450172424,
-0.7513636350631714,
0.32390695810317993,
0.7073017358779907,
-0.6468827128410339,
0.8502273559570312,
1.063617467880249,
-0.6801772117614746,
-0.1372717320919037,
-0.1815289556980133,
0.4639183580875397,
... |
def download _ mission ( self, clear = false ) : cmds = self. vehicle. commands cmds. download ( ) cmds. wait _ ready ( ) # wait until download is complete. if clear : cmds. clear ( ) cmds. upload ( ) print ( " clear any existing commands " ) | [
-0.47084352374076843,
-0.29728296399116516,
0.4778856933116913,
0.3709826171398163,
0.2565419673919678,
-0.8483309149742126,
-0.9428786635398865,
-0.9272024631500244,
0.4005771279335022,
0.39808788895606995,
0.5310136675834656,
0.2234237641096115,
-0.006353016942739487,
0.7352129220962524,... |
async def add ( self, ctx ) : server = ctx. message. server. id author = ctx. message. author existing _ roles = [ ] existing _ role _ names = [ ] for thing in author. roles : if thing. name! = " @ everyone " : existing _ roles. append ( thing. id ) existing _ role _ names. append ( thing. name ) self. json [ server ] ... | [
-0.7796951532363892,
-0.10699462890625,
0.6367565393447876,
-0.7490333318710327,
0.8406356573104858,
0.4665833115577698,
-0.4250774681568146,
0.6524465084075928,
0.225907564163208,
0.2523724138736725,
-0.8326890468597412,
0.8262406587600708,
-0.44969144463539124,
0.1544499546289444,
0.65... |
def couple _ vertex _ exist ( self, u, v ) : i = 0 for e in self. list _ edges : if e. vertex _ source = = u and e. vertex _ destination = = v : return i i + = 1 return - 1 | [
-1.2777093648910522,
-0.14679214358329773,
0.7528483867645264,
0.15674439072608948,
-0.12100505828857422,
0.11806373298168182,
0.6397776007652283,
0.6690471768379211,
0.4001081883907318,
0.7380668520927429,
-0.37178874015808105,
0.4162541925907135,
-0.2572903037071228,
-0.6568870544433594,... |
def loss _ beta ( x _ l _ til, x _ u _ til, x _ l _ train, x _ u _ train, m ) : n _ l _ til = len ( x _ l _ til ) n _ u _ til = len ( x _ u _ til ) beta _ l = estimate _ beta ( x _ l _ til, x _ l _ train, x _ u _ train, m ) beta _ u = estimate _ beta ( x _ u _ til, x _ l _ train, x _ u _ train, m ) return 1 / n _ l _ t... | [
0.37785282731056213,
0.0548425056040287,
0.5276457667350769,
0.041357968002557755,
0.08783774077892303,
-0.05007490888237953,
0.4872657060623169,
-0.07199790328741074,
-1.190462589263916,
-0.06871210038661957,
-0.6034945249557495,
0.7879982590675354,
-0.36298683285713196,
0.326105713844299... |
def random _ mini _ batches ( x, y, mini _ batch _ size = 64, seed = 0 ) : # 小 分 m = x. shape [ 0 ] # number of training examples mini _ batches = [ ] # , mini _ batches 空 np. random. seed ( seed ) # 定 子 # step 1 : shuffle ( x, y ) x 和 y 的 permutation = list ( np. random. permutation ( m ) ) # permutation 本 的 shuffled ... | [
0.43870264291763306,
0.14993597567081451,
1.1593550443649292,
0.5154562592506409,
-1.0773494243621826,
0.40787526965141296,
0.4439259171485901,
-0.14783525466918945,
0.9548888802528381,
0.17292019724845886,
-0.566747784614563,
-0.23928111791610718,
-0.587716281414032,
-0.4767707288265228,
... |
def button _ switch _ template ( self, cr, uid, ids, context = none ) : product _ attribute _ line _ obj = self. pool. get ('product. attribute. line') product _ attribute _ value _ obj = self. pool. get ('product. attribute. value') product _ attribute _ obj = self. pool. get ('product. attribute') product _ template ... | [
-0.804141640663147,
-1.298651933670044,
0.9024098515510559,
0.013818196952342987,
-0.26480066776275635,
-0.20752739906311035,
0.13218368589878082,
-0.6446719169616699,
0.4063253402709961,
0.8091957569122314,
-0.9187356233596802,
0.4994909167289734,
0.24806052446365356,
0.41426989436149597,... |
def test _ list _ integer _ min _ length _ 1 _ nistxml _ sv _ iv _ list _ integer _ min _ length _ 2 _ 2 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / list / integer / schema + instance / nistschema - sv - iv - list - integer - minlength - 2. xsd ", instance = " nistdata / list / ... | [
-0.5186260938644409,
-0.8969413638114929,
0.4031015634536743,
0.6567597389221191,
-0.5550797581672668,
-0.19931381940841675,
-0.5782901644706726,
-0.06461290270090103,
0.7482957243919373,
0.2708143889904022,
-1.1165498495101929,
0.283935010433197,
-0.32226797938346863,
0.9854856729507446,
... |
def is _ smaller _ or _ equal ( array1, array2 ) : assert array1. size = = array2. size return all ( array2 - array1 > = 0 ) | [
0.102765753865242,
-0.8803475499153137,
0.6144450306892395,
0.721411943435669,
-0.007125855889171362,
0.5169780850410461,
-1.0982675552368164,
-0.6443948745727539,
0.6810125708580017,
0.3057868778705597,
-0.2998234033584595,
0.5406762361526489,
-0.2032286375761032,
1.0826237201690674,
-0... |
def _ parse _ general _ information ( self, _ general _ info, name ) : def _ get _ pattern _ or _ empty ( pattern, group = 1 ) : " " " look for each pattern. if can't match, return empty string " " " try : p = re. compile ( pattern ) return p. search ( _ general _ info ). group ( group ) except attributeerror : attr = ... | [
-0.63219153881073,
-0.037948787212371826,
0.8370175957679749,
-0.7263597249984741,
-0.7371794581413269,
0.11867662519216537,
-0.7490799427032471,
-0.31806671619415283,
-1.208303689956665,
0.016306143254041672,
-0.37601208686828613,
0.36089786887168884,
0.13165883719921112,
0.28987845778465... |
def log _ exports ( self ) - > sequence [ str ] : return pulumi. get ( self, " log _ exports " ) | [
0.5100794434547424,
0.33593395352363586,
0.4584258794784546,
0.6734448671340942,
0.9409731030464172,
0.7607349753379822,
-0.5111302733421326,
-0.6802268624305725,
1.2792524099349976,
0.34408482909202576,
-0.7833899855613708,
1.1513354778289795,
0.19924001395702362,
-0.637000322341919,
-0... |
def _ alignments _ in ( y, x, board, ships ) : valid _ alignments = set ( ) # set of tuples, where each tuple is a unique ship. for ship _ id, ship _ length in enumerate ( ships ) : # this index shifts the a ship across the coordinate. for i in range ( 0, ship _ length ) : # vertical alignment attempts if y - i > = 0 a... | [
-0.6194452047348022,
0.27667126059532166,
0.6364631652832031,
-0.7817025780677795,
-0.6032623052597046,
0.0783369243144989,
-0.06066012382507324,
-0.05031413212418556,
-0.3645287752151489,
0.2932630181312561,
0.6059756278991699,
0.13575893640518188,
-0.16815003752708435,
-0.753544867038726... |
def exception _ type ( self, exception _ type ) : self. _ exception _ type = exception _ type | [
0.965619683265686,
-0.08885069191455841,
-0.2636171281337738,
0.5390188694000244,
0.9144173264503479,
0.4879103899002075,
0.2942793667316437,
0.9412717819213867,
0.4343010187149048,
0.0936763733625412,
-0.3223651051521301,
-0.19033171236515045,
-0.6774208545684814,
0.7688680291175842,
1.... |
def dispatch _ slack ( message ) : result = requests. post ( saq. config ['slack'] ['alert _ url'], headers = {'content - type':'application / json'}, data = message. value. decode ('utf8 ', errors ='ignore') ) logging. info ( f " dispatched message { message } to slack : { result } { result. text } " ) | [
0.5486353635787964,
0.2975529134273529,
0.4872574806213379,
-0.31664443016052246,
0.719788670539856,
-0.0320671871304512,
-0.6727768182754517,
-0.463895320892334,
-0.27636396884918213,
0.08727777004241943,
-0.9344100952148438,
1.5816837549209595,
0.11157090961933136,
0.7482628226280212,
... |
def _ find _ converter ( mimetype = none, extension = none, converters = ( ) ) : select = [ genericconverter ] for obj in converters : if ( mimetype = = obj. mimetype ) or ( extension in obj. extensions ) : select. append ( obj ) select. sort ( key = lambda x : x. priority, reverse = true ) return select | [
-0.847412645816803,
-1.2540295124053955,
0.6778431534767151,
0.29265108704566956,
-0.05777319148182869,
-0.5723898410797119,
-1.4700230360031128,
-0.38622182607650757,
-0.16001449525356293,
0.6812326908111572,
0.31884822249412537,
0.723567545413971,
-0.9109049439430237,
0.2905278205871582,... |
def get ( self, topic _ id : str ) - > none : topic = topic _ fetchers. get _ topic _ by _ id ( topic _ id ) story _ id _ to _ publication _ status _ map = { } for reference in topic. canonical _ story _ references : story _ id _ to _ publication _ status _ map [ reference. story _ id ] = ( reference. story _ is _ publ... | [
-0.22510790824890137,
-0.5612382292747498,
0.49387887120246887,
-0.13422273099422455,
0.23775255680084229,
0.017346449196338654,
0.23457735776901245,
-0.24471570551395416,
-1.0537388324737549,
-0.23332636058330536,
0.9003099799156189,
0.39030593633651733,
0.8832196593284607,
0.210308000445... |
def test _ request _ do _ roll _ up ( test _ dao, test _ configuration ) : dut = dtcsimilaritem ( test _ dao, test _ configuration, test ='true') dut. request _ do _ select _ all ( revision _ id = 1 ) for _ node in dut. request _ do _ select _ children ( 1 ) : _ attributes = _ node. data. get _ attributes ( ) _ attribu... | [
-1.0058274269104004,
0.8170154094696045,
0.8552772998809814,
0.19655457139015198,
0.8766422867774963,
-0.13476015627384186,
0.4546685218811035,
-0.163406640291214,
-0.32241490483283997,
0.20316119492053986,
-0.3809167742729187,
0.783635675907135,
0.18167193233966827,
-0.19834932684898376,
... |
def get _ clusters _ mpi ( self, ctype, ttotal = - 1 ) : rank = self. comm. get _ rank ( ) size = self. comm. get _ size ( ) if ttotal = = - 1 : ttotal = len ( self. trajectory ) num = int ( np. floor ( ttotal / size ) ) rem = ttotal % size traj = self. trajectory ats = self. ats molno = self. molno atype = self. atype... | [
-0.5644721388816833,
0.24398218095302582,
0.7598214149475098,
-0.2553722560405731,
-0.1973915547132492,
0.09823776036500931,
0.414311021566391,
-0.3033451437950134,
0.9994848966598511,
0.45958173274993896,
0.6632850766181946,
0.5144956707954407,
-0.06922824680805206,
-0.16433990001678467,
... |
def cleanup ( ) : path = " static " now = time. time ( ) for f in os. listdir ( path ) : ff = os. path. join ( path, f ) if os. stat ( ff ). st _ mtime < now - timeout : if os. path. isfile ( ff ) and " jpg " in f : os. remove ( ff ) | [
0.29280462861061096,
-0.31837019324302673,
0.8016284108161926,
0.4035983681678772,
-0.7970036268234253,
-0.03917267918586731,
0.6940638422966003,
-0.019122416153550148,
0.14074234664440155,
0.6397227048873901,
-0.10365813225507736,
0.027273308485746384,
0.5297883152961731,
1.47424256801605... |
def test _ inputs _ enable _ disable ( self, ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper, add _ input _ one ) : input _ page = inputpage ( ucc _ smartx _ selenium _ helper, ucc _ smartx _ rest _ helper ) self. assert _ util ( input _ page. table. input _ status _ toggle, true, left _ args = { " name ... | [
-0.17082159221172333,
0.8542878031730652,
0.6050587296485901,
0.7198534607887268,
0.47891268134117126,
0.9424920082092285,
-0.04495711252093315,
0.7591328024864197,
0.2644253373146057,
0.3024713099002838,
-0.30611491203308105,
-0.8195748329162598,
-0.8516691327095032,
0.41090452671051025,
... |
def isactive ( self ) : return self. active | [
-0.46819809079170227,
-1.8838695287704468,
0.4402472674846649,
0.591063916683197,
0.43651407957077026,
0.41234952211380005,
0.1442326158285141,
0.38749074935913086,
0.13993550837039948,
-0.8785556554794312,
-0.7702077627182007,
0.7442928552627563,
-1.1126478910446167,
-1.2869035005569458,
... |
def interval _ approximate _ nd ( f, a, b, degs ) : if len ( a )! = len ( b ) : raise valueerror ( " interval dimensions must be the same! " ) dim = len ( a ) deg = degs [ 0 ] if hasattr ( f, " evaluate _ grid " ) : # for polynomials, we can quickly evaluate all points in a grid # xyz does not contain points, but the n... | [
0.5201461911201477,
0.2603771686553955,
0.8468481302261353,
0.2912914752960205,
-0.1874888390302658,
-0.4918946623802185,
-0.40359678864479065,
0.0006397695979103446,
-0.7678177356719971,
0.4955059885978699,
0.3884766101837158,
-0.2606779932975769,
0.36301857233047485,
0.5943108201026917,
... |
def test _ get _ objects _ by _ image _ id ( self ) : response = self. client. open ('/ / objects / images / { imageid } '. format ( imageid ='imageid _ example'), method ='get') self. assert200 ( response,'response body is :'+ response. data. decode ('utf - 8') ) | [
-0.5143944025039673,
-0.3476724922657013,
0.32212820649147034,
0.005833028350025415,
0.45639950037002563,
0.4434327185153961,
0.44725117087364197,
-0.4528883993625641,
-0.27308574318885803,
0.4333406388759613,
-1.0186456441879272,
0.2608230710029602,
-0.3396696150302887,
0.6392948031425476... |
def test _ atomic _ any _ uri _ pattern _ 2 _ nistxml _ sv _ iv _ atomic _ any _ uri _ pattern _ 3 _ 5 ( mode, save _ output, output _ format ) : assert _ bindings ( schema = " nistdata / atomic / anyuri / schema + instance / nistschema - sv - iv - atomic - anyuri - pattern - 3. xsd ", instance = " nistdata / atomic / ... | [
-0.1821509450674057,
-0.22413727641105652,
0.5728065967559814,
0.9470866322517395,
-0.40498778223991394,
0.3191194534301758,
0.05215534195303917,
0.1225663423538208,
-0.26596009731292725,
0.29949626326560974,
-0.17662471532821655,
-0.13603658974170685,
-0.2932475507259369,
-0.2095526605844... |
def html _ representation ( dataset = depends ( deps. dataset ), ) : with xr. set _ options ( display _ style ='html') : return htmlresponse ( dataset. _ repr _ html _ ( ) ) | [
-0.13855712115764618,
0.9180176258087158,
0.02839820273220539,
-0.5999166965484619,
-0.8200607299804688,
-0.32136207818984985,
-0.23870369791984558,
0.21194836497306824,
0.3763398826122284,
0.5875549912452698,
0.7298048734664917,
0.5502135753631592,
0.5456944704055786,
-0.11204538494348526... |
def is _ solved ( states ) : # how many discs in the array array _ length = len ( states [ 0 ] ) for s in states : print ('time step : { } '. format ( s ) ) if states [ s ] [ 1 ] [ 0 ] = = 0 : print ('this step has first disc solved.') for d in range ( array _ length ) : if not all ( states [ s ] [ d + 1 ] ) : print ('... | [
-0.5985100269317627,
-0.1219293624162674,
0.7658431529998779,
0.078022301197052,
0.7857482433319092,
-0.5082895159721375,
0.26808851957321167,
0.2705274522304535,
0.2514488697052002,
-0.011114325374364853,
-0.4783317744731903,
-0.2702871859073639,
0.4770401120185852,
1.2749812602996826,
... |
def get _ adj _ rib _ all ( afi _ safi, peer _ ip ) : # data = dict ( ) # # prefixes = api _ utils. get _ adj _ rib _ in ( peer _ ip, afi _ safi ) # # for prefix in prefixes : # data [ prefix ] = api _ utils. get _ adj _ rib _ in ( peer _ ip, afi _ safi, prefix ) return flask. jsonify ( api _ utils. get _ adj _ rib _ a... | [
-0.36185094714164734,
0.2183481603860855,
0.48672518134117126,
0.31553933024406433,
0.5820986032485962,
-0.13099904358386993,
-0.5458941459655762,
-0.09894652664661407,
-0.17410321533679962,
0.42168182134628296,
0.6765960454940796,
0.06412961333990097,
0.0848950445652008,
0.898535966873169... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.