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
SetItems sets the items property value. All items contained in the list.
func (m *List) SetItems(value []ListItemable)() { m.items = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Base) SetItems(items hcl.Expression) {\n\ts.items = items\n}", "func (m *NOCWidget) SetItems(val []NOCItemBase) {\n\tm.itemsField = val\n}", "func (l *List) SetItems(items []ListItem, keepPosition bool) *List {\n\tl.items = items\n\tif keepPosition == false || l.currentIdx > len(l.items)-1 {\n\t\tl.cu...
[ "0.8377718", "0.79934865", "0.7978078", "0.79390347", "0.79210514", "0.7914814", "0.7902227", "0.78694093", "0.78578025", "0.78419966", "0.7840077", "0.7831494", "0.78293496", "0.78255165", "0.7818281", "0.7816909", "0.7808516", "0.7792681", "0.7791754", "0.77862304", "0.7785...
0.7967201
3
SetList sets the list property value. Provides additional details about the list.
func (m *List) SetList(value ListInfoable)() { m.list = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Drive) SetList(value Listable)() {\n m.list = value\n}", "func (this *Iter) SetList(l *[]interface{}) {\n\tthis.list = l\n\tthis.index = -1\n\tthis.currentPage = 1\n}", "func (options *ListJobsOptions) SetList(list string) *ListJobsOptions {\n\toptions.List = core.StringPtr(list)\n\treturn options\...
[ "0.7852837", "0.7834302", "0.7707903", "0.76114416", "0.7607494", "0.75335294", "0.7371298", "0.7231533", "0.7130639", "0.68794", "0.68399435", "0.67001563", "0.66798425", "0.66119003", "0.65419525", "0.6505559", "0.6407199", "0.6404088", "0.6371527", "0.6308061", "0.62936723...
0.8415547
0
SetOperations sets the operations property value. The collection of longrunning operations on the list.
func (m *List) SetOperations(value []RichLongRunningOperationable)() { m.operations = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *ExternalConnection) SetOperations(value []ConnectionOperationable)() {\n m.operations = value\n}", "func (m *Workbook) SetOperations(value []WorkbookOperationable)() {\n m.operations = value\n}", "func (m *List) GetOperations()([]RichLongRunningOperationable) {\n return m.operations\n}", "f...
[ "0.7198802", "0.69220114", "0.66551083", "0.6605073", "0.6553442", "0.6553442", "0.6538797", "0.6449035", "0.6385875", "0.63704", "0.6315704", "0.6312198", "0.62994707", "0.61955124", "0.6192981", "0.6184774", "0.6169092", "0.61600715", "0.61439407", "0.6048", "0.6038706", ...
0.8358397
0
SetSharepointIds sets the sharepointIds property value. Returns identifiers useful for SharePoint REST compatibility. Readonly.
func (m *List) SetSharepointIds(value SharepointIdsable)() { m.sharepointIds = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *MicrosoftGraphListItem) SetSharepointIds(v AnyOfmicrosoftGraphSharepointIds) {\n\to.SharepointIds = &v\n}", "func (o *MicrosoftGraphItemReference) SetSharepointIds(v AnyOfmicrosoftGraphSharepointIds) {\n\to.SharepointIds = &v\n}", "func (m *Drive) SetSharePointIds(value SharepointIdsable)() {\n m.s...
[ "0.7952072", "0.7934823", "0.77746314", "0.75141704", "0.750047", "0.6807269", "0.6786915", "0.67614096", "0.6590971", "0.63483787", "0.6196856", "0.5963558", "0.59606564", "0.57671094", "0.556037", "0.544962", "0.5333266", "0.53018636", "0.5215398", "0.51930815", "0.5125199"...
0.8109699
0
SetSubscriptions sets the subscriptions property value. The set of subscriptions on the list.
func (m *List) SetSubscriptions(value []Subscriptionable)() { m.subscriptions = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (mr *MockSessionMockRecorder) SetSubscriptions(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"SetSubscriptions\", reflect.TypeOf((*MockSession)(nil).SetSubscriptions), arg0)\n}", "func (m *MockSession) SetSubscriptions(arg0 []*nats.Subs...
[ "0.6805649", "0.6752347", "0.64073074", "0.6334549", "0.6187249", "0.6187249", "0.6186094", "0.6131424", "0.61299884", "0.6005485", "0.6001537", "0.5987716", "0.5975161", "0.5895233", "0.5893747", "0.5869636", "0.5850222", "0.5823477", "0.57931256", "0.57788503", "0.5737833",...
0.8208021
0
SetSystem sets the system property value. If present, indicates that this is a systemmanaged list. Readonly.
func (m *List) SetSystem(value SystemFacetable)() { m.system = value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *RoleWithAccess) SetSystem(v bool) {\n\to.System = &v\n}", "func (o *IamServiceProviderAllOf) SetSystem(v IamSystemRelationship) {\n\to.System = &v\n}", "func (m *Drive) SetSystem(value SystemFacetable)() {\n m.system = value\n}", "func (m *AndroidManagedStoreApp) SetIsSystemApp(value *bool)() {\n...
[ "0.7896474", "0.72561866", "0.6967416", "0.6135101", "0.60012877", "0.5942262", "0.57586634", "0.57460856", "0.5723831", "0.5708102", "0.56640434", "0.5659007", "0.5594216", "0.5577806", "0.5535843", "0.5497821", "0.54853433", "0.5480487", "0.547595", "0.5474845", "0.54435337...
0.78210694
1
Chair specifies the participation role for the calendar user specified by the property is CHAIR.
func Chair(v string) parameter.Parameter { return Other("CHAIR") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func chamberSpeakerRole(s *discordgo.Session, channelID string) (*discordgo.Role, error) {\n\tchamber, ok := Chambers[channelID]\n\tif !ok {\n\t\treturn nil, ERR_NOT_A_CHAMBER\n\t}\n\n\tch, err := s.State.Channel(channelID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.State.Role(ch.GuildID, chamber.S...
[ "0.47560984", "0.44838512", "0.4394359", "0.43604988", "0.4327836", "0.4301724", "0.4260221", "0.423811", "0.423811", "0.423534", "0.42002085", "0.4193655", "0.41903698", "0.41825715", "0.41674364", "0.41583565", "0.41501293", "0.41492894", "0.4144446", "0.41318828", "0.41199...
0.6365082
0
ReqParticipant specifies the participation role for the calendar user specified by the property is a required participant, REQPARTICIPANT.
func ReqParticipant() parameter.Parameter { return Other("REQ-PARTICIPANT") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func OptParticipant() parameter.Parameter {\n\treturn Other(\"OPT-PARTICIPANT\")\n}", "func (s *ChannelDefinition) SetParticipantRole(v string) *ChannelDefinition {\n\ts.ParticipantRole = &v\n\treturn s\n}", "func (s *TranscriptFilter) SetParticipantRole(v string) *TranscriptFilter {\n\ts.ParticipantRole = &v\...
[ "0.6335902", "0.6020651", "0.5960029", "0.59365475", "0.59108174", "0.58237433", "0.55794024", "0.55225873", "0.5517706", "0.53861356", "0.5348708", "0.53117955", "0.5155773", "0.5102707", "0.50262994", "0.49464083", "0.4815764", "0.4769822", "0.47673255", "0.47654703", "0.47...
0.8265217
0
OptParticipant specifies the participation role for the calendar user specified by the property is an optional participant, OPTPARTICIPANT.
func OptParticipant() parameter.Parameter { return Other("OPT-PARTICIPANT") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ReqParticipant() parameter.Parameter {\n\treturn Other(\"REQ-PARTICIPANT\")\n}", "func (s *TranscriptFilter) SetParticipantRole(v string) *TranscriptFilter {\n\ts.ParticipantRole = &v\n\treturn s\n}", "func (s *ParticipantTimerConfiguration) SetParticipantRole(v string) *ParticipantTimerConfiguration {\n\...
[ "0.6225694", "0.5972394", "0.5920174", "0.58749056", "0.5850301", "0.582409", "0.577012", "0.5664515", "0.5388283", "0.532105", "0.53170985", "0.5031255", "0.49427384", "0.4867233", "0.4839651", "0.47024885", "0.46469593", "0.46357363", "0.4633046", "0.4591002", "0.45416632",...
0.80076027
0
NonParticipant specifies the participation role for the calendar user specified by the property is a nonparticipant, NONPARTICIPANT.
func NonParticipant() parameter.Parameter { return Other("NON-PARTICIPANT") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (rec *RawEventCreate) SetNonInteractive(b bool) *RawEventCreate {\n\trec.mutation.SetNonInteractive(b)\n\treturn rec\n}", "func OutcomeOverviewParticipantsNotIn(vs ...string) predicate.OutcomeOverview {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Out...
[ "0.54938054", "0.5477978", "0.5378485", "0.5321094", "0.5321094", "0.5321094", "0.5321094", "0.5321094", "0.5321094", "0.5321094", "0.5321094", "0.5321094", "0.5321094", "0.5267588", "0.52520335", "0.52256835", "0.51861835", "0.51774764", "0.5175691", "0.516526", "0.5157808",...
0.7944042
0
Other specifies some other participation role for the calendar user specified by the property.
func Other(v string) parameter.Parameter { return parameter.Single(ROLE, v) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *W2) SetOther(v string) {\n\to.Other.Set(&v)\n}", "func (this *activityGroupStruct) Other() OtherActivity {\n\to := &this.other\n\treturn o\n}", "func (me TxsdActuate) IsOther() bool { return me.String() == \"other\" }", "func (me TxsdIncidentPurpose) IsOther() bool { return me.String() == \"other\" ...
[ "0.5639476", "0.54995006", "0.546558", "0.53956676", "0.53530425", "0.5336518", "0.50974333", "0.5055779", "0.5032807", "0.5032134", "0.4993602", "0.4959372", "0.49222732", "0.4897679", "0.4891945", "0.4860955", "0.4860652", "0.48268563", "0.4789251", "0.47876722", "0.4767436...
0.63611466
0
CommonPool returns the balance of the global common pool.
func (s *ImmutableState) CommonPool() (*quantity.Quantity, error) { _, value := s.Snapshot.Get(commonPoolKeyFmt.Encode()) if value == nil { return &quantity.Quantity{}, nil } var q quantity.Quantity if err := cbor.Unmarshal(value, &q); err != nil { return nil, err } return &q, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Acknowledgment) PoolBalance() uint64 {\n\treturn m.Terms.GetAmount()\n}", "func (p *P2C) Balance(key string) (string, error) {\n\tp.Lock()\n\tdefer p.Unlock()\n\n\tif len(p.hosts) == 0 {\n\t\treturn \"\", liblb.ErrNoHost\n\t}\n\n\t// chosen host\n\tvar host string\n\n\tvar n1, n2 string\n\n\tif len(key)...
[ "0.5926155", "0.5722179", "0.5685082", "0.5682519", "0.5641373", "0.56143695", "0.5608971", "0.5602491", "0.56006825", "0.55034167", "0.5480004", "0.5475807", "0.54739386", "0.5464113", "0.54625815", "0.54502606", "0.5443165", "0.54414755", "0.5441096", "0.5438737", "0.543676...
0.6130283
0
Thresholds returns the currently configured thresholds if any.
func (s *ImmutableState) Thresholds() (map[staking.ThresholdKind]quantity.Quantity, error) { params, err := s.ConsensusParameters() if err != nil { return nil, err } return params.Thresholds, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (_this *IntersectionObserver) Thresholds() *javascript.FrozenArray {\n\tvar ret *javascript.FrozenArray\n\tvalue := _this.Value_JS.Get(\"thresholds\")\n\tret = javascript.FrozenArrayFromJS(value)\n\treturn ret\n}", "func (o *LoadingTimeThresholdsPolicyDto) GetThresholds() []LoadingTimeThreshold {\n\tif o ==...
[ "0.71097803", "0.6909282", "0.6748608", "0.64702", "0.62003034", "0.609936", "0.6039909", "0.59123665", "0.58507127", "0.58371764", "0.58099043", "0.5742745", "0.5742745", "0.5547325", "0.54714656", "0.5422213", "0.53810775", "0.5289859", "0.5209263", "0.5187692", "0.51809484...
0.6634129
3
EscrowBalance returns the escrow balance for the ID.
func (s *ImmutableState) EscrowBalance(id signature.PublicKey) *quantity.Quantity { account := s.Account(id) return account.Escrow.Active.Balance.Clone() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetAccountBalanceById(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\n\taccountID, erro := strconv.ParseUint(params[\"accountID\"], 10, 64)\n\tif erro != nil {\n\t\tresponses.Error(w, http.StatusBadRequest, erro)\n\t\treturn\n\t}\n\n\tdb, erro := database.Connect()\n\tif erro != nil {\n\...
[ "0.55822587", "0.54363596", "0.54326504", "0.52948654", "0.5267713", "0.52443856", "0.5239745", "0.52388304", "0.5234785", "0.5226584", "0.5223258", "0.51968634", "0.51808625", "0.5170468", "0.51638365", "0.5147292", "0.51023656", "0.5096022", "0.5095926", "0.50698835", "0.50...
0.80400485
0
SlashEscrow slashes the escrow balance and the escrowbutundergoingdebonding balance of the account, transferring it to the global common pool, returning true iff the amount actually slashed is > 0. WARNING: This is an internal routine to be used to implement staking policy, and MUST NOT be exposed outside of backend im...
func (s *MutableState) SlashEscrow(ctx *abci.Context, fromID signature.PublicKey, amount *quantity.Quantity) (bool, error) { commonPool, err := s.CommonPool() if err != nil { return false, fmt.Errorf("staking: failed to query common pool for slash: %w", err) } from := s.Account(fromID) // Compute the amount we...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *common) Quiesce() bool {\n\tnumVirtuous := c.virtuousVoting.Len()\n\tc.ctx.Log.Verbo(\"Conflict graph has %d voting virtuous transactions\",\n\t\tnumVirtuous)\n\treturn numVirtuous == 0\n}", "func EnoughBalance(color ledgerstate.Color, amount uint64, consumables ...*ConsumableOutput) bool {\n\tconsumabl...
[ "0.49341345", "0.4908336", "0.48980752", "0.48811942", "0.48114797", "0.47869286", "0.47620127", "0.4718487", "0.4713854", "0.46976575", "0.46922806", "0.46842524", "0.46516705", "0.46219596", "0.45926288", "0.4587576", "0.45873407", "0.45777503", "0.4570878", "0.45536354", "...
0.62305254
0
TransferFromCommon transfers up to the amount from the global common pool to the general balance of the account, returning true iff the amount transferred is > 0. WARNING: This is an internal routine to be used to implement incentivization policy, and MUST NOT be exposed outside of backend implementations.
func (s *MutableState) TransferFromCommon(ctx *abci.Context, toID signature.PublicKey, amount *quantity.Quantity) (bool, error) { commonPool, err := s.CommonPool() if err != nil { return false, errors.Wrap(err, "staking: failed to query common pool for transfer") } to := s.Account(toID) transfered, err := quant...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CanTransfer(view *txo.UtxoViewpoint, block *asiutil.Block, db fvm.StateDB, addr common.Address,\n\tamount *big.Int, vtx *virtualtx.VirtualTransaction, calculateBalanceFunc fvm.CalculateBalanceFunc, assets *protos.Asset) bool {\n\tif amount.Cmp(common.Big0) == 0 {\n\t\treturn true\n\t}\n\tif assets == nil {\n\...
[ "0.59644663", "0.5832566", "0.576338", "0.5730674", "0.54021853", "0.5374337", "0.53338605", "0.53338605", "0.5328754", "0.5288938", "0.5288938", "0.5288416", "0.5273202", "0.5263543", "0.5263543", "0.5263543", "0.52464753", "0.52325016", "0.5202835", "0.5197652", "0.51842266...
0.7480716
0
AddRewards computes and transfers a staking reward to active escrow accounts. If an error occurs, the pool and affected accounts are left in an invalid state. This may fail due to the common pool running out of tokens. In this case, the returned error's cause will be `staking.ErrInsufficientBalance`, and it should be s...
func (s *MutableState) AddRewards(time epochtime.EpochTime, factor *quantity.Quantity, accounts []signature.PublicKey) error { steps, err := s.RewardSchedule() if err != nil { return err } var activeStep *staking.RewardStep for _, step := range steps { if time < step.Until { activeStep = &step break } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func accumulateRewards(config *params.ChainConfig, state *state.DB, header *types.Header) {\n\t// TODO: implement mining rewards\n}", "func (_RandomBeacon *RandomBeaconTransactor) WithdrawRewards(opts *bind.TransactOpts, stakingProvider common.Address) (*types.Transaction, error) {\n\treturn _RandomBeacon.contra...
[ "0.6756725", "0.64123845", "0.6352972", "0.6323859", "0.6277504", "0.6244347", "0.6214062", "0.6086639", "0.598928", "0.59732753", "0.5944851", "0.5910994", "0.58423203", "0.5786412", "0.5620724", "0.5618472", "0.5605595", "0.55774486", "0.5538607", "0.54995674", "0.54924965"...
0.76440066
0
AddRewardSingleAttenuated computes, scales, and transfers a staking reward to an active escrow account.
func (s *MutableState) AddRewardSingleAttenuated(time epochtime.EpochTime, factor *quantity.Quantity, attenuationNumerator, attenuationDenominator int, account signature.PublicKey) error { steps, err := s.RewardSchedule() if err != nil { return err } var activeStep *staking.RewardStep for _, step := range steps ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Coinbase) AddReward(output *Output) {\n\toutput.EncryptedMask = make([]byte, 1)\n\tc.Rewards = append(c.Rewards, output)\n}", "func (a Actor) AwardBlockReward(rt vmr.Runtime, params *AwardBlockRewardParams) *adt.EmptyValue {\n\trt.ValidateImmediateCallerIs(builtin.SystemActorAddr)\n\tAssertMsg(rt.Curren...
[ "0.612093", "0.59551144", "0.59414524", "0.5776947", "0.5700438", "0.5679214", "0.54675496", "0.53945607", "0.53710365", "0.52962494", "0.52574825", "0.5234012", "0.52230954", "0.5210352", "0.5163299", "0.514713", "0.5118373", "0.5050562", "0.50385445", "0.5029193", "0.499178...
0.84411126
0
NewMutableState creates a new mutable staking state wrapper.
func NewMutableState(tree *iavl.MutableTree) *MutableState { inner := &abci.ImmutableState{Snapshot: tree.ImmutableTree} return &MutableState{ ImmutableState: &ImmutableState{inner}, tree: tree, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newLockState() *lockState {\n\treturn &lockState{\n\t\tlocks: make(map[string]string),\n\t}\n}", "func newSyncState(startBlock, syncedTo *BlockStamp) *syncState {\n\n\treturn &syncState{\n\t\tstartBlock: *startBlock,\n\t\tsyncedTo: *syncedTo,\n\t}\n}", "func NewState() State {\n\treturn State{\n\t\tTime...
[ "0.67232126", "0.59957683", "0.58462787", "0.5798446", "0.57412094", "0.57268536", "0.56971854", "0.55965257", "0.5588695", "0.55782235", "0.5509733", "0.5509733", "0.55075246", "0.5504205", "0.54708654", "0.54607207", "0.5453687", "0.5403249", "0.53513885", "0.53513885", "0....
0.63858134
1
AddHandle gin.HandlerFunc gin.HandlerFunc, httpMethod, relativePath
func (m *Transport) AddHandle(handle interface{}, args ...string) error { h := handle.(gin.HandlerFunc) if len(args) == 0 { m.engine.Use(h) } else if len(args) == 2 { m.engine.Handle(args[0], args[1], h) } else { return errors.New("invalid args") } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HttpServer) Handle(group *gin.RouterGroup, httpMethod, relativePath string, handler interface{}) {\n\th.AddHandler(relativePath, handler)\n\tginHandler := Wrap(handler)\n\tgroup.Handle(httpMethod, relativePath, ginHandler)\n}", "func (s *WebService) Handle(route string, method string, httpHandler http.H...
[ "0.72447765", "0.698101", "0.69755876", "0.6785753", "0.6698356", "0.66749495", "0.66386235", "0.6612467", "0.6611905", "0.6611346", "0.65966296", "0.65879995", "0.6585628", "0.65778136", "0.65446544", "0.6534677", "0.65345293", "0.6529589", "0.6524859", "0.6505774", "0.65047...
0.61602634
55
NewMerkleBlobAccess creates an adapter that validates that blobs read from and written to storage correspond with the digest that is used for identification. It ensures that the size and the SHA256 based checksum match. This is used to ensure clients cannot corrupt the CAS and that if corruption were to occur, use of c...
func NewMerkleBlobAccess(blobAccess BlobAccess) BlobAccess { return &merkleBlobAccess{ BlobAccess: blobAccess, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewFlatBlobAccess(keyLocationMap KeyLocationMap, locationBlobMap LocationBlobMap, digestKeyFormat digest.KeyFormat, lock *sync.RWMutex, storageType string, capabilitiesProvider capabilities.Provider) blobstore.BlobAccess {\n\tflatBlobAccessPrometheusMetrics.Do(func() {\n\t\tprometheus.MustRegister(flatBlobAcc...
[ "0.58413476", "0.5624401", "0.5494648", "0.5427737", "0.5140033", "0.50221825", "0.49835172", "0.4974719", "0.49557987", "0.49510318", "0.4940078", "0.4915983", "0.49132773", "0.48539382", "0.48506436", "0.48390308", "0.48285547", "0.4827324", "0.4816197", "0.47794566", "0.47...
0.75446844
0
Restart restarts the application
func Restart() { log.Println("An error has occured, restarting the app") file, _ := osext.Executable() syscall.Exec(file, os.Args, os.Environ()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Restart(args ...string) {\n logger.Log(fmt.Sprintf(\"Restarting %v\\n\", process))\n Stop(args...)\n Start(args...)\n}", "func (r *Runner) Restart(application *config.Application) {\n\tif cmd, ok := r.cmds[application.Name]; ok {\n\t\tpgid, err := syscall.Getpgid(cmd.Process.Pid)\n\t\tif err == nil {\n\t...
[ "0.74956864", "0.7276446", "0.724625", "0.7144054", "0.70957565", "0.7012717", "0.7004468", "0.69704926", "0.6808136", "0.67299974", "0.6707739", "0.6671288", "0.66431946", "0.66143584", "0.65433764", "0.6533106", "0.6501655", "0.64996433", "0.6497295", "0.6495759", "0.649499...
0.77647364
0
Content returns the content
func (obj *subElement) Content() Content { return obj.content }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o FileContentBufferResponseOutput) Content() pulumi.StringOutput {\n\treturn o.ApplyT(func(v FileContentBufferResponse) string { return v.Content }).(pulumi.StringOutput)\n}", "func (obj *request) Content() Content {\n\treturn obj.content\n}", "func (r *Document) Content() pulumi.StringOutput {\n\treturn...
[ "0.72861093", "0.72709954", "0.71940833", "0.7078095", "0.70746005", "0.6974682", "0.69743764", "0.6971699", "0.6928106", "0.690793", "0.6905364", "0.690444", "0.6886027", "0.6858753", "0.6811308", "0.67990315", "0.67848706", "0.6763891", "0.6746183", "0.6731", "0.67288506", ...
0.6349977
48
Cardinality returns the cardinality
func (obj *subElement) Cardinality() SpecificCardinality { return obj.cardinality }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m Metric) Cardinality() int {\n\treturn len(m.RawMetrics)\n}", "func (s *SeriesIDSet) Cardinality() uint64 {\n\ts.RLock()\n\tdefer s.RUnlock()\n\treturn s.bitmap.GetCardinality()\n}", "func (ns NodeIPSet) Cardinality() int {\n\treturn len(ns)\n}", "func (t Type) Cardinality() int {\n\tcomputedScale, _ ...
[ "0.71189034", "0.708777", "0.7051972", "0.70327824", "0.6967584", "0.688138", "0.68615484", "0.6850261", "0.68149126", "0.67705745", "0.6766567", "0.6400095", "0.62452495", "0.6178156", "0.5935052", "0.57748646", "0.57452023", "0.5736418", "0.5714701", "0.56697875", "0.564668...
0.66883284
11
IsInputNode returns whether Node is InputNode
func (inNode *InputNode) IsInputNode() bool { return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func isInput(n *html.Node) bool {\n\treturn n.Type == html.ElementNode && n.Data == \"input\"\n}", "func (neuron *Neuron) IsInput() bool {\n\tif neuron.Net == nil {\n\t\treturn false\n\t}\n\treturn neuron.Net.IsInput(neuron.neuronIndex)\n}", "func (w *Wire) IsInput() bool {\n\treturn w.input == nil\n}", "fun...
[ "0.77378595", "0.7563745", "0.7193405", "0.6881346", "0.6374417", "0.6312678", "0.6054738", "0.5895529", "0.5886826", "0.5841217", "0.58025974", "0.5732391", "0.56517136", "0.562411", "0.56054157", "0.5595582", "0.5592241", "0.5553411", "0.5546443", "0.5511153", "0.54900104",...
0.87470484
0
Start is used to start input msgstream
func (inNode *InputNode) Start() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (mc *MsgHandler) Start(started chan bool) {\n\terr := mc.start(started, make(chan network.InMsg))\n\tif err != nil {\n\t\tmc.logger.Error(err)\n\t}\n}", "func (s *streamStrategy) Start() {\n\tgo func() {\n\t\tfor msg := range s.inputChan {\n\t\t\tif msg.Origin != nil {\n\t\t\t\tmsg.Origin.LogSource.LatencyS...
[ "0.718114", "0.7034203", "0.67446077", "0.66426194", "0.6566977", "0.6540834", "0.6461489", "0.64253646", "0.64017814", "0.6361705", "0.6340189", "0.63111186", "0.63055766", "0.6303685", "0.6293183", "0.6292466", "0.6285846", "0.6277648", "0.6252996", "0.6243372", "0.62280136...
0.6020397
30
Name returns node name
func (inNode *InputNode) Name() string { return inNode.name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (n *Node) Name() string { return n.notNil().name }", "func (n *node) Name() string {\n\tif n.name == \"\" {\n\t\treturn n.id\n\t}\n\treturn n.name\n}", "func (n *Node) Name() string {\n\treturn n.name\n}", "func (n *Node) Name() string {\n\treturn n.name\n}", "func (n *Node) Name() string {\n\tn.mutex...
[ "0.83197445", "0.8282766", "0.80326104", "0.80326104", "0.7946972", "0.7822782", "0.7772684", "0.7772684", "0.7735505", "0.7627044", "0.7599888", "0.7411889", "0.7408107", "0.7395289", "0.73570424", "0.73570424", "0.73515564", "0.733351", "0.71774364", "0.7162256", "0.7152602...
0.74829185
11
InStream returns the internal MsgStream
func (inNode *InputNode) InStream() msgstream.MsgStream { return inNode.inStream }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *eventSourceMessageReceivedClient) GetStream() rpcc.Stream { return c.Stream }", "func (c *signedExchangeReceivedClient) GetStream() rpcc.Stream { return c.Stream }", "func (s *Chan) In() chan []byte {\n\treturn s.inMsgChan\n}", "func In(stream pb.Chat_StreamClient, ch chan pb.Message) {\n\tfor {\n\t...
[ "0.6105474", "0.6063308", "0.58948004", "0.5838755", "0.58044165", "0.57779425", "0.57277787", "0.5700929", "0.5552331", "0.55458105", "0.5520131", "0.5516159", "0.54422444", "0.54403114", "0.54284227", "0.54207987", "0.5408762", "0.53644747", "0.5340302", "0.5325053", "0.532...
0.7173401
0
Operate consume a message pack from msgstream and return
func (inNode *InputNode) Operate(in []Msg) []Msg { msgPack, ok := <-inNode.inStream.Chan() if !ok { log.Warn("MsgStream closed", zap.Any("input node", inNode.Name())) return []Msg{&MsgStreamMsg{ isCloseMsg: true, }} } // TODO: add status if msgPack == nil { return []Msg{} } sub := tsoutil.SubByNow(m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (mod *backendModule) consume(topic string, msg []byte, err error) {\n\tif err != nil {\n\t\tmod.Logger().Warn().\n\t\t\tError(\"error\", err).\n\t\t\tPrint(\"mq consume error\")\n\t\treturn\n\t}\n\tn, m, err := proto.Decode(msg, mod.arena)\n\tif err != nil {\n\t\tmod.Logger().Error().\n\t\t\tInt(\"size\", len...
[ "0.6276936", "0.6246801", "0.6180561", "0.6133813", "0.6083706", "0.60718745", "0.6067789", "0.60644627", "0.60644627", "0.60466933", "0.60198724", "0.6012926", "0.6007215", "0.60016245", "0.5978266", "0.5916146", "0.5899456", "0.5891242", "0.58888996", "0.58823323", "0.58500...
0.56697845
33
NewInputNode composes an InputNode with provided MsgStream, name and parameters
func NewInputNode(inStream msgstream.MsgStream, nodeName string, maxQueueLength int32, maxParallelism int32, role string, nodeID int64, collectionID int64, dataType string) *InputNode { baseNode := BaseNode{} baseNode.SetMaxQueueLength(maxQueueLength) baseNode.SetMaxParallelism(maxParallelism) return &InputNode{ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewInput(Name string, Type string, Repr msgs.Representation, Chan string, Default msgs.Message) Input {\n\n\t// Validates if the message-type is registered\n\tif !msgs.IsMessageTypeRegistered(Type) {\n\t\terrorString := fmt.Sprintf(\"The '%s' message type has not been registered!\", Type)\n\t\tpanic(errorStri...
[ "0.6755735", "0.6387063", "0.6107659", "0.6013483", "0.60084355", "0.5982119", "0.59718966", "0.5887658", "0.57997257", "0.57652515", "0.5739579", "0.56995016", "0.5677465", "0.55904806", "0.5589528", "0.5555853", "0.5499458", "0.5491909", "0.54152054", "0.540663", "0.5405652...
0.7976249
0
ODataSQLQuery builds a SQL like query based on OData 2.0 specification
func ODataSQLQuery(query url.Values, table string, column string, db *sql.DB) (*sql.Rows, error) { // Parse url values queryMap, err := parser.ParseURLValues(query) if err != nil { return nil, errors.Wrap(ErrInvalidInput, err.Error()) } var finalQuery strings.Builder // SELECT clause finalQuery.WriteString(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func buildQuery(op ops.Operator, qb *queryBuilder) error {\n\tswitch op := op.(type) {\n\tcase *Table:\n\t\tbuildTable(op, qb)\n\tcase *Projection:\n\t\treturn buildProjection(op, qb)\n\tcase *ApplyJoin:\n\t\treturn buildApplyJoin(op, qb)\n\tcase *Filter:\n\t\treturn buildFilter(op, qb)\n\tcase *Horizon:\n\t\tif o...
[ "0.61842024", "0.60245055", "0.6003086", "0.59801304", "0.59445935", "0.58919936", "0.5888785", "0.5841532", "0.5811155", "0.5801685", "0.5731041", "0.57135344", "0.5703988", "0.5649988", "0.5627692", "0.56274", "0.56126505", "0.5601496", "0.55951214", "0.55934775", "0.556225...
0.6946478
0
ODataCount returns the number of rows from a table
func ODataCount(db *sql.DB, table string) (int, error) { var count int selectStmt := fmt.Sprintf("SELECT count(*) FROM %s", pq.QuoteIdentifier(table)) row := db.QueryRow(selectStmt) err := row.Scan(&count) if err != nil { return 0, err } return count, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *RepositoryService) Count(rs app.RequestScope) (int64, error) {\n\treturn s.dao.Count(rs.DB())\n}", "func (eq *EntityQuery) Count(ctx context.Context) (int, error) {\n\tif err := eq.prepareQuery(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn eq.sqlCount(ctx)\n}", "func (s *NewsService) Count(rs a...
[ "0.65731376", "0.6423667", "0.6399858", "0.6366155", "0.6364464", "0.6363455", "0.63600063", "0.63275915", "0.6326546", "0.62999713", "0.6288543", "0.6251071", "0.6241342", "0.62159956", "0.6206949", "0.62037224", "0.6189948", "0.6167601", "0.61594486", "0.61513174", "0.61453...
0.8465603
0
use upstream host on http request
func (c *Context) Factory(host string) (core.Plugin, error) { return core.Function(func(ctx context.Context, flow core.Core) { span := opentracing.SpanFromContext(ctx) span.LogFields(opentracinglog.String("event", "DiscoverService")) if len(host) == 0 { err := fmt.Errorf("host not found from upstream") blo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func makeHandler(c *http.Client, timeout time.Duration, upstreamURL string) func(w http.ResponseWriter, r *http.Request) {\n\n\tif strings.HasSuffix(upstreamURL, \"/\") == false {\n\t\tupstreamURL = upstreamURL + \"/\"\n\t}\n\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\n\t\tvar host string\n\n\t\ttl...
[ "0.60398525", "0.60352695", "0.60122204", "0.5932958", "0.59156084", "0.59117436", "0.58614457", "0.58290267", "0.5793419", "0.5724385", "0.5690602", "0.56799436", "0.55871075", "0.55695295", "0.55497336", "0.5545188", "0.5541778", "0.54927766", "0.5454155", "0.54400706", "0....
0.0
-1
init loads the routes for version 1
func init() { // var _r = net.GetRouter() // var r = _r.PathPrefix("/v1").Subrouter() var r = net.GetRouter() //route for test log.Print("cz init net_v1") r.Handle("/v3/fetchtokenizedcards", netHandle(handleDBGettokenizedcards, nil)).Methods("GET") //logicbusiness.go r.Handle("/v3/processpayment", ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func InitRoutesV1(tagRepository TagRepository) Controller {\n\treturn Controller{tagRepository: tagRepository}\n}", "func init() {\n\tutilruntime.Must(routev1.Install(common.Scheme))\n}", "func initalizeRoutes() {\n\n\tv1 := app.Group(\"/v1\")\n\n\t// Auth controller routes\n\taccountRoutes := v1.Group(\"/acco...
[ "0.72105503", "0.7132556", "0.70808864", "0.67184865", "0.6670662", "0.6662298", "0.6615105", "0.654131", "0.6539156", "0.6531931", "0.6509237", "0.6504522", "0.6493297", "0.64922535", "0.6465535", "0.6459662", "0.644983", "0.644032", "0.64029247", "0.6391795", "0.639086", ...
0.6707374
4
handleTest is an example for receive and handle the request from client
func handleTestV1(w http.ResponseWriter, r *http.Request) { defer func() { db.Connection.Close(nil) }() log.Print("cz handleTestV1") fmt.Fprint(w,"youtochi iso 2") rw := net.ResponseWriterJSON(w) rw.Write([]byte(`{"ready":true}`)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func testHandler(w http.ResponseWriter, r *http.Request) {\n\ttestEvent := `{\"output\":\"This is a test from falcosidekick\",\"priority\":\"Debug\",\"rule\":\"Test rule\", \"time\":\"`+time.Now().UTC().Format(time.RFC3339)+`\",\"outputfields\": {\"proc.name\":\"falcosidekick\",\"user.name\":\"falcosidekick\"}}`\n...
[ "0.67621565", "0.66037565", "0.64968973", "0.6321896", "0.63057536", "0.6269187", "0.62222594", "0.61611843", "0.61028373", "0.6018702", "0.6017492", "0.59806794", "0.59761524", "0.59743685", "0.5950414", "0.5908628", "0.5903862", "0.5894204", "0.5858509", "0.5857489", "0.584...
0.5541938
59
post handleDBGettokenizedcards receive and handle the request from client, access DB, and web
func handleDBPostGettokenizedcards(w http.ResponseWriter, r *http.Request) { defer func() { db.Connection.Close(nil) }() var errorGeneral string var errorGeneralNbr string var requestData modelito.RequestTokenizedCards errorGeneral="" requestData, errorGeneral=obtainPostParmsGettokenizedca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func handleDBGeneratetokenized(w http.ResponseWriter, r *http.Request) {\n\tdefer func() {\n\t\tdb.Connection.Close(nil)\n\t}()\n var requestData modelito.RequestTokenized\n var errorGeneral string\n var errorGeneralNbr string\n \n errorGeneral=\"\"\n requestData,errorGeneral =obtainParm...
[ "0.6588198", "0.64763606", "0.6018936", "0.579982", "0.5634544", "0.56159276", "0.5453365", "0.5441846", "0.5394664", "0.5379061", "0.5350443", "0.5323084", "0.52241564", "0.51942533", "0.5153262", "0.51236796", "0.51103026", "0.510832", "0.5101802", "0.50940883", "0.50757515...
0.78089374
0
handleGeneratetokenized for receive and handle the request from client
func handleDBPostGeneratetokenized(w http.ResponseWriter, r *http.Request) { defer func() { db.Connection.Close(nil) }() var requestData modelito.RequestTokenized var errorGeneral string var errorGeneralNbr string errorGeneral="" requestData,errorGeneral =obtainPostParmsGeneratetokeni...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func generateHandler(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\n\t// Default length for the body to generate.\n\ttokenLen := 50\n\n\tif r.URL.Query().Get(\"limit\") != \"\" {\n\t\ttokenLen, err = strconv.Atoi(r.URL.Query().Get(\"limit\"))\n\t\tif err != nil {\n\t\t\terrHandler(w, 500, err)\n\t\t...
[ "0.6485886", "0.6367012", "0.6349186", "0.6342776", "0.63062215", "0.6230696", "0.6209389", "0.610611", "0.6071862", "0.6026105", "0.5899857", "0.5849294", "0.5813853", "0.57808214", "0.57751876", "0.57645434", "0.5722361", "0.5669487", "0.56474334", "0.56421036", "0.56376094...
0.6050069
9
/////////////////////////////v4 /////////////////////////////v4 v4handleDBProcesspayment receive and handle the request from client, access DB
func v4handleDBPostProcesspayment(w http.ResponseWriter, r *http.Request) { defer func() { db.Connection.Close(nil) }() var errorGeneral string var errorGeneralNbr string var requestData modelito.RequestPayment errorGeneral="" requestData,errorGeneral =obtainPostParmsProcessPayment(r,errorGener...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func v4handleDBProcesspayment(w http.ResponseWriter, r *http.Request) {\n\tdefer func() {\n\t\tdb.Connection.Close(nil)\n\t}()\n\n var errorGeneral string\n var\terrorGeneralNbr string\n var requestData modelito.RequestPayment\n errorGeneral=\"\"\nrequestData,errorGeneral =obtainParmsProcessPayment(r,e...
[ "0.8299379", "0.6380844", "0.60654527", "0.5884241", "0.58363223", "0.579999", "0.57807887", "0.5764955", "0.5746082", "0.5651478", "0.5642665", "0.56156886", "0.5587672", "0.5553257", "0.54693264", "0.5430645", "0.5390535", "0.53442734", "0.5306043", "0.5254643", "0.525085",...
0.80649585
1
/////////////////////////////v4 /////////////////////////////v4 v4handleDBProcesspayment receive and handle the request from client, access DB
func v4handleDBProcesspayment(w http.ResponseWriter, r *http.Request) { defer func() { db.Connection.Close(nil) }() var errorGeneral string var errorGeneralNbr string var requestData modelito.RequestPayment errorGeneral="" requestData,errorGeneral =obtainParmsProcessPayment(r,errorGeneral) //////...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func v4handleDBPostProcesspayment(w http.ResponseWriter, r *http.Request) {\n\tdefer func() {\n\t\tdb.Connection.Close(nil)\n\t}()\n var errorGeneral string\n var errorGeneralNbr string\n var requestData modelito.RequestPayment\n \n errorGeneral=\"\"\nrequestData,errorGeneral =obtainPostParmsProcess...
[ "0.8066236", "0.63811046", "0.60661125", "0.5885126", "0.5838394", "0.58021265", "0.57802284", "0.5765489", "0.5746198", "0.56511474", "0.5642199", "0.56173843", "0.55882144", "0.55527824", "0.547019", "0.54304844", "0.5391546", "0.5343794", "0.5305601", "0.52543783", "0.5251...
0.8300391
0
handleGeneratetokenized for receive and handle the request from client
func handleDBGeneratetokenized(w http.ResponseWriter, r *http.Request) { defer func() { db.Connection.Close(nil) }() var requestData modelito.RequestTokenized var errorGeneral string var errorGeneralNbr string errorGeneral="" requestData,errorGeneral =obtainParmsGeneratetokenized(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func generateHandler(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\n\t// Default length for the body to generate.\n\ttokenLen := 50\n\n\tif r.URL.Query().Get(\"limit\") != \"\" {\n\t\ttokenLen, err = strconv.Atoi(r.URL.Query().Get(\"limit\"))\n\t\tif err != nil {\n\t\t\terrHandler(w, 500, err)\n\t\t...
[ "0.64853287", "0.634854", "0.63432175", "0.6306596", "0.62312275", "0.6210366", "0.6107571", "0.60715586", "0.6049596", "0.60266787", "0.5900387", "0.5849722", "0.58142793", "0.5782279", "0.5776159", "0.5763276", "0.5723139", "0.56683236", "0.5648297", "0.5643337", "0.56363",...
0.6366441
1
THIS NEEDS OPTIONS AND FLAGS IT IS NOT CLEAR THIS NEEDS OR SHOULD BE A repo.Repo THINGY
func (p *S3Publisher) Prune(r repo.Repo, opts *PruneOptions) error { // grouped is a make(map[string]map[string][]*s3.S3Object) // which is not ideal but it's also too soon to optimize... grouped, err := p.group(r) if err != nil { return err } to_prune := make([]*s3.S3Object, 0) for _, details := range gr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Manager) fetchRepo(p MetaPlan, t Task, branch string, ps ParameterStore, input, output ioAddr) string {\n\tvar parameters string\n\tfor k, v := range t.Parameters {\n\t\tif !strings.HasPrefix(v, \"((\") || !strings.HasSuffix(v, \"))\") {\n\t\t\tparameters = fmt.Sprintf(\"%sexport %s=%s\\n\", parameters, k...
[ "0.5838893", "0.5700386", "0.5663306", "0.5465661", "0.5457588", "0.5444131", "0.54148257", "0.54031265", "0.5380504", "0.5371099", "0.5325028", "0.53125", "0.53032994", "0.52985305", "0.52922666", "0.52624005", "0.5224353", "0.52225304", "0.52225304", "0.5209874", "0.5206702...
0.0
-1
this is its own method because we'll probably need and want it for generating index pages mmmmmaybe? presort everything before we return things?
func (p *S3Publisher) group(r repo.Repo) (map[string]map[string][]*s3.S3Object, error) { grouped := make(map[string]map[string][]*s3.S3Object) // Basically what we're after is something like this: // // + whosonfirst-data-venue-us-ca // + 123455 // - ...csv.bz2 // - ...db.bz2 mu := new(sync.RWMutex) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func create_index_files(ps []Post, indexname string) {\n\tvar prev, next int\n\tindex_page_flag := false\n\tindex := 1\n\tnum := 0\n\tlength := len(ps)\n\tsort.Sort(ByODate(ps))\n\tsort_index := make([]Post, 0)\n\tfor i := range ps {\n\t\tif ps[i].Changed {\n\t\t\tindex_page_flag = true\n\t\t}\n\t\tsort_index = ap...
[ "0.58273494", "0.5466409", "0.5307234", "0.5255241", "0.52120346", "0.5209862", "0.5153699", "0.5137243", "0.5116091", "0.5083791", "0.5040877", "0.5034797", "0.5020432", "0.49997312", "0.49883762", "0.49658018", "0.49565417", "0.4942077", "0.49418354", "0.49350893", "0.49299...
0.0
-1
Bit returns a uint32 with vth bit set to 1.
func Bit(v int) uint32 { return uint32(1) << uint32(v) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (x *Int) Bit(i int) uint {}", "func IntBit(x *big.Int, i int) uint", "func Bit(x, n uint) uint {\n\treturn (x >> n) & 1\n}", "func MSB32(x uint32) uint32", "func Val(value byte, bit byte) byte {\n\treturn (value >> bit) & 1\n}", "func getBit(n int32, i int) int32 {\n\tresult := n & (1 << uint(i))\n\...
[ "0.6833733", "0.66398203", "0.65513724", "0.64699847", "0.6399387", "0.63546085", "0.61861306", "0.61491585", "0.61178416", "0.6110519", "0.6080812", "0.6062119", "0.6059498", "0.587452", "0.5837608", "0.5821337", "0.58110696", "0.5806684", "0.5805188", "0.57958925", "0.57812...
0.8089188
0
SetPostviewImageSize sets the Post View image size for the camera: The possible options are: "2M" a smaller preview, usually 2Megpixels in size, sometimes not camera dependant "Original" the size of the image taken
func (c *Camera) SetPostviewImageSize(size PostViewSize) (err error) { _, err = c.newRequest(endpoints.Camera, "setPostviewImageSize", size).Do() return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Camera) GetPostviewImageSize() (size string, err error) {\n\tresp, err := c.newRequest(endpoints.Camera, \"getPostviewImageSize\").Do()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif len(resp.Result) > 0 {\n\t\terr = json.Unmarshal(resp.Result[0], &size)\n\t}\n\n\treturn\n}", "func (c *Camera) SetImageSize...
[ "0.6737561", "0.62523794", "0.6224132", "0.5630493", "0.5371186", "0.5294629", "0.49871954", "0.49389657", "0.48399967", "0.47075906", "0.4678444", "0.46008775", "0.4587406", "0.44018033", "0.4371223", "0.43571287", "0.43469974", "0.43336517", "0.43305343", "0.43261597", "0.4...
0.83650637
0
GetPostviewImageSize obtains the current Post View Image size from the camera: The possible options are: "2M" a smaller preview, usually 2Megpixels in size, sometimes not camera dependant "Original" the size of the image taken
func (c *Camera) GetPostviewImageSize() (size string, err error) { resp, err := c.newRequest(endpoints.Camera, "getPostviewImageSize").Do() if err != nil { return } if len(resp.Result) > 0 { err = json.Unmarshal(resp.Result[0], &size) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Camera) GetSupportedPostviewImageSize() (sizes []string, err error) {\n\tresp, err := c.newRequest(endpoints.Camera, \"getSupportedPostviewImageSize\").Do()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif len(resp.Result) > 0 {\n\t\terr = json.Unmarshal(resp.Result[0], &sizes)\n\t}\n\n\treturn\n}", "func (c...
[ "0.7458114", "0.69781554", "0.61268085", "0.48669896", "0.48574117", "0.47957015", "0.47445032", "0.47146225", "0.47024658", "0.46297923", "0.46039", "0.45731974", "0.45198196", "0.4490976", "0.44749692", "0.44173935", "0.44143057", "0.44099662", "0.44064572", "0.439179", "0....
0.8124131
0
GetSupportedPostviewImageSize obtains the supported Post View Image sizes from the camera
func (c *Camera) GetSupportedPostviewImageSize() (sizes []string, err error) { resp, err := c.newRequest(endpoints.Camera, "getSupportedPostviewImageSize").Do() if err != nil { return } if len(resp.Result) > 0 { err = json.Unmarshal(resp.Result[0], &sizes) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Camera) GetAvailablePostviewImageSize() (current string, available []string, err error) {\n\tresp, err := c.newRequest(endpoints.Camera, \"getAvailablePostviewImageSize\").Do()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif len(resp.Result) >= 1 {\n\t\t// Current size\n\t\tif err := json.Unmarshal(resp.Resul...
[ "0.74820864", "0.730369", "0.571322", "0.4549322", "0.44948772", "0.4281146", "0.427835", "0.4273784", "0.4234962", "0.42299852", "0.418386", "0.4142235", "0.41321218", "0.4115057", "0.41139987", "0.40988758", "0.4079467", "0.40490967", "0.40485758", "0.40454385", "0.4030844"...
0.86533886
0
GetAvailablePostviewImageSize obtains the current and available Post View Image sizes from the camera
func (c *Camera) GetAvailablePostviewImageSize() (current string, available []string, err error) { resp, err := c.newRequest(endpoints.Camera, "getAvailablePostviewImageSize").Do() if err != nil { return } if len(resp.Result) >= 1 { // Current size if err := json.Unmarshal(resp.Result[0], &current); err != n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Camera) GetSupportedPostviewImageSize() (sizes []string, err error) {\n\tresp, err := c.newRequest(endpoints.Camera, \"getSupportedPostviewImageSize\").Do()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif len(resp.Result) > 0 {\n\t\terr = json.Unmarshal(resp.Result[0], &sizes)\n\t}\n\n\treturn\n}", "func (c...
[ "0.7907042", "0.7288901", "0.5191613", "0.46706542", "0.45597464", "0.44490406", "0.44459066", "0.43250227", "0.42954162", "0.42822164", "0.42566746", "0.4238603", "0.42044538", "0.41916734", "0.41730225", "0.4146435", "0.40981996", "0.40936428", "0.4080742", "0.40763035", "0...
0.8519555
0
HandleRequest handles incoming request
func HandleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { _, _ = pretty.Println("parsed:", request.Body) return events.APIGatewayProxyResponse{Body: "response is working", StatusCode: 200}, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *Handler) handleRequest(w http.ResponseWriter, r *http.Request) {\n\tmethod := r.Method\n\th.handleCommon(w, r, method)\n}", "func HandleRequest(db *sql.DB) {\n\troutes := chi.NewRouter()\n\t// Route for user API\n\troutes.Get(\"/v1/users\", initRetrieveResolver(db).GetAllUsers)\n\troutes.Post(\"/v1/user...
[ "0.74420005", "0.72612906", "0.7180297", "0.7127764", "0.7055004", "0.70397246", "0.6982768", "0.6969357", "0.6969128", "0.69621074", "0.6961445", "0.6941809", "0.69207567", "0.6908853", "0.6908045", "0.68994975", "0.68979985", "0.6867785", "0.6861937", "0.6854056", "0.684881...
0.73736703
1
New creates and returns (but does not start) a new KeyValueServer.
func New(store kvstore.KVStore) KeyValueServer { // TODO: implement this! var server keyValueServer server.clientNum = 0 server.listener = nil server.readChan = make(chan []byte) server.channelMap = make(map[net.Conn]chan []byte) // 使用接口时,返回接口类型变量, 参考 book p113 return &server }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New() KeyValueServer {\n\treturn &keyValueServer{\n\t\tnil,\n\t\tmake([]*client, 0),\n\t\tmake(chan *request),\n\t\tmake(chan *request),\n\t\tmake(chan []byte),\n\t\tmake(chan net.Conn),\n\t\tmake(chan int),\n\t\tmake(chan int),\n\t\tmake(chan *client),\n\t\tmake(chan int),\n\t\tmake(chan int)}\n}", "func N...
[ "0.80415136", "0.7734398", "0.6711053", "0.6413338", "0.64029986", "0.6365256", "0.6311367", "0.63072085", "0.63063824", "0.62676656", "0.6260089", "0.6259903", "0.62559277", "0.62521654", "0.624715", "0.624715", "0.6245179", "0.6245179", "0.6236103", "0.6229519", "0.6223292"...
0.814005
0
This file contains the API methods for the public API
func enterLobby(w http.ResponseWriter, r *http.Request) { lobby, err := getLobby(r) if err != nil { if err == noLobbyIdSuppliedError { http.Error(w, err.Error(), http.StatusBadRequest) } else if err == lobbyNotExistentError { http.Error(w, err.Error(), http.StatusNotFound) } else { http.Error(w, err.Er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func InitAPI() {\n\n}", "func restAPI(keyCollection *ED25519Keys) {\n\n\t// CORS\n\tcorsAllowedHeaders := []string{\n\t\t\"Access-Control-Allow-Headers\",\n\t\t\"Access-Control-Allow-Methods\",\n\t\t\"Access-Control-Allow-Origin\",\n\t\t\"Cache-Control\",\n\t\t\"Content-Security-Policy\",\n\t\t\"Feature-Policy\"...
[ "0.6748179", "0.62991816", "0.5932598", "0.5911503", "0.57676053", "0.5707773", "0.5633813", "0.56232923", "0.56217265", "0.5617652", "0.5583918", "0.5582121", "0.55721515", "0.5566437", "0.5557306", "0.5547093", "0.5539885", "0.5531036", "0.5517308", "0.54855347", "0.5481521...
0.0
-1
InterceptRequest creates new request interceptor
func InterceptRequest(f func(http.Header)) *RequestInterceptor { return &RequestInterceptor{Intercept: f} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *APITest) Intercept(interceptor Intercept) *APITest {\n\ta.request.interceptor = interceptor\n\treturn a\n}", "func (this Interceptor) Intercept(url string, exec rack.Middleware) error {\n\tif this[url] != nil {\n\t\treturn PreExistingInterceptorError{url}\n\t}\n\tthis[url] = exec\n\treturn nil\n}", "f...
[ "0.71772784", "0.6711371", "0.6566157", "0.65058345", "0.63735974", "0.6020365", "0.5849495", "0.58412755", "0.5832512", "0.5831639", "0.58202237", "0.5789917", "0.5758646", "0.57329756", "0.5705637", "0.57048255", "0.56965905", "0.56952894", "0.56863815", "0.56753355", "0.56...
0.7859327
0
ServeHandler implements middleware interface
func (m RequestInterceptor) ServeHandler(h http.Handler) http.Handler { if m.Intercept == nil { return h } return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { m.Intercept(r.Header) h.ServeHTTP(w, r) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m middleware) serve(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tm.fn(w, r, ps, m.next.serve)\n}", "func (mux *ServeMux) Handler(r *Request) (h Handler, pattern string)", "func (sw *subware) serve(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tsw.middleware.serve...
[ "0.701317", "0.6978027", "0.68639946", "0.6832848", "0.6825121", "0.67454225", "0.671184", "0.671184", "0.671184", "0.66485435", "0.66485435", "0.662997", "0.66192985", "0.6582061", "0.6558721", "0.6557733", "0.6548036", "0.65442", "0.65360177", "0.6521949", "0.6514291", "0...
0.6135633
52
InterceptResponse creates new response interceptor
func InterceptResponse(f ResponseInterceptFunc) *ResponseInterceptor { return &ResponseInterceptor{Intercept: f} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *middleware) InterceptResponse(ctx context.Context, next gqlgen.ResponseHandler) *gqlgen.Response {\n\tresp := next(ctx)\n\n\toperations, ok := FromCtx(ctx)\n\tif !ok {\n\t\treturn resp\n\t}\n\n\tlocations := make([]string, 0)\n\tfor _, operation := range *operations {\n\t\toperationURL := fmt.Sprintf(\"%s...
[ "0.6732688", "0.61742854", "0.61518264", "0.60882735", "0.6087335", "0.59464914", "0.5909216", "0.5903693", "0.58017325", "0.5780744", "0.57799304", "0.574046", "0.57401216", "0.5722633", "0.5645109", "0.5630329", "0.54868275", "0.5467772", "0.54632527", "0.5380859", "0.53800...
0.79600096
0
ServeHandler implements middleware interface
func (m ResponseInterceptor) ServeHandler(h http.Handler) http.Handler { if m.Intercept == nil { return h } return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { nw := interceptRW{ ResponseWriter: w, f: m.Intercept, status: http.StatusOK, } defer nw.intercept()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m middleware) serve(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tm.fn(w, r, ps, m.next.serve)\n}", "func (mux *ServeMux) Handler(r *Request) (h Handler, pattern string)", "func (sw *subware) serve(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tsw.middleware.serve...
[ "0.701317", "0.6978027", "0.68639946", "0.6832848", "0.6825121", "0.67454225", "0.671184", "0.671184", "0.671184", "0.66485435", "0.66485435", "0.662997", "0.66192985", "0.6582061", "0.6558721", "0.6557733", "0.6548036", "0.65442", "0.65360177", "0.6521949", "0.6514291", "0...
0.0
-1
StatusCode returns status code
func (w *interceptRW) StatusCode() int { return w.status }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func StatusCode(err error) int {\n\tif e := getResponseError(err); e != nil {\n\t\treturn e.StatusCode\n\t} else {\n\t\treturn 0\n\t}\n}", "func getStatusCode(err error) int {\n\tif err == nil {\n\t\treturn http.StatusOK\n\t}\n\n\tswitch err {\n\tcase domain.ErrInternalServerError:\n\t\treturn http.StatusInterna...
[ "0.7977139", "0.7895499", "0.7739947", "0.7661967", "0.76566845", "0.76324046", "0.76063544", "0.7597542", "0.7560624", "0.7558895", "0.75543267", "0.75114775", "0.75105804", "0.7489442", "0.74774843", "0.74693877", "0.7460971", "0.7456384", "0.74472046", "0.744233", "0.74398...
0.71363187
87
Push implements Pusher interface
func (w *interceptRW) Push(target string, opts *http.PushOptions) error { if w, ok := w.ResponseWriter.(http.Pusher); ok { return w.Push(target, opts) } return http.ErrNotSupported }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (mb MessageBroadcast) Push(title, body, url, serviceName string) error {\n\terr := mb.Notifier.SendNotification(fmt.Sprintf(\"%s - %s\", serviceName, title), body, url)\n\treturn err\n}", "func (p *Pusher) Push(ctx context.Context) error {\n\tif p.PushFormat == \"\" {\n\t\tp.PushFormat = expfmt.FmtText\n\t}...
[ "0.7526137", "0.7486932", "0.73966146", "0.7359446", "0.73550624", "0.7211849", "0.7205202", "0.71911556", "0.71343577", "0.7076594", "0.70547783", "0.7031746", "0.7003834", "0.69900435", "0.69860846", "0.6985572", "0.6964585", "0.69643676", "0.6919392", "0.68924594", "0.6860...
0.0
-1
Flush implements Flusher interface
func (w *interceptRW) Flush() { if w, ok := w.ResponseWriter.(http.Flusher); ok { w.Flush() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (b *Writer) Flush() (err error)", "func (b *BodyWriter) Flush() {}", "func (w *batchWriter) Flush(ctx context.Context) error {\n\tfor i, s := range w.batch {\n\t\t_, err := fmt.Fprintln(w.writer, s)\n\t\tif err != nil {\n\t\t\tw.batch = w.batch[i:]\n\t\t\tw.persistRecords = w.persistRecords[i:]\n\t\t\tret...
[ "0.77338", "0.7562347", "0.7337648", "0.7318209", "0.7307648", "0.72882044", "0.72349006", "0.7216775", "0.7198917", "0.71503454", "0.71102554", "0.71098953", "0.7104424", "0.7090973", "0.70844454", "0.70734066", "0.70644945", "0.70608634", "0.70598626", "0.70474774", "0.7034...
0.66860497
70
Hijack implements Hijacker interface
func (w *interceptRW) Hijack() (net.Conn, *bufio.ReadWriter, error) { if w, ok := w.ResponseWriter.(http.Hijacker); ok { return w.Hijack() } return nil, nil, http.ErrNotSupported }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *ResponseWriter) Hijack() {\n\tr.ResponseWriter.Hijack()\n\treturn\n}", "func (w *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) {\n\tw.hijacked = true\n\tconn := newNodeConn(w.Value, w.reqReader)\n\tbrw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn))\n\treturn conn, brw, ni...
[ "0.72885764", "0.7229567", "0.7125964", "0.7092031", "0.7088203", "0.70847553", "0.7069373", "0.7020887", "0.6913342", "0.69082886", "0.68985516", "0.6793148", "0.6792225", "0.6764104", "0.66340905", "0.6617869", "0.6606947", "0.65951735", "0.65904766", "0.65904766", "0.65412...
0.71264076
2
Return a new ZKCluster instance.
func NewZKCluster(servers []string, clustername string, timeout time.Duration) (*ZKCluster, error) { cluster := &ZKCluster{ version: -1, } if zc, err := NewZKConnector(servers, timeout); err != nil { return nil, err } else { cluster.zc = zc } if ci, err := cluster.zc.GetCluster(clustername); err != nil { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New() *Cluster {\n\treturn &Cluster{\n\t\tmembers: make(map[string]time.Time),\n\t}\n}", "func NewCluster() *Cluster {\n\treturn &Cluster{}\n}", "func NewCluster() *Cluster {\n\treturn &Cluster{}\n}", "func New(clusterDefinition *v1alpha1.Cassandra) (*Cluster, error) {\n\tcluster := &Cluster{}\n\tif err...
[ "0.7340847", "0.7242057", "0.7242057", "0.7218593", "0.71349406", "0.70793885", "0.6993775", "0.68385905", "0.6811856", "0.66942805", "0.66486096", "0.6643621", "0.66187096", "0.6609086", "0.6550304", "0.6538345", "0.6523917", "0.64760154", "0.6463036", "0.6460007", "0.645946...
0.6543308
15
Locate and connect to an appropriate redis instance with a key.
func (c *ZKCluster) Connect(key []byte) (*redis.Client, func(), int64, error) { return c.connector.Connect(key) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *DefaultHandler) GetInstance(xesRedis redo.XesRedisBase) (instance string) {\n\tconf := this.getKeyInfo(xesRedis)\n\tRedisConfMap := core.GetRedisConf()\n\n\tif xesRedis.GetCtx() != nil {\n\t\tif val := xesRedis.GetCtx().Value(\"CacheRemember\"); val != nil && cast.ToBool(val) == true {\n\t\t\treturn th...
[ "0.6440123", "0.594228", "0.5782885", "0.5771898", "0.57064897", "0.5630639", "0.5628469", "0.55736065", "0.5545022", "0.55194753", "0.5472009", "0.54376", "0.54347074", "0.5426242", "0.54239553", "0.5419996", "0.54159856", "0.53502434", "0.534173", "0.53349733", "0.52950644"...
0.54061764
17
ZK assisted NodeReader implementation.
func (c *ZKCluster) ReadNodes() []Shard { cluster_root := ZK_ROOT + "/" + c.info.Name if shardbytes, _, err := c.zc.conn.Get(cluster_root + "/shards"); err != nil { return nil } else { var shards []Shard if err := json.Unmarshal(shardbytes, &shards); err != nil { return nil } return shards } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d *dataHandlerWays) ReadNode(n gosmparse.Node) {\n\n}", "func (m *InMemoryRepository) Reader(u fyne.URI) (fyne.URIReadCloser, error) {\n\tpath := u.Path()\n\n\tif path == \"\" {\n\t\treturn nil, fmt.Errorf(\"invalid path '%s'\", path)\n\t}\n\n\t_, ok := m.Data[path]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(...
[ "0.6017452", "0.59932595", "0.59224087", "0.54634476", "0.54396623", "0.53491575", "0.5331724", "0.5295215", "0.5267231", "0.5247381", "0.5229186", "0.5183156", "0.51690274", "0.5154921", "0.5139493", "0.51317436", "0.5123178", "0.5116769", "0.51056963", "0.51017195", "0.5071...
0.51022786
19
ZK assisted RingBuilder implementation. The ring type or the parameters might be designated via the zookeeper.
func (c *ZKCluster) BuildRing(shards []Shard) *HashRing { switch strings.ToLower(c.info.Options.RingType) { case "consistent": nreplica, err := strconv.Atoi(c.info.Options.RingParams) if err != nil { nreplica = len(shards) } ring := &ConsistentRing{ Nreplica: nreplica, } return ring.BuildRing(shards...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewRing(ctx context.Context, keyConfig *schema.EncryptionKeys) (*Ring, error) {\n\textsvc, err := NewKey(ctx, keyConfig.ExternalServiceKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Ring{\n\t\tExternalServiceKey: extsvc,\n\t}, nil\n}", "func Builder(bidderName openrtb_ext.BidderName, config co...
[ "0.5398259", "0.5288295", "0.5245123", "0.5193959", "0.5136608", "0.5104535", "0.5075202", "0.50625455", "0.50067204", "0.49620506", "0.49620014", "0.49620014", "0.48837057", "0.4865368", "0.48477665", "0.48336133", "0.48028204", "0.48012844", "0.47943044", "0.47305435", "0.4...
0.63549584
0
The watcher for status updates via the zookeeper.
func (c *ZKCluster) watchStatusUpdates() { status_node := ZK_ROOT + "/" + c.info.Name + "/status" for { exists, stat, event, err := c.zc.conn.ExistsW(status_node) if err == nil && exists && stat.Version > c.version { if statusbytes, stat, err := c.zc.conn.Get(status_node); err == nil { var status map[strin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *ConfigService) Watch(d time.Duration)", "func (s *Server) Watch(in *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error {\n\tresp := &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_SERVING}\n\treturn server.Send(resp)\n}", "func (service *D...
[ "0.623958", "0.61837316", "0.6139248", "0.6057308", "0.59626967", "0.59366274", "0.591849", "0.591734", "0.5904838", "0.5891101", "0.58281827", "0.58090955", "0.57885873", "0.57814926", "0.5751366", "0.57476586", "0.5746499", "0.56484777", "0.5643181", "0.5641713", "0.5572983...
0.6716589
0
ZK assisted HealthChecker implementation.
func (c *ZKCluster) Start(shards []Shard) <-chan ShardStatus { if c.checkerdone != nil { return c.updates } c.checkerdone = make(chan bool) c.status = make(map[string]ShardStatus, len(shards)) c.updates = make(chan ShardStatus, len(shards)) go c.watchStatusUpdates() return c.updates }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (fwdclient *Client) HealthCheck() error {\n\tlog.Debugf(\"%s: url=%s\", fwdclient.AppName, fwdclient.ActionUrls.Health)\n\treq, err := http.NewRequest(\"GET\", fwdclient.ActionUrls.Health, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Splunk %s\", fwdclient.To...
[ "0.694781", "0.6549382", "0.649623", "0.6465717", "0.6454487", "0.6405309", "0.6332119", "0.6331955", "0.6292222", "0.6247468", "0.62274045", "0.6200204", "0.6146639", "0.61432445", "0.61342466", "0.6122834", "0.611287", "0.6102746", "0.60879415", "0.6070193", "0.60683095", ...
0.0
-1
ZK assisted HealthChecker implementation.
func (c *ZKCluster) Stop() { if c.checkerdone != nil { close(c.checkerdone) close(c.updates) c.checkerdone = nil } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (fwdclient *Client) HealthCheck() error {\n\tlog.Debugf(\"%s: url=%s\", fwdclient.AppName, fwdclient.ActionUrls.Health)\n\treq, err := http.NewRequest(\"GET\", fwdclient.ActionUrls.Health, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Splunk %s\", fwdclient.To...
[ "0.694781", "0.6549382", "0.649623", "0.6465717", "0.6454487", "0.6405309", "0.6332119", "0.6331955", "0.6292222", "0.6247468", "0.62274045", "0.6200204", "0.6146639", "0.61432445", "0.61342466", "0.6122834", "0.611287", "0.6102746", "0.60879415", "0.6070193", "0.60683095", ...
0.0
-1
NewApp to handle routes
func NewApp(log *log.Logger) *App { app := App{ TreeMux: httptreemux.New(), log: log, } return &app }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewApp(root string) *App {\n\n CheckEnv()\n\n // Use negroni for middleware\n ne := negroni.New()\n\n // Use gorilla/mux for routing\n ro := mux.NewRouter()\n\n // Use Render for template. Pass in path to templates folder\n // as well as asset helper functions.\n re := render.New(render.Options{\n ...
[ "0.6850916", "0.6446402", "0.6436145", "0.64202356", "0.6252538", "0.6222237", "0.62143093", "0.61757416", "0.61443526", "0.614394", "0.6132202", "0.6132184", "0.6110882", "0.6105404", "0.6094272", "0.6080953", "0.60554385", "0.60168475", "0.5994937", "0.5980408", "0.59724873...
0.0
-1
doFetch do actual http call and will use given ctx as http request context.
func doFetch(ctx context.Context, url string, wg *sync.WaitGroup, result chan<- fetchResult) { start := time.Now() defer wg.Done() var ( err error req *http.Request res *http.Response body []byte ) resChan := fetchResult{url: url, err: err} req, err = http.NewRequest("GET", url, nil) if err != nil { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (f *fetch) do(ctx context.Context) (*fetchResult, error) {\n\tif globsMatchPath(f.g.goBinEnvGONOPROXY, f.modulePath) {\n\t\treturn f.doDirect(ctx)\n\t}\n\n\tvar r *fetchResult\n\tif err := walkGOPROXY(f.g.goBinEnvGOPROXY, func(proxy string) error {\n\t\tvar err error\n\t\tr, err = f.doProxy(ctx, proxy)\n\t\tr...
[ "0.6109814", "0.6098583", "0.6040279", "0.6032584", "0.5998184", "0.5843048", "0.5820807", "0.5798788", "0.57359403", "0.56955314", "0.564922", "0.56386936", "0.56216127", "0.55943507", "0.55792916", "0.5568278", "0.5544637", "0.5544262", "0.5529172", "0.5499886", "0.5455281"...
0.6665152
0
NewHTTPClient create an http client
func NewHTTPClient() *HTTPClient { return &HTTPClient{ Client: http.DefaultClient, CacheDir: viper.GetString("http_cache_dir"), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newHTTPClient() *http.Client {\n\tclient := &http.Client{\n\t\tTimeout: defaultTimeout,\n\t}\n\treturn client\n}", "func newHTTPClient() *http.Client {\n\treturn &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tProxy: http.ProxyFromEnvironment,\n\t\t\tDialContext: (&net.Dialer{\n\t\t\t\tTimeout: time...
[ "0.8164489", "0.79637885", "0.79102343", "0.78867954", "0.78280497", "0.7811923", "0.77769667", "0.7729933", "0.7682745", "0.7660241", "0.765571", "0.7613807", "0.7602645", "0.7594723", "0.75803137", "0.75574845", "0.75545543", "0.7552828", "0.7546641", "0.7512223", "0.748323...
0.7767212
7
NewBytesBuffer create a bytes buffer
func NewBytesBuffer(p []byte) *BytesBuffer { return &BytesBuffer{reader: bytes.NewReader(p)} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewBufferBytes(data []byte) *Buffer {\n\treturn &Buffer{refCount: 0, buf: data, length: len(data)}\n}", "func newBuffer() Buffer {\n\treturn &buffer{\n\t\tbytes: make([]byte, 0, 64),\n\t}\n}", "func newBuffer(b []byte) *buffer {\n\treturn &buffer{proto.NewBuffer(b), 0}\n}", "func NewBuffer(inp []byte) *...
[ "0.81802195", "0.7357088", "0.72746956", "0.7250504", "0.7194273", "0.7021639", "0.69860196", "0.6953487", "0.6906288", "0.69045806", "0.6828925", "0.6827577", "0.6809075", "0.67834884", "0.6779053", "0.6775601", "0.67704606", "0.6725194", "0.67095757", "0.66958207", "0.66910...
0.82989466
0
Read from the byte buffer
func (bb *BytesBuffer) Read(p []byte) (n int, err error) { return bb.reader.Read(p) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Read(b []byte) { Reader.Read(b) }", "func (cb *Buffer) Read(buf []byte) (int, error) {\n\tif buf == nil || len(buf) == 0 {\n\t\treturn 0, fmt.Errorf(\"Target buffer is null or empty\")\n\t}\n\n\ttoRead := min(len(buf), cb.ReadAvailability())\n\n\tlBytes := min(cb.rpos, toRead)\n\tcopy(buf[toRead-lBytes:toRe...
[ "0.73192525", "0.71558887", "0.71507657", "0.7125411", "0.7039935", "0.70364684", "0.69876087", "0.69863915", "0.69758904", "0.69751304", "0.69681305", "0.69678485", "0.69638294", "0.6963164", "0.6959764", "0.6959191", "0.6940648", "0.6894346", "0.68853796", "0.6876418", "0.6...
0.75947374
0
Close the bytes buffer
func (bb *BytesBuffer) Close() error { return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (b *bufCloser) Close() error { return nil }", "func (b *Bytes) Close() error {\n\tif b.p != nil {\n\t\tPut(b.p)\n\t\tb.p = nil\n\t}\n\treturn nil\n}", "func (bc BufConn) Close() error { return nil }", "func (d Buf) Close() error {\n\treturn nil\n}", "func (b *Buffer) Close() {\n\tb.length = 0\n\tb.poo...
[ "0.7059667", "0.68554896", "0.67279226", "0.6424046", "0.6312021", "0.62552226", "0.62393683", "0.6169757", "0.6165596", "0.60919654", "0.60889745", "0.60793084", "0.60702556", "0.5916911", "0.5909902", "0.58884627", "0.5861613", "0.5854654", "0.5819335", "0.58160126", "0.574...
0.76870584
0
Do perform the http request
func (hc *HTTPClient) Do(req *http.Request) (*http.Response, error) { if hc.CacheDir == "" { return hc.Client.Do(req) } return hc.doFromCache(req) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (k *KeKahu) doRequest(req *http.Request) (*http.Response, error) {\n\tres, err := k.client.Do(req)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"could not make http request: %s\", err)\n\t\treturn res, err\n\t}\n\n\tdebug(\"%s %s %s\", req.Method, req.URL.String(), res.Status)\n\n\t// Check the status from the c...
[ "0.7235754", "0.7090829", "0.7054483", "0.7033687", "0.6982876", "0.6954377", "0.69498605", "0.69461644", "0.693875", "0.69204235", "0.690806", "0.690719", "0.688872", "0.6874766", "0.68274575", "0.6815551", "0.6802797", "0.67801934", "0.6763377", "0.67381525", "0.67107075", ...
0.63527745
57
GenerateKey generates a public/private key pair using entropy from rand.
func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) { priv := make([]byte, PrivateKeySize) if _, err := io.ReadFull(rand, priv); err != nil { return nil, nil, err } pub, err := curve25519.X25519(priv, curve25519.Basepoint) if err != nil { return nil, nil, err } return pub, priv, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GenerateKey(c elliptic.Curve, rand io.Reader) (*PrivateKey, error)", "func GenerateKey(rand io.Reader) (priv PrivateKey, err error) {\n\t/* See Certicom's SEC1 3.2.1, pg.23 */\n\t/* See NSA's Suite B Implementer’s Guide to FIPS 186-3 (ECDSA) A.1.1, pg.18 */\n\n\t/* Select private key d randomly from [1, n) ...
[ "0.7788877", "0.76969683", "0.7624488", "0.744188", "0.7395295", "0.73885936", "0.73758936", "0.7309013", "0.72619724", "0.7205711", "0.71906334", "0.7189971", "0.71129245", "0.70509005", "0.70281416", "0.69510335", "0.69495016", "0.693022", "0.6927671", "0.69265497", "0.6896...
0.76064515
3
ToEd25519 converts the public key p into a ed25519 key. (x, y) = (sqrt(486664)u/v, (u1)/(u+1))
func (p PublicKey) ToEd25519() (ed25519.PublicKey, error) { a, err := convertMont(p) if err != nil { return nil, err } return a.Bytes(), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Ed25519PublicKeyToCurve25519(pk ed25519.PublicKey) []byte {\n\t// ed25519.PublicKey is a little endian representation of the y-coordinate,\n\t// with the most significant bit set based on the sign of the x-coordinate.\n\tbigEndianY := make([]byte, ed25519.PublicKeySize)\n\tfor i, b := range pk {\n\t\tbigEndia...
[ "0.7344533", "0.70818925", "0.70533943", "0.66119736", "0.66119736", "0.6594977", "0.6541674", "0.65109813", "0.6496604", "0.64243305", "0.6326358", "0.6308357", "0.6301593", "0.6285583", "0.61747074", "0.6142724", "0.60759276", "0.6024686", "0.60096884", "0.58517253", "0.584...
0.75875074
0
Equal reports whether p and x have the same value.
func (p PublicKey) Equal(x crypto.PublicKey) bool { xx, ok := x.(PublicKey) if !ok { return false } return bytes.Equal(p, xx) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *PointAffine) Equal(p1 *PointAffine) bool {\n\treturn p.X.Equal(&p1.X) && p.Y.Equal(&p1.Y)\n}", "func (pt *Point) Equal(other *Point) bool {\n\treturn other != nil && pt.X() == other.X() && pt.Y() == other.Y()\n}", "func equals(p1, p2 *node) bool {\n\treturn p1.x == p2.x && p1.y == p2.y\n}", "func (p...
[ "0.66917896", "0.6684461", "0.66173047", "0.65466124", "0.65097314", "0.6504235", "0.6351369", "0.63431054", "0.6267283", "0.6254484", "0.6120719", "0.60315156", "0.60013396", "0.5924778", "0.5841904", "0.5835877", "0.5827727", "0.5808125", "0.5798001", "0.57927734", "0.57853...
0.60522103
11
Public returns the public key using scalar multiplication (scalar point) using the Curve25519 basepoint. It will return nil if the private key is not a valid one.
func (p PrivateKey) Public() crypto.PublicKey { pub, _ := p.PublicKey() return pub }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (priv *PrivateKey) Public() (*PublicKey, error) {\n\tslice, err := curve25519.X25519(priv[:], curve25519.Basepoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp, _ := PublicKeyFromSlice(slice)\n\treturn p, nil\n}", "func (priv *PrivateKey) Public() crypto.PublicKey", "func (priv *PrivateKey) Public...
[ "0.7486395", "0.7223076", "0.7223076", "0.7094562", "0.6961375", "0.6914286", "0.688112", "0.68699086", "0.68139255", "0.6799366", "0.6795756", "0.6795311", "0.6792445", "0.66635567", "0.6620578", "0.65886533", "0.6586128", "0.65498763", "0.65493166", "0.6504039", "0.64899355...
0.6755846
13
Equal reports whether p and x have the same value.
func (p PrivateKey) Equal(x crypto.PrivateKey) bool { xx, ok := x.(PrivateKey) if !ok { return false } return bytes.Equal(p, xx) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *PointAffine) Equal(p1 *PointAffine) bool {\n\treturn p.X.Equal(&p1.X) && p.Y.Equal(&p1.Y)\n}", "func (pt *Point) Equal(other *Point) bool {\n\treturn other != nil && pt.X() == other.X() && pt.Y() == other.Y()\n}", "func equals(p1, p2 *node) bool {\n\treturn p1.x == p2.x && p1.y == p2.y\n}", "func (p...
[ "0.6690539", "0.66829693", "0.66171837", "0.654521", "0.650851", "0.6505088", "0.63501656", "0.63428605", "0.62662584", "0.62546206", "0.6119888", "0.60536253", "0.6030449", "0.6002429", "0.59237117", "0.58420193", "0.5834868", "0.5827569", "0.5807002", "0.57970726", "0.57920...
0.5325338
78
Public returns the public key using scalar multiplication (scalar point) using the Curve25519 basepoint.
func (p PrivateKey) PublicKey() (PublicKey, error) { pub, err := curve25519.X25519(p, curve25519.Basepoint) if err != nil { return nil, err } return pub, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (priv *PrivateKey) Public() (*PublicKey, error) {\n\tslice, err := curve25519.X25519(priv[:], curve25519.Basepoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp, _ := PublicKeyFromSlice(slice)\n\treturn p, nil\n}", "func (priv *PrivateKey) Public() crypto.PublicKey", "func (priv *PrivateKey) Public...
[ "0.7242989", "0.70058376", "0.70058376", "0.69450593", "0.68690264", "0.68627", "0.6815876", "0.67712384", "0.6661278", "0.6604308", "0.65751463", "0.65174145", "0.6499702", "0.6469141", "0.64683825", "0.6461882", "0.64304274", "0.6414707", "0.6411179", "0.6408536", "0.639551...
0.66854215
8
SharedKey returns the result of the scalar multiplication (scalar point), using the PrivateKey as the scalar value and the given key as the point. Both scalar and point must be slices of 32 bytes.
func (p PrivateKey) SharedKey(peerPublicKey []byte) ([]byte, error) { sharedKey, err := curve25519.X25519(p, peerPublicKey) if err != nil { return nil, err } return sharedKey, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ScalarMult(k *big.Int, B *ecdsa.PublicKey) *ecdsa.PublicKey {\n\tkey := new(ecdsa.PublicKey)\n\tkey.Curve = Secp256k1()\n\tkey.X, key.Y = Secp256k1().ScalarMult(B.X, B.Y, k.Bytes())\n\treturn key\n}", "func (w *Wallet) ComputeSharedSecret(publicKey []byte) []byte {\n\tpKey := btckey.PublicKey{}\n\tpKey.From...
[ "0.6313836", "0.6175551", "0.6031206", "0.59949994", "0.58535016", "0.5847794", "0.5770479", "0.57662123", "0.57426673", "0.572979", "0.5617691", "0.5583433", "0.54808366", "0.54642695", "0.5449815", "0.5398248", "0.5391034", "0.5383365", "0.5347781", "0.5343203", "0.53316313...
0.54707223
13
Sign signs the given message with the private key p and returns a signature. It implements the XEdDSA sign method defined in XEdDSA performs two passes over messages to be signed and therefore cannot handle prehashed messages. Thus opts.HashFunc() must return zero to indicate the message hasn't been hashed. This can be...
func (p PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) { if opts.HashFunc() != crypto.Hash(0) { return nil, errors.New("x25519: cannot sign hashed message") } return Sign(rand, p, message) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) {\n\tif opts.HashFunc() != crypto.Hash(0) {\n\t\treturn nil, errors.New(\"sign: cannot sign hashed message\")\n\t}\n\n\tout := Sign(message, priv)\n\treturn out[:], nil\n}", "func (sk *PrivateKey) Si...
[ "0.67398196", "0.6680818", "0.6339215", "0.62464464", "0.619496", "0.6178088", "0.61637336", "0.6148355", "0.6148355", "0.61142945", "0.6048279", "0.6040095", "0.6037477", "0.5980279", "0.59378606", "0.59160537", "0.5905036", "0.5871749", "0.5864553", "0.585822", "0.585396", ...
0.7261845
0
Sign signs the message with privateKey and returns a signature. It will panic if len(privateKey) is not PrivateKeySize. It implements the XEdDSA sign method defined in xeddsa_sign(k, M, Z): A, a = calculate_key_pair(k) r = hash1(a || M || Z) (mod q) R = rB h = hash(R || A || M) (mod q) s = r + ha (mod q) return R || s
func Sign(rand io.Reader, p PrivateKey, message []byte) (signature []byte, err error) { if l := len(p); l != PrivateKeySize { panic("x25519: bad private key length: " + strconv.Itoa(l)) } pub, priv, err := p.calculateKeyPair() if err != nil { return nil, err } random := make([]byte, 64) if _, err := io.Rea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Sign(hash, privateKey []byte) (sig []byte, err error) {\n\tif len(hash) != 32 {\n\t\treturn nil, fmt.Errorf(\"hash is required to be exactly 32 bytes (%d)\", len(hash))\n\t}\n\tif len(privateKey) != 32 {\n\t\treturn nil, fmt.Errorf(\"hex private key is required to be exactly 64 bytes (%d)\", len(privateKey))\...
[ "0.7253015", "0.7078278", "0.7068093", "0.6859804", "0.6822635", "0.6803113", "0.67156845", "0.6710437", "0.67014515", "0.6685589", "0.6672587", "0.66426647", "0.66395503", "0.6634565", "0.6627573", "0.6620776", "0.6604624", "0.6604006", "0.6588775", "0.65789026", "0.65545243...
0.0
-1
Verify reports whether sig is a valid signature of message by publicKey. It will panic if len(publicKey) is not PublicKeySize. It implements the XEdDSA verify method defined in xeddsa_verify(u, M, (R || s)): if u >= p or R.y >= 2|p| or s >= 2|q|: return false A = convert_mont(u) if not on_curve(A): return false h = has...
func Verify(publicKey PublicKey, message, sig []byte) bool { // The following code should be equivalent to: // // pub, err := publicKey.ToEd25519() // if err != nil { // return false // } // return ed25519.Verify(pub, message, sig) if l := len(publicKey); l != PublicKeySize { panic("x25519: bad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Verify(sig []byte, publicKey PublicKey) bool {\n\tif l := len(publicKey); l != PublicKeySize {\n\t\tpanic(\"sign: bad public key length: \" + strconv.Itoa(l))\n\t}\n\n\tif len(sig) < SignatureSize || sig[63]&224 != 0 {\n\t\treturn false\n\t}\n\tmsg := sig[SignatureSize:]\n\tsig = sig[:SignatureSize]\n\n\tretu...
[ "0.73681545", "0.7215541", "0.71791583", "0.71225846", "0.71195", "0.70969844", "0.7055452", "0.70434874", "0.6897032", "0.6861955", "0.67977583", "0.67892903", "0.6772671", "0.67163485", "0.671264", "0.668523", "0.6668513", "0.6657132", "0.6614563", "0.6543836", "0.65239805"...
0.7219678
1
calculateKeyPair converts a Montgomery private key k to a twisted Edwards public key and private key (A, a) as defined in calculate_key_pair(k): E = kB A.y = E.y A.s = 0 if E.s == 1: a = k (mod q) else: a = k (mod q) return A, a
func (p PrivateKey) calculateKeyPair() ([]byte, *edwards25519.Scalar, error) { var pA edwards25519.Point var sa edwards25519.Scalar k, err := (&edwards25519.Scalar{}).SetBytesWithClamping(p) if err != nil { return nil, nil, err } pub := pA.ScalarBaseMult(k).Bytes() signBit := (pub[31] & 0x80) >> 7 if signB...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GenerateKeyPair(group *schnorr.Group) (*SecKey, *PubKey) {\n\ts1 := common.GetRandomInt(group.Q)\n\ts2 := common.GetRandomInt(group.Q)\n\th1 := group.Exp(group.G, s1)\n\th2 := group.Exp(group.G, s2)\n\n\treturn NewSecKey(s1, s2), NewPubKey(h1, h2)\n}", "func GenerateKeyPair(h func() hash.Hash, seed []byte) ...
[ "0.69897085", "0.68689436", "0.68633217", "0.6845767", "0.6727594", "0.6598774", "0.65976435", "0.6574991", "0.65571785", "0.6535598", "0.6515089", "0.6499443", "0.6463625", "0.64459366", "0.6434493", "0.64074236", "0.63993114", "0.6224574", "0.62184876", "0.61737037", "0.616...
0.7862833
0
convertMont converts from a Montgomery ucoordinate to a twisted Edwards point P, according to convert_mont(u): umasked = u (mod 2|p|) P.y = u_to_y(umasked) P.s = 0 return P
func convertMont(u PublicKey) (*edwards25519.Point, error) { um, err := (&field.Element{}).SetBytes(u) if err != nil { return nil, err } // y = (u - 1)/(u + 1) a := new(field.Element).Subtract(um, one) b := new(field.Element).Add(um, one) y := new(field.Element).Multiply(a, b.Invert(b)).Bytes() // Set sign ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *Poly) toMont() {\n\tvar f int16 = int16((uint64(1) << 32) % uint64(q))\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = montgomeryReduce(int32(p[i]) * int32(f))\n\t}\n}", "func (z *Element22) ToMont() *Element22 {\n\tvar rSquare = Element22{\n\t\t11555390936043306539,\n\t\t958669060063230310,\n\t\t25809772728018...
[ "0.58092505", "0.575109", "0.56481266", "0.5609317", "0.5605688", "0.56055814", "0.56046015", "0.54018146", "0.53192925", "0.5307692", "0.5004337", "0.49508178", "0.49239808", "0.48059493", "0.46658686", "0.46323827", "0.4604539", "0.4589097", "0.45698458", "0.45200107", "0.4...
0.70762175
0
Read is a shortcut function to read and parse projects
func Read(path string) (*Project, error) { var error error var data []byte data, error = ioutil.ReadFile(path) if error != nil { return nil, error } var project = &Project{} error = json.Unmarshal(data, project) if error != nil { return nil, error } return project, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *Client) ReadProject(params *ReadProjectParams) (*ReadProjectOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewReadProjectParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"readProject\",\n\t\tMethod: ...
[ "0.7127253", "0.67041546", "0.63716996", "0.62035036", "0.61625195", "0.61137533", "0.6112978", "0.606727", "0.59411407", "0.5883763", "0.5815111", "0.5776463", "0.5734309", "0.5713775", "0.5671496", "0.5671328", "0.5665366", "0.5647636", "0.56434774", "0.5642749", "0.5633865...
0.78015107
0
/ GetAccount Retrieve an account's details
func (a *CredentialsControllerApiService) GetAccount(ctx _context.Context, account string) apiGetAccountRequest { return apiGetAccountRequest{ apiService: a, ctx: ctx, account: account, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetAccount(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tparams := mux.Vars(r)\n\tvar account entity.Account\n\tdb.DBCon.First(&account, params[\"id\"])\n\n\tjson.NewEncoder(w).Encode(account)\n}", "func GetAccount(w http.ResponseWriter, r *http.Req...
[ "0.8176065", "0.79820985", "0.7891528", "0.7867891", "0.7766878", "0.7754104", "0.7738958", "0.772553", "0.77135277", "0.7688991", "0.7680816", "0.76804084", "0.76744354", "0.76669705", "0.7659872", "0.76446897", "0.76438105", "0.7598293", "0.75956196", "0.75939405", "0.75795...
0.6937624
73
/ Execute executes the request
func (r apiGetAccountRequest) Execute() (AccountDetails, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte localVarReturnValue AccountDetails ) localBasePath, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) Execute() (*Response, error) {\n\treturn r.sendRequest()\n}", "func ExecuteRequest(req *http.Request, result interface{}) error {\n\tclient := http.Client{}\n\tresponse, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Println(\"Error executing request call\")\n\t\tlog.Println(err)\n\t\treturn...
[ "0.77782923", "0.7582797", "0.741287", "0.7358983", "0.7292987", "0.7218151", "0.7215562", "0.7154855", "0.7145005", "0.70240575", "0.69687915", "0.695788", "0.6858044", "0.6820558", "0.67871475", "0.6751008", "0.6732763", "0.67267585", "0.66466635", "0.6637201", "0.663456", ...
0.0
-1
/ ListAccounts Retrieve a list of accounts
func (a *CredentialsControllerApiService) ListAccounts(ctx _context.Context) apiListAccountsRequest { return apiListAccountsRequest{ apiService: a, ctx: ctx, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *AccountClient) List(paging PagingParams) (*Resources, error) {\n\n\tr := a.client.R().SetResult(&Resources{})\n\n\tif paging.number != \"\" {\n\t\tr.SetQueryParam(\"page[number]\", paging.number)\n\t}\n\n\tif paging.size != \"\" {\n\t\tr.SetQueryParam(\"page[size]\", paging.size)\n\t}\n\tresp, err := r.Ge...
[ "0.82821333", "0.82535917", "0.7921206", "0.77845496", "0.76322645", "0.7610615", "0.7585643", "0.75775146", "0.75582683", "0.75196075", "0.7479574", "0.74397135", "0.74345064", "0.7419024", "0.7412799", "0.7407804", "0.7386149", "0.736994", "0.7364397", "0.7301035", "0.72818...
0.7339883
19
/ Execute executes the request
func (r apiListAccountsRequest) Execute() ([]Account, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte localVarReturnValue []Account ) localBasePath, err := r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) Execute() (*Response, error) {\n\treturn r.sendRequest()\n}", "func ExecuteRequest(req *http.Request, result interface{}) error {\n\tclient := http.Client{}\n\tresponse, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Println(\"Error executing request call\")\n\t\tlog.Println(err)\n\t\treturn...
[ "0.7777472", "0.7582237", "0.741292", "0.7358592", "0.7292706", "0.72179556", "0.72150666", "0.7154164", "0.7144244", "0.70236844", "0.6968861", "0.69574517", "0.6857601", "0.68203115", "0.6786843", "0.67499226", "0.6732799", "0.6726702", "0.664588", "0.66373837", "0.66341907...
0.0
-1
Clone wraps html/template.Clone to also clone the name
func (t *Template) Clone() (*Template, error) { var tmpl, err = t.Template.Clone() return &Template{tmpl, t.Name}, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (tc *STemplateController) Clone(clone_name string, recursive bool) (*srv_tmpl.ServiceTemplate, error) {\n\turl := urlTemplateAction(tc.ID)\n\taction := make(map[string]interface{})\n\n\taction[\"action\"] = map[string]interface{}{\n\t\t\"perform\": \"clone\",\n\t\t\"params\": map[string]interface{}{\n\t\t\t\"...
[ "0.7064204", "0.6950689", "0.68847734", "0.6830195", "0.6234559", "0.6180015", "0.61048836", "0.6068922", "0.59161884", "0.58908933", "0.58908623", "0.58654845", "0.58292323", "0.56611645", "0.5652772", "0.56419474", "0.56299615", "0.5595035", "0.55785984", "0.5573975", "0.55...
0.76719445
0
Root creates a new TRoot for use in spawning templates. The name should match the main layout's name (as defined in the layout template) so execution of templates doesn't require a template.Lookup call, which can be somewhat error prone.
func Root(name, path string) *TRoot { var tmpl = &Template{template.New(name), name} var t = &TRoot{tmpl, path} return t }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (tp *Template) Root(name string) *Template {\n\ttp.root = name\n\treturn tp\n}", "func (t *TRoot) Name() string {\n\treturn t.template.Name\n}", "func (*Root) Name() (name string) { return \"/\" }", "func (r *Root) Name() string { return \"\" }", "func (a *App) getRoot(w http.ResponseWriter, r *http.R...
[ "0.7597663", "0.6376488", "0.5993522", "0.56988734", "0.5487304", "0.5406119", "0.53739834", "0.53517014", "0.5342579", "0.5333323", "0.531819", "0.5317198", "0.531694", "0.5315867", "0.5252057", "0.5209373", "0.5184296", "0.51761675", "0.5142933", "0.50949264", "0.50891984",...
0.7620937
0
Funcs allows adding template function maps to TRoots; this should be done before creating any templates, or else previously created templates won't get the newest function maps
func (t *TRoot) Funcs(fnList FuncMap) *TRoot { t.template.Funcs(template.FuncMap(fnList)) return t }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Tmpl) Funcs(funcMap template.FuncMap) {\n\tt.Template = t.Template.Funcs(funcMap)\n\tt.funcs = funcMap\n}", "func (app *App) TemplateFuncs(funcs ...template.FuncMap) *App {\n\tapp.templateFuncs = append(app.templateFuncs, funcs...)\n\treturn app\n}", "func (templateManager *TemplateManager) Funcs(func...
[ "0.717656", "0.7118898", "0.7076246", "0.6852086", "0.6742249", "0.66769844", "0.66769844", "0.66100323", "0.6607756", "0.65820014", "0.65328634", "0.6508341", "0.6488062", "0.64860225", "0.6327243", "0.6289445", "0.62823504", "0.6241177", "0.6225048", "0.61612254", "0.614882...
0.72019356
0
Clone creates a copy of the TRoot for ease of creating sublayouts. Since TRoots cannot be executed externally, we don't have the possibility of returning an error.
func (t *TRoot) Clone() *TRoot { var clone, _ = t.template.Clone() return &TRoot{clone, t.Path} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Template) Clone() (*Template, error) {\n\tvar tmpl, err = t.Template.Clone()\n\treturn &Template{tmpl, t.Name}, err\n}", "func (w *WebGLRenderTarget) Clone() *WebGLRenderTarget {\n\tw.p.Call(\"clone\")\n\treturn w\n}", "func (b *Buildtemplate) Clone(source buildv1alpha1.BuildTemplate, clientset *clien...
[ "0.63205683", "0.59134096", "0.5870232", "0.57930756", "0.57629037", "0.57532215", "0.5749004", "0.5738241", "0.57212216", "0.56898284", "0.5618096", "0.56123704", "0.5608078", "0.5585105", "0.5582553", "0.55766046", "0.5572645", "0.5569114", "0.5555808", "0.5512746", "0.5509...
0.7969468
0
Name exposes the underlying template's name
func (t *TRoot) Name() string { return t.template.Name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Template) Name() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"name\"])\n}", "func (p *PrecompiledTemplate) Name() TemplateName {\n\treturn p.name\n}", "func (o InstanceFromTemplateOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *InstanceFromTemplate) pulumi.StringOu...
[ "0.8049311", "0.78898543", "0.7841373", "0.77282107", "0.76256514", "0.75608164", "0.7434186", "0.7302377", "0.7288843", "0.7264269", "0.7216552", "0.7194174", "0.7158706", "0.7111411", "0.70910674", "0.7001287", "0.6999061", "0.693831", "0.6922039", "0.6914896", "0.68486345"...
0.78722036
2
ReadPartials parses the given files into the TRoot instance for gathering things like the toplevel layout, navigation elements, etc. The list of files is relative to the TRoot's Path. Returns on the first error encountered, if any.
func (t *TRoot) ReadPartials(files ...string) error { for _, file := range files { var _, err = t.template.ParseFiles(filepath.Join(t.Path, file)) if err != nil { return err } } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *TRoot) MustReadPartials(files ...string) {\n\tvar err = t.ReadPartials(files...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "func PartialLatexFiles(path string) {\n\t//read all files in directory sections\n\t// this must be settleable and discoverable\n\tvar counter int\n\n\ttype Content struct {\n\t\...
[ "0.7431444", "0.6224712", "0.59201527", "0.5268718", "0.5262331", "0.49429238", "0.48908126", "0.4883328", "0.48543856", "0.48400208", "0.48294452", "0.4807043", "0.47279018", "0.4716206", "0.46896315", "0.46685848", "0.4665916", "0.46120083", "0.459389", "0.45938268", "0.458...
0.86572236
0
MustReadPartials calls ReadPartials and panics on any error
func (t *TRoot) MustReadPartials(files ...string) { var err = t.ReadPartials(files...) if err != nil { panic(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *TRoot) ReadPartials(files ...string) error {\n\tfor _, file := range files {\n\t\tvar _, err = t.template.ParseFiles(filepath.Join(t.Path, file))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "func TestExtractPartialRead(t *testing.T) {\n\trc := mutate.Extract(invalidImage{})\n...
[ "0.60439926", "0.5645817", "0.54828453", "0.5442675", "0.5392826", "0.52395606", "0.52249944", "0.51955503", "0.5156704", "0.51566005", "0.5084639", "0.50834095", "0.5021623", "0.49996892", "0.49993837", "0.499132", "0.49418923", "0.48929805", "0.4889833", "0.48810267", "0.48...
0.7883434
0
Build clones the root (for layout, funcs, etc) and parses the given file in the clone. The returned template is the clone, and is safe to alter without worrying about breaking the root.
func (t *TRoot) Build(path string) (*Template, error) { var tNew, err = t.template.Clone() if err != nil { return nil, err } _, err = tNew.ParseFiles(filepath.Join(t.Path, path)) if err != nil { return nil, err } tNew.Name = path return tNew, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New(root, tmplName string) (Template, error) {\n\tvar dirs, files []string\n\tfilename := os.Getenv(\"GOPS_SCHEMA\") + tmplName + ext\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\tfmt.Println(\"Error opening file: \", err)\n\t\treturn Template{}, err\n\t}\n\tdefer file.Close()\n\n\t// Use bufio sc...
[ "0.6252311", "0.6109549", "0.5878709", "0.58077186", "0.5679899", "0.55972457", "0.5566577", "0.556319", "0.54841673", "0.54235893", "0.5379092", "0.5354807", "0.5316413", "0.5301843", "0.5290332", "0.5237256", "0.5234725", "0.52325094", "0.52297646", "0.5206937", "0.51865554...
0.687938
0
MustBuild calls Build and panics on any error
func (t *TRoot) MustBuild(path string) *Template { var tmpl, err = t.Build(path) if err != nil { panic(err) } return tmpl }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (runner Runner) RequiresBuild() bool {\n\treturn true\n}", "func (creator Creator) RequiresBuild() bool {\n\treturn false\n}", "func (builder *Builder) MustBuild() string {\n\tpolicy, err := builder.Build()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn policy\n}", "func (config *Config) MustBuild(...
[ "0.68233085", "0.6773994", "0.67645735", "0.671814", "0.65536076", "0.6549914", "0.6476688", "0.6311656", "0.6178096", "0.6117787", "0.6066569", "0.6049223", "0.6049223", "0.59941703", "0.59761995", "0.58996737", "0.5893004", "0.58696187", "0.5847744", "0.5803839", "0.5795752...
0.69064736
0
Template returns an empty template associated with this TRoot so we can use it for errors without fake "empty" templates
func (t *TRoot) Template() *Template { return t.Clone().template }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *MockedHTTPContext) Template() texttemplate.TemplateEngine {\n\tif c.MockedTemplate != nil {\n\t\treturn c.MockedTemplate()\n\t}\n\treturn nil\n}", "func Pure(any interface{}) Template {\n\tswitch a := any.(type) {\n\tcase string:\n\t\treturn Template{Template: template.Must(template.New(a).Parse(a))}\n\...
[ "0.62930477", "0.62836576", "0.6280606", "0.62045574", "0.6099084", "0.60814947", "0.60670257", "0.6026002", "0.6019132", "0.6002485", "0.59810877", "0.592314", "0.58343685", "0.5813961", "0.5787349", "0.5775547", "0.5774304", "0.5740142", "0.5739278", "0.57327855", "0.571042...
0.6982925
0
Get looks up a key's value from the cache.
func (c *TimeoutCache) Get(key interface{}) (value interface{}, ok bool) { c.lock.RLock() defer c.lock.RUnlock() if ent, ok := c.items[key]; ok { return ent, true } return nil, false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *cache) Get(key string) interface{} {\n\tif v := c.get(key); v != nil {\n\t\treturn v.Value\n\t}\n\treturn nil\n}", "func (c *Cache) Get(key string) interface{} {\n\te := c.entries[key]\n\tif e == nil {\n\t\treturn nil\n\t}\n\tc.promote(e)\n\treturn e.value\n}", "func (c *Cache) Get(key string) (interf...
[ "0.8441358", "0.83717173", "0.8355178", "0.8329172", "0.8251349", "0.8164837", "0.8127279", "0.8114952", "0.8068603", "0.8034928", "0.79851127", "0.7973055", "0.79678005", "0.7966013", "0.7958546", "0.7933897", "0.7925363", "0.7923581", "0.79136306", "0.7911231", "0.7904514",...
0.7415961
94