text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def run _ sliding _ window _ through _ text ( words, window _ size ) : word _ iterator = iter ( words ) # creates an object which can be iterated one element at a time word _ window = tuple ( itertools. islice ( word _ iterator, window _ size ) ) # islice ( ) makes an iterator that returns selected elements from the th... | [
-0.037168677896261215,
-0.4493613541126251,
0.5087380409240723,
-0.1073763519525528,
-1.057823896408081,
0.08387038856744766,
0.372526079416275,
0.6196483969688416,
-0.11106666922569275,
0.7086604237556458,
0.4906843304634094,
0.5419489741325378,
-1.2429343461990356,
0.9584866166114807,
... |
def add _ gaussian _ noise ( image, min _ sigma, max _ sigma ) : sigma = np. random. uniform ( min _ sigma, max _ sigma ) corrupted = np. random. normal ( image, sigma, ( image. shape [ 0 ], image. shape [ 1 ] ) ) corrupted = np. round ( corrupted * 255 ) / 255. 0 return corrupted. clip ( 0, 1 ). astype ( np. float64 ) | [
-0.4426875114440918,
-0.47055330872535706,
0.5046107172966003,
0.34600648283958435,
-0.15874092280864716,
0.4165758788585663,
-0.6853751540184021,
-0.7726468443870544,
0.4084623157978058,
0.8309950828552246,
0.6517887115478516,
1.025521159172058,
-0.24574804306030273,
-0.03554397448897362,... |
def calculate _ cooccurrence ( self, argument = none ) : self. w, w _ data _ copy = self. binarize _ data ( self. w ) if argument is none : argument = self. w argument, argument _ data _ copy = self. binarize _ data ( argument ) cooccurrences = self. w. t @ argument self. revert _ data ( self. w, w _ data _ copy ) self... | [
-0.26877111196517944,
-0.2236873060464859,
0.6109521985054016,
-0.25313231348991394,
0.23988260328769684,
-0.5965263247489929,
1.754553198814392,
0.5233585834503174,
-0.3692838251590729,
0.37477028369903564,
0.04687393829226494,
0.13784441351890564,
-0.08254390209913254,
0.4850742816925049... |
def pixbufrenderer ( self, treeviewcolumn, cellrendererpixbuf, treemodel, it ) : cellrendererpixbuf. set _ property ( " pixbuf ", none ) | [
-0.08364555984735489,
0.19777394831180573,
0.2811756730079651,
0.024566635489463806,
-0.2698030173778534,
-0.06688129156827927,
0.02895161882042885,
-0.1097959578037262,
-0.2525842487812042,
-0.8783428072929382,
-0.03846694901585579,
-0.06768210977315903,
-0.8755586743354797,
0.37873333692... |
def roll _ die ( self ) : result = randint ( 1, self. sides ) print ( str ( result ) ) | [
-0.5193519592285156,
0.28561386466026306,
0.562653124332428,
-0.6406638622283936,
0.14884544909000397,
0.641226053237915,
0.20127202570438385,
-0.5265824794769287,
-0.1987558752298355,
-0.743634819984436,
0.26512718200683594,
0.6665629744529724,
-0.4194352328777313,
-0.43605276942253113,
... |
def get _ allele ( hgvs, genome, transcript = none ) : chrom, start, end = hgvs. get _ coords ( transcript ) _, alt = hgvs. get _ ref _ alt ( transcript. tx _ position. is _ forward _ strand if transcript else true ) ref = get _ genomic _ sequence ( genome, chrom, start, end ) return chrom, start, end, ref, alt | [
-0.0033786222338676453,
-0.5006248950958252,
0.6489900350570679,
0.8170273900032043,
-0.4644980728626251,
0.08672723919153214,
-0.4114888906478882,
0.12836049497127533,
-0.6972415447235107,
0.43850353360176086,
0.3431120216846466,
0.764802873134613,
-0.3288677930831909,
-0.3187825381755829... |
def save ( self, commit = true ) : password = self. cleaned _ data [ " password1 " ] self. user. set _ password ( password ) if commit : self. user. save ( ) return self. user | [
-0.3049301505088806,
0.30771222710609436,
0.4844145178794861,
0.9551997184753418,
0.2510780692100525,
0.4473040699958801,
0.4122711420059204,
0.047586146742105484,
0.21923282742500305,
0.990827202796936,
-0.344564288854599,
-0.6078134179115295,
-1.2279448509216309,
-0.32529789209365845,
... |
def get _ model _ repository _ index ( self, headers : dict [ str, t. any ] =..., as _ json : t. literal [ false ] =... ) - > service _ pb2. repositoryindexresponse :... | [
-1.6664620637893677,
-0.5462245345115662,
0.37566933035850525,
-0.33297741413116455,
-0.16551657021045685,
-0.2640131413936615,
-0.16695639491081238,
-0.7883740663528442,
-0.31030648946762085,
-0.316729336977005,
-0.8042404055595398,
0.4135504961013794,
-0.12177005410194397,
-0.63909155130... |
def rewrite _ content ( jet ) : jet = copy. deepcopy ( jet ) # if jet [ " content " ]. shape [ 1 ] = = 5 : # pflow = jet [ " content " ] [ :, 4 ]. copy ( ) content = np. zeros ( ( len ( jet [ " content " ] ), 4 + 5 ) ) content [ :, : 4 ] = jet [ " content " ] [ :, : - 1 ] ids = np. abs ( jet ['content'] [ :, - 1 ] ) co... | [
0.28239333629608154,
-0.5466787219047546,
0.875006377696991,
-1.0867629051208496,
-0.3976537585258484,
-0.032917436212301254,
0.7254738807678223,
-0.35529014468193054,
-0.3220058083534241,
0.6733608841896057,
0.3419570326805115,
-0.20970876514911652,
-0.18251299858093262,
0.217063993215560... |
def test _ lamp _ duration ( self ) : if hardwarethread. _ hardwarethread _ _ singleton is not none : hardwarethread. _ drop ( ) # get current original value ( none ) and ensure getter returns the same original _ lamp _ duration = \ hardwarethread. _ hardwarethread _ _ lamp _ duration self. assertequal ( original _ lam... | [
-0.3583816885948181,
0.3413380980491638,
0.48502543568611145,
-0.17075605690479279,
0.5479970574378967,
0.9305741190910339,
0.14277799427509308,
-0.4089648425579071,
-0.03189714998006821,
-0.6187975406646729,
-0.3867625296115875,
0.09612735360860825,
-0.03577713295817375,
0.957252919673919... |
def setfastkineticsex ( exposedrows, serieslength, time, mode, hbin, vbin, offset ) : return none | [
0.5755696296691895,
0.3907252848148346,
0.19229087233543396,
1.1136295795440674,
-0.7604039907455444,
-0.5971258282661438,
-0.7359043955802917,
-0.006720082834362984,
0.25473350286483765,
0.16396743059158325,
-0.5921841859817505,
0.3187974691390991,
-0.22679495811462402,
0.0994659960269928... |
def _ _ init _ _ ( self, * args, * * kwargs ) : super ( patientintermediatemeasure, self ). _ _ init _ _ ( * args, * * kwargs ) self. fields _ to _ group _ by = ['bene _ sk'] | [
0.4689933657646179,
0.7779480218887329,
0.4324401021003723,
-0.28172120451927185,
0.5601513981819153,
-0.2696567475795746,
0.5615697503089905,
0.35310599207878113,
-0.8735958337783813,
0.001195757300592959,
0.3509851396083832,
0.03630952537059784,
-0.6187337636947632,
0.4256764352321625,
... |
def get _ directory ( parent, path, is _ in _ dir ) : title = translate ( " dirspanel ", " choose input directory " ) if is _ in _ dir \ else translate ( " dirspanel ", " choose output directory " ) return q. qfiledialog. getexistingdirectory ( parent, title, path ) | [
0.15831860899925232,
-0.29853034019470215,
0.4748825132846832,
-0.04747996851801872,
-0.3418118953704834,
-0.4152577519416809,
0.7138975858688354,
-0.44295477867126465,
-0.29531535506248474,
-0.8538578152656555,
0.763290524482727,
0.7913559675216675,
0.30667877197265625,
-0.020875884220004... |
def thanks ( ) : thank _ you = " " vld _ name = false while vld _ name is false : name = input ( " please enter a full name or'list': " ). lower ( ) if name = ='list': for name in db. keys ( ) : print ( name. title ( ) ) elif name = ='quit': break else : vld _ name = true if db. get ( name ) : continue else : # if name... | [
0.09882378578186035,
0.7323732376098633,
0.8359667658805847,
0.4944314658641815,
-0.4125376343727112,
0.635905385017395,
0.13178706169128418,
-0.41811394691467285,
0.004763208329677582,
0.6086983680725098,
-0.29405537247657776,
0.08745608478784561,
-0.07466600835323334,
0.9305877685546875,... |
def predict ( self, x ) : return self. base _ estimators [ self. leader _ index ]. predict ( x ) | [
-0.8681174516677856,
-0.27710720896720886,
0.32555481791496277,
0.43298840522766113,
-0.3266838490962982,
-0.03132041543722153,
-1.3184820413589478,
-0.6302384734153748,
0.24882425367832184,
-0.37895599007606506,
-0.6957310438156128,
0.8242720365524292,
-0.1842740923166275,
-0.522891342639... |
def deshacer _ modificacion ( self ) : try : ruta _ ultima _ cancion, ultima _ accion = self. acciones _ tomadas. desapilar ( ) if ultima _ accion = = self. agregada : self. remover _ cancion _ sin _ guardar ( ruta _ ultima _ cancion ) self. acciones _ deshechas. apilar ( ( ruta _ ultima _ cancion, self. agregada ) ) r... | [
-1.0818976163864136,
0.38689449429512024,
0.8440945744514465,
0.3810220956802368,
0.3472006320953369,
-0.5984753966331482,
0.4652225375175476,
0.5830766558647156,
0.5191193222999573,
0.5716140866279602,
0.18396347761154175,
-0.43172818422317505,
-0.45485731959342957,
0.1492110937833786,
... |
def area ( radio ) : pi = 3. 1415 return 2 * pi * radio * * 2 | [
0.0290676299482584,
-0.5437527298927307,
0.3350836932659149,
-0.7507161498069763,
-1.0290201902389526,
0.44412875175476074,
-0.11675187200307846,
-0.20630228519439697,
0.7502446174621582,
-0.0022443959023803473,
0.18607838451862335,
-0.19094857573509216,
-0.4934993088245392,
0.450206398963... |
def contact ( ) : return render _ template ('hi. html ', title ='contact ', year = datetime. now ( ). year, message ='your contact page.') | [
0.9499093294143677,
-0.19939763844013214,
0.6581993699073792,
0.4573003649711609,
-0.3928427994251251,
0.1357516497373581,
0.03550314903259277,
0.41686350107192993,
-0.48197755217552185,
0.4631596505641937,
0.46441650390625,
-0.5116387605667114,
0.015328696928918362,
0.25559380650520325,
... |
def querymenu ( self ) : updated _ min = raw _ input ('enter updated min ( example : 2007 - 03 - 16t00 : 00 : 00 ) :') query = gdata. contacts. client. contactsquery ( ) query. updated _ min = updated _ min feed = self. gd _ client. getcontacts ( q = query ) self. printfeed ( feed ) | [
0.022901790216565132,
-1.1159206628799438,
0.34593477845191956,
0.15845657885074615,
-0.5905355215072632,
0.05026489868760109,
-0.6277812719345093,
-1.0190573930740356,
-0.17808133363723755,
-0.6937220096588135,
0.34191811084747314,
0.945120096206665,
-0.8232229351997375,
-0.60701477527618... |
def testhastaginstancepermissiondenied ( self ) : userapi ( ). create ( [ ( u'fred ', u'password ', u'user ', u'fred @ example. com') ] ) user = getuser ( u'username') permissions = cachingpermissionapi ( user ) tagapi ( user ). create ( [ ( u'fred / bar ', u'description') ] ) tag = gettags ( paths = [ u'fred / bar'] )... | [
0.2904772162437439,
1.1473588943481445,
0.5806737542152405,
-0.007407885976135731,
0.2498089075088501,
0.7343482971191406,
0.15713877975940704,
-0.1932602971792221,
-0.8527864217758179,
-0.6010202169418335,
-0.30442988872528076,
-0.24746958911418915,
-0.29422181844711304,
0.623676478862762... |
def get _ tenant ( vm _ uuid ) : err _ msg, _ auth _ mgr = get _ auth _ mgr ( ) if err _ msg : return err _ msg, none, none logging. debug ( " auth. get _ tenant : allow _ all : % s, uuid : % s ", _ auth _ mgr. allow _ all _ access ( ), vm _ uuid ) if _ auth _ mgr. allow _ all _ access ( ) : logging. debug ( " returnin... | [
-0.1002267450094223,
-0.20179173350334167,
0.6622232794761658,
-0.14770948886871338,
-0.2740573287010193,
-1.1388468742370605,
-0.29036179184913635,
0.34023162722587585,
-0.5025482773780823,
1.0192750692367554,
0.09669184684753418,
0.12221258878707886,
-0.4083172380924225,
-0.4838945567607... |
def hardlink _ smoke _ test ( self ) : self. _ smoke ('hardlink') | [
0.2505455017089844,
0.5033828616142273,
0.3729943335056305,
0.9680049419403076,
1.631980538368225,
0.09808710962533951,
0.5877764821052551,
0.8058052062988281,
1.1345300674438477,
-0.5606011748313904,
0.02463611215353012,
1.1569684743881226,
-0.337368369102478,
0.8476628661155701,
-0.016... |
def run ( self ) : # create a thread for sending client input to server control _ thread = threading. thread ( target = self. _ send _ input, daemon = true ) control _ thread. start ( ) # create a thread for controlling client from terminal client _ control _ thread = threading. thread ( target = self. _ client _ contr... | [
-0.8574975728988647,
-0.5473145246505737,
0.9059876799583435,
-0.8499758243560791,
0.48666682839393616,
0.794674277305603,
0.5824863314628601,
-0.9205024242401123,
-0.6666619181632996,
-0.07030653953552246,
0.01965579390525818,
0.5416592955589294,
-0.3597782850265503,
0.1342887431383133,
... |
def err ( message ) : return status _ line ( ('status ','err ', message ) ) | [
0.7978352308273315,
0.017967520281672478,
0.23341123759746552,
0.3976822793483734,
-0.10705021023750305,
-0.2475878894329071,
-0.45555487275123596,
0.43892189860343933,
-0.6057621836662292,
-0.4925067126750946,
0.6018005013465881,
0.25371992588043213,
-0.07176267355680466,
0.69952195882797... |
def score ( self, key _ data, sensitive _ data ) : raise notimplementederror ('posterior probability based scoring not supported'' for this attacker!') | [
-0.06824665516614914,
-0.5319449305534363,
0.6330865621566772,
0.5391223430633545,
0.24663947522640228,
0.20175513625144958,
-1.2425754070281982,
-0.23091506958007812,
-0.49424368143081665,
0.6964251399040222,
0.6048284769058228,
-0.1635402888059616,
-0.451465904712677,
-0.5267618298530579... |
def test _ custom _ jinja ( minimal _ basic _ settings, fixtures _ settings, caplog ) : # get basic sample settings projectdir = os. path. join ( fixtures _ settings. fixtures _ path, " minimal _ basic " ) settings = minimal _ basic _ settings ( projectdir ) # init a custom jinja environment without any extension jinja... | [
0.35096749663352966,
0.1407378762960434,
0.6548242568969727,
0.3575158715248108,
-0.4240151345729828,
0.2788766324520111,
0.27061334252357483,
-0.5702921748161316,
0.7796325087547302,
-0.7528898119926453,
-0.2800622880458832,
0.3066689074039459,
-0.007462306879460812,
0.2109561264514923,
... |
def show _ loading _ bar ( self ) : self. master. show _ loading _ bar _ popup ('incrementing a counter... ', 100 ) operation _ thread = threading. thread ( target = self. long _ operation ) operation _ thread. start ( ) | [
0.37757113575935364,
1.6310170888900757,
0.6279987692832947,
0.23646599054336548,
-0.3262198269367218,
0.0643620565533638,
0.6863468289375305,
0.5931222438812256,
-0.23778988420963287,
-0.34751129150390625,
-0.2096026986837387,
0.25190863013267517,
-0.3064456284046173,
0.4317965805530548,
... |
def daterange ( start _ date, end _ date, delta = 1 ) : out = [ ] days = ( end _ date - start _ date ). days for n in range ( days / delta + 1 ) : out. append ( start _ date + timedelta ( n * delta ) ) return out # for d in range ( 1, days % delta + 1 ) : # get the remainder days # yield start _ date + timedelta ( n * ... | [
0.08044230192899704,
0.4277726709842682,
0.9196971654891968,
0.8560964465141296,
0.03301120921969414,
0.5829565525054932,
-0.5264194011688232,
0.5083590745925903,
-0.5339725613594055,
-0.3797227144241333,
0.04121730476617813,
0.263548880815506,
0.051665425300598145,
0.1499399095773697,
-... |
def compress _ image ( image _ path, image _ name ) : try : image = image. open ( image _ path + image _ name ) image. save ( image _ path +'compressed _'+ image _ name, quality = 50, optimised = true ) response = {'error':'','status': true,'compressed _ image _ path': image _ path +'compressed _'+ image _ name } excep... | [
-0.4492839276790619,
-0.707329273223877,
0.5406798720359802,
-0.009548335336148739,
-0.10860418528318405,
-0.39713314175605774,
-0.024044083431363106,
0.15701927244663239,
-0.41226741671562195,
1.515601634979248,
-0.5937809944152832,
-0.6156285405158997,
-0.7940225601196289,
0.366608023643... |
def test _ transaction _ filtering _ no _ result ( client, acc1 _ usd _ deposit _ transaction _ factory, acc2 _ eth _ withdrawal _ transaction _ factory, ) : deposit = acc1 _ usd _ deposit _ transaction _ factory ( client _ address ) withdrawal = acc2 _ eth _ withdrawal _ transaction _ factory ( client _ address ) enco... | [
0.038351986557245255,
0.818144679069519,
0.6846523284912109,
0.25964465737342834,
0.2194463610649109,
0.2783469557762146,
0.04514838382601738,
-0.9632717967033386,
-0.5867313146591187,
-0.939467191696167,
-0.19044843316078186,
-0.04400882497429848,
0.6787541508674622,
-0.3187764585018158,
... |
def register ( self, * types ) : types = [ t if isinstance ( t, collections. iterable ) else ( t, ) for t in types ] if not all ( type ( t ) is type for t in itertools. chain ( * types ) ) : raise typeerror ('multimethod can only register types') xtypes = itertools. product ( * types ) @ curry def register ( self, xtyp... | [
-0.7907483577728271,
1.0195086002349854,
0.9455296397209167,
0.8236583471298218,
0.9381675720214844,
-0.542258083820343,
-0.2750832736492157,
-0.963064968585968,
0.33683961629867554,
-0.17950597405433655,
-0.8289138674736023,
0.2296210080385208,
-0.9809949994087219,
0.1705169677734375,
-... |
def test _ nfc _ wps _ handover _ init ( dev, apdev ) : try : _ test _ nfc _ wps _ handover _ init ( dev, apdev ) finally : dev [ 0 ]. request ( " set ignore _ old _ scan _ res 0 " ) | [
-0.007630174979567528,
0.8175917863845825,
0.6471753120422363,
0.2585545778274536,
0.7260279655456543,
0.505793571472168,
0.6008428931236267,
-0.9435026049613953,
1.1498414278030396,
-1.136020541191101,
0.0798485204577446,
-0.8473288416862488,
-0.11309144645929337,
0.49507808685302734,
0... |
def getpages ( self ) : return bookpage. objects. getsortedpagesqueryset ( self ) | [
0.13200917840003967,
-0.7497356534004211,
0.3261759877204895,
0.6450194716453552,
0.6446670889854431,
0.4114193320274353,
-0.8504486083984375,
-0.48680242896080017,
-0.5124901533126831,
-0.3723668158054352,
0.7678738236427307,
-0.3361690044403076,
-0.5541706681251526,
0.16445393860340118,
... |
def settemperature ( temperature ) : return none | [
0.10752136260271072,
-0.5583980679512024,
0.22047041356563568,
0.19859862327575684,
0.18594908714294434,
-0.8183169364929199,
0.41207289695739746,
1.0623739957809448,
-0.006759464740753174,
-0.1520039439201355,
-1.2380379438400269,
-0.06643780320882797,
-1.361089825630188,
0.19945125281810... |
def test _ subscription _ api _ with _ free _ event ( self ) : data = { " event _ id " : self. event _ free. id, " user _ id " : self. user _ id, " no _ of _ tickets " : 4, } response = self. client. post ( self. end _ point, json. dumps ( data ), http _ authorization = " bearer { } ". format ( self. token ), content _... | [
1.0876357555389404,
0.10921643674373627,
0.9676249027252197,
0.5389628410339355,
-0.17796510457992554,
0.4174046218395233,
-0.551810622215271,
-0.6085532903671265,
0.17498110234737396,
-0.46875637769699097,
-1.1725465059280396,
0.03028103895485401,
-0.21972247958183289,
0.1101926639676094,... |
def _ check _ array _ sizes _ consistency _ when _ there _ are _ only _ out _ arrays ( writer, parameters ) : # check if there are only out array parameters : for param in parameters : if param. is _ array and param. is _ in : return # get the list of every out parameter array _ out _ params = [ param for param in para... | [
-0.6287305951118469,
-0.4895211160182953,
0.8780595660209656,
0.7157502770423889,
0.782912015914917,
-0.007162805180996656,
0.7308668494224548,
0.8333995342254639,
0.21549193561077118,
1.0923207998275757,
0.5750809907913208,
0.2343987077474594,
-0.48923784494400024,
1.4598525762557983,
-... |
def _ compute _ coeff _ transform ( mass _ centers, weights = np. array ( [ 1., 1., 1., 0. 75, 0. 5 ] ), value = 50. ) : nclasses, nvariables = np. shape ( mass _ centers ) t _ vals = np. empty ( ( nclasses, nclasses ), dtype = mass _ centers. dtype ) for i in range ( nclasses ) : weights _ mat = np. broadcast _ to ( w... | [
0.06624241918325424,
-0.48265716433525085,
0.6821393966674805,
-0.40530285239219666,
0.1660361886024475,
-0.7342965006828308,
0.16068033874034882,
-0.1775614321231842,
-0.007489110808819532,
1.0805367231369019,
-0.1301078349351883,
0.22267572581768036,
0.43707776069641113,
0.39470270276069... |
def layer _ index ( number : int ) - > int : assert number > = 0 if number = = 0 : return 0 return triangular _ root ( math. ceil ( number / 8 ) - 1 ) + 1 | [
-0.8625385761260986,
0.3999805450439453,
0.27456173300743103,
0.18156321346759796,
-0.05772540345788002,
0.10363440215587616,
1.6179436445236206,
-0.2814703583717346,
0.964087188243866,
0.05841202661395073,
0.0698927566409111,
0.39827990531921387,
-0.1547655463218689,
-0.014721083454787731... |
def create _ item ( self, * * kwargs ) : item, created = self. queryset. model. objects. get _ or _ create ( * * kwargs ) return item | [
0.19252271950244904,
-0.21199515461921692,
0.2506107687950134,
0.7268472909927368,
1.0154047012329102,
1.507002353668213,
-1.0770124197006226,
-0.4719591736793518,
-0.8028556108474731,
-0.29110777378082275,
0.1884777694940567,
-0.42438143491744995,
-0.32674333453178406,
-0.0783088654279708... |
def background _ roi _ detection ( self, image, roierode, mask, roi _ proportion = 0. 2, plotflag = false ) : # auto detection of 4 x background roi samples ( one in each corner of background ) dims = mask. shape # dimensions of mask new _ mask _ area = np. sum ( roierode ) bground _ roi = mask * 0 # initialise image m... | [
0.4688286781311035,
-0.49043047428131104,
0.8159869313240051,
-0.05180061236023903,
0.32688915729522705,
-0.9125726222991943,
0.7070398926734924,
0.09282965213060379,
-0.07957953959703445,
0.5844427347183228,
0.6260215044021606,
0.28320983052253723,
-0.4847796857357025,
-0.3546198606491089... |
def _ materialize _ feature _ column ( self, feature _ column, x ) : input _ fn = numpy _ io. numpy _ input _ fn ( x = {'x': x }, y = none, batch _ size = self. _ test _ data. num _ examples, num _ epochs = 1, shuffle = false ) with ops. graph ( ). as _ default ( ) : features = input _ fn ( ) input _ tensor = tools. in... | [
0.3776565194129944,
-0.11175252497196198,
0.34562039375305176,
0.19393524527549744,
0.009464668110013008,
-0.7820678353309631,
-0.2824508845806122,
0.32358530163764954,
0.25941818952560425,
0.09191907197237015,
-0.24854178726673126,
0.4702354371547699,
0.694610059261322,
-0.644719481468200... |
def test _ cancel _ free _ with _ block _ does _ not _ create _ transfer _ block ( self ) : self. assertfalse ( block. objects. exists ( ) ) event = baker. make _ recipe ('booking. future _ pc ', cost = 10 ) # free ( with block ) user3 = baker. make _ recipe ('booking. user') make _ data _ privacy _ agreement ( user3 )... | [
0.610419750213623,
0.9671117663383484,
0.8084685206413269,
0.8452048897743225,
-0.6155253052711487,
1.1296230554580688,
0.17921984195709229,
-0.23213306069374084,
0.13356328010559082,
-0.21480272710323334,
-0.8244489431381226,
-0.47984880208969116,
-0.3946887254714966,
0.7581616044044495,
... |
def bigramcorpus ( prevword, nextword ) : f = open ( '. / resources / count _ 2w. txt ','r') lines = f. readlines ( ) bigram _ dict = { } for line in lines : words = line. split ( ) bigram _ dict [ ( words [ 0 ]. lower ( ), words [ 1 ]. lower ( ) ) ] = int ( words [ 2 ] ) if ( prevword, nextword ) not in bigram _ dict.... | [
0.7276443243026733,
-0.34068652987480164,
0.6570234298706055,
-0.506866455078125,
-0.38529837131500244,
-0.4060615301132202,
1.0084059238433838,
0.717219352722168,
-1.075142741203308,
0.6071742177009583,
0.047489359974861145,
0.5521558523178101,
-1.0644748210906982,
0.6146538257598877,
0... |
def target _ image _ folder ( self ) : return self. _ target _ image _ folder | [
-1.4935635328292847,
-0.5372539758682251,
0.18639406561851501,
-0.3934449553489685,
0.30334579944610596,
0.35789135098457336,
1.1157151460647583,
-0.1364022046327591,
-0.07579746097326279,
-0.5507291555404663,
0.5750009417533875,
1.1881353855133057,
0.7970506548881531,
0.13816119730472565,... |
def plot _ correlation _ heatmap ( df, fname = none, figsize = ( 10, 10 ) ) : corr = df. corr ( ) fig = plt. figure ( figsize = figsize ) sns. heatmap ( corr, xticklabels = corr. columns. values, yticklabels = corr. columns. values, cmap ='bwr ', annot = true ) if fname : fig. savefig ( fname, bbox _ inches ='tight') | [
0.3160306215286255,
0.42957693338394165,
0.5500682592391968,
0.2798418402671814,
0.36033812165260315,
-0.03917509317398071,
1.4071601629257202,
0.9066286087036133,
0.18521781265735626,
-0.14474059641361237,
-0.24096529185771942,
0.198156476020813,
-0.21105444431304932,
0.3808523118495941,
... |
def target ( self ) : return self. _ _ target | [
-0.680352509021759,
-0.9310469627380371,
0.28173163533210754,
-0.3548814356327057,
0.7713415026664734,
0.7392260432243347,
0.6418750286102295,
-0.06477615237236023,
0.635474443435669,
-1.5001665353775024,
0.9579074382781982,
0.8503850102424622,
-0.38098397850990295,
-1.3068664073944092,
... |
def price _ type ( self, price _ type ) : allowed _ values = [ 0, 1, 2 ] # noqa : e501 if self. local _ vars _ configuration. client _ side _ validation and price _ type not in allowed _ values : # noqa : e501 raise valueerror ( " invalid value for ` price _ type ` ( { 0 } ), must be one of { 1 } ". format ( # noqa : e... | [
-0.3677263557910919,
-0.06654896587133408,
-0.2328263223171234,
0.8516492247581482,
0.37603119015693665,
0.8397777676582336,
0.3383845090866089,
-0.15610696375370026,
-0.1709088832139969,
1.1735734939575195,
-0.32276976108551025,
0.3362295925617218,
-0.7375327944755554,
0.7907621264457703,... |
def handle _ internal ( hass : homeassistant, gateway _ id : gatewayid, msg : message ) - > none : internal = msg. gateway. const. internal ( msg. sub _ type ) if ( handler : = handlers. get ( internal. name ) ) is none : return handler ( hass, gateway _ id, msg ) | [
0.5434033274650574,
-0.33830633759498596,
0.36343976855278015,
-0.25978004932403564,
-0.40036410093307495,
-0.11564340442419052,
-0.21480995416641235,
-0.23225750029087067,
0.1235087662935257,
-1.0025042295455933,
0.7028194665908813,
0.4941730797290802,
-0.8191727995872498,
1.1646821498870... |
def restore _ object ( self, attrs, instance = none ) : if instance : # update existing instance instance. event _ name = attrs. get ('event _ name ', instance. event _ name ) instance. event _ description = attrs. get ('event _ description ', instance. event _ description ) instance. venue _ name = attrs. get ('venue ... | [
-0.26178497076034546,
-0.6421045064926147,
0.9477983713150024,
-0.8200043439865112,
-0.9672301411628723,
0.146858349442482,
-0.22734516859054565,
1.0941470861434937,
0.7173124551773071,
0.08685209602117538,
-0.4128749966621399,
0.34060800075531006,
-0.4744732975959778,
-0.94427889585495,
... |
def checkseq ( record ) : # print ( " \ t checkseq ( ) received sequence : ", record, type ( record ) ) seq = record. seq. lower ( ) for motif in motifs _ list : if motif in seq : print ( " \ t + ", motif, " found at position : ", seq. find ( motif ) ) foundin _ list. append ( record ) # save the sequence for which thi... | [
0.05502019077539444,
-1.2644613981246948,
0.5169451832771301,
-0.8092395663261414,
0.5249720215797424,
-0.2703617513179779,
0.13816268742084503,
0.64500892162323,
-0.18989145755767822,
0.9040495157241821,
-0.634648323059082,
0.13328219950199127,
-0.8880232572555542,
0.7404343485832214,
-... |
def _ _ toid ( cmd ) : self. _ _ commandtotarget ( cmd ) return " id % s " % cmd. jobid ( ) | [
-0.035746779292821884,
-1.2722619771957397,
0.46491140127182007,
-0.7530310153961182,
0.2972670793533325,
0.3995627462863922,
0.12100747972726822,
0.13745062053203583,
0.6991353631019592,
-0.4043053090572357,
0.2994976043701172,
0.6729937791824341,
-0.19776763021945953,
-0.255138635635376,... |
def num _ channels ( im : union [ image. image, np. ndarray ] ) - > int : return im. shape [ 2 ] if len ( im. shape ) > 2 else 1 | [
-0.45965248346328735,
0.8764156103134155,
0.37897008657455444,
0.8318437933921814,
-0.12431925535202026,
-0.7783774733543396,
0.3060230314731598,
-0.7130149006843567,
0.6276041269302368,
0.30946075916290283,
0.6207873225212097,
-0.011478557251393795,
0.7366210222244263,
-0.1109512001276016... |
def count _ recursively ( lst ) : if not lst : return 0 return count _ recursively ( lst [ 1 : ] ) + 1 | [
-0.09136727452278137,
1.226270318031311,
0.17847585678100586,
1.6121666431427002,
-0.10284817963838577,
0.17979218065738678,
0.2689797878265381,
0.45848357677459717,
0.5220016837120056,
-0.6074962615966797,
-1.780454158782959,
-0.09785453230142593,
-0.08718762546777725,
1.400648832321167,
... |
def save ( self ) : raise notimplementederror ( " this is just an abstract interface " ) | [
-0.9277852177619934,
-0.7506888508796692,
0.6851708889007568,
0.24811233580112457,
0.44413459300994873,
1.281636357307434,
0.6209681630134583,
-0.029273621737957,
-0.08440577983856201,
0.15053203701972961,
-1.2122507095336914,
-0.6667811274528503,
-0.23383605480194092,
1.0229777097702026,
... |
def check _ directory _ exists _ and _ if _ not _ mkdir ( directory ) : if not os. path. exists ( directory ) : os. makedirs ( directory ) logger. debug ( f " making directory { directory } " ) else : logger. debug ( f " directory { directory } exists " ) | [
-1.0067024230957031,
0.7459633946418762,
0.41637691855430603,
-0.2588200569152832,
0.8012830018997192,
0.8127137422561646,
0.012888168916106224,
0.034685228019952774,
0.6934459209442139,
-0.2877478003501892,
0.5835037231445312,
0.08313218504190445,
0.4446071982383728,
1.11443030834198,
0... |
def compute _ embeddings _ lfw ( val _ loader, model, pdist = lambda x, y : 1. - f. cosine _ similarity ( x, y ), flipped _ embeddings = false ) : scores _ with _ gt = [ ] embeddings = [ ] ids = [ ] batch _ size = 0 for batch _ idx, data in enumerate ( tqdm ( val _ loader,'computing embeddings') ) : images _ 1 = data [... | [
-0.616491436958313,
-0.15622280538082123,
0.9076882004737854,
0.5519891977310181,
-0.22916105389595032,
0.548331081867218,
-0.007335529197007418,
-0.07577050477266312,
-0.4192051291465759,
0.5828401446342468,
-0.529790461063385,
-0.05825457349419594,
0.3605954647064209,
1.0575636625289917,... |
def get _ biospecimen _ data ( tcga _ id ) : payload = {'attachment':'true ', " filters " : json. dumps ( { " op " : " and ", " content " : [ { " op " : " in ", " content " : { " field " : " cases. project. program. name ", " value " : [ " tcga " ] } }, { " op " : " in ", " content " : { " field " : " project. project ... | [
0.2762688100337982,
0.24854125082492828,
0.47930794954299927,
-0.7514902949333191,
-0.009805281646549702,
-0.12380832433700562,
0.06533381342887878,
-0.645945131778717,
-0.29250314831733704,
0.6138432621955872,
0.08982007950544357,
1.0995843410491943,
-0.09647265821695328,
0.56553071737289... |
def test _ table _ 7 _ fail ( ) : cleanup ( ) print _ test _ separator ( " starting test _ table _ 7 " ) cat = csvcatalog. csvcatalog ( ) try : t = cat. create _ table ( " teams ", ".. / data / teams. csv " ) print ( " teams table ", json. dumps ( t. describe _ table ( ), indent = 2 ) ) t. add _ column _ definition ( c... | [
0.6878527402877808,
0.730772078037262,
0.5457795262336731,
0.2133728265762329,
-0.1652631312608719,
0.1737339347600937,
-0.008065459318459034,
-0.630939781665802,
-0.6719299554824829,
-0.3473380208015442,
-0.02634589560329914,
0.05416195094585419,
1.0957638025283813,
0.3799886405467987,
... |
def contact ( request ) : if request. method = ='post': if request. user. is _ authenticated : create _ contact _ form = contact ( name = request. post. get ('name'), comment = request. post. get ('comment'), email = request. post. get ('email'), user _ id = request. user ) create _ contact _ form. save ( ) else : crea... | [
0.28061261773109436,
0.3345136046409607,
0.8125610947608948,
0.42200976610183716,
0.18633335828781128,
0.30794209241867065,
0.07705783098936081,
-0.7240119576454163,
-0.44352734088897705,
0.07180442661046982,
0.19572077691555023,
0.16018334031105042,
-0.3924120366573334,
0.3602798283100128... |
def unify _ var ( self, x, y, theta ) : if x in theta : return self. unify ( theta [ x ], y, theta ) elif y in theta : return self. unify ( x, theta [ y ], theta ) else : if not is _ variable ( y ) : theta [ x ] = y return theta | [
-0.11380771547555923,
0.0198284313082695,
0.37183451652526855,
-0.8711479902267456,
0.0272341500967741,
-0.5384119749069214,
-0.7474925518035889,
-0.47361886501312256,
-0.3672689199447632,
0.5983774065971375,
-0.3788966238498688,
0.7791221141815186,
-0.1073552668094635,
-0.4111060500144958... |
def session _ scope ( ) : try : yield db _ session except exception as ex : # noqa b902 db _ session. rollback ( ) raise ex finally : db _ session. close ( ) | [
-0.22886231541633606,
0.06839098781347275,
0.7363215684890747,
-0.4542507231235504,
-0.4507579505443573,
-0.467267245054245,
0.39411038160324097,
-0.8862159252166748,
0.8204254508018494,
0.8480684161186218,
1.1112889051437378,
0.0021464284509420395,
0.0760011300444603,
-0.6729735732078552,... |
def apache _ restart ( ) : with settings ( hide ('warnings ','running ','stdout ','stderr'), warn _ only = true ) : run ('/ etc / init. d / httpd restart') | [
0.3363606631755829,
-0.0948193222284317,
0.5068469643592834,
0.05525686964392662,
-0.18788017332553864,
0.5279644131660461,
0.06795082241296768,
-0.03618551045656204,
-0.4604208767414093,
0.42400428652763367,
0.17324693500995636,
1.305400013923645,
-0.34189558029174805,
0.14891473948955536... |
def membrane ( x, y, a, b, beta, n, m, ninc, dt ) : w = np. zeros ( ninc, dtype = float ) c = beta for i in range ( ninc ) : wtemp = 0. 0 t = i * dt for n in range ( 1, n ) : for m in range ( 1, m ) : k = sqrt ( ( m * * 2 ) / ( a * * 2 ) + ( n * * 2 ) / ( b * * 2 ) ) hmn = iterm ( a, b, n, m ) wtemp = wtemp + hmn * sin... | [
0.24226634204387665,
-0.20004567503929138,
0.6811515092849731,
-0.2533514201641083,
0.3276093304157257,
-0.11071325838565826,
0.24142375588417053,
-0.13976144790649414,
-0.95894455909729,
0.4137701690196991,
0.5313672423362732,
-0.3677644729614258,
-0.7295886874198914,
0.21517081558704376,... |
def predict ( self, lexical _ input : str = none, * * kwargs ) - > " predictions " : if " input " in kwargs : lexical _ input = kwargs [ " input " ] warning _ message = " the'input'parameter is deprecated and will be removed in the next major release. " warning _ message + = " use the'lexical _ input'parameter instead.... | [
-0.23689328134059906,
0.14581359922885895,
0.63465416431427,
0.28099268674850464,
-0.1274600774049759,
-0.5809833407402039,
-0.9598214626312256,
0.3249317705631256,
-0.6328300833702087,
-0.0009302845573984087,
-0.17542606592178345,
-0.012291179969906807,
-1.1704550981521606,
0.127814292907... |
def generate _ checkbox _ uncheck _ template ( specifics : dict, placeholders : dict, * * kwargs ) - > dict : template = generate _ generic _ template ( specifics = specifics, placeholders = placeholders, meta = {'value':'{ { checkbox - value } }'} ) template ['action - type'] ='uncheck'return template | [
-0.9654890298843384,
-0.0751756802201271,
0.3030032217502594,
-0.6800034642219543,
0.12795421481132507,
-0.0788649246096611,
0.16766586899757385,
1.1219359636306763,
-0.4288073778152466,
1.227564811706543,
-0.24031175673007965,
-0.08935481309890747,
0.43637365102767944,
-0.3759917914867401... |
def on _ launch ( launch _ request, session ) : print ( " on _ launch requestid = " + launch _ request ['requestid'] + ", sessionid = " + session ['sessionid'] ) # dispatch to your skill's launch return get _ welcome _ response ( ) | [
0.8953883647918701,
-1.4403096437454224,
0.4421597719192505,
0.3250334560871124,
-0.33013689517974854,
-0.556218147277832,
-0.9190388321876526,
-0.19104306399822235,
1.65072762966156,
-0.012145759537816048,
-0.5162994861602783,
0.6643654108047485,
1.026073694229126,
0.2634713649749756,
-... |
def generate _ prime _ numbers ( length ) : prime _ numbers = [ 2 ] # two is the only even prime, so it gets a special treatment number = 3 # we'll start the search at 3 # keep running while string length is under specified length : while len ( stitch _ list ( prime _ numbers ) ) < length : # if number is prime, add to... | [
-0.6374744772911072,
0.25912219285964966,
0.46660569310188293,
0.17723239958286285,
0.12846793234348297,
0.07728764414787292,
-0.9053144454956055,
0.29540297389030457,
1.1560962200164795,
-0.18430721759796143,
-1.465847373008728,
0.08489297330379486,
-1.2244447469711304,
0.4864585101604461... |
def clone ( self, new _ view _ name ) : updated _ api, updated _ xml = self. _ clone _ view _ helper ( new _ view _ name ) retval = self. _ _ class _ _ ( updated _ api ) retval. config _ xml = updated _ xml return retval | [
-0.6638906002044678,
-1.1199264526367188,
0.4807283580303192,
0.7328214645385742,
-1.82609224319458,
0.3230971097946167,
-0.4854777753353119,
-0.5158330798149109,
0.5691094994544983,
-0.13970942795276642,
0.040204234421253204,
0.03020245023071766,
-0.34846755862236023,
-0.6455745100975037,... |
def clear _ gateway ( self ) : self. gateway = none | [
0.4714290201663971,
-0.32979816198349,
0.27866390347480774,
-0.40361353754997253,
-0.654569685459137,
-0.2853609323501587,
-0.5846691131591797,
-0.07890958338975906,
-0.0752067044377327,
0.33896541595458984,
-0.027926435694098473,
1.636824369430542,
-0.5816266536712646,
1.3086763620376587,... |
def reverse ( self, * args ) : return _ topods. topods _ shape _ reverse ( self, * args ) | [
-0.6091867089271545,
0.3389895558357239,
0.43154552578926086,
-0.2652445137500763,
0.9420355558395386,
0.6647027134895325,
0.6284254789352417,
-0.15425346791744232,
-1.2590034008026123,
-0.3416638970375061,
-0.30598849058151245,
0.22839418053627014,
-0.38321739435195923,
-0.678702354431152... |
async def test _ datadisk _ move _ fail ( coresys : coresys, new _ disk : str, os _ available ) : with pytest. raises ( hassosdatadiskerror, match = f "'{ new _ disk }'not a valid data disk target! " ) : await coresys. os. datadisk. migrate _ disk ( new _ disk ) | [
-0.3090539574623108,
0.7914483547210693,
0.5021928548812866,
0.29298892617225647,
0.6831040382385254,
0.5530580282211304,
-0.4869884252548218,
0.06683693081140518,
0.03947019204497337,
-0.6430486440658569,
-0.1385832279920578,
0.4548415243625641,
0.1223062127828598,
0.12937667965888977,
... |
def _ _ getitem _ _ ( self, statement ) : if statement in self. exact _ strs : return self. exact _ strs [ statement ] for ( pattern _ str, ( patt, templates ) ) in zip ( self. patterns. keys ( ), self. patterns. values ( ) ) : if patt. match ( statement ) : return templates return [ ] | [
0.004931772593408823,
-0.6604383587837219,
0.6084446907043457,
-0.39779162406921387,
-0.696658730506897,
-0.11008536070585251,
-0.5825686454772949,
-0.22621390223503113,
0.5902004837989807,
0.021958639845252037,
0.4404360055923462,
0.16826720535755157,
0.26303204894065857,
-0.0294094942510... |
def icon ( self ) : try : return pficon. icon _ from _ element ( self. note _ element, browser = self. browser ) except nosuchelementexception : return none | [
0.24717657268047333,
0.11085127294063568,
0.3151162564754486,
0.7391617894172668,
0.4086143672466278,
-0.13265150785446167,
0.7948729395866394,
0.0666644424200058,
-0.09787937253713608,
-0.16885574162006378,
0.02696007676422596,
-0.5280254483222961,
-0.6744662523269653,
-0.7757995128631592... |
def _ _ len _ _ ( self ) : # todo : override method to return length of dataset return len ( self. all _ data ) | [
0.06906852126121521,
-0.5875843167304993,
0.277621328830719,
-1.0474026203155518,
0.1443857103586197,
0.5158920288085938,
-0.14696013927459717,
1.4854516983032227,
1.0818560123443604,
-1.3092117309570312,
-0.2994319796562195,
0.022407036274671555,
0.15103809535503387,
0.2997623383998871,
... |
def match _ masked _ syllables ( self, pattern : text, mask : text = " x " ) - > bool : return ( true if re. match ( pattern, " ". join ( self. mask _ syllables ( mask = mask ) ) ) else false ) | [
0.4278142750263214,
0.08928488940000534,
0.3568761646747589,
0.9445915222167969,
-0.5173343420028687,
0.21237912774085999,
-0.29994434118270874,
0.17191524803638458,
0.0877574011683464,
0.1849682331085205,
-0.0695713609457016,
-0.4874178469181061,
-0.734106719493866,
-0.37936243414878845,
... |
def run _ report ( self ) : print ( f " water : { self. resource ['water'] } " ) print ( f " milk : { self. resource ['milk'] } " ) print ( f " coffee : { self. resource ['coffee'] } " ) print ( f " profit : { self. profit } " ) | [
-0.11797992885112762,
-0.6793496608734131,
0.5585827231407166,
-1.0842958688735962,
0.13052988052368164,
0.5434710383415222,
0.002475515939295292,
0.28103750944137573,
-1.2278465032577515,
-0.19517461955547333,
0.30868756771087646,
0.5038724541664124,
-0.3103432357311249,
0.653155326843261... |
async def send _ invitation ( self, ctx : ctx, invitee : str, mode : parse _ gamemode, main _ thinking _ time : parse _ td, fixed _ extra _ time : parse _ td, time _ increment _ per _ turn : parse _ td ) : invitee = self. bot. client. get _ user ( username = invitee ) ctx. session. send _ invitation ( invitee, main _ t... | [
-0.1878909319639206,
0.5568114519119263,
0.5574515461921692,
0.7943229675292969,
0.14712797105312347,
0.4619538486003876,
-0.1971340775489807,
0.21424467861652374,
-0.27532458305358887,
1.030274748802185,
-0.9584992527961731,
0.9565113186836243,
-0.6168627738952637,
-0.2303183674812317,
... |
def test _ large _ operation ( self ) : valid _ operation = " # " * singlerequestmessage. operation _ max _ length message = singlerequestmessage ( request _ id = " 0001 ", operation = valid _ operation, payload = " yay " ) # this shouldn't raise an error. write _ message ( message ) # now make it too big ( by one ). m... | [
-0.3262373208999634,
1.7895660400390625,
0.45468613505363464,
0.10249049961566925,
0.3380185663700104,
-0.04569001868367195,
0.7568696141242981,
0.5449153780937195,
0.8120626211166382,
-0.589977502822876,
0.02961830422282219,
-0.8832558393478394,
-0.21212488412857056,
0.15135276317596436,
... |
def bucketize ( vec, buckets ) : validate _ input ( isinstance ( vec, list ) and isinstance ( buckets, ( int, list ) ), \ " function takes a list of values, and either \ integer bucket number or list of boundaries " ) assignments = [ none for _ in range ( len ( vec ) ) ] if isinstance ( buckets, int ) : buckets = [ i /... | [
-1.2076443433761597,
0.3203623592853546,
0.959214448928833,
0.28356465697288513,
-0.40350109338760376,
-0.4337496757507324,
0.9049361944198608,
-0.30402299761772156,
-0.5838345885276794,
-0.07753077149391174,
-0.46243810653686523,
-0.6585642099380493,
-0.06583408266305923,
0.19387841224670... |
def settitle ( self, text ) : raise notimplementederror | [
-0.5418977737426758,
-0.35808265209198,
0.4074307680130005,
0.10789535939693451,
-0.7780189514160156,
0.5677922368049622,
-1.207465648651123,
0.12332500517368317,
0.3403080701828003,
0.30010977387428284,
-0.944340169429779,
-0.17678390443325043,
-0.6672965288162231,
0.16263097524642944,
... |
def _ _ init _ _ ( self, plist, center = np. array ( [ 0, 0 ] ), mtx = np. array ( [ [ 1, 0 ], [ 0, 1 ] ] ) ) : # parameter names assert len ( plist ) = = 2 self. params = [ k [ 0 ] for k in plist ] # ranges. self. llim = [ k [ 1 ] for k in plist ] self. rlim = [ k [ 2 ] for k in plist ] assert all ( np. array ( [ self... | [
-0.36448633670806885,
-0.306132048368454,
0.5361077189445496,
0.33436164259910583,
-0.22770076990127563,
0.6509845852851868,
-0.3665149509906769,
0.8647498488426208,
0.7235535383224487,
0.11951052397489548,
-0.6374121904373169,
-0.8898751735687256,
-0.3611305356025696,
0.04036892578005791,... |
def is _ fake ( node ) : return subgraphs. budget [ node ] = = np. inf | [
-0.08087552338838577,
1.462053656578064,
0.388953298330307,
1.4833916425704956,
0.03397295996546745,
-0.3944694399833679,
-0.29843461513519287,
-0.009305200539529324,
0.7748209238052368,
0.6065747737884521,
-0.8018333911895752,
0.6601948142051697,
-0.8183169960975647,
-0.1522754281759262,
... |
def aggregate _ dataframe ( df, interval ='daily') : return df. groupby ( df ['datetime']. map ( lambda x : x. date ( ) ) ). sum ( ) | [
-0.5015447735786438,
1.4257289171218872,
0.6102215647697449,
0.3884744644165039,
0.6377831697463989,
0.11572930961847305,
-0.014639884233474731,
0.07353949546813965,
-0.8851420283317566,
0.13076333701610565,
0.48738014698028564,
0.21121402084827423,
-0.028001459315419197,
-0.28524407744407... |
def show _ message ( self, msg ) : assert isinstance ( msg, ( str, unicode ) ) self. c _ instance. show _ message ( msg ) | [
0.13826358318328857,
0.7262083888053894,
0.20477481186389923,
-0.5154438614845276,
-0.6935572624206543,
0.36367544531822205,
0.7898648381233215,
0.3201390504837036,
0.24505619704723358,
-0.36179792881011963,
0.5925893783569336,
1.2919042110443115,
-0.8185352683067322,
1.1509653329849243,
... |
async def test _ sign _ endorse ( image _ config : imageconfig, image _ config _ signed : imageconfig, config _ digest _ canonical : str, config _ digest _ signed _ canonical : str, signature : str, ) : signer = fakesigner ( ) assert ( await image _ config. sign ( signer, signaturetypes. endorse ) = = signer. signature... | [
-0.7942793369293213,
0.08199989050626755,
0.6298069357872009,
0.24223172664642334,
-0.0993000790476799,
0.03680987283587456,
-0.02650441601872444,
0.5316526293754578,
-0.47435903549194336,
0.468951016664505,
-0.5944885611534119,
-0.44579610228538513,
0.030120665207505226,
0.710041701793670... |
def _ _ getitem _ _ ( self, idx ) : slide _ id = self. data _ df. image _ id. values [ idx ] isup _ grade = self. data _ df. isup _ grade. values [ idx ] if not self. use _ saved : mask = openslide. openslide ( os. path. join ( self. mask _ dir, f'{ slide _ id } _ mask. tiff') ) image = openslide. openslide ( os. path.... | [
-1.188703179359436,
0.5915395021438599,
0.7174263596534729,
0.02889912948012352,
0.4475650489330292,
-0.7292194366455078,
0.6889517903327942,
-0.3257732391357422,
0.7682070732116699,
0.12545602023601532,
-0.29222339391708374,
-0.18156708776950836,
0.4322924315929413,
-0.054500505328178406,... |
def get _ host _ location ( self, datapath _ id, in _ port, src _ ip, dst _ ip ) : src _ dpid = datapath _ id dst _ dpid = none source _ location = self. topology. retrieve _ dpid _ connected _ host ( src _ ip ) # check if inport of switch is the port that is connected with host if in _ port in self. topology. switch _... | [
-0.28780651092529297,
-0.41644012928009033,
0.6436136960983276,
-0.6425628066062927,
-0.32484257221221924,
0.2061024010181427,
0.09481459856033325,
0.12643221020698547,
-0.16014908254146576,
0.5149330496788025,
0.327661395072937,
0.3581334352493286,
0.23675720393657684,
-1.1875941753387451... |
def process _ y ( self, raw _ y _ batch ) : pass | [
-0.6446654200553894,
-1.0521968603134155,
0.6273504495620728,
0.8928083777427673,
0.43150705099105835,
0.05685119703412056,
0.5014111995697021,
0.12598326802253723,
-0.02265416830778122,
-0.8207159042358398,
-0.8295631408691406,
0.40196487307548523,
0.7024090886116028,
0.5329571962356567,
... |
def test _ changeset _ raises ( self ) : self. assertraises ( typeerror, node ) | [
-0.04341074079275131,
0.9505543112754822,
0.21728822588920593,
-0.6479149460792542,
0.34067246317863464,
0.21595895290374756,
-0.019924264401197433,
-0.6034801602363586,
-0.3309294283390045,
-0.03574993461370468,
0.028408288955688477,
1.0413161516189575,
-0.735653817653656,
0.8990851640701... |
def test _ valid _ read ( self ) : valid1 ='s0001004echo0000000b { " message " :'message = read _ message ( valid1, _ proto _ version ) self. assertisinstance ( message, streamrequestmessage ) self. assertequal ( message. request _ id, " 0001 " ) self. assertequal ( message. operation, " echo " ) self. assertequal ( me... | [
-0.10114608705043793,
0.1003713607788086,
0.7014069557189941,
0.5370872020721436,
-0.3613818883895874,
0.5432125926017761,
-0.6503813862800598,
-0.61695396900177,
0.21778590977191925,
-1.190840482711792,
0.7337917685508728,
0.1926695704460144,
-0.893700361251831,
-0.6391298174858093,
0.6... |
def test _ cancel _ booking _ from _ shopping _ basket _ ajax ( self ) : event = baker. make _ recipe ('booking. future _ pc') booking = baker. make _ recipe ('booking. booking ', event = event, user = self. user, paid = true ) assert booking. objects. count ( ) = = 1 url = reverse ('booking : delete _ booking ', args ... | [
0.44859564304351807,
0.6689830422401428,
0.5150306224822998,
1.975721836090088,
-0.6706814765930176,
0.7231578826904297,
0.26976993680000305,
1.177673101425171,
0.6846298575401306,
0.19400210678577423,
-0.29140424728393555,
-0.8046780228614807,
0.48617181181907654,
1.0800548791885376,
0.... |
def get _ ips _ in _ subnet ( subnet _ id ) : ips = slclient. call ('network _ subnet ','getipaddresses ', id = subnet _ id, mask = " id, ipaddress, isbroadcast, isgateway, isnetwork, isreserved, note " ) return ips | [
-0.4468153417110443,
0.2763126790523529,
0.28318464756011963,
0.5668362975120544,
0.5556325316429138,
-0.4067654609680176,
-1.055071234703064,
-0.0677398070693016,
0.5431303977966309,
0.23389317095279694,
-0.43514835834503174,
0.23423969745635986,
-0.5567096471786499,
-0.34887635707855225,... |
def exists ( cls, client ) : return cls. exists _ in ( get _ incident _ tabs ( client ) ) | [
0.5013585090637207,
-0.4497232735157013,
0.2475918084383011,
0.018862392753362656,
1.034686803817749,
0.872890830039978,
0.10832761973142624,
-0.03215494006872177,
-1.161521077156067,
-0.002128835069015622,
0.022672176361083984,
-0.3844417333602905,
-0.4653837978839874,
-0.6438601613044739... |
def all _ matching _ attributes ( pair : tuple, attributes : iterable ) - > bool : return all ( map ( partial ( matching _ attribute, pair ), attributes ) ) | [
-0.60402911901474,
0.23078377544879913,
0.44579243659973145,
0.8810108304023743,
-0.7880286574363708,
0.054431986063718796,
-0.7798420190811157,
1.085578441619873,
-0.9361951947212219,
0.33485522866249084,
0.4580160975456238,
-0.4784139096736908,
0.12765152752399445,
-0.4678160548210144,
... |
def status ( self, status ) : if status is none : raise valueerror ( " invalid value for ` status `, must not be ` none ` " ) # noqa : e501 allowed _ values = [ " active ", " canceled ", " past _ due ", " none " ] # noqa : e501 if status : if status not in allowed _ values : raise valueerror ( " invalid value for ` sta... | [
0.5609396696090698,
0.4038642346858978,
-0.22505082190036774,
0.47690996527671814,
-0.467618465423584,
0.3981283903121948,
0.08447480201721191,
0.8188706040382385,
0.3403455317020416,
-0.23028497397899628,
-0.5761104226112366,
-0.28881582617759705,
-0.030760113149881363,
0.0718632340431213... |
def filters ( self ) - > pulumi. output [ optional [ sequence ['outputs. networkpacketcapturefilter'] ] ] : return pulumi. get ( self, " filters " ) | [
-0.3854874074459076,
0.05939419940114021,
0.48146069049835205,
1.0383890867233276,
0.7235261797904968,
0.6337853074073792,
-0.13253973424434662,
-0.8989883661270142,
1.3945932388305664,
-0.40273457765579224,
-1.1774649620056152,
0.4591623544692993,
0.11537840217351913,
0.18365366756916046,... |
def v ( tag, message ) : # pylint : disable = invalid - name date = _ _ get _ date ( ) if log _ level _ stdout > = 4 : _ _ log _ to _ stdout ( colors. color _ verb, date, tag + " / v ", message ) if log _ level _ file > = 4 : _ _ log _ to _ file ( date, tag + " / v ", message ) | [
0.6385390758514404,
0.10284528881311417,
0.5791457295417786,
0.3747834861278534,
0.28848227858543396,
-0.55198734998703,
0.050112221390008926,
-1.006369948387146,
-0.9152987599372864,
0.03366163745522499,
0.504012405872345,
1.0988163948059082,
0.344637393951416,
0.848240852355957,
-0.038... |
def login _ required ( f ) : @ wraps ( f ) def login _ wrapped ( * args, * * kwargs ) : if'username'not in login _ session : return redirect ( url _ for ('showlogin') ) return f ( * args, * * kwargs ) return login _ wrapped | [
-1.190999984741211,
-0.5110682845115662,
0.6785528659820557,
0.24004341661930084,
-0.7189498543739319,
0.7464694380760193,
0.10703820735216141,
0.24890395998954773,
1.210799217224121,
0.04880937561392784,
0.31638696789741516,
0.34635454416275024,
0.842624843120575,
-0.13309508562088013,
... |
def constructbeerlisturl ( userid ) : return " http : / / www. ratebeer. com / user / " + str ( userid ) + " / beer - ratings / " | [
-0.7030600905418396,
-0.034515559673309326,
0.316672682762146,
0.08572476357221603,
-0.09752262383699417,
0.6588802933692932,
-0.6862733364105225,
0.6146106719970703,
-0.21683770418167114,
0.3508860766887665,
-0.8335767388343811,
0.27730420231819153,
-0.4490373730659485,
0.5460420250892639... |
def test _ successful _ update _ same _ user ( self ) : task = taskfactory ( creator = self. user, status = task. status. new ) url = reverse ('tasks : complete _ task ', kwargs = { " pk " : task. pk } ) response = self. client. post ( url, { } ) self. assertredirects ( response, reverse ('tasks : home'), status _ code... | [
0.3331643342971802,
0.6605251431465149,
0.7187853455543518,
1.4616471529006958,
-0.43745192885398865,
1.1490217447280884,
1.5704371929168701,
0.05443223565816879,
-0.019472090527415276,
-0.06705978512763977,
-1.1353906393051147,
-0.4065801203250885,
0.567864179611206,
0.09388776868581772,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.