text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func randset(arr []T, n int) {
} | [
-0.6867746114730835,
-0.1422877311706543,
0.23154176771640778,
-0.1538585126399994,
-0.335793673992157,
-0.12190558016300201,
0.43944910168647766,
-0.6030954122543335,
0.3596994876861572,
0.6357724070549011,
-0.22382749617099762,
-0.09244115650653839,
0.4713706970214844,
0.1072874069213867... |
func choice(arr []int) int {
n := len(arr)
i := randIndex(n - 1)
return arr[i]
} | [
-0.7496099472045898,
0.03192044422030449,
0.46688997745513916,
0.2635534405708313,
-0.26979386806488037,
0.9677658081054688,
1.1279542446136475,
-0.7995761632919312,
1.0279886722564697,
0.20318593084812164,
0.16937127709388733,
0.4212109446525574,
-0.22629788517951965,
0.6680444478988647,
... |
func randIndex(n int) int {
nBits := log2roundup(n)
nBytes := nBits/8 + 1
xtraBits := nBytes*8 - nBits
// fmt.Println("MaxIndex:", n)
// fmt.Println("Num_Bits:", nBits)
// fmt.Println("Num_Bytes:", nBytes)
// fmt.Println("Extra_Bits:", xtraBits)
// result is the randomly generated index that we want to
// u... | [
-0.2505744397640228,
0.8160054683685303,
0.6714234948158264,
-0.6281751990318298,
-0.07159042358398438,
-0.19419991970062256,
0.7454295754432678,
-0.03715518116950989,
0.7097105979919434,
-0.27209246158599854,
-0.2849521040916443,
0.5882184505462646,
-0.7537521719932556,
-0.275552511215209... |
func log2roundup(n int) int {
if n <= 2 {
return -1
}
result := 1
total := 2
for total < n {
result++
total *= 2
}
return result
} | [
-1.6253496408462524,
-0.25353994965553284,
0.7424893379211426,
-0.4533223807811737,
-0.09619472920894623,
-0.49083319306373596,
0.6952638030052185,
-0.5974533557891846,
-0.5737947821617126,
-0.161508247256279,
-0.295576810836792,
0.7777203321456909,
0.4791411757469177,
0.16541391611099243,... |
func New(quality func(c *Chromosome) (float64, error)) Genetic {
return &facebook{
distribution: generateRandom,
quality: quality,
fitness: standardFitness,
selection: standardSelection,
}
} | [
0.05055186152458191,
-0.566970705986023,
0.2973170578479767,
0.9026341438293457,
-0.9086433053016663,
0.12533408403396606,
0.1033845767378807,
-0.3182346522808075,
-0.9688318967819214,
-0.8989977240562439,
-0.21634282171726227,
0.5123889446258545,
0.5484646558761597,
-0.2050660103559494,
... |
func standardFitness(population []*Chromosome, q ...float64) error {
if len(q) != 1 {
return ErrorInvalidQualityStandardFitness
}
for i := 0; i < len(population); i++ {
population[i].Fitness = population[i].Quality / q[0]
}
return nil
} | [
0.26620152592658997,
-0.0930662453174591,
0.4904228448867798,
1.19820237159729,
-0.4702403247356415,
0.9841294288635254,
0.574391782283783,
0.5280930995941162,
-0.41681382060050964,
0.0005843842518515885,
-0.8857126832008362,
-0.3077690601348877,
-0.7956616282463074,
0.09801597893238068,
... |
func NewSMSConnectorSettings(decoders []string, enabled bool, serverPhoneNumber string, ) *SMSConnectorSettings {
this := SMSConnectorSettings{}
this.Decoders = decoders
this.Enabled = enabled
this.ServerPhoneNumber = serverPhoneNumber
return &this
} | [
-0.1234385073184967,
0.0534253753721714,
0.21929238736629486,
0.38169610500335693,
-1.2081010341644287,
-0.6630514860153198,
-0.8801719546318054,
-0.18023787438869476,
0.47857174277305603,
-0.3894975483417511,
-0.8593061566352844,
-0.5884425044059753,
-1.3669670820236206,
0.727694928646087... |
func NewSMSConnectorSettingsWithDefaults() *SMSConnectorSettings {
this := SMSConnectorSettings{}
return &this
} | [
0.192632794380188,
0.40000197291374207,
-0.06113927811384201,
0.46498358249664307,
-0.06563639640808105,
-0.9195032119750977,
-0.8620927333831787,
-0.430024117231369,
0.7210793495178223,
-0.6651929616928101,
-0.816977858543396,
-1.4198015928268433,
-0.6290010213851929,
0.45004937052726746,... |
func (o *SMSConnectorSettings) GetDecoders() []string {
if o == nil {
var ret []string
return ret
}
return o.Decoders
} | [
-0.5024627447128296,
0.25027939677238464,
-0.03569735586643219,
0.5815647840499878,
0.2746903896331787,
-0.5680410861968994,
-0.6942097544670105,
-0.2321232557296753,
0.33263498544692993,
-0.9888985753059387,
-0.6030548214912415,
-0.3945603370666504,
-0.8851577043533325,
0.8293294906616211... |
func (o *SMSConnectorSettings) GetDecodersOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.Decoders, true
} | [
-0.9192407727241516,
0.8534114956855774,
0.6300833821296692,
0.16846294701099396,
-0.039955753833055496,
-0.7731748223304749,
0.024853060021996498,
0.5643150806427002,
0.10220778733491898,
-0.9617953300476074,
-1.4148058891296387,
-0.19476599991321564,
-0.09237217903137207,
0.8935691118240... |
func (o *SMSConnectorSettings) SetDecoders(v []string) {
o.Decoders = v
} | [
-0.7113821506500244,
-0.06220667436718941,
-0.2780210077762604,
-0.18718984723091125,
-0.3068045973777771,
-0.6619372963905334,
-0.8805267214775085,
-0.7225568890571594,
-0.34224894642829895,
-0.33185556530952454,
-0.9317647814750671,
-0.6784147024154663,
-0.9459721446037292,
0.91870957612... |
func (o *SMSConnectorSettings) GetEnabled() bool {
if o == nil {
var ret bool
return ret
}
return o.Enabled
} | [
0.10142987221479416,
0.5057634711265564,
0.18726691603660583,
0.6862009763717651,
0.12045446038246155,
0.42128509283065796,
0.21184946596622467,
0.7879348993301392,
0.24305112659931183,
-0.3691451847553253,
-0.5454201698303223,
-0.4655504822731018,
-1.1067888736724854,
-0.28722667694091797... |
func (o *SMSConnectorSettings) GetEnabledOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Enabled, true
} | [
0.013856039382517338,
0.21850106120109558,
0.00959513895213604,
0.7820442318916321,
-0.6091840863227844,
0.32173219323158264,
0.6514432430267334,
0.7665154337882996,
-0.22742770612239838,
0.1846923828125,
-1.3411753177642822,
-0.5786600708961487,
-0.40786367654800415,
0.40755143761634827,
... |
func (o *SMSConnectorSettings) SetEnabled(v bool) {
o.Enabled = v
} | [
-0.09183087199926376,
0.505395233631134,
-0.019380837678909302,
0.7138904929161072,
-0.7451767325401306,
0.2510729432106018,
-0.07215523719787598,
0.25749480724334717,
-0.3539482057094574,
0.6263479590415955,
-0.8894222974777222,
-0.47314438223838806,
-0.9088006019592285,
-0.13881796598434... |
func (o *SMSConnectorSettings) GetLimits() Thresholds {
if o == nil || o.Limits == nil {
var ret Thresholds
return ret
}
return *o.Limits
} | [
0.7042201161384583,
0.8868129849433899,
0.23648598790168762,
0.5678990483283997,
-0.026898490265011787,
-0.6336851119995117,
0.05696369335055351,
-0.9001010060310364,
1.1610336303710938,
-1.0273748636245728,
0.3143085837364197,
-1.0761908292770386,
-0.8755934834480286,
0.2245248556137085,
... |
func (o *SMSConnectorSettings) GetLimitsOk() (*Thresholds, bool) {
if o == nil || o.Limits == nil {
return nil, false
}
return o.Limits, true
} | [
0.35779738426208496,
0.3455905020236969,
0.08101046830415726,
0.6359159350395203,
-0.7858030200004578,
-0.28396129608154297,
0.1651940643787384,
-0.7021703720092773,
0.5521764755249023,
-0.12955942749977112,
-1.0702649354934692,
-0.8641505837440491,
0.0034226190764456987,
0.274440228939056... |
func (o *SMSConnectorSettings) HasLimits() bool {
if o != nil && o.Limits != nil {
return true
}
return false
} | [
0.8642141819000244,
1.1602129936218262,
0.1748269945383072,
-0.6407497525215149,
0.32059744000434875,
-0.2644559144973755,
-0.5488722920417786,
0.132386714220047,
0.7208266854286194,
-1.045697569847107,
-0.2870512902736664,
-1.1872615814208984,
-0.3363083004951477,
0.04191470146179199,
0... |
func (o *SMSConnectorSettings) SetLimits(v Thresholds) {
o.Limits = &v
} | [
0.9562402963638306,
0.43297046422958374,
-0.03234468773007393,
-0.011433860287070274,
-0.8584982752799988,
-0.4742385447025299,
-1.2071322202682495,
-1.8690754175186157,
0.3348735570907593,
-0.5100066065788269,
0.23669368028640747,
0.15512855350971222,
-0.4982202351093292,
-0.6547085046768... |
func (o *SMSConnectorSettings) GetServerPhoneNumber() string {
if o == nil {
var ret string
return ret
}
return o.ServerPhoneNumber
} | [
-0.018247298896312714,
-0.48739302158355713,
0.18563705682754517,
0.8609895706176758,
0.029958171769976616,
0.20134501159191132,
0.6969212293624878,
0.0638054758310318,
0.8975799679756165,
0.284965455532074,
-0.7040061354637146,
-0.6212592720985413,
-0.8638021945953369,
0.7636892795562744,... |
func (o *SMSConnectorSettings) GetServerPhoneNumberOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ServerPhoneNumber, true
} | [
0.06542717665433884,
-0.12881307303905487,
0.3555695116519928,
0.9139743447303772,
-0.2279459536075592,
-0.08020365983247757,
0.7917819619178772,
0.461782842874527,
0.08493615686893463,
1.4166980981826782,
-1.1527098417282104,
-0.8645045757293701,
0.06735597550868988,
1.0424779653549194,
... |
func (o *SMSConnectorSettings) SetServerPhoneNumber(v string) {
o.ServerPhoneNumber = v
} | [
-0.081283338367939,
-0.7368013858795166,
-0.06365470588207245,
0.06760449707508087,
-0.9489849209785461,
-0.1578727662563324,
0.3214349150657654,
-0.2711634635925293,
0.4540814459323883,
0.7490322589874268,
-1.1429871320724487,
-0.14287887513637543,
-0.42368173599243164,
1.0515999794006348... |
func New(options *Options) *Signer {
if options == nil {
options = Default()
}
if options.Logger == nil {
options.Logger = logrus.New()
}
if options.Verbose {
logs.Debug.SetOutput(os.Stderr)
options.Logger.SetLevel(logrus.DebugLevel)
}
signer := &Signer{
impl: &defaultImpl{},
options: options,
... | [
0.005713760852813721,
-0.809026837348938,
0.5799074172973633,
-0.36998602747917175,
-0.695059061050415,
-0.3534081280231476,
0.12223192304372787,
0.04399656504392624,
-0.040849607437849045,
-0.2493646889925003,
-0.3261035978794098,
-0.09576841443777084,
0.205917090177536,
1.04130220413208,... |
func (s *Signer) SetImpl(impl impl) {
s.impl = impl
} | [
-1.2115548849105835,
0.06374891102313995,
0.3359624445438385,
0.030597848817706108,
-1.2765039205551147,
0.4553859829902649,
0.6155022382736206,
0.7614278197288513,
0.08868716657161713,
0.001893496373668313,
-1.3951642513275146,
0.2836470901966095,
-0.5586190819740295,
0.9609392881393433,
... |
func (s *Signer) log() *logrus.Logger {
return s.options.Logger
} | [
-0.24096524715423584,
0.25490301847457886,
0.1715335249900818,
0.18132038414478302,
-0.49144160747528076,
-0.20255334675312042,
0.4500693380832672,
0.9046797752380371,
0.5484163165092468,
-1.2655363082885742,
-0.307882696390152,
-0.27273184061050415,
-0.5041932463645935,
0.7583246231079102... |
func (s *Signer) SignImage(reference string) (object *SignedObject, err error) {
return s.SignImageWithOptions(s.options, reference)
} | [
-0.8790426254272461,
-0.8520875573158264,
0.3823906481266022,
0.1656646728515625,
-0.7407390475273132,
-0.36376190185546875,
0.2286686897277832,
0.009408286772668362,
0.36086589097976685,
0.446112722158432,
0.20955996215343475,
-0.3515678346157074,
-0.40759745240211487,
0.6850644946098328,... |
func (s *Signer) SignImageWithOptions(options *Options, reference string) (object *SignedObject, err error) {
s.log().Infof("Signing reference: %s", reference)
// Ensure options to sign are correct
if err := options.verifySignOptions(); err != nil {
return nil, fmt.Errorf("checking signing options: %w", err)
}
... | [
-0.6655648350715637,
-0.31400245428085327,
0.6856080889701843,
0.14739088714122772,
0.5429754853248596,
-0.6252871155738831,
0.023032154887914658,
-0.06661952286958694,
0.17898039519786835,
0.8251853585243225,
0.3699188232421875,
-0.16694985330104828,
-0.7232726216316223,
0.429033309221267... |
func (s *Signer) SignFile(path string) (*SignedObject, error) {
s.log().Infof("Signing file path: %s", path)
resetFn, err := s.enableExperimental()
if err != nil {
return nil, err
}
defer resetFn()
ctx, cancel := s.options.context()
defer cancel()
// If we don't have a key path, we must ensure we can get a... | [
0.06729555130004883,
-0.5790289044380188,
0.7109209299087524,
0.08307087421417236,
0.12256006896495819,
-0.6269155144691467,
0.39328426122665405,
-0.02366987057030201,
-0.462260901927948,
0.1653512418270111,
0.1171577200293541,
-0.7472109794616699,
-0.8604943752288818,
-0.2596327066421509,... |
func (s *Signer) VerifyImage(reference string) (*SignedObject, error) {
s.log().Infof("Verifying reference: %s", reference)
item := s.signedObjs.Get(reference)
if item != nil {
return item.Value(), nil
}
res, err := s.VerifyImages(reference)
if err != nil {
return nil, fmt.Errorf("verify image: %w", err)
}... | [
-0.26646777987480164,
-0.6592779755592346,
0.5420296788215637,
0.07562880963087082,
-0.09072700142860413,
-0.49051767587661743,
0.24725651741027832,
-0.8158316612243652,
0.7980267405509949,
0.5054979920387268,
-0.40291497111320496,
-0.179772287607193,
-0.7983934879302979,
0.783402979373931... |
func (s *Signer) VerifyImages(refs ...string) (*sync.Map, error) {
s.log().Debug("Checking cache")
res := &sync.Map{}
unknownRefs := []string{}
for _, ref := range refs {
item := s.signedObjs.Get(ref)
if item != nil {
res.Store(ref, item.Value())
continue
}
unknownRefs = append(unknownRefs, ref)
}
... | [
-0.619789183139801,
-0.43740493059158325,
0.6166080236434937,
0.040463462471961975,
0.3794466257095337,
-0.12349936366081238,
0.24159552156925201,
-0.3947393596172333,
0.1420753449201584,
0.5866265296936035,
-0.1040046364068985,
0.22352279722690582,
-0.6610579490661621,
1.488856315612793,
... |
func (s *Signer) VerifyFile(path string) (*SignedObject, error) {
s.log().Infof("Verifying file path: %s", path)
resetFn, err := s.enableExperimental()
if err != nil {
return nil, err
}
defer resetFn()
ko := cliOpts.KeyOpts{
KeyRef: s.options.PublicKeyPath,
RekorURL: cliOpts.DefaultRekorURL,
}
if s.o... | [
0.42573675513267517,
-1.062450885772705,
0.8835050463676453,
0.4753294289112091,
-0.2799620032310486,
-0.25801536440849304,
0.9703655242919922,
-0.15112489461898804,
0.06743703782558441,
-0.32660651206970215,
-0.035700615495443344,
-0.7595992088317871,
-0.49882352352142334,
0.1599484086036... |
func (s *Signer) enableExperimental() (resetFn func(), err error) {
const key = "COSIGN_EXPERIMENTAL"
previousValue := s.impl.EnvDefault(key, "")
if err := s.impl.Setenv(key, "true"); err != nil {
return nil, fmt.Errorf("enable cosign experimental mode: %w", err)
}
return func() {
if err := s.impl.Setenv(key, ... | [
0.0852801725268364,
-0.14566421508789062,
0.8109144568443298,
-0.33885759115219116,
0.12148713320493698,
0.5902449488639832,
0.47184982895851135,
0.6922885775566101,
-1.1654430627822876,
1.1717158555984497,
-0.1920289397239685,
0.4323800802230835,
0.01187411043792963,
-0.428046852350235,
... |
func (s *Signer) IsImageSigned(imageRef string) (bool, error) {
item := s.signedRefs.Get(imageRef)
if item != nil {
return item.Value(), nil
}
res, err := s.impl.ImagesSigned(context.Background(), s, imageRef)
if err != nil {
return false, fmt.Errorf("check if image is signed: %w", err)
}
signed, ok := res.... | [
-1.3426618576049805,
-0.24043598771095276,
0.6439027190208435,
-0.47681567072868347,
0.06764567643404007,
-0.6456092596054077,
0.24190618097782135,
-0.18466520309448242,
0.22003109753131866,
0.9532939195632935,
-0.6194099187850952,
-0.7174609303474426,
-0.974166750907898,
0.959310293197631... |
func (s *Signer) ImagesSigned(ctx context.Context, refs ...string) (*sync.Map, error) {
s.log().Debug("Checking cache")
res := &sync.Map{}
unknownRefs := []string{}
for _, ref := range refs {
item := s.signedRefs.Get(ref)
if item != nil {
res.Store(ref, item.Value())
continue
}
unknownRefs = append(u... | [
-1.2054157257080078,
-0.34093570709228516,
0.6575791835784912,
-0.7102300524711609,
0.10574504733085632,
-0.8969372510910034,
0.07312537729740143,
-0.6823576092720032,
0.2529926598072052,
0.1168319582939148,
-0.3508046269416809,
-0.31752100586891174,
0.06747355312108994,
0.8908320069313049... |
func (s *Signer) IsFileSigned(ctx context.Context, path string) (bool, error) {
ko := cliOpts.KeyOpts{
KeyRef: s.options.PublicKeyPath,
RekorURL: cliOpts.DefaultRekorURL,
}
rClient, err := s.impl.NewRekorClient(ko.RekorURL)
if err != nil {
return false, fmt.Errorf("creating rekor client: %w", err)
}
blo... | [
-0.13213257491588593,
-0.3992977738380432,
0.8134663105010986,
-0.3760468661785126,
-0.16237464547157288,
-0.15840812027454376,
0.1526966243982315,
0.7531989216804504,
-0.6774471402168274,
0.7332146167755127,
-1.0774879455566406,
-0.6591851711273193,
-0.7911314964294434,
0.7164700627326965... |
func (s *Signer) identityToken(ctx context.Context) (string, error) {
tok := s.options.IdentityToken
if s.options.PrivateKeyPath == "" && s.options.IdentityToken == "" {
// We only attempt to pull from the providers if the option is set
if !s.options.EnableTokenProviders {
s.log().Warn("No token set in options... | [
-0.41499730944633484,
-0.5725091099739075,
0.4381353557109833,
0.1641976684331894,
0.5974414348602295,
0.1129794716835022,
0.2991816997528076,
0.4038682281970978,
1.3719671964645386,
0.2730705738067627,
0.27465933561325073,
0.704060435295105,
-0.7750667333602905,
-0.13178525865077972,
0.... |
func uncounted(counted int) string {
buf := make([]byte, dataSpace[counted])
for i := range buf {
buf[i] = byte(dataSpace[counted+1+i])
}
return string(buf)
} | [
0.5639560222625732,
-0.1515028178691864,
0.44860345125198364,
-1.2707635164260864,
-0.5377901792526245,
0.08498137444257736,
0.5190455317497253,
-0.47922447323799133,
0.1218951866030693,
-0.7779377698898315,
-0.21382653713226318,
0.6178005933761597,
0.013513664714992046,
-0.203599959611892... |
func initB() {
defineB("!", false, func() {
address := dstack.pop()
val := dstack.pop()
dataSpace[address] = val
})
defineB("*", false, func() {
x := dstack.pop()
y := dstack.pop()
dstack.push(x * y)
})
defineB("+", false, func() {
x := dstack.pop()
y := dstack.pop()
dstack.push(x + y)
})
defin... | [
0.6289037466049194,
0.7917641401290894,
1.2460678815841675,
0.23866458237171173,
-0.6378962397575378,
-0.3670364022254944,
0.4153495728969574,
-0.29761093854904175,
0.3393004238605499,
-0.3461323082447052,
-0.9922533631324768,
0.42497703433036804,
0.3462273180484772,
0.4944394826889038,
... |
func NewTemplateFinder(templateProvider templates.TemplateProvider, osMapProvider templates.OSMapProvider) *TemplateFinder {
return &TemplateFinder{
templateProvider: templateProvider,
osMapProvider: osMapProvider,
}
} | [
-0.42633000016212463,
-0.6269165277481079,
0.1795331835746765,
-0.08154863864183426,
-0.737795889377594,
-0.47456082701683044,
-0.5056626200675964,
-0.16544944047927856,
0.4363032877445221,
0.5111064314842224,
0.016349883750081062,
0.9465949535369873,
-0.6599726676940918,
0.517404735088348... |
func (f *TemplateFinder) FindTemplate(vm *ovirtsdk.Vm) (*templatev1.Template, error) {
os, err := f.findOperatingSystem(vm)
if err != nil {
return nil, err
}
workload := getWorkload(vm)
return f.getTemplate(os, workload)
} | [
-0.39027702808380127,
0.7871544361114502,
0.532400369644165,
0.6255728006362915,
-0.39304453134536743,
-0.258459210395813,
0.4242728054523468,
-0.9357903599739075,
-0.48463818430900574,
1.1188545227050781,
0.4030996859073639,
-0.5219243764877319,
-1.1937661170959473,
0.6236228942871094,
... |
func NewGetRoleScopeTagsByIdsWithIdsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, ids *string)(*GetRoleScopeTagsByIdsWithIdsRequestBuilder) {
m := &GetRoleScopeTagsByIdsWithIdsRequestBuilder{
BaseRequ... | [
-0.8565545082092285,
-0.5268880128860474,
0.46031978726387024,
-1.0789029598236084,
-0.043858785182237625,
-0.6580377817153931,
-0.20234213769435883,
-0.29830318689346313,
-0.1523200124502182,
-0.5585672855377197,
-0.18609419465065002,
0.5733538269996643,
-0.8484779596328735,
0.38344249129... |
func NewGetRoleScopeTagsByIdsWithIdsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GetRoleScopeTagsByIdsWithIdsRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewGetRoleScopeT... | [
-0.864526093006134,
-0.4536477327346802,
0.19335471093654633,
-0.007412591017782688,
0.2465806007385254,
-1.1944472789764404,
-0.722412645816803,
-0.25584134459495544,
0.4533744156360626,
-1.0041513442993164,
-0.3897823393344879,
0.19969108700752258,
-0.7062205076217651,
0.4753972887992859... |
func (m *GetRoleScopeTagsByIdsWithIdsRequestBuilder) Get(ctx context.Context, requestConfiguration *GetRoleScopeTagsByIdsWithIdsRequestBuilderGetRequestConfiguration)(GetRoleScopeTagsByIdsWithIdsResponseable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
if err != nil {
... | [
-0.7875299453735352,
-0.1585598587989807,
0.43974369764328003,
-1.4144612550735474,
0.6863206028938293,
-0.7070193290710449,
-0.8010419011116028,
-0.9552686810493469,
-0.32441815733909607,
0.4332689940929413,
-0.8477218747138977,
0.7948870658874512,
-0.5493281483650208,
0.4069439172744751,... |
func (m *GetRoleScopeTagsByIdsWithIdsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *GetRoleScopeTagsByIdsWithIdsRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee2633... | [
-0.997076153755188,
-0.14806413650512695,
0.7976198196411133,
-1.5968585014343262,
0.26378098130226135,
-0.8230123519897461,
-0.779880702495575,
-0.8460592031478882,
-0.08955047279596329,
0.16387765109539032,
-0.29344695806503296,
0.4302873909473419,
-0.4962855875492096,
0.5004709959030151... |
func Required(message ...string) required {
vl := required{}
if len(message) > 0 {
vl.Message = message[0]
} else {
vl.Message = "This field is required."
}
return vl
} | [
-0.3961118459701538,
0.22837990522384644,
0.2436130940914154,
0.4083428680896759,
0.14044496417045593,
0.688387930393219,
-0.49736514687538147,
-0.15208838880062103,
-0.07053142786026001,
-0.2849220931529999,
-0.17268875241279602,
0.6321655511856079,
-0.3579476475715637,
1.0477627515792847... |
func MaxLengthValidator(length int, message ...string) maxLengthValidator {
vl := maxLengthValidator{}
vl.Length = length
if len(message) > 0 {
vl.Message = message[0]
} else {
vl.Message = fmt.Sprintf("Ensure this value has at most %v characters.", vl.Length)
}
return vl
} | [
0.3027786314487457,
-0.3764135539531708,
0.23307108879089355,
-0.2832493185997009,
-1.0459316968917847,
0.8560613989830017,
-0.5294589400291443,
0.24708423018455505,
0.18101918697357178,
-0.33320561051368713,
0.03277722746133804,
-0.04049272835254669,
-0.746200680732727,
0.7991864681243896... |
func MinLengthValidator(length int, message ...string) minLengthValidator {
vl := minLengthValidator{}
vl.Length = length
if len(message) > 0 {
vl.Message = message[0]
} else {
vl.Message = fmt.Sprintf("Ensure this value has at least %v characters", vl.Length)
}
return vl
} | [
0.44759753346443176,
-0.6823933720588684,
0.31601861119270325,
-0.6459810137748718,
-1.1703003644943237,
0.6681836247444153,
-0.5239102840423584,
-0.264394074678421,
0.22236987948417664,
-0.6699278950691223,
-0.003766298294067383,
0.32183438539505005,
-1.1506280899047852,
0.721066713333129... |
func RegexpValidator(regex string, message ...string) regexpValidator {
vl := regexpValidator{}
re, err := regexp.Compile(regex)
if err != nil {
panic(err)
}
vl.re = re
if len(message) > 0 {
vl.Message = message[0]
} else {
vl.Message = fmt.Sprintf("Enter a valid value.")
}
return vl
} | [
0.44457465410232544,
-0.12833721935749054,
0.5853484869003296,
0.41407155990600586,
-1.0211063623428345,
0.6450973153114319,
-0.316701203584671,
0.5388975739479065,
0.08151518553495407,
-0.12629927694797516,
0.23188775777816772,
-0.22115492820739746,
-1.2177364826202393,
-0.553301334381103... |
func EmailValidator(message ...string) regexpValidator {
regex := `(?i)^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$`
if len(message) > 0 {
return RegexpValidator(regex, message[0])
} else {
return RegexpValidator(regex, "Enter a valid email address.")
}
} | [
-0.2843934893608093,
0.24041907489299774,
0.5774423480033875,
0.23489584028720856,
-0.8976325392723083,
0.41766443848609924,
0.18080191314220428,
0.19658467173576355,
-0.469129741191864,
0.24751609563827515,
0.07303143292665482,
0.3323652148246765,
-0.8987357020378113,
-0.2400958240032196,... |
func URLValidator(message ...string) regexpValidator {
regex := `^(https?|ftp)(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$`
if len(message) > 0 {
return RegexpValidator(regex, message[0])
} else {
return RegexpValidator(regex, "Enter a valid url.")
}
} | [
-0.1170767992734909,
0.022977905347943306,
0.666327178478241,
0.07600206136703491,
-0.8293491005897522,
0.7310774326324463,
0.402914822101593,
0.4957720637321472,
-0.6126824021339417,
-0.6768229007720947,
0.9188945889472961,
0.6035264730453491,
-1.0091626644134521,
0.8611165881156921,
-0... |
func Transport(p string) (tr *http.Transport, err error) {
proxyURL, err := url.Parse(p)
if err != nil {
return nil, err
}
dialer, err := proxy.SOCKS5("tcp", proxyURL.Host, getAuth(proxyURL), proxy.Direct)
if err != nil {
return nil, err
}
switch proxyURL.Scheme {
case "socks5":
tr = &http.Transport{
... | [
-0.35692834854125977,
0.3886161744594574,
0.5175462365150452,
-0.4093160331249237,
-0.6334988474845886,
0.045382387936115265,
0.4666241705417633,
-0.6680023670196533,
0.08124427497386932,
-0.09004244208335876,
-0.37632372975349426,
-0.03417421132326126,
-0.5505205392837524,
-0.409150779247... |
func Encode(data []byte, width, height int) (*image.NRGBA, error) {
// 4 bytes can be stored in every pixel (NRGBA)
maxLength := width * height * 4
if len(data) > maxLength {
return nil, fmt.Errorf("data does not fit the image size")
}
img := image.NewNRGBA(image.Rectangle{image.Point{0, 0}, image.Point{width, h... | [
-0.014358644373714924,
0.3949458599090576,
0.550640881061554,
0.1843576282262802,
-0.45746782422065735,
-0.14013218879699707,
-0.17562367022037506,
-0.9382935166358948,
0.8743083477020264,
-0.018438633531332016,
0.7759959101676941,
0.23191052675247192,
-0.8672457337379456,
0.59096598625183... |
func Decode(img *image.NRGBA, trimZeros bool) ([]byte, error) {
if trimZeros {
i := len(img.Pix) - 1
for ; img.Pix[i] == 0 && i >= 0; i-- {
}
return img.Pix[:i+1], nil
}
return img.Pix, nil
} | [
-0.3204296827316284,
-0.033664219081401825,
0.5328260064125061,
0.5750299096107483,
-0.14242275059223175,
-0.344752699136734,
0.2356056272983551,
0.0846543237566948,
1.1779309511184692,
-0.4964049756526947,
0.2574557065963745,
-0.03580852597951889,
-0.7024545073509216,
1.059310793876648,
... |
func (f Fraction) Plus(summand Fraction) (sum Fraction) {
tmp := f.normalize()
if tmp.denominator == summand.denominator {
sum = Fraction{
tmp.numerator + summand.numerator,
tmp.denominator,
}
} else {
denominator := tmp.denominator * summand.denominator
sum = Fraction{
tmp.numerator*summand.denomin... | [
0.4697512686252594,
-0.0015412044012919068,
0.8120496869087219,
-0.180854931473732,
-0.700531005859375,
0.1620716005563736,
-0.4205978214740753,
-0.6111727356910706,
0.7738441228866577,
-1.5571842193603516,
1.0144068002700806,
-0.14965392649173737,
0.0054879323579370975,
-0.341783583164215... |
func (f Fraction) Minus(subtrahend Fraction) (difference Fraction) {
tmp := f.normalize()
if tmp.denominator == subtrahend.denominator {
difference = Fraction{
tmp.numerator - subtrahend.numerator,
tmp.denominator,
}
} else {
denominator := tmp.denominator * subtrahend.denominator
difference = Fraction... | [
0.15364867448806763,
-0.10728694498538971,
0.8910857439041138,
-0.3150789141654968,
-0.673945426940918,
0.6125693321228027,
-0.4517596662044525,
-0.5101970434188843,
-0.13896259665489197,
-1.9771809577941895,
0.13445018231868744,
-0.4349963963031769,
-0.1303180456161499,
-0.086606316268444... |
func (f Fraction) Multiply(multiplicand Fraction) (product Fraction) {
tmp := f.normalize()
product = Fraction{
tmp.numerator * multiplicand.numerator, tmp.denominator * multiplicand.denominator,
}
return product.normalize()
} | [
-0.5872750878334045,
-0.15720778703689575,
0.5947777628898621,
0.7506272792816162,
-0.8709209561347961,
-0.2661377489566803,
-0.21239785850048065,
-0.7318148016929626,
0.2688654065132141,
-1.1049612760543823,
0.5938708782196045,
-0.5608741641044617,
0.16934117674827576,
-0.2925464510917663... |
func NewAPO(short, long uint, priceType string) *apo {
return &apo{
period: long,
prev: math.NaN(),
priceType: priceType,
short: NewEMA(short, priceType),
long: NewEMA(long, priceType),
}
} | [
0.43632933497428894,
-0.06219390407204628,
0.49993056058883667,
0.3899427354335785,
-1.4969720840454102,
-0.5317680835723877,
-0.5012316703796387,
-0.10216568410396576,
0.3433554768562317,
0.2335275560617447,
-0.4772558808326721,
0.5106044411659241,
1.1025110483169556,
-0.36575236916542053... |
func (ins *apo) Calculate(newData utils.OHLCV) []float64 {
newPrice := newData.GetByType(ins.priceType)
if math.IsNaN(newPrice) {
return []float64{ins.prev}
}
ins.count++
ins.prev = ins.short.Calculate(newData)[0] - ins.long.Calculate(newData)[0]
if ins.count < ins.period {
return []float64{ma... | [
-0.6847286224365234,
0.6084657311439514,
0.7802909016609192,
0.6797293424606323,
0.19694532454013824,
-0.8946385979652405,
-0.2431534230709076,
-0.4411925971508026,
0.04085013270378113,
0.5791860818862915,
-0.3677538335323334,
0.034879300743341446,
0.197352334856987,
0.8049070239067078,
... |
func (idx *Index) Drop() error {
uri := join(idx.db.Url, "schema/index", idx.Label, idx.PropertyKeys[0])
ne := NeoError{}
resp, err := idx.db.Session.Delete(uri, nil, nil, &ne)
if err != nil {
return err
}
if resp.Status() == 404 {
return NotFound
}
if resp.Status() != 204 {
return ne
}
return nil
} | [
-1.417630672454834,
0.5848149657249451,
0.5169634819030762,
0.07619135826826096,
0.6326178908348083,
0.028254644945263863,
-1.0918985605239868,
-0.6833156943321228,
0.34843769669532776,
0.26923155784606934,
0.4119734466075897,
-0.23173676431179047,
-1.0457204580307007,
-0.7992342114448547,... |
func (db *Database) CreateIndex(label, property string) (*Index, error) {
uri := join(db.Url, "schema/index", label)
payload := indexRequest{[]string{property}}
result := Index{db: db}
ne := NeoError{}
resp, err := db.Session.Post(uri, payload, &result, &ne)
if err != nil {
return nil, err
}
switch resp.Statu... | [
-0.7323191165924072,
0.12576869130134583,
0.6468811631202698,
0.10258974879980087,
0.4229021668434143,
0.46732208132743835,
-0.9309139251708984,
-0.4037279486656189,
-0.04458014667034149,
0.6700826287269592,
-0.20175901055335999,
-0.195736825466156,
-0.7874770164489746,
-0.7822028994560242... |
func (db *Database) Indexes(label string) ([]*Index, error) {
uri := join(db.Url, "schema/index", label)
result := []*Index{}
ne := NeoError{}
resp, err := db.Session.Get(uri, nil, &result, &ne)
if err != nil {
return result, err
}
if resp.Status() == 404 {
return result, NotFound
}
if resp.Status() != 200... | [
-1.5399340391159058,
0.5556685924530029,
0.411683589220047,
0.21811409294605255,
1.2016358375549316,
-0.06397120654582977,
-0.8897587060928345,
0.17854025959968567,
0.07078279554843903,
0.33947089314460754,
-0.5604642629623413,
0.42691072821617126,
-0.41777855157852173,
0.1908920556306839,... |
func (db *Database) CreateUniqueConstraint(label, property string) (*UniqueConstraint, error) {
uri := join(db.Url, "schema/constraint", label, "uniqueness")
payload := uniqueConstraintRequest{[]string{property}}
result := UniqueConstraint{db: db}
ne := NeoError{}
resp, err := db.Session.Post(uri, payload, &result... | [
-0.684625506401062,
-0.05039826035499573,
0.62317955493927,
-0.112674780189991,
-0.03688643127679825,
0.04595218598842621,
-0.5666832327842712,
-0.3245369791984558,
0.43904227018356323,
0.5065277218818665,
-0.8646559715270996,
0.366795152425766,
-1.3078038692474365,
-0.7425666451454163,
... |
func (db *Database) UniqueConstraints(label, property string) ([]*UniqueConstraint, error) {
if label == "" {
return nil, errors.New("Label cannot be empty")
}
uri := join(db.Url, "schema/constraint", label, "uniqueness", property)
result := []*UniqueConstraint{}
ne := NeoError{}
resp, err := db.Session.Get(ur... | [
-1.0929979085922241,
-0.13233792781829834,
0.5278260707855225,
0.19720344245433807,
0.4902587831020355,
0.06079443544149399,
-0.5657121539115906,
-0.21626655757427216,
0.8249454498291016,
0.7353414297103882,
-0.7467789649963379,
0.014105452224612236,
-1.410618543624878,
-0.5805558562278748... |
func (cstr *UniqueConstraint) Drop() error {
uri := join(cstr.db.Url, "schema/constraint", cstr.Label, "uniqueness", cstr.PropertyKeys[0])
ne := NeoError{}
resp, err := cstr.db.Session.Delete(uri, nil, nil, &ne)
if err != nil {
return err
}
switch resp.Status() {
case 204:
return nil
case 404:
return NotF... | [
-1.0723795890808105,
0.10493475198745728,
0.5751029253005981,
-0.06907407194375992,
0.2958764135837555,
0.18980316817760468,
-0.02881186082959175,
0.9743198156356812,
0.3376785218715668,
0.5726125836372375,
0.06957750022411346,
-0.34621283411979675,
-1.175876498222351,
-0.7277997732162476,... |
func NewAccount() *Account {
createdAccount := Account{}
newPrivateKey, err := generatePrivateKey(4096)
if err != nil {
log.Fatal("Error generating rsa private key ", err)
}
newPublicKey, err := generatePublicKey(&newPrivateKey.PublicKey)
if err != nil {
log.Fatal("Error generating rsa public key ", err)
}... | [
-0.10202101618051529,
-0.9388787150382996,
0.3489531874656677,
0.4362335503101349,
-0.047723401337862015,
-0.11202825605869293,
0.6581990718841553,
0.3660967946052551,
0.9925635457038879,
0.05245324224233627,
-0.11245663464069366,
0.7893546223640442,
-0.1780199259519577,
0.3037399351596832... |
func generatePrivateKey(bitSize int) (*rsa.PrivateKey, error) {
// Private Key generation
privateKey, err := rsa.GenerateKey(rand.Reader, bitSize)
if err != nil {
return nil, err
}
// Validate Private Key
err = privateKey.Validate()
if err != nil {
return nil, err
}
return privateKey, nil
} | [
-0.8220664262771606,
0.39791324734687805,
0.2914619445800781,
0.01577449031174183,
0.019548604264855385,
-0.08378718048334122,
0.004003926645964384,
-1.0532346963882446,
0.9337414503097534,
0.3202100992202759,
-0.21194536983966827,
-0.04233914613723755,
-1.2899937629699707,
0.8028957843780... |
func generatePublicKey(privatekey *rsa.PublicKey) ([]byte, error) {
publicRsaKey, err := ssh.NewPublicKey(privatekey)
if err != nil {
return nil, err
}
pubKeyBytes := ssh.MarshalAuthorizedKey(publicRsaKey)
return pubKeyBytes, nil
} | [
0.1293555051088333,
0.6052631139755249,
0.33326420187950134,
0.4567047953605652,
-0.17216210067272186,
-0.3066236078739166,
-0.8871474266052246,
0.2723831236362457,
0.3980919420719147,
0.5259273648262024,
-0.8446428179740906,
0.5031630992889404,
-0.5335475206375122,
1.515437126159668,
0.... |
func (ac *Account) Sign(transaction []byte) []byte {
label := []byte("")
sha1hash := sha1.New()
encryptedmsg, err := rsa.EncryptOAEP(sha1hash, rand.Reader, ac.privateKey.Public().(*rsa.PublicKey), transaction, label)
if err != nil {
log.Println(err)
}
return encryptedmsg
} | [
-0.10338079184293747,
0.13614033162593842,
0.5068325996398926,
-0.07513372600078583,
0.072594054043293,
0.5016547441482544,
-0.28587719798088074,
-0.0734172835946083,
0.665186882019043,
1.2109289169311523,
-0.19576427340507507,
-0.1263507455587387,
-0.6606048345565796,
0.2433946579694748,
... |
func newSeq(fileseq, readseq uint) uint64 {
return (uint64(fileseq) << 48) | uint64(readseq)
} | [
-0.7442312240600586,
-0.9352582693099976,
0.2784804403781891,
-0.0361986942589283,
-0.7830280065536499,
-0.6361050605773926,
-1.0770059823989868,
0.10155365616083145,
-0.309169739484787,
0.1930554211139679,
0.13668577373027802,
-0.1981152892112732,
0.12193736433982849,
0.3169008195400238,
... |
func writeGeneList(ctx context.Context, geneListOutputPath string, geneDB *fusion.GeneDB) {
out, err := file.Create(ctx, geneListOutputPath)
if err != nil {
log.Panic(err)
}
w := bufio.NewWriter(out.Writer(ctx))
min, limit := geneDB.GeneIDRange()
er := errors.Once{}
n := 0
for id := min; id < limit; id++ {
... | [
-0.3468482494354248,
-0.44452932476997375,
0.49142441153526306,
-0.18618859350681305,
0.8978809714317322,
0.3191601634025574,
-0.008310174569487572,
0.18562568724155426,
-0.7412371039390564,
-0.05864330381155014,
-0.8666777014732361,
0.13457158207893372,
0.184995636343956,
0.44699910283088... |
func readGeneList(ctx context.Context, geneDB *fusion.GeneDB, geneListInputPath string) {
data, err := file.ReadFile(ctx, geneListInputPath)
if err != nil {
log.Panic(err)
}
var genes []string
for _, line := range strings.Split(string(data), "\n") {
line = strings.TrimSpace(line)
if line != "" {
genes = a... | [
-0.3196713626384735,
0.04001447185873985,
0.49160638451576233,
-0.19666938483715057,
0.41831719875335693,
0.5046590566635132,
-0.6822082996368408,
0.8088133335113525,
-0.8528050780296326,
0.6040540337562561,
-0.016079764813184738,
0.6898518800735474,
-0.07609792798757553,
0.261746048927307... |
func DetectFusion(ctx context.Context, flags fusionFlags, opts fusion.Opts) {
var (
geneDB *fusion.GeneDB
allCandidates []fusion.Candidate
)
if flags.rioInputPath == "" {
// Generate candidates from scratch
opts.Denovo = (flags.cosmicFusionPath == "")
r1Paths := strings.Split(flags.r1, ",")
r2Path... | [
0.05493199825286865,
-0.4941757321357727,
0.7506172060966492,
1.4113911390304565,
-0.027875991538167,
-0.5637413859367371,
1.0886826515197754,
0.9559878706932068,
-0.4731934666633606,
-0.5450714826583862,
0.23047809302806854,
0.041415270417928696,
0.059121593832969666,
0.8118195533752441,
... |
func (s *Stream) Send(obj Obj) (err error) {
s.time.inSend.Store(true) // an indication for Collector to postpone cleanup
hdr := &obj.Hdr
if s.Terminated() {
err = fmt.Errorf("%s terminated(%s, %v), cannot send [%s/%s(%d)]",
s, *s.term.reason, s.term.err, hdr.Bck, hdr.ObjName, hdr.ObjAttrs.Size)
glog.Errorln(... | [
-0.12534581124782562,
-0.5566375851631165,
0.7070237994194031,
-0.15973183512687683,
-0.7411813735961914,
0.16040557622909546,
0.5558359622955322,
-1.0596342086791992,
0.3106807470321655,
0.1157810389995575,
-0.8013955950737,
0.29551810026168823,
-0.0048479437828063965,
0.28066369891166687... |
func (s *Stream) sendLoop(dryrun bool) {
for {
if s.sessST.Load() == active {
if dryrun {
s.dryrun()
} else if err := s.doRequest(); err != nil {
*s.term.reason = reasonError
s.term.err = err
break
}
}
if !s.isNextReq() {
break
}
}
s.terminate()
s.wg.Done()
// handle terminati... | [
-0.24936187267303467,
-0.5087248086929321,
0.790183424949646,
-0.05126648768782616,
-0.5225796103477478,
-0.05426923558115959,
-0.05993766337633133,
-0.8039896488189697,
0.7231548428535461,
-0.12416713684797287,
-0.14036865532398224,
0.18026918172836304,
-0.381966769695282,
0.0287579223513... |
func (s *Stream) objDone(obj *Obj, err error) {
var rc int64
if obj.prc != nil {
rc = obj.prc.Dec()
cmn.Assert(rc >= 0) // remove
}
// SCQ completion callback
if rc == 0 {
if obj.Callback != nil {
obj.Callback(obj.Hdr, obj.Reader, obj.CmplPtr, err)
} else if s.callback != nil {
s.callback(obj.Hdr, ob... | [
0.8107435703277588,
-1.2906455993652344,
1.0655157566070557,
0.23254700005054474,
-0.43025606870651245,
0.8639012575149536,
0.8450630307197571,
-0.2990886867046356,
0.7430828809738159,
0.3685755133628845,
0.054863616824150085,
0.04316847026348114,
-0.4361802041530609,
0.825190007686615,
... |
func (s *Stream) eoObj(err error) {
var obj = &s.sendoff.obj
s.Sizecur += s.sendoff.off
s.stats.Offset.Add(s.sendoff.off)
if err != nil {
goto exit
}
if s.sendoff.off != obj.Hdr.ObjAttrs.Size {
err = fmt.Errorf("%s: obj %s/%s offset %d != %d size",
s, s.sendoff.obj.Hdr.Bck, s.sendoff.obj.Hdr.ObjName, s.sen... | [
0.1758147031068802,
-0.6465384364128113,
0.8340955376625061,
-1.215505599975586,
-0.8960630297660828,
0.48103487491607666,
1.3409503698349,
-0.4263792634010315,
0.22627714276313782,
0.27395007014274597,
-0.8855827450752258,
0.20642103254795074,
0.4957915246486664,
0.7593432664871216,
0.2... |
func NewInstancePoolsAPI(m interface{}) InstancePoolsAPI {
return InstancePoolsAPI{C: m.(*common.DatabricksClient)}
} | [
-0.5218777060508728,
-0.6138100028038025,
-0.00463850749656558,
0.1582028567790985,
-0.8420052528381348,
0.08885574340820312,
0.42401522397994995,
-0.3408728241920471,
0.5379983186721802,
1.4939409494400024,
-1.0877121686935425,
0.5703794956207275,
-1.43327796459198,
-0.23050370812416077,
... |
func (a InstancePoolsAPI) Create(instancePool InstancePool) (InstancePoolAndStats, error) {
var instancePoolInfo InstancePoolAndStats
err := a.C.Post("/instance-pools/create", instancePool, &instancePoolInfo)
return instancePoolInfo, err
} | [
-1.3534154891967773,
0.043175626546144485,
0.29857948422431946,
0.20380306243896484,
-0.09082009643316269,
1.2767043113708496,
0.32983699440956116,
-0.8827491402626038,
0.2966119945049286,
0.027190743014216423,
-0.8790268301963806,
1.072461724281311,
-1.2209677696228027,
0.0779540538787841... |
func (a InstancePoolsAPI) Update(instancePoolInfo InstancePoolAndStats) error {
return a.C.Post("/instance-pools/edit", instancePoolInfo, nil)
} | [
-1.263457179069519,
-0.9766363501548767,
0.14616629481315613,
-0.11339535564184189,
-0.33133047819137573,
1.5111331939697266,
0.6482269167900085,
-0.7068008780479431,
0.02723582834005356,
0.2700309753417969,
-0.6987334489822388,
1.4792488813400269,
-1.31951904296875,
-0.3722343444824219,
... |
func (a InstancePoolsAPI) Read(instancePoolID string) (InstancePoolAndStats, error) {
var instancePoolInfo InstancePoolAndStats
err := a.C.Get("/instance-pools/get", map[string]string{
"instance_pool_id": instancePoolID,
}, &instancePoolInfo)
return instancePoolInfo, err
} | [
-0.9157501459121704,
-0.4414966404438019,
0.381501704454422,
-0.7912663817405701,
-0.43123936653137207,
1.1880075931549072,
0.018862269818782806,
-1.1068543195724487,
0.23141182959079742,
0.10856422036886215,
0.053165458142757416,
1.9636248350143433,
-0.7633943557739258,
-0.466229677200317... |
func (a InstancePoolsAPI) List() (ipl InstancePoolList, err error) {
err = a.C.Get("/instance-pools/list", nil, &ipl)
return
} | [
-1.0172216892242432,
-0.09842562675476074,
0.19604216516017914,
-0.04466834291815758,
0.2343500703573227,
0.5939865112304688,
0.06241811066865921,
-0.18193545937538147,
0.4515126347541809,
0.665321946144104,
-1.0938953161239624,
1.653710126876831,
-1.0214389562606812,
-0.3080264627933502,
... |
func (a InstancePoolsAPI) Delete(instancePoolID string) error {
return a.C.Post("/instance-pools/delete", map[string]string{
"instance_pool_id": instancePoolID,
}, nil)
} | [
-0.7283473610877991,
0.13288608193397522,
0.01563919521868229,
0.3655570447444916,
0.25433072447776794,
1.385875940322876,
0.6655998826026917,
-0.5299314856529236,
0.4139401912689209,
0.5657733082771301,
-0.9375548362731934,
1.955963373184204,
-1.657071590423584,
-0.2652541697025299,
0.0... |
func Walk(t *tree.Tree, ch chan int, sender bool) bool {
if t == nil {
return true
}
if Walk(t.Left, ch, sender) == false {
return false
}
if sender == true {
ch <- t.Value
} else {
testVal := <-ch
if testVal != t.Value {
return false
}
}
if Walk(t.Right, ch, sender) == false {
return false
... | [
-0.5999987125396729,
0.5813788175582886,
0.7331181764602661,
-0.33521878719329834,
-0.4100901484489441,
0.7400658130645752,
0.232149139046669,
-0.7152162194252014,
-0.29633042216300964,
-0.11623501032590866,
-1.2316006422042847,
-0.5913906693458557,
-0.1383596956729889,
0.8932400941848755,... |
func Same(t1, t2 *tree.Tree) bool {
ch := make(chan int)
go Walk(t1, ch, true)
return Walk(t2, ch, false)
} | [
-0.7465447187423706,
0.24864645302295685,
0.6965534687042236,
0.18574386835098267,
-0.5012512803077698,
0.9360318779945374,
0.038600996136665344,
-0.6092394590377808,
-1.5728282928466797,
0.6855860948562622,
-1.2170233726501465,
0.6245068907737732,
-1.1924947500228882,
0.25765636563301086,... |
func assignImages() {
var iconsSize = 18
SetPict(obj.ButtonExit, "")
SetPict(obj.ButtonProceed, "")
SetPict(obj.EditButtonClose, "")
SetPict(obj.EditSpinAudioDelay, "")
SetPict(obj.EditSpinAudioTrack, "")
SetPict(obj.EditSpinCutSec, "")
SetPict(obj.EditSpinCutSecDuration, "")
SetPict(obj.EditSpinSplit, "")
Se... | [
-0.9154214262962341,
-1.1461683511734009,
0.7635666728019714,
-0.32361388206481934,
-0.15344364941120148,
0.25115475058555603,
0.8035406470298767,
-0.07481201738119125,
-0.581388533115387,
0.5768046975135803,
-0.7196752429008484,
-0.3230137228965759,
-0.0505501814186573,
1.2522311210632324... |
func filterTiKVInstances(tc *v1alpha1.TidbCluster) []string {
var instances []string
for _, store := range tc.Status.TiKV.Stores {
if store.State == v1alpha1.TiKVStateUp {
instances = append(instances, store.PodName)
}
}
return instances
} | [
-1.0402097702026367,
-0.5470898747444153,
0.5145476460456848,
-0.2248973697423935,
-0.6596306562423706,
0.28237244486808777,
0.07917562872171402,
-0.03778388723731041,
0.3158359229564667,
2.234605312347412,
0.7562747597694397,
-0.004072070121765137,
-0.6927561163902283,
-0.2791516482830047... |
func checkTiKVAutoScalingInterval(sldb *sldbv1.ServerlessDB, intervalSeconds int32) (bool, error) {
if sldb.Annotations == nil {
sldb.Annotations = map[string]string{}
}
ableToScale, err := utils.CheckStsAutoScalingInterval(sldb, intervalSeconds, v1alpha1.TiKVMemberType)
if err != nil {
return false, err
}
if... | [
-0.3529171645641327,
0.2930249571800232,
0.534593403339386,
0.7615390419960022,
-0.7508566379547119,
0.6041520237922668,
-0.307139128446579,
-0.24548964202404022,
-0.8756818175315857,
1.4150038957595825,
-0.006236427929252386,
-0.13902531564235687,
-1.0916600227355957,
0.8223088383674622,
... |
func updateTacIfTiKVScale(tc *v1alpha1.TidbCluster, sldb *sldbv1.ServerlessDB, recommendedReplicas int32) error {
sldb.Annotations[utils.AnnTiKVLastAutoScalingTimestamp] = fmt.Sprintf("%d", time.Now().Unix())
tc.Spec.TiKV.Replicas = recommendedReplicas
return nil
} | [
-0.3904682397842407,
-0.34544408321380615,
0.08008608222007751,
-0.2505530118942261,
-0.29929429292678833,
0.06405086815357208,
-0.7058542966842651,
0.022458964958786964,
-1.0548123121261597,
1.564247488975525,
0.32952022552490234,
0.0013648857129737735,
0.11551447212696075,
0.284518688917... |
func (o *deleteSvcOpts) Validate() error {
return nil
} | [
0.8019253611564636,
0.45557209849357605,
0.33370232582092285,
0.7777768969535828,
0.5790295600891113,
-0.14330315589904785,
0.12167467176914215,
-0.13384120166301727,
1.258139729499817,
-0.07861113548278809,
1.2845702171325684,
-0.04774785041809082,
-0.609009861946106,
0.6530198454856873,
... |
func (o *deleteSvcOpts) Ask() error {
if o.appName != "" {
if _, err := o.store.GetApplication(o.appName); err != nil {
return err
}
} else {
if err := o.askAppName(); err != nil {
return err
}
}
if o.name != "" {
if _, err := o.store.GetService(o.appName, o.name); err != nil {
return err
}
}... | [
0.7543800473213196,
-0.3117537200450897,
0.8411105871200562,
0.8531522750854492,
-0.24226145446300507,
-0.21988102793693542,
0.17094437777996063,
-0.6006160378456116,
0.7232961058616638,
-0.1697632074356079,
0.8923501372337341,
0.9534603357315063,
0.3781879246234894,
0.6469911336898804,
... |
func (o *deleteSvcOpts) Execute() error {
wkld, err := o.store.GetWorkload(o.appName, o.name)
if err != nil {
return fmt.Errorf("get workload: %w", err)
}
envs, err := o.appEnvironments()
if err != nil {
return err
}
if err := o.deleteStacks(wkld.Type, envs); err != nil {
return err
}
// Skip removing... | [
0.6540474891662598,
0.4269073009490967,
0.6847695708274841,
0.3238734006881714,
0.76088947057724,
-0.18847274780273438,
-0.5122585296630859,
-0.9275094866752625,
0.14675481617450714,
1.043501615524292,
1.0181810855865479,
-0.4948219954967499,
-0.2843805253505707,
0.2462417185306549,
0.14... |
func (o *deleteSvcOpts) emptyECRRepos(envs []*config.Environment) error {
var uniqueRegions []string
for _, env := range envs {
if !contains(env.Region, uniqueRegions) {
uniqueRegions = append(uniqueRegions, env.Region)
}
}
// TODO: centralized ECR repo name
repoName := clideploy.RepoName(o.appName, o.name... | [
-0.48753485083580017,
0.4789282977581024,
0.48411083221435547,
-1.0674587488174438,
1.14909827709198,
-0.06932397186756134,
-0.08341822773218155,
-0.266794890165329,
0.8788118362426758,
0.6930776238441467,
-0.38001763820648193,
-0.0916832834482193,
-0.03234890103340149,
0.2680678367614746,... |
func (o *deleteSvcOpts) RecommendActions() error {
logRecommendedActions([]string{
fmt.Sprintf("Run %s to update the corresponding pipeline if it exists.",
color.HighlightCode("copilot pipeline deploy")),
})
return nil
} | [
0.1198429986834526,
-0.27352210879325867,
0.3500569462776184,
-0.3427770137786865,
0.36922338604927063,
-0.4613700807094574,
0.32368046045303345,
-0.588326632976532,
0.27296024560928345,
1.201255440711975,
0.3302176892757416,
1.607529878616333,
-0.11129263043403625,
0.038243599236011505,
... |
func buildSvcDeleteCmd() *cobra.Command {
vars := deleteSvcVars{}
cmd := &cobra.Command{
Use: "delete",
Short: "Deletes a service from an application.",
Example: `
Delete the "test" service from the application.
/code $ copilot svc delete --name test
Delete the "test" service from just the prod environ... | [
0.399558961391449,
-0.661236047744751,
0.8048881888389587,
0.25816377997398376,
0.3812982141971588,
0.24134598672389984,
0.19500580430030823,
0.23984871804714203,
0.5613411068916321,
-0.5251029133796692,
0.6191949248313904,
1.030153751373291,
-0.12477229535579681,
0.08713041990995407,
0.... |
func (this *Response) ReadAll() ([]byte, error) {
var reader io.ReadCloser
var err error
switch this.Header.Get("Content-Encoding") {
case "gzip":
reader, err = gzip.NewReader(this.Body)
if err != nil {
return nil, err
}
default:
reader = this.Body
}
defer reader.Close()
return ioutil.ReadAll(reader... | [
0.5869712233543396,
-0.9848299622535706,
0.8859639763832092,
0.722141444683075,
0.22640855610370636,
0.000859555322676897,
-1.351073980331421,
-0.8165318965911865,
0.2762904763221741,
-0.37324658036231995,
0.17699849605560303,
0.49580901861190796,
-0.8774000406265259,
0.1985383927822113,
... |
func (this *Response) ToString() (string, error) {
bytes, err := this.ReadAll()
if err != nil {
return "", err
}
return string(bytes), nil
} | [
0.6582697033882141,
-1.1084332466125488,
0.5586591958999634,
-0.638059675693512,
0.17586256563663483,
-0.13748635351657867,
-0.2216702103614807,
-1.1707297563552856,
0.6061702370643616,
-0.14910763502120972,
0.049837298691272736,
-0.3695794641971588,
-0.41913965344429016,
-1.38449311256408... |
func NewOpts() TransactionOptions {
return TransactionOptions{
Description: "",
Currency: "EUR",
}
} | [
1.1186139583587646,
-0.05104544758796692,
0.18393076956272125,
-0.6615621447563171,
-0.6094251871109009,
-1.1957982778549194,
-0.8640996813774109,
-0.7085586786270142,
0.754397451877594,
0.3829602003097534,
0.44474613666534424,
-0.19625791907310486,
-0.3478584587574005,
-0.1454378813505172... |
func New(from, to string, amount float64, opts TransactionOptions) Transaction {
return Transaction{
FromID: from,
ToID: to,
Amount: amount,
Status: "pending",
Description: opts.Description,
Currency: opts.Currency,
CreationTime: time.Now(),
UUID: uuid.New().Strin... | [
0.21415850520133972,
-0.5740945935249329,
0.4709770381450653,
-0.43083199858665466,
-0.4261014759540558,
-0.6257961392402649,
-0.6002970933914185,
-0.04598262161016464,
-0.2777310907840729,
0.013439545407891273,
-0.12218431383371353,
-0.11214940994977951,
0.5130789875984192,
-0.38129675388... |
func (t *Transaction) Stage(db *pg.DB) error {
// Ensure the sender exists
sender, err := account.GetAccountByID(t.FromID, db)
if err != nil {
log.Error(err)
return err
}
// Block funds
err = sender.Reserve(t.Amount, db)
if err != nil {
log.Error(err)
t.Delete(db)
return err
}
// Create the transacti... | [
0.6025369763374329,
1.1269510984420776,
0.8244236707687378,
-0.11748304218053818,
0.07626204192638397,
-0.3044556677341461,
0.6920716762542725,
0.2901843190193176,
-0.4500434100627899,
0.7359318137168884,
-0.18916042149066925,
-0.521047055721283,
0.19782480597496033,
0.21552908420562744,
... |
func (t *Transaction) Delete(db *pg.DB) error {
t.Status = "canceled"
_, err := db.Model(t).WherePK().Update()
if err != nil {
log.Error(err)
}
return nil
} | [
1.1850634813308716,
0.27437764406204224,
0.43136319518089294,
0.6522951126098633,
0.012575305998325348,
0.4238368272781372,
-0.38832032680511475,
1.3775718212127686,
-0.5019795298576355,
1.2756109237670898,
-0.2125612050294876,
-1.0390187501907349,
-0.37980175018310547,
-0.5984225869178772... |
func (t *Transaction) Execute(db *pg.DB) error {
// We need to ensure that both the sender and recipient exist
sender, err1 := account.GetAccountByID(t.FromID, db)
recipient, err2 := account.GetAccountByID(t.ToID, db)
if err1 != nil || err2 != nil {
t.Delete(db)
return errors.New("Failed to validate transaction... | [
-0.30862417817115784,
0.3180781304836273,
0.8355491161346436,
-0.6803610920906067,
0.2362808883190155,
-0.23539972305297852,
0.32346463203430176,
-0.008106129243969917,
-0.16664685308933258,
1.284521460533142,
-0.5273786187171936,
-1.1117712259292603,
0.03322790935635567,
-0.38773432374000... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.