text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (this *Tuple) String() string {
return fmt.Sprintf("%v", this.data)
} | [
-0.7931358814239502,
-0.5561335682868958,
0.19560325145721436,
-1.3842746019363403,
-0.2853162884712219,
1.2068604230880737,
-0.5412468314170837,
-0.737739622592926,
-0.5685040950775146,
-0.0689922347664833,
0.13871322572231293,
-0.1112678200006485,
-0.0741218626499176,
-1.136335015296936,... |
func (this *Tuple) PopLeft() interface{} {
if this.Len() < 1 {
return nil
}
ret := this.data[0]
this.data = this.data[1:]
return ret
} | [
-0.049222659319639206,
0.5053932070732117,
0.6105844974517822,
-0.4824855327606201,
0.062102124094963074,
0.250200480222702,
-0.4591030180454254,
-0.6360160112380981,
0.29414984583854675,
0.7745168209075928,
-0.6338310837745667,
-0.7674374580383301,
-0.6012601256370544,
-0.6250510215759277... |
func (this *Tuple) PopRight() interface{} {
if this.Len() < 1 {
return nil
}
idx := this.Offset(-1)
ret := this.data[idx]
this.data = this.data[:idx]
return ret
} | [
-0.6420484185218811,
0.7944110035896301,
0.8336247205734253,
-0.35935544967651367,
-0.7554634213447571,
-0.027143113315105438,
-0.7996600866317749,
-0.5358937382698059,
-0.5478188395500183,
0.7287166118621826,
0.1155850738286972,
-0.48362109065055847,
-0.9990083575248718,
-0.84398716688156... |
func (this *Tuple) Reverse() {
for i, j := 0, this.Len()-1; i < j; i, j = i+1, j-1 {
this.data[i], this.data[j] = this.data[j], this.data[i]
}
} | [
-1.688165307044983,
0.7332028746604919,
0.48465728759765625,
-1.5345520973205566,
0.42470136284828186,
-0.38875851035118103,
0.11317438632249832,
0.8521649837493896,
-1.5184900760650635,
0.1672721803188324,
-0.5189777612686157,
0.22242344915866852,
-0.6014528870582581,
-1.2652068138122559,... |
func TupleElemEq(lhsi interface{}, rhsi interface{}) bool {
lhsv, rhsv := reflect.ValueOf(lhsi), reflect.ValueOf(rhsi)
// IsNil panics if type is not interface-y, so use IsValid instead
if lhsv.IsValid() != rhsv.IsValid() {
return false
}
// TODO: this currently blows up if lhs can't be converted to same
// typ... | [
-1.691969394683838,
-0.3682836890220642,
0.5856924057006836,
-0.02596825174987316,
-0.052431851625442505,
0.7765557169914246,
-0.2550821602344513,
-0.523076593875885,
0.01545336190611124,
0.4282691776752472,
-0.5391654968261719,
-0.2832462191581726,
-0.30304375290870667,
0.4001875817775726... |
func (this *Tuple) Eq(other *Tuple) bool {
if this.Len() != other.Len() {
return false
}
//return reflect.DeepEqual(this.data, other.data)
for i := 0; i < this.Len(); i++ {
lhsi, rhsi := this.Get(i), other.Get(i)
if !TupleElemEq(lhsi, rhsi) {
return false
}
}
return true
} | [
-1.8729454278945923,
0.7632756233215332,
0.6896291375160217,
-0.7561659812927246,
0.08222929388284683,
0.7003864049911499,
-0.17942067980766296,
-0.020015135407447815,
-0.5404426455497742,
0.08315161615610123,
-1.0779478549957275,
-0.4570907950401306,
-0.4918202757835388,
0.105166055262088... |
func (this *Tuple) Ne(other *Tuple) bool {
return !this.Eq(other)
} | [
-2.041851043701172,
0.8086759448051453,
0.6014161109924316,
-0.2917315661907196,
0.2728809118270874,
0.32826748490333557,
-0.726902425289154,
-0.04418795555830002,
-0.8823357224464417,
0.5095664262771606,
-0.2274380922317505,
-1.5822551250457764,
-0.2799888253211975,
-0.06417044997215271,
... |
func TupleElemLt(lhsi interface{}, rhsi interface{}) bool {
lhsv, rhsv := reflect.ValueOf(lhsi), reflect.ValueOf(rhsi)
if lhsv.IsValid() && !rhsv.IsValid() {
// zero value is considered least
return false
}
switch lhsi.(type) {
case nil:
if rhsv.IsValid() {
return true
}
case string:
if lhsi.(string)... | [
-0.062413282692432404,
-0.9052305817604065,
0.5940585136413574,
-1.0709911584854126,
-0.18021218478679657,
0.7662636041641235,
-0.8224515914916992,
-0.8167180418968201,
0.2146472930908203,
-0.6709157824516296,
-0.5487574338912964,
-0.2600604295730591,
-0.4555996060371399,
0.373254805803298... |
func (this *Tuple) Lt(other *Tuple) bool {
tlen, olen := this.Len(), other.Len()
var n int
if tlen < olen {
n = tlen
} else {
n = olen
}
for i := 0; i < n; i++ {
lhsi, rhsi := this.Get(i), other.Get(i)
if TupleElemLt(lhsi, rhsi) {
return true
} else if !TupleElemEq(lhsi, rhsi) {
return false
}
... | [
-0.35480302572250366,
-0.28276053071022034,
0.8138746619224548,
-1.1801174879074097,
-0.39516741037368774,
0.22552628815174103,
-0.8363506197929382,
-0.6735848188400269,
-0.23262600600719452,
-0.39780232310295105,
-0.5890321135520935,
-1.1194872856140137,
-0.34665557742118835,
0.4770061671... |
func (this *Tuple) Le(other *Tuple) bool {
return this.Lt(other) || this.Eq(other)
} | [
-0.6340029239654541,
-0.08273709565401077,
0.5399209856987,
-0.8746638298034668,
0.06311860680580139,
-0.08480345457792282,
-1.036078929901123,
-0.6377328038215637,
0.46054762601852417,
-0.15716764330863953,
-0.2754547595977783,
-1.5657165050506592,
-0.05873972922563553,
-0.127463459968566... |
func (this *Tuple) Gt(other *Tuple) bool {
return !this.Le(other)
} | [
-1.6870360374450684,
0.7949440479278564,
0.7080427408218384,
-0.1681850552558899,
-0.19170016050338745,
1.2471120357513428,
-1.0105973482131958,
0.03712529316544533,
-0.9077253341674805,
0.22756633162498474,
0.0506175272166729,
-1.7044912576675415,
-0.24174480140209198,
-0.2644608318805694... |
func (this *Tuple) Ge(other *Tuple) bool {
return !this.Lt(other)
} | [
-1.6629470586776733,
1.6229833364486694,
0.7798358798027039,
-0.2849924564361572,
0.7198277115821838,
0.7528627514839172,
-0.9520407915115356,
-0.4668498635292053,
-0.8548535108566284,
-0.03537675738334656,
-0.399203896522522,
-1.6201496124267578,
-0.7647651433944702,
0.31350433826446533,
... |
func (this *Tuple) Index(item interface{}, start int) int {
for i := start; i < this.Len(); i++ {
if TupleElemEq(this.Get(i), item) {
return i
}
}
return -1
} | [
-1.738891839981079,
-0.3586818277835846,
0.2921917140483856,
-0.0013884628424420953,
-0.47900521755218506,
0.042221080511808395,
1.2476623058319092,
0.40104344487190247,
-0.3687438368797302,
0.8208511471748352,
-0.36199483275413513,
-0.20275746285915375,
-0.5067237615585327,
-1.40035176277... |
func (this *Tuple) Count(item interface{}, start int) int {
ctr := 0
for i := start; i < this.Len(); i++ {
if TupleElemEq(this.Get(i), item) {
ctr += 1
}
}
return ctr
} | [
-0.9149782061576843,
-0.3074650168418884,
0.622224748134613,
0.25949928164482117,
-0.5456550121307373,
-0.25444501638412476,
0.9775409698486328,
0.12555396556854248,
-0.24750582873821259,
0.694549560546875,
-0.9313639998435974,
-0.7366812229156494,
0.165938138961792,
-0.6377933621406555,
... |
func (this *Tuple) Insert(start int, other *Tuple) {
this.InsertItems(start, other.data...)
} | [
-1.7242437601089478,
0.9251189231872559,
0.4623372256755829,
-0.574675440788269,
0.16162759065628052,
0.13222083449363708,
0.04506883770227432,
-0.3022692799568176,
-1.1535202264785767,
0.14085794985294342,
-1.3120955228805542,
-0.7363196015357971,
-0.5573517680168152,
-0.4183630347251892,... |
func (this *Tuple) InsertItems(start int, items ...interface{}) {
start = this.Offset(start)
rhs := this.Copy().data[start:]
this.data = append(this.data[:start], items...)
this.data = append(this.data, rhs...)
} | [
-1.8723444938659668,
0.7243240475654602,
0.4796614348888397,
-0.6823882460594177,
0.45693036913871765,
0.9138648509979248,
-0.14802059531211853,
0.30847325921058655,
-1.2676301002502441,
0.1873764544725418,
-1.0992271900177002,
-0.710980236530304,
-0.7335876822471619,
-0.8228257298469543,
... |
func (this *Tuple) Append(other *Tuple) {
this.AppendItems(other.data...)
} | [
-1.2590298652648926,
0.41993314027786255,
0.36571982502937317,
-0.25199636816978455,
-0.09691727161407471,
0.27822062373161316,
-1.0877774953842163,
-0.2774135172367096,
-0.305144727230072,
-0.3637607991695404,
-0.9871846437454224,
-0.5029700994491577,
0.31272822618484497,
0.47283217310905... |
func (this *Tuple) AppendItems(items ...interface{}) {
this.data = append(this.data, items...)
} | [
-1.7059639692306519,
0.2984297275543213,
0.3231162130832672,
-0.2877722978591919,
0.5975608229637146,
0.8287400603294373,
-0.9742957949638367,
0.21680083870887756,
-0.4899939000606537,
-0.8024107813835144,
-1.0472228527069092,
-0.8468590974807739,
-0.05297271907329559,
0.1739719808101654,
... |
func LoadConfig() *Config {
config := Config{}
defConf := DefaultConfig()
file := FileConfig(ConfigPath())
env := EnvConfig()
return config.Apply(defConf).Apply(file).Apply(env)
} | [
0.5521371960639954,
-0.043009575456380844,
0.478809118270874,
0.8772125840187073,
0.040995173156261444,
-0.07133042067289352,
-0.19259603321552277,
0.9629225134849548,
-1.1099716424942017,
0.36022108793258667,
-0.21901440620422363,
0.02820449136197567,
-0.520231306552887,
1.123741507530212... |
func DefaultConfig() *Config {
config := new(Config)
config.URL = MktmpioURL
return config
} | [
0.9558882713317871,
0.26943439245224,
0.13814705610275269,
0.6278933882713318,
-0.5271124839782715,
0.06502596288919449,
-0.6314241290092468,
1.6312977075576782,
0.020918400958180428,
-0.12751883268356323,
-0.536923885345459,
-1.1361336708068848,
-0.5273609161376953,
0.8184061646461487,
... |
func EnvConfig() *Config {
config := new(Config)
config.Token = os.Getenv("MKTMPIO_TOKEN")
config.URL = os.Getenv("MKTMPIO_URL")
return config
} | [
0.43922582268714905,
-0.3240894377231598,
0.4497081935405731,
-0.19116012752056122,
-0.7894911170005798,
0.5946328639984131,
-1.1448179483413696,
0.6324551701545715,
-1.303145170211792,
1.2943893671035767,
-0.5689573884010315,
-0.19603502750396729,
-0.15233390033245087,
0.757925808429718,
... |
func FileConfig(cfgPath string) *Config {
config := new(Config)
cfgFile, err := ioutil.ReadFile(cfgPath)
if err != nil {
config.err = err
} else {
config.err = yaml.Unmarshal(cfgFile, config)
}
return config
} | [
0.5906805396080017,
-0.8591880798339844,
0.592664897441864,
0.012641149573028088,
-0.7130759954452515,
-0.2562564015388489,
0.4560805559158325,
1.1636031866073608,
-0.8528677821159363,
-0.14557315409183502,
-0.355913907289505,
-0.11222424358129501,
0.2655488848686218,
0.3212035894393921,
... |
func (c *Config) Apply(b *Config) *Config {
newCfg := new(Config)
if b.Token == "" {
newCfg.Token = c.Token
} else {
newCfg.Token = b.Token
}
if b.URL == "" {
newCfg.URL = c.URL
} else {
newCfg.URL = b.URL
}
return newCfg
} | [
-0.1091272383928299,
-0.19138309359550476,
0.4288928806781769,
0.3287510573863983,
-0.7289324402809143,
-0.060198813676834106,
-1.1002700328826904,
0.9340036511421204,
0.388925164937973,
0.36042436957359314,
-0.9711588621139526,
-0.3006190061569214,
-0.8814865350723267,
0.26037564873695374... |
func ConfigPath() string {
if path, err := homedir.Expand(MKtmpioCfgFile); err == nil {
return path
}
return ""
} | [
0.39287427067756653,
0.39679694175720215,
0.22436176240444183,
0.5072640180587769,
-0.6174710392951965,
0.3645004630088806,
0.7326992154121399,
-0.1293426901102066,
-0.33630460500717163,
1.0204039812088013,
0.2642078399658203,
-1.6579632759094238,
-0.8150845766067505,
0.31530746817588806,
... |
func (c *Config) Save(cfgPath string) error {
cfgFile, err := yaml.Marshal(c)
if err == nil {
err = ioutil.WriteFile(cfgPath, cfgFile, 0600)
}
return err
} | [
0.12120980769395828,
-0.20227624475955963,
0.21606247127056122,
-0.17983824014663696,
0.38064277172088623,
-0.42692628502845764,
0.537461519241333,
0.7860813140869141,
-0.7721297144889832,
0.5196367502212524,
-1.8247517347335815,
-0.34066644310951233,
-0.5137835144996643,
0.762870728969574... |
func getCourses(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"List": "List of all courses!",
})
} | [
-0.49681180715560913,
0.013725990429520607,
0.4359947144985199,
0.07711111009120941,
1.2409818172454834,
-0.16899794340133667,
-0.6363710165023804,
0.0387110635638237,
0.6289340853691101,
0.23064662516117096,
-0.13271838426589966,
0.8068810105323792,
-0.15989600121974945,
0.252753049135208... |
func (s *RestServer) AddInterfaceAPIRoutes(r *mux.Router) {
r.Methods("GET").Subrouter().HandleFunc("/", httputils.MakeHTTPHandler(s.listInterfaceHandler))
r.Methods("GET").Subrouter().HandleFunc("/{ObjectMeta.Tenant}/{ObjectMeta.Namespace}/{ObjectMeta.Name}", httputils.MakeHTTPHandler(s.getInterfaceHandler))
r.M... | [
-0.5750675201416016,
0.07485342025756836,
1.0831992626190186,
-0.10944842547178268,
0.40902388095855713,
0.39717626571655273,
0.7310851216316223,
-0.5215754508972168,
-0.09880498051643372,
-0.12081931531429291,
-0.3402164876461029,
-0.37282314896583557,
-0.8930023312568665,
0.0466670095920... |
func FindGit() (string, error) {
if !bazel.InBazelTest() {
return exec.LookPath("git")
}
if runtime.GOOS == "windows" {
return filepath.Join(bazel.RunfilesDir(), "external", "git_amd64_windows", "bin", "git.exe"), nil
} else if runtime.GOOS == "linux" {
return filepath.Join(bazel.RunfilesDir(), "external", "g... | [
0.3131351172924042,
0.315926730632782,
0.8241416811943054,
0.5258604884147644,
-0.47630390524864197,
0.5982882380485535,
0.22660072147846222,
-0.239178866147995,
-1.3165216445922852,
-0.1448201835155487,
0.7304896116256714,
0.6848140954971313,
-0.8474611043930054,
1.844986915588379,
0.50... |
func (c *Controller) clusterAction(admin submarine.AdminInterface, cluster *rapi.SubmarineCluster, infos *submarine.ClusterInfos) (bool, error) {
glog.Info("clusterAction()")
var err error
/* run sanity check if needed
needSanity, err := sanitycheck.RunSanityChecks(admin, &c.config.submarine, c.podControl, cluster,... | [
-0.849661111831665,
-0.23838944733142853,
0.939743161201477,
-0.2747834026813507,
0.36966586112976074,
0.23307918012142181,
0.9374772906303406,
0.051500964909791946,
0.6550580859184265,
0.7038425207138062,
-0.0520394928753376,
1.224124789237976,
-0.26781749725341797,
0.32390305399894714,
... |
func (c *Controller) applyConfiguration(admin submarine.AdminInterface, cluster *rapi.SubmarineCluster) (bool, error) {
glog.Info("applyConfiguration START")
defer glog.Info("applyConfiguration STOP")
asChanged := false
// expected replication factor and number of master nodes
cReplicaFactor := *cluster.Spec.Rep... | [
-0.6359904408454895,
0.19770753383636475,
0.9722158312797546,
-0.06602492928504944,
-0.07843737304210663,
0.0945596694946289,
0.6217578053474426,
0.589447557926178,
0.3049454689025879,
0.26371410489082336,
-0.010753004811704159,
-0.12999442219734192,
-0.4282775819301605,
0.586405336856842,... |
func (c *Controller) manageRollingUpdate(admin submarine.AdminInterface, cluster *rapi.SubmarineCluster, rCluster *submarine.Cluster, nodes submarine.Nodes) (bool, error) {
return true, nil
} | [
0.0028347403276711702,
0.4133782386779785,
0.5600168704986572,
-0.37603360414505005,
0.06579811871051788,
0.7758751511573792,
-0.44332632422447205,
-0.34573638439178467,
-0.11638902127742767,
-0.09587065875530243,
0.08716224133968353,
0.3634798228740692,
-1.4157639741897583,
0.093155004084... |
func (c *Controller) managePodScaleDown(admin submarine.AdminInterface, cluster *rapi.SubmarineCluster, rCluster *submarine.Cluster, nodes submarine.Nodes) (bool, error) {
return true, nil
} | [
-0.6345141530036926,
-0.19782613217830658,
0.6785447001457214,
-0.26929134130477905,
0.431966096162796,
0.7086371779441833,
-0.23665685951709747,
-0.40177831053733826,
-1.1108591556549072,
-0.22668339312076569,
-0.21476486325263977,
0.13580413162708282,
-1.1402143239974976,
0.3773115873336... |
func (*noCopy) Lock() {} | [
-1.0750519037246704,
0.1511157900094986,
0.32982349395751953,
0.7712238430976868,
-0.597829282283783,
1.201088786125183,
2.053748369216919,
-0.38265424966812134,
0.5056560635566711,
-1.1498479843139648,
0.32723942399024963,
0.6644472479820251,
-0.7817989587783813,
0.1338651329278946,
-0.... |
func NewAdapter() (adapter *Adapter, err error) {
p := configProvider()
adapter = &Adapter{
ec2: ec2.New(p),
ec2metadata: ec2metadata.New(p),
autoscaling: autoscaling.New(p),
acm: acm.New(p),
iam: iam.New(p),
cloudformation: cloudformati... | [
-0.47627586126327515,
-1.058466911315918,
0.41237184405326843,
0.26873084902763367,
0.1306333988904953,
0.23322834074497223,
-0.288638174533844,
-0.34282371401786804,
0.018003782257437706,
-0.3666229248046875,
0.4057277739048004,
0.5121003985404968,
0.29630112648010254,
0.5350648760795593,... |
func (a *Adapter) WithHealthCheckPath(path string) *Adapter {
a.healthCheckPath = path
return a
} | [
-0.09272513538599014,
-0.7859744429588318,
0.3766377866268158,
0.774096667766571,
-0.2135467231273651,
0.24095775187015533,
0.34278130531311035,
-0.16252078115940094,
0.5050200819969177,
-0.6836590766906738,
0.4400748312473297,
-0.535045325756073,
0.5427298545837402,
0.38309556245803833,
... |
func (a *Adapter) WithHealthCheckPort(port uint) *Adapter {
a.healthCheckPort = port
return a
} | [
-0.012822005897760391,
-1.036234974861145,
0.5853456854820251,
0.4091056287288666,
0.2544541358947754,
0.10020085424184799,
0.557298481464386,
-0.3692072927951813,
0.586273729801178,
-1.2638553380966187,
0.22608694434165955,
-0.7956246137619019,
0.4305770695209503,
0.31695303320884705,
-... |
func (a *Adapter) WithHealthCheckInterval(interval time.Duration) *Adapter {
a.healthCheckInterval = interval
return a
} | [
-0.33016473054885864,
-0.662804901599884,
0.49683958292007446,
0.581186056137085,
-0.722364068031311,
0.9841299653053284,
-0.49495214223861694,
-0.08523255586624146,
-0.3868561387062073,
-0.8561922311782837,
0.7751525640487671,
-0.553986132144928,
-0.2067679911851883,
0.40787598490715027,
... |
func (a *Adapter) WithCreationTimeout(interval time.Duration) *Adapter {
a.creationTimeout = interval
return a
} | [
0.8345919251441956,
0.14312782883644104,
0.023754658177495003,
0.1485346108675003,
-0.7092207670211792,
0.4362960755825043,
-0.08134311437606812,
-0.07461178302764893,
-0.237452894449234,
-0.29539114236831665,
0.3273521363735199,
-0.5392841696739197,
0.847166121006012,
0.9117399454116821,
... |
func (a *Adapter) WithCustomTemplate(template string) *Adapter {
a.customTemplate = template
return a
} | [
0.340638130903244,
-0.5364534854888916,
0.2935541868209839,
-0.6931338906288147,
-1.8819187879562378,
-1.0989950895309448,
-0.3606123924255371,
0.25124043226242065,
1.089375615119934,
-0.3423842191696167,
-0.5678679943084717,
-0.7534974813461304,
-0.03021102398633957,
0.30314400792121887,
... |
func (a *Adapter) ClusterID() string {
return a.manifest.instance.clusterID()
} | [
0.6385653614997864,
-0.7931510210037231,
0.1749054193496704,
-0.01251734234392643,
-0.3880499601364136,
0.8273704648017883,
0.2629339396953583,
-0.06340333074331284,
2.0101914405822754,
0.5954912900924683,
1.2296061515808105,
1.604552149772644,
0.2579227089881897,
-0.175615593791008,
0.0... |
func (a *Adapter) VpcID() string {
return a.manifest.instance.vpcID
} | [
1.2428967952728271,
-1.40773606300354,
0.1138877421617508,
-0.6840545535087585,
-0.250150591135025,
1.0307625532150269,
-0.013107492588460445,
0.21970035135746002,
0.9973598122596741,
0.357503205537796,
1.1137369871139526,
0.8753697872161865,
-0.2855178117752075,
-0.8527147769927979,
0.1... |
func (a *Adapter) InstanceID() string {
return a.manifest.instance.id
} | [
0.5033475160598755,
-1.1817467212677002,
0.11203593760728836,
-0.8220330476760864,
-0.8675764203071594,
0.6974825859069824,
-0.11481934040784836,
0.7858361005783081,
1.178127646446228,
0.3706834614276886,
1.1937891244888306,
1.3857996463775635,
-0.8461982011795044,
0.3788318634033203,
0.... |
func (a *Adapter) AutoScalingGroupName() string {
return a.manifest.autoScalingGroup.name
} | [
-0.6005454659461975,
0.010406588204205036,
0.06165142357349396,
-0.2737594544887543,
-1.8765525817871094,
-0.4470692276954651,
-0.7823486328125,
-0.03758474811911583,
-0.7911125421524048,
0.6225571036338806,
0.445870041847229,
0.5619274377822876,
0.19476446509361267,
0.6156356930732727,
... |
func (a *Adapter) SecurityGroupID() string {
return a.manifest.securityGroup.id
} | [
1.0029140710830688,
-0.7602247595787048,
-0.05286331847310066,
0.22874568402767181,
-0.5432971715927124,
0.1104259341955185,
-0.16045202314853668,
0.2974011301994324,
0.9502473473548889,
-0.3481581509113312,
0.2654811441898346,
0.745390772819519,
-0.538447380065918,
1.041511058807373,
-0... |
func (a *Adapter) PrivateSubnetIDs() []string {
return getSubnetIDs(a.manifest.privateSubnets)
} | [
0.07319925725460052,
-0.3827873468399048,
0.11713702231645584,
0.6614696383476257,
-0.7545721530914307,
0.7833830714225769,
-0.8595981001853943,
-0.9076727032661438,
0.7146429419517517,
-0.6303566098213196,
-0.7144469618797302,
2.1313788890838623,
-0.07794678956270218,
0.7360055446624756,
... |
func (a *Adapter) PublicSubnetIDs() []string {
return getSubnetIDs(a.manifest.publicSubnets)
} | [
0.462829053401947,
-0.22434692084789276,
0.07248282432556152,
0.9632880091667175,
-1.1928240060806274,
1.0232564210891724,
-1.1132453680038452,
-0.6804186105728149,
-0.12249705195426941,
-0.1643698513507843,
-1.1145637035369873,
1.9880266189575195,
0.3176475465297699,
0.8187152147293091,
... |
func (a *Adapter) FindManagedStacks() ([]*Stack, error) {
stacks, err := findManagedStacks(a.cloudformation, a.ClusterID())
if err != nil {
return nil, err
}
targetGroupARNs := make([]string, len(stacks))
for i, stack := range stacks {
targetGroupARNs[i] = stack.targetGroupARN
}
// This call is idempotent an... | [
-0.14389392733573914,
0.24097305536270142,
0.37043893337249756,
0.2376345992088318,
0.7082488536834717,
-0.4915754497051239,
-0.30684396624565125,
-1.4225343465805054,
-0.15922704339027405,
-0.15383192896842957,
0.6873918175697327,
0.37431734800338745,
0.022914258763194084,
1.6744233369827... |
func (a *Adapter) CreateStack(certificateARN string, scheme string) (string, error) {
spec := &stackSpec{
name: a.stackName(certificateARN),
scheme: scheme,
certificateARN: certificateARN,
securityGroupID: a.SecurityGroupID(),
subnets: a.PublicSubnetIDs(),
vpcID: a.Vp... | [
0.619683027267456,
0.029537562280893326,
0.5921747088432312,
0.3670242428779602,
0.721741259098053,
-0.28379568457603455,
0.03426631540060043,
-0.3900911211967468,
-0.06497414410114288,
-0.14478431642055511,
0.14061856269836426,
0.3451409935951233,
-0.029917458072304726,
-0.080797284841537... |
func (a *Adapter) GetStack(stackID string) (*Stack, error) {
return getStack(a.cloudformation, stackID)
} | [
-0.09715749323368073,
0.8377861380577087,
0.21265514194965363,
0.9663158059120178,
0.4271790385246277,
-1.3377809524536133,
0.027883168309926987,
-1.4641993045806885,
0.3196941614151001,
-0.4433067739009857,
-0.4480617940425873,
0.9014198780059814,
0.1034434586763382,
0.03538194298744202,
... |
func (a *Adapter) MarkToDeleteStack(stack *Stack) (time.Time, error) {
t0 := time.Now().Add(a.stackTTL)
return t0, markToDeleteStack(a.cloudformation, a.stackName(stack.CertificateARN()), t0.Format(time.RFC3339))
} | [
-0.24468089640140533,
0.43174177408218384,
0.4199371039867401,
-0.23041656613349915,
0.9187003374099731,
-0.9630834460258484,
0.4199031591415405,
-0.43382683396339417,
0.30582869052886963,
0.0725630447268486,
-0.36872002482414246,
0.3792645037174225,
1.0110143423080444,
1.102914571762085,
... |
func (a *Adapter) DeleteStack(stack *Stack) error {
if err := detachTargetGroupFromAutoScalingGroup(a.autoscaling, stack.TargetGroupARN(), a.AutoScalingGroupName()); err != nil {
return fmt.Errorf("DeleteStack failed to detach: %v", err)
}
return deleteStack(a.cloudformation, stack.Name())
} | [
-0.2525952160358429,
0.4069957137107849,
0.4967397451400757,
0.1411045342683792,
-0.02981010638177395,
-0.5473394989967346,
0.4619988203048706,
-1.0653374195098877,
0.3909725844860077,
-0.38963979482650757,
0.37917739152908325,
0.42036670446395874,
0.42212939262390137,
0.3911047577857971,
... |
func NewFinder(getter storage.Getter, feed *feeds.Feed) feeds.Lookup {
return &finder{feeds.NewGetter(getter, feed)}
} | [
0.25527775287628174,
-1.2960643768310547,
0.1611713320016861,
-0.27289655804634094,
-0.7089239358901978,
-0.5677160620689392,
-0.8399028778076172,
-0.9289749264717102,
-0.1517384648323059,
-0.7602720260620117,
0.5320940613746643,
0.3617304265499115,
0.9636427164077759,
0.4023783802986145,
... |
func (f *finder) At(ctx context.Context, at, after int64) (ch swarm.Chunk, current, next feeds.Index, err error) {
for i := uint64(0); ; i++ {
u, err := f.getter.Get(ctx, &index{i})
if err != nil {
if !errors.Is(err, storage.ErrNotFound) {
return nil, nil, nil, err
}
return ch, &index{i - 1}, &index{i... | [
-1.2938874959945679,
-0.4819751977920532,
0.6519227623939514,
-0.7531825304031372,
0.09413550794124603,
-0.7087305188179016,
0.010200979188084602,
-1.3286482095718384,
-1.1321520805358887,
-0.24061988294124603,
-0.039074283093214035,
0.6636187434196472,
0.5201223492622375,
-0.0038550118915... |
func NewAsyncFinder(getter storage.Getter, feed *feeds.Feed) feeds.Lookup {
return &asyncFinder{feeds.NewGetter(getter, feed)}
} | [
0.007474355399608612,
-0.9573821425437927,
0.11994154751300812,
-0.8053630590438843,
-0.8212284445762634,
-1.1605974435806274,
-1.0333919525146484,
-0.681032657623291,
-0.2195500135421753,
-0.2101205736398697,
0.002435466507449746,
0.27738338708877563,
0.7983200550079346,
0.425689041614532... |
func (f *asyncFinder) At(ctx context.Context, at, after int64) (ch swarm.Chunk, cur, next feeds.Index, err error) {
ch, diff, err := f.get(ctx, at, 0)
if err != nil {
return nil, nil, nil, err
}
if ch == nil {
return nil, nil, nil, nil
}
if diff == 0 {
return ch, &index{0}, &index{1}, nil
}
c := make(chan... | [
-0.8930871486663818,
-1.1030759811401367,
0.9272120594978333,
-0.5158057808876038,
0.05335717275738716,
-0.43456974625587463,
0.5356450080871582,
-0.8446915149688721,
-0.6887391209602356,
0.01275285892188549,
-0.05996213108301163,
0.4946307837963104,
0.5255645513534546,
0.4237630069255829,... |
func NewUpdater(putter storage.Putter, signer crypto.Signer, topic []byte) (feeds.Updater, error) {
p, err := feeds.NewPutter(putter, signer, topic)
if err != nil {
return nil, err
}
return &updater{Putter: p}, nil
} | [
-0.11780714243650436,
-0.9418673515319824,
0.16145794093608856,
0.2577266991138458,
-1.2868471145629883,
-0.356209397315979,
-0.2776929438114166,
-0.5137790441513062,
-0.6072930693626404,
0.0714215412735939,
0.3797747492790222,
-0.33951544761657715,
-0.8934568762779236,
0.5300018191337585,... |
func (u *updater) Update(ctx context.Context, at int64, payload []byte) error {
err := u.Put(ctx, &index{u.next}, at, payload)
if err != nil {
return err
}
u.next++
return nil
} | [
-0.9278185963630676,
0.777337908744812,
0.30281320214271545,
-0.6168711185455322,
-0.6063490509986877,
0.05050753802061081,
-0.6820003986358643,
-0.9521791338920593,
0.0318160317838192,
0.06732749193906784,
-0.5031105279922485,
-0.018926123157143593,
-0.8257488012313843,
-0.485372394323349... |
func CredentialAssertionToProto(assertion *CredentialAssertion) *wantypes.CredentialAssertion {
if assertion == nil {
return nil
}
return &wantypes.CredentialAssertion{
PublicKey: &wantypes.PublicKeyCredentialRequestOptions{
Challenge: assertion.Response.Challenge,
TimeoutMs: int64(assertion.... | [
-0.06425287574529648,
-0.9511255621910095,
0.48150402307510376,
-0.2825244665145874,
-1.0134568214416504,
0.8030744194984436,
0.0041062175296247005,
0.29105812311172485,
0.20923790335655212,
-0.19012388586997986,
-0.3097647428512573,
1.061098575592041,
-0.8575084209442139,
0.33123755455017... |
func CredentialAssertionResponseToProto(car *CredentialAssertionResponse) *wantypes.CredentialAssertionResponse {
if car == nil {
return nil
}
return &wantypes.CredentialAssertionResponse{
Type: car.Type,
RawId: car.RawID,
Response: &wantypes.AuthenticatorAssertionResponse{
ClientDataJson: car.Asserti... | [
0.1808454990386963,
-1.2911603450775146,
0.4745739698410034,
-0.7685847282409668,
-0.7262526154518127,
0.13148167729377747,
0.15197710692882538,
-0.4585868716239929,
0.5364826917648315,
-0.3506980240345001,
-0.19034916162490845,
0.4320398271083832,
-1.1684620380401611,
-0.41863131523132324... |
func CredentialCreationToProto(cc *CredentialCreation) *wantypes.CredentialCreation {
if cc == nil {
return nil
}
return &wantypes.CredentialCreation{
PublicKey: &wantypes.PublicKeyCredentialCreationOptions{
Challenge: cc.Response.Challenge,
Rp: rpEntityToProto(cc.Response.... | [
0.330584853887558,
0.27011191844940186,
0.3928709030151367,
0.12179120630025864,
-0.29904910922050476,
0.4876530170440674,
-0.004776940681040287,
-0.9781841039657593,
0.3960384130477905,
-0.10542625933885574,
-0.500064492225647,
0.00216669705696404,
0.1672743707895279,
0.1367160677909851,
... |
func CredentialCreationResponseToProto(ccr *CredentialCreationResponse) *wantypes.CredentialCreationResponse {
if ccr == nil {
return nil
}
return &wantypes.CredentialCreationResponse{
Type: ccr.Type,
RawId: ccr.RawID,
Response: &wantypes.AuthenticatorAttestationResponse{
ClientDataJson: ccr.Attestati... | [
0.04974367097020149,
-0.5778540372848511,
0.27891984581947327,
-0.6624671816825867,
-0.5547545552253723,
0.08969409763813019,
0.2894512414932251,
-1.0368515253067017,
0.5094273686408997,
-0.47591081261634827,
-0.5088286399841309,
0.03240961581468582,
-0.28624629974365234,
-0.21498009562492... |
func CredentialAssertionFromProto(assertion *wantypes.CredentialAssertion) *CredentialAssertion {
if assertion == nil {
return nil
}
return &CredentialAssertion{
Response: publicKeyCredentialRequestOptionsFromProto(assertion.PublicKey),
}
} | [
0.09565237909555435,
-1.284886121749878,
0.37490540742874146,
0.3648056387901306,
-0.6330564022064209,
0.9521473050117493,
0.6697976589202881,
0.6826665997505188,
0.42573845386505127,
-1.1246541738510132,
-0.14924106001853943,
0.8827978372573853,
-1.6078953742980957,
0.6369149088859558,
... |
func CredentialAssertionResponseFromProto(car *wantypes.CredentialAssertionResponse) *CredentialAssertionResponse {
if car == nil {
return nil
}
return &CredentialAssertionResponse{
PublicKeyCredential: PublicKeyCredential{
Credential: Credential{
ID: base64.RawURLEncoding.EncodeToString(car.RawId),
... | [
0.362009733915329,
-1.691097378730774,
0.09792154282331467,
0.010919573716819286,
-0.6517435312271118,
0.5641092658042908,
0.6601345539093018,
0.46624791622161865,
0.09644817560911179,
-0.3205017149448395,
-0.5520370602607727,
0.3234700560569763,
-1.7282390594482422,
0.04087743163108826,
... |
func CredentialCreationFromProto(cc *wantypes.CredentialCreation) *CredentialCreation {
if cc == nil {
return nil
}
return &CredentialCreation{
Response: publicKeyCredentialCreationOptionsFromProto(cc.PublicKey),
}
} | [
0.3517104685306549,
-0.2630724310874939,
0.11526531726121902,
0.9534793496131897,
0.05809345841407776,
0.9083442687988281,
0.19190332293510437,
0.12714308500289917,
0.426871120929718,
-0.9209219813346863,
-0.775099515914917,
0.06673569232225418,
-0.5828927755355835,
0.24867495894432068,
... |
func CredentialCreationResponseFromProto(ccr *wantypes.CredentialCreationResponse) *CredentialCreationResponse {
if ccr == nil {
return nil
}
return &CredentialCreationResponse{
PublicKeyCredential: PublicKeyCredential{
Credential: Credential{
ID: base64.RawURLEncoding.EncodeToString(ccr.RawId),
Typ... | [
0.5153805613517761,
-0.9892236590385437,
-0.0619148388504982,
0.2945030629634857,
-0.18436163663864136,
0.5829064846038818,
0.6500178575515747,
-0.34865501523017883,
0.10209149122238159,
-0.13412469625473022,
-0.8523324728012085,
0.0089098010212183,
-0.6524853110313416,
0.19907069206237793... |
func DefaultTemplateSetup(esClient *elasticsearch.Client, archiveTemplateModifier func(*Template)) TemplateSetup {
archiveTemplateModifier(&TasquesArchiveTemplate)
return &templateSetupImpl{
esClient: esClient,
Templates: []Template{
TasquesQueuesTemplate,
TasquesArchiveTemplate,
TasquesLocksTemplate,
... | [
-0.5565465092658997,
0.5105190873146057,
0.34138500690460205,
-0.6653629541397095,
0.4758671522140503,
-0.522196888923645,
-0.31739023327827454,
1.051278829574585,
0.2964671552181244,
0.43458130955696106,
-0.7640829682350159,
-0.03118046000599861,
0.7212762236595154,
-0.4970100522041321,
... |
func (p *ProtocGenGrpcNode) Name() string {
return "grpc:grpc-node:protoc-gen-grpc-node"
} | [
-0.7964054942131042,
-0.2544909417629242,
0.6878048777580261,
-0.6827427744865417,
-0.007374286651611328,
0.8591563105583191,
0.1792713850736618,
-0.34377607703208923,
-1.2856934070587158,
1.13648521900177,
-0.07304704934358597,
0.7259228229522705,
-0.21513248980045319,
0.20096324384212494... |
func (p *ProtocGenGrpcNode) Configure(ctx *protoc.PluginContext) *protoc.PluginConfiguration {
if !protoc.HasServices(ctx.ProtoLibrary.Files()...) {
return nil
}
return &protoc.PluginConfiguration{
Label: label.New("build_stack_rules_proto", "plugin/grpc/grpc-node", "protoc-gen-grpc-node"),
Outputs: protoc.Fla... | [
-0.16701443493366241,
0.4416051208972931,
0.650497317314148,
-0.14635540544986725,
1.0128353834152222,
-0.0704660415649414,
0.6117478609085083,
-0.1553373783826828,
-0.8648406863212585,
-0.4635816514492035,
0.26624685525894165,
0.2333715260028839,
-0.8478748798370361,
0.43536195158958435,
... |
func grpcGeneratedFileName(reldir string) func(f *protoc.File) []string {
return func(f *protoc.File) []string {
name := strings.ReplaceAll(f.Name, "-", "_")
if reldir != "" {
name = path.Join(reldir, name)
}
return []string{name + "_grpc_pb.js"}
}
} | [
-0.3656243085861206,
-0.24187329411506653,
1.0714753866195679,
-0.07303163409233093,
0.4221651554107666,
1.0623674392700195,
0.5763301849365234,
0.0034053102135658264,
-0.9884297847747803,
-0.0231328085064888,
-0.6256516575813293,
0.021388396620750427,
0.37468549609184265,
0.51751863956451... |
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
} | [
0.8741579055786133,
-0.631639301776886,
0.8534528017044067,
1.2026909589767456,
0.42606523633003235,
0.8930875062942505,
-0.11484168469905853,
0.11600733548402786,
-0.7203778028488159,
-0.3646620810031891,
0.6552295088768005,
0.16867855191230774,
-0.38348233699798584,
0.8589836955070496,
... |
func expectFlag(flag, value string) {
if value == "" {
exit.WithMessage(fmt.Sprintf("You must specify the %q flag", flag))
}
} | [
0.8802822828292847,
1.3158903121948242,
0.3590822219848633,
-0.03815499320626259,
0.0878734290599823,
0.40865811705589294,
-0.574880838394165,
0.9101738333702087,
-0.7804581522941589,
-0.15006542205810547,
0.2103007435798645,
0.9685360193252563,
-0.3572138547897339,
0.9889206290245056,
-... |
func checkNoArguments(_ *cobra.Command, args []string) error {
if len(args) > 0 {
return errors.New("this command doesn't support any arguments")
}
return nil
} | [
-0.19278116524219513,
0.8299177885055542,
0.38683566451072693,
-0.07505977153778076,
0.4982609450817108,
-0.2185187041759491,
-0.450337290763855,
0.768771767616272,
-0.6640942692756653,
0.41168683767318726,
0.026973066851496696,
0.26223596930503845,
-1.6192190647125244,
1.5949983596801758,... |
func GetItems(huntID int) ([]*models.Item, *response.Error) {
itemDBs, e := db.GetItemsWithHuntID(huntID)
if itemDBs == nil {
return nil, e
}
items := make([]*models.Item, 0, len(itemDBs))
for _, itemDB := range itemDBs {
item := models.Item{ItemDB: *itemDB}
items = append(items, &item)
}
return items, e... | [
-0.4009139835834503,
0.24826811254024506,
0.33916476368904114,
1.191567301750183,
1.535312294960022,
0.4490184783935547,
0.10231297463178635,
-0.19249173998832703,
-0.6187669038772583,
0.19612768292427063,
-0.551007091999054,
0.5592005252838135,
-0.5868237018585205,
1.0744620561599731,
0... |
func GetItemsForHunt(huntID int) ([]*models.Item, *response.Error) {
itemDBs, e := db.GetItemsWithHuntID(huntID)
if itemDBs == nil {
return nil, e
}
items := make([]*models.Item, 0, len(itemDBs))
for _, v := range itemDBs {
item := models.Item{ItemDB: *v}
items = append(items, &item)
}
return items, e
} | [
-0.6499574184417725,
-0.07616589963436127,
0.31984785199165344,
1.0224915742874146,
1.4649707078933716,
0.5010613203048706,
-0.2860540747642517,
-0.2769223749637604,
-1.0597128868103027,
-0.1313086301088333,
-0.7965772151947021,
0.23664988577365875,
-0.050033360719680786,
1.047816514968872... |
func InsertItem(item *models.Item) *response.Error {
return item.Insert()
} | [
-0.671047568321228,
0.7257282137870789,
0.08403589576482773,
0.9166707992553711,
1.2413949966430664,
1.6066358089447021,
0.905034065246582,
0.40613430738449097,
-0.09559659659862518,
0.012254639528691769,
-0.6945946216583252,
-0.9136346578598022,
-0.9045701026916504,
-0.2285039871931076,
... |
func DeleteItem(env *config.Env, huntID, itemID int) *response.Error {
return db.DeleteItem(itemID, huntID)
} | [
-0.035551346838474274,
0.0023827527184039354,
0.19520634412765503,
1.4402140378952026,
1.3493443727493286,
1.3341952562332153,
0.18600285053253174,
-0.10281500220298767,
-0.5987846851348877,
0.28143325448036194,
0.35884416103363037,
0.6643455028533936,
-0.3771890699863434,
0.38800144195556... |
func UpdateItem(env *config.Env, item *models.Item) *response.Error {
return item.Update(env)
} | [
-1.1038801670074463,
-1.2491823434829712,
0.08653340488672256,
1.0539286136627197,
0.4156991243362427,
1.663988709449768,
0.401056706905365,
0.4295177459716797,
-0.5340240001678467,
1.0029397010803223,
-0.5015852451324463,
0.17159540951251984,
0.052656400948762894,
-0.6977435946464539,
0... |
func New() *FillsGrp {
var m FillsGrp
return &m
} | [
0.5950968861579895,
-0.09213217347860336,
-0.057573746889829636,
-1.1462948322296143,
-0.5743969678878784,
0.11943651735782623,
0.5884251594543457,
-1.2444024085998535,
-0.65436190366745,
-0.9696033000946045,
0.23562556505203247,
-0.05655512586236,
-0.623846173286438,
0.8146255016326904,
... |
func NewNoFills() *NoFills {
var m NoFills
return &m
} | [
0.6470942497253418,
0.11221379786729813,
-0.3941831588745117,
-0.7423686385154724,
-1.06081223487854,
-0.5503760576248169,
1.1808061599731445,
-1.1325527429580688,
-0.014669787138700485,
-1.8420757055282593,
-0.4877139627933502,
-0.6375268697738647,
-1.0914280414581299,
1.0553076267242432,... |
func base64Encode(src string) string {
return strings.
TrimRight(base64.URLEncoding.
EncodeToString([]byte(src)), "=")
} | [
-0.10746410489082336,
0.22264112532138824,
0.19602584838867188,
-0.27140331268310547,
0.27962613105773926,
0.504093587398529,
-0.6867566704750061,
0.17581845819950104,
0.3589133322238922,
1.1483266353607178,
0.37466850876808167,
0.44185420870780945,
-0.4932461082935333,
-0.1007880717515945... |
func base64Decode(src string) (string, error) {
if l := len(src) % 4; l > 0 {
src += strings.Repeat("=", 4-l)
}
decoded, err := base64.URLEncoding.DecodeString(src)
if err != nil {
errMsg := fmt.Errorf("Decoding Error %s", err)
return "", errMsg
}
return string(decoded), nil
} | [
-0.41358157992362976,
0.18921080231666565,
0.525446891784668,
-0.2570802867412567,
-0.20382529497146606,
-0.2401617020368576,
-0.5593034625053406,
0.5078956484794617,
0.3214794099330902,
0.07704712450504303,
0.35544517636299133,
-0.14163899421691895,
-0.9049068093299866,
-0.170772656798362... |
func generateHash(src, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
h.Write([]byte(src))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
} | [
0.5510672330856323,
0.35870346426963806,
0.7029160261154175,
0.6796393990516663,
0.06120553985238075,
0.2741282284259796,
-1.0287705659866333,
0.5372966527938843,
0.17453217506408691,
0.5105380415916443,
-0.6941870450973511,
0.7510367035865784,
-0.2985873520374298,
-0.34438279271125793,
... |
func getAllIPList(provider string, model store.ClusterManagerModel) map[string]struct{} {
condProd := operator.NewLeafCondition(operator.Eq, operator.M{"provider": provider})
clusterStatus := []string{common.StatusInitialization, common.StatusRunning, common.StatusDeleting}
condStatus := operator.NewLeafCondition(op... | [
-1.2638792991638184,
-0.36761313676834106,
0.7591037750244141,
0.1813589334487915,
-0.9449005722999573,
-0.09052900969982147,
-0.3130859434604645,
1.4203773736953735,
-0.14677532017230988,
0.980469286441803,
-0.3603951930999756,
-0.08666935563087463,
0.03478918597102165,
0.0474896728992462... |
func GetUserClusterPermList(user UserInfo, clusterList []string) (map[string]*proto.Permission, error) {
permissions := make(map[string]*proto.Permission)
cli := &cluster.BCSClusterPerm{}
actionIDs := []string{cluster.ClusterView.String(), cluster.ClusterManage.String(), cluster.ClusterDelete.String()}
perms, err ... | [
-0.25374048948287964,
-0.12959599494934082,
0.39683452248573303,
0.7981400489807129,
-0.45415136218070984,
-0.06147691234946251,
-0.24091637134552002,
0.0917329490184784,
0.012263104319572449,
1.0090203285217285,
-0.9661394357681274,
0.1286652684211731,
-0.7016980648040771,
0.3222052156925... |
func GetUserPermListByProjectAndCluster(user UserInfo, clusterList []string, filterUse bool) (map[string]*proto.Permission, error) {
permissions := make(map[string]*proto.Permission)
// policyCode resourceType clusterList
for _, clusterID := range clusterList {
defaultPerm := auth.GetInitPerm(true)
permission... | [
-0.49939602613449097,
-0.21687689423561096,
0.39046710729599,
1.0034843683242798,
0.0026834739837795496,
0.9802800416946411,
0.10086770355701447,
-0.0030748548451811075,
-0.5015864372253418,
1.2119067907333374,
-0.474977046251297,
-0.3006107807159424,
-0.908926784992218,
0.5307234525680542... |
func GetClusterCreatePerm(user UserInfo) map[string]bool {
permissions := make(map[string]bool)
// attention: v0 permission only support project
permissions["test"] = true
permissions["prod"] = true
permissions["create"] = true
return permissions
} | [
-0.41913312673568726,
0.5424435138702393,
0.4347449243068695,
0.4919600486755371,
0.36933112144470215,
0.744908332824707,
0.6856083273887634,
-0.010291277430951595,
-0.8072713613510132,
0.5440003871917725,
-0.3326718807220459,
-0.2728278934955597,
-0.44857916235923767,
-0.01416603568941354... |
func CheckUseNodesPermForUser(businessID string, user string, nodes []string) bool {
bizID, err := strconv.Atoi(businessID)
if err != nil {
errMsg := fmt.Errorf("strconv BusinessID to int failed: %v", err)
blog.Errorf(errMsg.Error())
return false
}
return canUseHosts(bizID, user, nodes)
} | [
0.08046047389507294,
0.5549459457397461,
0.37188780307769775,
0.5343302488327026,
-0.4556432366371155,
0.21407240629196167,
0.8152856230735779,
0.04222749173641205,
-1.2937490940093994,
0.1899474710226059,
0.7222011685371399,
0.7427182197570801,
-1.0989453792572021,
0.3553715944290161,
0... |
func importClusterExtraOperation(cluster *proto.Cluster) {
// sync cluster/cluster-snap info to pass-cc
err := passcc.GetCCClient().CreatePassCCCluster(cluster)
if err != nil {
blog.Errorf("ImportClusterExtraOperation[%s] CreatePassCCCluster failed: %v",
cluster.ClusterID, err)
}
err = passcc.GetCCClient().Cr... | [
-0.18376758694648743,
0.6818864941596985,
0.6731611490249634,
0.4812781512737274,
-0.3240112364292145,
0.41205868124961853,
1.220847487449646,
0.26848283410072327,
0.8612697124481201,
0.8193438053131104,
-0.5649444460868835,
-0.06625271588563919,
-0.047759659588336945,
-0.9736523032188416,... |
func GetSession() *mgo.Session {
if session == nil {
var err error
session, err = mgo.DialWithInfo(&mgo.DialInfo{
Addrs: []string{AppConfig.MongoDBHost},
Username: AppConfig.DBUser,
Password: AppConfig.DBPwd,
Timeout: 60 * time.Second,
})
if err != nil {
log.Fatalf("[GetSession]: %s\n", err)... | [
0.28592705726623535,
0.010082698427140713,
0.6453848481178284,
0.7140926122665405,
0.3605663478374481,
-0.2415780872106552,
-0.2461787462234497,
-0.596504271030426,
0.7568018436431885,
0.20142965018749237,
0.08920753747224808,
0.3891317844390869,
-1.043953776359558,
-0.2516520917415619,
... |
func addIndexes() {
var err error
userIndex := mgo.Index{
Key: []string{"email"},
Unique: true,
Background: true,
Sparse: true,
}
// Add indexes into MongoDB
session := GetSession().Copy()
defer session.Close()
userCol := session.DB(AppConfig.Database).C("users")
err = userCol.EnsureInde... | [
-0.0309878122061491,
0.44286730885505676,
0.49826428294181824,
0.2110794484615326,
0.4446544647216797,
1.2025082111358643,
0.4294600784778595,
0.5341963768005371,
0.0630837231874466,
0.03951922431588173,
-0.22118712961673737,
0.3718929588794708,
-0.5788257122039795,
-0.1175629273056984,
... |
func unmarshalPrio(data []byte, info *Prio) error {
return unmarshalStruct(data, info)
} | [
0.6352043151855469,
0.44034266471862793,
0.5158712267875671,
-0.3610401153564453,
-1.0390119552612305,
-0.41867247223854065,
-1.3822205066680908,
0.6578928232192993,
0.0054638199508190155,
-0.7456749677658081,
-0.7034515142440796,
-0.9172511696815491,
-0.3382628858089447,
-0.35869145393371... |
func marshalPrio(info *Prio) ([]byte, error) {
if info == nil {
return []byte{}, fmt.Errorf("Prio: %w", ErrNoArg)
}
return marshalStruct(info)
} | [
0.5207192897796631,
0.42391321063041687,
0.4053833484649658,
0.7452815771102905,
-1.158219814300537,
0.001114543410949409,
-1.0454741716384888,
0.3065841495990753,
0.5188674926757812,
-0.7181574702262878,
-0.7716877460479736,
0.18268649280071259,
-0.2021656334400177,
0.408970445394516,
0... |
func deduceWhatWeCan(restrictions [][]int) [][]int {
updatedArray, changeMade := attemptToReduce(restrictions)
for changeMade {
updatedArray, changeMade = attemptToReduce(updatedArray)
}
return updatedArray
} | [
-0.7116390466690063,
0.42423292994499207,
0.43473583459854126,
0.07704780250787735,
0.09308449923992157,
-0.6120983362197876,
0.9545937180519104,
-0.7532801628112793,
-0.05379750207066536,
0.16127213835716248,
0.388094037771225,
0.9479659795761108,
-0.09039268642663956,
1.0588350296020508,... |
func buildColumnToPossibleRestrictions(tickets []Ticket, restrictions []FieldDef) [][]int {
numberOfColumns := len(restrictions)
rowToRestrictions := make([][]int, numberOfColumns)
for i := 0; i < numberOfColumns; i++ {
rowToRestrictions[i] = buildPossibleRestrictionsForColumn(getColumn(tickets, i), restrictions)
... | [
-0.764073371887207,
0.5683897733688354,
0.5573793053627014,
-0.2247423678636551,
0.12050129473209381,
-0.39618396759033203,
0.29643192887306213,
0.08574481308460236,
-0.4556933343410492,
0.5248655676841736,
-0.4956839978694916,
-0.053983163088560104,
-0.3134823739528656,
-0.774753630161285... |
func (vb *VarBytes) Serialize(w io.Writer) error {
var varlen = VarUint{UintType: GetUintTypeByValue(vb.Len), Value: vb.Len}
if err := varlen.Serialize(w); err != nil {
return err
}
return binary.Write(w, binary.LittleEndian, vb.Bytes)
} | [
0.44704747200012207,
0.6165140271186829,
0.24417559802532196,
-0.502609372138977,
0.3212394714355469,
-0.1788337230682373,
0.44561967253685,
-0.8016582131385803,
0.18922482430934906,
0.1607988476753235,
-1.0692678689956665,
-0.03672138229012489,
-1.5345968008041382,
1.0433177947998047,
-... |
func (vb *VarBytes) Deserialize(r io.Reader) error {
var varlen VarUint
if err := varlen.Deserialize(r); err != nil {
return err
}
vb.Len = uint64(varlen.Value)
vb.Bytes = make([]byte, vb.Len)
return binary.Read(r, binary.LittleEndian, vb.Bytes)
} | [
0.4822080731391907,
0.20337501168251038,
0.3177245557308197,
-0.7769927978515625,
-0.2693287134170532,
-0.7255048155784607,
-0.3139253556728363,
-0.3531775176525116,
-0.2563260495662689,
-0.20985479652881622,
-0.7583726048469543,
-0.12077369540929794,
-1.661010980606079,
0.5181112289428711... |
func (z *zksync) Exec_Withdraw(payload *types.AssetsWithdraw, tx *types.Transaction, index int) (*types.Receipt, error) {
action := NewAction(z, tx, index)
return action.AssetWithdraw(payload, tx, index)
} | [
-0.23677437007427216,
0.2134900987148285,
0.444091796875,
-1.3822616338729858,
0.22130538523197174,
-0.6525034308433533,
0.09671652317047119,
-0.7708609700202942,
0.2078559696674347,
-0.3786711096763611,
0.39622262120246887,
0.5514743328094482,
0.5237026214599609,
-1.3980618715286255,
0.... |
func (NullEvaluator) Evaluate(ctx context.Context, input *EvaluationInput) (*EvaluationOutput, error) {
return &EvaluationOutput{
Traits: input.Traits,
}, nil
} | [
0.250547856092453,
-0.28844907879829407,
-0.015551905147731304,
-0.15393267571926117,
-0.5165557265281677,
-0.9913104772567749,
0.010412007570266724,
-0.5740517973899841,
0.0857517272233963,
-0.6249748468399048,
0.26321184635162354,
-0.016621187329292297,
-0.5397286415100098,
0.10830566287... |
func NewConfigMapReplicator(client kubernetes.Interface, resyncPeriod time.Duration, allowAll bool) Replicator {
repl := objectReplicator{
replicatorProps: replicatorProps{
Name: "config map",
allowAll: allowAll,
client: client,
targetsFrom: make(map[string][]string),
t... | [
-0.5553576350212097,
-0.5182204246520996,
0.49656641483306885,
-0.03993861377239227,
-1.327236294746399,
-0.29895278811454773,
0.1634284257888794,
0.324545294046402,
1.1601970195770264,
0.6366626620292664,
-0.4322143793106079,
0.570468008518219,
0.12152884900569916,
0.42168989777565,
0.8... |
func RequestIDFromContext(ctx context.Context) string {
return ctx.Value(requestIDKey).(string)
} | [
-0.2878437936306,
-0.7920612096786499,
-0.12929703295230865,
0.20026251673698425,
-0.9012985229492188,
0.6533769369125366,
-1.2820494174957275,
-1.245950698852539,
1.4592111110687256,
0.25820785760879517,
0.6390334963798523,
0.18448564410209656,
-0.1996833086013794,
-0.19794972240924835,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.