text
stringlengths
25
2.19k
embedding
listlengths
768
768
def _ vis _ replay _ buffer ( self, logger, step ) : if step > self. replay _ buffer. capacity : return # visualization does not work if earlier samples were overridden # get data size = self. replay _ buffer. size states = self. replay _ buffer. get ( ). observation [ : size, : 2 ] fig = plt. figure ( ) plt. scatter (...
[ 0.7449056506156921, 0.5694611668586731, 0.7403929829597473, -0.8642584085464478, -0.9434757232666016, -0.39222756028175354, 0.7621960043907166, -0.12134822458028793, 0.44466277956962585, -0.19668206572532654, -0.20875157415866852, 1.360661268234253, 0.6343593001365662, -0.6252462863922119,...
def without _ low _ degree _ nodes ( g, minimum = 1, eligible = none ) : def low _ degree ( g, threshold ) : " " " get eligible nodes whose degree is below the threshold " " " if eligible is none : return [ n for n, d in g. degree ( ) if d < threshold ] return [ n for n, d in g. degree ( ) if d < threshold and g. nodes...
[ 0.4055574834346771, 0.1965789496898651, 0.37906181812286377, -0.6963527202606201, -1.227613925933838, 0.4750063419342041, -0.30547329783439636, 0.21783903241157532, 0.30832934379577637, -0.1424802988767624, -0.5500329732894897, 0.6068398952484131, -0.5780875086784363, -1.1960986852645874, ...
def _ _ init _ _ ( self, uuid : uuid, keystore _ file : str, password : str ) - > none : super ( ). _ _ init _ _ ( ) self. _ uuid = uuid. hex self. _ ks _ file = keystore _ file self. _ ks _ password = password self. _ load _ or _ create _ keys ( )
[ -0.08963799476623535, -0.39976465702056885, 0.32431846857070923, 0.6919868588447571, -0.5839307904243469, 0.009845859371125698, -0.6008578538894653, 1.4937530755996704, -0.46544212102890015, 0.2889857292175293, -0.1595476269721985, -0.6691702604293823, 0.6524918675422668, -0.14293745160102...
def read _ file ( filename ) : try : with open ( filename ) as f : lines = [ line. rstrip ('\ n') for line in f. readlines ( ) ] return lines except ioerror : raise bogglesetupexception ('please enter a valid filename.')
[ 0.03610372543334961, 0.0026658615097403526, 0.3428995907306671, 0.7964676022529602, 0.8516061305999756, 0.2059539407491684, -0.22812195122241974, 0.598918080329895, -0.3376297056674957, 0.6482729911804199, 0.6052886843681335, -0.12119518965482712, 0.2232854813337326, 0.3098390996456146, ...
def _ _ negative _ pair ( data _ dict : dict, person : str ) : person _ list = list ( data _ dict. keys ( ) ) person _ list. remove ( person ) random. shuffle ( person _ list ) counter _ person = person _ list [ - 1 ] index _ no1 = list ( data _ dict [ person ]. keys ( ) ) random. shuffle ( index _ no1 ) index _ no2 = ...
[ -1.5347172021865845, -0.1916908323764801, 0.9062671065330505, -1.0556927919387817, -0.7029528021812439, 0.5253258347511292, 0.0659911260008812, 0.8393703103065491, -0.42933812737464905, 0.5968276262283325, -0.09310373663902283, -0.5647302865982056, -0.5958174467086792, 0.01775295101106167,...
def getvalue ( self, zeroonelist ) : totalweight = totalvalue = 0 for i in range ( len ( zeroonelist ) ) : item, weight, value = self. items [ i ] if totalweight + weight < = self. maxcapacity : totalweight + = zeroonelist [ i ] * weight totalvalue + = zeroonelist [ i ] * value return totalvalue
[ -0.5633712410926819, -0.21982167661190033, 0.720915675163269, 1.0622644424438477, 0.32566431164741516, -0.32642146944999695, 0.45936375856399536, 0.05039618909358978, 0.20198358595371246, -0.1827627718448639, -1.1604129076004028, -0.9894320964813232, -0.9870891571044922, 1.0059723854064941...
def get _ portfolio ( df, returns, lb = 0, ub = 1 ) : ncol = df. shape ( ) [ 1 ] expected _ values = df. mean ( ) covariances = df. cov ( ) h = invert ( covariances ) lower = lb if hasattr ( lb,'_ _ iter _ _') else [ lb ] * ncol upper = ub if hasattr ( ub,'_ _ iter _ _') else [ ub ] * ncol returns = returns if hasattr ...
[ -0.5862913727760315, 0.49610447883605957, 0.7655512690544128, 0.6073602437973022, 0.6302549839019775, -0.20729494094848633, 0.7497702240943909, -0.6130821108818054, 0.149529829621315, 0.16523383557796478, 0.35362735390663147, -0.10213777422904968, 0.0949678122997284, -0.6788355112075806, ...
def row ( self, index : int ) - > tuple [ any ] : return self. _ df. row _ tuple ( index )
[ -1.8539594411849976, 1.7287017107009888, 0.2244156002998352, 0.1651158183813095, 0.6329168677330017, -0.7693254351615906, -0.5758695006370544, -0.6219985485076904, -0.3643742799758911, -0.2277272492647171, 0.07950415462255478, -0.5272483229637146, 0.09586389362812042, -0.8702105283737183, ...
def updateparameters ( self, parameters ) : # check if job location folder is a valid directory if os. path. isdir ( jobloc ) : # set the path of the tiles within the specified job tileloc = os. path. join ( jobloc,'job _'+ str ( parameters [ 0 ]. value ) ) # if job folder does not exist, check if job folder read - onl...
[ -0.6643043160438538, -0.555109977722168, 0.6549051403999329, -0.4062175154685974, -0.27086833119392395, 0.03304092586040497, 0.8728040456771851, 0.34105509519577026, -0.469093382358551, 0.49923640489578247, 0.5350601077079773, 0.8634970784187317, -0.6381263136863708, 1.137304663658142, -...
def assortativity ( x _ degrees, y _ degrees ) : assortativity = 0 # to be replaced assortativity = stats. pearsonr ( x _ degrees, y _ degrees ) [ 0 ] # todo : write code for calculating assortativity # your code here # raise notimplementederror ( ) return assortativity
[ 0.2506612539291382, -1.0409414768218994, 0.44822007417678833, -0.37422797083854675, -0.16320374608039856, -0.454307496547699, 0.2636861205101013, -0.31126394867897034, -0.5029057264328003, 0.9471369981765747, 0.7960574626922607, 0.32270658016204834, -0.637367844581604, 0.17616286873817444,...
def pad ( input _ tensor, paddings ) : assert len ( paddings ) = = 4 assert paddings [ 2 ] = = paddings [ 2 ] return tf. keras. layers. zeropadding2d ( padding = tuple ( paddings [ 1 ] ) ) ( input _ tensor )
[ -0.1103777289390564, -0.22683729231357574, 0.2838730216026306, -0.08484257757663727, -0.26983359456062317, 0.6727653741836548, -0.5457713603973389, -0.42530277371406555, -0.05551209673285484, -0.252608060836792, 0.24054011702537537, -0.07283702492713928, -0.325951486825943, -0.575130283832...
def most _ frequent _ winner ( self ) : return reduce ( lambda a1, a2 : a1 if self. _ players [ a1 ]. won / self. _ players [ a1 ]. games _ played > self. _ players [ a2 ]. won / self. _ players [ a2 ]. games _ played else a2, self. _ players )
[ -0.20202790200710297, -0.4326065480709076, 0.6533591151237488, 0.5496392846107483, 0.06956794857978821, -0.2886563539505005, 0.3912386894226074, -0.5340148210525513, -0.4009535312652588, -0.6415265202522278, 0.8216837644577026, -0.05084625259041786, -0.09532936662435532, 0.0453253053128719...
def seek _ image ( self, image _ num ) : seek _ num = image _ num - self. get _ image _ num ( ) self. skip _ n _ images ( seek _ num )
[ -1.259487509727478, 0.7249234914779663, 0.6615571975708008, 0.4462803602218628, 0.5326652526855469, 0.24601882696151733, 1.5114185810089111, -0.7763581275939941, -0.12129037082195282, -0.7052677273750305, 0.4517306387424469, 0.4338586926460266, 0.0974598154425621, -0.09101404249668121, 1...
def build ( self, input _ shape ) : params = self. params for _ in range ( params [ " num _ hidden _ layers " ] ) : # create sublayers for each layer. self _ attention _ layer = layers. selfattention ( params [ " hidden _ size " ], params [ " num _ heads " ], params [ " attention _ dropout " ] ) feed _ forward _ networ...
[ -0.1859997659921646, 0.6963061094284058, 0.5361185073852539, 0.08392999321222305, 0.060734692960977554, -0.7952619791030884, 1.0377843379974365, -0.30959799885749817, -0.06766870617866516, -0.2347855418920517, -0.44672664999961853, 0.6051760315895081, 0.311466246843338, 0.5095527172088623,...
def require _ series _ field ( plot _ spec, field ) : if field not in plot _ spec : for series _ spec in plot _ spec [ " series " ] : if field not in series _ spec : raise invalid ( " field { } not defined ". format ( field ) ) return plot _ spec
[ 0.7611861228942871, 0.14327475428581238, 0.4585503339767456, -0.666597843170166, -0.008314741775393486, 1.5639827251434326, 0.11426068842411041, -0.32055535912513733, -0.6276598572731018, 0.6546513438224792, 0.3625229001045227, 0.41628411412239075, 0.15091772377490997, 0.20835566520690918,...
def get _ package _ libraries ( pkg ) : for entry in walk _ packages ( pkg. _ _ path _ _, pkg. _ _ name _ _ + '.') : try : module = import _ module ( entry [ 1 ] ) except importerror as e : raise invalidtemplatelibrary ( " invalid template library specified. importerror raised when " " trying to load'% s': % s " % ( en...
[ -0.4696340560913086, 0.7565027475357056, 0.5100318193435669, 0.01568983867764473, -0.20133671164512634, 0.5230388045310974, 0.6118305325508118, -0.01934356614947319, 0.6706249117851257, -0.3088703453540802, -0.46253544092178345, -0.8453027009963989, -0.3769403398036957, 1.016730546951294, ...
def generate _ py _ apidoc ( self ) : apidoc _ output = os. path. join ( self. apidoc _ dir, py _ dir ) # cleanup try : shutil. rmtree ( apidoc _ output ) except oserror : # dir already removed pass os. makedirs ( apidoc _ output ) with cd ( apidoc _ output ) : self. _ generate _ py _ apidoc ( apidoc _ output )
[ -0.4744778275489807, 0.06725361943244934, 0.4214898943901062, -0.5625913143157959, 0.1441536247730255, -0.022100131958723068, 1.1915379762649536, 0.17599256336688995, 0.0784338191151619, -0.7384514212608337, 0.13007988035678864, -0.21059146523475647, 0.2470100075006485, 0.3526902496814728,...
def gene _ family ( ) : allowed _ str _ args = ['family _ name ','hgnc _ symbol'] allowed _ int _ args = ['limit ','family _ identifier ','hgnc _ identifier'] args = get _ args ( request _ args = request. args, allowed _ int _ args = allowed _ int _ args, allowed _ str _ args = allowed _ str _ args ) return jsonify ( q...
[ -0.5860316753387451, 0.15753941237926483, 0.4132123291492462, 0.12944486737251282, 0.014715524390339851, -1.0603386163711548, -0.6281849145889282, -0.5697263479232788, -1.574796199798584, -0.17472440004348755, -0.19630630314350128, 0.5253695845603943, -0.18724596500396729, 0.05233401432633...
def selectvertex ( self, svertx, evertx, sverty, everty, cumulativea, cumulativeb, cumulativec ) : # commented for future use : # # # print " svertx = % s, evertx = % s, sverty = % s, everty = % s " % ( svertx, evertx, sverty, everty ) # if svertx = = evertx and sverty = = everty : # # if self. debug : print " svertx =...
[ -0.08076624572277069, -1.1630717515945435, 0.8105716705322266, -0.4907744228839874, -0.40344759821891785, -0.10207119584083557, 0.5397855043411255, -0.8368260860443115, 1.0973243713378906, -0.013297048397362232, 0.2203606516122818, 0.5033977627754211, -0.3889703154563904, -0.26931881904602...
def push _ processor ( self, host _ id ) : proc _ md = { } req _ url = urljoin ( self. _ remote _ base _ url, self. _ url _ push _ processor _ info ) proc _ md ['processor _ id'] = host _ id proc _ md ['workload'] = self. _ query _ workload ( host _ id ) proc _ md ['temperature'] = self. _ query _ temperature ( host _ ...
[ -1.013595700263977, 0.23085376620292664, 0.6197018623352051, -0.4390469789505005, -0.35556134581565857, 0.4263492226600647, -0.711477518081665, 0.014551004394888878, -0.8269860744476318, 0.7762150764465332, -0.5605097413063049, 1.3961095809936523, -0.90482097864151, 0.8996575474739075, 0...
def create _ word _ map ( words ) : word _ map = { w : i + 1 for i, w in enumerate ( words ) } # mapping for special characters word _ map [ token _ unknown ] = len ( word _ map ) + 1 word _ map [ token _ start ] = len ( word _ map ) + 1 word _ map [ token _ end ] = len ( word _ map ) + 1 word _ map [ token _ pad ] = 0...
[ -0.6044324040412903, -0.24778145551681519, 0.6664528250694275, -1.1371784210205078, -0.6747573614120483, 0.47790542244911194, 0.24533197283744812, 0.6087812781333923, 0.05310669168829918, 0.34104064106941223, -1.205100655555725, 0.04516994208097458, 0.2010248899459839, 0.43604278564453125,...
def main ( source ='auto ', quit = true ) : try : verstring ='pkgbuilder v'+ _ _ version _ _ # translators : translate the whole sentence. # alternatively, use translation instead of locale. locale = _ ('lang locale by author < mail @ if. you. want >') if locale! ='lang locale by author < mail @ if. you. want >': verst...
[ 0.6298432946205139, 0.3853023052215576, 0.9419788122177124, 0.07308872044086456, -0.18755637109279633, -0.0870157778263092, 0.7482937574386597, 0.14366422593593597, -0.04322376474738121, 0.23500700294971466, -0.22706729173660278, 0.015203629620373249, 0.8167781829833984, -0.124310813844203...
def build ( self ) : self. root = applicationroot ( ) return self. root
[ 0.6491296887397766, -1.2208292484283447, 0.2249220758676529, 0.6037803292274475, -0.5132477283477783, 0.5359383225440979, 0.0464811809360981, -0.4259035289287567, 0.43674176931381226, -1.4059629440307617, 0.14639145135879517, 1.2598594427108765, -0.8012077808380127, 1.190395712852478, -0...
def write _ csv ( filepath, data, colnames ) : # create the directory if it doesn't exist os. makedirs ( os. path. dirname ( filepath ), exist _ ok = true ) with open ( filepath,'w') as csvfile : writer = csv. writer ( csvfile ) headers = colnames + [ " last checked " ] writer. writerow ( headers ) now = datetime. now ...
[ -0.6485052108764648, -0.3477638363838196, 0.3083033561706543, 0.34202948212623596, 1.5601356029510498, 0.3811907172203064, 0.2542282044887543, 0.19007447361946106, -0.4775679409503937, -0.10228453576564789, -0.388783723115921, -0.49516817927360535, 0.26126182079315186, -0.49119725823402405...
def update ( self ) : self. screen. blit ( self. background, ( 0, 0 ) ) # draw apples and other objects for o in self. objects : self. drawobject ( o ) if self. moving _ left : self. drawobject ( ( self. horse _ image _ l, self. horse _ loc ) ) else : self. drawobject ( ( self. horse _ image, self. horse _ loc ) ) # fl...
[ -0.813711404800415, -0.7827052474021912, 0.6226754188537598, -0.1232907846570015, -0.12226784974336624, 1.0477428436279297, 0.13238513469696045, -0.2914249002933502, -0.04628811031579971, 0.41883280873298645, 0.300143301486969, -0.13489525020122528, 0.13693884015083313, 0.3496907353401184,...
def expander ( x ) : return np. expand _ dims ( x, axis = 0 )
[ 0.2605034410953522, 0.7250264286994934, 0.44957250356674194, 0.5062055587768555, -0.7230021357536316, 0.09915167838335037, 0.14507068693637848, -0.0024802854750305414, 0.5761916041374207, -0.34236955642700195, 0.6319618225097656, 0.13046306371688843, 0.5529587864875793, 0.20376132428646088...
def train _ extratree ( self ) : clf = extratreesclassifier ( n _ estimators = 1000, max _ depth = 15, min _ samples _ split = 10, random _ state = 0 ) self. clf = clf. fit ( self. data, self. target ) self. evaluate ( self. clf )
[ -0.15678159892559052, 0.41514116525650024, 0.37256863713264465, -0.8013405203819275, 0.696017861366272, -0.09811852127313614, -0.11579343676567078, 1.613568902015686, 0.2444971352815628, -0.43792420625686646, -1.0301010608673096, 1.3781774044036865, -0.1362150013446808, 0.23534199595451355...
def _ _ init _ _ ( self, g _ id : int, couples : list [ couple ] ) : assert 2 * len ( couples ) = = settings. n _ population self. cs : list [ couple ] = couples self. n = len ( couples ) self. id = g _ id self. preg = self. population _ register ( ) self. creg = none self. lump _ sum = none self. prev _ lump _ sums = ...
[ -0.10630075633525848, 0.5960783362388611, 0.4616866707801819, 0.7714064717292786, 0.2828094959259033, 0.0974174439907074, 0.6034967303276062, 0.11359746754169464, -0.09936115145683289, -0.07406017184257507, -0.771364152431488, 0.016765279695391655, 0.10768671333789825, 0.8228787779808044, ...
def certificate _ upload _ date ( self ) - > str : return pulumi. get ( self, " certificate _ upload _ date " )
[ 0.8817152380943298, 0.3210908770561218, 0.6888390779495239, 0.3191121518611908, 0.2796056270599365, 1.3646245002746582, -0.10193832963705063, -0.030171282589435577, 0.019376132637262344, 0.583796501159668, -0.6166176199913025, 0.2669636309146881, 0.34649530053138733, -1.053847074508667, ...
def translate _ solution ( solution ) : ext = { } used _ pops = [ ] for v in solution [ " vnfs " ] : if " is _ sap " in v and v [ " is _ sap " ] = = true : # ignore dummy vnfs continue if " place _ at " in v and len ( v [ " place _ at " ] ) > 0 : # if the vnf is placed at some host ( in our case there are no vnf replic...
[ -0.6109203696250916, 0.04137135669589043, 0.6318223476409912, -0.06411299109458923, -0.7019777894020081, -0.9608052372932434, 0.46176379919052124, -0.0925731211900711, 0.6760013103485107, 0.8886268734931946, -0.39022183418273926, -0.8824120163917542, 0.3579896092414856, 0.198841854929924, ...
def log _ progress ( current : int, max _ value : int ) : _ check _ experiment ( ) _ current _ experiment. log _ progress ( current, max _ value )
[ -0.5523861646652222, 0.10001330822706223, 0.2774830460548401, 0.5752350687980652, -0.4522510766983032, 0.403238445520401, -0.3364235460758209, 0.41912755370140076, -0.8670320510864258, -0.1561252325773239, 0.2388424277305603, 0.21213223040103912, -0.4362238347530365, 0.2603355050086975, ...
def get _ genes ( self, * confidence _ levels : str ) : genes _ to _ return = [ ] if confidence _ levels : genes = [ ] for level in confidence _ levels : assert level in [ 0, 1, 2, 3 ], ( " choose among the following levels : 3 ( green ), 2 ( amber ), " " 1 ( red ), 0 ( the rest ) " ) if str ( level ) in self. genes : ...
[ -0.34437891840934753, -0.7130701541900635, 0.5295053720474243, 1.380003809928894, 0.7230849862098694, -0.0033121767919510603, -1.2049981355667114, 0.09275549650192261, -0.7141749858856201, 0.0863426998257637, 0.20762455463409424, 0.6391592621803284, -1.1099679470062256, 1.0980530977249146,...
def build _ check _ task _ options ( data, host _ id, instance _ id, checks, timestamp ) : return dict ( host _ id = host _ id, instance _ id = instance _ id, data = preprocess _ data ( data, checks, timestamp ), )
[ 0.04866820201277733, 0.05685894191265106, 0.3841016888618469, -0.022764690220355988, 0.29288560152053833, 0.22707147896289825, 0.18086493015289307, 0.5016286969184875, -0.5711885690689087, 0.47901856899261475, -0.18635684251785278, 0.7246248722076416, 0.7535974979400635, 0.2146960645914077...
def setupclass ( cls ) : cls. maxdiff = none cls. job _ 1 = gaussianadapter ( execution _ type ='queue ', job _ type ='conformers ', level = level ( method ='cbs - qb3'), project ='test ', project _ directory = os. path. join ( arc _ path,'arc ','testing ','test _ jobadapter'), species = [ arcspecies ( label ='spc1 ', ...
[ 0.4854886829853058, -0.40487027168273926, 0.883687436580658, 0.3368239998817444, 0.24844880402088165, 0.28592029213905334, 0.313262939453125, -0.3282763361930847, -0.051889412105083466, -0.4736170172691345, -0.19066700339317322, 0.593941330909729, -0.1367068737745285, 0.3657417595386505, ...
def decorator ( sorting _ algorithm ) : @ wraps ( sorting _ algorithm ) def wrapper ( arr, * args, * * kwargs ) : to _ sort = [ ( value, i ) for i, value in enumerate ( arr ) ] if kwargs. get ('key') : key = kwargs ['key'] kwargs ['key'] = lambda x : ( key ( x [ 0 ] ), x [ 1 ] ) if kwargs. get ('reverse') : to _ sort [...
[ -0.9978331923484802, 0.4625247120857239, 0.6808497905731201, -0.11605304479598999, -0.654322624206543, 0.10028006136417389, -0.4290373623371124, 0.45592331886291504, -0.14388005435466766, 1.2093067169189453, 0.4524480402469635, 0.42654895782470703, 0.4242326319217682, 0.8294710516929626, ...
def config _ mode ( self, * args, * * kwargs ) : return " "
[ -1.156614899635315, -0.03690618276596069, 0.5300053954124451, -0.00963854230940342, 0.6992622017860413, 0.5618054866790771, -0.4592140018939972, 0.4265839457511902, -0.5929762125015259, 0.44334694743156433, -0.3404891788959503, -0.8667274117469788, -0.6029282212257385, 0.43970364332199097,...
def _ _ init _ _ ( self, params, name = none ) : super ( cnnextractor, self ). _ _ init _ _ ( name = name ) self. params = params self. cnn _ model = tf. keras. applications. inception _ v3. inceptionv3 ( # type : tf. keras. models. model weights ='imagenet ', include _ top = false, pooling ='avg') for layer in self. c...
[ -0.23418325185775757, -0.013139509595930576, 0.5957890748977661, 0.5190486311912537, 0.026903850957751274, 0.027128295972943306, 0.39390289783477783, 1.0540016889572144, -0.7832625508308411, 0.7848580479621887, -0.5061053037643433, -0.8440991640090942, -0.8985163569450378, 0.80503743886947...
def entity _ id ( self ) : return self. _ entity _ id
[ 1.4186663627624512, -1.3584675788879395, 0.1656503975391388, 0.5107023119926453, 1.8700976371765137, 1.4267067909240723, 1.1752616167068481, 0.7003363370895386, 0.9495521783828735, -0.7486595511436462, 0.849808931350708, 1.0656638145446777, 0.39380767941474915, 0.8707168102264404, 0.5048...
def get _ object _ or _ none ( klass, * args, * * kwargs ) : queryset = _ get _ queryset ( klass ) try : return queryset. get ( * args, * * kwargs ) except queryset. model. doesnotexist : return none
[ -0.625214159488678, -0.5297762751579285, 0.7607031464576721, -0.05460149794816971, 0.44695064425468445, -0.24944981932640076, -0.9651926159858704, -1.038341760635376, -0.028811752796173096, 0.19794981181621552, 0.5762128829956055, -0.16073758900165558, 0.26305651664733887, -0.6488093733787...
def orientable ( self, * args ) : return _ topods. topods _ tshape _ orientable ( self, * args )
[ -0.1759299784898758, 0.26608556509017944, 0.3440319299697876, -0.4488059878349304, 0.34966546297073364, 0.30318978428840637, 0.7508200407028198, -0.6299915313720703, -0.8856053352355957, 0.7573321461677551, -0.03415552154183388, -0.408040314912796, -0.980633020401001, -1.2552220821380615, ...
def addjobscheduledlistener ( self, c : utility. function. callback ) - > none :...
[ 0.5724751949310303, -0.5569729208946228, 0.5586672425270081, -0.20032991468906403, -0.380668580532074, 1.1780571937561035, -0.14601372182369232, 0.31409355998039246, 0.14111171662807465, -1.3191674947738647, -0.9415218234062195, 0.10218171030282974, 0.15865600109100342, 0.3347346782684326,...
def verdict ( df ) : sweep _ list = df ['sweep']. unique ( ) for sweep in sweep _ list : filter _ sweep = df. loc [ ( df ['sweep'] = = sweep ) ] lc _ list = filter _ sweep ['lc _ account']. unique ( ) for lc in lc _ list : filter _ lc = df. loc [ ( df ['lc _ account'] = = lc ) & ( df ['status']! ='entitlement removed')...
[ 0.2273353487253189, -0.21537397801876068, 0.7836612462997437, -0.9646756649017334, -0.316232830286026, 0.2949725389480591, -0.3322497308254242, 0.9172998666763306, -0.344527006149292, 0.9880586862564087, 0.23795385658740997, 1.1529021263122559, 1.1328274011611938, 0.5833746194839478, 0.9...
def count _ chaperone _ events ( dfs, thresh, fps _ clean, thresh _ clean ) : cleaned _ df = [ ] for treatment _ name, df in dfs. groupby ( " treatment _ name " ) : initial _ data = df [ df [ " treatment _ name " ] = = treatment _ name ] cleaned = cleanup _ dwell ( initial _ data, fps _ clean, thresh _ clean ) cleaned ...
[ -0.012115354649722576, 0.3406231999397278, 0.8730675578117371, -0.5328485369682312, 0.22709748148918152, -0.05219096690416336, 0.501282811164856, 0.6718059778213501, -0.20440733432769775, -0.12009155005216599, -0.4220936596393585, -0.30897384881973267, 0.39092376828193665, 0.07665593922138...
def median _ of _ three ( lst, start, end ) : a, b, c = randint ( start, end ), randint ( start, end ), randint ( start, end ) if lst [ a ] < = lst [ b ] < = lst [ c ] or lst [ a ] > = lst [ b ] > = lst [ c ] : return b elif lst [ b ] < = lst [ a ] < = lst [ c ] or lst [ b ] > = lst [ a ] > = lst [ c ] : return a else ...
[ 0.36397936940193176, -0.657515823841095, 0.7309337258338928, -0.27952486276626587, -0.22880113124847412, 1.184714436531067, -1.0384360551834106, 0.27517616748809814, 0.43457794189453125, -0.11840632557868958, -0.11097800731658936, 0.15324650704860687, -1.1115367412567139, -1.01289153099060...
def test _ prod ( ) : print ('testing prod ( )') result = funcs. prod ( ( 5, ) ) introcs. assert _ equals ( 5, result ) result = funcs. prod ( ( 1, 2, 3, 1 ) ) introcs. assert _ equals ( 6, result ) result = funcs. prod ( ( ) ) introcs. assert _ equals ( 1, result ) result = funcs. prod ( ( 7, 12, 1, 2, 2 ) ) introcs. ...
[ -0.34524983167648315, 0.15618985891342163, 0.7686939239501953, 0.852235734462738, -0.0816505178809166, 0.4456576406955719, 1.499424934387207, -0.4643482267856598, 0.481946736574173, -1.325169324874878, 0.15835736691951752, 0.14157730340957642, -0.5106188654899597, -0.35121238231658936, 0...
def displaywidgetstocollectinfo ( self ) : # create label for image title _ h _ box = qhboxlayout ( ) login _ label = qlabel ( self ) login _ label. settext ( " create new account " ) title _ h _ box. addwidget ( login _ label ) login _ label. setfont ( qfont ('arial ', 20 ) ) username _ h _ box = qhboxlayout ( ) name ...
[ -0.0035595151130110025, -0.32847678661346436, 0.8692004680633545, -0.5766240954399109, 0.32651230692863464, 1.0626885890960693, 0.726258397102356, -0.9061620235443115, 0.03676450252532959, -0.4433104991912842, -0.4247942864894867, -0.7801185846328735, 0.3494848906993866, 0.8846924304962158...
def get _ parameter ( vault, name, at = none, is _ json = false, optional = false, default _ value = none ) : if at : parameter = vault. get _ parameter _ timeseries ( name = name ). at ( timestamp = at ) else : parameter = vault. get _ parameter _ timeseries ( name = name ). latest ( ) if optional : parameter = parame...
[ -0.5744636058807373, 0.32244962453842163, 0.5951683521270752, -0.008699918165802956, -0.06321349740028381, -0.794124960899353, -1.6689660549163818, -1.1871813535690308, 0.09347419440746307, 1.1949353218078613, 0.3713764250278473, 1.0699681043624878, 0.5707218647003174, -0.4170646071434021,...
def _ parse _ example _ variant _ alt _ allele ( example ) : parsed _ features = tf. io. parse _ single _ example ( serialized = example, features = proto _ features ) variant = parsed _ features ['variant / encoded'] alt _ allele _ indices = parsed _ features ['alt _ allele _ indices / encoded'] return variant, alt _ ...
[ -0.018914462998509407, -1.344374418258667, 0.22437500953674316, 0.03737795725464821, -0.7950544953346252, 0.5514081120491028, 0.25305673480033875, 1.3621625900268555, 0.27166807651519775, 0.7397746443748474, -0.6494885683059692, 1.2470265626907349, 1.0073939561843872, -0.49144864082336426,...
def compute _ temperature ( self ) : temperature = self. temperature _ sl + self. a * self. altitude # print ( temperature ) return temperature
[ 0.4771241545677185, -0.643683135509491, 0.21684694290161133, 0.06933876872062683, -0.1906009018421173, -0.04011956602334976, 0.45296990871429443, 1.6267399787902832, 0.10693342238664627, 0.6624577641487122, 0.3183489441871643, 0.3436686098575592, -0.031827885657548904, 0.3274192810058594, ...
def read ( polarfile, cpfile, coordfile ) : data = {'c': np. array ( [ c ] ),'d': np. array ( [ d ] ),'t': np. array ( [ t ] ) } with open ( polarfile ) as f : lines = f. readlines ( ) a = [ ] cl = [ ] cd = [ ] cdp = [ ] cm = [ ] # xtr _ top = [ ] # xtr _ bottom = [ ] for line in lines [ 12 : ] : split = line. split ( ...
[ 0.3591921627521515, -1.1314585208892822, 1.0303497314453125, -1.7317038774490356, -0.3241202235221863, 1.0330687761306763, 0.32333192229270935, 0.36482667922973633, -1.6356793642044067, 0.04318331182003021, -0.2311626672744751, -0.01786915399134159, -0.23715922236442566, 0.1233140975236892...
def test _ bw40 _ ch124 ( self, setup ) : self. common _ channel ( band ='40 ', channel ='124')
[ 0.41305020451545715, 0.2613564431667328, 0.5659875273704529, -0.3058774173259735, 1.0684869289398193, 0.40447884798049927, 0.06496625393629074, -1.3149348497390747, -0.5229957103729248, 0.03547923266887665, -0.3977590501308441, 0.42156967520713806, -0.7220597267150879, 0.8251025080680847, ...
def get _ wp _ post _ data ( self ) : res = self. db _ session. execute ( importpagedata. pages _ to _ include ). fetchall ( ) for row in res : page _ id = row [ 0 ] best _ revision = self. find _ most _ recent _ revision ( page _ id ) if best _ revision : row = self. get _ row _ from _ id ( page _ id ) yield row
[ 0.6690405607223511, 0.32645636796951294, 0.6217459440231323, -0.02167949452996254, -0.06898563355207443, -0.09483977407217026, -0.9709681272506714, 0.1705615073442459, 0.08175309747457504, 0.3357847034931183, 1.122883915901184, 0.19924944639205933, 0.11662764847278595, 0.2639659345149994, ...
def levels ( ohlc _ day ) : high = round ( ohlc _ day [ " high " ] [ - 1 ], 2 ) low = round ( ohlc _ day [ " low " ] [ - 1 ], 2 ) close = round ( ohlc _ day [ " close " ] [ - 1 ], 2 ) pivot = round ( ( high + low + close ) / 3, 2 ) r1 = round ( ( 2 * pivot - low ), 2 ) r2 = round ( ( pivot + ( high - low ) ), 2 ) r3 = ...
[ -0.49892619252204895, -0.20021851360797882, 0.6319525837898254, -0.6658207774162292, 0.03247592970728874, -0.03844267874956131, -0.36458584666252136, -0.7788900136947632, -0.4988948702812195, 0.03456588089466095, -0.4721871614456177, -1.2468219995498657, -0.0470111146569252, 0.073637947440...
def write _ problem _ schema ( self ) : if self. has _ error : return false if not self. new _ problem _ doc : err _ msg ='" new _ problem _ doc " is not set! ( userproblemhelper )'self. add _ error _ message ( err _ msg ) return false if key _ file _ prefix in self. problem _ updates : success, filepath _ or _ err = \...
[ -0.946455717086792, -0.9650663137435913, 0.6378211379051208, 0.5962021946907043, 0.559175968170166, 0.9323176741600037, 0.5887323021888733, 0.6939414739608765, -0.4090493321418762, 0.049233824014663696, -0.06361781805753708, -0.5590283274650574, -0.7093629240989685, -0.4687964916229248, ...
async def test _ logbook _ stream _ excluded _ entities _ inherits _ filters _ from _ recorder ( recorder _ mock : recorder, hass : homeassistant, hass _ ws _ client : websocketgenerator ) - > none : now = dt _ util. utcnow ( ) await asyncio. gather ( * [ async _ setup _ component ( hass, comp, { } ) for comp in ( " ho...
[ 0.5963881611824036, 0.41592493653297424, 0.7412946820259094, 0.43848761916160583, -0.5363062024116516, 0.26504647731781006, 0.5036922693252563, -0.24164028465747833, 0.3041682839393616, -1.0919268131256104, -0.6928612589836121, 0.3664150536060333, 0.20524851977825165, 0.9981838464736938, ...
def str ( self, flag = " prereqs " ) : output = " " if flag = = " prereqs " : output = self. _ _ print _ prereqs ( ) if flag = = " grades " : output = self. _ _ print _ grades ( ) if flag = = " not _ open " : output = self. _ _ print _ not _ open ( ) if flag = = " only " : output = self. _ _ print _ only ( ) if flag = ...
[ -0.8158023953437805, -0.8960456252098083, 0.7265385389328003, 0.4052489399909973, -1.1865019798278809, 1.0983781814575195, 0.22275206446647644, -0.36480095982551575, -1.1776670217514038, -0.1049593910574913, 0.6961286067962646, 0.2408566176891327, -0.49968093633651733, 0.8033350110054016, ...
def describe ( self, buf _ inputs ) : print ( buf _ inputs. type ( ) ) # print ( buf _ inputs. size ( ) ) # 的 shape , 元 print ( buf _ inputs. dim ( ) ) # 的
[ 0.44975611567497253, 0.23773245513439178, 0.783728301525116, -0.4907435476779938, 0.8129258751869202, 0.5488322377204895, 1.0020039081573486, -0.3457503318786621, 0.1452413946390152, -0.5310419201850891, -1.076430320739746, 1.700971245765686, -0.6633346676826477, 0.28613829612731934, -0....
def encode ( self, word ) : return ( word @ self. g ) % 2
[ -0.32237744331359863, 0.08816942572593689, 0.2675456404685974, 0.5058709979057312, -0.687157928943634, 0.6522508859634399, 0.10372282564640045, -1.1762962341308594, 0.07299249619245529, -0.36358389258384705, -0.0838729664683342, 0.41872501373291016, -1.4271492958068848, 0.8803801536560059,...
def hazard ( self ) : if self. hazardous = ='n': hazard ='is not'else : hazard ='is'return hazard
[ -0.029220806434750557, 0.14585895836353302, 0.4161686599254608, 0.5089432597160339, 0.6645234823226929, 1.1113824844360352, -0.8656213879585266, -0.5207203030586243, 0.4297206699848175, -0.03240814432501793, 0.15439018607139587, 0.4775015413761139, -0.5505598783493042, -0.4306057095527649,...
def make _ inference ( image, model _ config, model _ weights, threshold = 0. 7, save = false ) : # create predictor and model config cfg, predictor = create _ predictor ( model _ config, model _ weights, threshold ) # convert pil image to array image = np. asarray ( image ) outputs = predictor ( image ) v = shellfishv...
[ -0.4961954355239868, 0.44776785373687744, 0.5782281160354614, -0.8495612144470215, -0.5481569170951843, 0.3784973919391632, -0.34790781140327454, 0.31627529859542847, -0.296994686126709, 0.5147891640663147, -0.40086036920547485, 0.7262609004974365, 0.2217155247926712, 0.5826471447944641, ...
def test _ storage _ providers _ exclude _ thumbnails ( self ) - > none : host, media _ id = self. _ download _ image ( ) rel _ thumbnail _ path = ( self. media _ repo. filepaths. url _ cache _ thumbnail _ directory _ rel ( media _ id ) ) media _ store _ thumbnail _ path = os. path. join ( self. media _ store _ path, r...
[ -0.028129812330007553, 1.0130631923675537, 0.8064957857131958, 0.24543890357017517, 0.6721607446670532, 0.3108789324760437, 0.5229606628417969, 0.08808799088001251, 0.2660500705242157, 0.2978852391242981, -0.5085021257400513, 0.08593523502349854, 0.08450645953416824, -0.4688281714916229, ...
async def test _ live _ stream _ with _ one _ second _ commit _ interval ( async _ setup _ recorder _ instance : recorderinstancegenerator, hass : homeassistant, hass _ ws _ client : websocketgenerator, device _ registry : dr. deviceregistry, ) - > none : config = { recorder. conf _ commit _ interval : 0. 5 } await asy...
[ 0.6925409436225891, 0.17655493319034576, 1.1359280347824097, 0.8212572336196899, 0.5656647682189941, -0.03134692460298538, 0.9314895272254944, -0.21552905440330505, -0.3796461522579193, -0.03375633433461189, -0.5247857570648193, 0.41963979601860046, -0.5121613144874573, 0.8442062139511108,...
def _ normalize _ data ( self, data : dict ) - > dict [ str, bool ] : normalized _ data = { } for k, v in data. items ( ) : field _ name = k. lower ( ). replace ('','_') field _ name ='is _ { } _ public '. format ( field _ name ) field _ value = v! ='hidden'normalized _ data [ field _ name ] = field _ value return norm...
[ -0.5950616598129272, 0.24952998757362366, 0.49589523673057556, -1.3970659971237183, -0.7507057785987854, 0.35148146748542786, -1.092010259628296, 0.26074349880218506, -0.334817498922348, 1.0397719144821167, -1.393640160560608, 0.051757629960775375, 0.2594436705112457, -0.005588112864643335...
def location ( self ) : return self. execute ( command. get _ location ) ['value']
[ -0.5891454219818115, -0.40007323026657104, 0.36491915583610535, 1.0323482751846313, 0.6526315212249756, -0.30121859908103943, 0.9009271264076233, -0.12045688927173615, -0.593074381351471, -0.23533843457698822, 1.0012913942337036, 0.7499265670776367, -0.43377235531806946, -0.995099306106567...
def use _ knight _ pre _ roll ( self, game _ state ) : return
[ -0.30089136958122253, 0.4750710129737854, 0.5796408653259277, 0.4275796413421631, -0.4177038371562958, -0.13779404759407043, -0.053832195699214935, 0.43059206008911133, 0.8257499933242798, -0.17441417276859283, -0.16762737929821014, 0.11173047870397568, 0.26293858885765076, 0.8355908393859...
def _ proxy ( self ) - > " hostednumberordercontext " : if self. _ context is none : self. _ context = hostednumberordercontext ( self. _ version, sid = self. _ solution [ " sid " ], ) return self. _ context
[ 0.6307706236839294, 0.2521001994609833, 0.6111257076263428, -0.26085808873176575, -0.20832616090774536, 0.11066754907369614, 0.2575468122959137, -0.029899630695581436, 0.9400502443313599, -0.9599702954292297, -0.20038112998008728, -0.40907585620880127, -0.4647757112979889, -0.2776165604591...
def eigenvalue _ based _ rog ( simname, coord _ loc = [ 3, 6 ] ) : coord, bs = extract. extract _ unwrapped ( simname, first _ only = true, boxsize = true ) coord = coord ['timestep _ 0'] sidehx = bs [ 0 ] / 2 sidehy = bs [ 1 ] / 2 sidehz = bs [ 2 ] / 2 all _ gyration _ tensors = { } rog = { } for index, chain in enume...
[ 0.3214420676231384, 0.2189944088459015, 0.7655139565467834, -0.3766673803329468, 0.4445354640483856, -0.8499026894569397, 0.6000201106071472, 0.3926542401313782, -0.45871150493621826, 0.6101838946342468, -0.2320461869239807, 0.22247996926307678, 0.024355201050639153, -0.06908370554447174, ...
def tree ( self, type _ name, recursive = true, max _ level = 999 ) : def field _ lookup ( struct, indent _ level = 0 ) : indent ='' * indent _ level fields ='' for ftype, fname in struct. fields : type _ name, field _ name = type _ names [ ftype ], field _ names [ fname ] fields + = indent +'| - - { } { } '. format ( ...
[ -0.34090468287467957, 0.672240674495697, 0.7647521495819092, -1.2346222400665283, -0.4581579566001892, -0.2086750715970993, 0.03705361485481262, -0.3104226887226105, -0.1889786720275879, 0.43292370438575745, 0.049967192113399506, 0.17099107801914215, -0.7431855201721191, -0.335717767477035...
def get _ center ( self ) : return ( self. matrix [ 0, 2 ], self. matrix [ 1, 2 ] )
[ -0.6543895602226257, -0.43225255608558655, 0.512770414352417, 0.10895506292581558, 0.4505830407142639, -0.25112468004226685, -0.24622273445129395, 0.04856085032224655, 0.05165519565343857, 0.9250786900520325, -0.3844185173511505, 0.09634216874837875, -0.674934446811676, -0.1240055412054061...
def set _ fixed _ threshold _ std ( self, threshold _ std ) : # set fixed threshold on recurrence plot level jointrecurrenceplot. set _ fixed _ threshold _ std ( self, threshold _ std ) # set diagonal of jr to zero to avoid self - loops in the joint # recurrence network a = self. jr. copy ( ) a. flat [ : : self. n + 1 ...
[ 0.8563874363899231, -0.2914753556251526, 0.5708304643630981, 0.5119284391403198, -0.6899636387825012, 0.22987495362758636, 1.4352152347564697, 0.4031260907649994, -0.4271879494190216, -0.9228615164756775, -0.6098265051841736, 0.8884896636009216, -0.6672865748405457, 0.05630268156528473, ...
def datatable _ options ( self ) : return self. _ datatable _ options
[ -0.04582982882857323, 0.35827288031578064, 0.2639167308807373, -0.23939402401447296, 0.4885827898979187, 0.3160378634929657, 0.3265177011489868, -0.9060235023498535, -0.6436765789985657, -0.23297345638275146, -0.9275773167610168, 0.82853764295578, 0.8678564429283142, -0.13655610382556915, ...
def application ( environ, start _ response ) : output = [ ] if environ ['request _ method'] = ='get': return bad _ request ( start _ response ) # # # # # parameters are never safe try : content _ length = int ( environ ['content _ length'] ) except valueerror : content _ length = 0 post _ data = environ ['wsgi. input'...
[ -0.4563029110431671, -0.0407022200524807, 0.8701432943344116, 0.49548229575157166, 0.07961218804121017, -0.5356109738349915, -0.4091542065143585, -1.104791283607483, -0.7549535036087036, 0.4917643964290619, -0.3197599947452545, 0.015518097206950188, 0.2369774729013443, 0.4649660289287567, ...
def deposit ( ) : if request. method = = " post " : # extract cash amount from the form dollarstoadd = request. form. get ( " deposit amount " ) # check if the cash is a float try : dollarstoadd = float ( dollarstoadd ) except typeerror : return apology ( " a valid currency number should be entered. " ) # make sure the...
[ 0.6971361637115479, 0.725499153137207, 0.9131308197975159, 0.7327715754508972, 0.321096807718277, 0.16469691693782806, 1.037561058998108, -0.21760019659996033, 0.0635622963309288, -0.5015802383422852, 0.0524783656001091, -0.7689493894577026, -0.2560179531574249, 0.6591179966926575, 0.769...
def format _ lat _ lon ( la : str, lo : str ) - > tuple : la = la [ : 2 ] + '.'+ la [ 2 : ] lo = lo [ : 1 ] + '.'+ lo [ 1 : ] return la, lo
[ 0.2801763713359833, -1.4602946043014526, 0.7920681238174438, -1.0923258066177368, 0.2048567533493042, 0.16002508997917175, -0.8741527199745178, -0.22251418232917786, -0.2289828658103943, 0.4635728895664215, 0.6122280955314636, 0.5640347599983215, 0.7447922229766846, -0.1028791069984436, ...
def map _ foldindex _ to _ groupedorder ( x : pd. dataframe, n _ folds : int, return _ foldorder : bool = false ) - > none : f = crossvalidate ( n _ folds, true, true ) ( get _ validation _ fold _ time ) # sorting needs to be activated because then we how the indices line up chronologically foldorder = f ( x _ in = x, ...
[ -0.8895856738090515, 0.6761634945869446, 0.6916537880897522, 0.6324338316917419, -0.18302732706069946, -0.4989945888519287, -0.2605441212654114, -0.614356517791748, -0.17758405208587646, -0.13390298187732697, -0.01021393109112978, 0.202376589179039, 0.907676637172699, -0.37886619567871094,...
def transaction _ location _ id ( self, transaction _ location _ id ) : if transaction _ location _ id is none : raise valueerror ( " invalid value for ` transaction _ location _ id `, must not be ` none ` " ) if len ( transaction _ location _ id ) < 1 : raise valueerror ( " invalid value for ` transaction _ location _...
[ 0.009652932174503803, -0.10475891083478928, -0.7168340086936951, -0.668723464012146, 0.3638133704662323, 0.06586982309818268, 0.6067494750022888, 0.3071118891239166, 0.18025609850883484, 0.9219880700111389, -0.046031415462493896, -0.7446995973587036, 0.11018341034650803, -0.061232037842273...
def get _ values ( self, x _ axis ) : el = [ self. _ elements. get ( x _ axis ) ] return self. _ get _ data ( el )
[ -0.26321303844451904, 0.5557601451873779, 0.49766963720321655, 0.7027992010116577, 0.09004995971918106, 0.14451755583286285, -1.2556958198547363, -0.5672059059143066, -0.3695581257343292, -0.2918901741504669, -0.9991052746772766, 1.0529383420944214, 0.3257278800010681, -0.3385933041572571,...
def compute _ normal ( vertex, face ) : eps = np. finfo ( float ). eps nface = np. shape ( face ) [ 1 ] nvert = np. shape ( vertex ) [ 1 ] normal = np. zeros ( [ 3, nvert ] ) # unit normals to the faces normalf = crossp ( vertex [ :, face [ 1, : ] ] - vertex [ :, face [ 0, : ] ], vertex [ :, face [ 2, : ] ] - vertex [ ...
[ -0.3009451627731323, 0.16769564151763916, 0.696239709854126, -0.01993715390563011, -1.3665226697921753, 0.3165740370750427, 0.2530519664287567, 0.585233747959137, 0.10634337365627289, 1.0708136558532715, 0.09786178916692734, 0.3716275990009308, -1.0009198188781738, -0.82624351978302, -0....
def position ( self, content ) : allowed = [ " c ", " cb ", " db ", " de ", " dl ", " dt ", " fb ", " fs ", " g ", " ilb ", " k ", " lb ", " ls ", " mlb ", " nt ", " og ", " ol ", " olb ", " ot ", " p ", " qb ", " rb ", " saf ", " ss ", " t ", " te ", " wr ", " unk ", " dst ", ] xref = { " ml " : " lb ", " il " : " lb ...
[ -0.33292755484580994, -0.5188013911247253, 0.9870654344558716, -0.8530622124671936, -0.7798444032669067, 0.2236170470714569, 0.057596877217292786, 0.03212660551071167, -0.4330744743347168, 0.5744488835334778, 0.7273743152618408, -0.7491961717605591, -0.8797482252120972, -0.4786573946475982...
def _ do _ launch _ separate _ process ( cls ) : import subprocess import time import re import signal output _ name ='sim _ output. txt'args = ['bin / python ','mi / instrument / uw / res _ probe / ooicore / test / trhph _ simulator. py ','- - logfile ', output _ name ] log. info ( " = = starting simulator = = % s " %...
[ 1.0613130331039429, -0.4647717773914337, 0.879453182220459, 0.11286838352680206, -0.05851089209318161, -0.2395537942647934, 0.6258346438407898, -0.2087385356426239, 0.08255372196435928, -0.5463849306106567, -0.30891722440719604, -0.23840934038162231, 0.13934528827667236, -0.247818544507026...
def do _ request ( address, request, timeout = - 1 ) : # determine host ( assume tcp ) protocol, host, port = split _ address ( address ) # check request if not isinstance ( request, basestring ) : raise valueerror ( " request should be a string. " ) # check timeout if timeout is none : timeout = - 1 # create socket an...
[ -0.7601837515830994, 0.3503371775150299, 0.7713813781738281, -0.3238608241081238, -0.3541572391986847, -0.5391861200332642, -0.8511056303977966, -0.07594794780015945, 0.5057298541069031, 0.5967385172843933, 0.6193883419036865, 0.8092545866966248, -0.6100183725357056, -0.4814505875110626, ...
def get _ costs ( self, start _ nodes, end _ nodes, end _ speed = 10. 0 ) : if not isinstance ( start _ nodes, list ) : start _ nodes = [ start _ nodes ] if not isinstance ( end _ nodes, list ) : end _ nodes = [ end _ nodes ] output = { } # many - to - one or one - to - one if len ( end _ nodes ) = = 1 : for start _ no...
[ -1.3160431385040283, 0.5751155018806458, 0.9023967385292053, 0.09639660269021988, 0.1409929394721985, -1.2657235860824585, -0.33729591965675354, 0.9656249284744263, -0.8281878232955933, 0.7895317673683167, -0.3318037688732147, -0.04315286502242088, -0.16712364554405212, 0.5038691163063049,...
def _ _ init _ _ ( self, input _ shape, n _ output _ classes, conv1 _ channels, conv2 _ channels ) : image _ width, image _ height, n _ channels = input _ shape self. conv _ 1 = convolutionallayer ( n _ channels, conv1 _ channels, 3, 1 ) self. relu _ 1 = relulayer ( ) self. max _ pool _ 1 = maxpoolinglayer ( 4, 4 ) sel...
[ -0.12197650223970413, -0.5185401439666748, 0.5241910219192505, 0.9279954433441162, -0.27010127902030945, -0.30892810225486755, -0.1880355030298233, -0.35069331526756287, -0.23556780815124512, -0.2763824760913849, -0.5650367140769958, -0.4904371201992035, 0.18073724210262299, 0.939220368862...
def get _ to _ data ( tup, vocab, labeldict, max _ len ) : sent = [ vocab [ wrd ] if wrd in vocab else vocab [ " unk " ] for wrd in tup [ 0 ] ] sentlen = len ( sent ) sent. extend ( [ - 1 ] * ( max _ len - sentlen ) ) for rel in tup [ 1 ] : ent, num, label, idthing = rel ent _ dists = [ j - ent [ 0 ] if j < ent [ 0 ] e...
[ -0.3539457619190216, -0.0242819394916296, 0.5523130893707275, -1.420521855354309, 0.05174856260418892, 0.14614464342594147, -0.20491500198841095, -0.5387250185012817, -0.343177855014801, 0.13305257260799408, -0.5320473909378052, 0.2298756241798401, 0.08783590793609619, -0.7156722545623779,...
def test _ validate _ config ( self ) - > none : h = self. provider def force _ load _ metadata ( ) - > awaitable [ none ] : async def force _ load ( ) - > " openidprovidermetadata " : return await h. load _ metadata ( force = true ) return get _ awaitable _ result ( force _ load ( ) ) # default test config does not th...
[ -0.593468189239502, 0.7088147401809692, 0.5824209451675415, -0.3590255081653595, 0.35489773750305176, 0.19725559651851654, -0.15343010425567627, -0.5891871452331543, -0.07782942056655884, 0.2169780135154724, -0.49935317039489746, 0.5645620226860046, 0.0383487269282341, 0.2332826554775238, ...
def file _ download ( file _ url ) : local _ filename = file _ url. split ('/') [ - 1 ] r = requests. get ( file _ url, stream = true ) if r. status _ code = = 200 : with open ( local _ filename,'wb') as f : count = 0 for chunk in r. iter _ content ( chunk _ size = 1024 ) : count + = 1 if count < = 3000 : if chunk : f....
[ -0.11530807614326477, -0.3611088991165161, 0.8513429164886475, 0.2123783379793167, 0.4279800355434418, -0.18387353420257568, 0.2568332850933075, 0.8353933095932007, -0.7593600749969482, -0.05381669104099274, -0.11454713344573975, -0.5265369415283203, 0.05980829522013664, 0.0723800286650657...
def plot _ tweet _ sentiment _ over _ time ( self, avg = false ) : # this is depricated analyser = sentimentintensityanalyzer ( ) tweets = database _ helper. select _ geo _ tweets ( self. movieid ) tweet _ sentiment = [ ] for index, row in tweets. iterrows ( ) : sentiment = analyser. polarity _ scores ( row ['msg'] ) t...
[ 0.1846618354320526, 0.26180073618888855, 0.7579671144485474, -0.11119647324085236, -0.08631078898906708, 0.4448406398296356, 0.28889772295951843, -0.08488687127828598, -0.35558271408081055, 1.0877256393432617, 0.06914863735437393, 0.7225748896598816, 0.3603839874267578, 0.9550420641899109,...
def add _ person ( self, first _ name, last _ name, person _ type, wants _ accommodation ) : person _ type = person _ type. lower ( ) if person _ type not in ( " fellow ", " staff " ) : cprint ( " unknown person type : persons can be of either fellow or staff type " ) return false name = f " { first _ name } { last _ n...
[ -0.7235352993011475, -0.3544565737247467, 0.9205495715141296, -0.24887271225452423, -0.2666245102882385, 0.9059252142906189, -0.15862274169921875, -0.21885888278484344, 0.20001016557216644, 0.016764504835009575, 0.2772473692893982, -0.19380339980125427, -0.5730791687965393, 1.3684266805648...
def parse _ feed ( self ) : return feedparser. parse ( self. eztv _ rss _ link )
[ 0.07608354091644287, -0.7866969704627991, 0.17816464602947235, -0.3489541709423065, 0.5338678359985352, -0.5828118324279785, -0.6366551518440247, 0.04366085305809975, 0.5485003590583801, -1.2751215696334839, 0.17797626554965973, 0.4072154462337494, -0.4517335891723633, 0.06114177033305168,...
def make _ optimizer ( hyper, parameters ) : optimizer = hyper. optimizer _ cls ( parameters, * * hyper. optimizer _ params ) return optimizer
[ 0.9808756709098816, -0.10566055029630661, 0.24991793930530548, 0.5663323998451233, 0.8885868787765503, -0.4185612201690674, -0.527686595916748, 0.21266654133796692, -0.6242896318435669, -0.17230156064033508, -0.5477272868156433, 0.6314509510993958, -0.30759957432746887, -0.7108474969863892...
def onoff _ observations ( ant _ dict, obs _ set _ id, freq, fpga _ file, source, repetitions, ncaptures, az _ offset, el _ offset ) : logger = logger _ defaults. getmodulelogger ( _ _ name _ _ ) if az _ offset = = 0. 0 and el _ offset = = 0. 0 : logger. error ( " both azimuth and elevation offset are 0. it is not how ...
[ -0.6650640964508057, -0.3696926534175873, 0.7123739719390869, -1.0325690507888794, -0.4503457844257355, 0.8214828372001648, -0.08672299981117249, 0.6704325079917908, 0.041120901703834534, 0.8313895463943481, 0.17981839179992676, -0.1107354387640953, 0.7707306742668152, 0.6153959035873413, ...
def _ _ init _ _ ( self, corner, position, character ) : super ( ballsprite, self ). _ _ init _ _ ( corner, position, character, impassable ='' ) # choose one of the positions in the bottom row of the game board, and # compute the per - row x motion ( fractional ) we'd need to fall there. self. _ dx = random. uniform (...
[ 0.14723025262355804, 0.6066247224807739, 0.6874728798866272, -0.38262939453125, -0.028295140713453293, -0.30660751461982727, -0.051235806196928024, -0.4722350537776947, 0.46717187762260437, 0.25731971859931946, -0.7652649283409119, -0.3655764162540436, 0.1963539570569992, -0.69422203302383...
def send _ message ( self, context, message, is _ phrase = true ) : if is _ phrase : response = self. get _ answer ( message ) log _ response = message else : response = message log _ response = " other " data = { " chat _ id " : context [ " from " ] [ " id " ], " text " : response } requests. post ( url = self. get _ ...
[ -0.7352814078330994, 0.18394556641578674, 0.6439523696899414, 0.27035996317863464, 0.4555736184120178, 0.2456704080104828, -0.5716363191604614, -0.7300600409507751, 0.9216761589050293, 0.5309009552001953, 0.24451415240764618, 0.4118829667568207, -0.9885457158088684, 0.28576502203941345, ...
def update ( self, s, a, r, s _ prime ) : # update the internal logs based on the updated state # check if we reached a terminal state # update the steps counter print ('update. episode # { }, step : { }, state : { } '. format ( self. episode, self. episode _ steps _ counter, self. state ) ) if self. state = ='experime...
[ 0.017902953550219536, -0.5516379475593567, 0.4230482280254364, -0.05053166300058365, -0.2669210433959961, -0.05345327779650688, -0.45189169049263, 0.5390679836273193, 0.442247211933136, 0.5012492537498474, 0.2998116910457611, 0.6672208309173584, 0.3844550848007202, 0.07114194333553314, 0...
def guess _ realm ( host ) : if host. find ( " @ " )! = - 1 : return host. split ( " @ " ) [ - 1 ] # cannot be parsed by configparser due to realm syntax guessed _ realm = { " domain " : " ", " realm " : none } section = none with open ( " / etc / krb5. conf ", " r " ) as tmpfile : data = [ x. strip ( ) for x in tmpfil...
[ -0.33285412192344666, -1.0592142343521118, 0.6976071000099182, -0.14329810440540314, -1.1200487613677979, 0.10862923413515091, 0.5719685554504395, 0.1778867244720459, -0.5996387004852295, 0.22534865140914917, -0.25323164463043213, 0.23533491790294647, -0.21427567303180695, 1.07731187343597...
def _ compute _ dist ( p, x1, x2 ) : cross = np. dot ( x2 - x1, p - x1 ) ; if ( cross < = 0 ) : # p x1 x2 is obtuse angle return np. linalg. norm ( p - x1 ), 0. 0 d2 = np. dot ( x2 - x1, x2 - x1 ) if ( cross > = d2 ) : # p x2 x1 is obtuse angle return np. linalg. norm ( p - x2 ), 1. 0 alpha = cross / d2 q = x1 + alpha ...
[ 0.45648637413978577, -0.12358994781970978, 0.7245563864707947, -0.27367573976516724, -0.5357537865638733, 0.42032283544540405, -0.3077145218849182, 0.7005069255828857, 0.34176647663116455, 0.6597380638122559, 0.38927677273750305, -0.3374265432357788, -0.27920806407928467, -0.52605319023132...
def get _ used _ memory ( * * kwargs ) : mem = psutil. virtual _ memory ( ) return mem. used
[ -0.09317189455032349, -0.2145969271659851, 0.4530564546585083, 0.5623875856399536, 0.29166117310523987, -0.7555944323539734, 0.42080172896385193, -0.8140094876289368, -0.4518088698387146, -0.22303184866905212, -0.17773008346557617, 1.120625376701355, -1.1586382389068604, 0.7002102136611938...
def get _ user _ profile _ photos ( self, user _ id, * * options ) : return self. api _ call ( " getuserprofilephotos ", user _ id = str ( user _ id ), * * options )
[ -0.08282135426998138, 0.646704912185669, 0.35083165764808655, 1.927092432975769, 0.17477010190486908, -0.8499923944473267, 0.1713629961013794, -0.9086259007453918, 0.5786643624305725, 0.05159537121653557, -1.7103434801101685, 0.43200963735580444, -0.4386764168739319, 0.6421826481819153, ...
def search _ regex ( self, time _ string, regex _ exprs ) : ret _ str = none ts _ parts = time _ string. split ( " - " ) # look for the terra ref timestamp for one _ part in ts _ parts : for form in regex _ exprs : res = re. search ( form, one _ part ) if res : ret _ str = res. group ( 0 ) break if not ret _ str is non...
[ 0.08734016865491867, -0.16216351091861725, 0.7614285349845886, -0.08896753191947937, 0.4243834912776947, -0.48786795139312744, -0.299956351518631, 0.07259967923164368, -0.6216117143630981, 0.3237306773662567, 0.9213324189186096, -0.5089743137359619, -0.9270872473716736, -0.2896538078784942...
def containment ( lower _ forecast, upper _ forecast, actual ) : return ( np. count _ nonzero ( ( upper _ forecast > = actual ) & ( lower _ forecast < = actual ), axis = 0 ) / actual. shape [ 0 ] )
[ 0.11297587305307388, -0.8202670812606812, 0.46742692589759827, 0.013786002062261105, 0.41105130314826965, 0.4975602924823761, 0.6151455044746399, 0.068521648645401, -0.32443416118621826, 0.08807984739542007, 0.6836974620819092, 0.476028710603714, 0.018481720238924026, -0.46126505732536316,...