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
TaskConfigSchema returns the schema for the driver configuration of the task.
func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error) { return taskConfigSpec, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d *Driver) ConfigSchema() (*hclspec.Spec, error) {\n\treturn configSpec, nil\n}", "func GetUserConfigSchema(t string) map[string]interface{} {\n\tif _, ok := getUserConfigurationOptionsSchemaFilenames()[t]; !ok {\n\t\tlog.Panicf(\"user configuration options schema type `%s` is not available\", t)\n\t}\n\n\...
[ "0.6586699", "0.58137196", "0.56230664", "0.53895205", "0.5364081", "0.53349406", "0.52917063", "0.52878046", "0.51269746", "0.50748026", "0.505897", "0.5052785", "0.5022496", "0.49787623", "0.49776208", "0.49759728", "0.4963513", "0.48683783", "0.4866191", "0.48051867", "0.4...
0.85169226
0
Capabilities define what features the driver implements.
func (d *Driver) Capabilities() (*drivers.Capabilities, error) { return capabilities, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCapabilities(features ...string) Capabilities {\n\tc := Capabilities{}\n\tfor _, feature := range features {\n\t\tc.With(feature)\n\t}\n\treturn c\n}", "func (srv *Server) Capabilities(context.Context, *gnmipb.CapabilityRequest) (*gnmipb.CapabilityResponse, error) {\n\treturn nil, grpc.Errorf(codes.Unimp...
[ "0.7242673", "0.6908501", "0.68707454", "0.67757386", "0.6752177", "0.6611623", "0.6568753", "0.6544832", "0.6525126", "0.6461981", "0.64540225", "0.64472747", "0.64395314", "0.63170815", "0.62939256", "0.62640125", "0.6262464", "0.6258976", "0.62495536", "0.6239869", "0.6208...
0.6607212
6
Fingerprint is called by the client when the plugin is started. It allows the driver to indicate its health to the client. The channel returned should immediately send an initial Fingerprint, then send periodic updates at an interval that is appropriate for the driver until the context is canceled.
func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error) { err := shelpers.Init() if err != nil { d.logger.Error("Could not init stats helper", "err", err) return nil, err } ch := make(chan *drivers.Fingerprint) go d.handleFingerprint(ctx, ch) return ch, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (i *instanceManager) fingerprint() {\n\tfpChan, cancel, err := i.dispenseFingerprintCh()\n\tif err != nil {\n\t\ti.logger.Error(\"failed to dispense driver plugin\", \"error\", err)\n\t}\n\n\t// backoff and retry used if the RPC is closed by the other end\n\tvar backoff time.Duration\n\tvar retry int\n\tfor {...
[ "0.67849284", "0.5897063", "0.5688403", "0.5526209", "0.54947096", "0.54665834", "0.53494525", "0.51623464", "0.5127396", "0.5124749", "0.5117888", "0.49343532", "0.48946166", "0.4862256", "0.47582838", "0.4736561", "0.4724519", "0.47087526", "0.466834", "0.46634454", "0.4586...
0.6965612
0
RecoverTask detects running tasks when nomad client or task driver is restarted. When a driver is restarted it is not expected to persist any internal state to disk. To support this, Nomad will attempt to recover a task that was previously started if the driver does not recognize the task ID. During task recovery, Noma...
func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error { if handle == nil { return fmt.Errorf("error: handle cannot be nil") } if _, ok := d.tasks.Get(handle.Config.ID); ok { return nil } var taskState TaskState if err := handle.GetDriverState(&taskState); err != nil { return fmt.Errorf("failed to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestLibvirtDriver_Start_Stop_Recover_Task(t *testing.T) {\n\tutil.RequireLibvirt(t)\n\n\trequire := require.New(t)\n\n\td := NewLibvirtDriver(testlog.HCLogger(t)).(*Driver)\n\tharness := dtestutil.NewDriverHarness(t, d)\n\n\trequire.NoError(task.EncodeConcreteDriverConfig(&taskCfg))\n\n\tcleanup := harness.Mk...
[ "0.58838654", "0.5342246", "0.4967397", "0.49165246", "0.48566574", "0.48527366", "0.48488343", "0.4843941", "0.48418212", "0.4827211", "0.481903", "0.47926974", "0.47663003", "0.47648853", "0.47385824", "0.47373864", "0.47090328", "0.47073582", "0.4702934", "0.46741527", "0....
0.7950789
0
BuildContainerName returns the podman container name for a given TaskConfig
func BuildContainerName(cfg *drivers.TaskConfig) string { return fmt.Sprintf("%s-%s", cfg.Name, cfg.AllocID) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *dockerExec) containerName() string {\n\tpathHex := reflow.Digester.FromString(e.path()).Short()\n\treturn fmt.Sprintf(\"reflow-%s-%s-%s\", e.Executor.ID, e.id.Hex(), pathHex)\n}", "func (o ClusterBuildStrategySpecBuildStepsEnvValueFromResourceFieldRefOutput) ContainerName() pulumi.StringPtrOutput {\n\tr...
[ "0.6439012", "0.62852246", "0.622028", "0.6200449", "0.6197181", "0.61668086", "0.61047316", "0.6056285", "0.60304743", "0.5793392", "0.5791889", "0.57634854", "0.57511026", "0.5727425", "0.5724323", "0.56959724", "0.56770957", "0.56690484", "0.56192434", "0.5603206", "0.5591...
0.7562802
0
StartTask creates and starts a new Container based on the given TaskConfig.
func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error) { if _, ok := d.tasks.Get(cfg.ID); ok { return nil, nil, fmt.Errorf("task with ID %q already started", cfg.ID) } var driverConfig TaskConfig if err := cfg.DecodeDriverConfig(&driverConfig); err != nil { ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *ECS) StartTask(req *StartTaskReq) (*StartTaskResp, error) {\n\tif req == nil {\n\t\treturn nil, fmt.Errorf(\"The req params cannot be nil\")\n\t}\n\n\tparams := makeParams(\"StartTask\")\n\tif req.Cluster != \"\" {\n\t\tparams[\"cluster\"] = req.Cluster\n\t}\n\tif req.TaskDefinition != \"\" {\n\t\tparams[...
[ "0.65428984", "0.63425386", "0.618552", "0.6107186", "0.6064747", "0.6054203", "0.604236", "0.6014893", "0.59061396", "0.5791596", "0.5766864", "0.5757924", "0.5691278", "0.56747615", "0.56268", "0.55775166", "0.5566711", "0.55478686", "0.55056304", "0.54779893", "0.54329526"...
0.6873531
0
WaitTask function is expected to return a channel that will send an ExitResult when the task exits or close the channel when the context is canceled. It is also expected that calling WaitTask on an exited task will immediately send an ExitResult on the returned channel. A call to WaitTask after StopTask is valid and sh...
func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error) { d.logger.Debug("WaitTask called", "task", taskID) handle, ok := d.tasks.Get(taskID) if !ok { return nil, drivers.ErrTaskNotFound } ch := make(chan *drivers.ExitResult) go handle.runExitWatcher(ctx, ch) return ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Task) Wait(timeout time.Duration) (TaskResult, error) {\n\tselect {\n\tcase <-t.startedChan:\n\tdefault:\n\t\treturn nil, ErrNotExecuting\n\t}\n\n\tt.resultLock.RLock()\n\tif t.waitResult != nil {\n\t\tt.resultLock.RUnlock()\n\t\treturn t.waitResult, nil\n\t}\n\tt.resultLock.RUnlock()\n\n\tvar timeoutChan...
[ "0.68873113", "0.6370824", "0.6234808", "0.6090943", "0.60882926", "0.60077477", "0.59856975", "0.5946728", "0.57896346", "0.5758922", "0.5743035", "0.57364565", "0.5708013", "0.56723464", "0.5585439", "0.5556589", "0.54844946", "0.54625577", "0.5353345", "0.5346748", "0.5334...
0.76350826
0
StopTask function is expected to stop a running task by sending the given signal to it. If the task does not stop during the given timeout, the driver must forcefully kill the task. StopTask does not clean up resources of the task or remove it from the driver's internal state.
func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error { d.logger.Info("Stopping task", "taskID", taskID, "signal", signal) handle, ok := d.tasks.Get(taskID) if !ok { return drivers.ErrTaskNotFound } // fixme send proper signal to container err := d.podman.ContainerStop(d.ctx, hand...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Task) StopWithTimeout(timeout time.Duration) error {\n\tdefer func() { recover() }()\n\tclose(*t.Stopper)\n\n\tselect {\n\tcase <-*t.Done:\n\t\treturn nil\n\tcase <-time.After(timeout):\n\t\treturn goerr.Wrap(&ErrStoppingTaskTimeout{})\n\t}\n}", "func (h *Hub) StopTask(ctx context.Context, request *pb.S...
[ "0.6536051", "0.61022145", "0.5902817", "0.57699805", "0.5755604", "0.5728442", "0.56008637", "0.549826", "0.5445834", "0.5424107", "0.5390439", "0.53785425", "0.53028846", "0.5296322", "0.52536076", "0.5202666", "0.5167302", "0.50993377", "0.507832", "0.50076854", "0.4984623...
0.7427215
0
DestroyTask function cleans up and removes a task that has terminated. If force is set to true, the driver must destroy the task even if it is still running.
func (d *Driver) DestroyTask(taskID string, force bool) error { handle, ok := d.tasks.Get(taskID) if !ok { return drivers.ErrTaskNotFound } if handle.isRunning() && !force { return fmt.Errorf("cannot destroy running task") } if handle.isRunning() { d.logger.Debug("Have to destroyTask but container is stil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CleanTask() {\n\tfor taskID, t := range kv.DefaultClient.GetStorage().Tasks {\n\t\tflag := true\n\t\tfor nid := range kv.DefaultClient.GetStorage().Nodes {\n\t\t\tif t.NodeID == nid {\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tif t.Timer {\n\t\t\t\tlog.Info(\"clean timer:\", taskID)\n\t\t\t\t...
[ "0.60128415", "0.59829104", "0.59223276", "0.5853163", "0.5822631", "0.5637229", "0.55053747", "0.5499162", "0.54739857", "0.54706156", "0.5426137", "0.54249454", "0.5411983", "0.5394763", "0.53803176", "0.5303343", "0.529844", "0.52842695", "0.52794904", "0.526981", "0.52620...
0.7716327
0
InspectTask function returns detailed status information for the referenced taskID.
func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error) { d.logger.Debug("InspectTask called") handle, ok := d.tasks.Get(taskID) if !ok { return nil, drivers.ErrTaskNotFound } return handle.taskStatus(), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Client) InspectTask(id string) (*swarm.Task, error) {\n\tresp, err := c.do(http.MethodGet, \"/tasks/\"+id, doOptions{})\n\tif err != nil {\n\t\tvar e *Error\n\t\tif errors.As(err, &e) && e.Status == http.StatusNotFound {\n\t\t\treturn nil, &NoSuchTask{ID: id}\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp...
[ "0.6450777", "0.612711", "0.6043263", "0.60372734", "0.5894179", "0.5767152", "0.5736859", "0.57292414", "0.5600359", "0.55213696", "0.5463764", "0.5417522", "0.5382704", "0.535509", "0.5335711", "0.53252643", "0.5318367", "0.52696025", "0.5261585", "0.5251186", "0.5250223", ...
0.7474207
0
TaskStats function returns a channel which the driver should send stats to at the given interval. The driver must send stats at the given interval until the given context is canceled or the task terminates.
func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error) { d.logger.Debug("TaskStats called", "taskID", taskID) handle, ok := d.tasks.Get(taskID) if !ok { return nil, drivers.ErrTaskNotFound } statsChannel := make(chan *drivers.TaskResource...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ChannelStats(namespace string) StatsCollector {\n\tlabels := []string{\"topic\", \"channel\", \"paused\"}\n\tnamespace += \"_channel\"\n\n\treturn channelStats{\n\t\t{\n\t\t\tval: func(c *channel) float64 { return float64(len(c.Clients)) },\n\t\t\tvec: prometheus.NewGaugeVec(prometheus.GaugeOpts{\n\t\t\t\tNam...
[ "0.5239738", "0.51784253", "0.49386886", "0.48893714", "0.4876019", "0.48401034", "0.475298", "0.47351772", "0.46660122", "0.4591185", "0.45741856", "0.4563549", "0.4537039", "0.45309833", "0.44815376", "0.44753942", "0.44719172", "0.44595218", "0.44447067", "0.44192713", "0....
0.67854583
0
TaskEvents function allows the driver to publish driver specific events about tasks and the Nomad client publishes events associated with an allocation.
func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error) { return d.eventer.TaskEvents(ctx) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *RabbitMQConnection) PublishEventsTrackingTask(payload []byte) error {\n\tch, err := c.Channel()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer ch.Close()\n\n\terr = ch.Publish(\n\t\t\"tracking\", //Exchange\n\t\t\"tracking-queue\", //Routing key\n\t\tfalse, //Mandatory\n\t\tfalse, ...
[ "0.62560856", "0.6115658", "0.60783863", "0.60229474", "0.5975949", "0.5699085", "0.54833305", "0.53989345", "0.5368666", "0.53186864", "0.5253385", "0.5113489", "0.5108155", "0.509764", "0.50957435", "0.508231", "0.50769174", "0.50740504", "0.5070625", "0.50645995", "0.50423...
0.6764465
0
SignalTask function is used by drivers which support sending OS signals (SIGHUP, SIGKILL, SIGUSR1 etc.) to the task. It is an optional function and is listed as a capability in the driver Capabilities struct.
func (d *Driver) SignalTask(taskID string, signal string) error { handle, ok := d.tasks.Get(taskID) if !ok { return drivers.ErrTaskNotFound } return d.podman.ContainerKill(d.ctx, handle.containerID, signal) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ProcessSignal(p *os.Process, sig os.Signal,) error", "func signal_disable(uint32) {}", "func signal(s os.Signal) {\n\tp, _ := os.FindProcess(os.Getpid())\n\t_ = p.Signal(s)\n\t// Sleep so test won't finish and signal will be received.\n\ttime.Sleep(999)\n}", "func signal_disable(s uint32) {\n}", "func...
[ "0.61870855", "0.5511749", "0.5325872", "0.5245061", "0.52382535", "0.5158235", "0.5155546", "0.5136468", "0.5113385", "0.5107931", "0.50993425", "0.508363", "0.50823617", "0.5018183", "0.5008709", "0.49947438", "0.49496862", "0.49458396", "0.49453184", "0.49269986", "0.49240...
0.7002219
0
ExecTask function is used by the Nomad client to execute commands inside the task execution context.
func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error) { return nil, fmt.Errorf("Podman driver does not support exec") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ts *TaskService) Exec(ctx context.Context, req *taskAPI.ExecProcessRequest) (*types.Empty, error) {\n\tdefer logPanicAndDie(log.G(ctx))\n\n\tlog.G(ctx).WithFields(logrus.Fields{\"id\": req.ID, \"exec_id\": req.ExecID}).Debug(\"exec\")\n\ttask, err := ts.taskManager.Task(req.ID)\n\tif err != nil {\n\t\treturn...
[ "0.7491893", "0.74503505", "0.71984", "0.7141873", "0.70722926", "0.6939766", "0.6800779", "0.6633108", "0.65625066", "0.6557004", "0.652908", "0.6454363", "0.6441503", "0.6435012", "0.6338124", "0.6324664", "0.6318782", "0.6309154", "0.6298092", "0.6294548", "0.62881535", ...
0.78052336
0
expandPath returns the absolute path of dir, relative to base if dir is relative path. base is expected to be an absolute path
func expandPath(base, dir string) string { if filepath.IsAbs(dir) { return filepath.Clean(dir) } return filepath.Clean(filepath.Join(base, dir)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func expandFilePath(filePath string, baseDir string) string {\n\tif !strings.HasPrefix(filePath, \"/\") {\n\t\tfilePath = path.Join(baseDir, filePath)\n\t}\n\treturn filePath\n}", "func expandPath(path string) (string, error) {\n\tif len(path) == 0 {\n\t\treturn \"\", nil\n\t}\n\tif path[0] == '~' && (len(path) ...
[ "0.7221674", "0.63791376", "0.62171954", "0.6203149", "0.60714793", "0.6038171", "0.60058975", "0.5962914", "0.58609414", "0.5853772", "0.5846553", "0.58370256", "0.58066094", "0.5787698", "0.5785019", "0.57407224", "0.57359976", "0.5726426", "0.567552", "0.5660976", "0.56590...
0.79213846
0
isParentPath returns true if path is a child or a descendant of parent path. Both inputs need to be absolute paths.
func isParentPath(parent, path string) bool { rel, err := filepath.Rel(parent, path) return err == nil && !strings.HasPrefix(rel, "..") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func pathIsChild(parent, child string) bool {\n\tif !strings.HasPrefix(child, parent) {\n\t\treturn false\n\t}\n\trel := child[len(parent):]\n\trel = strings.Trim(rel, \"/\")\n\treturn !strings.Contains(rel, \"/\")\n}", "func (d *Driver) isParent(id, parent string) bool {\n\t// TODO (maybe): this function is cal...
[ "0.6913496", "0.6632338", "0.6614952", "0.6239509", "0.6065598", "0.6004529", "0.599899", "0.5987033", "0.5987033", "0.57555145", "0.5745408", "0.5715766", "0.56958073", "0.5602596", "0.5588836", "0.5535407", "0.5507737", "0.5400315", "0.5310334", "0.5297292", "0.52722096", ...
0.78000367
0
GetOcJusticeTerminalCase invokes the dt_oc_info.GetOcJusticeTerminalCase API synchronously
func (client *Client) GetOcJusticeTerminalCase(request *GetOcJusticeTerminalCaseRequest) (response *GetOcJusticeTerminalCaseResponse, err error) { response = CreateGetOcJusticeTerminalCaseResponse() err = client.DoAction(request, response) return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetOcJusticeTerminalCaseWithCallback(request *GetOcJusticeTerminalCaseRequest, callback func(response *GetOcJusticeTerminalCaseResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetOcJusticeTerminalCaseResponse\n\t\tvar ...
[ "0.76105475", "0.7207098", "0.63172954", "0.6272593", "0.42553726", "0.41234902", "0.40939113", "0.4023941", "0.39742783", "0.38595548", "0.38287857", "0.378181", "0.37741143", "0.37575984", "0.37342227", "0.37036774", "0.36915794", "0.3683943", "0.3679489", "0.36713696", "0....
0.8129121
0
GetOcJusticeTerminalCaseWithChan invokes the dt_oc_info.GetOcJusticeTerminalCase API asynchronously
func (client *Client) GetOcJusticeTerminalCaseWithChan(request *GetOcJusticeTerminalCaseRequest) (<-chan *GetOcJusticeTerminalCaseResponse, <-chan error) { responseChan := make(chan *GetOcJusticeTerminalCaseResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetOcJusticeTerminalCaseWithCallback(request *GetOcJusticeTerminalCaseRequest, callback func(response *GetOcJusticeTerminalCaseResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetOcJusticeTerminalCaseResponse\n\t\tvar ...
[ "0.79232085", "0.64444685", "0.5182867", "0.50883555", "0.478109", "0.45607275", "0.45374334", "0.45302606", "0.4415868", "0.43623936", "0.4354781", "0.42620373", "0.41785672", "0.40921018", "0.40574202", "0.40431407", "0.40057978", "0.4002611", "0.40005198", "0.39568612", "0...
0.8225025
0
GetOcJusticeTerminalCaseWithCallback invokes the dt_oc_info.GetOcJusticeTerminalCase API asynchronously
func (client *Client) GetOcJusticeTerminalCaseWithCallback(request *GetOcJusticeTerminalCaseRequest, callback func(response *GetOcJusticeTerminalCaseResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetOcJusticeTerminalCaseResponse var err error def...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetOcJusticeTerminalCase(request *GetOcJusticeTerminalCaseRequest) (response *GetOcJusticeTerminalCaseResponse, err error) {\n\tresponse = CreateGetOcJusticeTerminalCaseResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "func (client *Client) GetOcJusticeTerminalCaseWithC...
[ "0.66025335", "0.66022605", "0.5441328", "0.5314528", "0.4794885", "0.47772574", "0.44892713", "0.4443668", "0.43273535", "0.42628276", "0.4138406", "0.41172293", "0.41120696", "0.4096734", "0.40186015", "0.3951663", "0.39511362", "0.3897255", "0.38712794", "0.38415867", "0.3...
0.8397443
0
CreateGetOcJusticeTerminalCaseRequest creates a request to invoke GetOcJusticeTerminalCase API
func CreateGetOcJusticeTerminalCaseRequest() (request *GetOcJusticeTerminalCaseRequest) { request = &GetOcJusticeTerminalCaseRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("dt-oc-info", "2022-08-29", "GetOcJusticeTerminalCase", "", "") request.Method = requests.POST return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetOcJusticeTerminalCase(request *GetOcJusticeTerminalCaseRequest) (response *GetOcJusticeTerminalCaseResponse, err error) {\n\tresponse = CreateGetOcJusticeTerminalCaseResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "func CreateGetOcJusticeTerminalCaseResponse() (resp...
[ "0.7281973", "0.718111", "0.60141575", "0.59981817", "0.53045654", "0.529162", "0.5089326", "0.50162315", "0.48275313", "0.46769378", "0.46516144", "0.45637316", "0.44809666", "0.44730073", "0.44580668", "0.44391593", "0.43980765", "0.4389381", "0.43701097", "0.43534452", "0....
0.8775902
0
CreateGetOcJusticeTerminalCaseResponse creates a response to parse from GetOcJusticeTerminalCase response
func CreateGetOcJusticeTerminalCaseResponse() (response *GetOcJusticeTerminalCaseResponse) { response = &GetOcJusticeTerminalCaseResponse{ BaseResponse: &responses.BaseResponse{}, } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateGetOcJusticeTerminalCaseRequest() (request *GetOcJusticeTerminalCaseRequest) {\n\trequest = &GetOcJusticeTerminalCaseRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"dt-oc-info\", \"2022-08-29\", \"GetOcJusticeTerminalCase\", \"\", \"\")\n\trequest.Method = requests.PO...
[ "0.77589756", "0.7157844", "0.61063325", "0.6026642", "0.59860957", "0.59467834", "0.56416875", "0.5634511", "0.556447", "0.5405703", "0.52253896", "0.5192126", "0.51881194", "0.51555777", "0.50910974", "0.50739145", "0.5035087", "0.5018713", "0.5008554", "0.499794", "0.49734...
0.899438
0
GetQueryCmd adds the query commands
func GetQueryCmd(cdc *codec.Codec) *cobra.Command { profileQueryCmd := &cobra.Command{ Use: types.ModuleName, Short: "Querying commands for the profiles module", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, RunE: client.Val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command {\n\t// return cli.GetQueryCmd(cdc)\n\tpanic(\"need to add cli.GetQueryCmd(cdc)\")\n}", "func (AppModuleBasic) GetQueryCmd(cdc *amino.Codec) *cobra.Command {\n\treturn client.GetQueryCmd(cdc)\n}", "func (amb AppModuleBasic) GetQueryCmd(cdc *cod...
[ "0.7866081", "0.78498286", "0.7787561", "0.77516055", "0.7711904", "0.7710565", "0.7693822", "0.76449287", "0.76294416", "0.76294416", "0.758036", "0.7576063", "0.75644815", "0.7563028", "0.7548859", "0.75329256", "0.75329256", "0.75210536", "0.75081134", "0.7501117", "0.7489...
0.7079285
43
GetCmdQueryProfile queries a profile from the given address or dtag
func GetCmdQueryProfile(cdc *codec.Codec) *cobra.Command { return &cobra.Command{ Use: "profile [address_or_dtag]", Short: "Retrieve the profile having the specified user address or profile dtag, if any.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { cliCtx := context.N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func queryProfile(ctx sdk.Context, path []string, _ abci.RequestQuery, keeper Keeper) ([]byte, error) {\n\tif len(strings.TrimSpace(path[0])) == 0 {\n\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, \"DTag or address cannot be empty or blank\")\n\t}\n\n\taddress, err := sdk.AccAddressFromBech32(path[0])...
[ "0.73663527", "0.66192484", "0.66032195", "0.6373226", "0.62577033", "0.5889509", "0.5735262", "0.5682528", "0.56526613", "0.54866666", "0.5468216", "0.54676366", "0.5464707", "0.5439784", "0.5404302", "0.5396977", "0.53676295", "0.53150916", "0.53021604", "0.5297001", "0.525...
0.8442145
0
GetCmdQueryProfiles queries all the profiles
func GetCmdQueryProfiles(cdc *codec.Codec) *cobra.Command { return &cobra.Command{ Use: "all", Short: "Retrieve all the registered profiles.", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { cliCtx := context.NewCLIContext().WithCodec(cdc) route := fmt.Sprintf("custom/%s/%s"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *SmartContract) QueryAllProfiles(ctx contractapi.TransactionContextInterface) ([]QueryProfileResult, error) {\n\tstartKey := \"\"\n\tendKey := \"\"\n\n\tresultsIterator, err := ctx.GetStub().GetStateByRange(startKey, endKey)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resultsIterator.Close()\n\...
[ "0.7198962", "0.6869934", "0.6789719", "0.67125577", "0.6603376", "0.65903366", "0.6403358", "0.61283404", "0.5979468", "0.59100527", "0.58843744", "0.5871112", "0.58510584", "0.5812088", "0.57750744", "0.5740033", "0.57312274", "0.57131714", "0.57038635", "0.5665462", "0.565...
0.8219907
0
GetCmdQueryProfileParams queries all the profiles' module params
func GetCmdQueryProfileParams(cdc *codec.Codec) *cobra.Command { return &cobra.Command{ Use: "parameters", Short: "Retrieve all the profile module parameters", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { cliCtx := context.NewCLIContext().WithCodec(cdc) route := fmt.Sprin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func queryProfileParams(ctx sdk.Context, _ abci.RequestQuery, keeper Keeper) ([]byte, error) {\n\tprofileParams := keeper.GetParams(ctx)\n\n\tbz, err := codec.MarshalJSONIndent(keeper.Cdc, &profileParams)\n\tif err != nil {\n\t\tpanic(\"could not marshal result to JSON\")\n\t}\n\n\treturn bz, nil\n}", "func GetC...
[ "0.67599773", "0.6400527", "0.5847315", "0.5535475", "0.55341256", "0.55146354", "0.55065244", "0.5402974", "0.5288138", "0.5251579", "0.520587", "0.51665294", "0.5144454", "0.5124429", "0.5092634", "0.5016223", "0.49747425", "0.4949739", "0.49178165", "0.48966557", "0.487474...
0.7892636
0
Setup sets up all endpoints and middleware for the server
func Setup() *celerity.Server { db, _ := gorm.Open("sqlite3", "./data.sqlite3") db.LogMode(true) db.AutoMigrate( models.User{}, models.Room{}, models.Message{}, models.Session{}, ) var lobbyCount int db.Model(&models.Room{}).Where("slug = ?", "lobby").Count(&lobbyCount) if lobbyCount == 0 { db.Creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Setup() {\n\trouter = httprouter.New()\n\n\trouter.GET(\"/\", index)\n\trouter.GET(\"/status\", status)\n\n\tevtHandler := event.NewHandler()\n\trouter.POST(\"/events\", evtHandler.Create)\n\trouter.GET(\"/events\", evtHandler.Index)\n\trouter.GET(\"/events/:id\", evtHandler.Show)\n\n\tsubHandler := subscript...
[ "0.76839864", "0.74411607", "0.7420936", "0.74127454", "0.73549485", "0.72737867", "0.7140154", "0.70420814", "0.7023133", "0.70221287", "0.7019182", "0.6920558", "0.69160783", "0.6907643", "0.68852675", "0.68766725", "0.686933", "0.68692505", "0.6868554", "0.6865591", "0.686...
0.0
-1
104 / 5 =====> 20 4
func bölme(bölünen, bölen int) (bölüm, kalan int) { bölüm = bölünen / bölen kalan = bölünen % bölen return bölüm, kalan }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func P12() int64 {\n\tvar i, value int64 = 1, 0;\n\tfor {\n\t\tn := i * (i+1) / 2;\n\t\tcount := CountDivisors(n);\n\t\tif(count > 500) {\n\t\t\tvalue = n;\n\t\t\tbreak;\n\t\t}\n\t\ti++;\n\t}\n return value;\n}", "func divide(S, D uint32) uint32 {\n\treturn 65535 * S / D\n}", "func split(sum int) (x,y int) ...
[ "0.5891377", "0.57369494", "0.5670985", "0.56679827", "0.5648372", "0.55592567", "0.5535071", "0.5503972", "0.5502064", "0.5498154", "0.5479929", "0.54766035", "0.54746884", "0.5465032", "0.5463755", "0.5463755", "0.5463755", "0.5463755", "0.5463755", "0.5463755", "0.5463755"...
0.0
-1
stringView returns a view of the []byte as a string. In unsafe mode, it doesn't incur allocation and copying caused by conversion. In regular safe mode, it is an allocation and copy. Usage: Always maintain a reference to v while result of this call is in use, and call keepAlive4BytesView(v) at point where done with vie...
func stringView(v []byte) string { return string(v) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func bytesView(v string) []byte {\n\treturn []byte(v)\n}", "func (v ByteVec) String() string { return string([]byte(v)) }", "func (v *View) String() string {\n\tf := format.NewASCII()\n\treturn v.FormatString(f)\n}", "func (s View) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (s View) Strin...
[ "0.63379955", "0.5909125", "0.58037746", "0.56420934", "0.56420934", "0.54916877", "0.54738015", "0.5430865", "0.5414218", "0.5414218", "0.53638655", "0.5337022", "0.53342456", "0.53323567", "0.52999586", "0.52574825", "0.52541006", "0.52512985", "0.5248777", "0.5213757", "0....
0.7783467
0
bytesView returns a view of the string as a []byte. In unsafe mode, it doesn't incur allocation and copying caused by conversion. In regular safe mode, it is an allocation and copy. Usage: Always maintain a reference to v while result of this call is in use, and call keepAlive4BytesView(v) at point where done with view...
func bytesView(v string) []byte { return []byte(v) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func stringView(v []byte) string {\n\treturn string(v)\n}", "func NewView(b []byte) *View { return &View{b} }", "func GetBytesBuffer4K() *bytes.Buffer {\n\tif b := getb4K(); b != nil {\n\t\treturn b\n\t}\n\tif p := get4K(); p != nil {\n\t\treturn bytes.NewBuffer(internal.Puts(p))\n\t}\n\treturn bytes.NewBuffer...
[ "0.6358887", "0.5210643", "0.47978938", "0.47844735", "0.47593164", "0.46141908", "0.4609627", "0.46013665", "0.45809", "0.4562257", "0.45536464", "0.4526796", "0.45103198", "0.45092463", "0.4495565", "0.4488356", "0.4468821", "0.4467235", "0.4460009", "0.44589624", "0.443517...
0.75592566
0
NewNode creates a new node base around this configuration
func NewNode(config *Configuration) *Node { node := new(Node) node.config = config node.partitions = make(map[string][]partition) node.strategyMap = make(map[string]RoutingStrategy) // create a http listener, do it this way to get the running port addrStr := fmt.Sprintf(":%d", config.NodePort) listener, err :=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewNode(id uint64) *Node { return &Node{Id: id} }", "func NewNode(node ast.Node) Node {\n\treturn creator(baseNode{node: node})\n}", "func NewNode(name string, config *Config) *Node {\n\tnode := &Node{\n\t\tName: name,\n\t\tConfig: config,\n\t\tRooms: map[model.Guid]*Room{},\n\t}\n\n\tif config.Store !...
[ "0.7093768", "0.7062563", "0.7058369", "0.70189285", "0.70076716", "0.69962263", "0.6984174", "0.6945499", "0.690799", "0.6906533", "0.689603", "0.6859061", "0.68354684", "0.68204737", "0.68075323", "0.6745448", "0.6743017", "0.6740784", "0.67379194", "0.67348075", "0.6731235...
0.67340374
20
Shutdown does what is on the box
func (n Node) Shutdown() { log.Info("Starting shutdown of %d partitions", len(n.partitions)) for _, parts := range n.partitions { for _, part := range parts { part.Close() } } log.Info("Finished closing all the partitions") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ShutDown() {\n\tC.shout_shutdown()\n}", "func Shutdown() {\n\tclose(shutdown)\n}", "func (h *healthcheckManager) shutdown() {\n\th.quit <- true\n\t<-h.stopped\n}", "func Shutdown() {\n\t// Currently nothing to do\n}", "func (p *DirectBuy) Shutdown() {\n\tp.log.Info(\"Shutting down DirectBuy\")\n\tclos...
[ "0.6944937", "0.6943444", "0.690774", "0.6876422", "0.68660134", "0.6862036", "0.68073046", "0.67971396", "0.67509586", "0.67452574", "0.6728236", "0.67253536", "0.67180264", "0.66992676", "0.66873753", "0.66680455", "0.6665496", "0.666321", "0.6582819", "0.6554132", "0.64983...
0.0
-1
Subscribe will create a channel that will be published to each time a change on ONE partition changes
func (n *Node) Subscribe(topic string) <-chan Message { consumer := make(chan Message) parts := n.getPartitionsFor(topic) var part partition for _, p := range parts { part = smallestOf(part, p) } log.Debug("Created subscriber for %s:%v", topic, part) part.Subscribe(consumer) return consumer }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c Conference) Subscribe(id uuid.UUID, topic string, out chan Notification) {\n\ttree, ok := c.Room[topic]\n\tif !ok {\n\t\ttree = &bst.BinarySearchTree{}\n\t\tc.Room[topic] = tree\n\t}\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\ttree.Add(NewSubscriber(id, out))\n}", "func (h *Hub) Subscribe(t string, c ...
[ "0.66779685", "0.6572508", "0.6495061", "0.6422174", "0.63689184", "0.6352444", "0.6288932", "0.6274408", "0.62708884", "0.625784", "0.6244839", "0.62359333", "0.6185336", "0.6170156", "0.61666375", "0.6162882", "0.6162781", "0.61599725", "0.61536837", "0.61132455", "0.608628...
0.71316516
0
SubscribeToAll creates a channel that is registered to ALL of the different partitions
func (n *Node) SubscribeToAll(topic string) <-chan Message { consumer := make(chan Message) parts := n.getPartitionsFor(topic) for _, p := range parts { p.Subscribe(consumer) } return consumer }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (x *Pep) SubscribeToAll(ctx context.Context, host string, jid *jid.JID) {\n\tx.runQueue.Run(func() {\n\t\tif err := x.subscribeToAll(ctx, host, jid); err != nil {\n\t\t\tlog.Error(err)\n\t\t}\n\t})\n}", "func (cp *CandlesProvider) SubscribeAll(d time.Duration) chan schemas.ResultChannel {\n\tch := make(chan...
[ "0.6937696", "0.58796257", "0.5855679", "0.5842687", "0.57394993", "0.5554731", "0.55545205", "0.5499015", "0.5495352", "0.54776376", "0.54013604", "0.53748983", "0.5313518", "0.52899235", "0.52726644", "0.52343976", "0.5234129", "0.5231414", "0.52018505", "0.51724696", "0.51...
0.78876483
0
RegisterStrategy allows a different RoutingStrategy to be specified for a given topic
func (n *Node) RegisterStrategy(topic string, strategy RoutingStrategy) { n.strategyMap[topic] = strategy }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func RegisterStrategy(info *StrategyInfo) {\n\tstrategyRegistry = append(strategyRegistry, info)\n}", "func RoutingStrategy(r RoutingStrategyType) metaOp {\n\treturn func(m *PluginMeta) {\n\t\tm.RoutingStrategy = r\n\t}\n}", "func (t Twitter) registerRoutes(r *mux.Router) {\n\n}", "func (n networkRoute) Regi...
[ "0.6233871", "0.60150677", "0.5539055", "0.5388272", "0.5353805", "0.5258051", "0.5237158", "0.5210581", "0.52068865", "0.5089592", "0.50649077", "0.50563955", "0.5038952", "0.49194244", "0.48399246", "0.48336083", "0.48249227", "0.48226076", "0.48137185", "0.47765005", "0.47...
0.8255487
0
Write write the payload to a parition in the topic based on the RoutingStrategy specified
func (n *Node) Write(topic, payload string) error { rs := n.getStrategyFor(topic) partID := rs.WhichPartition(payload) parts := n.getPartitionsFor(topic) return parts[partID].Write(payload) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Subscriber) write(mt int, payload []byte) error {\n s.ws.SetWriteDeadline(time.Now().Add(writeWait))\n return s.ws.WriteMessage(mt, payload)\n}", "func (route_p *Router) publish(pkt_p *defs.UDPMsg, addr_p *net.UDPAddr) {\n\tif pkt_p.Flag&defs.UDPMsg_NewNode == defs.UDPMsg_NewNode {\n\t\troute_p.nm...
[ "0.5794445", "0.55988747", "0.5263754", "0.52281415", "0.5177151", "0.50187415", "0.4988992", "0.4955801", "0.49440837", "0.49342078", "0.49267042", "0.49209622", "0.49163938", "0.49163938", "0.4913341", "0.49116528", "0.48997316", "0.4893645", "0.48907122", "0.48559427", "0....
0.6585562
0
responsible for (1) discovering if we have seen this topic before, otherwise fetching it
func (n *Node) getPartitionsFor(topic string) []partition { parts, hasParts := n.partitions[topic] if hasParts { return parts } // we haven't seen this before fetch it log.Info("The topic %s is new -- creating it locally", topic) // TODO fetch!!! - for now, we will just make it all local parts = make([]part...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ts *TargetSyncer) fetchTopics() ([]string, bool, error) {\n\tnew, err := ts.topicManager.Topics()\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tif len(ts.previousTopics) != len(new) {\n\t\tts.previousTopics = new\n\t\treturn new, true, nil\n\t}\n\tfor i, v := range ts.previousTopics {\n\t\tif v != n...
[ "0.63564193", "0.6155337", "0.6141741", "0.59800786", "0.5890245", "0.5821753", "0.5762925", "0.57450515", "0.57057124", "0.55477715", "0.5542679", "0.5485723", "0.5468279", "0.54534346", "0.54458946", "0.5443599", "0.54278564", "0.5422039", "0.54053885", "0.53741664", "0.537...
0.0
-1
GetFileContentType : Gets file content type
func GetFileContentType(out *os.File) (string, error) { // Only the first 512 bytes are used to sniff the content type. buffer := make([]byte, 512) _, err := out.Read(buffer) if err != nil { return "", err } // Use the net/http package's handy DectectContentType function. Always returns a valid // content-ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getFileContentType(out io.Reader) (string, error) {\n\t// Only the first 512 bytes are used to sniff the content type.\n\tbuffer := make([]byte, 512)\n\n\t_, err := out.Read(buffer)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Use the net/http package's handy DectectContentType function. Always retur...
[ "0.81000364", "0.8066238", "0.79145086", "0.7778787", "0.74996734", "0.7295712", "0.7261386", "0.72185165", "0.7110216", "0.6988363", "0.6982667", "0.6970133", "0.6933078", "0.68941605", "0.68878514", "0.6883115", "0.6878635", "0.68280417", "0.6811066", "0.6810509", "0.673948...
0.79005975
3
New creates a new topic
func New(name string, baseDir string) (*WALTopic, error) { walDir := filepath.Join(baseDir, name) oneMB := 1 * 1024 * 1024 w, err := walFactory.NewSize(nil, nil, walDir, oneMB, false) if err != nil { return nil, errors.Wrapf(err, "Could not create wal for topic %s", name) } m := make(map[int]uint64) return &WA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (api *TopicalAPI) TopicNew(w http.ResponseWriter, r *http.Request) {\n\tflashes, _ := api.session.GetFlashes(r, w)\n\tuser, err := api.session.GetUser(r)\n\n\tif err != nil {\n\t\tapi.session.SaveFlash(\"Log in to post a message\", r, w)\n\t\thttp.Redirect(w, r, \"/topics\", 302)\n\t\treturn\n\t}\n\n\tpayload...
[ "0.8250956", "0.7481734", "0.7237881", "0.7221837", "0.72201616", "0.71867234", "0.7052233", "0.6944838", "0.69335455", "0.6894096", "0.6878326", "0.6877358", "0.68346196", "0.681044", "0.6770804", "0.67220366", "0.6689578", "0.6662674", "0.6654795", "0.66509044", "0.6650095"...
0.5847545
50
Restore creates a topic with an existing wal
func Restore(name string, walDir string) (*WALTopic, error) { w, err := walFactory.Open(nil, nil, walDir) if err != nil { return nil, errors.Wrapf(err, "Could no open wal for topic %s", name) } m := make(map[int]uint64) return &WALTopic{name: name, walDir: walDir, wal: w, firstIndexInSegment: m}, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Cluster) RestoreTopic(toml []byte) error {\n\treturn c.createTopic(toml, true)\n}", "func (ctl Controller) Restore(name string) *pitr.Error {\n\terr := ctl.cluster.Stop()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = ctl.cluster.Clear()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstdout, stder...
[ "0.7388679", "0.5776889", "0.54517996", "0.5324671", "0.52316856", "0.52075505", "0.5200593", "0.5074295", "0.50688195", "0.5018047", "0.49563769", "0.49482065", "0.49438968", "0.49104205", "0.49067542", "0.4878728", "0.48616022", "0.48592317", "0.48512042", "0.48401818", "0....
0.8242817
0
Append appends to the wal of this topic
func (t *WALTopic) Append(data Data) error { var buf bytes.Buffer _ = gob.NewEncoder(&buf).Encode(data) if err := t.wal.Log(buf.Bytes()); err != nil { return errors.Wrapf(err, "Error appending to wal for topic: %s", t.name) } for _, a := range t.readerAlerts { if a.waiting { a.appendC <- true } } re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *Topic) Append(msg schema.Message) {\n\tt.lock.Lock()\n\tdefer t.lock.Unlock()\n\tt.Depth++\n\tmsg.Offset = t.Depth\n\tt.Channel <- msg\n\tt.buffer.Put(msg)\n}", "func (l *Log) Append(ctx context.Context, msg Message) error {\n\tdata, err := json.Marshal(msg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t...
[ "0.7172584", "0.6377327", "0.57611495", "0.5748846", "0.5728976", "0.5707987", "0.56621695", "0.5645391", "0.55513144", "0.55505306", "0.5547055", "0.55321455", "0.5517304", "0.5488533", "0.54715824", "0.5470633", "0.5447862", "0.5418506", "0.5404934", "0.5399982", "0.5397534...
0.7302169
0
Close closes the underlying wal
func (t *WALTopic) Close() error { return t.wal.Close() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (gWal *GenericWAL) Close() error {\n gWal.wal.Close()\n return nil\n}", "func (wal *seriesWAL) Close() error {\n\treturn wal.base.close()\n}", "func (w *WAL) Close() error {\n\tw.mu.Lock()\n\tdefer w.mu.Unlock()\n\n\tif w.fp != nil {\n\t\tw.fp.Close()\n\t\tw.fp = nil\n\t}\n\n\tif w.tail() != nil {\n\t\t...
[ "0.7960339", "0.710267", "0.6919875", "0.67559904", "0.67290163", "0.6673831", "0.6418077", "0.6385415", "0.6304291", "0.629084", "0.6190526", "0.6190526", "0.6162513", "0.6127387", "0.6101584", "0.6093734", "0.60745424", "0.60743195", "0.6074003", "0.60731363", "0.6072704", ...
0.6502886
6
NewReader gets a reader of a wal TODO The index might not exist in this wal so we want to find either the index or the next index after the one given This is because during recovery in a multitopic syncable we may not know exactly what we are looking for and we are just checking to make sure we didn't miss anything.
func (t *WALTopic) NewReader(index uint64) (Reader, error) { return t.newWalReader(index) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (wal *WAL) NewReader(name string, offset Offset, bufferSource func() []byte) (*Reader, error) {\n\tr := &Reader{\n\t\tfilebased: filebased{\n\t\t\tdir: wal.dir,\n\t\t\tfileFlags: os.O_RDONLY,\n\t\t\th: newHash(),\n\t\t\tlog: golog.LoggerFor(\"wal.\" + name),\n\t\t},\n\t\twal: wal,...
[ "0.6434191", "0.5840932", "0.58075285", "0.567036", "0.55909795", "0.5506269", "0.5485145", "0.5431219", "0.5323112", "0.5318784", "0.52565265", "0.5216578", "0.5212504", "0.5120026", "0.51129574", "0.5033053", "0.5015555", "0.4984612", "0.4940707", "0.49372166", "0.48791194"...
0.5193216
13
TODO This is a testing only function. Can we test a different way?
func (t *WALTopic) addReaderAlert(a *topicReaderAlert) { t.readerAlerts = append(t.readerAlerts, a) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestGetNone4A(t *testing.T) {\n}", "func TestGetEmpty4A(t *testing.T) {\n}", "func TestSinglePrewrite4A(t *testing.T) {\n}", "func TestGetValue4A(t *testing.T) {\n}", "func TestGetVersions4A(t *testing.T) {\n}", "func TestAckInstalledApplicationListDuplicateRegression(t *testing.T) {\n\n}", "func ...
[ "0.6145971", "0.57826537", "0.5515557", "0.54874736", "0.5458228", "0.5443233", "0.54182136", "0.54031444", "0.538412", "0.5362841", "0.53577185", "0.5339525", "0.5329989", "0.5237156", "0.5230411", "0.5178454", "0.5160178", "0.51488256", "0.51488256", "0.51488256", "0.514882...
0.0
-1
Next gets the next AcceptedProposal or blocks
func (r *walTopicReader) Next(ctx context.Context) (*types.AcceptedProposal, error) { return r.next(ctx, false) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *Pacer) Next() {\n\t// Wait for item to be read from gate.\n\tp.gate <- struct{}{}\n}", "func (b *BlockProcessorQueue) ConfirmedNext() (uint64, bool) {\n\n\tresp := make(chan struct {\n\t\tStatus bool\n\t\tNumber uint64\n\t})\n\treq := Next{ResponseChan: resp}\n\n\tb.ConfirmedNextChan <- req\n\n\tv := <-...
[ "0.59082824", "0.5903719", "0.5894827", "0.5835964", "0.56806195", "0.5579939", "0.5564853", "0.55631655", "0.5560681", "0.5522159", "0.5475068", "0.545712", "0.53569907", "0.5316378", "0.530344", "0.52969617", "0.5296468", "0.5285935", "0.5249892", "0.52495056", "0.52451444"...
0.6375579
0
Create some middleware which swaps out the existing request context with new context.Context value containing the connection pool.
func injectDBGorm(db *gorm.DB) gin.HandlerFunc { return func(c *gin.Context) { c.Set("dbConnection", db) c.Next() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *AppServer) new(w http.ResponseWriter, r *http.Request, params *AppParams, handlers []Middleware) *Context {\n\t// adjust request id\n\trequestId := r.Header.Get(s.requestId)\n\tif requestId == \"\" {\n\t\trequestId = NewObjectId().Hex()\n\n\t\t// inject request header with new request id\n\t\tr.Header.Set...
[ "0.6319336", "0.6146942", "0.5946056", "0.5754442", "0.575218", "0.5731107", "0.57245153", "0.5641714", "0.55994594", "0.5569156", "0.55382276", "0.55248874", "0.5497842", "0.5477662", "0.5432631", "0.54214084", "0.54184", "0.5410464", "0.53937906", "0.5390533", "0.53903556",...
0.0
-1
User will inject the databaseTx in the `User` schema
func (gtx *GuardTx) User(user *schema.User) *schema.User { if user == nil { user = &schema.User{ Entity: schema.Entity{DBContract: gtx.dbTx}, } } else { user.DBContract = gtx.dbTx } user.SetValidator(gtx.validator.User) return user }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func User(user tables.Person) error {\n\tfmt.Println(\"preparing\")\n\tstmt, err := mysqlBus.DB.Prepare(\"INSERT INTO Person VALUES(?, ?, ?, ?, ?, ?)\")\n\tfmt.Println(\"prepared\")\n\tfmt.Println(err)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(\"executing\")\n\t_, err = stmt.Exec(user.Username, user.H...
[ "0.6224481", "0.58505857", "0.58417505", "0.5826436", "0.5734593", "0.5690672", "0.5690672", "0.568731", "0.5683977", "0.56832737", "0.5665492", "0.5661991", "0.56523687", "0.5643033", "0.5639015", "0.56369126", "0.56279415", "0.56095916", "0.56004083", "0.5600074", "0.559548...
0.71175754
0
Role will inject the databaseTx in the `Role` schema
func (gtx *GuardTx) Role(role *schema.Role) *schema.Role { if role == nil { role = &schema.Role{ Entity: schema.Entity{DBContract: gtx.dbTx}, } } else { role.DBContract = gtx.dbTx } role.SetValidator(gtx.validator.Role) return role }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (j *AuroraJob) Role(role string) Job {\n\tj.jobConfig.Key.Role = role\n\n\t// Will be deprecated\n\tidentity := &aurora.Identity{User: role}\n\tj.jobConfig.Owner = identity\n\tj.jobConfig.TaskConfig.Owner = identity\n\treturn j\n}", "func RoleSeeder(db *gorm.DB) {\n\tdb.Exec(\"TRUNCATE TABLE roles\")\n\tdb....
[ "0.593468", "0.5845933", "0.5706156", "0.56633246", "0.5598586", "0.5546218", "0.5509051", "0.5496969", "0.5492553", "0.54864913", "0.54306674", "0.54306674", "0.54306674", "0.54306674", "0.54260254", "0.54152405", "0.54106504", "0.54106504", "0.54106504", "0.53951716", "0.53...
0.6932387
0
Permission will inject the databaseTx in the `Permission` schema
func (gtx *GuardTx) Permission(permission *schema.Permission) *schema.Permission { if permission == nil { return &schema.Permission{ Entity: schema.Entity{DBContract: gtx.dbTx}, } } else { permission.DBContract = gtx.dbTx } permission.SetValidator(gtx.validator.Permission) return permission }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (_Storage *StorageTransactor) GrantPermission(opts *bind.TransactOpts, kind uint8, addr common.Address) (*types.Transaction, error) {\n\treturn _Storage.contract.Transact(opts, \"grantPermission\", kind, addr)\n}", "func CreatePermissionSuite(\n\tdb Queryer,\n\tmodel interface{},\n) error {\n\tmType, err :=...
[ "0.57659733", "0.562225", "0.5615602", "0.559084", "0.5548221", "0.5522893", "0.548699", "0.54744476", "0.54559094", "0.5383814", "0.5369931", "0.53067356", "0.5277368", "0.5224058", "0.520029", "0.5188981", "0.51543236", "0.50971645", "0.5032364", "0.5014209", "0.49922004", ...
0.6913373
0
Rule will inject the databaseTx in the `Rule` schema
func (gtx *GuardTx) Rule(rule *schema.Rule) *schema.Rule { if rule == nil { return &schema.Rule{ Entity: schema.Entity{DBContract: gtx.dbTx}, } } rule.DBContract = gtx.dbTx rule.SetValidator(gtx.validator.Rule) return rule }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (fw *IPtables) injectRule(rule *IPtablesRule) error {\n\trule2arr := strings.Split(rule.GetBody(), \" \")\n\tif len(rule2arr) < 3 {\n\t\treturn fmt.Errorf(\"In injectRule() not enough elements in rule %s\", rule.GetBody())\n\t}\n\n\truleChain := rule2arr[0]\n\n\tfor i, chain := range fw.chains {\n\t\tif chain...
[ "0.5817582", "0.53555834", "0.5226998", "0.5186216", "0.508085", "0.5008556", "0.4957827", "0.4957827", "0.49559155", "0.49460205", "0.48994553", "0.48729715", "0.48546115", "0.48274273", "0.4813973", "0.48122132", "0.47885105", "0.47852197", "0.47779572", "0.47655752", "0.47...
0.67752594
0
GetTx function will return specific database transaction
func (gtx *GuardTx) GetTx() *sql.Tx { return gtx.dbTx }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (uts *UnapprovedTransactions) GetTransaction(txID []byte) ([]byte, error) {\n\treturn uts.DB.Get(uts.getTableName(), txID)\n}", "func (db *DB) GetTx() *GetTx {\n\treturn &GetTx{\n\t\tdb: db,\n\t}\n}", "func GetTransaction(_db *gorm.DB, blkHash common.Hash, txHash common.Hash) *Transactions {\n\tvar tx Tra...
[ "0.7570912", "0.7563583", "0.75429225", "0.7470973", "0.74389464", "0.74146205", "0.73161745", "0.7297836", "0.72537345", "0.72484773", "0.7109892", "0.70955324", "0.70955324", "0.70955324", "0.7064121", "0.70506865", "0.6991761", "0.69659305", "0.695677", "0.69502926", "0.69...
0.7353372
6
mark text as Output type
func (*text) isOutput() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (Output) typ() string { return \"output1\" }", "func (self *Output) Type() string {\n\treturn \"output\"\n}", "func (t *typewriter) Typewrite() string {\n\t// Re-use the cached result if already processed.\n\tif t.cur != -1 {\n\t\treturn t.result\n\t}\n\n\tvar buf bytes.Buffer\n\n\tfor {\n\t\tsep, str := ...
[ "0.6845131", "0.6313934", "0.62364113", "0.5994303", "0.59707606", "0.5910661", "0.58733034", "0.5823576", "0.5814002", "0.5777523", "0.5733294", "0.5717191", "0.57098264", "0.567048", "0.5668985", "0.56583005", "0.559444", "0.55912685", "0.55904263", "0.5571912", "0.55579597...
0.6452956
1
Class or classes to add
func (h *HTML) Class(c ...string) *HTML { h.classes = append(h.classes, c...) return h }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ns Nodes) AddClass(a string) {\n}", "func (this *Intro) addClass(c *Class) {\n\tthis.classes = append(this.classes, c)\n}", "func (c FakeClassList) Add(classes ...string) {\n\tfor _, cl := range classes {\n\t\tc[cl] = struct{}{}\n\t}\n}", "func (c *Classifier) AddClasses(classes []string) {\n\terr := c...
[ "0.7353803", "0.6405253", "0.6077631", "0.57352865", "0.5628054", "0.55100405", "0.5430202", "0.5396594", "0.5327561", "0.52193564", "0.52193564", "0.5143893", "0.5127993", "0.51194954", "0.5070766", "0.5058464", "0.5051829", "0.5024158", "0.49740955", "0.49037462", "0.490216...
0.5485202
6
On defines an event handler
func (h *HTML) On(event string, handler EventHandler) *HTML { h.events = append(h.events, eventHandler{event, handler}) return h }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Client) On(event string, handler Handler) {\n\tc.handlers[event] = handler\n}", "func (m *Main) On(event string, cb EventCallback) {\n\tm.Callback[event] = cb\n}", "func (s *Server) On(event string, f interface{}) {\n\tvalue := reflect.ValueOf(f)\n\n\tif !validHandler(value, reflect.TypeOf(f).Name()) ...
[ "0.753045", "0.7305682", "0.6904258", "0.6867544", "0.6787099", "0.6748967", "0.6697568", "0.6642001", "0.6630415", "0.6616909", "0.66079646", "0.6538392", "0.6523674", "0.6486402", "0.64701205", "0.63886946", "0.62199557", "0.62079185", "0.614324", "0.61256766", "0.6095047",...
0.72935206
2
mark HTML as Output type
func (*HTML) isOutput() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *Tidy) OutputHtml(val bool) (bool, error) {\n\treturn this.optSetBool(C.TidyHtmlOut, cBool(val))\n}", "func (this *Tidy) OutputXhtml(val bool) (bool, error) {\n\treturn this.optSetBool(C.TidyXhtmlOut, cBool(val))\n}", "func htmlFmt(w io.Writer, x interface{}, format string) {\n\twriteAny(w, x, true)...
[ "0.6400135", "0.6055975", "0.6011148", "0.58667994", "0.5687668", "0.561943", "0.55879533", "0.55276394", "0.5470911", "0.5454469", "0.545375", "0.5367108", "0.53660023", "0.536108", "0.5316962", "0.5314116", "0.5296099", "0.5273366", "0.52713025", "0.5254828", "0.5251903", ...
0.70670927
0
Update is for component to have itself rerendered.
func (s *State) Update() { // fmt.Println("update") s.render() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *renderer) Update(_ tea.Msg, _ *list.Model) tea.Cmd { return nil }", "func (component *Component) Update() {\n\tcomponent.WarnError(component.UpdateWithError())\n}", "func (c *PureComponent) HasUpdated() bool { return false }", "func (v *Component) ComponentDidUpdate(prevProps *Map, prevState *Map) {...
[ "0.739471", "0.7180391", "0.7151857", "0.6852027", "0.67297417", "0.6516826", "0.6448432", "0.6317419", "0.6290429", "0.6266985", "0.6240016", "0.6225204", "0.6130606", "0.6125892", "0.6121056", "0.61098975", "0.6102079", "0.6094033", "0.6089738", "0.60849196", "0.60818887", ...
0.73830247
1
/ NewComboBoxSelector :initializer of combo box selector
func NewComboBoxSelector(label string, list []string) *ComboBoxSelector { obj := new(ComboBoxSelector) obj.SelectedItem = list[0] // initialize widgets obj.Cell = widgets.NewQWidget(nil, 0) obj.box = widgets.NewQComboBox(obj.Cell) obj.box.AddItems(list) obj.textLabel = widgets.NewQLabel2(label, obj.Cell, 0) /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCombobox() *Combobox {\n\tc := new(Combobox)\n\n\tc.c = C.uiNewCombobox()\n\n\tC.pkguiComboboxOnSelected(c.c)\n\n\tc.ControlBase = NewControlBase(c, uintptr(unsafe.Pointer(c.c)))\n\treturn c\n}", "func (app *controlsTestApplication) ForComboBox() *controls.ComboBoxBuilder {\n\treturn controls.NewComboBox...
[ "0.6398603", "0.60383093", "0.54640085", "0.5442935", "0.5414595", "0.52587616", "0.5221845", "0.519968", "0.5109608", "0.50104415", "0.49778694", "0.49130982", "0.49013048", "0.47839087", "0.47829998", "0.47143096", "0.47012314", "0.4693571", "0.4685004", "0.46644437", "0.46...
0.8261668
0
TODO solve this problem by DFS & WFS
func sumOfLeftLeavesDFS(root *TreeNode) int { sum := 0 var dfs func(r *TreeNode) dfs = func(r *TreeNode) { if r == nil { return } if r.Left != nil && r.Left.Left == nil && r.Left.Right == nil { sum += r.Left.Val } dfs(r.Left) dfs(r.Right) } dfs(root) return sum }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func search(start *node, end *node , sp [676]wordlists, ep [676]wordlists) (*node){\n if start.name == end.name {\n return start\n }\n\n var st_index, en_index uint16\n var _arr_st_index, _arr_en_index []uint16\n var wlen uint8\n\n var cur [110000]node\n var child node\n var ndC uint...
[ "0.66430527", "0.65681833", "0.64927596", "0.6254573", "0.6130751", "0.6112519", "0.60927993", "0.598578", "0.59538746", "0.592007", "0.5894179", "0.58892846", "0.5865991", "0.584865", "0.582699", "0.58195686", "0.58023083", "0.5763093", "0.5759495", "0.5752892", "0.57520384"...
0.0
-1
NewFileInfo returns a new FileInfo for testing.
func NewFileInfo( t *testing.T, path string, externalPath string, isImport bool, moduleIdentity bufmoduleref.ModuleIdentity, commit string, ) bufmoduleref.FileInfo { fileInfo, err := bufmoduleref.NewFileInfo( path, filepath.Clean(filepath.FromSlash(externalPath)), isImport, moduleIdentity, commit, ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewFileInfo(fPath string, info fs.FileInfo) FileInfo {\n\treturn &fileInfo{\n\t\tfullPath: fPath,\n\t\tFileInfo: info,\n\t}\n}", "func NewFileInfo(name string, size int64, mode os.FileMode, modTime, accessTime time.Time) *FileInfo {\n\treturn &FileInfo{\n\t\tname: filepath.Base(name),\n\t\tsize: ...
[ "0.7941719", "0.79101765", "0.761692", "0.7125709", "0.70744866", "0.6888411", "0.6767215", "0.6567179", "0.65616375", "0.64753735", "0.62839127", "0.61712617", "0.60467106", "0.5909766", "0.5876665", "0.58575416", "0.58478796", "0.58459", "0.58442307", "0.5804826", "0.578671...
0.7401893
3
branchName takes the root directory and relative path to the directory and returns the branch name
func branchName(root, dirRelPath, openAPIFileName string) string { name := filepath.Base(dirRelPath) _, err := os.Stat(filepath.Join(root, dirRelPath, openAPIFileName)) if !os.IsNotExist(err) { // add Pkg: prefix indicating that it is a separate package as it has // openAPIFile return fmt.Sprintf("Pkg: %s", na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (g *github) GetBranchName() string { return g.branchName }", "func (o FunctionBuildConfigSourceRepoSourceOutput) BranchName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v FunctionBuildConfigSourceRepoSource) *string { return v.BranchName }).(pulumi.StringPtrOutput)\n}", "func (ref RefName) BranchNam...
[ "0.68889207", "0.6779807", "0.67637867", "0.6708616", "0.66863376", "0.6600948", "0.6599172", "0.656859", "0.65478766", "0.6514856", "0.6429341", "0.63615274", "0.6339297", "0.628713", "0.6250935", "0.6203753", "0.61460423", "0.61223817", "0.60922194", "0.60919046", "0.607967...
0.75781703
0
Write writes the ascii tree to p.Writer
func (p TreeWriter) Write(nodes []*yaml.RNode) error { switch p.Structure { case TreeStructurePackage: return p.packageStructure(nodes) case TreeStructureGraph: return p.graphStructure(nodes) } // If any resource has an owner reference, default to the graph structure. Otherwise, use package structure. for _,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *GameTree) writeTree(w *bufio.Writer, n TreeNodeIdx, needs bool, nMov int, nMovPerLine int) (err error) {\n\tdefer u(tr(\"writeTree\"))\n\tif needs == true {\n\t\tif nMov > 0 {\n\t\t\terr = w.WriteByte('\\n')\n\t\t\tnMov = 0\n\t\t}\n\t\terr = w.WriteByte('(')\n\t}\n\tif err == nil {\n\t\tif nMov == nMovPer...
[ "0.73633575", "0.69991916", "0.6758368", "0.66080135", "0.6491745", "0.6239188", "0.6143039", "0.6132252", "0.60777396", "0.5980392", "0.5865827", "0.58224255", "0.58132666", "0.57983017", "0.57665694", "0.5751684", "0.5702447", "0.5665232", "0.56497645", "0.56465477", "0.563...
0.53567725
36
Tree adds this node to the root
func (a node) Tree(root treeprint.Tree) error { sort.Sort(a) branch := root var err error // generate a node for the Resource if a.RNode != nil { branch, err = a.p.doResource(a.RNode, "Resource", root) if err != nil { return err } } // attach children to the branch for _, n := range a.children { if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (tree *BinaryTree) Add(value int) {\n\tif tree.root == nil {\n\t\ttree.root = &(node{Value: value})\n\t} else {\n\t\ttree.root.add(value)\n\t}\n\n}", "func (t *Tree) Add(val float64) {\n\tt.root = t.root.add(val)\n}", "func AddRootNode(db *sql.DB, id int64, name string) error {\n\t// move all other nodes ...
[ "0.6451382", "0.64198977", "0.6349391", "0.62001956", "0.61917245", "0.6170597", "0.61382675", "0.61298287", "0.61081576", "0.6092689", "0.596722", "0.5927524", "0.5906705", "0.5861521", "0.5852074", "0.5836093", "0.5803622", "0.5765342", "0.573831", "0.57127416", "0.564222",...
0.6134371
7
graphStructure writes the tree using owners for structure
func (p TreeWriter) graphStructure(nodes []*yaml.RNode) error { resourceToOwner := map[string]*node{} root := &node{} // index each of the nodes by their owner for _, n := range nodes { ownerVal, err := ownerToString(n) if err != nil { return err } var owner *node if ownerVal == "" { // no owner -- ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (q *Qualifier) Graph(w io.Writer) {\n\tfmt.Fprintf(w, \"digraph {\\n\")\n\tq.root.Graph(w, 0, \"[root]\")\n\tfmt.Fprintf(w, \"}\\n\")\n}", "func WriteTree(writer io.Writer, hierarchy *Hierarchy, includeEmpty bool) {\n\ttree := assembleTree(hierarchy)\n\tkeys := make([]string, len(tree))\n\ti := 0\n\tfor k :...
[ "0.6092704", "0.586756", "0.58613664", "0.57382333", "0.5712016", "0.56290585", "0.5610613", "0.5602439", "0.55215484", "0.54591393", "0.5436809", "0.5413327", "0.53986627", "0.5312661", "0.5216152", "0.51965225", "0.514187", "0.5128386", "0.5080789", "0.5075414", "0.5053383"...
0.7600591
0
nodeToString generates a string to identify the node matches ownerToString format
func nodeToString(node *yaml.RNode) (string, error) { meta, err := node.GetMeta() if err != nil { return "", err } return fmt.Sprintf("%s %s/%s", meta.Kind, meta.Namespace, meta.Name), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ownerToString(node *yaml.RNode) (string, error) {\n\tmeta, err := node.GetMeta()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tnamespace := meta.Namespace\n\n\towners, err := node.Pipe(yaml.Lookup(\"metadata\", \"ownerReferences\"))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif owners == nil {\n\t\tr...
[ "0.7972814", "0.77023315", "0.7609072", "0.6673394", "0.6602986", "0.65908784", "0.64567", "0.6454524", "0.6390594", "0.63837796", "0.6312542", "0.6307958", "0.6304605", "0.6244567", "0.6232909", "0.6209375", "0.61758256", "0.6165706", "0.61587185", "0.6129427", "0.612889", ...
0.74435776
3
ownerToString generate a string to identify the owner matches nodeToString format
func ownerToString(node *yaml.RNode) (string, error) { meta, err := node.GetMeta() if err != nil { return "", err } namespace := meta.Namespace owners, err := node.Pipe(yaml.Lookup("metadata", "ownerReferences")) if err != nil { return "", err } if owners == nil { return "", nil } elements, err := own...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o RepositoryAssociationRepositoryBitbucketOutput) Owner() pulumi.StringOutput {\n\treturn o.ApplyT(func(v RepositoryAssociationRepositoryBitbucket) string { return v.Owner }).(pulumi.StringOutput)\n}", "func (o BucketReplicationConfigurationRuleDestinationAccessControlTranslationOutput) Owner() pulumi.Stri...
[ "0.70522296", "0.6943506", "0.69375956", "0.688022", "0.6856853", "0.6838874", "0.68302846", "0.67942965", "0.6789248", "0.67787945", "0.6762392", "0.6750272", "0.6650149", "0.6641561", "0.65653723", "0.65565586", "0.6555649", "0.6503313", "0.6494172", "0.6487006", "0.6482137...
0.8615006
0
index indexes the Resources by their package
func (p TreeWriter) index(nodes []*yaml.RNode) map[string][]*yaml.RNode { // index the ResourceNodes by package indexByPackage := map[string][]*yaml.RNode{} for i := range nodes { meta, err := nodes[i].GetMeta() if err != nil || meta.Kind == "" { // not a resource continue } pkg := filepath.Dir(meta.An...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (pi *PackageIndexer) Index(pack *Package) string {\n\tpi.mutex.Lock() \n\tdefer pi.mutex.Unlock()\n\t// foreach loop over the package's dependencies \n\tfor _, dep := range pack.deps {\n\t\t// query for each dependency\n\t\tif dep.name != \"\" && pi.Query(dep.name) == FAIL {\n\t\t\t// dependency not installed...
[ "0.59473515", "0.5910294", "0.5895813", "0.5877585", "0.58192575", "0.5749591", "0.57174927", "0.5698926", "0.56244725", "0.5540453", "0.5508983", "0.54928124", "0.54442203", "0.5425963", "0.54177755", "0.53597957", "0.5350733", "0.53459483", "0.5278293", "0.5273926", "0.5261...
0.72815484
0
sort sorts the Resources in the index in display order and returns the ordered keys for the index Packages are sorted by package name Resources within a package are sorted by: [filename, namespace, name, kind, apiVersion]
func (p TreeWriter) sort(indexByPackage map[string][]*yaml.RNode) []string { var keys []string for k := range indexByPackage { pkgNodes := indexByPackage[k] sort.Slice(pkgNodes, func(i, j int) bool { return compareNodes(pkgNodes[i], pkgNodes[j]) }) keys = append(keys, k) } // return the package names sorted ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func sortResources(resources []astmodel.InternalTypeName) []astmodel.InternalTypeName {\n\tsort.Slice(resources, func(i, j int) bool {\n\t\tiVal := resources[i]\n\t\tjVal := resources[j]\n\n\t\treturn iVal.PackageReference().PackageName() < jVal.PackageReference().PackageName() ||\n\t\t\tiVal.PackageReference().Pa...
[ "0.7373579", "0.67436945", "0.66443646", "0.63406587", "0.6209258", "0.605762", "0.6039649", "0.5944665", "0.5886248", "0.5750245", "0.56788707", "0.5572973", "0.55383927", "0.552214", "0.5503361", "0.55031127", "0.5499262", "0.5477553", "0.5433216", "0.53902084", "0.535577",...
0.7210953
1
getFields looks up p.Fields from leaf and structures them into treeFields. TODO(pwittrock): simplify this function
func (p TreeWriter) getFields(leaf *yaml.RNode) (treeFields, error) { fieldsByName := map[string]*treeField{} // index nested and non-nested fields for i := range p.Fields { f := p.Fields[i] seq, err := leaf.Pipe(&f) if err != nil { return nil, err } if seq == nil { continue } if fieldsByName[f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getParentTreeFields(treePath string) (treeNames, treePaths []string) {\n\tif treePath == \"\" {\n\t\treturn treeNames, treePaths\n\t}\n\n\ttreeNames = strings.Split(treePath, \"/\")\n\ttreePaths = make([]string, len(treeNames))\n\tfor i := range treeNames {\n\t\ttreePaths[i] = strings.Join(treeNames[:i+1], \"...
[ "0.61212295", "0.5837798", "0.5814727", "0.57181865", "0.56932044", "0.5691752", "0.56457984", "0.56295365", "0.5619157", "0.56047153", "0.55527204", "0.5524664", "0.5486085", "0.5475357", "0.5453594", "0.5439258", "0.5431331", "0.54223394", "0.54207104", "0.54119086", "0.536...
0.79517883
0
NewCopyRecipeToMyRecipesWithChangesParams creates a new CopyRecipeToMyRecipesWithChangesParams object with the default values initialized.
func NewCopyRecipeToMyRecipesWithChangesParams() *CopyRecipeToMyRecipesWithChangesParams { var () return &CopyRecipeToMyRecipesWithChangesParams{ timeout: cr.DefaultTimeout, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCopyRecipeToMyRecipesWithChangesParamsWithHTTPClient(client *http.Client) *CopyRecipeToMyRecipesWithChangesParams {\n\tvar ()\n\treturn &CopyRecipeToMyRecipesWithChangesParams{\n\t\tHTTPClient: client,\n\t}\n}", "func NewCopyRecipeToMyRecipesWithChangesParamsWithTimeout(timeout time.Duration) *CopyRecipe...
[ "0.7398709", "0.7115698", "0.6506534", "0.5838536", "0.575506", "0.55052036", "0.54349566", "0.54136103", "0.5332016", "0.5116452", "0.50422174", "0.48769543", "0.48056495", "0.47824895", "0.47173387", "0.470763", "0.4704235", "0.46622336", "0.46519724", "0.45844418", "0.4572...
0.83219415
0
NewCopyRecipeToMyRecipesWithChangesParamsWithTimeout creates a new CopyRecipeToMyRecipesWithChangesParams object with the default values initialized, and the ability to set a timeout on a request
func NewCopyRecipeToMyRecipesWithChangesParamsWithTimeout(timeout time.Duration) *CopyRecipeToMyRecipesWithChangesParams { var () return &CopyRecipeToMyRecipesWithChangesParams{ timeout: timeout, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CopyRecipeToMyRecipesWithChangesParams) WithTimeout(timeout time.Duration) *CopyRecipeToMyRecipesWithChangesParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "func (o *CopyRecipeToMyRecipesWithChangesParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "func NewCopyRecipeToMyRecipe...
[ "0.7334397", "0.6605116", "0.63352853", "0.5800872", "0.56409484", "0.5607914", "0.54550415", "0.5356853", "0.5310841", "0.53100616", "0.5263849", "0.5247955", "0.52475536", "0.5226695", "0.52168256", "0.5173177", "0.5161624", "0.5160964", "0.5154121", "0.5137564", "0.5129438...
0.7710058
0
NewCopyRecipeToMyRecipesWithChangesParamsWithContext creates a new CopyRecipeToMyRecipesWithChangesParams object with the default values initialized, and the ability to set a context for a request
func NewCopyRecipeToMyRecipesWithChangesParamsWithContext(ctx context.Context) *CopyRecipeToMyRecipesWithChangesParams { var () return &CopyRecipeToMyRecipesWithChangesParams{ Context: ctx, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCopyRecipeToMyRecipesWithChangesParams() *CopyRecipeToMyRecipesWithChangesParams {\n\tvar ()\n\treturn &CopyRecipeToMyRecipesWithChangesParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "func (o *CopyRecipeToMyRecipesWithChangesParams) WithContext(ctx context.Context) *CopyRecipeToMyRecipesWithChanges...
[ "0.7866671", "0.78459364", "0.7305147", "0.65556616", "0.59407496", "0.5868117", "0.5521566", "0.50582105", "0.48954266", "0.4673309", "0.44319955", "0.43159604", "0.4264343", "0.42311433", "0.40826327", "0.40715033", "0.4071279", "0.40607655", "0.39594117", "0.38937762", "0....
0.83000755
0
NewCopyRecipeToMyRecipesWithChangesParamsWithHTTPClient creates a new CopyRecipeToMyRecipesWithChangesParams object with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCopyRecipeToMyRecipesWithChangesParamsWithHTTPClient(client *http.Client) *CopyRecipeToMyRecipesWithChangesParams { var () return &CopyRecipeToMyRecipesWithChangesParams{ HTTPClient: client, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CopyRecipeToMyRecipesWithChangesParams) WithHTTPClient(client *http.Client) *CopyRecipeToMyRecipesWithChangesParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "func (o *CopyRecipeToMyRecipesWithChangesParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "func (o *GetPublicsRec...
[ "0.7614183", "0.7191112", "0.60642815", "0.6035904", "0.6035271", "0.601885", "0.596128", "0.5958554", "0.5913607", "0.5900584", "0.58948666", "0.5868178", "0.5853816", "0.5807214", "0.5771283", "0.5759591", "0.5750537", "0.57373995", "0.5735678", "0.57353026", "0.5731023", ...
0.746175
1
WithTimeout adds the timeout to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) WithTimeout(timeout time.Duration) *CopyRecipeToMyRecipesWithChangesParams { o.SetTimeout(timeout) return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CopyRecipeToMyRecipesWithChangesParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "func (o *GetPublicsRecipeParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "func NewCopyRecipeToMyRecipesWithChangesParamsWithTimeout(timeout time.Duration) *CopyRecipeToMyRec...
[ "0.6520962", "0.5858076", "0.57581943", "0.5501371", "0.52934045", "0.5210673", "0.52082425", "0.5182034", "0.5154618", "0.508878", "0.50811505", "0.5077336", "0.50460726", "0.50446784", "0.5041395", "0.5041395", "0.5026333", "0.50209403", "0.49826825", "0.49667513", "0.49350...
0.7105756
0
SetTimeout adds the timeout to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) SetTimeout(timeout time.Duration) { o.timeout = timeout }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CopyRecipeToMyRecipesWithChangesParams) WithTimeout(timeout time.Duration) *CopyRecipeToMyRecipesWithChangesParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "func (o *GetPublicsRecipeParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "func (o *GetIngredientVersionRevisionParams)...
[ "0.6950563", "0.6872008", "0.63673514", "0.63112706", "0.62673944", "0.6094319", "0.6092785", "0.6001111", "0.59669495", "0.59356844", "0.5930924", "0.59246594", "0.5920255", "0.58911455", "0.58869755", "0.58824813", "0.5843332", "0.58411634", "0.5800582", "0.5796857", "0.579...
0.74348015
0
WithContext adds the context to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) WithContext(ctx context.Context) *CopyRecipeToMyRecipesWithChangesParams { o.SetContext(ctx) return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CopyWithContext(ctx context.Context, dst *Writer, src Stream) error {\n\tif err := src.Open(); err != nil {\n\t\treturn err\n\t}\n\tvar err error\n\tfor ctx.Err() == nil {\n\t\tvar pair Pair\n\t\tpair, err = src.Read()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif pair.Key == nil {\n\t\t\tbreak\n\t\t}...
[ "0.6065512", "0.5775695", "0.5548469", "0.53784853", "0.5308844", "0.5259793", "0.52479076", "0.52151114", "0.52060354", "0.5190454", "0.5179951", "0.51040375", "0.50996315", "0.50958705", "0.5086578", "0.5032771", "0.49986193", "0.49502012", "0.49191132", "0.48936892", "0.48...
0.58584803
1
SetContext adds the context to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) SetContext(ctx context.Context) { o.Context = ctx }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *RevertProductSnapshotRequestUsingPOSTParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "func (o *GetPublicsRecipeParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "func (o *CopyRecipeToMyRecipesWithChangesParams) WithContext(ctx context.Context) *CopyRecipeToMyRecipesWi...
[ "0.62970084", "0.61870456", "0.61496747", "0.6082606", "0.5998157", "0.59815085", "0.5933783", "0.5929907", "0.59284055", "0.58162916", "0.5791815", "0.57468003", "0.5741497", "0.57338977", "0.5702138", "0.56917036", "0.56914335", "0.566592", "0.5653271", "0.56424826", "0.562...
0.67339253
0
WithHTTPClient adds the HTTPClient to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) WithHTTPClient(client *http.Client) *CopyRecipeToMyRecipesWithChangesParams { o.SetHTTPClient(client) return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CopyRecipeToMyRecipesWithChangesParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "func (o *GetPublicsRecipeParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "func (o *AddItemParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", ...
[ "0.68199915", "0.6054078", "0.59095484", "0.58934873", "0.58423924", "0.5841846", "0.5841459", "0.58388424", "0.5804307", "0.5749258", "0.5740945", "0.57321674", "0.57095027", "0.5701237", "0.5682556", "0.56596583", "0.5657443", "0.5632348", "0.5626681", "0.5624085", "0.56233...
0.7069977
0
SetHTTPClient adds the HTTPClient to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *GetPublicsRecipeParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "func (o *RevertProductSnapshotRequestUsingPOSTParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "func (o *CopyRecipeToMyRecipesWithChangesParams) WithHTTPClient(client *http.Client) *Co...
[ "0.7151808", "0.7038088", "0.6908971", "0.6900971", "0.68990266", "0.6891095", "0.6878877", "0.68639123", "0.68540007", "0.6851541", "0.68416125", "0.6839482", "0.68369865", "0.68172693", "0.67863685", "0.67825335", "0.6768729", "0.67661315", "0.67284036", "0.669015", "0.6666...
0.7771742
0
WithJSONBody adds the jSONBody to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) WithJSONBody(jSONBody *models.Recipe) *CopyRecipeToMyRecipesWithChangesParams { o.SetJSONBody(jSONBody) return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CopyRecipeToMyRecipesWithChangesParams) SetJSONBody(jSONBody *models.Recipe) {\n\to.JSONBody = jSONBody\n}", "func (a *API) JSONBody(ctx *fasthttp.RequestCtx, model interface{}) {\n\tr := bytes.NewReader(ctx.PostBody())\n\tjson.NewDecoder(r).Decode(&model)\n}", "func (c *RBController) RecipeJSONAdvanc...
[ "0.63932765", "0.5612401", "0.5401041", "0.53624415", "0.528843", "0.51485735", "0.51017815", "0.5067448", "0.5022532", "0.49914533", "0.49796784", "0.4972427", "0.4907961", "0.48759767", "0.48699957", "0.48650312", "0.48458964", "0.48397836", "0.48314732", "0.48046854", "0.4...
0.7077129
0
SetJSONBody adds the jsonBody to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) SetJSONBody(jSONBody *models.Recipe) { o.JSONBody = jSONBody }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CopyRecipeToMyRecipesWithChangesParams) WithJSONBody(jSONBody *models.Recipe) *CopyRecipeToMyRecipesWithChangesParams {\n\to.SetJSONBody(jSONBody)\n\treturn o\n}", "func (r *Request) SetJSONBody(val interface{}) error {\n\tbuf := bytes.NewBuffer(nil)\n\tenc := json.NewEncoder(buf)\n\tif err := enc.Encod...
[ "0.68018734", "0.65308696", "0.5895473", "0.58617973", "0.5805046", "0.57633257", "0.56163126", "0.55379707", "0.544437", "0.543002", "0.5392192", "0.53760797", "0.53396225", "0.5332443", "0.52658796", "0.5227039", "0.5201621", "0.51650983", "0.5164823", "0.5163957", "0.51321...
0.7069762
0
WithRecipeID adds the recipeID to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) WithRecipeID(recipeID string) *CopyRecipeToMyRecipesWithChangesParams { o.SetRecipeID(recipeID) return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CopyRecipeToMyRecipesWithChangesParams) SetRecipeID(recipeID string) {\n\to.RecipeID = recipeID\n}", "func (o *RecipeAdditive) SetRecipe(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Recipe) error {\n\tvar err error\n\tif insert {\n\t\tif err = related.Insert(ctx, exec, boil.Infe...
[ "0.615391", "0.599917", "0.59268034", "0.5921865", "0.59162635", "0.55177057", "0.5504684", "0.55040866", "0.54498166", "0.5376762", "0.5370218", "0.5241743", "0.52196133", "0.51959723", "0.51737744", "0.51557696", "0.5140836", "0.5042319", "0.5009742", "0.49966857", "0.49725...
0.6474311
0
SetRecipeID adds the recipeId to the copy recipe to my recipes with changes params
func (o *CopyRecipeToMyRecipesWithChangesParams) SetRecipeID(recipeID string) { o.RecipeID = recipeID }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *RecipeLipid) SetRecipe(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Recipe) error {\n\tvar err error\n\tif insert {\n\t\tif err = related.Insert(ctx, exec, boil.Infer()); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to insert into foreign table\")\n\t\t}\n\t}\n\n\tupdateQu...
[ "0.67791796", "0.6419247", "0.62198806", "0.58240676", "0.56545", "0.5435384", "0.5370785", "0.5254237", "0.5230423", "0.5207603", "0.5194222", "0.51442355", "0.51157427", "0.5088593", "0.5044387", "0.5031753", "0.49801058", "0.49731523", "0.49663797", "0.49481156", "0.493317...
0.6869463
0
WriteToRequest writes these params to a swagger request
func (o *CopyRecipeToMyRecipesWithChangesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.JSONBody != nil { if err := r.SetBodyParam(o.JSONBody); err != nil { return err } } // path param reci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *FileInfoCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.ByteOffset != nil {\n\n\t\t// query param byte_offset\n\t\tvar qrByteOffset int64\n\n\t\tif o.ByteOffset != nil ...
[ "0.7198161", "0.714435", "0.70471495", "0.7021836", "0.69967365", "0.69959503", "0.6979433", "0.6979074", "0.69695425", "0.6966308", "0.69242847", "0.6908102", "0.69045216", "0.6871055", "0.68575305", "0.68564737", "0.6851862", "0.6845359", "0.6844677", "0.684266", "0.6830004...
0.0
-1
To reduce request to GKE metadata server, the base token source is reused across syncers. Note: Initialization is deferred because there are possible to use serviceAccountSecretRef with no available default token source.
func initializedBaseTokenSource() (oauth2.TokenSource, error) { baseTokenSourceOnce.Do(func() { baseTokenSource, baseTokenSourceErr = google.DefaultTokenSource(context.Background(), cloudPlatformScope) }) return baseTokenSource, baseTokenSourceErr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func tokenSource(ctx context.Context) (oauth2.TokenSource, error) {\n\tok, err := credsFile.Exists()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar bootstrapToken *oauth2.Token\n\tif !ok {\n\t\ttok, err := authenticate()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbootstrapToken = tok\n\t}\n\tretu...
[ "0.6248717", "0.59793735", "0.5819379", "0.5771171", "0.5746096", "0.57363856", "0.5698077", "0.56682885", "0.56210387", "0.560057", "0.55441684", "0.55334824", "0.5487145", "0.5487065", "0.545568", "0.5444413", "0.540357", "0.536407", "0.5363666", "0.5356209", "0.5340606", ...
0.7220189
0
TokenSource create oauth2.TokenSource for Credentials. Note: We can specify scopes needed for spannerautoscaler but it does increase maintenance cost. We should already use least privileged Google Service Accounts so it use cloudPlatformScope.
func (c *Credentials) TokenSource(ctx context.Context) (oauth2.TokenSource, error) { switch c.Type { case CredentialsTypeADC: return initializedBaseTokenSource() case CredentialsTypeServiceAccountJSON: cred, err := google.CredentialsFromJSON(ctx, c.ServiceAccountJSON, cloudPlatformScope) if err != nil { ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func tokenSource(ctx context.Context, accessToken, credentials string) (oauth2.TokenSource, error) {\n\t// Try access token first\n\tif accessToken != \"\" {\n\t\tlog.Printf(\"[INFO] authenticating via access_token\")\n\n\t\tcontents, _, err := pathorcontents.Read(accessToken)\n\t\tif err != nil {\n\t\t\treturn ni...
[ "0.74979717", "0.7401055", "0.70478684", "0.70462215", "0.7018204", "0.7013672", "0.6994854", "0.69563544", "0.6934276", "0.68950164", "0.6852529", "0.6838926", "0.6566733", "0.6493974", "0.64755976", "0.64075357", "0.63987464", "0.63816744", "0.6311301", "0.6255845", "0.6236...
0.7532123
0
New returns a new Syncer.
func New( ctx context.Context, ctrlClient ctrlclient.Client, namespacedName types.NamespacedName, projectID string, instanceID string, credentials *Credentials, recorder record.EventRecorder, opts ...Option, ) (Syncer, error) { ts, err := credentials.TokenSource(ctx) if err != nil { return nil, err } log...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewSyncer(cfg *Config) *Syncer {\n\tsyncer := new(Syncer)\n\tsyncer.cfg = cfg\n\tsyncer.meta = NewLocalMeta(cfg.Meta)\n\tsyncer.closed.Set(false)\n\tsyncer.lastCount.Set(0)\n\tsyncer.count.Set(0)\n\tsyncer.insertCount.Set(0)\n\tsyncer.updateCount.Set(0)\n\tsyncer.deleteCount.Set(0)\n\tsyncer.done = make(chan ...
[ "0.7282004", "0.721814", "0.7176084", "0.70723194", "0.7026891", "0.69710535", "0.68922335", "0.6689", "0.6485574", "0.6469128", "0.634105", "0.62894493", "0.6284482", "0.62109864", "0.6156181", "0.6142157", "0.59772795", "0.59637696", "0.5897962", "0.5894021", "0.58785456", ...
0.67866945
7
UpdateTarget updates target and returns wether did update or not.
func (s *syncer) UpdateTarget(projectID, instanceID string, credentials *Credentials) bool { updated := false if s.projectID != projectID { updated = true s.projectID = projectID } if s.instanceID != instanceID { updated = true s.instanceID = instanceID } // TODO: Consider deepCopy if !reflect.DeepEqu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (mr *ClientMockRecorder) UpdateTarget(arg0, arg1, arg2 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UpdateTarget\", reflect.TypeOf((*Client)(nil).UpdateTarget), arg0, arg1, arg2)\n}", "func (m *Client) UpdateTarget(arg0 context.Context, ar...
[ "0.6614034", "0.64920354", "0.6105699", "0.60342765", "0.6030683", "0.59310377", "0.5721925", "0.56897306", "0.56685436", "0.5625591", "0.5597833", "0.55948585", "0.55275893", "0.5479221", "0.5437466", "0.5431092", "0.5352646", "0.53513056", "0.5247706", "0.52319986", "0.5218...
0.73240125
0
NewPoller returns an instance of Poller but do not start polling goroutine
func NewPoller(url string, interval time.Duration, out chan PollMsg, shutdown chan *sync.WaitGroup) *Poller { return &Poller{ URL: url, Interval: interval, Out: out, Shutdown: shutdown, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewPoller() *Poller {\n\treturn &Poller{}\n}", "func NewPoller() *Poller {\n\treturn &Poller{\n\t\tinterval: DefaultPollingInterval,\n\t}\n}", "func NewPoller(getFunc GetFunc, period time.Duration, store Store) *Poller {\n\treturn &Poller{\n\t\tgetFunc: getFunc,\n\t\tperiod: period,\n\t\tstore: store,\...
[ "0.8291853", "0.8011239", "0.78253216", "0.77730536", "0.7642704", "0.73517257", "0.7298127", "0.71799994", "0.707358", "0.6794879", "0.65679336", "0.6537219", "0.6506827", "0.6469193", "0.63708735", "0.621865", "0.62098026", "0.6207545", "0.6190991", "0.61326003", "0.6106173...
0.77754176
3
Start spins up a goroutine that continously polls given API endpoint at interval Poller.Interval
func (p *Poller) Start() { go func(url string, interval time.Duration, out chan<- PollMsg, shutdown <-chan *sync.WaitGroup) { wg := &sync.WaitGroup{} defer func() { wg.Done() }() ticker := time.NewTicker(interval) msg := PollMsg{} resp, err := http.Get(url) if err != nil { msg.Error = append(msg.E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *AutoScaler) Run() {\n\tticker := s.clock.NewTicker(s.pollPeriod)\n\ts.readyCh <- struct{}{} // For testing.\n\n\t// Don't wait for ticker and execute pollAPIServer() for the first time.\n\ts.pollAPIServer()\n\n\tfor {\n\t\tselect {\n\t\tcase <-ticker.C():\n\t\t\ts.pollAPIServer()\n\t\tcase <-s.stopCh:\n\t...
[ "0.6498689", "0.64851135", "0.64312106", "0.6397514", "0.63825715", "0.6344594", "0.6055021", "0.59994274", "0.59954834", "0.5936349", "0.5913254", "0.59047526", "0.5847434", "0.5748641", "0.56952643", "0.5693969", "0.5684528", "0.56824774", "0.5681835", "0.5674555", "0.56715...
0.7321983
0
Stop sends a shutdown signal to the polling goroutine to return
func (p *Poller) Stop() { wg := &sync.WaitGroup{} wg.Add(1) p.Shutdown <- wg wg.Wait() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (rcsw *RemoteClusterServiceWatcher) Stop(cleanupState bool) {\n\trcsw.probeEventsSink.send(&ClusterNotRegistered{\n\t\tclusterName: rcsw.clusterName,\n\t})\n\tclose(rcsw.stopper)\n\tif cleanupState {\n\t\trcsw.eventsQueue.Add(&ClusterUnregistered{})\n\t}\n\trcsw.eventsQueue.ShutDown()\n}", "func (w *Unbondi...
[ "0.7100459", "0.70205927", "0.69549215", "0.69389325", "0.69152033", "0.6909807", "0.6899172", "0.68864995", "0.6879378", "0.6826131", "0.6764922", "0.6750816", "0.67412126", "0.67412126", "0.67412126", "0.67412126", "0.67412126", "0.67412126", "0.6737912", "0.672382", "0.670...
0.78706795
0
GetAndDelete retrieves a PendingFileshare from the repository and then deletes it.
func (r *inMemoryFileshareRepository) GetAndDelete(key string) (PendingFileshare, bool) { r.Lock() defer r.Unlock() fileshare, ok := r.pendingFileshares[key] if !ok { return PendingFileshare{}, false } delete(r.pendingFileshares, key) return fileshare, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (am *AutogitManager) Delete(\n\tctx context.Context, dstTLF *libkbfs.TlfHandle, dstDir string,\n\trepo, branchName string) (doneCh <-chan struct{}, err error) {\n\tam.log.CDebugf(ctx, \"Autogit delete request for %s/%s:%s\",\n\t\tdstTLF.GetCanonicalPath(), dstDir, repo, branchName)\n\tdefer func() {\n\t\tam.d...
[ "0.50653577", "0.5034428", "0.4935411", "0.4918671", "0.47782397", "0.47302368", "0.46873987", "0.46159875", "0.45806068", "0.45560926", "0.4527142", "0.45016083", "0.44963208", "0.44932404", "0.44923154", "0.44845128", "0.4465482", "0.44443616", "0.44268724", "0.442413", "0....
0.758004
0
Set adds a new PendingFileshare in the repository. If the key already exists, it returns false, otherwise it returns true.
func (r *inMemoryFileshareRepository) Set(key string, fd PendingFileshare) bool { r.Lock() defer r.Unlock() if _, ok := r.pendingFileshares[key]; ok { return false // Key already exists. } if r.pendingFileshares == nil { r.pendingFileshares = make(map[string]PendingFileshare) } r.pendingFileshares[key] = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (f *Filter) Set(key string) (bool, error) {\n\tcmd := \"s \" + f.Name + \" \" + f.getKey(key)\n\tresp, err := f.Conn.SendAndReceive(cmd)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif resp == \"Yes\" || resp == \"No\" {\n\t\treturn resp == \"Yes\", nil\n\t}\n\treturn false, errInvalidResponse(resp)\n}",...
[ "0.56819904", "0.5656244", "0.56193894", "0.5489106", "0.547759", "0.5415303", "0.5358624", "0.5329123", "0.5298075", "0.5251422", "0.5236577", "0.518625", "0.51822776", "0.51691777", "0.51528174", "0.5129096", "0.5112244", "0.5102831", "0.5098065", "0.5075395", "0.5075193", ...
0.85217196
0
Deprecated: use Default instead.
func New(t LoggerReporter, baseURL string) *Expect { return WithConfig(Config{ BaseURL: baseURL, Reporter: NewAssertReporter(t), Printers: []Printer{ NewCompactPrinter(t), }, }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (in *ManagedCluster) Default() {\n}", "func (f Base) Default() interface{} {\n\treturn f.defaultValue\n}", "func (t TestDescription) Default() TestDescription {\n\treturn t.newLabel(\"DEFAULT\")\n}", "func Default() *API {\n\tapi := New()\n\tapi.Use(\n\t\ttimeout.Default(\"12s\"),\n\t\tlogging.Default(\...
[ "0.66580963", "0.6516262", "0.6497345", "0.6331331", "0.6288372", "0.62188077", "0.62092525", "0.61736196", "0.6171395", "0.6143951", "0.6123842", "0.61111015", "0.61039007", "0.6092376", "0.6084715", "0.6078167", "0.60673964", "0.6048669", "0.6029358", "0.60164595", "0.60038...
0.0
-1
Env returns Environment associated with Expect instance. Tests can use it to store arbitrary data. Example: e := httpexpect.Default(t, " e.Env().Put("key", "value") value := e.Env().GetString("key")
func (e *Expect) Env() *Environment { return e.chain.env() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Env(env string) (value []byte, err error) {\n\tvalue, err = exec.Command(\"go\", \"env\", env).Output()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvalue = bytes.TrimSpace(value)\n\n\tif len(value) == 0 {\n\t\terr = ErrEmptyEnv{env}\n\t}\n\n\treturn\n}", "func (envManager *TestEnvManager) GetEnv() TestEnv {\n\...
[ "0.69212854", "0.66415465", "0.65178424", "0.6469878", "0.63406515", "0.63362306", "0.6283041", "0.62473047", "0.6217694", "0.6203327", "0.619105", "0.61533636", "0.6140795", "0.61385715", "0.6101667", "0.609115", "0.6076825", "0.603624", "0.60137403", "0.59723485", "0.595712...
0.7403274
0
Request returns a new Request instance. Arguments are similar to NewRequest. After creating request, all builders attached to Expect instance are invoked. See Builder.
func (e *Expect) Request(method, path string, pathargs ...interface{}) *Request { opChain := e.chain.enter("Request(%q)", method) defer opChain.leave() req := newRequest(opChain, e.config, method, path, pathargs...) for _, builder := range e.builders { builder(req) } for _, matcher := range e.matchers { re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) Request() *http.Request {\n\treq := httptest.NewRequest(r.Method, r.Target, strings.NewReader(r.Body))\n\treq.Header = r.Header\n\treturn req\n}", "func (f Factory) Request(method string, arguments interface{}) (request Request) {\n\trequest.Token = f.Token\n\trequest.Method = method\n\tif argu...
[ "0.73795944", "0.71671206", "0.70723724", "0.70567113", "0.69686484", "0.6907132", "0.68797153", "0.68797153", "0.68705773", "0.68705773", "0.68705773", "0.6861712", "0.68570507", "0.68570507", "0.6850988", "0.68318594", "0.6826593", "0.6780901", "0.67803687", "0.6775812", "0...
0.80211514
0
OPTIONS is a shorthand for e.Request("OPTIONS", path, pathargs...).
func (e *Expect) OPTIONS(path string, pathargs ...interface{}) *Request { return e.Request(http.MethodOptions, path, pathargs...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Options(url string, data ...interface{}) (*ClientResponse, error) {\n\treturn DoRequest(\"OPTIONS\", url, data...)\n}", "func (g *Group) OPTIONS(path string, handler Handler, middleware ...Middleware) *Group {\n\treturn g.Add(http.MethodOptions, path, handler, middleware...)\n}", "func (r *Request) Option...
[ "0.76900136", "0.7574512", "0.7364902", "0.7281106", "0.7234489", "0.7181617", "0.71771985", "0.71593726", "0.71545005", "0.7152557", "0.7115014", "0.70317966", "0.7006474", "0.697124", "0.69393027", "0.69371873", "0.69233954", "0.69009876", "0.6857603", "0.6837377", "0.68300...
0.8413449
0
HEAD is a shorthand for e.Request("HEAD", path, pathargs...).
func (e *Expect) HEAD(path string, pathargs ...interface{}) *Request { return e.Request(http.MethodHead, path, pathargs...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) Head(path string) *Request {\n\treturn r.method(\"HEAD\", path)\n}", "func (r *Request) Head(path string, params ...url.Values) {\n\tcontentType := \"text/html\"\n\n\tif len(params) == 0 {\n\t\tr.Send(\"HEAD\", path, contentType)\n\t} else {\n\t\tr.Send(\"HEAD\", path, contentType, params[0])\n...
[ "0.8339463", "0.796774", "0.79031473", "0.79007864", "0.7859185", "0.78095627", "0.7662336", "0.76048857", "0.75982046", "0.7593806", "0.7559749", "0.7555149", "0.75462085", "0.75420874", "0.7530385", "0.7517558", "0.7505431", "0.7505388", "0.746149", "0.7457079", "0.7431187"...
0.8708814
0
GET is a shorthand for e.Request("GET", path, pathargs...).
func (e *Expect) GET(path string, pathargs ...interface{}) *Request { return e.Request(http.MethodGet, path, pathargs...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) Get(path string) *Request {\n\treturn r.method(\"GET\", path)\n}", "func GET(t *testing.T, path string) *httpexpect.Request {\n\tu, err := url.Parse(path)\n\trequire.Nil(t, err)\n\treturn newAPI(t).\n\t\tGET(u.Path).\n\t\tWithQueryString(u.RawQuery)\n}", "func (r *Request) Get(url string) *Re...
[ "0.81648576", "0.7915022", "0.7594921", "0.75366944", "0.7499703", "0.74763393", "0.73408014", "0.73338115", "0.7321939", "0.7278976", "0.7253074", "0.72435415", "0.72385293", "0.72086805", "0.7207457", "0.7175362", "0.7173006", "0.7165603", "0.7134777", "0.71175677", "0.7106...
0.8767445
0
POST is a shorthand for e.Request("POST", path, pathargs...).
func (e *Expect) POST(path string, pathargs ...interface{}) *Request { return e.Request(http.MethodPost, path, pathargs...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) Post(path string) *Request {\n\treturn r.method(\"POST\", path)\n}", "func (r *Request) Post(path, contentType string, data ...interface{}) {\n\tr.Send(\"POST\", path, contentType, data...)\n}", "func (client *Client) Post(path, data string, mods ...func(*Req)) (Res, error) {\n\treq := client...
[ "0.8183926", "0.7732567", "0.76200134", "0.75784963", "0.75539345", "0.7427361", "0.7357585", "0.7335185", "0.7305281", "0.730186", "0.72804624", "0.727684", "0.7255811", "0.7240516", "0.72129816", "0.72095233", "0.7202608", "0.71791095", "0.71427095", "0.7142554", "0.7136954...
0.85327715
0
PUT is a shorthand for e.Request("PUT", path, pathargs...).
func (e *Expect) PUT(path string, pathargs ...interface{}) *Request { return e.Request(http.MethodPut, path, pathargs...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) Put(path string) *Request {\n\treturn r.method(\"PUT\", path)\n}", "func (r *Request) Put(path, contentType string, data ...interface{}) {\n\tr.Send(\"PUT\", path, contentType, data...)\n}", "func (client *Client) Put(path string) Response {\n\treturn client.processRequest(path, \"PUT\")\n}",...
[ "0.82787406", "0.7994318", "0.7698192", "0.7613152", "0.7606588", "0.75494", "0.7526452", "0.7382648", "0.73742276", "0.7360344", "0.735589", "0.73023254", "0.7295277", "0.7255101", "0.7236425", "0.72218215", "0.7220903", "0.72073925", "0.7194703", "0.7173302", "0.71618134", ...
0.880231
0
PATCH is a shorthand for e.Request("PATCH", path, pathargs...).
func (e *Expect) PATCH(path string, pathargs ...interface{}) *Request { return e.Request(http.MethodPatch, path, pathargs...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) Patch(path string) *Request {\n\treturn r.method(\"PATCH\", path)\n}", "func (r *Router) PATCH(path string, handler RequestHandler) {\n\tr.setPath(httpPATCH, path, handler)\n}", "func (r *Router) PATCH(url string, viewFn View) *Path {\n\treturn r.Path(fasthttp.MethodPatch, url, viewFn)\n}", ...
[ "0.8082939", "0.79485875", "0.7912536", "0.7824908", "0.763242", "0.76136535", "0.7507971", "0.7493006", "0.7487783", "0.74693745", "0.7466364", "0.74389553", "0.74365085", "0.7419845", "0.74184185", "0.7400768", "0.7369115", "0.7331139", "0.7320122", "0.73052347", "0.7297849...
0.8773625
0