text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def detailed _ metrics _ enabled ( self ) - > optional [ bool ] : return pulumi. get ( self, " detailed _ metrics _ enabled " ) | [
1.1404595375061035,
1.4025092124938965,
0.5963634848594666,
0.636422872543335,
0.744475781917572,
1.3542437553405762,
0.007837925106287003,
0.507867693901062,
0.24036189913749695,
-0.31599369645118713,
-0.12432624399662018,
1.1327414512634277,
-0.08141788095235825,
-0.5106766819953918,
-... |
def execute ( self, query, attempts = 3 ) : self. cursor = none self. columns = none self. record = none data = {'query': query } url ='% s / query /'% self. server statuscodes, posted = [ ], false while not posted and attempts > 0 : request = self. connection. post ( url, data = data ) reason = self. _ check _ request... | [
-1.000925898551941,
0.2671678066253662,
0.8868215680122375,
0.27267223596572876,
-0.119241863489151,
0.10931797325611115,
-1.0349502563476562,
0.0886128842830658,
-0.18049538135528564,
0.29320865869522095,
-0.018254542723298073,
-0.18163760006427765,
-0.8750814199447632,
0.2997366487979889... |
def fix _ time _ np _ string ( df ) : @ jit def _ fix _ time ( mlist ) : out = np. empty ( mlist. shape, dtype = np. object ) for i in range ( len ( mlist ) ) : elem = str ( mlist [ i ] ) aux = " 0 " * ( 8 - len ( elem ) ) + elem out [ i ] = aux [ : 2 ] + " : " + aux [ 2 : 4 ] + " : " + aux [ 4 : 6 ] + ". " + aux [ 6 :... | [
0.09840591251850128,
-0.5759255290031433,
0.9072136282920837,
-0.03863179683685303,
0.17583081126213074,
-0.21255002915859222,
-0.9270015954971313,
-0.275637149810791,
0.14323917031288147,
1.3659294843673706,
0.12431201338768005,
0.8111809492111206,
0.5660958290100098,
0.47440752387046814,... |
def add _ results ( results1, results2, weight = none ) : if results1 = = none : from copy import deepcopy return deepcopy ( results2 ) else : if results1. store _ states : results1. states + = results2. states if results1. e _ ops! = none : results1. expect + = results2. expect if results1. map _ ops : results1. maps ... | [
-0.2500278055667877,
-0.021375006064772606,
0.7564570307731628,
0.813343346118927,
-0.2091732621192932,
-0.32523033022880554,
0.3131040930747986,
-0.9720214009284973,
0.4574202299118042,
-0.20059970021247864,
0.29872795939445496,
-0.05409657582640648,
-0.3834756016731262,
0.302939265966415... |
def test _ update _ check _ ignores _ downgrades ( fake _ post _ request ) : app = create _ ctfd ( ) with app. app _ context ( ) : app. config [ " update _ check " ] = true fake _ response = mock ( ) fake _ post _ request. return _ value = fake _ response fake _ response. json = lambda : { " resource " : { " html _ url... | [
0.1341972053050995,
-0.40390264987945557,
0.6817282438278198,
0.03989513963460922,
0.6320993304252625,
0.591052234172821,
-0.2952120304107666,
0.6224876046180725,
-0.8414717316627502,
-0.16977067291736603,
-0.9930383563041687,
-0.32603204250335693,
-0.5492613911628723,
0.0400158166885376,
... |
def clustering _ process ( self, records, zoom, pix _ x, pix _ y ) : cluster _ points = [ ] for record in records : # get x, y of site record = record. object x = record. site. geometry _ point. x y = record. site. geometry _ point. y # check every point in cluster _ points for pt in cluster _ points : if'minbbox'not i... | [
-0.1837921440601349,
-0.4359252452850342,
0.6482205390930176,
-0.20835451781749725,
0.10724010318517685,
-0.1408625990152359,
0.7732506394386292,
-0.31464067101478577,
0.5194241404533386,
0.7118993997573853,
0.24983426928520203,
0.7686043381690979,
0.043233226984739304,
-0.2614226937294006... |
def fit ( self, y : np. ndarray, sample _ weight : optional [ np. ndarray ] = none ) - > none : if sample _ weight is not none : self. samples = sample _ weight. sum ( ) else : self. samples = y. shape [ 0 ] self. _ n _ dimensions = np. unique ( y ). shape [ 0 ] self. _ n _ parameters = self. _ n _ dimensions - 1 self.... | [
0.5860991477966309,
-0.08293409645557404,
0.5288824439048767,
0.7330358624458313,
0.6570658087730408,
-0.5577203035354614,
0.4263474941253662,
-0.07638227194547653,
-0.1926768720149994,
0.22784928977489471,
0.019720427691936493,
0.9617411494255066,
-0.13432615995407104,
1.004754900932312,
... |
def cmd ( self ) : self. _ raise ( ) | [
0.5864545106887817,
0.22018156945705414,
0.3439047932624817,
0.46502435207366943,
0.7271000742912292,
0.16436849534511566,
1.1328272819519043,
-0.5001662373542786,
0.029486272484064102,
-0.9556580781936646,
1.1776142120361328,
0.4002130627632141,
0.03632286936044693,
0.47817885875701904,
... |
def linleastsquares ( x, y ) : beta = np. dot ( ( np. dot ( np. linalg. inv ( np. dot ( x. t, x ) ), x. t ) ), y ) return beta | [
0.7042309641838074,
-1.6640081405639648,
0.6252074837684631,
-1.3556015491485596,
0.2615390419960022,
0.21168825030326843,
-1.0847798585891724,
-1.6716248989105225,
-0.014533386565744877,
1.050477147102356,
0.03960312902927399,
0.6919414401054382,
0.13082939386367798,
-0.28736793994903564,... |
def compute _ equality _ for _ cluster ( cluster _ a, cluster _ b, similarity _ dic ) : # if has record in dictory, then use dictory if similarity _ dic. get ( ( cluster _ a. id, cluster _ b. id ) ) is not none : return similarity _ dic. get ( ( cluster _ a. id, cluster _ b. id ) ) # compare cdg _ list of entity if clu... | [
0.22632482647895813,
-0.19426502287387848,
0.7458885312080383,
0.0030299124773591757,
0.6912529468536377,
-0.22949902713298798,
0.6149414777755737,
0.7365954518318176,
0.052567798644304276,
0.7124176621437073,
-0.4366145133972168,
0.5293006896972656,
-0.16796399652957916,
0.509734928607940... |
def update _ spatial _ relationship ( self, rc _ name, rel _ type ='intersect ', search _ radius = none ) : # todo : move this method to a separate class dedicated to dealing # with spatial relationships. rc _ info = self. get _ relationship _ info ( rc _ name ) dest _ path = os. path. join ( self. path, rc _ info. des... | [
-0.27209270000457764,
-0.8118193745613098,
0.9229683876037598,
0.05203244090080261,
-0.05950738117098808,
-0.1702134907245636,
0.32245251536369324,
0.3715074956417084,
-0.47611984610557556,
0.6544494032859802,
0.5414033532142639,
0.050675421953201294,
-0.09037646651268005,
-0.6808883547782... |
def _ load _ json _ tests ( self ) : for tf in glob. glob ( os. path. join ( self. project. tests _ dir, " test _ *. json " ) ) : id _ key = os. path. basename ( tf ) with open ( tf ) as test _ file : try : entries = json. load ( test _ file ) self. log [ id _ key ]. id = id _ key for entry _ key, entry in entries. ite... | [
-0.4802349805831909,
-0.6753393411636353,
0.7420216798782349,
-0.39370569586753845,
0.2180740237236023,
0.321191668510437,
0.5903725624084473,
-0.24960564076900482,
-0.9655246138572693,
0.08419129252433777,
-0.5663459897041321,
-0.30558934807777405,
0.06543456017971039,
0.23824556171894073... |
def rm _ all _ recursively ( self, path ) : self. rm _ allfiles _ recursively ( path ) self. rm _ dir ( path ) | [
-0.1602734923362732,
0.24450156092643738,
0.44155824184417725,
0.5733452439308167,
-0.5121337175369263,
0.06451600044965744,
0.562907338142395,
-0.44744259119033813,
0.4342946708202362,
-0.47787654399871826,
-0.36604270339012146,
-0.5673067569732666,
-0.19682782888412476,
0.992022812366485... |
def add _ button ( self, callback = none, text = none, icon = none, checkable = false, checked = false, event = none, name = none ) : if callback is none : return partial ( self. add _ button, text = text, icon = icon, name = name, checkable = checkable, checked = checked, event = event ) name = name or getattr ( callb... | [
-0.017051583155989647,
0.41706910729408264,
0.7128320932388306,
0.05067751556634903,
-0.4856608510017395,
-0.009769062511622906,
0.09465954452753067,
0.008966373279690742,
0.749496579170227,
-0.4276772737503052,
-0.3948517441749573,
-0.6302180886268616,
-0.12218277901411057,
0.130978688597... |
def ecdf _ windowed ( times, window _ sizes, window _ sf = none, times _ allowed = none, auto _ pad _ left = none, pad _ left _ at _ x = 0, normalize = true, skip _ times _ allowed _ check = false ) : times = np. array ( times ) window _ sizes = np. array ( window _ sizes ) if times _ allowed is not none and not skip _... | [
0.2865426540374756,
1.0915753841400146,
0.8159440755844116,
0.24625860154628754,
-0.8363054990768433,
0.2594919204711914,
0.9100858569145203,
-0.062090203166007996,
0.01902374066412449,
0.45316532254219055,
0.5704447627067566,
0.6018552184104919,
-0.28606653213500977,
1.6274559497833252,
... |
def sort ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.3762694001197815,
-0.449886679649353,
0.34222331643104553,
0.8467761278152466,
0.1900520771741867,
0.4335845708847046,
0.5132628083229065,
-0.9066031575202942,
-0.6482802033424377,
-0.5615040063858032,
-0.6467821002006531,
0.5605714917182922,
-0.6170766949653625,
0.5467553734779358,
-... |
def delete _ directory _ recurrent ( directory : directory ) : for lower _ directory in directory. directory _ set. all ( ) : delete _ directory _ recurrent ( lower _ directory ) for lower _ file in directory. file _ set. all ( ) : lower _ file. delete _ by _ user ( ) directory. delete _ by _ user ( ) | [
-0.2857632339000702,
0.1340843290090561,
0.47985419631004333,
0.6942830681800842,
0.26515474915504456,
-0.009274790994822979,
1.7505043745040894,
-0.5538304448127747,
0.510480523109436,
-0.6412115097045898,
0.21968384087085724,
0.6259828805923462,
-0.13383276760578156,
1.1085045337677002,
... |
def add _ static _ group ( self, name, type, members = none ) : if members is none : members = [ ] dto = {'displayname': name,'isstatic': true,'grouptype': type,'memberuuidlist': members } return self. add _ group ( json. dumps ( dto ) ) | [
-1.176389217376709,
0.7955297231674194,
0.33311325311660767,
0.4302946627140045,
-0.3877512216567993,
-0.1796526163816452,
-1.2008514404296875,
-0.38941535353660583,
-0.41145622730255127,
0.6948267221450806,
-0.843813955783844,
0.6911671161651611,
-0.9639655947685242,
0.6258937120437622,
... |
def _ _ init _ _ ( self, debug = false, verbose = - 1 ) : self. verbose = verbose self. debug = debug self. mydir = dirnm ( abspath ( _ _ file _ _ ) ) | [
0.31758007407188416,
-0.046778976917266846,
0.47773477435112,
0.6953295469284058,
0.09835288673639297,
-0.2151530385017395,
-0.025869833305478096,
0.08776932954788208,
-0.4998997747898102,
-0.7547877430915833,
0.2670202851295471,
0.2383834421634674,
0.1366627961397171,
1.7929718494415283,
... |
def contains _ punctuation ( string : str ) - > bool : for punctuation in [ '. ', ', ', '? ', '!'] : if punctuation in string : return true return false | [
0.15930835902690887,
-0.4705328941345215,
0.31062445044517517,
0.5067152380943298,
-0.5594757199287415,
-0.22695264220237732,
-0.03428248316049576,
0.7052030563354492,
0.4059830605983734,
-0.08595866709947586,
-0.13145077228546143,
-0.4001205265522003,
-0.2740943133831024,
-0.2587640881538... |
def is _ prime _ v1 ( num ) : if num = = 1 : return false # 1 is not a prime for n in range ( 2, num ) : if num % n = = 0 : return false # number is divisible and hence not a prime else : return true | [
-0.9750398397445679,
0.6441836357116699,
0.3775758743286133,
1.3340036869049072,
0.2509995102882385,
0.10042630136013031,
-0.455145001411438,
0.08713535219430923,
1.2627311944961548,
0.4044588804244995,
0.14794008433818817,
0.04562045633792877,
-1.1381765604019165,
0.332248330116272,
-1.... |
def _ read _ data _ format ( file : binaryio ) - > generator : success = false for _ in range ( _ max _ format _ string _ length ) : try : char = file. read ( 1 ). decode ( ) except unicodedecodeerror : # we aren't reading a unicode string raise deserializationexception ('non unicode string encountered') if char = = _ ... | [
-0.4270124137401581,
0.2642847001552582,
0.44834694266319275,
-0.49246954917907715,
-0.8876939415931702,
-0.1055724248290062,
-0.5777889490127563,
-0.16175411641597748,
-0.9910988211631775,
-0.9016492366790771,
0.6056789755821228,
-0.1742040514945984,
0.3425730764865875,
-0.277719140052795... |
def get _ unique _ entries ( ) : all _ entries = get _ entries ( ) distinct _ entries = all _ entries. distinct ( ) return distinct _ entries | [
0.31175175309181213,
-0.03313424438238144,
0.37061020731925964,
0.49059128761291504,
1.1889317035675049,
0.2599770128726959,
-0.09931319952011108,
0.7091972827911377,
0.0053918506018817425,
-0.4785107970237732,
-1.0220656394958496,
0.6076003313064575,
0.2001599371433258,
0.6346864104270935... |
def unregister ( self, var _ name ) : if self. _ lock. acquire ( true, 1 ) : try : if var _ name in self. _ variables : del self. _ variables [ var _ name ] return true else : self. _ logger. debug ( f " variable { var _ name } not found in globals " ) return false except exception as e : self. _ logger. exception ( st... | [
-0.6123499870300293,
0.8376856446266174,
0.7872293591499329,
-1.1730616092681885,
-0.23713374137878418,
-0.27988260984420776,
0.4179880917072296,
0.23819881677627563,
-0.49038413166999817,
0.6035879850387573,
-0.733224093914032,
-0.0785454586148262,
-1.6756789684295654,
0.36995673179626465... |
def smash ( ball _ 1, ball _ 2 ) : if cross _ check ( ( ball _ 1. x + ball _ 1. speed * math. cos ( ball _ 1. angle ), ball _ 1. y + ball _ 1. speed * math. sin ( ball _ 1. angle ) ), ( ball _ 2. x + ball _ 2. speed * math. cos ( ball _ 2. angle ), ball _ 2. y + ball _ 2. speed * math. sin ( ball _ 2. angle ) ), ball _... | [
0.6793875098228455,
-0.46257808804512024,
0.884989857673645,
-0.34607183933258057,
1.0509995222091675,
0.3964592218399048,
0.10121165961027145,
0.09908653050661087,
-0.631172239780426,
0.2683110535144806,
-1.1307313442230225,
0.2647189199924469,
-0.40485793352127075,
-0.9949743151664734,
... |
def is _ contains _ word ( text, word ) : words = none if isinstance ( word, ( tuple, list ) ) : words = list ( word ) else : words = [ word ] result = false if words is not none : for wrd in words : regexp = re. compile ( " ^ (. * _ )? " + wrd + " ( _. * )? $ " ) result = regexp. match ( text ) is not none if result :... | [
-0.26337990164756775,
0.1151038184762001,
0.795691967010498,
0.2932933568954468,
-0.748650074005127,
-0.2820556163787842,
-0.7235349416732788,
0.3346561789512634,
-0.31702563166618347,
0.394806832075119,
-0.1969447135925293,
0.10400401055812836,
-0.8972405791282654,
0.6899271011352539,
-... |
def utc2local ( utc _ time ) : if isinstance ( utc _ time, str ) : utc _ time = datetime. datetime. strptime ( utc _ time,'% y - % m - % d % h : % m : % s') timestamp = calendar. timegm ( utc _ time. timetuple ( ) ) return datetime. datetime. fromtimestamp ( timestamp ) | [
0.600592851638794,
-0.9044273495674133,
0.5165783166885376,
-0.3586125373840332,
-0.5250884890556335,
-0.0009998604655265808,
-0.1886293888092041,
0.7330151200294495,
1.17029869556427,
0.7379692196846008,
-0.36220383644104004,
0.28788188099861145,
0.05103972554206848,
-0.6871914267539978,
... |
def to _ color ( indx, base ) : base2 = base * base b = 2 - indx / base2 r = 2 - ( indx % base2 ) / base g = 2 - ( indx % base2 ) % base return b * 127, r * 127, g * 127 | [
-0.5255873203277588,
-0.5213044881820679,
0.5011237263679504,
-0.48438239097595215,
0.19007962942123413,
-0.9066158533096313,
-0.659487247467041,
-0.650359034538269,
0.18187569081783295,
0.252427875995636,
-0.6421365737915039,
-0.1548967957496643,
-0.3593040406703949,
-1.1507744789123535,
... |
def properties ( self ) - > optional [ any ] : return pulumi. get ( self, " properties " ) | [
0.6654377579689026,
-0.029523255303502083,
0.3822445571422577,
0.651784360408783,
1.8215259313583374,
0.562938392162323,
-0.3169820308685303,
0.1000014990568161,
0.9196473956108093,
-0.7942764163017273,
0.4975144863128662,
0.5366553664207458,
-0.16163283586502075,
-1.200721025466919,
-1.... |
def _ _ init _ _ ( self, character ) : self. name ='character place event'self. character = character | [
1.1217470169067383,
-1.1902978420257568,
0.42928364872932434,
-0.9802824854850769,
-0.1957026869058609,
0.1283915638923645,
0.44415271282196045,
0.9438807964324951,
0.552004873752594,
-0.0266479030251503,
-1.267682433128357,
0.02560419589281082,
0.07653173059225082,
0.3775113821029663,
1... |
def empirical _ kernel _ fn ( f : applyfn, trace _ axes : axes = ( - 1, ), diagonal _ axes : axes = ( ), vmap _ axes : vmapaxes = none, implementation : union [ ntkimplementation, int ] = default _ ntk _ implementation, _ j _ rules : bool = _ default _ ntk _ j _ rules, _ s _ rules : bool = _ default _ ntk _ s _ rules, ... | [
0.3801605701446533,
0.3078570067882538,
0.649270236492157,
-0.2205738127231598,
-0.30552273988723755,
-0.7986598014831543,
0.2769627869129181,
-0.3506121337413788,
-0.4884576201438904,
0.4849735200405121,
-0.18299882113933563,
0.9172346591949463,
0.9808815121650696,
-0.5037157535552979,
... |
def test _ write _ wavecar ( vasp _ calc, vasp _ inputs, vasp _ wavecar, sandbox _ folder ) : wavecar, _ = vasp _ wavecar inputs = vasp _ inputs ( parameters = {'gga':'pe ','gga _ compat': false,'lorbit': 11,'sigma': 0. 5,'magmom':'30 * 2 * 0. ','istart': 1 } ) inputs. wavefunctions = wavecar calc = vasp _ calc ( input... | [
0.0028324113227427006,
-0.28193262219429016,
0.3964792788028717,
0.05230090767145157,
0.2600712776184082,
0.1653863936662674,
0.6470459699630737,
-0.10331588238477707,
0.22095787525177002,
-0.5501872301101685,
-0.40326744318008423,
-0.1540866494178772,
-0.4540010094642639,
0.48162564635276... |
def message ( self ) : message = self. trap. afterturn ( self. pkmn ) assert message = = [ self. pkmn. getheader ( ) + self. message ], " message should be the pokemon's name and the message given to the trap. " | [
-0.14112316071987152,
0.14187152683734894,
0.2813481092453003,
-0.6042954325675964,
0.8552302122116089,
0.24682952463626862,
-0.7768220901489258,
-0.7435355186462402,
-0.4121800363063812,
-0.10568966716527939,
0.09342421591281891,
0.16165052354335785,
-0.16067710518836975,
-0.5299441218376... |
def _ find _ pop ( pops, popid ) : for pop in pops : # hack to cover both cases for the dictionary key due to inconsistency in the api if " nfvipopid " in pop : if pop [ " nfvipopid " ] = = popid : return pop if " nfvipop " in pop : if pop [ " nfvipop " ] = = popid : return pop return none | [
0.15517888963222504,
-0.8184078931808472,
0.4141782522201538,
0.03435228019952774,
-0.16066814959049225,
-0.8438234329223633,
-0.2591633200645447,
-1.111825704574585,
-0.047040797770023346,
1.8229941129684448,
0.9125760793685913,
-0.8734781742095947,
-0.400973379611969,
0.13926689326763153... |
def forward ( self, input ) : return input * self. alpha + self. delta * torch. abs ( input ) | [
-0.23422710597515106,
-0.14771787822246552,
0.5730394124984741,
-0.1480901837348938,
-0.4880038797855377,
1.8808550834655762,
0.5035306811332703,
-0.2657455801963806,
-0.3170419931411743,
-1.0034619569778442,
0.06843921542167664,
-0.32031989097595215,
0.2771158218383789,
-0.098488807678222... |
def range1000 ( ) : global secret _ number, num _ range, num _ guesses secret _ number = random. randrange ( 0, 1000 ) num _ range = 1000 num _ guesses = 10 init ( ) | [
-0.2442512810230255,
-0.2412954717874527,
0.26449546217918396,
0.6058251857757568,
1.241370439529419,
-0.02712261490523815,
0.05611032992601395,
1.276416301727295,
0.093787282705307,
0.1591300368309021,
-1.4582462310791016,
0.8366098999977112,
-0.08797256648540497,
0.639048159122467,
0.7... |
def set _ rng _ state ( new _ state : tensor ) - > none : new _ state _ copy = new _ state. clone ( memory _ format = torch. contiguous _ format ) _ get _ default _ mps _ generator ( ). set _ state ( new _ state _ copy ) | [
-0.38954398036003113,
0.04948737099766731,
0.43756479024887085,
-0.3491842746734619,
0.053653474897146225,
0.5539805889129639,
0.1595422327518463,
0.14849355816841125,
-0.05258754640817642,
0.06679154932498932,
-0.6669207215309143,
0.6137288808822632,
0.014456217177212238,
-0.0791627690196... |
def requestavatar ( _ avatarid, _ mind, * interfaces ) : # pylint : disable = invalid - name if iresource in interfaces : return iresource, restapi ( ), lambda : none raise keyerror ( " none of the requested interfaces are supported " ) | [
-1.5322965383529663,
0.6894927024841309,
0.24940651655197144,
0.6555876731872559,
-0.4555020332336426,
-0.5388894081115723,
-0.33897534012794495,
-0.6335641145706177,
0.5065996050834656,
-0.33609631657600403,
-0.0465855747461319,
0.05509678274393082,
-0.964526355266571,
0.5284863114356995,... |
def at _ index ( self, i ) : self. _ _ getitem _ _ ( i ) | [
-1.0057278871536255,
-0.46901294589042664,
0.12236692756414413,
-1.0865551233291626,
0.2917650043964386,
0.18282289803028107,
0.6568572521209717,
-0.9619913101196289,
-0.645602822303772,
-0.004092587623745203,
-0.9333574175834656,
0.33129388093948364,
0.6337661147117615,
-1.516940712928772... |
def closest _ xy _ pair ( a ) : nrow, ncol = len ( a ), len ( a [ 0 ] ) queue = collections. deque ( [ coordinate ( i, j ) for i in range ( nrow ) for j in range ( ncol ) if a [ i ] [ j ] = ='x'] ) dists = { x : 0 for x in queue } while queue : start = queue. popleft ( ) dist = dists [ start ] for pos in [ coordinate (... | [
0.08607066422700882,
-0.6581736207008362,
0.8670234680175781,
-0.9939532279968262,
-1.5437040328979492,
-0.671420156955719,
0.6799100637435913,
-0.7986198663711548,
0.2872682511806488,
0.3674904704093933,
0.42129820585250854,
-0.467984676361084,
-0.17947746813297272,
0.6388190388679504,
... |
def test _ read _ valid ( self ) : valid = _ proto _ version self. assertequal ( read _ version _ message ( valid ), valid ) | [
0.4783168435096741,
-0.336518794298172,
0.3601195216178894,
0.8530924320220947,
0.03997212275862694,
1.4148359298706055,
-0.35438355803489685,
0.3434945344924927,
-0.36473897099494934,
-0.4512321650981903,
0.08045853674411774,
-0.07843901962041855,
-0.8716866970062256,
-1.29347562789917,
... |
def test _ write ( self ) : message = errorresultmessage ( request _ id = " 0001 ", payload = " hello world " ) m _ bytes = write _ message ( message ) self. assertequal ( m _ bytes,'e00010000000bhello world') | [
-0.6949784755706787,
0.3243737518787384,
0.314918577671051,
0.23276707530021667,
1.5631184577941895,
0.28427210450172424,
-0.10360920429229736,
-0.4412013590335846,
-0.04187777265906334,
-0.8757025003433228,
-0.0057228803634643555,
-0.21860799193382263,
-1.1797574758529663,
0.2607274353504... |
def as _ dict ( config ) : the _ dict = ordereddict ( { } ) for section in config. sections ( ) : the _ dict [ section ] = { } for key, val in config. items ( section ) : the _ dict [ section ] [ key ] = val return the _ dict | [
-0.23157653212547302,
-1.1039798259735107,
0.5080016255378723,
-1.226226568222046,
-1.2167052030563354,
-0.04008247330784798,
-0.09880048781633377,
-0.12296436727046967,
-0.18960990011692047,
0.007449509110301733,
-0.7649174332618713,
-0.6716306805610657,
0.8455131649971008,
1.146729350090... |
async def get _ current _ operation _ info ( self ) - > mythicresponse : if self. operator is none : await self. get _ self ( ) url = " { } { } : { } / api / v { } / operations / { } ". format ( self. _ http, self. server _ ip, self. _ server _ port, self. _ server _ api _ version, self. operator. current _ operation. ... | [
-0.8591443300247192,
-0.16494105756282806,
0.8760032653808594,
0.06551273912191391,
0.15563854575157166,
-0.9111301898956299,
0.5735399127006531,
-0.18775790929794312,
-0.19415947794914246,
0.3652103841304779,
-0.2775316536426544,
-0.35389161109924316,
-0.27438482642173767,
-0.564987242221... |
def decode _ auth _ token ( auth _ token ) : try : payload = jwt. decode ( auth _ token, secret _ key ) return { " username " : payload [ " username " ], " isadmin " : payload [ " isadmin " ] } except jwt. expiredsignatureerror : return'signature expired. please log in again.'except jwt. invalidtokenerror : return'inva... | [
-0.29730677604675293,
-0.5134210586547852,
0.27729108929634094,
-0.1787763386964798,
-0.8440127372741699,
-0.05892157182097435,
-0.9468455910682678,
-0.2386062890291214,
0.3060910701751709,
0.3919256031513214,
-1.447259545326233,
0.10428394377231598,
0.2103492021560669,
-0.2928024232387543... |
def test _ stopservicenotrunning ( self ) : self. component. startservice ( ) self. component. stopservice ( ) self. assertfalse ( self. component. running ) | [
-1.0295404195785522,
-0.8639388680458069,
-0.01707325503230095,
-0.3618435263633728,
0.9869118332862854,
0.8232390880584717,
-0.02575172856450081,
0.22930733859539032,
-0.6186732649803162,
-1.049788236618042,
-0.2504771947860718,
-0.8805184960365295,
-0.9665160775184631,
0.1218661367893219... |
def get _ current _ trading _ info ( fsym, tsym, markets ='all ', try _ conversion = true, format ='raw') : # load data url = build _ url ('generateavg ', fsym = fsym, tsym = tsym, markets = markets, try _ conversion = try _ conversion ) data = load _ data ( url ) # select format to return if format = ='raw': data = da... | [
-1.0510119199752808,
0.2185239940881729,
0.5079767107963562,
-1.0711265802383423,
-0.6259844899177551,
-0.32627177238464355,
-0.7059870958328247,
0.01404095720499754,
-1.07783842086792,
0.5841242671012878,
0.18776658177375793,
0.5331305265426636,
0.3299013078212738,
0.4658335745334625,
0... |
def deeplabv3 _ resnetd152b _ coco ( pretrained _ backbone = false, classes = 21, aux = true, * * kwargs ) : backbone = resnetd152b ( pretrained = pretrained _ backbone, ordinary _ init = false, bends = ( 3, ) ). features del backbone. final _ pool return get _ deeplabv3 ( backbone = backbone, classes = classes, aux = ... | [
-0.6386733651161194,
1.1097193956375122,
0.5249882936477661,
0.3357302248477936,
-0.4176201820373535,
0.40083417296409607,
0.26317036151885986,
-0.08545967191457748,
-0.16059359908103943,
-0.5271275639533997,
-0.06085388362407684,
0.6817627549171448,
0.056386593729257584,
-0.60433250665664... |
def _ _ repr _ _ ( self ) : formatstr = ( " uribuilder ( scheme = { b. scheme }, userinfo = { b. userinfo }, " " host = { b. host }, port = { b. port }, path = { b. path }, " " query = { b. query }, fragment = { b. fragment } ) " ) return formatstr. format ( b = self ) | [
-0.49477237462997437,
-1.0275031328201294,
0.6945921182632446,
0.04047469422221184,
-0.4468191862106323,
0.9942450523376465,
0.16116328537464142,
0.7163263559341431,
0.6261924505233765,
-0.6386209726333618,
0.08758102357387543,
0.026818983256816864,
-0.6770663857460022,
-0.7065652012825012... |
def get _ user ( self, user _ id ) : return self. client. get ( self. client. users +'/ { } '. format ( user _ id ), bucket = _ func _ ( ) ) | [
0.030495677143335342,
0.2596915662288666,
0.1605929285287857,
0.42803627252578735,
0.344845712184906,
-0.3630255162715912,
-0.447142094373703,
-1.1569254398345947,
0.02322438918054104,
-0.9272791147232056,
-0.40728726983070374,
1.058717966079712,
0.05051193758845329,
0.1214820072054863,
... |
def quicksort ( _ list ) : if len ( _ list ) < = 1 : return _ list pivot = _ list [ random. randint ( 0, len ( _ list ) - 1 ) ] a = [ x for x in _ list if x < pivot ] b = [ x for x in _ list if x > pivot ] mid = [ x for x in _ list if x = = pivot ] return quicksort ( a ) + mid + quicksort ( b ) | [
-0.3828594386577606,
0.45475614070892334,
0.5555070638656616,
-0.09375426173210144,
0.29903051257133484,
0.1136455088853836,
-0.8600732088088989,
0.19982613623142242,
1.5165116786956787,
-0.18475602567195892,
-1.2889604568481445,
-0.8706910014152527,
-1.0674556493759155,
0.6830027103424072... |
def make _ query ( cls, * * kwargs ) - > query : return super ( ). make _ query ( asset _ class = weathersensor, * * kwargs ) | [
-0.23855018615722656,
0.21046429872512817,
0.2560061514377594,
-0.1695178747177124,
-0.1576109528541565,
0.3144253194332123,
-0.22404298186302185,
-0.4022972285747528,
-0.1860446035861969,
-0.25976869463920593,
0.48585575819015503,
-0.0470828153192997,
0.1787692904472351,
0.466598242521286... |
def sort _ entities ( t, sxp = none ) : def get _ key ( e ) : eid = e. attrib. get ('entityid') sv = none try : sxp _ values = e. xpath ( sxp, namespaces = ns, smart _ strings = false ) try : sv = sxp _ values [ 0 ] try : sv = sv. text except attributeerror : pass except indexerror : log. warning ( " sort pipe : unable... | [
-0.45009464025497437,
0.005733947269618511,
0.5444403290748596,
-0.6499839425086975,
-0.4893316924571991,
-0.19352708756923676,
0.2319267988204956,
-0.06134499981999397,
-0.20451560616493225,
0.5816850662231445,
0.47742098569869995,
-0.1847950518131256,
0.5051068067550659,
0.93231022357940... |
def validate _ mechanism ( self, mech ) : # a mechanism m, arg, cidrlength, cidr6length = parse _ mechanism ( mech, self. d ) # map '?'' +'or'-'to'neutral'' pass'or'fail'if m : result = results. get ( m [ 0 ] ) if result : # eat '?'' +'or'-'m = m [ 1 : ] else : # default pass result ='pass'if m in common _ mistakes : s... | [
-0.40024682879447937,
0.16995061933994293,
0.7268237471580505,
-0.25871628522872925,
-0.6180706024169922,
0.3390170931816101,
0.46104028820991516,
-0.1413007229566574,
-0.06511469930410385,
-0.3791576325893402,
0.5135299563407898,
-0.21297404170036316,
-0.37711140513420105,
0.1795820891857... |
def _ _ init _ _ ( self, drop _ out _ rate ) : self. drop _ out _ rate = drop _ out _ rate self. model = models. sequential ( ) self. model. add ( rescaling ( scale = 1. / 255 ) ) # three conv2d layers with 5 x 5 kernels, and 2 x 2 strides self. model. add ( conv2d ( filters = 24, kernel _ size = ( 5, 5 ), strides = ( ... | [
0.2215418517589569,
0.07415695488452911,
0.9920122623443604,
-0.08974696695804596,
-0.046407364308834076,
0.3240262567996979,
-0.6717525720596313,
-0.5561000108718872,
0.21873104572296143,
-0.265944242477417,
-0.4929691255092621,
-0.5609285235404968,
0.14126946032047272,
0.2165229916572570... |
def _ _ init _ _ ( self ) : entries = [ textmenuentry ( " start ", self. startgame ), textmenuentry ( " options ", self. runoptions ), textmenuentry ( " exit ", self. stoprunning ) ] self. menu = menu ( entries ) screen = mainmenuscreen ( self. menu ) cmds = { kao _ up : self. menu. up, kao _ down : self. menu. down, e... | [
-0.40656596422195435,
-0.4832322597503662,
0.6862760186195374,
0.38494956493377686,
0.18489933013916016,
0.07855269312858582,
0.1216035708785057,
0.08164823800325394,
-0.27006128430366516,
-0.09424620866775513,
-0.18127164244651794,
-0.6371836066246033,
0.2033393532037735,
0.73016309738159... |
def test _ color _ brightness ( color ) : if color. lightness ( ) > 255. 0 / 2 : return " light " else : return " dark " | [
0.190593421459198,
-0.5647364258766174,
0.47868138551712036,
-0.15192711353302002,
0.5992395877838135,
0.26079627871513367,
-0.4163784384727478,
-0.7817452549934387,
0.37650325894355774,
-0.7537312507629395,
0.2050190269947052,
-0.10790378600358963,
0.6549870371818542,
1.0334054231643677,
... |
def readconfig ( output _ dir, input _ file ) : variables = { } variables ['chromedir'] = chrome _ dir # use a bogus version number, we don't really care what it is, we just # want to find the files that would get picked up from chrome. release, # and don't care where the installer archive task ends up putting them. va... | [
-0.33026206493377686,
-0.7924506068229675,
0.3518535792827606,
0.6048398017883301,
-0.4519408941268921,
0.10178106278181076,
0.10994572937488556,
0.6978424787521362,
-1.4010884761810303,
0.7425511479377747,
0.06789416074752808,
0.1853647232055664,
-0.43377965688705444,
0.03878726065158844,... |
def interpolate _ orbit _ points ( orbit _ points, name ) : if len ( orbit _ points ) = = 0 : return [ ] ok = orbit _ points [ " name " ] = = name ops = orbit _ points [ ok ] # get the indexes of missing orbits idxs = np. flatnonzero ( np. diff ( ops [ " orbit _ num " ] ) > 1 ) new _ orbit _ points = [ ] for idx in idx... | [
-0.5931361317634583,
0.12555253505706787,
0.7942813038825989,
-0.19768892228603363,
0.021004460752010345,
0.5459890961647034,
-0.7852930426597595,
0.04767816141247749,
0.6403019428253174,
1.5413883924484253,
-0.14895786345005035,
-0.12294414639472961,
-0.06476399302482605,
0.09623809903860... |
def _ remove _ allowed ( self, metadata : dict ) - > bool : allowed _ resource = os. path. join ( self. preferred _ metadata _ dir, metadata. get ( " name " ) ) current _ resource = os. path. splitext ( metadata. get ( " resource " ) ) [ 0 ] return allowed _ resource = = current _ resource | [
-0.3254791796207428,
0.393841952085495,
0.5387353897094727,
0.037604667246341705,
-1.187959909439087,
0.618168294429779,
-0.05988672375679016,
0.054317351430654526,
-0.5540652871131897,
0.84231036901474,
1.1985321044921875,
0.7248720526695251,
-0.7584201097488403,
-0.3340742588043213,
0.... |
def test _ destroy _ alumno _ curso _ docente ( self ) : self. client. force _ authenticate ( user = self. user _ docente ) response = self. client. delete ( " / api / alumnos / curso / 1 / " ) self. assertequal ( response. status _ code, status. http _ 403 _ forbidden ) response = self. client. get ( " / api / alumnos... | [
0.22901710867881775,
0.5071752667427063,
0.5355632901191711,
0.2418319135904312,
0.22952206432819366,
0.7748361229896545,
0.20795606076717377,
0.7389827966690063,
0.45574814081192017,
0.12233781814575195,
-0.2276640087366104,
0.6128087639808655,
0.679019570350647,
-0.34501248598098755,
1... |
def balance ( self ) : return self. left _ level - self. right _ level | [
-0.24857324361801147,
-0.886124312877655,
0.6365545392036438,
-0.13702064752578735,
0.564422607421875,
1.0797419548034668,
-0.2959062159061432,
-1.0563340187072754,
-0.5583137273788452,
-0.014145231805741787,
-0.18810468912124634,
-0.4843224287033081,
-1.0581040382385254,
0.901367843151092... |
def disarm ( self ) : self. is _ mine = false self. clicked = false self. mines _ nearby = 0 self. mark = 0 self. config ( image = gif [ 0 ], relief ='raised ', bg ='white') | [
-0.19488660991191864,
-0.22242587804794312,
0.14466902613639832,
-0.1739249974489212,
0.7489941120147705,
0.19748342037200928,
0.9806966781616211,
0.6000392436981201,
0.11479556560516357,
0.09107092767953873,
-0.5678833723068237,
0.05921309441328049,
-0.09366254508495331,
0.476191431283950... |
def get _ validated _ context ( self, predictor, kwargs ) : context _ lower _ mappings = dict ( ) for ctx _ key in predictor. context _ feature _ names : context _ lower _ mappings [ ctx _ key. lower ( ) ] = ctx _ key if key _ context not in kwargs : raise exc. invalidparameterconfiguration ( err _ msg _ missing _ fiel... | [
-0.7894331812858582,
-0.6661500930786133,
0.6792706847190857,
-0.18864013254642487,
-1.0260705947875977,
0.3734898865222931,
-0.27088093757629395,
-0.684293806552887,
0.02264808490872383,
0.7940200567245483,
-0.08368634432554245,
0.32367458939552307,
-0.5987467765808105,
0.3673916161060333... |
def _ _ init _ _ ( self ) : # one - time initialization flag, used for selecting initial palette self. _ initialized = false # the active theme name self. _ qt _ theme = " dark " self. _ disassembly _ theme = " dark " # the list of available themes self. _ themes = \ { " dark " : 0, " light " : 1, } # # coverage overvi... | [
0.21543100476264954,
-0.5552644729614258,
1.0681674480438232,
-1.3053849935531616,
-0.8424497246742249,
0.06408991664648056,
0.2960633933544159,
-0.5858549475669861,
0.8577578067779541,
-0.34744712710380554,
-0.5733529925346375,
-0.04685930907726288,
0.20736882090568542,
0.9291866421699524... |
def standarize ( ) : for filename in mydir : with open ( filename,'r') as file : filedata = file. read ( ) filedata = filedata. replace ('','' ) with open ( filename,'w') as file : file. write ( filedata ) file. close ( ) print ( " all files are now standarized. " ) | [
0.5356290340423584,
-0.6170841455459595,
0.6264347434043884,
-0.2446180284023285,
0.3170890510082245,
0.29204055666923523,
0.08880529552698135,
1.947411298751831,
-0.7657503485679626,
0.254868745803833,
-0.727315366268158,
0.044679708778858185,
-0.5158405303955078,
0.727495551109314,
-0.... |
def _ _ init _ _ ( self, options : dict, weight _ file : str, use _ character _ inputs = true, embedding _ weight _ file = none, max _ batch _ size = 128, cell _ reset = false ) : if not use _ character _ inputs : if embedding _ weight _ file is none : raise valueerror ( " embedding _ weight _ file is required input wi... | [
0.8228327035903931,
0.3530690371990204,
0.748481810092926,
0.694037139415741,
0.2829253077507019,
0.5261743068695068,
0.6334182620048523,
0.034564390778541565,
-0.5961052179336548,
0.6872722506523132,
0.05321545898914337,
-0.1982891708612442,
-0.17044907808303833,
-0.12843257188796997,
0... |
def parse _ line ( line : str ) - > list [ tuple [ int, int ] ] : res = [ ] for i, s in enumerate ( line. strip ( ). split ( ", " ) ) : if s = = " x " : continue res. append ( ( int ( s ), - i ) ) return res | [
-0.8303180932998657,
0.07736952602863312,
0.31805357336997986,
0.23816923797130585,
0.26902592182159424,
-0.33146440982818604,
-0.2899484634399414,
1.0818029642105103,
0.010149831883609295,
0.6365877389907837,
-0.6788666844367981,
-0.8174141049385071,
-0.08524895459413528,
-0.2903046309947... |
def validate _ function _ output ( does _ return _ dict, processed _ inputs, indices ) : if does _ return _ dict is false and processed _ inputs is not none : raise typeerror ( " provided ` function ` which is applied to all elements of table returns a variable of type { }. make sure provided ` function ` returns a var... | [
-0.28259795904159546,
0.2848716080188751,
0.537054717540741,
0.12698306143283844,
-0.1606912761926651,
0.04589184373617172,
0.4244854748249054,
-0.0005100155831314623,
-0.7204930186271667,
0.041226401925086975,
0.7379829287528992,
0.6072064638137817,
0.03815136104822159,
0.3282824158668518... |
def test _ arange _ multiple _ args ( self ) : def test _ f ( dummy ) : return torch. arange ( dummy. size ( 0 ), end = 30 ) dummy = torch. randn ( 10 ) jitvsglow ( test _ f, dummy, expected _ fused _ ops = { " aten : : arange " } ) | [
-0.15065103769302368,
1.1159497499465942,
0.43533551692962646,
0.6689893007278442,
0.7553787231445312,
0.037252068519592285,
-0.14860029518604279,
-0.4893978536128998,
-0.006671208888292313,
0.02729951962828636,
-0.31319761276245117,
0.2962457239627838,
0.474358469247818,
0.281639575958251... |
def test _ registerform _ invalid ( self ) : # if the form is not valid, then user. objects. create _ user would not be called. with patch ('user _ auth. views. user. objects. create _ user') as c _ user : with patch ('user _ auth. views. userinfo. objects. create') as c _ userinfo : user = c _ user. return _ value. sa... | [
-0.6088548302650452,
0.7997461557388306,
0.3528585731983185,
0.8122349977493286,
0.9449664354324341,
0.7697941660881042,
-0.21209026873111725,
0.061886146664619446,
-0.3788488507270813,
-1.2255786657333374,
-1.0351722240447998,
-0.8066595196723938,
-0.20882625877857208,
0.706899881362915,
... |
def link _ callback ( uri, rel ) : surl = settings. static _ url # typically / static / root = settings. project _ root # typically / home / userx / project _ static / if uri. startswith ( surl ) : path = os. path. join ( root, uri. replace ( surl, " " ) ) else : return uri if not os. path. isfile ( path ) : path = os.... | [
0.8144087195396423,
-0.496856689453125,
0.7351484894752502,
0.47091779112815857,
-0.28323981165885925,
0.49511635303497314,
1.503675103187561,
-0.07942964136600494,
0.5718393325805664,
-0.6420209407806396,
1.2965292930603027,
0.09313920885324478,
-0.5543566942214966,
-0.03287132829427719,
... |
def partial _ fit ( self, x, actions ) : opt, cost, rec, kl, nw = self. sess. run ( ( self. optimizer, self. cost, self. reconstr _ loss, self. kl _ loss, self. network _ weights ), feed _ dict = { self. x : x, self. actions : actions } ) return cost, rec, kl, nw | [
0.497334361076355,
-0.8295700550079346,
0.3748551309108734,
0.15141813457012177,
-0.42022567987442017,
-0.48675888776779175,
-0.5455449819564819,
-0.4904351234436035,
0.38655349612236023,
-0.30680519342422485,
-0.5750091075897217,
0.362321674823761,
-0.5830391645431519,
-0.3982341885566711... |
def _ _ init _ _ ( _ _ self _ _, *, location : str, custom _ parameters : optional [ mapping [ str,'outputs. customloginsettingvalueresponse'] ] = none, id : optional [ str ] = none, kind : optional [ str ] = none, name : optional [ str ] = none, tags : optional [ mapping [ str, str ] ] = none, type : optional [ str ] ... | [
-1.0026228427886963,
0.18924856185913086,
0.6197583079338074,
-0.40901556611061096,
0.0340791679918766,
0.21506571769714355,
-1.1077357530593872,
-0.22258837521076202,
0.6829753518104553,
0.4996742606163025,
-1.3886090517044067,
0.6708559393882751,
0.2805987298488617,
-1.193543553352356,
... |
def train _ unsup _ only ( self, epoch, performance _ estimators = none ) : if performance _ estimators is none : performance _ estimators = performancelist ( ) performance _ estimators + = [ losshelper ( " train _ loss " ) ] performance _ estimators + = [ floathelper ( " encoder _ grad _ norm " ) ] performance _ estim... | [
-0.7291046977043152,
0.5020169019699097,
0.703752338886261,
0.93988436460495,
0.21613338589668274,
0.032484401017427444,
0.6963927149772644,
0.9716704487800598,
-0.31151291728019714,
-0.15874363481998444,
-0.4915473461151123,
0.2383134514093399,
0.1720360964536667,
1.1086931228637695,
-0... |
def make _ reservation ( self, id, request ) : # pre : # id should be a unique identifier, and the number of seats in request should be no more than the amount of free seats. # the reservation request must always be a reservation for this showtime. # post : # if the reservation request demanded more seats than availabl... | [
-0.5509238243103027,
0.2798766791820526,
0.4860580265522003,
0.19654157757759094,
-0.4117693305015564,
-0.6955644488334656,
-0.9021453857421875,
-0.6630929708480835,
0.5808470249176025,
-0.7625125646591187,
0.25090113282203674,
-0.38211533427238464,
-0.34358450770378113,
-0.411467045545578... |
def generate _ gaussian _ map ( self, image _ size, center _ location ) : center _ x = center _ location [ 0 ] center _ y = center _ location [ 1 ] # r = np. sqrt ( center _ x * * 2 + center _ y * * 2 ) r = np. sqrt ( image _ size [ 0 ] * * 2 + image _ size [ 1 ] * * 2 ) / 70 gaussian _ map = np. array ( [ [ np. exp ( ... | [
-0.4654732644557953,
-1.237199068069458,
0.7346255779266357,
-0.46846893429756165,
-0.5059952139854431,
0.46121037006378174,
0.05165170133113861,
0.6997808814048767,
0.8541595935821533,
0.9730989336967468,
0.31217116117477417,
0.2025640457868576,
0.302396297454834,
0.40356045961380005,
-... |
def test _ 01 _ build ( self ) : # print ( prettyformatany. form ( self. m _ working _ sched,'c1 - 01 - a - workingschedule') ) # print ( prettyformatany. form ( self. m _ pyhouse _ obj. house,'c1 - 01 - b - house') ) print ( prettyformatany. form ( self. m _ pyhouse _ obj. house. schedules,'c1 - 01 - c - schedules') ) | [
-0.4052063226699829,
-0.39986488223075867,
0.4581310749053955,
-0.18248647451400757,
0.09343608468770981,
0.6079211831092834,
-0.18295367062091827,
-0.04359109699726105,
0.3222355246543884,
-0.779093861579895,
0.230698823928833,
0.5025951266288757,
-0.04040447622537613,
-0.1302804797887802... |
def test _ 02 _ content _ image _ etag _ 304 ( self ) : attachment = self. env ['ir. attachment']. create ( {'datas': b " r0lgoddhaqabaiaaap / / / / / / / ywaaaaaaqabaaacakqbads = ",'name':'testetag. gif ','public': true,'mimetype':'image / gif ', } ) response = self. url _ open ('/ web / image / % s'% attachment. id, ... | [
-0.2853067219257355,
0.1558006852865219,
0.46146801114082336,
-0.5992070436477661,
0.7349138259887695,
0.0017043867846950889,
-0.16856332123279572,
-0.25453245639801025,
-0.19385187327861786,
0.2189054787158966,
0.053258705884218216,
-0.19688229262828827,
0.37215596437454224,
0.05682788416... |
def testgetvaluesforquerywithreadquerypermissiondenied ( self ) : userapi ( ). create ( [ ( u'fred ', u'password ', u'fred ', u'fred @ example. com') ] ) user = getuser ( u'username') permissions = cachingpermissionapi ( user ) tagapi ( user ). create ( [ ( u'fred / bar ', u'description') ] ) values = [ ( u'fred / bar ... | [
0.19508105516433716,
0.9585855603218079,
0.5095768570899963,
0.208051398396492,
0.32180705666542053,
0.7616872787475586,
-0.4466482400894165,
-0.9269299507141113,
-0.6547433137893677,
-0.927398681640625,
0.29864948987960815,
-0.23586377501487732,
-0.06202103942632675,
0.6877122521400452,
... |
def test _ gf _ write _ feature _ header _ with _ description _ with _ empty _ background _ no _ short _ description ( disabled _ colors, capsys, mocker ) : # given feature = mocker. magicmock ( spec = feature ) feature. keyword = " feature " feature. short _ description = " my feature " feature. description = [ " foo ... | [
0.7307169437408447,
-0.17701375484466553,
0.4009791314601898,
0.4700542688369751,
0.8391441702842712,
0.3290019929409027,
-0.3227333128452301,
-0.04813340678811073,
-0.6918159127235413,
-0.4460047483444214,
-0.4255964159965515,
0.6119992733001709,
-0.3234640061855316,
0.5686917901039124,
... |
def getbricks ( self ) : return self. _ bricks [ : ] | [
-0.6196116805076599,
-0.0017173662781715393,
0.33206427097320557,
2.0227856636047363,
0.5913560390472412,
-0.013924580067396164,
-0.24037855863571167,
-0.2515259385108948,
0.09324602782726288,
-0.40335825085639954,
-0.7532534599304199,
0.6015537977218628,
-1.3709211349487305,
-0.5048481225... |
def decrypt ( self, data : bytearray ) - > bytearray : if not isinstance ( data, ( bytes, bytearray ) ) : self. clear ( ) raise gostciphererror ('invalid ciphertext data') return self. encrypt ( data ) | [
-0.26256677508354187,
1.2587018013000488,
0.3254585862159729,
0.12091096490621567,
-0.025223828852176666,
-0.08819735050201416,
0.13022610545158386,
-0.7772682905197144,
1.4790465831756592,
0.29583975672721863,
-0.5664300918579102,
0.5217869877815247,
-1.7913848161697388,
0.031461678445339... |
def expand _ polygon ( polyarr, offset ) : try : # convert the polygon vertex array to a linestr object polyshape = polyshape ( polyarr ) # offset the polygon by an ammount offset _ deg polyshapenew = polyshape. buffer ( offset ) # convert the linestr object back to a numpy array outpolyarr = np. array ( polyshapenew. ... | [
0.19263198971748352,
-0.8559473752975464,
0.7549739480018616,
-0.4043582081794739,
-1.0063174962997437,
0.6625897288322449,
-0.3954160511493683,
0.18201519548892975,
0.9169262647628784,
0.08084715902805328,
0.1297222524881363,
0.3675759732723236,
-0.281464546918869,
-0.8160161375999451,
... |
def _ _ tostage ( stage ) : return " stage % s " % stage | [
-0.7268452048301697,
-0.9382122755050659,
0.4617900848388672,
-0.7919853925704956,
-1.1707189083099365,
-0.27563536167144775,
-0.0856107622385025,
0.007536496501415968,
0.24938614666461945,
0.9997355341911316,
0.6339547634124756,
0.0065504708327353,
0.03553182631731033,
0.3514573872089386,... |
def handleallgardeningbuttonshidden ( self ) : somethingvisible = false if not self. _ _ shovelbutton. ishidden ( ) : somethingvisible = true if not self. _ _ wateringcanbutton. ishidden ( ) : somethingvisible = true if not somethingvisible : self. hidegardeninggui ( ) | [
0.24317967891693115,
0.5837743878364563,
0.7684292793273926,
1.0788084268569946,
0.12379928678274155,
1.2544504404067993,
0.629807710647583,
-0.2385268211364746,
-0.1542506366968155,
-0.09177418053150177,
-0.7571902275085449,
-0.45315176248550415,
-0.40541136264801025,
1.6072100400924683,
... |
def changerightlimit ( self ) : self. rightlimit = true self. cleanspikelist ( ) # self. createspikes ( ) | [
0.2231772094964981,
0.4637324810028076,
0.3594968318939209,
0.3421787917613983,
-0.7438600063323975,
0.06373119354248047,
-0.16922509670257568,
1.2375357151031494,
-0.10736280679702759,
1.002199649810791,
-1.2959684133529663,
1.5142414569854736,
-0.6357930898666382,
0.9906073212623596,
-... |
def help _ in _ use ( ) : return jsonify ( httpx. get ( graphite _ host, params = { " target " : " stats. gauges. bot. help. total. in _ use ", " from " : time _ frames [ request. args. get ( " frame ", " day " ) ], " format " : " json ", " maxdatapoints " : " 100 ", }, ). json ( ) [ 0 ] [ " datapoints " ] ) | [
-0.9287528395652771,
0.5439077615737915,
0.7047207951545715,
-0.7614226937294006,
0.14674878120422363,
-0.9038496017456055,
-0.3032478392124176,
-0.8908424377441406,
-1.0962144136428833,
0.9342476725578308,
0.24410876631736755,
0.7847815752029419,
0.0990314856171608,
-0.3215516209602356,
... |
def get _ entity _ stats ( self, scope, start _ date = none, end _ date = none, stats = none, related _ type = none, dto = none, * * kwargs ) : if dto is none : dto = {'scopes': scope } period = { } if start _ date : period ['startdate'] = start _ date if end _ date : period ['enddate'] = end _ date if stats : period [... | [
-0.5888962745666504,
0.5627323389053345,
0.7631825804710388,
-0.5234760046005249,
0.6032742261886597,
-0.26275211572647095,
-0.4687247574329376,
-1.0305849313735962,
0.40122532844543457,
-0.21510501205921173,
0.05004074424505234,
1.6107690334320068,
0.32611262798309326,
0.29155784845352173... |
def to _ exp _ poly _ ratio ( npq, dom _ bounds, data = [ ] ) : ( n _ p, n _ q ) = npq if n _ p < = n _ q : logging. error ('require higher degree of polynomial in numerator than denominator') exit ( 1 ) assert ( n _ p > = 2 ) # don't technically need even order on p ( x ) for truly finite domain if n _ p % 2! = 0 : lo... | [
-0.05237617343664169,
-0.6087759137153625,
0.8306694626808167,
-0.7160999178886414,
-0.36295023560523987,
-0.08795323222875595,
-0.5027344226837158,
0.22223639488220215,
0.9409611821174622,
0.36738717555999756,
0.03212125599384308,
-0.1578018218278885,
-0.19479288160800934,
0.5267862081527... |
def pitch _ pos _ in _ f ( x ) : pos _ in = torch. longtensor ( np. arange ( num _ notes ) ) pos _ in = pos _ in. repeat ( x. shape [ : - 2 ] + ( 1, ) ) return get _ variable ( pos _ in ) | [
0.09507352858781815,
0.001222879160195589,
0.5287458300590515,
-0.3142121136188507,
-0.21316824853420258,
-0.5451183319091797,
0.457732617855072,
-0.2717902660369873,
-1.1632784605026245,
0.5379431247711182,
-0.3742191195487976,
-0.41148748993873596,
-0.015241987071931362,
-1.5545338392257... |
def test _ vasp _ calc _ error _ ignore _ all ( run _ vasp _ process ) : results, node = run _ vasp _ process ( test _ case ='exit _ codes / converged - with - error ', settings = {'parser _ settings': {'ignore _ all _ errors': true } } ) # check that the standard output is there assert'retrieved'in results assert'misc... | [
0.7041245102882385,
-0.07626913487911224,
0.45440414547920227,
0.10386092215776443,
0.7262730002403259,
0.9490200877189636,
-0.5044732689857483,
0.5162780284881592,
0.006960400380194187,
-0.36793282628059387,
-0.7150207757949829,
-0.9887889623641968,
-0.07965917885303497,
0.371538877487182... |
def main ( ) : parser = argparse. argumentparser ( description = " " " \ parse xml created by doxygen in < rootpath > and create one rest file with breathe generation directives per definition in the < destdir >. note : by default this script will not overwrite already created files. " " ", formatter _ class = argparse... | [
0.23800085484981537,
-0.11340966820716858,
1.2144908905029297,
0.1651076376438141,
0.4979774057865143,
0.35478726029396057,
0.7501775622367859,
-0.49413609504699707,
-0.6925258040428162,
-0.1394822746515274,
0.06708521395921707,
0.44848117232322693,
-0.11149775236845016,
-0.361071586608886... |
def showmenuitemjson ( rest _ id, menu _ id ) : menuitem = session. query ( menuitem ). filter _ by ( restaurant _ id = rest _ id, id = menu _ id ). one ( ) menuitem. price = sub ('\ $ ','', menuitem. price ) return jsonify ( menuitem = menuitem. serialize ) | [
-0.4943785071372986,
-0.8355295658111572,
0.5001376867294312,
0.7853835821151733,
-0.915124773979187,
-0.47735366225242615,
-1.2874246835708618,
0.1882680207490921,
-0.3975488543510437,
0.5410712361335754,
-0.42466437816619873,
0.4375644624233246,
-0.5663504600524902,
-0.1271212100982666,
... |
def preprocess _ adj ( adj ) : adj _ normalized = normalize _ adj ( adj + sp. eye ( adj. shape [ 0 ] ) ) return sparse _ to _ tuple ( adj _ normalized ) | [
-0.5669136047363281,
0.7262381911277771,
0.31806084513664246,
-0.25354713201522827,
-0.4150591492652893,
-0.2750841975212097,
0.2894049882888794,
0.3641689419746399,
1.193408489227295,
1.07017982006073,
0.5779930949211121,
-0.11188816279172897,
0.2515898048877716,
-0.1469842493534088,
0.... |
def _ removeview ( self, win ) : self. _ _ inremoveview = true for tw in self. tabwidgets : if tw. haseditor ( win ) : tw. removewidget ( win ) break win. closeit ( ) self. _ _ inremoveview = false # if this was the last editor in this view, switch to the next, that # still has open editors for i in ( list ( range ( se... | [
-0.5282421708106995,
-0.9656221270561218,
0.45734670758247375,
-0.5154505372047424,
-1.181557059288025,
-0.5123170018196106,
0.6838416457176208,
0.32291486859321594,
-0.2520008087158203,
-0.4398467242717743,
0.19827942550182343,
-0.2563132643699646,
-0.337816059589386,
1.0820398330688477,
... |
def mintimetovisitallpoints ( points ) - > int : res = 0 for i in range ( len ( points ) - 1 ) : delta1, delta2 = ( abs ( points [ i ] [ 0 ] - points [ i + 1 ] [ 0 ] ), abs ( points [ i ] [ 1 ] - points [ i + 1 ] [ 1 ] ) ) diag = min ( delta1, delta2 ) straight = abs ( delta1 - delta2 ) res + = diag + straight return r... | [
0.4936954379081726,
0.14900904893875122,
0.9026375412940979,
0.1096038967370987,
-0.6389657855033875,
0.4186048209667206,
0.5435310006141663,
-0.326744019985199,
0.18078041076660156,
1.4565014839172363,
-0.6450705528259277,
0.4611619710922241,
-0.2179357409477234,
0.10059613734483719,
-0... |
def _ calc _ bbox ( self, nstd = 2 ) : self. _ bbox = gaussian _ bbox ( self. x [ 0 : 2 ], self. p [ 0 : 2, 0 : 2 ] ) | [
-0.12975367903709412,
0.2551567852497101,
0.3479715585708618,
0.07455606013536453,
-0.2583785057067871,
-0.4996647536754608,
0.0422603040933609,
0.025637071579694748,
-0.6127068996429443,
-0.3768569231033325,
-0.44616207480430603,
1.2304742336273193,
0.39770936965942383,
0.2155804336071014... |
def validate _ product _ pack ( self, cr, uid, bom _ id, product _ qty, context = none ) : bom _ obj = self. pool. get ('mrp. bom') bom = bom _ obj. browse ( cr, uid, bom _ id, context = context ) for line in bom. bom _ lines : self. log ( ). info ( " validating against line { } of bom { } ". format ( line, bom. name )... | [
-0.40459173917770386,
-1.1400537490844727,
0.5876003503799438,
0.6170322895050049,
0.06875041127204895,
0.17535512149333954,
0.0002236176369478926,
-1.1363520622253418,
0.303618460893631,
-0.5637719035148621,
-0.24200765788555145,
0.5400360226631165,
-1.0376648902893066,
0.2637633979320526... |
def list ( self, context, names = none, ids = none, project = none, search _ opts = none ) : neutron = neutronapi. get _ client ( context ) params = { } search _ opts = search _ opts if search _ opts else { } if names : params ['name'] = names if ids : params ['id'] = ids # note ( jeffrey4l ) : list all the security gr... | [
-0.7065801620483398,
0.6245411038398743,
0.3883644640445709,
-0.2173726111650467,
0.24304336309432983,
-0.562688946723938,
-1.7428112030029297,
-0.32235950231552124,
-0.03321090713143349,
1.00043785572052,
-0.25424328446388245,
1.1912184953689575,
-0.9959209561347961,
0.4118705689907074,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.