text stringlengths 25 2.19k | embedding listlengths 768 768 |
|---|---|
def getoperationbyname ( self, name ) : for item in self. operations : if item. name = = name : return item raise keyerror ( " no operation named % s " % name ) | [
-0.005970440339297056,
0.36910638213157654,
0.4365401268005371,
0.15895305573940277,
-0.9066565036773682,
-0.6598158478736877,
0.629359245300293,
-1.5078200101852417,
-0.3087526559829712,
0.7727884650230408,
-0.16774149239063263,
-0.8388290405273438,
-0.12153757363557816,
-1.02671301364898... |
def _ concat _ list ( self, lst, new _ value ) : if lst is not none : if isinstance ( lst, list ) : return lst + [ new _ value ] else : return [ lst, new _ value ] else : return new _ value | [
-0.32738834619522095,
-0.5538700819015503,
0.5531204342842102,
0.8799867630004883,
-0.5335448384284973,
0.009267846122384071,
-1.8386391401290894,
0.6486907601356506,
0.83415687084198,
0.5182507634162903,
0.1417786329984665,
-0.11079813539981842,
-0.06145197153091431,
1.6723142862319946,
... |
def _ create _ cone _ based _ search _ algorithm ( model _ file, working _ dir, dichotomic _ search _ rel _ tol = 1e - 6, discrete _ objective _ indices = none, explore _ decision _ space = false, max _ num _ iterations = none, obj _ index _ 2 _ range = none, rel _ coverage _ gap = 0. 0, search _ model _ params _ file ... | [
0.1583908349275589,
-0.3726547658443451,
0.623454213142395,
0.6150673031806946,
-0.37815162539482117,
0.019886013120412827,
0.1711830496788025,
-0.3675692677497864,
-0.45632779598236084,
0.8311423659324646,
-0.04764793813228607,
0.14605563879013062,
0.11093007773160934,
-0.2880800366401672... |
def test _ insert _ curly _ braces ( self ) : self. insert _ rows ( ) band. insert ( band ( name = " { } ", popularity = 100 ) ). run _ sync ( ) response = band. select ( band. name ). run _ sync ( ) names = [ i [ " name " ] for i in response ] self. assertin ( " { } ", names ) | [
-0.42803099751472473,
0.6689911484718323,
0.43606576323509216,
0.499971866607666,
0.2444603443145752,
0.8872707486152649,
-0.02667965367436409,
-0.6905738711357117,
-0.10563939064741135,
0.29862383008003235,
-1.086402416229248,
-0.23233622312545776,
-1.291295051574707,
0.5306829214096069,
... |
def getddgexternaloutputtime ( index ) : andor _ solis. getddgexternaloutputtime. restype = ctypes. c _ uint # in picoseconds delay = ctypes. c _ uint64 ( ) width = ctypes. c _ uint64 ( ) result = andor _ solis. getddgexternaloutputtime ( ctypes. c _ ulong ( index ), ctypes. byref ( delay ), ctypes. byref ( width ) ) c... | [
-1.082879900932312,
0.869812548160553,
0.8889674544334412,
-0.7427151203155518,
-1.367004632949829,
-0.7389507293701172,
0.801609218120575,
-0.5597971677780151,
0.3939783573150635,
0.18633179366588593,
-0.2649381458759308,
-0.4265921115875244,
-0.5301397442817688,
0.11746122688055038,
0.... |
def initevolutionvector ( self ) : return ( np. array ( [ self. getdelay ( x ) for x in self. edges ] ) ) | [
0.20070573687553406,
0.09386265277862549,
0.6223962306976318,
0.19291013479232788,
0.4034653306007385,
-0.20206715166568756,
0.093411885201931,
0.06177442520856857,
0.3395332098007202,
0.2718525230884552,
-0.7883743643760681,
0.782850980758667,
0.7215772271156311,
0.29401499032974243,
-0... |
def csv ( value ) : return value. split ( ',') | [
-0.19920876622200012,
0.11230401694774628,
0.3449253439903259,
0.19079038500785828,
-0.005972163751721382,
-0.3328621983528137,
-1.2777888774871826,
0.556564211845398,
0.594862699508667,
0.09116854518651962,
-0.2211712896823883,
0.6176044940948486,
0.194474458694458,
-0.9748566150665283,
... |
def _ get _ secgroups _ from _ port _ list ( self, ports, neutron ) : def _ chunk _ by _ ids ( sg _ ids, limit ) : sg _ id _ list = [ ] for sg _ id in sg _ ids : sg _ id _ list. append ( sg _ id ) if len ( sg _ id _ list ) > = limit : yield sg _ id _ list sg _ id _ list = [ ] if sg _ id _ list : yield sg _ id _ list # ... | [
-0.5001257061958313,
0.8989737033843994,
0.29159581661224365,
-0.2913060486316681,
0.08690739423036575,
-0.6425867080688477,
-0.6714632511138916,
-0.6916289329528809,
-0.13301190733909607,
0.39449095726013184,
-0.7653202414512634,
0.3328149914741516,
-0.7531802654266357,
0.1770652085542678... |
def change _ block _ 3 ( self ) : cntsrc = 0 notemode = " " noteimp = " " notephys = " " notefmesh = " " commentout = false # we toggle this to determine whether or not to # comment out continued lines com = " c $ " # using $ avoids issue with long lines. sourcecards = [ " sdef ", " si ", " sp ", " sb ", " sc ", " ds "... | [
0.20740021765232086,
-0.4085051119327545,
0.8800753355026245,
-0.5481036305427551,
-0.40473395586013794,
-0.348091721534729,
-0.03474419564008713,
0.17930184304714203,
-0.23344621062278748,
0.6648908853530884,
-0.21875230967998505,
0.4341869652271271,
-0.2356305718421936,
0.285062313079834... |
def main ( args ) : # if swag = = over. 9000 : if args : with open ( sharedvars. shoppath, " r " ) as shopfile : # open shop shopjson = json. load ( shopfile ) with open ( sharedvars. pppath, " r " ) as ppfile : ppjson = json. load ( ppfile ) with open ( sharedvars. inventorypath, " r " ) as inventoryfile : invjson = j... | [
-0.8615155816078186,
-0.7819463014602661,
1.0157711505889893,
0.5582650899887085,
-0.300424724817276,
0.03589498996734619,
0.3930199444293976,
0.27553942799568176,
0.4488704204559326,
0.4539915919303894,
-0.5446619391441345,
0.2799374461174011,
-0.011763942427933216,
0.04299924522638321,
... |
def run _ samtools _ stats ( bam _ path, reference _ path, cmd _ args, working _ dir ) : stats _ path = os. path. join ( working _ dir,'sequencing _ stats. txt') cmd ='samtools stats % s - - reference % s % s'% ( cmd _ args, reference _ path, bam _ path ) with open ( stats _ path,'w') as out _ file : subprocess. check ... | [
1.2339578866958618,
-0.5666772723197937,
0.9048640131950378,
-0.2307949662208557,
0.4925997853279114,
0.3618173599243164,
0.6287445425987244,
-1.0701020956039429,
-0.10839740931987762,
0.07126068323850632,
1.0524117946624756,
0.715499758720398,
0.2603199779987335,
-0.3648160696029663,
0.... |
def main ( ) : grid = [ " x xxxxxxxxxxxxxxxxxx ", " x x x x ", " x xxxxx xxxx xxx xxx ", " x x x x x ", " x xxxxxxxxxxxx x x x ", " x x x x x x ", " x xxx xxxxxx xxxxx x ", " x xxx x x x x ", " x xxx xxxxx ", " x xxx xxxxxx x ", " x xxx x x x x x ", " xxx xxx x x xxxx x x ", " x x x xx x x x ", " xxxxx xxxx x xxx ", " ... | [
1.0602450370788574,
0.001530274748802185,
1.1137672662734985,
0.47389158606529236,
0.30312058329582214,
0.24260349571704865,
0.9249519109725952,
-0.442244291305542,
0.07210512459278107,
0.5497575998306274,
0.0280744731426239,
0.20725415647029877,
-0.6616886854171753,
-0.07143625617027283,
... |
def stop ( self ) : print ( " stopping... " ) self. _ listening = false | [
-0.2933213710784912,
-0.868499219417572,
-0.0731411799788475,
-0.8175157904624939,
0.5374833345413208,
1.3211936950683594,
0.6165814399719238,
0.42065638303756714,
-1.4705092906951904,
-0.40167132019996643,
0.11865674704313278,
0.7059392929077148,
-1.349208950996399,
0.08911250531673431,
... |
def get _ base ( with _ query = false ) : if with _ query : # adds query property to models - enables ` user. query. query _ method ( ) ` base. query = db _ session. query _ property ( ) return base | [
-0.17928598821163177,
-0.8165135383605957,
0.41395390033721924,
0.7273604273796082,
0.22019071877002716,
-0.11038344353437424,
-0.04299110546708107,
-0.9236583113670349,
0.2759292423725128,
0.24885329604148865,
0.661939263343811,
-0.6127481460571289,
-0.3634372651576996,
-0.361789554357528... |
def redirect _ to _ terms _ accept ( current _ path = " / ", slug = " default " ) : redirect _ url _ parts = list ( urlparse ( accept _ terms _ path ) ) if slug! = " default " : redirect _ url _ parts [ 2 ] + = slug + " / " querystring = querydict ( redirect _ url _ parts [ 4 ], mutable = true ) querystring [ terms _ r... | [
-0.6433669328689575,
-0.7653716802597046,
0.48537057638168335,
-0.3589209020137787,
-0.012874097563326359,
0.3831561505794525,
0.5332951545715332,
0.3536674678325653,
-0.3602761924266815,
-0.08802209049463272,
0.31670060753822327,
0.07985754311084747,
-0.21096386015415192,
-0.6411632895469... |
def _ mgui _ set _ max ( self, value : float ) : self. _ update _ precision ( maximum = value ) val = self. _ pre _ set _ hook ( value ) self. _ qwidget. setmaximum ( val ) | [
-0.3081834614276886,
0.22153647243976593,
0.6567496061325073,
0.43021225929260254,
-0.09372633695602417,
0.4446794092655182,
-0.3222435414791107,
-0.47257739305496216,
-0.2856942117214203,
0.20766465365886688,
-0.09479258954524994,
-0.010023903101682663,
0.4045626223087311,
0.5799809694290... |
def cidr _ blocks ( self ) - > optional [ pulumi. input [ sequence [ pulumi. input [ str ] ] ] ] : return pulumi. get ( self, " cidr _ blocks " ) | [
0.4979664087295532,
0.34152206778526306,
0.2723403573036194,
1.0189766883850098,
1.127363920211792,
1.0902291536331177,
0.18160071969032288,
-0.19683387875556946,
0.6284335255622864,
0.5143001079559326,
-1.1654565334320068,
0.05808285251259804,
-1.1684584617614746,
-1.1962586641311646,
-... |
def process _ page ( event, context ) : for r in event [ " records " ] : if ( " s3 " in r and " object " in r [ " s3 " ] and " key " in r [ " s3 " ] [ " object " ] and " bucket " in r [ " s3 " ] and " arn " in r [ " s3 " ] [ " bucker " ] ) : pages. process _ page ( r [ " s3 " ] [ " bucker " ] [ " arn " ], r [ " s3 " ] ... | [
0.2107003778219223,
-1.1361408233642578,
0.6692381501197815,
-0.18491914868354797,
0.648487389087677,
-0.2020915448665619,
-0.3907991647720337,
0.42051050066947937,
0.1222391203045845,
0.5671198964118958,
-0.12443015724420547,
-0.0660734623670578,
0.48995399475097656,
0.28270602226257324,
... |
def _ _ init _ _ ( self, name : str, output _ stride : dict, in _ dim = 3, pretrained = true ) : super ( resnetibnbuilder, self ). _ _ init _ _ ( ) self. _ name = name self. _ pretrained = pretrained self. _ resnet _ map = {'resnet50 _ ibn _ a': resnet50 _ ibn _ a,'resnet101 _ ibn _ a': resnet101 _ ibn _ a,'resnet152 _... | [
-0.09150925278663635,
-0.1277601420879364,
0.7032890319824219,
1.047317385673523,
-0.3050864338874817,
0.32545316219329834,
0.6296471953392029,
0.3561858534812927,
-0.26730862259864807,
-0.203491672873497,
-1.0535905361175537,
-0.23964758217334747,
0.009545900858938694,
-0.6879412531852722... |
def is _ valid _ code ( self, code ) : return self. _ _ temple _ to _ abrev. get ( code ) is not none | [
-1.0394346714019775,
0.8340442180633545,
0.5564831495285034,
-0.1336309313774109,
0.10070069134235382,
0.44062143564224243,
0.32146701216697693,
-0.15560975670814514,
1.0911924839019775,
0.4134126901626587,
0.1876646727323532,
0.08796747773885727,
-0.028906308114528656,
0.28745198249816895... |
def gettrainbatch ( self ) : if self. totalepochs > = self. options. trainingepochs : return none, none endindex = self. currentindex + self. options. batchsize if self. options. sequentialfetch : # fetch the next sequence of images self. indices = np. arange ( self. currentindex, endindex ) if endindex > self. totalim... | [
-1.552096962928772,
-0.46791166067123413,
0.6180924773216248,
-0.45561641454696655,
-0.3690487742424011,
-0.1157342717051506,
0.42499881982803345,
-0.31864529848098755,
0.021761363372206688,
0.093045175075531,
-0.0619642399251461,
0.054602012038230896,
0.033665139228105545,
0.2368628978729... |
def frexp ( arg, queue = none ) : sig = arg. _ new _ like _ me ( queue = queue ) expt = arg. _ new _ like _ me ( queue = queue ) _ frexp ( sig, expt, arg, queue = queue ) return sig, expt | [
0.009443788789212704,
0.26534217596054077,
0.4707210659980774,
-0.03314882144331932,
-1.2316124439239502,
-0.9225806593894958,
0.11744406819343567,
0.22726815938949585,
0.2554377019405365,
0.0903472900390625,
-1.1028872728347778,
0.0928528755903244,
-0.42987915873527527,
1.1446162462234497... |
def defaultsearch ( baseurl, params ) : global api _ request _ count try : # get request sent to google r = requests. get ( baseurl, params = params ) api _ request _ count + = 1 # response in json format converted into a dictionary response = eval ( r. text ) return response except exception as e : print ( " error for... | [
-1.6266355514526367,
-0.26600828766822815,
0.4171242117881775,
-0.1668156236410141,
0.7507631778717041,
0.020079031586647034,
-0.6672325730323792,
-0.32274535298347473,
-1.0310924053192139,
0.2668481469154358,
-0.33991020917892456,
0.05553529039025307,
-0.8405936360359192,
0.16378490626811... |
def find _ config _ file ( filename : str, dirs : list = none ) - > str : script _ dir = os. path. dirname ( os. path. abspath ( filename ) ) default _ dirs = ['/ etc / ehos / ','/ usr / local / etc / ehos ','/ usr / local / etc / ', " { } /.. / etc ". format ( script _ dir ),'etc / ','etc / ehos ','/ usr / share / eho... | [
-0.07871575653553009,
0.22315062582492828,
0.8319096565246582,
0.44393813610076904,
0.057711780071258545,
-0.33549824357032776,
0.9872252941131592,
0.34918200969696045,
-0.5302047729492188,
0.6289955973625183,
0.3087102770805359,
-0.8894939422607422,
-0.32054850459098816,
1.497370362281799... |
def importcsv ( csvfilepath, delimiterchar = ", ", ignorefirstrow = false ) : data = [ ] with open ( csvfilepath,'rb') as csvfile : csvreader = csv. reader ( csvfile, delimiter = delimiterchar ) for index, row in enumerate ( csvreader ) : if ignorefirstrow : ignorefirstrow = false continue data. append ( row ) csvfile.... | [
0.33068934082984924,
-0.3407836854457855,
0.6791946887969971,
0.6806381344795227,
-0.09769143164157867,
0.869642436504364,
0.035080596804618835,
0.5190870761871338,
0.6938374042510986,
0.47875791788101196,
-0.388269305229187,
-0.09993649274110794,
-0.34867921471595764,
-0.2231045514345169,... |
def _ getapplicablefeatures ( self, script, langsys ) : # first check to see if this has already been found if ( script, langsys ) in self. _ applicablefeaturecache : return self. _ applicablefeaturecache [ script, langsys ] scriptlist = self. scriptlist # 1. find the appropriate script record scriptrecords = scriptlis... | [
-0.43758976459503174,
-0.49966883659362793,
0.8880457282066345,
0.027173202484846115,
-0.2899101674556732,
-1.2944730520248413,
-0.46053874492645264,
0.513022243976593,
0.2949313223361969,
0.20389814674854279,
-0.3962063491344452,
0.7272088527679443,
-0.024162791669368744,
0.76312869787216... |
def set ( self, value = 1. 0 ) : self. current _ value = float ( value ) self. current _ value = max ( min ( self. current _ value, self. max _ value ), 0. 0 ) # clean the output print ( self. printed _ characters *'\ r ', end ='', flush = true ) # print the current status percentage = min ( self. current _ value / sel... | [
0.17158617079257965,
-0.23601405322551727,
0.4753947854042053,
-0.4025249481201172,
-0.551981508731842,
0.6617973446846008,
0.5660643577575684,
-0.4775833487510681,
-0.9960038661956787,
-0.022475119680166245,
0.4805687367916107,
0.5736290812492371,
-0.4135133624076843,
0.902437150478363,
... |
def db _ path ( cls ) : path ='static / uploads /'return path | [
-0.013640375807881355,
-0.14802472293376923,
0.5186742544174194,
0.6919578313827515,
0.6128131151199341,
1.2098485231399536,
0.8470923900604248,
-0.2053663581609726,
-0.741460382938385,
0.3534655272960663,
-0.10884514451026917,
-0.40267181396484375,
-0.9579049348831177,
0.5601520538330078,... |
def sentence ( self ) : return self. _ sentence | [
0.3022192716598511,
-0.8105678558349609,
0.3568029999732971,
0.40404215455055237,
0.029866201803088188,
-0.4874212145805359,
0.6114796996116638,
-0.3422403633594513,
0.08039636164903641,
-0.14256206154823303,
0.26263192296028137,
-0.5477437376976013,
-1.1507078409194946,
-0.168555080890655... |
def wait _ for _ user _ menu ( self ) : return self. wait _ for _ element _ to _ be _ clickable ( self. user _ menu, message ='user menu is not clickable') | [
-1.0453145503997803,
0.2539443075656891,
0.3321722447872162,
1.2625033855438232,
-0.33654534816741943,
0.2652061879634857,
0.353735089302063,
0.31857308745384216,
-0.6113864183425903,
-0.8250666260719299,
0.12132242321968079,
-0.03541180491447449,
-0.7949146032333374,
-0.31021055579185486,... |
def _ _ init _ _ ( self, bucket _ name, aws _ access _ key _ id = none, aws _ secret _ access _ key = none, max _ workers = 1, * * kwargs ) : super ( bases3changesprocessor, self ). _ _ init _ _ ( * * kwargs ) s3 = boto3. resource ('s3 ', aws _ access _ key _ id = aws _ access _ key _ id, aws _ secret _ access _ key = ... | [
0.3008959889411926,
0.7270938754081726,
0.7374472618103027,
-0.44861993193626404,
-0.028661733493208885,
-0.3482806086540222,
-0.37041187286376953,
0.7080903053283691,
0.4880662262439728,
0.3638157248497009,
-0.5902376174926758,
0.6861072182655334,
0.061024148017168045,
0.20698559284210205... |
def parse ( self ) : for line in self. data : row = line. strip ( ). split ( ) instance = gamblercupinstance ( ) instance. x = int ( row [ 0 ] ) instance. y = int ( row [ 1 ] ) self. instances. append ( instance ) | [
-1.0243111848831177,
0.3637819290161133,
0.3697810471057892,
-1.014298915863037,
0.21108651161193848,
0.198383629322052,
-0.2915876507759094,
0.8663495182991028,
-0.6110752820968628,
0.2844599783420563,
0.07089092582464218,
-0.5177062749862671,
-0.3141363263130188,
-0.2568272650241852,
0... |
def validate _ use _ of _ extended _ x _ char _ for _ counterparty ( mt _ message ) : mt _ type ='' bic _ list = [ ] error _ str ='' destinationparty = none destinationaddress = none def checkbackofcobject ( acm _ obj ) : backofcobj = none for extobj in acm _ obj. externalobjects ( ) : if extobj. integrationtype ( ) = ... | [
0.510484516620636,
-0.38701510429382324,
0.947762668132782,
-0.7165712714195251,
-0.12305516004562378,
-0.751059353351593,
0.8219477534294128,
-0.3086540102958679,
-0.510269820690155,
0.596027672290802,
0.1970835030078888,
0.5849741697311401,
-0.2691487967967987,
-0.06985218077898026,
0.... |
def test _ addcallbacksonlycallsone ( self ) : sd = synchronousdeferred ( " foo " ) failures = [ ] sd. addcallbacks ( lambda r : 1 / 0, failures. append ) self. assertequals ( failures, [ ] ) | [
0.5251683592796326,
1.574959635734558,
0.5285542607307434,
0.8846697211265564,
0.8907503485679626,
0.682450532913208,
-0.4229964315891266,
-0.4342796504497528,
1.1818758249282837,
-1.5922805070877075,
-0.9441226720809937,
-0.2832617163658142,
-0.30156928300857544,
2.0971763134002686,
0.3... |
def cast ( * args ) : return _ itksmoothingrecursivegaussianimagefilterpython. itksmoothingrecursivegaussianimagefilteriul3iul3 _ cast ( * args ) | [
0.11183403432369232,
0.2925903797149658,
0.37801775336265564,
-0.4164367616176605,
-0.15068663656711578,
1.543063759803772,
-0.20711897313594818,
-0.17953911423683167,
0.6698075532913208,
0.16892915964126587,
-0.00209845881909132,
0.7875866889953613,
-0.6627549529075623,
0.3379896283149719... |
def load _ solvers ( self, force _ update : bool = false ) - > none : solvers = { } if not force _ update : try : with open ( os. path. join ( self. dataset, " solvers. json " ), " r " ) as fsolvers : solvers = json. load ( fsolvers ) logger. info ( " read solvers. json dataset " ) except filenotfounderror : logger. in... | [
-1.1410783529281616,
-0.7006908655166626,
0.666391909122467,
-1.0455900430679321,
0.16150420904159546,
-0.42837706208229065,
-0.39789843559265137,
-0.32720959186553955,
-0.5613809823989868,
0.2149355262517929,
-0.8362591862678528,
0.21376579999923706,
-0.2895226776599884,
0.542219877243042... |
def _ create _ lun ( self, volume ) : lun _ type ='0'v = self. vmem _ vip log. info ( _ ( " creating lun % ( name ) s, % ( size ) s gb " ) % volume ) # todo ( rdl ) : thin luns are not supported in 5. x, so this # will not work ( not sure if backend will ignore the flag ) # if self. config. use _ thin _ luns : lun _ ty... | [
0.18877169489860535,
-0.7352532744407654,
0.5871939659118652,
-0.11664443463087082,
0.8038293123245239,
-0.07221738249063492,
-0.018454857170581818,
-0.07277513295412064,
0.580632209777832,
-0.19742590188980103,
-1.1103817224502563,
0.38602301478385925,
-0.6807823181152344,
-0.359457999467... |
def shepard _ interpolant ( xs, ys, zs, xi, yi, power = 0. 0, eps = 1e - 7, modified = false, d = 25e3, l = 500e3 ) : # - - remove singleton dimensions xs = np. squeeze ( xs ) ys = np. squeeze ( ys ) zs = np. squeeze ( zs ) xi = np. squeeze ( xi ) yi = np. squeeze ( yi ) # - - number of data points npts = len ( zs ) # ... | [
-0.2556493282318115,
0.003115701721981168,
0.9370514750480652,
-1.0629349946975708,
-0.27386415004730225,
0.058420199900865555,
-0.7134739756584167,
0.10841105133295059,
0.09327011555433273,
0.5743624567985535,
0.11791922897100449,
0.7212657332420349,
-0.31805846095085144,
0.10846565663814... |
def memory _ state _ machine ( card _ idx ) : global state global first _ card _ idx global second _ card _ idx global turns # first click if state = = 0 : # register first exposed card first _ card _ idx = card _ idx state = 1 # even clicks elif state = = 1 : # register second exposed card second _ card _ idx = card _... | [
-0.6744672060012817,
0.2934388816356659,
0.6309328675270081,
-1.2929812669754028,
0.18553605675697327,
-0.4504595696926117,
0.33460626006126404,
0.40702199935913086,
0.47714754939079285,
-0.12775962054729462,
-0.24427981674671173,
0.607465386390686,
0.014661399647593498,
0.324461966753006,... |
async def test _ datadisk _ migrate _ between _ external _ renames ( coresys : coresys, all _ dbus _ services : dict [ str, dbusservicemock | dict [ str, dbusservicemock ] ], os _ available, ) : sdb1 _ partition _ service : partitionservice = all _ dbus _ services [ " udisks2 _ partition " ] [ " / org / freedesktop / u... | [
-0.2483803927898407,
0.9513221979141235,
1.0228419303894043,
0.5564450621604919,
0.016475556418299675,
0.4011678695678711,
-0.5409680604934692,
-0.531107485294342,
0.18089452385902405,
-0.5014353394508362,
-0.5940850973129272,
0.5701767206192017,
0.16074159741401672,
0.16351865231990814,
... |
def ldap _ authenticate ( self, user, password ) : dn = " uid = " + user + ldapserver. _ base _ dn try : self. server. simple _ bind _ s ( dn, password ) response = true except ldap. ldaperror : response = false return response | [
-1.3712735176086426,
-0.45822227001190186,
0.6478835344314575,
0.01505734771490097,
-0.9789865612983704,
0.5499528646469116,
-0.6996971368789673,
-0.1600096970796585,
1.3058512210845947,
-0.4468817412853241,
-0.8440245389938354,
0.4365823566913605,
-0.5671420097351074,
-0.15840458869934082... |
def draw ( self, npts ) : raise exception ( " this is the base region class! use a subclass " ) | [
-0.3915948271751404,
-0.05520409718155861,
0.1614694595336914,
-0.11386331915855408,
0.37642940878868103,
1.1786893606185913,
0.22044819593429565,
-0.6539402604103088,
0.5678605437278748,
-1.3516888618469238,
-0.06443900614976883,
-0.21997369825839996,
-0.6712677478790283,
0.72423595190048... |
def cast ( event ) : a = np. zeros ( ( len ( event ), 5 ) ) for i, p in enumerate ( event ) : a [ i, 3 ] = p [ 0 ] a [ i, 0 ] = p [ 1 ] a [ i, 1 ] = p [ 2 ] a [ i, 2 ] = p [ 3 ] a [ i, 4 ] = p [ 4 ] return ( a ) | [
-0.6226933598518372,
-1.0842682123184204,
0.7781555652618408,
-0.722076416015625,
0.6894356608390808,
0.3892594277858734,
0.7418488264083862,
-0.5776866674423218,
1.0753188133239746,
1.3168065547943115,
-0.27861708402633667,
0.7385158538818359,
-0.6866484880447388,
0.010806731879711151,
... |
def get _ wd ( self ) : return self. wd | [
0.25396400690078735,
-0.5295490026473999,
0.5527357459068298,
0.17025960981845856,
-0.04396817460656166,
0.3304888606071472,
0.7402886152267456,
-0.738657534122467,
-0.034647226333618164,
-1.8695977926254272,
1.4302499294281006,
0.9550319314002991,
-0.717392086982727,
0.3117486536502838,
... |
def decrypt _ with _ padding ( key, ciphertext, use _ padding = true ) : # type : ( bytes, bytes, bool ) - > tuple if len ( key )! = 16 and len ( key )! = 32 and len ( key )! = 24 : return false, b " " ciphertext _ not _ b64 = utils. base64 _ decode ( ciphertext ) plaintext _ padded = aes. new ( key, aes. mode _ ecb ).... | [
0.034458354115486145,
1.4119240045547485,
0.7394171357154846,
0.015940524637699127,
-0.19198627769947052,
0.5473851561546326,
-0.6095026135444641,
0.20840169489383698,
0.03150951489806175,
1.0491156578063965,
-0.9140765070915222,
-0.9426215291023254,
-0.609044075012207,
0.3230501115322113,... |
def _ _ getitem _ _ ( self, idx ) : if type ( idx ) = = slice : return self. vec [ idx ] if idx > = len ( self. vec ) or idx < ( - 1 ) * len ( self. vec ) : raise indexerror ( " getitem : index out of range " ) return self. vec [ idx ] | [
-0.15952076017856598,
0.01211011502891779,
0.5259333252906799,
0.22322608530521393,
-0.3894486129283905,
0.14536647498607635,
0.5214151740074158,
-1.3009529113769531,
0.33742472529411316,
-0.714261531829834,
1.1404143571853638,
0.8527748584747314,
-0.07615596801042557,
-0.996464729309082,
... |
def compose _ network ( self, subbook ) : for source in subbook. network. weights : # for every source in the weights dict of each subbook network for target in subbook. network. weights [ source ] : # for every target in the weights dict of each subbook network self. add _ weight ( source, target, subbook. network. we... | [
-0.5613267421722412,
-0.6313026547431946,
0.5428403615951538,
1.085219383239746,
0.7305276393890381,
0.3305385410785675,
0.20763014256954193,
-0.176823690533638,
-0.6740509271621704,
-0.3232785761356354,
-0.4683518409729004,
-0.9154140949249268,
-0.003632576670497656,
1.0273457765579224,
... |
def get ( org _ id ) : try : response, status = affidavitservice. find _ affidavit _ by _ org _ id ( org _ id = org _ id ), \ http _ status. http _ 200 _ ok except businessexception as exception : response, status = {'code': exception. code,'message': exception. message }, exception. status _ code return response, stat... | [
0.6894379258155823,
-0.14745911955833435,
0.4010564684867859,
-0.18883539736270905,
0.11986023187637329,
-0.19526535272598267,
-0.04721955209970474,
0.24146200716495514,
-0.06330464035272598,
0.7917190194129944,
0.5425302982330322,
1.505842924118042,
-0.30707916617393494,
0.621429085731506... |
def nolazy ( self ) : self. data = np. array ( self. data ) self. labels = np. array ( self. labels ) self. dist = np. array ( self. dist ) | [
0.14905594289302826,
-0.8452728986740112,
0.17246122658252716,
-1.5495202541351318,
0.4442686140537262,
0.014740205369889736,
-0.06435704231262207,
0.4753762185573578,
-0.22238266468048096,
-0.44425520300865173,
-0.7617818713188171,
0.7895914316177368,
0.020534573122859,
0.1140354722738266... |
def random _ enemies ( self, initials ) : for initial in initials : position, name = initial enemy = enemy ( 5. 5, 3., name = name, position = position, orientation = pi ) pursue _ behaviors = [ behavior ( character = enemy, target = self. main _ character, args = {'characters _ sight': 30. }, * * pursue ), ] evade _ b... | [
-1.0160436630249023,
-0.11458933353424072,
0.6809194684028625,
-0.4079495966434479,
0.6763140559196472,
0.21876873075962067,
0.22147643566131592,
-0.8385863900184631,
0.21142923831939697,
0.31477975845336914,
-0.4574756622314453,
0.15634086728096008,
-0.22761116921901703,
0.329278141260147... |
def isequal ( self, * args ) : return _ topods. topods _ shape _ isequal ( self, * args ) | [
-0.8050162196159363,
-0.1523951292037964,
0.5690462589263916,
0.34344714879989624,
1.2810802459716797,
0.57900470495224,
0.49659910798072815,
-0.8136914968490601,
-0.008061645552515984,
0.7705346345901489,
-0.7056325078010559,
-0.4115369915962219,
-0.6935027837753296,
0.0723116546869278,
... |
def _ flight _ connection _ handler ( self, airport : str, states _ dict : dict [ str, statevector ], get _ flight _ connections _ handler : callable ) - > list [ airtrafficdatatype ] : flight _ connections = get _ flight _ connections _ handler ( airport ) flight _ connections _ dict = { fc. icao24 : fc for fc in flig... | [
-0.2519475817680359,
-0.4833958148956299,
0.7077551484107971,
0.18183211982250214,
0.23086589574813843,
-0.2872740626335144,
-0.8071624040603638,
0.033654630184173584,
0.20456437766551971,
-0.5715429186820984,
0.2332407534122467,
-0.6881327629089355,
0.7790124416351318,
0.5394373536109924,... |
def get _ config _ path ( ) : global config _ path if not config _ path : config _ path = _ set _ default _ config _ path ( ) return config _ path | [
-0.3371542990207672,
0.3546062409877777,
0.3502863347530365,
1.528993844985962,
0.6798849105834961,
-0.32860255241394043,
1.2226390838623047,
0.6839599609375,
-0.9660373330116272,
0.4018789827823639,
-0.08252015709877014,
-0.35394132137298584,
-1.0868630409240723,
0.705150842666626,
1.44... |
def add _ car ( self ) : possible _ directions = {'h': ['l ','r'],'v': ['u ','d'] } starting _ points = {'l': ( self. right, self. top + self. buffer ),'r': ( self. left, self. bottom - self. buffer - 15 ),'u': ( self. right - self. buffer - 15, self. bottom ),'d': ( self. left + self. buffer, self. top ) } direction =... | [
-0.5742658972740173,
-0.032546114176511765,
0.6935999393463135,
-0.4490428566932678,
0.6522220969200134,
0.8958492279052734,
-0.3576313257217407,
-0.41302016377449036,
0.18090267479419708,
-0.30607151985168457,
-0.8114646673202515,
0.12099889665842056,
-0.6896281838417053,
-0.1436714231967... |
def prepare _ data ( dataset _ path ) : x _ train, y _ train = readucr ( dataset _ path +'_ train') x _ test, y _ test = readucr ( dataset _ path +'_ test') nb _ classes = len ( np. unique ( y _ test ) ) y _ train = ( y _ train - y _ train. min ( ) ) / ( y _ train. max ( ) - y _ train. min ( ) ) * ( nb _ classes - 1 ) ... | [
-0.2826220393180847,
0.49256432056427,
0.5954424142837524,
-0.608271062374115,
0.225404754281044,
-0.20927774906158447,
0.2480505406856537,
0.2669346332550049,
-0.32129013538360596,
-0.05925541743636131,
-0.45186281204223633,
0.04807932674884796,
0.7835027575492859,
-0.5617923140525818,
... |
def validate _ client _ secret ( self, client _ id, client _ secret ) : app = oauthclient. find ( client _ id ) if app is not none and app. secret = = client _ secret : return true return false | [
1.4454728364944458,
-0.8803724646568298,
0.39996227622032166,
0.465923011302948,
0.23027746379375458,
0.32768434286117554,
-0.7226973176002502,
-1.1727532148361206,
-0.19891905784606934,
0.5533936023712158,
-0.4843195676803589,
0.5200572609901428,
-0.2721409201622009,
0.06627088040113449,
... |
def train _ tfidf ( self ) : def dummy _ function ( doc ) : return doc tfidf _ vec = tfidfvectorizer ( tokenizer = dummy _ function, preprocessor = dummy _ function, token _ pattern = none, encoding = self. train _ params [ " vectorizer _ encoding " ], decode _ error = self. train _ params [ " vectorizer _ decode _ err... | [
0.28567129373550415,
0.40605810284614563,
0.5662542581558228,
0.0308088306337595,
0.14845578372478485,
-0.1418590545654297,
0.70079106092453,
0.37851327657699585,
-0.7948237657546997,
-0.058754824101924896,
0.1272840052843094,
0.6775305867195129,
-0.08222810924053192,
0.3017628788948059,
... |
def bin _ open ( img : np. ndarray, disk _ size : int ) - > np. ndarray : selem = disk ( disk _ size ) res = binary _ opening ( img, selem ) return res | [
-1.0914711952209473,
-0.3950652778148651,
0.44243040680885315,
0.5909769535064697,
-0.16136303544044495,
-0.2387194037437439,
0.7558000087738037,
0.07754780352115631,
0.10621332377195358,
-0.2112923413515091,
0.10876317322254181,
0.10451396554708481,
0.22048743069171906,
0.0943195596337318... |
def _ weights _ init ( m ) : if isinstance ( m, nn. linear ) or isinstance ( m, nn. conv2d ) : init. kaiming _ normal _ ( m. weight ) | [
0.14760924875736237,
0.1756048947572708,
0.4937824308872223,
1.2260653972625732,
-0.6752532720565796,
-0.36556753516197205,
0.03696942701935768,
-0.28499510884284973,
-0.41895607113838196,
0.001573983347043395,
0.3798728883266449,
-0.5213581323623657,
-0.463683545589447,
1.4742180109024048... |
def remove _ interfaces _ from _ vm _ task ( self, virtual _ machine, filter _ function = none ) : device _ change = [ ] for device in virtual _ machine. config. hardware. device : if isinstance ( device, vim. vm. device. virtualethernetcard ) and \ ( filter _ function is none or filter _ function ( device ) ) : nicspe... | [
0.0682728961110115,
0.6091952919960022,
0.7983980774879456,
0.7309355139732361,
-0.3706182837486267,
-0.7071182727813721,
0.6079548001289368,
0.8638539910316467,
0.0256098210811615,
1.2797164916992188,
-0.5631881356239319,
0.14451242983341217,
-0.9433562159538269,
0.16416634619235992,
0.... |
def test _ get _ persisted _ upto _ position ( self ) - > none : # the following tests are a bit cheeky in that we notify about new # positions via ` advance ` without * actually * advancing the postgres # sequence. self. _ insert _ row _ with _ id ( " first ", 3 ) self. _ insert _ row _ with _ id ( " second ", 5 ) id ... | [
-0.3792681097984314,
0.8258714079856873,
0.7514821887016296,
-0.55428546667099,
0.8736912608146667,
0.2671988606452942,
0.8090806603431702,
-0.10085608065128326,
-0.2802152931690216,
-0.5810605883598328,
-1.1213842630386353,
-0.9309868216514587,
0.22736568748950958,
0.0068819355219602585,
... |
def hasfield ( self, * args, * * kwargs ) : # real signature unknown pass | [
-0.15941232442855835,
0.24609264731407166,
0.6024913191795349,
0.2669312059879303,
1.0214413404464722,
0.831871747970581,
0.1296355128288269,
0.22188152372837067,
-0.5342344045639038,
-0.9565531015396118,
-1.177995204925537,
-0.4519616365432739,
-0.7112998366355896,
0.2989667057991028,
-... |
def drop _ records _ without _ descriptors ( df ) : uris _ len = df. descriptors _ uris. apply ( len ) logger. info ('dropping % d records with no descriptors :'% df. loc [ uris _ len = = 0 ]. shape [ 0 ] ) logger. debug ('\ t'+ df. loc [ uris _ len = = 0, ['paper _ id ','datestamp ','uri ','descriptors'] ]. to _ strin... | [
-0.3991349935531616,
0.41780948638916016,
0.485582172870636,
-1.3165240287780762,
0.6508023738861084,
-0.14525601267814636,
-0.5469682216644287,
0.2878760099411011,
-0.23452992737293243,
-0.3020695447921753,
0.6251764297485352,
-0.004546244163066149,
0.057173434644937515,
-0.31665340065956... |
def _ _ init _ _ ( self, parent : " regsregister ", name : str, offset : int, width : int, description : str = none, reset _ val : str = " n / a ", access : str = " rw " ) - > none : self. parent = parent self. name = name or " n / a " self. offset = offset self. width = width self. description = description or " n / a... | [
0.008914253674447536,
0.3119767904281616,
0.5338584780693054,
-0.4024767279624939,
0.2357397973537445,
-0.2571010887622833,
-0.24363598227500916,
0.25949379801750183,
0.30955225229263306,
0.020761817693710327,
-0.47570180892944336,
0.5641976594924927,
-0.058917250484228134,
1.0859936475753... |
def parse ( self, response ) : custom _ settings = {'item _ pipelines': {'ufcstats. pipelines. ufcstatspipeline': 400 } } # prompt user to specify whether to update new events or all events. event _ update = none while event _ update is none : try : event _ update _ type = int ( input ('\ nselect from the following upd... | [
-0.06347804516553879,
0.111830934882164,
0.8140832185745239,
0.3314491808414459,
-0.12610645592212677,
0.5380992889404297,
0.25653570890426636,
-0.035920653492212296,
0.25636398792266846,
-0.06963514536619186,
0.8094755411148071,
0.09638743102550507,
0.3476640284061432,
0.41601893305778503... |
def dump _ reads _ fasta ( self, reads, fasta _ file ) : targ _ seqs = { } fas _ out = open ( fasta _ file,'w') for rnum, read in enumerate ( reads ) : ( gi, pos ) = read try : targ _ seq = targ _ seqs [ gi ] except keyerror : targ _ seq = self. ref _ db. retrieve ( gi ) targ _ seqs [ gi ] = targ _ seq read _ seq = tar... | [
-0.8330049514770508,
-0.767987847328186,
0.6361141204833984,
-1.1206369400024414,
0.458454430103302,
-0.1309591680765152,
0.6545057892799377,
0.3002581000328064,
-0.12514536082744598,
0.3559319078922272,
1.1363766193389893,
-0.32237979769706726,
0.0817691758275032,
0.9114252328872681,
0.... |
def flank _ mutate ( resid, chain, mutatation, template, output, fix _ atoms ) : residues = dict ( ) with open ( template,'r') as input _ file : for line in input _ file : if line. startswith ('atom') or line. startswith ('hetatm') : atom _ data = {'label': str ( line [ 0 : 6 ]. strip ( ) ),'atom _ num': int ( line [ 6... | [
0.40823090076446533,
-0.41935911774635315,
1.0025025606155396,
-0.6000918745994568,
0.27462249994277954,
-0.05931459367275238,
0.2594883441925049,
0.656510055065155,
-0.8047389984130859,
0.36352190375328064,
-0.8165602684020996,
-0.03941461071372032,
-0.47884413599967957,
-0.08866187930107... |
def create _ absence _ type _ temp _ table ( cursor, temp _ table, source _ table, new _ column, type _ str, grade, source _ schema ='clean') : sql _ create _ agg _ temp = " " " drop table if exists { tmp } ; create temporary table { tmp } as select student _ lookup, count ( * ) as { nc } from { ss }. { st } where grad... | [
0.08154860138893127,
-0.17591646313667297,
0.5709275603294373,
-0.48767393827438354,
-0.3238682746887207,
0.7262337803840637,
0.9569830894470215,
0.10766579210758209,
-0.39431968331336975,
1.0639781951904297,
0.20142577588558197,
0.6490551829338074,
-0.035591669380664825,
0.626463294029235... |
def funfit ( fs, xs, ys, full = false ) : ans = [ ] coefs = [ ] n = len ( fs ) for i in xrange ( n ) : try : ans. append ( sum ( ys * fs [ i ] ( xs ) ) ) except typeerror : # only catch'cause not clear what caused it raise typeerror ('fs functions must be numpy - compatible.') coefs. append ( [ ] ) for j in xrange ( n ... | [
0.06384474039077759,
0.7565947771072388,
0.751318633556366,
-0.18422584235668182,
-0.4225340187549591,
-1.123136281967163,
0.41210615634918213,
-0.06861136853694916,
-0.08319810032844543,
-0.012907213531434536,
-0.7046133875846863,
-0.22660070657730103,
0.31416788697242737,
-0.287582010030... |
def stop _ webhook ( self ) : self. run _ webhook ( webhook _ url = " " ) | [
-0.17530809342861176,
-0.7759373784065247,
0.13984641432762146,
0.37592795491218567,
1.3623554706573486,
0.6080983281135559,
0.17021240293979645,
0.8883336186408997,
-0.8365777730941772,
0.31790998578071594,
-0.5724073648452759,
1.171854853630066,
-1.1111785173416138,
0.3813149034976959,
... |
def part _ decode ( part ) : return part. replace ( " ~ 1 ", " / " ). replace ( " ~ 0 ", " ~ " ) | [
-0.18820689618587494,
-1.8881585597991943,
0.4165792167186737,
-0.0035817213356494904,
-0.7110090851783752,
0.28238752484321594,
0.38125595450401306,
0.6938080787658691,
-0.23421421647071838,
-0.5224634408950806,
-0.4535720944404602,
-0.6430301666259766,
-1.06610107421875,
-0.9770740866661... |
def expand ( self, action _ priors, add _ noise ) : # when train by self - play, add dirichlet noises in each node # should note it's different from paper that only add noises in root node # i guess alphago zero discard the whole tree after each move and rebuild a new tree, so it's no conflict # while here i contained ... | [
-0.19095465540885925,
0.4193183183670044,
1.0886245965957642,
-0.5289894938468933,
0.09734676033258438,
0.2599615156650543,
-0.07997386157512665,
0.34689804911613464,
0.456291139125824,
0.035538725554943085,
0.11731559783220291,
0.6232268214225769,
-0.4295722246170044,
0.45647546648979187,... |
def security _ groups ( self ) - > optional [ pulumi. input [ sequence [ pulumi. input [ str ] ] ] ] : return pulumi. get ( self, " security _ groups " ) | [
0.09432576596736908,
0.5402885675430298,
0.24708154797554016,
0.6898038983345032,
1.1934391260147095,
0.6598047614097595,
0.18063291907310486,
-0.43651577830314636,
0.7329429388046265,
-0.24603340029716492,
-1.1004480123519897,
0.42259034514427185,
-0.8264610767364502,
-0.7658358812332153,... |
def account _ view ( request, pk ) : customer = customer. objects. get ( id = pk ) requirement = requirement. objects. filter ( customer _ id = customer. id ). first ( ) # set context. # leads, sales _ people, roof _ types, storeys, electric _ powers, payments, installers are default options loaded in django admin # re... | [
0.03167252615094185,
-0.021176517009735107,
0.9102243185043335,
0.1138252541422844,
-0.40361782908439636,
-0.12006550282239914,
0.8995335102081299,
0.03393709659576416,
0.4991055428981781,
0.34383758902549744,
0.5045561194419861,
0.10577056556940079,
0.3644431233406067,
0.9676303267478943,... |
def is _ admin ( self ) : auth = self. boilerplate. auth return auth. has _ membership ( auth. id _ group ( self. group _ admin ) ) | [
-0.6281384229660034,
0.4478612542152405,
0.110465869307518,
0.7699601054191589,
0.5725355744361877,
-0.6576288938522339,
-0.663408100605011,
-1.0067942142486572,
0.21634210646152496,
0.012557308189570904,
0.14599104225635529,
1.3341619968414307,
-0.9264073371887207,
0.6764512062072754,
-... |
def source _ gate ( self ) : pass # pragma : no cover | [
0.7109099626541138,
0.1522912085056305,
0.4598538279533386,
-0.06660564243793488,
-0.4153987169265747,
1.0971406698226929,
0.5465121865272522,
0.12611310184001923,
0.019728893414139748,
0.682012677192688,
-0.4970410466194153,
0.28081977367401123,
-0.6261833906173706,
0.7770732045173645,
... |
def match _ arch ( self, block ) : arches = none if " default _ arches " in block : arches = get _ default _ arches ( ) elif " default _ cbdeps _ arches " in block : arches = get _ default _ arches ( cbdeps _ arches = true ) if arches is not none : block [ " if _ arch " ] = arches logger. debug ( f " set if _ arch : { ... | [
-0.5917197465896606,
0.7931954264640808,
0.41637271642684937,
1.2260032892227173,
0.03470373526215553,
-1.2289561033248901,
0.20476703345775604,
-0.30285969376564026,
1.1351627111434937,
0.47842779755592346,
-0.20284274220466614,
0.06698913127183914,
-0.5775754451751709,
0.9191552400588989... |
def pack ( obj, stream, * * kwargs ) : msgpack. pack ( obj, stream, default = _ encode _ ext _ type, use _ bin _ type = true, * * kwargs ) | [
0.3054700195789337,
0.6462410688400269,
0.5752070546150208,
1.3169821500778198,
-0.6157841682434082,
0.12330832332372665,
-0.031039470806717873,
-1.1855305433273315,
0.3292325437068939,
-0.6351100206375122,
-1.1620538234710693,
0.7870933413505554,
-1.133215069770813,
1.0021514892578125,
... |
def full _ batch _ mc ( n ) : return gramcomputations ( extension _ cls _ directions = sqrtggnmc, extension _ cls _ second = sqrtggnmc, compute _ gammas = false, compute _ lambdas = false, subsampling _ directions = none, subsampling _ second = none, verbose = false, ) | [
0.7796033024787903,
0.4901390075683594,
0.5186354517936707,
0.6109881401062012,
-0.6599513292312622,
-0.48305198550224304,
0.6168110370635986,
-0.7947285771369934,
0.6052592396736145,
-0.1450519561767578,
-0.24984394013881683,
0.45327940583229065,
-0.21116745471954346,
0.8053422570228577,
... |
def kodi _ setart _ dict ( self ) : outdict = { } if self. tall : outdict ['poster'] = self. medium _ tall. source if self. wide : outdict ['banner'] = self. medium _ wide. source outdict ['fanart'] = self. medium _ wide. source if self. thumbnail : outdict ['thumb'] = self. medium _ thumbnail. source else : if self. t... | [
-0.9780461192131042,
-0.2626800537109375,
0.35349056124687195,
-1.3401823043823242,
-1.6924138069152832,
-0.16166026890277863,
-0.47533926367759705,
-0.771756112575531,
0.2139127403497696,
0.3407600224018097,
-0.7636790871620178,
0.9199984669685364,
-0.09596742689609528,
0.7565308213233948... |
def myinfoupdated ( self, view ) : # todo : image,... self. _ myview = view nk = view. nick self. nicklabel. set _ markup ( str ( nk ) ) psm = view. psm cm = view. current _ media message = str ( psm ) +'' + str ( cm ) self. psmlabel. set _ markup ('< i >'+ message +'< / i >') self. status. set _ active ( self. status ... | [
-0.10144277662038803,
-1.5296756029129028,
0.48148778080940247,
-0.6512627005577087,
-0.6253496408462524,
-0.022534796968102455,
0.008968048729002476,
0.25675103068351746,
0.11164826899766922,
-0.583674967288971,
-0.1536685973405838,
-0.056429360061883926,
0.2073083221912384,
0.53765612840... |
def do _ set ( self, args ) : args = str ( args ). split ('=') key = self. process _ args ( args [ 0 ] ) value = self. process _ args ( args [ 1 ]. lower ( ) ) try : if value. startswith ( " eval " ) : value = eval ( value ) if type ( value ) = = str : value = value. lower ( ) self. config [ key ] = value if key = = " ... | [
-0.9639953374862671,
0.03331995755434036,
0.5226410627365112,
-0.1887398511171341,
0.523590624332428,
0.1664523482322693,
-0.11088118702173233,
-0.5375696420669556,
-0.022559083998203278,
0.7249522805213928,
0.04503494128584862,
0.3573473393917084,
-0.4755494296550751,
0.5719599723815918,
... |
def corellate _ weekend _ takings _ against _ tweets ( self, full _ week = false, week _ inc _ weekend = false, first _ run = false, critical _ period = false, senti _ class = none, percentage = false ) : mojo _ df = self. mojo _ box _ office _ df results = [ ] # only do correlations if there is more than one week if (... | [
0.15345413982868195,
0.321440190076828,
0.8302839398384094,
-1.386560082435608,
-0.09198547899723053,
-0.3748357892036438,
-0.008551876060664654,
0.16324938833713531,
-0.47566455602645874,
0.6342511177062988,
0.47225677967071533,
-0.012427270412445068,
-0.2903638780117035,
0.46869829297065... |
def make _ normal _ system ( a, d, inv _ cd ) : # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # import import numpy as np tmp = np. dot ( a. t, inv _ cd ) return ( np. dot ( tmp, a ), np. dot ( tmp, d. reshap... | [
-0.6664881706237793,
-0.3234103322029114,
0.4381710886955261,
-1.2443310022354126,
-0.8992118835449219,
-0.0027639418840408325,
0.025353481993079185,
0.13334651291370392,
-0.10476479679346085,
0.40909653902053833,
0.1225898489356041,
0.30364060401916504,
0.5504405498504639,
-0.234194248914... |
def finished _ search ( request ) : if request. method = ='post': # get search key data from search form search _ value = request. post. get ('search _ value') print ( " = = = = = = = = = = = = = = = = = = = = = = = = " ) # get all requirements in finished and service status if request. user. has _ perm ('customer. cus... | [
-0.17656272649765015,
-0.1211085096001625,
0.8983248472213745,
0.2764304280281067,
-0.39220672845840454,
0.5701726675033569,
0.382845938205719,
0.014986805617809296,
-0.9877551794052124,
0.5699692964553833,
0.6696350574493408,
0.054468102753162384,
0.28557589650154114,
1.4430745840072632,
... |
def _ has _ params ( sql ) : return bool ( positional _ vars. search ( sql ) ) or bool ( named _ vars. search ( sql ) ) | [
0.14216206967830658,
-0.08454946428537369,
0.42194482684135437,
-0.0035157816018909216,
-0.6215721368789673,
-0.3835163712501526,
-1.7674810886383057,
0.24297888576984406,
-0.8667306303977966,
0.7321407794952393,
0.3427744507789612,
-0.6466160416603088,
0.22234119474887848,
1.8925539255142... |
def script ( self, script, check _ return _ code = true ) : if not os. path. isfile ( script ) : raise runtimeerror ( " hive script : { 0 } does not exist. ". format ( script ) ) return self. _ command ( ['- f ', script ], check _ return _ code ) | [
-0.29848554730415344,
0.30212944746017456,
0.4617125391960144,
0.8673651218414307,
0.9203552007675171,
-0.5844566822052002,
0.40667033195495605,
-0.7077664732933044,
-0.17844119668006897,
0.5803144574165344,
0.5292066931724548,
0.638257622718811,
0.21927493810653687,
-0.42819344997406006,
... |
def add _ special _ tokens _ ( model, tokenizer ) : num _ added _ tokens = tokenizer. set _ special _ tokens ( special _ tokens ) model. set _ num _ special _ tokens ( len ( special _ tokens ) ) | [
-0.2509807348251343,
0.39427751302719116,
0.4204201400279999,
0.05105431005358696,
-0.8487392067909241,
-0.1319694221019745,
-0.6772736310958862,
1.5993268489837646,
0.13846133649349213,
-0.6430774331092834,
-1.7762333154678345,
0.17862552404403687,
1.1526222229003906,
0.8960366249084473,
... |
def plot _ histories ( history, epochs ) : acc = history ['accuracy'] val _ acc = history ['val _ accuracy'] loss = history ['loss'] val _ loss = history ['val _ loss'] epochs _ range = range ( epochs ) plt. figure ( figsize = ( 8, 8 ) ) plt. subplot ( 1, 2, 1 ) plt. plot ( epochs _ range, acc, label ='training accurac... | [
0.39029309153556824,
0.7395389080047607,
0.5629115104675293,
-0.08654380589723587,
-0.4316805601119995,
0.06931325048208237,
0.3598893880844116,
0.32499024271965027,
-0.13122306764125824,
-0.373249351978302,
0.33101341128349304,
1.1619336605072021,
1.5531134605407715,
0.6634079813957214,
... |
def _ writeconfigfile ( filepath, configparser ) : configfile = open ( filepath,'wb') configparser. write ( configfile ) | [
-0.7115046381950378,
-1.0061461925506592,
-0.11808460205793381,
0.2329271137714386,
0.9130445718765259,
0.5838290452957153,
0.37548574805259705,
1.0467278957366943,
-1.7568974494934082,
0.8850782513618469,
-0.7256668210029602,
-1.1450778245925903,
-0.12186304479837418,
0.7437290549278259,
... |
def test _ remove _ quotes ( self ) : send _ msg _ list = [ b " a \ t'a _ value'\ n ", b'a \ t " a _ value " \ n ', b " a \ ta _ value \ n " ] recv _ msg = {'a':'a _ value'} for send _ msg in send _ msg _ list : self. assert _ equal ( self. instance. deserialize ( send _ msg ) [ 0 ], recv _ msg ) | [
0.23707449436187744,
0.14127454161643982,
0.5190920829772949,
-1.1562293767929077,
0.23645222187042236,
-0.6599488258361816,
-0.8880358338356018,
-0.2924383878707886,
-0.29750820994377136,
0.3637966513633728,
-0.7202925682067871,
0.17557579278945923,
-0.46594175696372986,
0.287712037563324... |
def _ get _ proposal ( self, given ) : v = list ( self. v ) candidates = np. delete ( np. array ( v ), given ) given = set ( given ) n = self. k. shape [ 0 ] k _ diag = np. diag ( self. k ) diag _ idxs = np. diag _ indices ( n ) k = np. copy ( self. k ) probs = np. zeros ( len ( candidates ) ) for i, el in enumerate ( ... | [
-0.4053952395915985,
0.26654839515686035,
0.6532959938049316,
-0.07638536393642426,
-0.29214614629745483,
-0.2358139455318451,
-0.1686951220035553,
0.24139755964279175,
0.45845258235931396,
1.4519081115722656,
0.8109541535377502,
0.016200099140405655,
-0.22213050723075867,
-0.0200680829584... |
def confirm _ clowder _ info ( host, secret _ key, space _ id, clowder _ user = none, clowder _ pass = none ) : logger = logging. getlogger ( _ _ name _ _ ) # check that we have good parameters if not secret _ key or not space _ id : logger. error ( " one or more required parameters is empty " ) return false if ( not c... | [
0.11182578653097153,
-0.18532361090183258,
0.6743183135986328,
0.6376358866691589,
-0.2609682083129883,
0.4924176037311554,
-0.729073703289032,
-0.3751814365386963,
-0.6804500222206116,
0.44667577743530273,
-0.14711348712444305,
0.4116685688495636,
-0.6430431604385376,
1.8600926399230957,
... |
def train _ and _ evaluate ( model, train _ data, test _ data, metrics = [ r2 _ score, mean _ squared _ error, scaled _ rmse ] ) : # train model model. fit ( * train _ data ) # evaluate model print ( f'{ " = " * 100 } \ n evaluating : \ n { model } \ n { " = " * 100 }') for m in metrics : m _ name, m _ value _ train = ... | [
0.39049670100212097,
0.12634852528572083,
0.7364950180053711,
-0.029000040143728256,
-0.37470364570617676,
1.063326120376587,
0.17073969542980194,
0.38186946511268616,
-1.1141573190689087,
-0.036045387387275696,
-0.19220609962940216,
0.8714229464530945,
0.28154271841049194,
-0.207973644137... |
def sum _ up _ diagonals ( matrix ) : tl = 0 tr = 0 matrix _ len = len ( matrix ) idx = 0 while idx < len ( matrix ) : tl + = matrix [ idx ] [ idx ] tr + = matrix [ idx ] [ ( matrix _ len - 1 ) - idx ] idx + = 1 return tl + tr | [
-0.7247631549835205,
0.9578381180763245,
0.6925151944160461,
-0.9859481453895569,
-0.486362099647522,
-0.391621857881546,
0.999739408493042,
0.10743796825408936,
1.0498631000518799,
1.0676770210266113,
-0.618842363357544,
-0.1692878156900406,
0.1383078247308731,
-0.8786015510559082,
-0.4... |
def find _ content ( img _ hsv, hist _ sample ) : src _ img _ cp = img _ hsv # normalize the sample histogram cv2. normalize ( hist _ sample, hist _ sample, 0, 179, cv2. norm _ minmax ) distance = cv2. calcbackproject ( [ img _ hsv ], [ 0 ], hist _ sample, [ 0, 180 ], 0. 5 ) print ('ssssssssssssssssssssss distance - - ... | [
0.843734085559845,
-0.12132611125707626,
0.9836378693580627,
0.2696042060852051,
-0.5709855556488037,
-0.3088272213935852,
0.5475713610649109,
-0.2278972566127777,
-0.05951967090368271,
0.9887323379516602,
-0.6071690320968628,
0.34456631541252136,
-0.2935687005519867,
0.6936662793159485,
... |
def silence _ output ( cmd _ method, * args, * * kwargs ) : with open ( os. devnull, " w " ) as fnull : for k in ( " stdout ", " stderr " ) : if kwargs. get ( k ) = = " null " : kwargs [ k ] = fnull return cmd _ method ( * args, * * kwargs ) | [
0.36301836371421814,
-0.8717275261878967,
0.5227025747299194,
0.023919282481074333,
-0.44185346364974976,
-0.9798215627670288,
0.4394744336605072,
-0.8849460482597351,
0.2210947424173355,
-0.325020968914032,
1.0353025197982788,
0.033929597586393356,
-0.004111561458557844,
1.019346952438354... |
def _ _ init _ _ ( self, parent = none ) : super ( tabbar, self ). _ _ init _ _ ( parent ) self. setacceptdrops ( true ) self. _ _ dragstartpos = qpoint ( ) | [
0.48048046231269836,
0.065863236784935,
0.5313128232955933,
0.24298211932182312,
-1.0413285493850708,
1.256742238998413,
0.10573230683803558,
0.23759838938713074,
-0.8735716938972473,
-0.36573028564453125,
-0.8635347485542297,
-0.8453897833824158,
0.619095504283905,
0.9317102432250977,
0... |
def decay _ schedule ( epoch, lr ) : if ( ( epoch! = 0 ) and ( ( epoch / 100 = = 1 ) and ( epoch / 400 = = 1 ) ) ) : lr = lr * 0. 1 return lr | [
-0.20351816713809967,
-0.6025804281234741,
0.3625527620315552,
-0.025215918198227882,
-0.46801742911338806,
0.2532670795917511,
-0.7671471834182739,
-0.1355816125869751,
0.347692608833313,
0.16550837457180023,
0.6472553014755249,
0.7214786410331726,
-0.30705735087394714,
1.1363242864608765... |
def reset _ ids _ in _ meta _ df ( meta _ df ) : # record original index name, and then change it so that the column that it # becomes will be appropriately named original _ index _ name = meta _ df. index. name meta _ df. index. name = " old _ id " # reset index meta _ df. reset _ index ( inplace = true ) # change the... | [
-0.3763851225376129,
-0.3856900632381439,
0.6619081497192383,
-0.28931379318237305,
0.4720119535923004,
-0.2966483533382416,
0.28210902214050293,
0.6034106612205505,
-0.08027396351099014,
1.0367411375045776,
0.24707446992397308,
2.1206469535827637,
0.5404456853866577,
-0.8422170281410217,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.