query
stringlengths
7
3.85k
document
stringlengths
11
430k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
LockedCoins returns the set of coins that are not spendable (i.e. locked), defined as the vesting coins that are not delegated.
func (plva PermanentLockedAccount) LockedCoins(_ sdk.Context) sdk.Coins { return plva.BaseVestingAccount.LockedCoinsFromVesting(plva.OriginalVesting) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (pva PeriodicVestingAccount) LockedCoins(ctx sdk.Context) sdk.Coins {\n\treturn pva.BaseVestingAccount.LockedCoinsFromVesting(pva.GetVestingCoins(ctx.BlockTime()))\n}", "func (dva DelayedVestingAccount) LockedCoins(ctx sdk.Context) sdk.Coins {\n\treturn dva.BaseVestingAccount.LockedCoinsFromVesting(dva.GetV...
[ "0.75121504", "0.74375194", "0.74270487", "0.7414589", "0.68385124", "0.6392496", "0.61917114", "0.6113071", "0.58873636", "0.58075583", "0.56814134", "0.56528914", "0.56135285", "0.5559344", "0.5548731", "0.54984355", "0.5480376", "0.54703814", "0.5414903", "0.5400289", "0.5...
0.73147166
4
TrackDelegation tracks a desired delegation amount by setting the appropriate values for the amount of delegated vesting, delegated free, and reducing the overall amount of base coins.
func (plva *PermanentLockedAccount) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins) { plva.BaseVestingAccount.TrackDelegation(balance, plva.OriginalVesting, amount) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bva *BaseVestingAccount) TrackDelegation(balance, vestingCoins, amount sdk.Coins) {\n\tfor _, coin := range amount {\n\t\tbaseAmt := balance.AmountOf(coin.Denom)\n\t\tvestingAmt := vestingCoins.AmountOf(coin.Denom)\n\t\tdelVestingAmt := bva.DelegatedVesting.AmountOf(coin.Denom)\n\n\t\t// Panic if the delegat...
[ "0.8186424", "0.78992194", "0.7826971", "0.7759204", "0.7720231", "0.7715642", "0.68331814", "0.61249405", "0.57603174", "0.57438606", "0.5540563", "0.5494072", "0.5373377", "0.5255798", "0.5181217", "0.5127807", "0.5004754", "0.49716696", "0.48736444", "0.47637394", "0.47572...
0.76592255
6
GetStartTime returns zero since a permanent locked vesting account has no start time.
func (plva PermanentLockedAccount) GetStartTime() int64 { return 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (dva DelayedVestingAccount) GetStartTime() int64 {\n\treturn 0\n}", "func (va ClawbackVestingAccount) GetStartTime() int64 {\n\treturn va.StartTime\n}", "func (cva ContinuousVestingAccount) GetStartTime() int64 {\n\treturn cva.StartTime\n}", "func (pva PeriodicVestingAccount) GetStartTime() int64 {\n\tr...
[ "0.7989411", "0.77213776", "0.76390874", "0.7605982", "0.7384329", "0.7244314", "0.7236585", "0.7189344", "0.7175738", "0.7171928", "0.7160729", "0.7008172", "0.69832927", "0.6975663", "0.69752145", "0.695411", "0.69208306", "0.69165504", "0.6912835", "0.6835436", "0.6752777"...
0.82880247
0
GetEndTime returns a vesting account's end time, we return 0 to denote that a permanently locked vesting account has no end time.
func (plva PermanentLockedAccount) GetEndTime() int64 { return 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bva BaseVestingAccount) GetEndTime() int64 {\n\treturn bva.EndTime\n}", "func (o *ApplianceSetupInfoAllOf) GetEndTime() time.Time {\n\tif o == nil || o.EndTime == nil {\n\t\tvar ret time.Time\n\t\treturn ret\n\t}\n\treturn *o.EndTime\n}", "func (o *ApplianceClusterInstallPhase) GetEndTime() time.Time {\n...
[ "0.8592755", "0.7491895", "0.7327237", "0.73128647", "0.7202728", "0.71574676", "0.7140883", "0.7082313", "0.7063966", "0.7059457", "0.69634634", "0.6931381", "0.6890082", "0.67958534", "0.6728343", "0.67127305", "0.67088944", "0.6631116", "0.6616934", "0.6547994", "0.6525623...
0.8543022
1
Validate checks for errors on the account fields
func (plva PermanentLockedAccount) Validate() error { if plva.EndTime > 0 { return errors.New("permanently vested accounts cannot have an end-time") } return plva.BaseVestingAccount.Validate() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (account *Account) Validate() (map[string]interface{}, bool) {\n\n\tif !strings.Contains(account.Phone, \"+\") {\n\t\treturn u.Message(false, \"Phone Number address is required\"), false\n\t}\n\n\tif len(account.UserName) < 3 {\n\t\treturn u.Message(false, \"Username is required\"), false\n\t}\n\n\t//PhoneNum...
[ "0.6950377", "0.6660194", "0.6604518", "0.660115", "0.6589453", "0.6474401", "0.6469365", "0.6463922", "0.64215875", "0.63889915", "0.6362919", "0.63358384", "0.6252108", "0.62329525", "0.6229978", "0.61784095", "0.61675555", "0.61494285", "0.6107046", "0.6084981", "0.6062506...
0.0
-1
NewClawbackVestingAccount returns a new ClawbackVestingAccount
func NewClawbackVestingAccount(baseAcc *authtypes.BaseAccount, funder sdk.AccAddress, originalVesting sdk.Coins, startTime int64, lockupPeriods, vestingPeriods Periods) *ClawbackVestingAccount { // copy and align schedules to avoid mutating inputs lp := make(Periods, len(lockupPeriods)) copy(lp, lockupPeriods) vp :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MakeNewAccount(name string) (*MyAccount, error) {\n\tkeys, err := NewKeypair()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &MyAccount{\n\t\tFields: make(map[string]string),\n\t\tKeys: keys,\n\t\tName: name,\n\t}, nil\n}", "func (c *CoinTest) newAccount(stub shim.ChaincodeStubInterface, args...
[ "0.63165385", "0.62145144", "0.6156019", "0.6112193", "0.60393506", "0.6007511", "0.5856643", "0.58285093", "0.58285093", "0.5770267", "0.56909066", "0.561485", "0.551723", "0.5479558", "0.54709643", "0.54680747", "0.5435082", "0.54297704", "0.5414012", "0.54114395", "0.54044...
0.75940603
0
GetVestedCoins returns the total number of vested coins. If no coins are vested, nil is returned.
func (va ClawbackVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins { // It's likely that one or the other schedule will be nearly trivial, // so there should be little overhead in recomputing the conjunction each time. coins := coinsMin(va.GetUnlockedOnly(blockTime), va.GetVestedOnly(blockTime)) if coin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (plva PermanentLockedAccount) GetVestedCoins(_ time.Time) sdk.Coins {\n\treturn nil\n}", "func (pva PeriodicVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins {\n\tcoins := ReadSchedule(pva.StartTime, pva.EndTime, pva.VestingPeriods, pva.OriginalVesting, blockTime.Unix())\n\tif coins.IsZero() {\n...
[ "0.74722266", "0.73172396", "0.72161824", "0.706704", "0.6925188", "0.6750736", "0.67176706", "0.66681737", "0.6615126", "0.660531", "0.64609796", "0.5631008", "0.5568076", "0.55106115", "0.54429114", "0.5325035", "0.52657974", "0.5237786", "0.51828796", "0.51632583", "0.5131...
0.72799873
2
GetVestingCoins returns the total number of vesting coins. If no coins are vesting, nil is returned.
func (va ClawbackVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins { return va.OriginalVesting.Sub(va.GetVestedCoins(blockTime)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (vva ValidatorVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins {\n\treturn vva.OriginalVesting.Sub(vva.GetVestedCoins(blockTime))\n}", "func (cva ContinuousVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins {\n\treturn cva.OriginalVesting.Sub(cva.GetVestedCoins(blockTime))\n}", "...
[ "0.74396104", "0.726373", "0.714508", "0.7126855", "0.7010945", "0.670897", "0.66787076", "0.66363263", "0.6620459", "0.65084815", "0.6413031", "0.5598332", "0.55388", "0.5478214", "0.5397174", "0.535151", "0.53034747", "0.5291319", "0.5265547", "0.5263068", "0.52396154", "...
0.72693485
1
LockedCoins returns the set of coins that are not spendable (i.e. locked), defined as the vesting coins that are not delegated.
func (va ClawbackVestingAccount) LockedCoins(ctx sdk.Context) sdk.Coins { return va.BaseVestingAccount.LockedCoinsFromVesting(va.GetVestingCoins(ctx.BlockTime())) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (pva PeriodicVestingAccount) LockedCoins(ctx sdk.Context) sdk.Coins {\n\treturn pva.BaseVestingAccount.LockedCoinsFromVesting(pva.GetVestingCoins(ctx.BlockTime()))\n}", "func (dva DelayedVestingAccount) LockedCoins(ctx sdk.Context) sdk.Coins {\n\treturn dva.BaseVestingAccount.LockedCoinsFromVesting(dva.GetV...
[ "0.75121504", "0.74375194", "0.74270487", "0.73147166", "0.68385124", "0.6392496", "0.61917114", "0.6113071", "0.58873636", "0.58075583", "0.56814134", "0.56528914", "0.56135285", "0.5559344", "0.5548731", "0.54984355", "0.5480376", "0.54703814", "0.5414903", "0.5400289", "0....
0.7414589
3
TrackDelegation tracks a desired delegation amount by setting the appropriate values for the amount of delegated vesting, delegated free, and reducing the overall amount of base coins.
func (va *ClawbackVestingAccount) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins) { va.BaseVestingAccount.TrackDelegation(balance, va.GetVestingCoins(blockTime), amount) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bva *BaseVestingAccount) TrackDelegation(balance, vestingCoins, amount sdk.Coins) {\n\tfor _, coin := range amount {\n\t\tbaseAmt := balance.AmountOf(coin.Denom)\n\t\tvestingAmt := vestingCoins.AmountOf(coin.Denom)\n\t\tdelVestingAmt := bva.DelegatedVesting.AmountOf(coin.Denom)\n\n\t\t// Panic if the delegat...
[ "0.8186424", "0.78992194", "0.7826971", "0.7759204", "0.7720231", "0.76592255", "0.68331814", "0.61249405", "0.57603174", "0.57438606", "0.5540563", "0.5494072", "0.5373377", "0.5255798", "0.5181217", "0.5127807", "0.5004754", "0.49716696", "0.48736444", "0.47637394", "0.4757...
0.7715642
5
GetStartTime returns the time when vesting starts for a periodic vesting account.
func (va ClawbackVestingAccount) GetStartTime() int64 { return va.StartTime }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (pva PeriodicVestingAccount) GetStartTime() int64 {\n\treturn pva.StartTime\n}", "func (dva DelayedVestingAccount) GetStartTime() int64 {\n\treturn 0\n}", "func (cva ContinuousVestingAccount) GetStartTime() int64 {\n\treturn cva.StartTime\n}", "func GetStartTime() time.Time {\n\treturn startAtTime\n}", ...
[ "0.7675311", "0.7655725", "0.7410766", "0.72879225", "0.7022617", "0.6954567", "0.6840737", "0.6801517", "0.6740562", "0.66733193", "0.6625888", "0.6578882", "0.65752226", "0.656922", "0.6512452", "0.64991933", "0.6462216", "0.6451606", "0.64373773", "0.6424162", "0.64052635"...
0.7509543
2
GetVestingPeriods returns vesting periods associated with periodic vesting account.
func (va ClawbackVestingAccount) GetVestingPeriods() Periods { return va.VestingPeriods }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (pva PeriodicVestingAccount) GetVestingPeriods() Periods {\n\treturn pva.VestingPeriods\n}", "func NewPeriodicVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, startTime int64, periods Periods) *PeriodicVestingAccount {\n\tendTime := startTime\n\tfor _, p := range periods {\n\t\tendT...
[ "0.82607967", "0.53933996", "0.51751536", "0.5136177", "0.5023484", "0.49357113", "0.4917464", "0.47208306", "0.47143596", "0.45715773", "0.45275274", "0.45155838", "0.44273278", "0.44169536", "0.44071308", "0.43515027", "0.42970163", "0.41897523", "0.41696903", "0.41315487", ...
0.8009713
1
coinEq returns whether two Coins are equal. The IsEqual() method can panic.
func coinEq(a, b sdk.Coins) bool { return a.IsAllLTE(b) && b.IsAllLTE(a) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (coin Coin) IsEqual(other Coin) bool {\n\treturn coin.Amount.Equal(other.Amount)\n}", "func (v Coin) Equal(o Coin) bool {\n\treturn v.Amount.Equal(o.Amount) &&\n\t\tv.CoinIdentifier.Equal(o.CoinIdentifier)\n}", "func (n *Uint256) Eq(n2 *Uint256) bool {\n\treturn n.n[0] == n2.n[0] && n.n[1] == n2.n[1] && n...
[ "0.70465946", "0.6923523", "0.60608363", "0.60347974", "0.6028179", "0.60094017", "0.5901305", "0.58853287", "0.58778554", "0.5840299", "0.58085173", "0.5762222", "0.5661418", "0.5580482", "0.5563641", "0.5520213", "0.54485756", "0.5405266", "0.54030937", "0.5394832", "0.5368...
0.74850535
0
Validate checks for errors on the account fields
func (va ClawbackVestingAccount) Validate() error { if va.GetStartTime() >= va.GetEndTime() { return errors.New("vesting start-time must be before end-time") } lockupEnd := va.StartTime lockupCoins := sdk.NewCoins() for _, p := range va.LockupPeriods { lockupEnd += p.Length lockupCoins = lockupCoins.Add(p.A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (account *Account) Validate() (map[string]interface{}, bool) {\n\n\tif !strings.Contains(account.Phone, \"+\") {\n\t\treturn u.Message(false, \"Phone Number address is required\"), false\n\t}\n\n\tif len(account.UserName) < 3 {\n\t\treturn u.Message(false, \"Username is required\"), false\n\t}\n\n\t//PhoneNum...
[ "0.6950377", "0.6660194", "0.6604518", "0.660115", "0.6589453", "0.6474401", "0.6469365", "0.6463922", "0.64215875", "0.63889915", "0.6362919", "0.63358384", "0.6252108", "0.62329525", "0.6229978", "0.61784095", "0.61675555", "0.61494285", "0.6107046", "0.6084981", "0.6062506...
0.5430431
71
MarshalYAML returns the YAML representation of a ClawbackVestingAccount.
func (va ClawbackVestingAccount) MarshalYAML() (interface{}, error) { accAddr, err := sdk.AccAddressFromBech32(va.Address) if err != nil { return nil, err } out := vestingAccountYAML{ Address: accAddr, AccountNumber: va.AccountNumber, PubKey: getPKString(va), Sequence: va.Se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bva BaseVestingAccount) MarshalYAML() (interface{}, error) {\n\taccAddr, err := sdk.AccAddressFromBech32(bva.Address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := vestingAccountYAML{\n\t\tAddress: accAddr,\n\t\tAccountNumber: bva.AccountNumber,\n\t\tPubKey: getPKString(bva),...
[ "0.81687456", "0.8013179", "0.78075606", "0.77150255", "0.63062006", "0.6222024", "0.61517715", "0.6118727", "0.60633063", "0.60269654", "0.5953029", "0.5952517", "0.5855554", "0.5855083", "0.5827823", "0.5779316", "0.5734564", "0.571303", "0.5689044", "0.5630494", "0.5589824...
0.848191
0
NewClawbackGrantAction returns an AddGrantAction for a ClawbackVestingAccount.
func NewClawbackGrantAction( funderAddress string, sk StakingKeeper, grantStartTime int64, grantLockupPeriods, grantVestingPeriods []Period, grantCoins sdk.Coins, ) exported.AddGrantAction { return clawbackGrantAction{ funderAddress: funderAddress, sk: sk, grantStartTime: grantSt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewClawbackAction(requestor, dest sdk.AccAddress, ak AccountKeeper, bk BankKeeper, sk StakingKeeper) exported.ClawbackAction {\n\treturn clawbackAction{\n\t\trequestor: requestor,\n\t\tdest: dest,\n\t\tak: ak,\n\t\tbk: bk,\n\t\tsk: sk,\n\t}\n}", "func NewClawbackRewardAction(ak Acc...
[ "0.64638203", "0.61863166", "0.5534939", "0.529289", "0.5087931", "0.50345194", "0.47454304", "0.46657106", "0.4555626", "0.4545793", "0.45320782", "0.44856998", "0.4456182", "0.4451843", "0.43959028", "0.43657944", "0.43611333", "0.4357266", "0.43521774", "0.43518445", "0.43...
0.7976986
0
AddToAccount implements the exported.AddGrantAction interface. It checks that rawAccount is a ClawbackVestingAccount with the same funder and adds the described Grant to it.
func (cga clawbackGrantAction) AddToAccount(ctx sdk.Context, rawAccount exported.VestingAccount) error { cva, ok := rawAccount.(*ClawbackVestingAccount) if !ok { return sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "account %s must be a ClawbackVestingAccount, got %T", rawAccount.GetAddress(), rawAccount) } if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (pga periodicGrantAction) AddToAccount(ctx sdk.Context, rawAccount exported.VestingAccount) error {\n\tpva, ok := rawAccount.(*PeriodicVestingAccount)\n\tif !ok {\n\t\treturn sdkerrors.Wrapf(sdkerrors.ErrNotSupported,\n\t\t\t\"account %s must be a PeriodicVestingAccount, got %T\",\n\t\t\trawAccount.GetAddress...
[ "0.70387936", "0.6084376", "0.58506024", "0.5656218", "0.5626727", "0.5414569", "0.5300817", "0.51898015", "0.511495", "0.50976485", "0.5083623", "0.5055534", "0.49965897", "0.48901007", "0.48723358", "0.48572427", "0.48206356", "0.4800977", "0.4778801", "0.47696823", "0.4769...
0.7568594
0
addGrant merges a new clawback vesting grant into an existing ClawbackVestingAccount.
func (va *ClawbackVestingAccount) addGrant(ctx sdk.Context, sk StakingKeeper, grantStartTime int64, grantLockupPeriods, grantVestingPeriods []Period, grantCoins sdk.Coins) { // how much is really delegated? bondedAmt := sk.GetDelegatorBonded(ctx, va.GetAddress()) unbondingAmt := sk.GetDelegatorUnbonding(ctx, va.GetA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (pva *PeriodicVestingAccount) AddGrant(ctx sdk.Context, action exported.AddGrantAction) error {\n\treturn action.AddToAccount(ctx, pva)\n}", "func (pva *PeriodicVestingAccount) addGrant(ctx sdk.Context, sk StakingKeeper, grantStartTime int64, grantVestingPeriods []Period, grantCoins sdk.Coins) {\n\t// how m...
[ "0.7331163", "0.7113666", "0.55019873", "0.5447035", "0.54171383", "0.539944", "0.53757775", "0.528504", "0.5252317", "0.52441466", "0.52223444", "0.5207451", "0.5137339", "0.51206416", "0.50980806", "0.5086144", "0.49832323", "0.49606624", "0.4951147", "0.49187273", "0.48713...
0.73836535
0
GetFunder implements the exported.ClawbackVestingAccountI interface.
func (va ClawbackVestingAccount) GetFunder() sdk.AccAddress { addr, err := sdk.AccAddressFromBech32(va.FunderAddress) if err != nil { panic(err) } return addr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (svc *Service) GetFundsForProposalByFunder(req client.GetFundsForProposalByFunderRequest, reply *client.GetFundsForProposalByFunderReply) error {\n\t// Validate parameters\n\terr := req.Funder.Err()\n\tif err != nil {\n\t\treturn errors.New(\"invalid funder address\")\n\t}\n\n\tamount := svc.proposalMaster.Pr...
[ "0.52361333", "0.5219271", "0.5107116", "0.49333978", "0.48144346", "0.47565222", "0.47532547", "0.46947348", "0.46947348", "0.46947348", "0.46271998", "0.46200928", "0.45988363", "0.4598473", "0.45913786", "0.4580138", "0.45723897", "0.4563494", "0.45597363", "0.45284525", "...
0.82736015
0
GetUnlockedOnly implements the exported.ClawbackVestingAccountI interface. It returns the unlocking schedule at blockTIme. Like GetVestedCoins, but only for the lockup component.
func (va ClawbackVestingAccount) GetUnlockedOnly(blockTime time.Time) sdk.Coins { return ReadSchedule(va.StartTime, va.EndTime, va.LockupPeriods, va.OriginalVesting, blockTime.Unix()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (va ClawbackVestingAccount) GetVestedOnly(blockTime time.Time) sdk.Coins {\n\treturn ReadSchedule(va.StartTime, va.EndTime, va.VestingPeriods, va.OriginalVesting, blockTime.Unix())\n}", "func (_Constants *ConstantsCallerSession) UnstakeLockPeriod() (*big.Int, error) {\n\treturn _Constants.Contract.UnstakeLo...
[ "0.67690635", "0.5902726", "0.5877758", "0.5756858", "0.5283301", "0.5265267", "0.5147104", "0.5132386", "0.5092646", "0.50746304", "0.50555545", "0.50017166", "0.49906853", "0.49503067", "0.49447116", "0.49404284", "0.4913754", "0.49131387", "0.4903401", "0.4901039", "0.4900...
0.8647829
0
GetVestedOnly implements the exported.ClawbackVestingAccountI interface. It returns the vesting schedule and blockTime. Like GetVestedCoins, but only for the vesting (in the clawback sense) component.
func (va ClawbackVestingAccount) GetVestedOnly(blockTime time.Time) sdk.Coins { return ReadSchedule(va.StartTime, va.EndTime, va.VestingPeriods, va.OriginalVesting, blockTime.Unix()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (va ClawbackVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins {\n\t// It's likely that one or the other schedule will be nearly trivial,\n\t// so there should be little overhead in recomputing the conjunction each time.\n\tcoins := coinsMin(va.GetUnlockedOnly(blockTime), va.GetVestedOnly(blockTime...
[ "0.67785037", "0.67503226", "0.66144603", "0.6596947", "0.65359217", "0.6487381", "0.64839846", "0.64474326", "0.64271235", "0.64212775", "0.6202558", "0.61998135", "0.6146275", "0.5791093", "0.52322394", "0.50997275", "0.5037106", "0.5030548", "0.49749142", "0.49297792", "0....
0.8709211
0
computeClawback removes all future vesting events from the account, returns the total sum of these events. When removing the future vesting events, the lockup schedule will also have to be capped to keep the total sums the same. (But future unlocking events might be preserved if they unlock currently vested coins.) If ...
func (va *ClawbackVestingAccount) computeClawback(clawbackTime int64) sdk.Coins { // Compute the truncated vesting schedule and amounts. // Work with the schedule as the primary data and recompute derived fields, e.g. OriginalVesting. vestTime := va.StartTime totalVested := sdk.NewCoins() totalUnvested := sdk.NewC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (va *ClawbackVestingAccount) clawback(ctx sdk.Context, dest sdk.AccAddress, ak AccountKeeper, bk BankKeeper, sk StakingKeeper) error {\n\t// Compute the clawback based on the account state only, and update account\n\ttoClawBack := va.computeClawback(ctx.BlockTime().Unix())\n\tif toClawBack.IsZero() {\n\t\tret...
[ "0.6719768", "0.5626019", "0.5324699", "0.52189773", "0.5140744", "0.50596994", "0.5059033", "0.504977", "0.48822775", "0.48712832", "0.4870118", "0.48615333", "0.48471743", "0.4828697", "0.48089796", "0.4786879", "0.47522268", "0.4720129", "0.47145593", "0.47144145", "0.4701...
0.80608404
0
updateDelegation returns an account with its delegation bookkeeping modified for clawback, given the current disposition of the account's bank and staking state. Also returns the modified amount to claw back. Computation steps: first, compute the total amount in bonded and unbonding states, used for BaseAccount bookkee...
func (va *ClawbackVestingAccount) updateDelegation(encumbered, toClawBack, bonded, unbonding, unbonded sdk.Coins) sdk.Coins { delegated := bonded.Add(unbonding...) oldDelegated := va.DelegatedVesting.Add(va.DelegatedFree...) slashed := oldDelegated.Sub(coinsMin(delegated, oldDelegated)) total := delegated.Add(unbon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (k Keeper) TransferDelegation(ctx sdk.Context, valAddr sdk.ValAddress, fromDelegator, toDelegator sdk.AccAddress, shares sdk.Dec) (sdk.Dec, error) {\n\t// Redelegations link a delegation to it's previous validator so slashes are propagated to the new validator.\n\t// If the delegation is transferred to a new ...
[ "0.63843423", "0.6348469", "0.63280714", "0.6127292", "0.6099896", "0.59851784", "0.5903084", "0.5901659", "0.58393365", "0.57900774", "0.5761572", "0.5679458", "0.5625733", "0.562472", "0.55934227", "0.5562052", "0.55510765", "0.5547109", "0.55152845", "0.55124575", "0.54277...
0.8535179
0
NewClawbackAction returns an exported.ClawbackAction for ClawbackVestingAccount.
func NewClawbackAction(requestor, dest sdk.AccAddress, ak AccountKeeper, bk BankKeeper, sk StakingKeeper) exported.ClawbackAction { return clawbackAction{ requestor: requestor, dest: dest, ak: ak, bk: bk, sk: sk, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewClawbackGrantAction(\n\tfunderAddress string,\n\tsk StakingKeeper,\n\tgrantStartTime int64,\n\tgrantLockupPeriods, grantVestingPeriods []Period,\n\tgrantCoins sdk.Coins,\n) exported.AddGrantAction {\n\treturn clawbackGrantAction{\n\t\tfunderAddress: funderAddress,\n\t\tsk: sk,\n\t\tg...
[ "0.734408", "0.724161", "0.60927427", "0.5704581", "0.54267293", "0.5386312", "0.51870364", "0.5036263", "0.50139284", "0.49548915", "0.4951062", "0.49484608", "0.4876492", "0.48602346", "0.4833887", "0.48318735", "0.48297027", "0.47833982", "0.4767467", "0.47623938", "0.4719...
0.8150347
0
TakeFromAccount implements the exported.ClawbackAction interface. It returns an error if the account is not at ClawbackVestingAccount or if the funder does not match.
func (ca clawbackAction) TakeFromAccount(ctx sdk.Context, rawAccount exported.VestingAccount) error { cva, ok := rawAccount.(*ClawbackVestingAccount) if !ok { return sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "clawback expects *ClawbackVestingAccount, got %T", rawAccount) } if ca.requestor.String() != cva.FunderA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (va *ClawbackVestingAccount) clawback(ctx sdk.Context, dest sdk.AccAddress, ak AccountKeeper, bk BankKeeper, sk StakingKeeper) error {\n\t// Compute the clawback based on the account state only, and update account\n\ttoClawBack := va.computeClawback(ctx.BlockTime().Unix())\n\tif toClawBack.IsZero() {\n\t\tret...
[ "0.6373067", "0.61946815", "0.52225226", "0.5115219", "0.5063567", "0.50280553", "0.50247216", "0.5002626", "0.49813092", "0.49658814", "0.4900447", "0.48946452", "0.48875058", "0.48761022", "0.48605388", "0.48496777", "0.48311484", "0.48254326", "0.48169035", "0.48071176", "...
0.8336627
0
Clawback transfers unvested tokens in a ClawbackVestingAccount to dest. Future vesting events are removed. Unstaked tokens are simply sent. Unbonding and staked tokens are transferred with their staking state intact. Account state is updated to reflect the removals.
func (va *ClawbackVestingAccount) clawback(ctx sdk.Context, dest sdk.AccAddress, ak AccountKeeper, bk BankKeeper, sk StakingKeeper) error { // Compute the clawback based on the account state only, and update account toClawBack := va.computeClawback(ctx.BlockTime().Unix()) if toClawBack.IsZero() { return nil } ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (_SweetToken *SweetTokenTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) {\n\treturn _SweetToken.contract.Transact(opts, \"transfer\", dst, wad)\n}", "func (_SweetToken *SweetTokenSession) Transfer(dst common.Address, wad *big.Int) (*types.Transacti...
[ "0.59044206", "0.58445424", "0.58438736", "0.5824221", "0.5764436", "0.5750469", "0.5714623", "0.5655064", "0.5607176", "0.5605843", "0.55872256", "0.5583866", "0.556326", "0.55429995", "0.5541394", "0.5541394", "0.55385965", "0.5532491", "0.552686", "0.55218875", "0.5501367"...
0.61959475
0
distributeReward adds the reward to the future vesting schedule in proportion to the future vesting staking tokens.
func (va ClawbackVestingAccount) distributeReward(ctx sdk.Context, ak AccountKeeper, bondDenom string, reward sdk.Coins) { now := ctx.BlockTime().Unix() t := va.StartTime firstUnvestedPeriod := 0 unvestedTokens := sdk.ZeroInt() for i, period := range va.VestingPeriods { t += period.Length if t <= now { firs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (_BondedECDSAKeep *BondedECDSAKeepTransactor) DistributeETHReward(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _BondedECDSAKeep.contract.Transact(opts, \"distributeETHReward\")\n}", "func (_BondedECDSAKeep *BondedECDSAKeepTransactorSession) DistributeETHReward() (*types.Transaction, erro...
[ "0.6758821", "0.64290905", "0.6397762", "0.63100404", "0.60241735", "0.59990525", "0.59793544", "0.5928813", "0.585137", "0.57938814", "0.5633375", "0.5522693", "0.54059565", "0.537793", "0.5369064", "0.5322376", "0.5290096", "0.52899516", "0.5289859", "0.52838886", "0.528256...
0.7879191
0
scaleCoins scales the given coins, rounding down.
func scaleCoins(coins sdk.Coins, scale sdk.Dec) sdk.Coins { scaledCoins := sdk.NewCoins() for _, coin := range coins { amt := coin.Amount.ToDec().Mul(scale).TruncateInt() // round down scaledCoins = scaledCoins.Add(sdk.NewCoin(coin.Denom, amt)) } return scaledCoins }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (blk *Block) Scale(sx, sy float64) {\n\tops := contentstream.NewContentCreator().\n\t\tScale(sx, sy).\n\t\tOperations()\n\n\t*blk.contents = append(*ops, *blk.contents...)\n\tblk.contents.WrapIfNeeded()\n\n\tblk.width *= sx\n\tblk.height *= sy\n}", "func (k Keeper) MintCoins(ctx sdk.Context, newCoins sdk.Co...
[ "0.53646266", "0.5312407", "0.5284086", "0.5185207", "0.51215756", "0.50750524", "0.5065373", "0.50019264", "0.49968642", "0.49823198", "0.49739826", "0.48987997", "0.4869174", "0.48599055", "0.4815493", "0.48011187", "0.47879016", "0.47696072", "0.47589323", "0.47524524", "0...
0.8575942
0
intMin returns the minimum of its arguments.
func intMin(a, b sdk.Int) sdk.Int { if a.GT(b) { return b } return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MinInt(a ...int) int {\n\tswitch len(a) {\n\tcase 0:\n\t\treturn 0\n\tcase 1:\n\t\treturn a[0]\n\tcase 2:\n\t\tif a[0] > a[1] {\n\t\t\treturn a[1]\n\t\t} else {\n\t\t\treturn a[0]\n\t\t}\n\tdefault:\n\t\tmin := math.MaxInt32\n\t\tfor _, i := range a {\n\t\t\tif i < min {\n\t\t\t\tmin = i\n\t\t\t}\n\t\t}\n\t\t...
[ "0.84761566", "0.83848757", "0.83676636", "0.8266599", "0.8205421", "0.8192152", "0.8164177", "0.8159744", "0.8159744", "0.8159744", "0.81228924", "0.80882347", "0.8054223", "0.8054223", "0.8051462", "0.8035539", "0.80338305", "0.80289274", "0.80289274", "0.80289274", "0.8028...
0.78345966
36
NewClawbackRewardAction returns an exported.RewardAction for a ClawbackVestingAccount.
func NewClawbackRewardAction(ak AccountKeeper, bk BankKeeper, sk StakingKeeper) exported.RewardAction { return clawbackRewardAction{ ak: ak, bk: bk, sk: sk, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewClawbackAction(requestor, dest sdk.AccAddress, ak AccountKeeper, bk BankKeeper, sk StakingKeeper) exported.ClawbackAction {\n\treturn clawbackAction{\n\t\trequestor: requestor,\n\t\tdest: dest,\n\t\tak: ak,\n\t\tbk: bk,\n\t\tsk: sk,\n\t}\n}", "func NewClawbackGrantAction(\n\tfun...
[ "0.7404201", "0.6953166", "0.5464461", "0.53948647", "0.5364549", "0.52774936", "0.5242982", "0.51873976", "0.5161824", "0.51156837", "0.5114475", "0.5087842", "0.5044298", "0.4955228", "0.49131867", "0.48881137", "0.4860685", "0.48492974", "0.48389384", "0.48261693", "0.4807...
0.8147421
0
ProcessReward implements the exported.RewardAction interface.
func (cra clawbackRewardAction) ProcessReward(ctx sdk.Context, reward sdk.Coins, rawAccount exported.VestingAccount) error { cva, ok := rawAccount.(*ClawbackVestingAccount) if !ok { return sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "expected *ClawbackVestingAccount, got %T", rawAccount) } cva.postReward(ctx, rewa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (vi *votedInfo) CalculateReward(multiplier, divider *big.Int, period int) {\n\tif multiplier.Sign() == 0 || period == 0 {\n\t\treturn\n\t}\n\tif divider.Sign() == 0 || vi.totalBondedDelegation.Sign() == 0 {\n\t\treturn\n\t}\n\t// reward = multiplier * period * bondedDelegation / (divider * totalBondedDelegati...
[ "0.6228627", "0.6163718", "0.60478336", "0.603172", "0.6024607", "0.5981112", "0.5969014", "0.59682953", "0.59496", "0.59159184", "0.5895051", "0.5894164", "0.5851955", "0.5822973", "0.57389563", "0.56443095", "0.5625199", "0.5603768", "0.5591688", "0.55578643", "0.5497458", ...
0.78040135
0
PostReward implements the exported.ClawbackVestingAccountI interface.
func (va *ClawbackVestingAccount) PostReward(ctx sdk.Context, reward sdk.Coins, action exported.RewardAction) error { return action.ProcessReward(ctx, reward, va) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (va ClawbackVestingAccount) postReward(ctx sdk.Context, reward sdk.Coins, ak AccountKeeper, bk BankKeeper, sk StakingKeeper) {\n\t// Find the scheduled amount of vested and unvested staking tokens\n\tbondDenom := sk.BondDenom(ctx)\n\tvested := ReadSchedule(va.StartTime, va.EndTime, va.VestingPeriods, va.Origi...
[ "0.7498109", "0.6607101", "0.5900165", "0.574824", "0.5748048", "0.5657382", "0.5594524", "0.5589504", "0.55825084", "0.54884845", "0.54612577", "0.525241", "0.5206265", "0.5183272", "0.5154278", "0.5114508", "0.510423", "0.5094205", "0.5076016", "0.5053601", "0.5036061", "...
0.85944164
0
postReward encumbers a previouslydeposited reward according to the current vesting apportionment of staking. Note that rewards might be unvested, but are unlocked.
func (va ClawbackVestingAccount) postReward(ctx sdk.Context, reward sdk.Coins, ak AccountKeeper, bk BankKeeper, sk StakingKeeper) { // Find the scheduled amount of vested and unvested staking tokens bondDenom := sk.BondDenom(ctx) vested := ReadSchedule(va.StartTime, va.EndTime, va.VestingPeriods, va.OriginalVesting,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (va *ClawbackVestingAccount) PostReward(ctx sdk.Context, reward sdk.Coins, action exported.RewardAction) error {\n\treturn action.ProcessReward(ctx, reward, va)\n}", "func (va ClawbackVestingAccount) distributeReward(ctx sdk.Context, ak AccountKeeper, bondDenom string, reward sdk.Coins) {\n\tnow := ctx.Bloc...
[ "0.7543883", "0.6046861", "0.59213", "0.5888484", "0.569692", "0.5377273", "0.53159016", "0.51158017", "0.5068981", "0.49706677", "0.49703842", "0.49670628", "0.49598822", "0.49169713", "0.49141806", "0.49058503", "0.49056473", "0.48940882", "0.48806125", "0.4861055", "0.4859...
0.7991568
0
handle first http connect, and convert connect to websocket
func (ws *WS)HandleConn(conn net.Conn, authConn *AuthConns, dealmsg func([]byte)bool){ defer conn.Close() buf := make([]byte, 1024) bufChan := make(chan []byte, 10) defer close(bufChan) go ws.HandleWS(bufChan, authConn, dealmsg) for{ _, err := conn.Read(buf) if err != nil{ if err != io.EOF{ //if client ws ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func serveWebSocket(w http.ResponseWriter, r *http.Request){\n if r.Method != \"GET\" {\n http.Error(w, \"Method not allowed\", 405)\n return\n }\n ws, err := upgrader.Upgrade(w, r, nil)\n if err != nil {\n log.Println(err)\n return\n }\n c := &Connection{send: make(ch...
[ "0.6909302", "0.68113315", "0.6766838", "0.6753222", "0.6626202", "0.66035175", "0.6556864", "0.6526347", "0.65038013", "0.64528245", "0.64516246", "0.6439596", "0.6414564", "0.6411506", "0.6399498", "0.63830733", "0.6383055", "0.63786024", "0.63679075", "0.6355151", "0.63472...
0.58464557
97
NewDiamond builds a new diamond instance. The default diamond gets populated with a random KSUID as diamondID. Default diamond has cnflicts handling enabled.
func NewDiamond(repo string, stores context2.Stores, opts ...DiamondOption) *Diamond { diamond := defaultDiamond(repo, stores) for _, apply := range opts { apply(diamond) } if diamond.deconflicter == nil { // points to the appropriate metadata path rendering function from model, // depending on the conflicts...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateDiamond(repo string, stores context2.Stores, opts ...DiamondOption) (model.DiamondDescriptor, error) {\n\tvar err error\n\td := NewDiamond(repo, stores, opts...)\n\n\tdefer func(t0 time.Time) {\n\t\tif d.MetricsEnabled() {\n\t\t\td.m.Usage.UsedAll(t0, \"CreateDiamond\")(err)\n\t\t}\n\t}(time.Now())\n\n\...
[ "0.6531112", "0.6350572", "0.62973064", "0.58797884", "0.5780172", "0.5770052", "0.5733969", "0.5599219", "0.55495274", "0.5385128", "0.52965933", "0.5290076", "0.5282357", "0.5248779", "0.5212722", "0.5211248", "0.51848173", "0.51848173", "0.5163079", "0.51546043", "0.509076...
0.76206434
0
basenameKeyFilter applies a filter on results from some iterator (e.g. the KeysPrefix store function). This is useful to filter out items located deeper in the metadata tree, but for which the simple separator rule cannot be applied.
func basenameKeyFilter(filter string) func([]string, string, error) ([]string, string, error) { return func(keys []string, next string, err error) ([]string, string, error) { if err != nil { return keys, next, err } filtered := make([]string, 0, len(keys)) for _, key := range keys { if !strings.HasPrefix...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func KeyHasSuffix(v string) predicate.Blob {\n\treturn predicate.Blob(\n\t\tfunc(s *sql.Selector) {\n\t\t\ts.Where(sql.HasSuffix(s.C(FieldKey), v))\n\t\t},\n\t)\n}", "func KeyHasPrefix(v string) predicate.Blob {\n\treturn predicate.Blob(\n\t\tfunc(s *sql.Selector) {\n\t\t\ts.Where(sql.HasPrefix(s.C(FieldKey), v)...
[ "0.52340424", "0.4928137", "0.4894693", "0.4847061", "0.47071567", "0.46861228", "0.4669897", "0.46603027", "0.46325058", "0.4622332", "0.46086925", "0.4532329", "0.45094556", "0.44940478", "0.4484004", "0.44813517", "0.4467792", "0.44648084", "0.44573885", "0.4454603", "0.44...
0.81313115
0
write a plain text message
func writeString(w http.ResponseWriter, body string, status int) { writeBody(w, []byte(body), status, "text/plain") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func writePlainText(statusCode int, text string, w http.ResponseWriter) {\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tw.WriteHeader(statusCode)\n\tfmt.Fprintln(w, text)\n}", "func (s *Status) WriteText(w http.ResponseWriter) error {\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tw.WriteHeader(...
[ "0.6655747", "0.632213", "0.6149622", "0.6030877", "0.60090363", "0.5999739", "0.59934056", "0.5987086", "0.5954685", "0.59016705", "0.5841889", "0.58273524", "0.58256876", "0.5818543", "0.5768177", "0.57515097", "0.5703201", "0.5698121", "0.56870776", "0.56831807", "0.567638...
0.6367332
1
NewRolloutBlockLister returns a new RolloutBlockLister.
func NewRolloutBlockLister(indexer cache.Indexer) RolloutBlockLister { return &rolloutBlockLister{indexer: indexer} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s rolloutBlockNamespaceLister) Get(name string) (*v1alpha1.RolloutBlock, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"rolloutblock\"), name)\n\t}\n\treturn ob...
[ "0.6314954", "0.6238325", "0.6161388", "0.61283696", "0.5824281", "0.55151194", "0.520106", "0.51907414", "0.5156084", "0.5144187", "0.51403826", "0.5134927", "0.50486195", "0.5025212", "0.5025212", "0.5023222", "0.5006356", "0.49875388", "0.49786118", "0.49344215", "0.493307...
0.84841317
0
List lists all RolloutBlocks in the indexer.
func (s *rolloutBlockLister) List(selector labels.Selector) (ret []*v1alpha1.RolloutBlock, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1alpha1.RolloutBlock)) }) return ret, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s rolloutBlockNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.RolloutBlock, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.RolloutBlock))\n\t})\n\treturn ret, err\n}", "func (s *rolloutBlockLister) ...
[ "0.7311063", "0.6322645", "0.60686725", "0.60537857", "0.58911", "0.552953", "0.5229831", "0.5191888", "0.51698", "0.51621276", "0.515386", "0.5137676", "0.5080767", "0.50736266", "0.5053302", "0.50126654", "0.4932627", "0.4914542", "0.4912257", "0.49045357", "0.49037486", ...
0.76020056
0
RolloutBlocks returns an object that can list and get RolloutBlocks.
func (s *rolloutBlockLister) RolloutBlocks(namespace string) RolloutBlockNamespaceLister { return rolloutBlockNamespaceLister{indexer: s.indexer, namespace: namespace} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewRolloutBlockLister(indexer cache.Indexer) RolloutBlockLister {\n\treturn &rolloutBlockLister{indexer: indexer}\n}", "func (l *LessonTut) Blocks() []*BlockTut { return l.blocks }", "func (s rolloutBlockNamespaceLister) Get(name string) (*v1alpha1.RolloutBlock, error) {\n\tobj, exists, err := s.indexer.G...
[ "0.66517174", "0.61137074", "0.6060496", "0.602393", "0.5799248", "0.57554275", "0.575131", "0.5643157", "0.5598307", "0.5551497", "0.55365604", "0.55362105", "0.5523253", "0.55167264", "0.5508807", "0.54773945", "0.54551417", "0.5453782", "0.54265654", "0.54017013", "0.53818...
0.7300363
0
List lists all RolloutBlocks in the indexer for a given namespace.
func (s rolloutBlockNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.RolloutBlock, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1alpha1.RolloutBlock)) }) return ret, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *rolloutBlockLister) List(selector labels.Selector) (ret []*v1alpha1.RolloutBlock, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.RolloutBlock))\n\t})\n\treturn ret, err\n}", "func (s *rolloutBlockLister) RolloutBlocks(namespace string) ...
[ "0.70668423", "0.6486759", "0.59354115", "0.58971703", "0.58813244", "0.5809516", "0.5714969", "0.56303203", "0.55635107", "0.5493994", "0.5447972", "0.54354554", "0.54354066", "0.5417491", "0.53622055", "0.5223752", "0.5200587", "0.51956224", "0.5188562", "0.51839614", "0.51...
0.81074965
0
Get retrieves the RolloutBlock from the indexer for a given namespace and name.
func (s rolloutBlockNamespaceLister) Get(name string) (*v1alpha1.RolloutBlock, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(v1alpha1.Resource("rolloutblock"), name) } return obj.(*v1alpha1.RolloutBlock),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s beeNamespaceLister) Get(name string) (*v1beta1.Bee, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1beta1.Resource(\"bee\"), name)\n\t}\n\treturn obj.(*v1beta1.Bee), nil\n}", ...
[ "0.6030591", "0.59331393", "0.5855316", "0.5818759", "0.5671234", "0.56690836", "0.5618589", "0.55901265", "0.5538037", "0.55035794", "0.548112", "0.54450256", "0.5436534", "0.54056436", "0.539699", "0.53958815", "0.53886515", "0.5377897", "0.5372501", "0.53640854", "0.535776...
0.80333996
0
AddCopy creates a new QuarksSecrets controller to watch for the user defined secrets.
func AddCopy(ctx context.Context, config *config.Config, mgr manager.Manager) error { ctx = ctxlog.NewContextWithRecorder(ctx, "copy-reconciler", mgr.GetEventRecorderFor("copy-recorder")) log := ctxlog.ExtractLogger(ctx) r := NewCopyReconciler(ctx, config, mgr, credsgen.NewInMemoryGenerator(log), controllerutil.SetC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func add(mgr manager.Manager, r reconcile.Reconciler) error {\n\n \t// minimumRefreshRate = os.Getenv(\"MINIMUM_REFRESH_RATE\")\n\n\t// Create a new controller\n\tc, err := controller.New(\"vaultsecret-controller\", mgr, controller.Options{Reconciler: r})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Watch for c...
[ "0.61047924", "0.58078575", "0.55848235", "0.5407227", "0.5254048", "0.5200474", "0.51375145", "0.49901083", "0.49053696", "0.48901126", "0.4862202", "0.4833981", "0.48101637", "0.48065236", "0.47915724", "0.47563052", "0.47331327", "0.47252765", "0.47191927", "0.46923995", "...
0.8458819
0
listQuarksSecretsReconciles lists all Quarks Secrets associated with the a particular secret.
func listQuarksSecretsReconciles(ctx context.Context, client crc.Client, secret *corev1.Secret, namespace string) ([]reconcile.Request, error) { quarksSecretList := &qsv1a1.QuarksSecretList{} err := client.List(ctx, quarksSecretList, crc.InNamespace(namespace)) if err != nil { return nil, errors.Wrap(err, "failed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s Secrets) List(ctx context.Context, maxResults int32) ([]string, error) {\n\tvers, err := s.Ops.Secrets().List(ctx, maxResults)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tout := make([]string, 0, len(vers))\n\tfor _, ver := range vers {\n\t\tout = append(out, ver.ID)\n\t}\n\treturn out, nil\n}", "fun...
[ "0.57259434", "0.5530794", "0.5380004", "0.53071386", "0.5273651", "0.5255789", "0.52251434", "0.52205926", "0.5210257", "0.51597595", "0.51561975", "0.5152343", "0.51374936", "0.51229763", "0.5094752", "0.50841784", "0.50665426", "0.50590277", "0.4997374", "0.4994975", "0.49...
0.833262
0
CreateOrder cria um novo contato
func Create(responseWriter http.ResponseWriter, request *http.Request) { fmt.Println("[ CreateOrder ]") body, _ := json.Marshal(request.Body) fmt.Println("[ CreateOrder ] Body=" + string(body)) //params := mux.Vars(request) var orderEntity OrderEntity _ = json.NewDecoder(request.Body).Decode(&orderEntity) var r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (company *Company) CreateOrder(id, color, quantity, dueDate, fulfilledQuantity int) *Order {\n\torder := &Order{\n\t\tkey: keyConfiguration.NewKey(),\n\t\tid: id,\n\t\tcolor: color,\n\t\tquantity: quantity,\n\t\tdueDate: dueDate,\n\t\tfulfilledQuanti...
[ "0.7995825", "0.7714538", "0.76843715", "0.7665126", "0.7629189", "0.7612207", "0.75953907", "0.7582923", "0.7548065", "0.7545327", "0.75202197", "0.7519648", "0.75073755", "0.74967855", "0.749028", "0.7485679", "0.746166", "0.7416033", "0.74129796", "0.73773503", "0.73278636...
0.7286142
22
Closures Creamos una funcion tabla que recibe un entero y a su vez retorna una funcion que retorna un entero
func Tabla(valor int) func() int { numero := valor secuencia := 0 return func() int { secuencia++ return numero * secuencia } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Tabla(valor int) func() int {\n\tnumero := valor //la primera ejecucion va a ejecutar linea57 y 58\n\tsecuencia := 0\n\treturn func() int { //cuando se llama y se asigna a una variable, la variable solo toma la parte que se retorna.\n\t\tsecuencia++\n\t\treturn numero * secuencia\n\t}\n\n}", "func Tabla(val...
[ "0.61445713", "0.59035116", "0.54191124", "0.5237038", "0.52154064", "0.5208149", "0.5103757", "0.5103272", "0.5053731", "0.50382227", "0.5018528", "0.50136447", "0.5009777", "0.5006587", "0.5002946", "0.49952084", "0.49399126", "0.49373722", "0.48772338", "0.48347634", "0.48...
0.5859927
2
RecoverPanics wraps http.Handler to recover and log panics.
func RecoverPanics(handler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { defer func() { if x := recover(); x != nil { w.WriteHeader(http.StatusInternalServerError) fmt.Fprint(w, "apis panic. Look in log for details.") glog.Infof("APIServer panic'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func RecoverPanics(handler http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\t\tdefer func() {\n\t\t\tif x := recover(); x != nil {\n\t\t\t\thttp.Error(w, \"apis panic. Look in log for details.\", http.StatusInternalServerError)\n\t\t\t\tglog.Errorf(\"APISer...
[ "0.73594993", "0.7038121", "0.7008406", "0.6885905", "0.6658655", "0.6547491", "0.64594406", "0.64355105", "0.6379547", "0.63791853", "0.63632184", "0.63296616", "0.631733", "0.630849", "0.6275611", "0.6274496", "0.6261786", "0.62580246", "0.6256298", "0.6241197", "0.6223762"...
0.74536425
0
Simple CORS implementation that wraps an http Handler For a more detailed implementation use or implement CORS at your proxy layer Pass nil for allowedMethods and allowedHeaders to use the defaults
func CORS(handler http.Handler, alloweedOriginPatterns []*regexp.Regexp, allowedMethods, allowedHeaders []string, allowCredentials string) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { origin := req.Header.Get("Origin") if origin != "" { allowed := false for _, patte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func AllowCORS(h http.Handler) http.Handler {\n return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n if origin := r.Header.Get(\"Origin\"); origin != \"\" {\n w.Header().Set(\"Access-Control-Allow-Origin\", origin)\n if r.Method == \"OPTIONS\" && r.Header.Get(\"Access-Control-Requ...
[ "0.76304674", "0.73658764", "0.73056734", "0.7282161", "0.71808046", "0.714095", "0.71343446", "0.7124745", "0.7118615", "0.71138436", "0.7107819", "0.70997053", "0.70225453", "0.700575", "0.70035934", "0.6915656", "0.69056773", "0.6897148", "0.6897042", "0.68887126", "0.6873...
0.71452546
5
Opts returns a redisconn.Opts object with the configured options applied.
func (cfg ClientConfig) Opts() redisconn.Opts { opts := redisconn.Opts{} cfg.Options.ApplyOpts(&opts) return opts }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetRedisOpts(driver *dipper.Driver) *Options {\n\tif conn, ok := dipper.GetMapData(driver.Options, \"data.connection\"); ok {\n\t\tdefer delete(conn.(map[string]interface{}), \"Password\")\n\t}\n\tif tls, ok := dipper.GetMapData(driver.Options, \"data.connection.TLS\"); ok {\n\t\tdefer delete(tls.(map[string]...
[ "0.69560456", "0.65203357", "0.6464695", "0.60208565", "0.6006148", "0.5755672", "0.5684365", "0.56654674", "0.5618213", "0.55474895", "0.54999447", "0.5461396", "0.5443127", "0.54348564", "0.5417129", "0.5403839", "0.5378627", "0.5340202", "0.53303003", "0.53119975", "0.5279...
0.7253291
0
Opts returns a rediscluster.Opts object with the configured options applied.
func (cfg ClusterConfig) Opts() rediscluster.Opts { opts := rediscluster.Opts{} cfg.Options.ApplyOpts(&opts.HostOpts) cfg.Cluster.ApplyOpts(&opts) return opts }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cfg ClientConfig) Opts() redisconn.Opts {\n\topts := redisconn.Opts{}\n\tcfg.Options.ApplyOpts(&opts)\n\treturn opts\n}", "func GetRedisOpts(driver *dipper.Driver) *Options {\n\tif conn, ok := dipper.GetMapData(driver.Options, \"data.connection\"); ok {\n\t\tdefer delete(conn.(map[string]interface{}), \"Pa...
[ "0.6970594", "0.6281927", "0.59078234", "0.5868081", "0.5761447", "0.56771445", "0.56171125", "0.55353045", "0.5506973", "0.5471589", "0.54695356", "0.54681355", "0.54206634", "0.5406276", "0.5379113", "0.53657633", "0.5356025", "0.5337401", "0.52826387", "0.52810746", "0.523...
0.73391664
0
ApplyOpts applies any values set in o to opts, if a value is not set on o, then we don't update opts and allow redispipe to use its defaults.
func (o Opts) ApplyOpts(opts *redisconn.Opts) { if o.DB != nil { opts.DB = *o.DB } if o.WritePause > 0 { opts.WritePause = o.WritePause } if o.ReconnectPause > 0 { opts.ReconnectPause = o.ReconnectPause } if o.TCPKeepAlive > 0 { opts.TCPKeepAlive = o.TCPKeepAlive } o.Timeouts.ApplyOpts(opts) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *Options) Apply(opts ...Option) error {\n\tfor i, opt := range opts {\n\t\tif err := opt(o); err != nil {\n\t\t\treturn fmt.Errorf(\"option %d failed: %s\", i, err)\n\t\t}\n\t}\n\treturn nil\n}", "func (o *Options) Apply() {\n\tif o == nil {\n\t\treturn\n\t}\n\tif len(o.ShowHiddenMetricsForVersion) > 0 {...
[ "0.6115144", "0.6088725", "0.59637165", "0.58984965", "0.5830588", "0.5801298", "0.57815975", "0.5702999", "0.565666", "0.56555563", "0.5646621", "0.56115735", "0.5607685", "0.55613136", "0.544665", "0.54299736", "0.53732026", "0.5360941", "0.53602225", "0.5359189", "0.534636...
0.608243
2
ApplyOpts applies any values set in t to opts, if a value is not set on t, then we don't update opts and allow redispipe to use its defaults.
func (t Timeouts) ApplyOpts(opts *redisconn.Opts) { if t.Dial > 0 { opts.DialTimeout = t.Dial } if t.IO > 0 { opts.IOTimeout = t.IO } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o Opts) ApplyOpts(opts *redisconn.Opts) {\n\n\tif o.DB != nil {\n\t\topts.DB = *o.DB\n\t}\n\tif o.WritePause > 0 {\n\t\topts.WritePause = o.WritePause\n\t}\n\tif o.ReconnectPause > 0 {\n\t\topts.ReconnectPause = o.ReconnectPause\n\t}\n\tif o.TCPKeepAlive > 0 {\n\t\topts.TCPKeepAlive = o.TCPKeepAlive\n\t}\n\t...
[ "0.62161744", "0.60801", "0.5962653", "0.58972675", "0.5862883", "0.5759934", "0.5752782", "0.57467747", "0.547668", "0.5474911", "0.5289025", "0.5288125", "0.52854234", "0.52022785", "0.5182077", "0.5168935", "0.51122046", "0.5102658", "0.5087273", "0.50831145", "0.5053145",...
0.62208015
0
ApplyOpts applies any values set in o to opts, if a value is not set on o, then we don't update opts and allow redispipe to use its defaults.
func (o ClusterOpts) ApplyOpts(opts *rediscluster.Opts) { if o.Name != "" { opts.Name = o.Name } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *Options) Apply(opts ...Option) error {\n\tfor i, opt := range opts {\n\t\tif err := opt(o); err != nil {\n\t\t\treturn fmt.Errorf(\"option %d failed: %s\", i, err)\n\t\t}\n\t}\n\treturn nil\n}", "func (o *Options) Apply() {\n\tif o == nil {\n\t\treturn\n\t}\n\tif len(o.ShowHiddenMetricsForVersion) > 0 {...
[ "0.6115116", "0.60880756", "0.60818255", "0.5963018", "0.58978915", "0.5830136", "0.5801093", "0.5780717", "0.5702616", "0.5656612", "0.5655646", "0.564559", "0.56109065", "0.5607306", "0.5561439", "0.544544", "0.5429387", "0.5372531", "0.5360312", "0.53601557", "0.5357337", ...
0.49006703
39
VersionString returns a TLS version string.
func VersionString(value uint16) string { if str, found := tlsVersionString[value]; found { return str } return fmt.Sprintf("TLS_VERSION_UNKNOWN_%d", value) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func VersionString() string {\n\treturn C.GoString(C.LZ4_versionString())\n}", "func TLSVersion(ver uint16) string {\n\tswitch ver {\n\tcase tls.VersionTLS10:\n\t\treturn \"1.0\"\n\tcase tls.VersionTLS11:\n\t\treturn \"1.1\"\n\tcase tls.VersionTLS12:\n\t\treturn \"1.2\"\n\t}\n\treturn fmt.Sprintf(\"Unknown [%x]\...
[ "0.74643797", "0.7188609", "0.70724016", "0.70276886", "0.6924166", "0.6852171", "0.68485165", "0.68244296", "0.6796393", "0.6793432", "0.67549765", "0.67549765", "0.6725175", "0.6683086", "0.6674843", "0.66420186", "0.6634001", "0.6576915", "0.65724236", "0.6564921", "0.6546...
0.77363867
0
CipherSuiteString returns the TLS cipher suite as a string.
func CipherSuiteString(value uint16) string { if str, found := tlsCipherSuiteString[value]; found { return str } return fmt.Sprintf("TLS_CIPHER_SUITE_UNKNOWN_%d", value) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CipherSuiteName(suite uint16) string {\n\tswitch suite {\n\tcase tls.TLS_RSA_WITH_RC4_128_SHA:\n\t\treturn \"TLS_RSA_WITH_RC4_128_SHA\"\n\tcase tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA:\n\t\treturn \"TLS_RSA_WITH_3DES_EDE_CBC_SHA\"\n\tcase tls.TLS_RSA_WITH_AES_128_CBC_SHA:\n\t\treturn \"TLS_RSA_WITH_AES_128_CBC_SHA\...
[ "0.69200236", "0.6264078", "0.60463476", "0.553764", "0.552981", "0.55205077", "0.5297108", "0.52549493", "0.521741", "0.5183919", "0.51783603", "0.51552385", "0.5096407", "0.50740904", "0.5053442", "0.49669608", "0.49222544", "0.49079034", "0.4856489", "0.48283112", "0.47250...
0.77113676
0
New creates a new engine with given options. Options can change the timeout, register a signal, execute a prehook callback and many other behaviours.
func New(ctx context.Context, options ...Option) (*Engine, error) { e := &Engine{} e.parent = ctx e.init() for _, o := range options { if err := o.apply(e); err != nil { return nil, err } } return e, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New(opts ...Option) *Engine {\n\toptions := defaultEngineOptions()\n\n\tfor _, opt := range opts {\n\t\topt.apply(&options)\n\t}\n\n\te := &Engine{\n\t\tsimStepper: options.simStepper,\n\t}\n\n\te.World = NewWorld()\n\n\treturn e\n}", "func NewEngine(cfg *config.Config, options ...func(*Engine)) *Engine {\n...
[ "0.67921555", "0.669759", "0.6473409", "0.6158667", "0.6096818", "0.5842643", "0.58255535", "0.57950187", "0.57940483", "0.57030845", "0.5669355", "0.56626093", "0.5661552", "0.5651985", "0.5622525", "0.559433", "0.5591475", "0.55850506", "0.55799", "0.55681443", "0.5546847",...
0.6813927
0
launch will start given hook.
func (e *Engine) launch(h Hook) { e.wait.Add(1) go func() { defer e.wait.Done() runtime := &HookRuntime{} // Wait for an event to notify this goroutine that a shutdown is required. // It could either be from engine's context or during Hook startup if an error has occurred. // NOTE: If HookRuntime retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Launch(actions []actloop.Action, logger *log.Logger) (stop func()) {\n\tloop := actloop.NewActLoop(actions, logger)\n\tgo loop.Run(time.Second*2, time.Minute*5, notifyReady)\n\treturn loop.Cancel\n}", "func Launch(addr, localDir, filename string,\n\targs []string, logDir string, retry int) error {\n\n\tfiel...
[ "0.5877089", "0.5779476", "0.5759628", "0.57347715", "0.56235826", "0.5620141", "0.56181556", "0.5604568", "0.5598416", "0.5588178", "0.5450167", "0.5426442", "0.54139924", "0.53387564", "0.5329647", "0.5309052", "0.52930015", "0.52812076", "0.5246368", "0.52041054", "0.51378...
0.73184854
0
init configures default parameters for engine.
func (e *Engine) init() { e.mutex.Lock() defer e.mutex.Unlock() if e.ctx == nil || e.cancel == nil { e.ctx, e.cancel = context.WithCancel(e.parent) } if e.timeout == 0 { e.timeout = DefaultTimeout } if len(e.signals) == 0 && !e.noSignal { e.signals = Signals } if e.interrupt == nil { e.interrupt =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (eng *Engine) Init(cfg string) error {\n\treturn nil\n}", "func Init(eng *en.RealEngine) {\n\tengine = *eng\n}", "func (engine *Engine) Init(options types.EngineOpts) {\n\t// 将线程数设置为CPU数\n\t// runtime.GOMAXPROCS(runtime.NumCPU())\n\t// runtime.GOMAXPROCS(128)\n\n\t// 初始化初始参数\n\tif engine.initialized {\n\t...
[ "0.7221774", "0.66383153", "0.6604026", "0.6536726", "0.6430138", "0.6430138", "0.62999934", "0.62854785", "0.62300193", "0.62171", "0.62102425", "0.61965305", "0.6160467", "0.6122625", "0.61147517", "0.6108825", "0.6103406", "0.6101473", "0.60721517", "0.6070308", "0.6061238...
0.6992129
1
Start will launch the engine and start registered hooks. It will block until every hooks has shutdown, gracefully or with force...
func (e *Engine) Start() error { e.init() go e.waitShutdownNotification() for _, h := range e.hooks { e.launch(h) } e.wait.Wait() if e.afterShutdown != nil { e.afterShutdown() } e.mutex.Lock() defer e.mutex.Unlock() return e.cause }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *EngineConfig) Start() error {\n\tlogger.Info(\"Engine: Starting...\")\n\n\t// Todo document RunnerType for engine configuration\n\trunnerType := config.GetRunnerType()\n\te.Init(runnerType == \"DIRECT\")\n\n\tactionRunner := e.actionRunner.(interface{})\n\n\tif managedRunner, ok := actionRunner.(util.Mana...
[ "0.70842016", "0.70279807", "0.6923318", "0.6841361", "0.6739894", "0.6596409", "0.6575987", "0.6469447", "0.64490694", "0.6430585", "0.64055973", "0.6379535", "0.6339723", "0.6337157", "0.6315934", "0.6285416", "0.62843764", "0.6270798", "0.62603813", "0.62498593", "0.622291...
0.78836673
0
Stop will shutdown engine.
func (e *Engine) Stop() error { e.mutex.Lock() defer e.mutex.Unlock() if e.interrupt != nil { select { case e.interrupt <- os.Interrupt: default: } } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *Engine) Stop() error {\n\tclose(e.stop)\n\treturn nil\n}", "func (e *Engine) Stop() {\n\te.running = false\n}", "func (e *Engine) Stop() {\n\tif atomic.CompareAndSwapInt32(&e.stopping, 0, 1) {\n\t\te.wg.Wait()\n\t\te.running = 0\n\t\te.stopping = 0\n\t}\n}", "func (e *Engine) Stop() error {\n\te.sto...
[ "0.8119374", "0.8024512", "0.7673363", "0.7569195", "0.7498961", "0.74496645", "0.729721", "0.7241718", "0.72293586", "0.71640617", "0.7073136", "0.70670533", "0.7035117", "0.70122164", "0.6990118", "0.69852245", "0.6978263", "0.6965461", "0.6890941", "0.6878703", "0.6846897"...
0.74494004
6
NEW: This method is only available in solanacore v1.7 or newer. Please use getConfirmedBlocks for solanacore v1.6 GetBlocks returns a list of confirmed blocks between two slots Max range allowed is 500,000 slot
func (c *RpcClient) GetBlocks(ctx context.Context, startSlot uint64, endSlot uint64) (GetBlocksResponse, error) { return c.processGetBlocks(c.Call(ctx, "getBlocks", startSlot, endSlot)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *RpcClient) GetConfirmedBlocks(ctx context.Context, startSlot uint64, endSlot uint64) ([]uint64, error) {\n\tres := struct {\n\t\tGeneralResponse\n\t\tResult []uint64 `json:\"result\"`\n\t}{}\n\terr := s.request(ctx, \"getConfirmedBlocks\", []interface{}{startSlot, endSlot}, &res)\n\tif err != nil {\n\t\tr...
[ "0.78249013", "0.6385375", "0.62107474", "0.6095312", "0.60634947", "0.6063101", "0.59976745", "0.5974859", "0.59326327", "0.58996063", "0.5883632", "0.5878408", "0.58193696", "0.5773688", "0.57701415", "0.57556033", "0.572684", "0.5716062", "0.5714754", "0.57055044", "0.5696...
0.6407925
1
NEW: This method is only available in solanacore v1.7 or newer. Please use getConfirmedBlocks for solanacore v1.6 GetBlocks returns a list of confirmed blocks between two slots Max range allowed is 500,000 slot
func (c *RpcClient) GetBlocksWithConfig(ctx context.Context, startSlot uint64, endSlot uint64, cfg GetBlocksConfig) (GetBlocksResponse, error) { return c.processGetBlocks(c.Call(ctx, "getBlocks", startSlot, endSlot, cfg)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *RpcClient) GetConfirmedBlocks(ctx context.Context, startSlot uint64, endSlot uint64) ([]uint64, error) {\n\tres := struct {\n\t\tGeneralResponse\n\t\tResult []uint64 `json:\"result\"`\n\t}{}\n\terr := s.request(ctx, \"getConfirmedBlocks\", []interface{}{startSlot, endSlot}, &res)\n\tif err != nil {\n\t\tr...
[ "0.7826052", "0.6409298", "0.63869226", "0.62129146", "0.6096529", "0.6065399", "0.6064389", "0.59982294", "0.59739965", "0.5933728", "0.590104", "0.58848983", "0.58794004", "0.5818846", "0.57752573", "0.5755512", "0.57286024", "0.571757", "0.5715281", "0.5704689", "0.5697877...
0.57698154
15
initDNSServer creates an instance of the dnsforward.Server Please note that we must do it even if we don't start it so that we had access to the query log and the stats
func initDNSServer(baseDir string) { err := os.MkdirAll(baseDir, 0755) if err != nil { log.Fatalf("Cannot create DNS data dir at %s: %s", baseDir, err) } dnsServer = dnsforward.NewServer(baseDir) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func runDNSServer() {\n\n\t// load the blocked domains\n\tblacklist := LoadBlacklistOrFail(blacklistPath)\n\tfmt.Printf(\"Loading list of %d blocked domains...\\n\", blacklist.Size())\n\n\t// make the custom handler function to reply to DNS queries\n\tupstream := getEnvOrDefault(\"UPSTREAM_DNS\", \"1.1.1.1:53\")\n...
[ "0.6577117", "0.61836004", "0.58856076", "0.5873448", "0.58571017", "0.5849781", "0.58205044", "0.5788006", "0.5765969", "0.5757338", "0.57560205", "0.57468", "0.5746392", "0.57075214", "0.5705852", "0.56903404", "0.5686891", "0.56743336", "0.5671335", "0.5657342", "0.5653865...
0.7915286
0
checkIfBackupInNewOrProgress check whether there are backups created by this schedule still in New or InProgress state
func (c *scheduleReconciler) checkIfBackupInNewOrProgress(schedule *velerov1.Schedule) bool { log := c.logger.WithField("schedule", kube.NamespaceAndName(schedule)) backupList := &velerov1.BackupList{} options := &client.ListOptions{ Namespace: schedule.Namespace, LabelSelector: labels.Set(map[string]string{ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Task) hasBackupCompleted(backup *velero.Backup) (bool, []string) {\n\tcompleted := false\n\treasons := []string{}\n\tprogress := []string{}\n\n\tpvbs := t.getPodVolumeBackupsForBackup(backup)\n\n\tswitch backup.Status.Phase {\n\tcase velero.BackupPhaseNew:\n\t\tprogress = append(\n\t\t\tprogress,\n\t\t\tf...
[ "0.65107685", "0.60924333", "0.6047755", "0.59358364", "0.5879894", "0.58064044", "0.579322", "0.5754999", "0.546307", "0.54417455", "0.54404837", "0.54389805", "0.5420077", "0.54141295", "0.53390694", "0.5332677", "0.5270624", "0.52638215", "0.5197946", "0.51915765", "0.5188...
0.8554207
0
ifDue check whether schedule is due to create a new backup.
func (c *scheduleReconciler) ifDue(schedule *velerov1.Schedule, cronSchedule cron.Schedule) bool { isDue, nextRunTime := getNextRunTime(schedule, cronSchedule, c.clock.Now()) log := c.logger.WithField("schedule", kube.NamespaceAndName(schedule)) if !isDue { log.WithField("nextRunTime", nextRunTime).Debug("Schedul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *scheduleReconciler) checkIfBackupInNewOrProgress(schedule *velerov1.Schedule) bool {\n\tlog := c.logger.WithField(\"schedule\", kube.NamespaceAndName(schedule))\n\tbackupList := &velerov1.BackupList{}\n\toptions := &client.ListOptions{\n\t\tNamespace: schedule.Namespace,\n\t\tLabelSelector: labels.Set(map...
[ "0.5760196", "0.5610772", "0.52594167", "0.5190598", "0.51561713", "0.5043613", "0.4985795", "0.4985035", "0.49514583", "0.4903711", "0.49007374", "0.4899634", "0.48967138", "0.48667654", "0.485368", "0.4840095", "0.48217595", "0.4819338", "0.4814378", "0.48026362", "0.479245...
0.7543842
0
submitBackup create a backup from schedule.
func (c *scheduleReconciler) submitBackup(ctx context.Context, schedule *velerov1.Schedule) error { c.logger.WithField("schedule", schedule.Namespace+"/"+schedule.Name).Info("Schedule is due, going to submit backup.") now := c.clock.Now() // Don't attempt to "catch up" if there are any missed or failed runs - simpl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func createBackup(w http.ResponseWriter, r *http.Request) {\n\tlogrus.Infof(\">>>>CreateBackup r=%s\", r)\n\n\tif RunningBackupAPIID != \"\" {\n\t\tlogrus.Infof(\"Another backup id %s is already running. Aborting.\", RunningBackupAPIID)\n\t\thttp.Error(w, fmt.Sprintf(\"Another backup id %s is already running. Abor...
[ "0.68177533", "0.6513657", "0.6345432", "0.61539024", "0.6150429", "0.59448236", "0.59301215", "0.57305014", "0.567647", "0.56463933", "0.56347996", "0.55442417", "0.5516464", "0.5512978", "0.54288435", "0.54252183", "0.5423092", "0.53933567", "0.53620535", "0.5304515", "0.53...
0.78230155
0
GetUserList get user list from paas
func (m *publicUser) GetUserList(c *gin.Context) (int, interface{}) { user := plugins.CurrentPlugin(c, m.config.LoginVersion) userList, err := user.GetUserList(c, m.config.ConfigMap) rspBody := metadata.LonginSystemUserListResult{} if nil != err { rspBody.Code = common.CCErrCommHTTPDoRequestFailed rspBody.ErrMs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetListUser(c *gin.Context) {\r\n\tvar usr []model.UserTemporary\r\n\tres := model.GetLUser(usr)\r\n\r\n\tutils.WrapAPIData(c, map[string]interface{}{\r\n\t\t\"Data\": res,\r\n\t}, http.StatusOK, \"success\")\r\n}", "func getUserList() string {\n\tvar userlist string\n\tfmt.Println(len(Users))\n\tfor key, v...
[ "0.7359356", "0.72904336", "0.7077272", "0.7028727", "0.7027776", "0.702073", "0.70161134", "0.6993351", "0.6991551", "0.6870929", "0.6868621", "0.68681204", "0.68483824", "0.6812991", "0.67967814", "0.6774643", "0.6770087", "0.6731464", "0.67262626", "0.6713845", "0.6699844"...
0.7338346
1
CgoEform Earth reference ellipsoids. E f o r m This function is part of the International Astronomical Union's SOFA (Standards of Fundamental Astronomy) software collection. Status: canonical. Given: n int ellipsoid identifier (Note 1) Returned: a double equatorial radius (meters, Note 2) f double flattening (Note 2) R...
func CgoEform(n int) (a, f float64, err en.ErrNum) { var cA, cF C.double var cStatus C.int cStatus = C.iauEform(C.int(n), &cA, &cF) switch int(cStatus) { case 0: case -1: err = errEform.Set(-1) default: err = errEform.Set(0) } return float64(cA), float64(cF), err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GoEform(n int) (a, f float64, err en.ErrNum) {\n\n\t// Look up a and f for the specified reference ellipsoid.\n\tswitch n {\n\tcase WGS84:\n\t\ta = 6378137.0\n\t\tf = 1.0 / 298.257223563\n\tcase GRS80:\n\t\ta = 6378137.0\n\t\tf = 1.0 / 298.257222101\n\tcase WGS72:\n\t\ta = 6378135.0\n\t\tf = 1.0 / 298.26\n\td...
[ "0.74699134", "0.53509736", "0.5212823", "0.5123355", "0.49350253", "0.49159133", "0.4744874", "0.46416277", "0.4524783", "0.4492814", "0.4436879", "0.44055137", "0.43862936", "0.43788657", "0.43419313", "0.43260568", "0.43255433", "0.43137696", "0.4303726", "0.42876762", "0....
0.5603201
1
GoEform Earth reference ellipsoids.
func GoEform(n int) (a, f float64, err en.ErrNum) { // Look up a and f for the specified reference ellipsoid. switch n { case WGS84: a = 6378137.0 f = 1.0 / 298.257223563 case GRS80: a = 6378137.0 f = 1.0 / 298.257222101 case WGS72: a = 6378135.0 f = 1.0 / 298.26 default: // Invalid identifier. a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewEllipsoid(radius, flattening float64) *Ellipsoid {\n\te := new(Ellipsoid)\n\tC.geod_init(&e.g, C.double(radius), C.double(flattening))\n\treturn e\n}", "func (e *Ellipsoid) Inverse(\n\tlat1, lon1, lat2, lon2 float64,\n\ts12, azi1, azi2 *float64,\n) {\n\tC.geod_inverse(&e.g,\n\t\tC.double(lat1), C.double(...
[ "0.57555723", "0.5633475", "0.56043756", "0.55265075", "0.54089504", "0.53410894", "0.52664757", "0.5026412", "0.49845457", "0.4889047", "0.48806256", "0.4879575", "0.48052537", "0.47927207", "0.47134507", "0.46969742", "0.46880403", "0.46797422", "0.46588522", "0.46408844", ...
0.6615527
0
Register a new tunnel on this control connection
func (c *Control) registerTunnel(rawTunnelReq *msg.ReqTunnel) { for _, proto := range strings.Split(rawTunnelReq.Protocol, "+") { tunnelReq := *rawTunnelReq tunnelReq.Protocol = proto c.conn.Debug("Registering new tunnel") t, err := NewTunnel(&tunnelReq, c) if err != nil { ack := &msg.NewTunnel{Error: er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (na *Nagent) CreateTunnel(tun *netproto.Tunnel) error {\n\terr := na.validateMeta(tun.Kind, tun.ObjectMeta)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// check if tunnel already exists\n\toldTun, err := na.FindTunnel(tun.ObjectMeta)\n\tif err == nil {\n\t\t// check if tunnel contents are same\n\t\tif !proto.E...
[ "0.6146846", "0.61225635", "0.5909397", "0.56072223", "0.5565189", "0.5540766", "0.5476352", "0.54763263", "0.54655796", "0.5418362", "0.53958005", "0.5362109", "0.5323186", "0.5291799", "0.52836424", "0.526554", "0.5163012", "0.5159695", "0.51567835", "0.51567405", "0.515555...
0.73147064
0
Remove a proxy connection from the pool and return it If not proxy connections are in the pool, request one and wait until it is available Returns an error if we couldn't get a proxy because it took too long or the tunnel is closing
func (c *Control) GetProxy() (proxyConn conn.Conn, err error) { // initial timeout is zero to try to get a proxy connection without asking for one timeout := time.NewTimer(0) // get a proxy connection. if we timeout, request one over the control channel for proxyConn == nil { var ok bool select { case proxyC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (router *Router) GetTunnel() *Tunnel {\n\trouter.mu.Lock()\n\tdefer router.mu.Unlock()\n\n\t// Keep trying to find a healthy tunnel until the pool exhausted and\n\t// actively remove unhealthy tunnels from the pool.\n\tfor {\n\t\tif len(router.pool) < 1 {\n\t\t\treturn nil\n\t\t}\n\t\ti := rand.Intn(len(route...
[ "0.6022615", "0.60019463", "0.5842775", "0.58329505", "0.5832659", "0.5711125", "0.55737877", "0.55508256", "0.5519788", "0.55154026", "0.5507154", "0.5496575", "0.54928315", "0.5485385", "0.5482652", "0.54800826", "0.5476584", "0.54401356", "0.5434093", "0.54271895", "0.5416...
0.67896104
0
Up20200929144301 adds Visual Studio Code as a workspace template.
func Up20200929144301(tx *sql.Tx) error { client, err := getClient() if err != nil { return err } defer client.DB.Close() migrationsRan, err := getRanSQLMigrations(client) if err != nil { return err } if _, ok := migrationsRan[20200929144301]; ok { return nil } namespaces, err := client.ListOnepanelE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func createWorkspace(client secrethub.ClientInterface, io ui.IO, org string, orgDescription string, progressPrinter progress.Printer) error {\n\tif org == \"\" {\n\t\tcreateWorkspace, err := ui.AskYesNo(io, \"Do you want to create a shared workspace for your team?\", ui.DefaultYes)\n\t\tif err != nil {\n\t\t\tretu...
[ "0.49752992", "0.49527052", "0.48761147", "0.48284465", "0.4793886", "0.45810252", "0.44825286", "0.4462606", "0.4437953", "0.43855366", "0.43842992", "0.438213", "0.43730313", "0.43259045", "0.43124765", "0.42978927", "0.42976612", "0.42841607", "0.42832598", "0.42819938", "...
0.5603818
0
Down20200929144301 removes Visual Studio Code from workspace templates.
func Down20200929144301(tx *sql.Tx) error { client, err := getClient() if err != nil { return err } namespaces, err := client.ListOnepanelEnabledNamespaces() if err != nil { return err } uid, err := uid2.GenerateUID(vscodeWorkspaceTemplateName, 30) if err != nil { return err } for _, namespace := range...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Up20200929144301(tx *sql.Tx) error {\n\tclient, err := getClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer client.DB.Close()\n\n\tmigrationsRan, err := getRanSQLMigrations(client)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, ok := migrationsRan[20200929144301]; ok {\n\t\treturn nil\n\t}\n\n\tna...
[ "0.5403419", "0.48610234", "0.48188964", "0.47880107", "0.46502808", "0.4624768", "0.4575532", "0.45335364", "0.44752434", "0.44420055", "0.44269013", "0.44095922", "0.44063526", "0.43804044", "0.4365622", "0.4359805", "0.4350803", "0.43353775", "0.4305398", "0.42996585", "0....
0.5788403
0
WithLogger sets the logger to use. By default, it logs to the standard library logger.
func WithLogger(l goka.Logger) Option { return func(s *Server) { s.log = l } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithLogger(logger Logger) Option {\n\treturn loggerOption{Logger: logger}\n}", "func WithLogger(l Logger) OptionFn {\n\treturn func(app *Application) {\n\t\tif l != nil {\n\t\t\tapp.logger = l\n\t\t\tapp.MustRegister(\"logger\", l)\n\t\t}\n\t}\n}", "func WithLogger(l log.Logger) Option {\n\treturn func(o ...
[ "0.7840537", "0.7794925", "0.77942044", "0.77463925", "0.7745421", "0.7726518", "0.7726518", "0.7713602", "0.7698265", "0.76704085", "0.7669409", "0.7656201", "0.76350176", "0.76218003", "0.7616936", "0.76035553", "0.7575008", "0.75647897", "0.75019264", "0.7490467", "0.74822...
0.73261267
29
GenerateModels parses the magmagenmeta key of the given swagger YAML file, copies the files that the target file depends on into the current working directory, shells out to `swagger generate models`, then cleans up the dependency files.
func GenerateModels(targetFilepath string, configFilepath string, rootDir string, specs map[string]MagmaSwaggerSpec) error { absTargetFilepath, err := filepath.Abs(targetFilepath) if err != nil { return fmt.Errorf("target filepath %s is invalid: %w", targetFilepath, err) } tmpGenDir, err := ioutil.TempDir(".", "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (g *Generator) Generate(context *common.Context, schema *schema.Schema) ([]common.Output, error) {\n\tmoduleName := strings.ToLower(schema.Title)\n\tvar outputs []common.Output\n\n\tfor _, def := range schema.Definitions {\n\t\t// create models only for objects\n\t\tif def.Type != nil {\n\t\t\tif t, ok := def...
[ "0.66913444", "0.64157486", "0.61856574", "0.61356175", "0.5997691", "0.589548", "0.57147914", "0.56822777", "0.56303346", "0.5599357", "0.5589933", "0.55740947", "0.5566793", "0.5553001", "0.55090463", "0.5508715", "0.5495265", "0.54901445", "0.5487085", "0.5477915", "0.5435...
0.8132264
0
ParseSwaggerDependencyTree parses the entire dependency tree of a magma swagger spec file specified by the rootFilepath parameter. The returned value maps between the absolute specified dependency filepath and the parsed struct for the dependency file.
func ParseSwaggerDependencyTree(rootFilepath string, rootDir string) (map[string]MagmaSwaggerSpec, error) { absRootFilepath, err := filepath.Abs(rootFilepath) if err != nil { return nil, fmt.Errorf("root filepath %s is invalid: %w", rootFilepath, err) } targetSpec, err := readSwaggerSpec(absRootFilepath) if err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Matcher) GeneratorDependencyTree(manifestFilePath string) string {\n\tlog.Debug().Msgf(\"Executing: Generate dependencies.txt\")\n\tmaven, err := exec.LookPath(\"mvn\")\n\tif err != nil {\n\t\tlog.Fatal().Err(err).Msgf(\"Please make sure Maven is installed. Hint: Check same by executing: mvn --version \\n...
[ "0.44742846", "0.4455825", "0.43550068", "0.43006805", "0.4232624", "0.41817617", "0.40636328", "0.40288898", "0.39767098", "0.39680606", "0.39440867", "0.3909975", "0.38882518", "0.38842115", "0.38663462", "0.3862431", "0.38287383", "0.38224056", "0.3783585", "0.37813827", "...
0.8142745
0
MarshalToYAML marshals a MagmaSwaggerSpec to a YAMLformatted string.
func (m *MagmaSwaggerSpec) MarshalToYAML() (string, error) { d, err := yaml.Marshal(&m) if err != nil { return "", err } return string(d), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d LegacyDec) MarshalYAML() (interface{}, error) {\n\treturn d.String(), nil\n}", "func (c *Components) MarshalYAML() (interface{}, error) {\n\tnb := high.NewNodeBuilder(c, c.low)\n\treturn nb.Render(), nil\n}", "func (f Fixed8) MarshalYAML() (interface{}, error) {\n\treturn f.String(), nil\n}", "func (...
[ "0.6445463", "0.6326264", "0.63029575", "0.63027453", "0.6261498", "0.6249017", "0.6187328", "0.6172001", "0.61505026", "0.6124385", "0.6124385", "0.60929036", "0.6092049", "0.6075512", "0.6065055", "0.6051939", "0.60301274", "0.6030115", "0.59681195", "0.5957629", "0.5953704...
0.77819127
0
OK, nothing special here
func Hash(data []byte) [blake2b.Size]byte { return blake2b.Sum512(data) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func curate(file *pe.File) []byte {\n\n\tm := make(map[string]interface{})\n\tfields := make([]string, 0)\n\n\tif file.HasDOSHdr {\n\t\tm[\"dos_header\"] = file.DOSHeader\n\t\tfields = append(fields, \"dos_header\")\n\t}\n\n\tif file.HasRichHdr {\n\t\tm[\"rich_header\"] = file.RichHeader\n\t\tfields = append(field...
[ "0.48523924", "0.47066402", "0.4516987", "0.4516987", "0.4516987", "0.4516987", "0.45057568", "0.4504245", "0.44656408", "0.44644177", "0.4460515", "0.44400802", "0.44385478", "0.44224203", "0.44211292", "0.44093663", "0.44025904", "0.4399125", "0.4385478", "0.4383673", "0.43...
0.0
-1
Compute and check the hash
func CheckHash(data []byte, target [blake2b.Size]byte) bool { if Hash(data) == target { return true } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func computeHash(w http.ResponseWriter, req *http.Request) {\n\tvalues := req.URL.Query()\n\tdata := values.Get(\"data\")\n\tif data == \"\" {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Write([]byte(\"400 - data param not present\"))\n\t\treturn\n\t}\n\tsalt := values.Get(\"salt\")\n\tif salt == \"\" {\n\t...
[ "0.69898987", "0.6741546", "0.67407966", "0.6724998", "0.6688802", "0.6658574", "0.66341126", "0.6630911", "0.66244596", "0.66141754", "0.66067123", "0.6591132", "0.65789235", "0.6557145", "0.65372247", "0.6517661", "0.6517661", "0.6517661", "0.64942336", "0.6490384", "0.6477...
0.0
-1
/ Starting Point : 1 Starting Point 2 : 1
func ConvertXY(src int, dst int) int { que := new(Queue) visited := make(map[int]int) que.Add([]int{src, 0}) for que.Len() != 0 { node := que.Remove().([]int) visited[node[0]] = 1 value := node[0] steps := node[1] if value == dst { return steps } if _, ok := visited[value*2]; !ok && value < dst { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func firstStep(y int) {\n\tfmt.Println(\"1.1\", y)\n\ty = 52 // 1.4 assign y to 52\n\tfmt.Println(\"1.2\", y)\n}", "func stepfrom(dir rune, x, y int) (sx, sy int) {\n\tswitch dir {\n\tcase 'N':\n\t\treturn x, y + 1\n\tcase 'S':\n\t\treturn x, y - 1\n\tcase 'W':\n\t\treturn x + 1, y\n\tcase 'E':\n\t\treturn x - 1...
[ "0.5825244", "0.5791528", "0.558185", "0.55745775", "0.55386", "0.55188316", "0.54899657", "0.5474828", "0.54533607", "0.5444746", "0.54436755", "0.54403", "0.5420142", "0.5400024", "0.5377683", "0.5345384", "0.5345", "0.52899605", "0.5273703", "0.525066", "0.5220603", "0.5...
0.0
-1
/ Steps to convert 2 to 7: 3
func maxSlidingWindows(arr []int, k int) { size := len(arr) for i := 0; i < size-k+1; i++ { max := arr[i] for j := 1; j < k; j++ { if max < arr[i+j] { max = arr[i+j] } } fmt.Print(max, " ") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func stepPerms(n int32) int32 {\n\tif n < 3 {\n\t\treturn n\n\t}\n\n\ta, b, c, current := 1, 2, 4, 0\n\n\tfor i := int32(3); i < n; i++ {\n\t\tcurrent = a + b + c\n\t\ta, b = b, c\n\t\tc = current\n\t}\n\n\treturn int32(c)\n}", "func solve2(input string) string {\n\tlist := parseInput(input)\n\ti := 0\n\tn := 0\...
[ "0.56478983", "0.54741895", "0.54507023", "0.543882", "0.5436077", "0.5412232", "0.5351659", "0.5347985", "0.53406036", "0.53287077", "0.5303835", "0.52942103", "0.5291034", "0.5268272", "0.5268217", "0.5260187", "0.52593374", "0.5203191", "0.51988673", "0.51940155", "0.51879...
0.0
-1
/ 75 92 92 92 90 75 92 92 92 90
func minOfMaxSlidingWindows(arr []int, k int) { size := len(arr) que := new(Queue) minVal := math.MaxInt32 i := 0 for i < size { // Remove out of range elements if que.Len() > 0 && que.Front().(int) <= i-k { que.Remove() } // Remove smaller values at left. for que.Len() > 0 && arr[que.Back().(int)] <=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func main() {\n\tvalues := []string{\"ABC\", \"ACB\", \"BAC\", \"BCA\", \"CAB\", \"CBA\"}\n\t// values := []string{\"to\", \"to\", \"top\", \"ton\", \"tom\"}\n\tfactor := []int{100, 10, 1}\n\n\t// 65x100 + 66x10 + 67x1 = 7227\n\thashKey := 0\n\tfor v := range values {\n\t\tbytes := []byte(values[v])\n\t\tf := 0\n\...
[ "0.58024555", "0.5661549", "0.5576845", "0.5349433", "0.5328527", "0.5309565", "0.53035676", "0.5302726", "0.52974", "0.5284454", "0.5270035", "0.5224862", "0.52078164", "0.5188299", "0.5173334", "0.5172408", "0.5172408", "0.5172408", "0.5172408", "0.5172408", "0.5172408", ...
0.0
-1
Min of max is: 75
func maxOfMinSlidingWindows(arr []int, k int) { size := len(arr) que := new(Queue) maxVal := math.MinInt32 i := 0 for i < size { // Remove out of range elements if que.Len() > 0 && que.Front().(int) <= i-k { que.Remove() } // Remove smaller values at left. for que.Len() > 0 && arr[que.Back().(int)] >=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MinMax(x, min, max int) int { return x }", "func (p parseSpec) minMax() (int, int) {\n\tmaxVal := -math.MaxInt64\n\tminVal := math.MaxInt64\n\tfor _, v := range p {\n\t\tif v > maxVal {\n\t\t\tmaxVal = v\n\t\t} else if v < minVal {\n\t\t\tminVal = v\n\t\t}\n\t}\n\treturn minVal, maxVal\n}", "func minmax(a...
[ "0.74028397", "0.6915779", "0.66241217", "0.6616075", "0.6559249", "0.64556175", "0.6428241", "0.6380175", "0.6302906", "0.62899035", "0.62846214", "0.626812", "0.6259294", "0.6231927", "0.62230694", "0.6221588", "0.62114716", "0.6209669", "0.62021357", "0.61924946", "0.61843...
0.0
-1
/ Max of min is: 59
func firstNegSlidingWindows(arr []int, k int) { size := len(arr) que := new(Queue) i := 0 for i < size { // Remove out of range elements if que.Len() > 0 && que.Front().(int) <= i-k { que.Remove() } if arr[i] < 0 { que.Add(i) } // window of size k if i >= (k - 1) { if que.Len() > 0 { fmt....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func normalizeMinutes(min int) (int, int) {\n\tflag := false\n\taddHours := 0\n\tif min < 0 {\n\t\tflag = !flag\n\t\tmin = -1 * min\n\t}\n\n\tif min >= 60 {\n\t\taddHours = min / 60\n\t\tmin = min % 60\n\t}\n\n\tif flag {\n\t\tif min > 0 {\n\t\t\tmin = 60 - min\n\t\t\taddHours += 1\n\t\t}\n\t\taddHours = -1 * addH...
[ "0.61662334", "0.57398677", "0.5701072", "0.5669399", "0.5604872", "0.5507069", "0.54734653", "0.5398669", "0.5395211", "0.5355866", "0.5341673", "0.52995133", "0.52645224", "0.5257398", "0.5246607", "0.523801", "0.5223781", "0.5210974", "0.5200304", "0.5191768", "0.51909083"...
0.0
-1
/ 2 2 6 14 14 NAN
func RottenFruitUtil(arr [][]int, maxCol int, maxRow int, currCol int, currRow int, traversed [][]int, day int) { if currCol < 0 || currCol >= maxCol || currRow < 0 || currRow >= maxRow { return } // Traversable and rot if not already rotten. if traversed[currCol][currRow] <= day || arr[currCol][currRow] == 0 { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NaN() float32 { return Float32frombits(uvnan) }", "func fillNaNDense(m *mat.Dense) {\n\tr, c := m.Dims()\n\tfor i := 0; i < r; i++ {\n\t\tfor j := 0; j < c; j++ {\n\t\t\tm.Set(i, j, math.NaN())\n\t\t}\n\t}\n}", "func (a *Array64) NaNSum(axis ...int) *Array64 {\n\tif a.valAxis(&axis, \"NaNSum\") {\n\t\tret...
[ "0.602442", "0.58442634", "0.5628861", "0.56243914", "0.55352783", "0.55352783", "0.55352783", "0.55352783", "0.5477595", "0.5387952", "0.5378903", "0.5312592", "0.52907044", "0.52907044", "0.52536094", "0.5228146", "0.5210892", "0.5192936", "0.5192836", "0.5192836", "0.51296...
0.0
-1
/ RottenFruit : 3 RottenFruit2 : 3
func StepsOfKnightUtil(size int, currCol int, currRow int, traversed [][]int, dist int) { // Range check if currCol < 0 || currCol >= size || currRow < 0 || currRow >= size { return } // Traverse if not already traversed. if traversed[currCol][currRow] <= dist { return } dir := [][]int{{-2, -1}, {-2, 1}, {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func printTally(wrapped, dropped int64) {\n\tfmt.Println(\"\\n--------------------------------------\")\n\tfmt.Printf(\"%-10s : %02d\\n\", \"Total\", chocolateCount)\n\tfmt.Printf(\"%-10s : %02d\\n\", \"Wrapped\", wrapped)\n\tfmt.Printf(\"%-10s : %02d\\n\", \"Dropped\", dropped)\n\tfmt.Println(\"------------------...
[ "0.48526704", "0.45791003", "0.45148775", "0.45120233", "0.45096675", "0.4484106", "0.44114172", "0.44073385", "0.43790644", "0.4351559", "0.43006048", "0.42932254", "0.42848495", "0.4264322", "0.42597494", "0.42453548", "0.4244313", "0.42309946", "0.422844", "0.4227956", "0....
0.0
-1
/ StepsOfKnight : 8 StepsOfKnight2 : 8
func DistNearestFillUtil(arr [][]int, maxCol int, maxRow int, currCol int, currRow int, traversed [][]int, dist int) { // Range check if currCol < 0 || currCol >= maxCol || currRow < 0 || currRow >= maxRow { return } // Traversable if there is a better distance. if traversed[currCol][currRow] <= dist { return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func StepsOfKnightUtil(size int, currCol int, currRow int, traversed [][]int, dist int) {\n\t// Range check\n\tif currCol < 0 || currCol >= size || currRow < 0 || currRow >= size {\n\t\treturn\n\t}\n\n\t// Traverse if not already traversed.\n\tif traversed[currCol][currRow] <= dist {\n\t\treturn\n\t}\n\n\tdir := [...
[ "0.631437", "0.6289041", "0.5995027", "0.5943802", "0.58128786", "0.5675189", "0.5543537", "0.55353135", "0.55158156", "0.5515774", "0.54764587", "0.54721206", "0.5456247", "0.5381262", "0.5378672", "0.53775716", "0.53614694", "0.5350701", "0.53365123", "0.53184175", "0.52972...
0.0
-1
/ 0 1 0 0 1 0 0 1 0 1 1 1 2 1 0 2 2 2 1 0 3 3 2 1 0
func findLargestIslandUtil(arr [][]int, maxCol int, maxRow int, currCol int, currRow int, traversed [][]bool) int { dir := [][]int{{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1}} var x, y int var sum = 1 // Traverse in all eight directions. for i := 0; i < 8; i++ { x = currCol + dir[i][0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func createSet(input [9]int8) int16 {\n\tvar used int16 = 0\n\tfor i := 0; i < 9; i++ {\n\t\tused += (1 << uint(input[i] - 1))\n\t}\n\treturn used;\n}", "func duplicateZeros1(arr []int) {\n\tvar count int\n\tn := len(arr)\n\tfor _, v := range arr {\n\t\tif v == 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfor i := n - 1;...
[ "0.5901486", "0.57600516", "0.5691947", "0.56687385", "0.5632322", "0.56271887", "0.5624384", "0.5614425", "0.5581852", "0.557765", "0.5537337", "0.54688233", "0.5465581", "0.54486245", "0.54246455", "0.5421789", "0.541518", "0.54054135", "0.5336431", "0.5312148", "0.52895814...
0.0
-1
/ Largest Island: 12
func main() { main1() main2() main3() main4() main5() main6() main7() main8() main9() main10() main11() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func main() {\n\thighestStartingPoint := 0\n\thighestValue := 0\n\tfor i := 1; i < 1000000; i++ {\n\t\tlatz := collatz.From(i)\n\t\tif latz.Length > highestValue {\n\t\t\thighestStartingPoint = i\n\t\t\thighestValue = latz.Length\n\t\t}\n\t}\n\n\tfmt.Println(highestStartingPoint)\n}", "func findLargestIslandUtil...
[ "0.66160476", "0.64744246", "0.618712", "0.61700565", "0.6037497", "0.5992314", "0.59851134", "0.59376025", "0.5864505", "0.5848303", "0.5829246", "0.5827219", "0.5810036", "0.5801721", "0.579599", "0.57703656", "0.57446194", "0.5703196", "0.57013416", "0.56909364", "0.568791...
0.0
-1
create a master node and initialize its channels
func NewMaster() *Master { m := &Master{ subMap: map[string]*Submission{}, jobChan: make(chan *WorkerJob, 0), NodeHandles: map[string]*NodeHandle{}} http.Handle("/master/", websocket.Handler(func(ws *websocket.Conn) { m.Listen(ws) })) return m }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewMasterNode() *MasterNode {\n\tcurrentNode := MasterNode{}\n\tcurrentNode.Slaves = make(map[*websocket.Conn]bool)\n\tcurrentNode.broadcast = make(chan []byte)\n\treturn &currentNode\n}", "func (n *MasterNode) StartMasterNode(host string, port int) {\n\t// Configure websocket route\n\thttp.HandleFunc(\"/ws...
[ "0.66622347", "0.64293945", "0.6145258", "0.60843116", "0.597381", "0.5962286", "0.5953004", "0.5896927", "0.5833437", "0.5825309", "0.5784566", "0.57775766", "0.5761488", "0.5743756", "0.5732949", "0.57158387", "0.56984013", "0.567924", "0.56664616", "0.5651798", "0.56275845...
0.60488987
4
sends a message to every connected worker
func (m *Master) Broadcast(msg *WorkerMessage) { m.nodeMu.RLock() logger.Debug("Broadcast(%v): to %v nodes", *msg, len(m.NodeHandles)) for _, nh := range m.NodeHandles { nh.BroadcastChan <- msg } m.nodeMu.RUnlock() logger.Debug("Broadcast(): done") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func handleMessages(){\r\n\tfor{\r\n\t\t// get next message from broadcast channel\r\n\t\tmsg := <- broadcast\r\n\r\n\t\t// send message to each currently connected client\r\n\t\tfor client := range clients{\r\n\t\t\terr := client.WriteJSON(msg)\r\n\r\n\t\t\tif err != nil{\r\n\t\t\t\tlog.Println(\"@ handleMessages...
[ "0.6683119", "0.66107297", "0.6527772", "0.64723986", "0.64621276", "0.64592254", "0.64288116", "0.64274037", "0.6404339", "0.6387626", "0.6385022", "0.63430643", "0.62988806", "0.6289499", "0.6284704", "0.62429345", "0.6237176", "0.62246853", "0.6220611", "0.62152636", "0.62...
0.6004114
36
remove node handles from the map used to store them as they disconnect
func (m *Master) RemoveNodeOnDeath(nh *NodeHandle) { logger.Debug("RemoveNodeOnDeath(%v)", nh.NodeId) <-nh.Con.DiedChan m.nodeMu.Lock() delete(m.NodeHandles, nh.NodeId) m.nodeMu.Unlock() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func cbRemoveConnection(hConn C.MQHCONN) {\n\t// Remove all of the hObj values for this hconn\n\tkey := makePartialKey(hConn)\n\tmapLock()\n\tfor k, _ := range cbMap {\n\t\tif strings.HasPrefix(k, key) {\n\t\t\tdelete(cbMap, k)\n\t\t}\n\t}\n\tmapUnlock()\n}", "func (g *Graph) cleanNodes() {\n\tcleaned := []*Node...
[ "0.5977338", "0.57795995", "0.5744829", "0.56060827", "0.54988384", "0.5470038", "0.54184693", "0.5405626", "0.53601146", "0.53557134", "0.5353138", "0.53511405", "0.53385425", "0.53376305", "0.52991736", "0.52857304", "0.52746004", "0.52491444", "0.5248946", "0.52391887", "0...
0.0
-1
/ The function NewObjectLength calls NewUnaryFunctionBase to create a function named OBJECT_LENGTH with an expression as input.
func NewObjectLength(operand Expression) Function { rv := &ObjectLength{ *NewUnaryFunctionBase("object_length", operand), } rv.expr = rv return rv }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *ObjectLength) Constructor() FunctionConstructor {\n\treturn func(operands ...Expression) Function {\n\t\treturn NewObjectLength(operands[0])\n\t}\n}", "func (this *ObjectLength) Constructor() FunctionConstructor {\n\treturn func(operands ...Expression) Function {\n\t\treturn NewObjectLength(operands[...
[ "0.6523122", "0.6523122", "0.5879528", "0.585225", "0.57606673", "0.57606673", "0.57047075", "0.56010866", "0.5507508", "0.5425705", "0.5425705", "0.5403266", "0.53994787", "0.53820825", "0.5202233", "0.5193633", "0.5174063", "0.5164767", "0.5130811", "0.5112785", "0.5112785"...
0.84461415
1
/ It calls the VisitFunction method by passing in the receiver to and returns the interface. It is a visitor pattern.
func (this *ObjectLength) Accept(visitor Visitor) (interface{}, error) { return visitor.VisitFunction(this) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *NowStr) Accept(visitor Visitor) (interface{}, error) {\n\treturn visitor.VisitFunction(this)\n}", "func (e FunctionCallExpression) Visit(env Environment) Value {\n\treturn NoneValue()\n}", "func (i *InterfaceSet) Visit(n ast.Node) (w ast.Visitor) {\n\tswitch n := n.(type) {\n\tcase *ast.TypeSpec:\n...
[ "0.60175425", "0.5906299", "0.59027874", "0.5845828", "0.5825935", "0.5819577", "0.5819577", "0.580104", "0.5785162", "0.5777933", "0.5703701", "0.56876904", "0.56876904", "0.5627525", "0.5536116", "0.549273", "0.5463964", "0.5434355", "0.54164505", "0.54164505", "0.5402595",...
0.54699755
17
/ It returns a value type NUMBER.
func (this *ObjectLength) Type() value.Type { return value.NUMBER }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (v Value) Number() (Number, error) {\n\tr := bytes.NewReader(v.bytes)\n\treturn byteReaderToNumber(v.dataType, r)\n}", "func getNumber(v interface{}) (int64, error) {\n\tswitch v := v.(type) {\n\tcase int:\n\t\treturn int64(v), nil\n\tcase int8:\n\t\treturn int64(v), nil\n\tcase int16:\n\t\treturn int64(v),...
[ "0.70115584", "0.6969048", "0.6674587", "0.66428035", "0.6590476", "0.65527546", "0.64667314", "0.64667314", "0.64667314", "0.64667314", "0.63752025", "0.63733643", "0.6349295", "0.629919", "0.62977487", "0.62339395", "0.61801726", "0.6162864", "0.6155927", "0.6140079", "0.60...
0.55151886
48
/ Calls the Eval method for unary functions and passes in the receiver, current item and current context.
func (this *ObjectLength) Evaluate(item value.Value, context Context) (value.Value, error) { return this.UnaryEval(this, item, context) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (fn NoArgFunc) Eval(ctx *Context, r Row) (interface{}, error) {\n\treturn fn.Logic(ctx, r)\n}", "func (bp *BinaryPlus) Eval() float64 {\n\treturn bp.left.(Eval).Eval() + bp.right.(Eval).Eval()\n}", "func (ast *Unary) Eval(env *Env, ctx *Codegen, gen *ssa.Generator) (\n\tssa.Value, bool, error) {\n\texpr, ...
[ "0.65601635", "0.62554264", "0.610906", "0.6098628", "0.60711527", "0.6037241", "0.5988044", "0.5928711", "0.5928711", "0.58814615", "0.587307", "0.58361375", "0.5803793", "0.5803793", "0.5791637", "0.5744556", "0.57429147", "0.5731631", "0.5702675", "0.5695341", "0.56899124"...
0.0
-1
/ This method returns the length of the object. If the type of input is missing then return a missing value, and if not an object return a null value. Convert it to a valid Go type. Cast it to a map from string to interface and return its length by using the len function by casting it to float64.
func (this *ObjectLength) Apply(context Context, arg value.Value) (value.Value, error) { if arg.Type() == value.MISSING { return value.MISSING_VALUE, nil } else if arg.Type() != value.OBJECT { return value.NULL_VALUE, nil } oa := arg.Actual().(map[string]interface{}) return value.NewValue(float64(len(oa))), n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *FakeObject) Length() int { return reflect.ValueOf(o.Value).Len() }", "func length(v interface{}) (int, error) {\n\tswitch val := v.(type) {\n\tcase string:\n\t\treturn len(val), nil\n\tcase []interface{}:\n\t\treturn len(val), nil\n\tcase map[string]interface{}:\n\t\treturn len(val), nil\n\tdefault:\n\t...
[ "0.6576737", "0.641415", "0.6306101", "0.6094734", "0.60418206", "0.6018301", "0.5996876", "0.59715265", "0.5953909", "0.5932843", "0.590009", "0.5885789", "0.5872587", "0.58563036", "0.58299994", "0.57967377", "0.57810503", "0.576028", "0.5746586", "0.57231796", "0.5718099",...
0.596643
9
/ The constructor returns a NewObjectLength with the an operand cast to a Function as the FunctionConstructor.
func (this *ObjectLength) Constructor() FunctionConstructor { return func(operands ...Expression) Function { return NewObjectLength(operands[0]) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *ObjectAdd) Constructor() FunctionConstructor {\n\treturn func(operands ...Expression) Function {\n\t\treturn NewObjectAdd(operands[0], operands[1], operands[2])\n\t}\n}", "func (this *ObjectRemove) Constructor() FunctionConstructor {\n\treturn func(operands ...Expression) Function {\n\t\treturn NewOb...
[ "0.7275384", "0.69671285", "0.6962341", "0.68921953", "0.6845353", "0.6845353", "0.68416286", "0.68416286", "0.6744794", "0.6708235", "0.6654913", "0.6654913", "0.66427934", "0.6617833", "0.6557411", "0.6531051", "0.65282565", "0.65282565", "0.6448263", "0.6430938", "0.642644...
0.79440147
1
/ The function NewObjectNames calls NewUnaryFunctionBase to create a function named OBJECT_NAMES with an expression as input.
func NewObjectNames(operand Expression) Function { rv := &ObjectNames{ *NewUnaryFunctionBase("object_names", operand), } rv.expr = rv return rv }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *ObjectNames) Constructor() FunctionConstructor {\n\treturn func(operands ...Expression) Function {\n\t\treturn NewObjectNames(operands[0])\n\t}\n}", "func (this *ObjectNames) Constructor() FunctionConstructor {\n\treturn func(operands ...Expression) Function {\n\t\treturn NewObjectNames(operands[0])\...
[ "0.58631206", "0.58631206", "0.5818655", "0.5258608", "0.5123252", "0.5123252", "0.50969934", "0.5032237", "0.50116974", "0.5003598", "0.49712798", "0.48637605", "0.48614097", "0.4857428", "0.48428673", "0.4813975", "0.48088303", "0.4790116", "0.478159", "0.478159", "0.477660...
0.8870936
1
/ It calls the VisitFunction method by passing in the receiver to and returns the interface. It is a visitor pattern.
func (this *ObjectNames) Accept(visitor Visitor) (interface{}, error) { return visitor.VisitFunction(this) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *NowStr) Accept(visitor Visitor) (interface{}, error) {\n\treturn visitor.VisitFunction(this)\n}", "func (e FunctionCallExpression) Visit(env Environment) Value {\n\treturn NoneValue()\n}", "func (i *InterfaceSet) Visit(n ast.Node) (w ast.Visitor) {\n\tswitch n := n.(type) {\n\tcase *ast.TypeSpec:\n...
[ "0.601801", "0.59070253", "0.59054166", "0.58446676", "0.58266926", "0.5820728", "0.5820728", "0.5802115", "0.57868934", "0.577937", "0.57069504", "0.5627799", "0.5535857", "0.5494115", "0.5471187", "0.5471187", "0.5465064", "0.5435572", "0.54174775", "0.54174775", "0.5403646...
0.56891
12