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
WriteBytesToFile writes a []byte to a specified file on the EC2 instance
func (ins *EC2RemoteClient) WriteBytesToFile(source []byte, destination string) error { err := ins.cmdClient.WriteBytesToFile(source, destination) return err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WriteBytes(ctx context.Context, data []byte, filename string) error {\n\tif strings.HasPrefix(filename, \"gs://\") {\n\t\treturn writeGCSObject(ctx, data, filename)\n\t}\n\treturn ioutil.WriteFile(filename, data, os.ModePerm)\n}", "func SaveBytesToFile(content []byte, outputFile string, overwrite bool) erro...
[ "0.70434415", "0.6866407", "0.6832017", "0.68032885", "0.66986525", "0.6693543", "0.65425426", "0.64673275", "0.6426073", "0.6332181", "0.6302297", "0.6260653", "0.6243535", "0.6230753", "0.61927813", "0.6178638", "0.61687887", "0.61561227", "0.61376625", "0.61336935", "0.612...
0.80710757
0
Deprecated: Use SecretVersion_State.Descriptor instead.
func (SecretVersion_State) EnumDescriptor() ([]byte, []int) { return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{1, 0} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*SecretVersion) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{1}\n}", "func (*Secret) Descriptor() ([]byte, []int) {\n\treturn file_pkg_flow_grpc_secrets_proto_rawDescGZIP(), []int{0}\n}", "func (*SetStateSpec) Descriptor() ([]byte, []int)...
[ "0.64241785", "0.62223697", "0.62026495", "0.61575454", "0.6137586", "0.60295725", "0.60001373", "0.5997433", "0.5975869", "0.5968872", "0.59638256", "0.59485865", "0.5922023", "0.58976424", "0.58952713", "0.5827793", "0.5794404", "0.5776734", "0.57455724", "0.57246864", "0.5...
0.69412255
0
Deprecated: Use Secret.ProtoReflect.Descriptor instead.
func (*Secret) Descriptor() ([]byte, []int) { return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{0} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*CredentialsKVProto) Descriptor() ([]byte, []int) {\n\treturn file_Security_proto_rawDescGZIP(), []int{1}\n}", "func (*TokenProto) Descriptor() ([]byte, []int) {\n\treturn file_Security_proto_rawDescGZIP(), []int{0}\n}", "func (*Secret) Descriptor() ([]byte, []int) {\n\treturn file_pkg_flow_grpc_secrets_...
[ "0.6954283", "0.6922612", "0.68011224", "0.6779633", "0.67407244", "0.67103106", "0.662461", "0.6623578", "0.66090536", "0.65876913", "0.65496767", "0.6473732", "0.64469266", "0.6440782", "0.63975", "0.6394054", "0.637844", "0.6369081", "0.6352151", "0.6339204", "0.6335964", ...
0.6606762
9
Deprecated: Use SecretVersion.ProtoReflect.Descriptor instead.
func (*SecretVersion) Descriptor() ([]byte, []int) { return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{1} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*CredentialsKVProto) Descriptor() ([]byte, []int) {\n\treturn file_Security_proto_rawDescGZIP(), []int{1}\n}", "func (*SecretPayload) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{3}\n}", "func (*TokenProto) Descriptor() ([]byte, []int) {\...
[ "0.6847484", "0.6715793", "0.6695759", "0.66937315", "0.6623736", "0.6599705", "0.65578085", "0.65053517", "0.6492708", "0.6484372", "0.6433935", "0.64155066", "0.64061314", "0.63588876", "0.6358342", "0.6349531", "0.6346874", "0.6325663", "0.6314042", "0.63127357", "0.629627...
0.705888
0
Deprecated: Use Replication.ProtoReflect.Descriptor instead.
func (*Replication) Descriptor() ([]byte, []int) { return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{2} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*Deprecation) Descriptor() ([]byte, []int) {\n\treturn file_external_cfgmgmt_response_nodes_proto_rawDescGZIP(), []int{8}\n}", "func (*PatchCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{161}\n}", "func (*Listen) Descriptor() ([]byte...
[ "0.6727746", "0.6686084", "0.6545586", "0.6480731", "0.6466182", "0.64647496", "0.6437498", "0.6433067", "0.6430104", "0.6422417", "0.6404882", "0.6386649", "0.6378753", "0.6375563", "0.637492", "0.63679546", "0.63624215", "0.63500184", "0.63441485", "0.63429284", "0.6334024"...
0.0
-1
Deprecated: Use SecretPayload.ProtoReflect.Descriptor instead.
func (*SecretPayload) Descriptor() ([]byte, []int) { return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{3} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*LabelledPayload) Descriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_pipeline_v1_beam_runner_api_proto_rawDescGZIP(), []int{59}\n}", "func (*ExternalPayload) Descriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_pipeline_v1_beam_runner_api_proto_rawDescGZIP(), []int{53}\n}", ...
[ "0.65490156", "0.64903533", "0.63943386", "0.6318891", "0.62863195", "0.6273548", "0.621698", "0.6194263", "0.61777174", "0.6158098", "0.6156442", "0.6155339", "0.61546296", "0.6109918", "0.610977", "0.6063295", "0.604994", "0.60420156", "0.6019964", "0.60105217", "0.60040504...
0.6862886
0
Deprecated: Use Replication_Automatic.ProtoReflect.Descriptor instead.
func (*Replication_Automatic) Descriptor() ([]byte, []int) { return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{2, 0} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*Deprecation) Descriptor() ([]byte, []int) {\n\treturn file_external_cfgmgmt_response_nodes_proto_rawDescGZIP(), []int{8}\n}", "func (*PatchCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{161}\n}", "func (*Persistent) Descriptor() ([]...
[ "0.6894834", "0.67953676", "0.66490424", "0.6634654", "0.65959626", "0.65788096", "0.6574221", "0.65688884", "0.65657634", "0.65597504", "0.65399843", "0.65367705", "0.6523806", "0.65232563", "0.65229344", "0.65124637", "0.6510672", "0.6508254", "0.6489727", "0.6485264", "0.6...
0.0
-1
Deprecated: Use Replication_UserManaged.ProtoReflect.Descriptor instead.
func (*Replication_UserManaged) Descriptor() ([]byte, []int) { return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{2, 1} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*McUserProto) Descriptor() ([]byte, []int) {\n\treturn file_pkg_mcclient_mcuser_mcuser_proto_proto_rawDescGZIP(), []int{0}\n}", "func (*LoginedUserRep) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{3}\n}", "func (*NetMessageSplitscreenUserChanged) Descriptor() ([]byt...
[ "0.70660174", "0.69403785", "0.678979", "0.6760362", "0.6759122", "0.6756026", "0.67284197", "0.66994125", "0.6697244", "0.66709644", "0.66658753", "0.66588396", "0.6652014", "0.66486746", "0.6647983", "0.66478443", "0.6627967", "0.66196585", "0.6619095", "0.6616627", "0.6610...
0.68749994
2
Deprecated: Use Replication_UserManaged_Replica.ProtoReflect.Descriptor instead.
func (*Replication_UserManaged_Replica) Descriptor() ([]byte, []int) { return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{2, 1, 0} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*ReplicaInfo) Descriptor() ([]byte, []int) {\n\treturn file_google_spanner_admin_instance_v1_spanner_instance_admin_proto_rawDescGZIP(), []int{0}\n}", "func (ReplicaInfo_ReplicaType) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_spanner_admin_instance_v1_spanner_instance_admin_proto_rawDescGZIP(...
[ "0.6919288", "0.67240775", "0.66489303", "0.6557044", "0.63410616", "0.63238233", "0.6313102", "0.6294632", "0.62538755", "0.6247766", "0.6238576", "0.6229779", "0.6208036", "0.6207874", "0.6207713", "0.61889184", "0.6183292", "0.61792266", "0.6175798", "0.61689883", "0.61688...
0.71663374
0
Must be called as soon as the program starts to initialize Args
func getArguments() { // define pointers to the arguments which will be filled up when flag.Parse() is called langFlag := flag.String("l", string(auto), "Which language to use. Args are: lua | wren | moon | auto") dirFlag := flag.String("d", ".", "The directory containing the main file and the subfiles") outFlag :=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func argsInit() {\n\tArgs = make([]string, 0, 0)\n\tArgs = append(Args, os.Args...)\n\tExecFile = options.GetExecFileByPid(os.Getpid())\n\t// default opt Parser\n\t// do not include ExecFile\n\topts = options.NewOptParser(Args[1:])\n\tArgLine = options.ArgsToSpLine(Args)\n\tArgFullLine = options.CleanArgLine(os.Ar...
[ "0.74348855", "0.71042395", "0.6630047", "0.6588652", "0.6358079", "0.62932676", "0.62634456", "0.6233771", "0.62128526", "0.6169773", "0.6157398", "0.6115356", "0.6105673", "0.6088985", "0.605611", "0.6049494", "0.5983334", "0.5979197", "0.59693015", "0.59642893", "0.5955199...
0.6201516
9
buildLogMsg generates an empty CI test plan that prints msg to the build log.
func buildLogMsg(title, msg string) droneyaml.BuildItem { return droneyaml.BuildItem{ Key: "Warning: " + title, Build: droneyaml.Build{ Container: droneyaml.Container{ Image: "library/alpine:3.2", Environment: droneyaml.MapEqualSlice([]string{"MSG=" + msg}), }, Commands: []string{`echo "$MSG...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *tracer) buildMessage() string {\n\tif t.IsNull() {\n\t\treturn \"\"\n\t}\n\n\t// Note: this value is very important, it makes sure the internal calls of this package would not interfere with the real caller we want to catch\n\t// badly set and you will get a line number that does not match with the ...
[ "0.57305515", "0.532833", "0.52610326", "0.5235716", "0.51883453", "0.5136516", "0.5134061", "0.5091816", "0.50882214", "0.5044602", "0.5035794", "0.50196993", "0.49808282", "0.49630845", "0.49628553", "0.49331522", "0.49271595", "0.48909366", "0.48870495", "0.48639286", "0.4...
0.61156356
0
fibonacci is a function that returns a function that returns an int.
func fibonacci() func() int { first, second := 0, 1 return func() int { ret := first first, second = second, first+second return ret } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func fibonacci() func() int {\n\n\treturn func() int {\n\t\tif x == -1 {\n\t\t\tx = 0\n\t\t\treturn x\n\t\t}\n\t\tif y == -1 {\n\t\t\ty = 1\n\t\t\treturn y\n\t\t}\n\n\t\tvar cur int = x + y\n\t\tx = y\n\t\ty = cur\n\t\treturn cur\n\t}\n\n}", "func fibonacci() func() int {\n\tterm_1, term_2 := 0, 1\n\treturn func...
[ "0.8847999", "0.8757891", "0.87546825", "0.8742662", "0.8730003", "0.870885", "0.86387646", "0.8622545", "0.86220956", "0.86146945", "0.86084855", "0.85591084", "0.85559744", "0.8555152", "0.8547645", "0.8536301", "0.85228187", "0.85178524", "0.8498509", "0.84956574", "0.8494...
0.86712015
6
NewDeployment converts BOSH deployment information into a deployment view for the dashboard
func NewDeployment(configTier config.Tier, configSlot config.Slot, boshDeployment *data.Deployment) (deployment *Deployment) { tierName := configTier.Name slotName := configSlot.Name name := fmt.Sprintf("%s / %s - %s", tierName, slotName, boshDeployment.Name) releases := make([]DisplayNameVersion, len(boshDeploym...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newDeployment(apployment *appscodev1alpha1.Apployment) *appsv1.Deployment {\n\tlabels := map[string]string{\n\t\t\"app\": \"Appscode\",\n\t\t\"controller\": apployment.Name,\n\t}\n\treturn &appsv1.Deployment{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: apployment.Spec.ApploymentName,\n\t\t\tN...
[ "0.7245263", "0.7115578", "0.69355154", "0.688241", "0.68323797", "0.67257977", "0.66148096", "0.64859754", "0.6411792", "0.6330559", "0.6227838", "0.6215856", "0.6212143", "0.6204911", "0.61451054", "0.6140682", "0.6136553", "0.61164033", "0.61146384", "0.61137414", "0.61049...
0.7144714
1
ContainsFilterTag determines if a Deployment has a release matching filterTag
func (deployment *Deployment) ContainsFilterTag(filterTag string) bool { if filterTag == "" { return true } for _, release := range deployment.Releases { if release.Name == filterTag { return true } } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func isReleaseTag(eventType string, payload api.WebhookGithub) bool {\n\tif api.GithubWebhookPush == eventType {\n\t\tif nil != payload[api.GithubWebhookFlagRef] &&\n\t\t\tstrings.Contains(payload[api.GithubWebhookFlagRef].(string),\n\t\t\t\tapi.GithubWebhookFlagTags) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn f...
[ "0.63597506", "0.5253143", "0.5221754", "0.5196398", "0.51056296", "0.50931746", "0.4982437", "0.49158007", "0.48898113", "0.48771313", "0.4853815", "0.48363844", "0.48362416", "0.48145217", "0.4810747", "0.47806767", "0.47804633", "0.47619316", "0.4756543", "0.47478878", "0....
0.83583623
0
NewUncertaintyGroup furnishes an UncertaintyGroup for a given set of actions where their quantity is known a priori.
func NewUncertaintyGroup(count uint) UncertaintyGroup { return &uncertaintyGroup{ remaining: count, results: make(chan error), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newGroupAtLeastOnce() *Instruction {\n\treturn &Instruction{\n\t\tType: GroupAtLeastOnceInst,\n\t\tName: \"AtLeastOnce\",\n\t}\n}", "func newGroup(groupId string, broadcastChannelCap int64) *group {\n\n\tg := &group{\n\t\tId: groupId,\n\t\tclients: make(map[string]*socketClient),\n\t\tbroadcastChannel: m...
[ "0.523805", "0.51416165", "0.48481917", "0.48094192", "0.47957078", "0.4758264", "0.47503814", "0.47461075", "0.46588066", "0.46588066", "0.4653089", "0.4646152", "0.4639611", "0.4613281", "0.4588941", "0.4585807", "0.45691368", "0.45633745", "0.45534816", "0.4546183", "0.454...
0.6746478
0
ByteOrder returns the byte order for the CPU's native endianness.
func ByteOrder() binary.ByteOrder { return byteOrder }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetByteOrder() binary.ByteOrder {\n\tbuf := [2]byte{}\n\t*(*uint16)(unsafe.Pointer(&buf[0])) = uint16(0xABCD)\n\n\tswitch buf {\n\tcase [2]byte{0xCD, 0xAB}:\n\t\treturn binary.LittleEndian\n\tcase [2]byte{0xAB, 0xCD}:\n\t\treturn binary.BigEndian\n\tdefault:\n\t\tpanic(\"Could not determine native endianness....
[ "0.80799955", "0.6644619", "0.66354847", "0.6532824", "0.6508645", "0.64949846", "0.60611993", "0.59378254", "0.591465", "0.58923656", "0.58208567", "0.5719463", "0.5529042", "0.5429169", "0.5246309", "0.5219467", "0.5196728", "0.5044286", "0.5037801", "0.49660262", "0.490307...
0.68111
1
Init creates a new light string
func (ls *LightString) Init() { log.Infof("Creating %v pixel light string", ls.Count) ls.Last = ls.Count // default last pixel to count n := 0 for n < ls.Count { ls.Pixels = append(ls.Pixels, &Pixel{ Color: defaultPixelColor, Brightness: defaultPixelBrightness, }) n++ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (td *TextDisplay)Init(){\r\n\tfontBytes, err := ioutil.ReadFile(\"Blockstepped.ttf\")\r\n\tif err != nil {\r\n\t\tlog.Println(err)\r\n\t\treturn\r\n\t}\r\n\tvar err2 error\r\n\ttd.font, err2 = truetype.Parse(fontBytes)\r\n\tif err2 != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\ttd.mplusNormalFont = truetype.NewFa...
[ "0.5770172", "0.56220156", "0.55416876", "0.55140245", "0.54732513", "0.53269196", "0.52365375", "0.520851", "0.51928884", "0.5182738", "0.5087613", "0.5065547", "0.5049686", "0.5035323", "0.50059944", "0.49973142", "0.49936852", "0.4987295", "0.497426", "0.49706402", "0.4970...
0.7305143
0
FillString writes a color to all pixels
func (ls *LightString) FillString(color uint8) { log.Debugf("Filling pixels with color %v", color) n := 0 for n < ls.Last { ls.Pixels[n].Color = color log.Debugf("Coloring pixel %v %v", n, color) n++ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func PaintFill(image [][]rune, row, col int, newColor rune) {\n\tpaintFillHelper(image, row, col, image[row][col], newColor)\n}", "func (tb *Textbox) Fill(u rune) error {\n\tif !utf8.ValidRune(u) {\n\t\treturn errors.New(\"invalid rune\")\n\t}\n\n\tfor i := range tb.pixels {\n\t\ttb.pixels[i] = u\n\t}\n\treturn ...
[ "0.63875264", "0.63263696", "0.6272358", "0.6254065", "0.60946006", "0.59574157", "0.5893883", "0.5891934", "0.58215666", "0.56947726", "0.5689455", "0.5674843", "0.56719476", "0.560667", "0.5572262", "0.5509258", "0.54924154", "0.5467268", "0.5448704", "0.5425666", "0.540781...
0.806296
0
SetColor writes a color to a specific pixel
func (ls *LightString) SetColor(position int, color uint8) error { if position > ls.Last { log.Errorf("SetColor: last valid pixel is #%v", ls.Last) return fmt.Errorf("SetColor: last valid pixel is #%v", ls.Last) } log.Debugf("Coloring pixel %v %v", position, color) ls.Pixels[position].Color = color return nil ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func setPixel(x, y int, c color, pixels []byte) {\n\tindex := (y*windowWidth + x) * 4\n\n\tif index < len(pixels)-4 && index >= 0 {\n\t\tpixels[index] = c.r\n\t\tpixels[index+1] = c.g\n\t\tpixels[index+1] = c.b\n\t}\n}", "func (writer *Writer) WriteSetColor(color uint16) {\n\twriter.write16(uint16(CmdSetColor))\...
[ "0.73720556", "0.72960764", "0.7205484", "0.7205484", "0.71994334", "0.70884395", "0.6987065", "0.69633406", "0.6919301", "0.6915945", "0.68813854", "0.6852106", "0.68471354", "0.6827616", "0.67762893", "0.6771381", "0.6748354", "0.67284906", "0.6727163", "0.66611207", "0.661...
0.6281695
29
Render writes the string to hardware
func (ls *LightString) Render() { log.Debug("Rendering string") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *rawData) Render(w io.Writer) (int, error) { return w.Write([]byte(e.content)) }", "func (t *textRender) Render(w io.Writer) (err error) {\n\tif len(t.Values) > 0 {\n\t\t_, err = fmt.Fprintf(w, t.Format, t.Values...)\n\t} else {\n\t\t_, err = io.WriteString(w, t.Format)\n\t}\n\treturn\n}", "func (g *Ga...
[ "0.6693423", "0.6568186", "0.6555938", "0.65232486", "0.64735943", "0.64108616", "0.630587", "0.6246599", "0.62406623", "0.6227451", "0.6213972", "0.6186643", "0.61188525", "0.60934913", "0.6093434", "0.6093434", "0.60800576", "0.6035777", "0.60135376", "0.59639907", "0.59434...
0.67597234
0
NewDirectRequestSpec initializes a new DirectRequestSpec from a job.DirectRequestSpec
func NewDirectRequestSpec(spec *job.DirectRequestSpec) *DirectRequestSpec { return &DirectRequestSpec{ ContractAddress: spec.ContractAddress, MinIncomingConfirmations: spec.MinIncomingConfirmations, MinIncomingConfirmationsEnv: spec.MinIncomingConfirmationsEnv, MinContractPayment: spec....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewDirectRequestSpec(spec *job.DirectRequestSpec) *DirectRequestSpec {\n\treturn &DirectRequestSpec{\n\t\tContractAddress: spec.ContractAddress,\n\t\tOnChainJobSpecID: spec.OnChainJobSpecID.String(),\n\t\t// This is hardcoded to runlog. When we support other intiators, we need\n\t\t// to change this\n\t\tIni...
[ "0.81985295", "0.61109", "0.610836", "0.6104865", "0.60955787", "0.60782826", "0.60756934", "0.60756934", "0.6053734", "0.6053734", "0.6046308", "0.6046308", "0.60427433", "0.60427433", "0.6041208", "0.6038668", "0.6038668", "0.6030468", "0.60247654", "0.60017973", "0.599973"...
0.8256631
0
NewFluxMonitorSpec initializes a new DirectFluxMonitorSpec from a job.FluxMonitorSpec
func NewFluxMonitorSpec(spec *job.FluxMonitorSpec) *FluxMonitorSpec { var drumbeatSchedulePtr *string if spec.DrumbeatEnabled { drumbeatSchedulePtr = &spec.DrumbeatSchedule } var drumbeatRandomDelayPtr *string if spec.DrumbeatRandomDelay > 0 { drumbeatRandomDelay := spec.DrumbeatRandomDelay.String() drumbeat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewFluxMonitorSpec(spec *job.FluxMonitorSpec) *FluxMonitorSpec {\n\treturn &FluxMonitorSpec{\n\t\tContractAddress: spec.ContractAddress,\n\t\tPrecision: spec.Precision,\n\t\tThreshold: spec.Threshold,\n\t\tAbsoluteThreshold: spec.AbsoluteThreshold,\n\t\tPollTimerPeriod: spec.PollTimerPerio...
[ "0.7735614", "0.52191037", "0.51470137", "0.5015607", "0.49694467", "0.4964988", "0.49210796", "0.49060473", "0.49040398", "0.4856898", "0.48292074", "0.48211414", "0.4782509", "0.4765241", "0.47645527", "0.4729567", "0.4721767", "0.47063202", "0.46926945", "0.46776727", "0.4...
0.8116492
0
NewOffChainReportingSpec initializes a new OffChainReportingSpec from a job.OCROracleSpec
func NewOffChainReportingSpec(spec *job.OCROracleSpec) *OffChainReportingSpec { return &OffChainReportingSpec{ ContractAddress: spec.ContractAddress, P2PBootstrapPeers: spec.P2PBootstrapPeers, P2PV2Bootstrappers: spec.P2PV2Bootstrappers, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewOffChainReportingSpec(spec *job.OffchainReportingOracleSpec) *OffChainReportingSpec {\n\treturn &OffChainReportingSpec{\n\t\tContractAddress: spec.ContractAddress,\n\t\tP2PPeerID: spec.P2PPeerID,\n\t\tP2PBootstrapPeers: spec.P2PBootst...
[ "0.76700133", "0.6786117", "0.5106095", "0.505037", "0.49529737", "0.4917524", "0.48303846", "0.48108968", "0.48050052", "0.4734925", "0.47245955", "0.46765545", "0.46355996", "0.4632689", "0.46127805", "0.46126866", "0.45519337", "0.45240414", "0.451157", "0.44827083", "0.44...
0.78592646
0
NewOffChainReporting2Spec initializes a new OffChainReportingSpec from a job.OCR2OracleSpec
func NewOffChainReporting2Spec(spec *job.OCR2OracleSpec) *OffChainReporting2Spec { return &OffChainReporting2Spec{ ContractID: spec.ContractID, Relay: spec.Relay, RelayConfig: spec.RelayConfig, P2PV2Bootstrappers: spec.P2PV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewOffChainReportingSpec(spec *job.OCROracleSpec) *OffChainReportingSpec {\n\treturn &OffChainReportingSpec{\n\t\tContractAddress: spec.ContractAddress,\n\t\tP2PBootstrapPeers: spec.P2PBootstrapPeers,\n\t\tP2PV2Bootstrappers: spec.P2PV2B...
[ "0.74342453", "0.7407351", "0.5452599", "0.52549857", "0.5217595", "0.4960075", "0.48198467", "0.4791364", "0.4668639", "0.46265647", "0.46166524", "0.46087602", "0.46001962", "0.4571639", "0.45662475", "0.4562123", "0.45615572", "0.45457885", "0.4515329", "0.451332", "0.4507...
0.7729383
0
NewPipelineSpec generates a new PipelineSpec from a pipeline.Spec
func NewPipelineSpec(spec *pipeline.Spec) PipelineSpec { return PipelineSpec{ ID: spec.ID, JobID: spec.JobID, DotDAGSource: spec.DotDagSource, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewPipelineSpec(spec *pipeline.Spec) PipelineSpec {\n\treturn PipelineSpec{\n\t\tID: spec.ID,\n\t\tDotDAGSource: spec.DotDagSource,\n\t}\n}", "func (in *PipelineSpec) DeepCopy() *PipelineSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(PipelineSpec)\n\tin.DeepCopyInto(out)\n\treturn out...
[ "0.82939947", "0.7002424", "0.7002424", "0.7002424", "0.6526051", "0.636503", "0.6136273", "0.611253", "0.5635833", "0.56107116", "0.553662", "0.53617257", "0.5338917", "0.531994", "0.5294855", "0.527345", "0.5272532", "0.5264014", "0.52633154", "0.5214412", "0.52054584", "...
0.8225763
1
NewKeeperSpec generates a new KeeperSpec from a job.KeeperSpec
func NewKeeperSpec(spec *job.KeeperSpec) *KeeperSpec { return &KeeperSpec{ ContractAddress: spec.ContractAddress, FromAddress: spec.FromAddress, CreatedAt: spec.CreatedAt, UpdatedAt: spec.UpdatedAt, EVMChainID: spec.EVMChainID, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewKeeperSpec(spec *job.KeeperSpec) *KeeperSpec {\n\treturn &KeeperSpec{\n\t\tContractAddress: spec.ContractAddress,\n\t\tFromAddress: spec.FromAddress,\n\t\tCreatedAt: spec.CreatedAt,\n\t\tUpdatedAt: spec.UpdatedAt,\n\t}\n}", "func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, pk ProtocolKe...
[ "0.81380135", "0.642263", "0.6284003", "0.61777276", "0.61743927", "0.6154568", "0.6145337", "0.61207503", "0.61089283", "0.6068348", "0.6050417", "0.60409606", "0.6033205", "0.5995373", "0.59891766", "0.5973247", "0.59710914", "0.5970534", "0.59357965", "0.5931972", "0.59264...
0.810713
1
NewWebhookSpec generates a new WebhookSpec from a job.WebhookSpec
func NewWebhookSpec(spec *job.WebhookSpec) *WebhookSpec { return &WebhookSpec{ CreatedAt: spec.CreatedAt, UpdatedAt: spec.UpdatedAt, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewWebhook(timeout time.Duration) filters.Spec {\n\treturn WebhookWithOptions(WebhookOptions{Timeout: timeout, Tracer: opentracing.NoopTracer{}})\n}", "func (in *GitHubWebhookSpec) DeepCopy() *GitHubWebhookSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(GitHubWebhookSpec)\n\tin.DeepCopyInto(out)...
[ "0.62817883", "0.60171837", "0.5866091", "0.5728155", "0.5688821", "0.5654436", "0.56526816", "0.55921936", "0.55623686", "0.55391085", "0.548519", "0.5471916", "0.5470614", "0.54071194", "0.5395845", "0.5376193", "0.5341764", "0.5336821", "0.53300333", "0.53069496", "0.52973...
0.8407555
0
NewCronSpec generates a new CronSpec from a job.CronSpec
func NewCronSpec(spec *job.CronSpec) *CronSpec { return &CronSpec{ CronSchedule: spec.CronSchedule, CreatedAt: spec.CreatedAt, UpdatedAt: spec.UpdatedAt, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCronFromJobSpec(\n\tjobSpec job.Job,\n\tpipelineRunner pipeline.Runner,\n) (*Cron, error) {\n\n\tcronSpec := jobSpec.CronSpec\n\tspec := jobSpec.PipelineSpec\n\n\tcronLogger := logger.CreateLogger(\n\t\tlogger.Default.With(\n\t\t\t\"jobID\", jobSpec.ID,\n\t\t\t\"schedule\", cronSpec.CronSchedule,\n\t\t),\n...
[ "0.74659383", "0.6873497", "0.6515948", "0.64865166", "0.64812636", "0.6299038", "0.62634075", "0.62484765", "0.60576093", "0.5970894", "0.59279096", "0.5879235", "0.58560973", "0.57060903", "0.56286716", "0.5588584", "0.55848086", "0.557354", "0.5539054", "0.55289936", "0.54...
0.81789845
0
NewBlockhashStoreSpec creates a new BlockhashStoreSpec for the given parameters.
func NewBlockhashStoreSpec(spec *job.BlockhashStoreSpec) *BlockhashStoreSpec { return &BlockhashStoreSpec{ CoordinatorV1Address: spec.CoordinatorV1Address, CoordinatorV2Address: spec.CoordinatorV2Address, CoordinatorV2PlusAddress: spec.CoordinatorV2PlusAddress, WaitBlocks: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newMockBlockHeaderStore() *mockBlockHeaderStore {\n\treturn &mockBlockHeaderStore{\n\t\theaders: make(map[chainhash.Hash]wire.BlockHeader),\n\t\theights: make(map[uint32]wire.BlockHeader),\n\t}\n}", "func newChainStore(r repo.Repo, genTS *types.TipSet) *CborBlockStore {\n\ttempBlock := r.Datastore()\n\tcbor...
[ "0.6099992", "0.56509185", "0.55223393", "0.5484488", "0.5479262", "0.5428878", "0.5401267", "0.5392514", "0.5379299", "0.53530794", "0.5318673", "0.52941626", "0.52702796", "0.52518064", "0.52428454", "0.5215994", "0.52090174", "0.5206185", "0.51709896", "0.5166824", "0.5156...
0.7850846
0
NewBlockHeaderFeederSpec creates a new BlockHeaderFeederSpec for the given parameters.
func NewBlockHeaderFeederSpec(spec *job.BlockHeaderFeederSpec) *BlockHeaderFeederSpec { return &BlockHeaderFeederSpec{ CoordinatorV1Address: spec.CoordinatorV1Address, CoordinatorV2Address: spec.CoordinatorV2Address, CoordinatorV2PlusAddress: spec.CoordinatorV2PlusAddress, WaitBlocks: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (_Rootchain *RootchainFilterer) FilterNewHeaderBlock(opts *bind.FilterOpts, proposer []common.Address, headerBlockId []*big.Int, reward []*big.Int) (*RootchainNewHeaderBlockIterator, error) {\n\n\tvar proposerRule []interface{}\n\tfor _, proposerItem := range proposer {\n\t\tproposerRule = append(proposerRule...
[ "0.56433254", "0.53405935", "0.5309693", "0.52485263", "0.5207438", "0.52066755", "0.5181882", "0.51282775", "0.5117454", "0.50633496", "0.5005211", "0.4995157", "0.49901152", "0.4985155", "0.4977487", "0.49115044", "0.4903588", "0.4873314", "0.48645684", "0.48605022", "0.485...
0.7923484
0
NewBootstrapSpec initializes a new BootstrapSpec from a job.BootstrapSpec
func NewBootstrapSpec(spec *job.BootstrapSpec) *BootstrapSpec { return &BootstrapSpec{ ContractID: spec.ContractID, Relay: spec.Relay, RelayConfig: spec.RelayConfig, BlockchainTimeout: spec.BlockchainTimeout, ContractCon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newBootstrapTemplate(e2eCtx *E2EContext) *cfn_bootstrap.Template {\n\tBy(\"Creating a bootstrap AWSIAMConfiguration\")\n\tt := cfn_bootstrap.NewTemplate()\n\tt.Spec.BootstrapUser.Enable = true\n\tt.Spec.SecureSecretsBackends = []v1alpha3.SecretBackend{\n\t\tv1alpha3.SecretBackendSecretsManager,\n\t\tv1alpha3....
[ "0.5944629", "0.5933648", "0.59169173", "0.56426483", "0.5536578", "0.5498435", "0.54153734", "0.5258806", "0.51931775", "0.5177603", "0.514529", "0.5142841", "0.5117338", "0.5056667", "0.50183445", "0.5017194", "0.49952316", "0.49911648", "0.49311557", "0.49291143", "0.49195...
0.7841147
0
NewJobResource initializes a new JSONAPI job resource
func NewJobResource(j job.Job) *JobResource { resource := &JobResource{ JAID: NewJAIDInt32(j.ID), Name: j.Name.ValueOrZero(), Type: JobSpecType(j.Type), SchemaVersion: j.SchemaVersion, GasLimit: j.GasLimit, ForwardingAllowed: j.ForwardingAllowed, MaxTas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewJobResource(j job.Job) *JobResource {\n\tresource := &JobResource{\n\t\tJAID: NewJAIDInt32(j.ID),\n\t\tName: j.Name.ValueOrZero(),\n\t\tType: JobSpecType(j.Type),\n\t\tSchemaVersion: j.SchemaVersion,\n\t\tMaxTaskDuration: j.MaxTaskDuration,\n\t\tPipelineSpec: NewPipeli...
[ "0.71115786", "0.6927896", "0.68013906", "0.6778276", "0.67617893", "0.6550171", "0.6489", "0.63859403", "0.63677716", "0.6361811", "0.63571984", "0.63510984", "0.634167", "0.6319448", "0.63165826", "0.62932074", "0.6272358", "0.62598807", "0.6237205", "0.6236662", "0.6225984...
0.7175808
0
GetName implements the api2go EntityNamer interface
func (r JobResource) GetName() string { return "jobs" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (x ExternalEntity) GetName() string {\n\treturn x.Name\n}", "func (x GenericEntity) GetName() string {\n\treturn x.Name\n}", "func (x DashboardEntity) GetName() string {\n\treturn x.Name\n}", "func (x ApmDatabaseInstanceEntity) GetName() string {\n\treturn x.Name\n}", "func (x ApmApplicationEntity) Ge...
[ "0.72349846", "0.72203386", "0.7149104", "0.7125047", "0.7036643", "0.6993078", "0.6991599", "0.68841416", "0.686844", "0.6778971", "0.67610085", "0.6752631", "0.67306346", "0.6612504", "0.6607173", "0.6597457", "0.6588913", "0.65749925", "0.6517986", "0.65003", "0.64853036",...
0.0
-1
WithGroupIDConsumerOption provides an option to modify the GroupID for a consumer Group
func WithGroupIDConsumerOption(groupID string) ConsumerOption { return func(c *Consumer) { c.config.GroupID = groupID } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithConsumerGroupID(groupID string) ConfigOpt {\n\treturn func(c *kafkalib.ConfigMap) {\n\t\t_ = c.SetKey(\"group.id\", groupID)\n\t}\n}", "func ConsumerSetGroupID(groupID string) model.Option {\n\treturn model.FuncOption(func(d *model.Dispatcher) { d.ConsumerGroupID = groupID })\n}", "func DeliverGroup(g...
[ "0.802058", "0.7819796", "0.61697775", "0.60025406", "0.5875389", "0.58104455", "0.57588154", "0.5694752", "0.5690244", "0.56404895", "0.5616615", "0.55349314", "0.55349314", "0.5481481", "0.5397696", "0.53932905", "0.53766704", "0.53226244", "0.5288298", "0.5288043", "0.5282...
0.82104796
0
WithTopicConsumerOption provides an option to modify the topic on which the Consumer will listen to
func WithTopicConsumerOption(topic string) ConsumerOption { return func(c *Consumer) { c.config.Topic = topic } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Consumer) SetTopic(topic string) *Consumer {\n\tif topic != \"\" {\n\t\tc.mutex.Lock()\n\t\tc.bind.SetKey(topic)\n\t\tc.mutex.Unlock()\n\t\tc.SetQueueName(true, \"\")\n\t\tc.SetChannelKey(true, \"\")\n\t}\n\treturn c\n}", "func WithTopic(ctx context.Context, topic string) context.Context {\n\treturn con...
[ "0.6210682", "0.6181558", "0.5921562", "0.57679456", "0.57265645", "0.5627791", "0.56116796", "0.56046695", "0.5534199", "0.5490605", "0.5454656", "0.54239225", "0.5391212", "0.5385388", "0.53655887", "0.5318569", "0.53060013", "0.52522916", "0.5226082", "0.5217438", "0.51836...
0.79187584
0
WithMaxMinByteConsumerOption provides an option to modify the min/max byte that can written to kafka
func WithMaxMinByteConsumerOption(min, max int) ConsumerOption { return func(c *Consumer) { c.config.MinBytes = min c.config.MaxBytes = max } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithMaxBytes(maxBytes int) ProducerOption {\n\treturn func(p *ProducerConfiguration) {\n\t\t_ = p.KafkaConfig.SetKey(\"message.max.bytes\", maxBytes)\n\t}\n}", "func MaxRequestMaxBytes(max int) ConsumerOption {\n\treturn func(o *api.ConsumerConfig) error {\n\t\to.MaxRequestMaxBytes = max\n\t\treturn nil\n\t...
[ "0.6460316", "0.6222933", "0.57933277", "0.5723617", "0.5691092", "0.55269736", "0.5415435", "0.52666736", "0.5261587", "0.5226586", "0.52105325", "0.5204843", "0.51837397", "0.5139786", "0.5101226", "0.5093622", "0.5091504", "0.50828505", "0.50730497", "0.50669616", "0.50474...
0.811482
0
WithAutoCommitConsumerOption sets the autocommit property of consumer
func WithAutoCommitConsumerOption(flag bool) ConsumerOption { return func(c *Consumer) { c.autocommit = flag } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithAutoCommitTimeConsumerOption(dur time.Duration) ConsumerOption {\n\treturn func(c *Consumer) { c.config.CommitInterval = dur }\n}", "func (m *Eth) AutoCommit(toggle bool) {\n\tif toggle {\n\t\tm.StartMining()\n\t} else {\n\t\tm.StopMining()\n\t}\n}", "func CommitSync() OptionFunc {\n\treturn func(c *C...
[ "0.7708878", "0.62646776", "0.5866283", "0.5665535", "0.5649291", "0.56325513", "0.5467695", "0.5445847", "0.5381265", "0.53750414", "0.5210893", "0.5156814", "0.51398385", "0.51015705", "0.5085359", "0.49919894", "0.49556273", "0.48541895", "0.48460233", "0.4829172", "0.4811...
0.88928133
0
WithAutoCommitTimeConsumerOption sets the auto commit time for Consumer
func WithAutoCommitTimeConsumerOption(dur time.Duration) ConsumerOption { return func(c *Consumer) { c.config.CommitInterval = dur } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithAutoCommitConsumerOption(flag bool) ConsumerOption {\n\treturn func(c *Consumer) { c.autocommit = flag }\n}", "func (m *Eth) AutoCommit(toggle bool) {\n\tif toggle {\n\t\tm.StartMining()\n\t} else {\n\t\tm.StopMining()\n\t}\n}", "func AutoCheckpoint(interval time.Duration) ConsumerOption {\n\treturn f...
[ "0.80161095", "0.5698739", "0.56289744", "0.55272317", "0.5302148", "0.52034277", "0.5149862", "0.5130434", "0.5120156", "0.5006398", "0.4895261", "0.48788273", "0.47227955", "0.47208133", "0.47032696", "0.46719334", "0.46237248", "0.46131718", "0.45893103", "0.45277336", "0....
0.8712708
0
WithDecoderConsumerOption sets the decoder for the Consumer Message
func WithDecoderConsumerOption(fn Decoder) ConsumerOption { return func(c *Consumer) { c.dec = fn } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithReaderConsumerOption(reader *kafgo.Reader) ConsumerOption {\n\treturn func(c *Consumer) { c.reader = reader }\n}", "func WithDecoder(key string, dec func(body io.ReadCloser) (io.ReadCloser, error)) ToServerOption {\n\treturn func(opts *toServerOptions) {\n\t\tif opts.decoders == nil {\n\t\t\topts.decode...
[ "0.6346354", "0.57452494", "0.5407947", "0.53981495", "0.539218", "0.53732616", "0.53729", "0.52718526", "0.5188233", "0.51518285", "0.510901", "0.50905174", "0.49296317", "0.49056286", "0.48400813", "0.48395008", "0.48391026", "0.4833951", "0.48156092", "0.479748", "0.478445...
0.83780915
0
WithBeforeFuncsConsumerOption provides a way to set BeforeFunc(s) to the consumer
func WithBeforeFuncsConsumerOption(fns ...BeforeFunc) ConsumerOption { return func(c *Consumer) { c.befores = append(c.befores, fns...) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithAfterFuncsConsumerOption(fns ...AfterFunc) ConsumerOption {\n\treturn func(c *Consumer) { c.afters = append(c.afters, fns...) }\n}", "func (response *Response) Before(fn func()) {\n\tresponse.beforeFuncs = append(response.beforeFuncs, fn)\n}", "func BeforeStart(fn func(context.Context) error) Option {...
[ "0.6618595", "0.5789044", "0.57522064", "0.5682141", "0.56307137", "0.54601324", "0.5457689", "0.54529136", "0.5351939", "0.52193326", "0.5124414", "0.50656784", "0.50458676", "0.49094933", "0.48592332", "0.4859097", "0.48306805", "0.48134655", "0.4813117", "0.48100883", "0.4...
0.87780225
0
WithAfterFuncsConsumerOption provides a way to set AfterFunc(s) to the consumer
func WithAfterFuncsConsumerOption(fns ...AfterFunc) ConsumerOption { return func(c *Consumer) { c.afters = append(c.afters, fns...) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithBeforeFuncsConsumerOption(fns ...BeforeFunc) ConsumerOption {\n\treturn func(c *Consumer) { c.befores = append(c.befores, fns...) }\n}", "func (response *Response) After(fn func()) {\n\tresponse.afterFuncs = append(response.afterFuncs, fn)\n}", "func After(routines []func(), callback func()) {\n\tvar ...
[ "0.7024639", "0.6065201", "0.5984738", "0.5939588", "0.58868283", "0.5807153", "0.5745618", "0.5697903", "0.5637532", "0.5575202", "0.55675274", "0.55618495", "0.54770416", "0.5417393", "0.53260213", "0.52852386", "0.5212502", "0.51372826", "0.5116915", "0.5115929", "0.511328...
0.87876165
0
WithEndpointConsumerOption provides a way to set endpoint to the consumer
func WithEndpointConsumerOption(end endpoint.Endpoint) ConsumerOption { return func(c *Consumer) { c.end = end } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithEndpoint(e string) Option {\n\treturn func(o *Options) {\n\t\to.Endpoint = e\n\t}\n}", "func WithEndpoint(endpoint string) Option {\n\treturn wrappedOption{oconf.WithEndpoint(endpoint)}\n}", "func WithEndpoint(endpoint string) Option {\n\treturn func(o *options) {\n\t\to.endpoint = endpoint\n\t}\n}", ...
[ "0.70915824", "0.7042524", "0.69967586", "0.6994163", "0.6945915", "0.6737613", "0.67196137", "0.661804", "0.6488725", "0.6401157", "0.61127394", "0.6109585", "0.60376006", "0.60001093", "0.60001093", "0.59774673", "0.5949713", "0.58298445", "0.57701105", "0.57417226", "0.573...
0.8235426
0
WithReaderConsumerOption lets you set the reader for kafka
func WithReaderConsumerOption(reader *kafgo.Reader) ConsumerOption { return func(c *Consumer) { c.reader = reader } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ConsumerReader(r StreamReader) ConsumerOptionsFn {\n\treturn func(o *Consumer) error {\n\t\to.reader = r\n\t\treturn nil\n\t}\n}", "func WithReader(r reader.Reader) Option {\n\treturn func(o *Options) {\n\t\to.Reader = r\n\t}\n}", "func WithReader(r reader.Reader) loader.Option {\n\treturn func(o *loader....
[ "0.721365", "0.63954514", "0.612182", "0.60554236", "0.5910244", "0.58986294", "0.56332886", "0.5478815", "0.54349446", "0.5386139", "0.52661705", "0.52229625", "0.52031034", "0.5185453", "0.51728", "0.5157714", "0.51267815", "0.51030433", "0.5096483", "0.50594753", "0.501666...
0.84777284
0
WithOffsetConsumerOption lets you set the kafka offset to read from
func WithOffsetConsumerOption(offset int64) ConsumerOption { return func(c *Consumer) { switch offset { case LastOffset: c.config.StartOffset = LastOffset case FirstOffset: c.config.StartOffset = FirstOffset default: c.config.StartOffset = FirstOffset } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (_options *ListTopicsOptions) SetOffset(offset int64) *ListTopicsOptions {\n\t_options.Offset = core.Int64Ptr(offset)\n\treturn _options\n}", "func WithOffset(offset int) eventsource.QueryOption {\n\treturn func(i interface{}) {\n\t\tif o, ok := i.(*options); ok {\n\t\t\to.offset = &offset\n\t\t}\n\t}\n}", ...
[ "0.65632766", "0.63940036", "0.6103379", "0.6010719", "0.5940324", "0.59126174", "0.59043145", "0.5897389", "0.58670217", "0.5842533", "0.5818599", "0.5817295", "0.58023596", "0.5781974", "0.5693429", "0.5672001", "0.5663549", "0.565853", "0.5648319", "0.56464297", "0.5642492...
0.8170133
0
Open actually handles the subcriber messages
func (c *Consumer) Open() error { if c.reader == nil { c.reader = kafgo.NewReader(*c.config) } for { // start a new context var ( ctx = context.Background() msg kafgo.Message err error ) if c.autocommit { msg, err = c.reader.ReadMessage(ctx) } else { msg, err = c.reader.FetchMessage(ctx)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (core *Core) handleOpen(query *MessageQuery) {\n\n\tif verbose {\n\t\tlog.Println(\"Opening connection\")\n\t}\n\tcore.locks.AddClient(query.clt)\n}", "func (w *BaseWebsocketClient) OnOpen() {}", "func (s *BasevhdlListener) EnterFile_open_information(ctx *File_open_informationContext) {}", "func (contro...
[ "0.6114414", "0.5814772", "0.56604224", "0.5624466", "0.55345947", "0.55344206", "0.5481519", "0.5478093", "0.54761076", "0.5423344", "0.53903896", "0.53574616", "0.5348757", "0.53430444", "0.5336", "0.5325706", "0.5297685", "0.5275618", "0.52629817", "0.52551985", "0.5235657...
0.48950005
47
NewConsumer returns kafka consumer for the given brokers
func NewConsumer( brokers []string, logger log.Logger, options ...ConsumerOption, ) (*Consumer, error) { // default values cfg := kafgo.ReaderConfig{ Brokers: brokers, GroupID: defaultConsumerGroupID, Topic: defaultTopic, Logger: kafka.LoggerFunc(logger.Debugf), } cs := &Consumer{ reader: nil, co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewConsumer(addrs, zookeepers []string, group, topic string, config *Config) (*Consumer, error) {\n\tif config == nil {\n\t\tconfig = new(Config)\n\t}\n\n\tclient, err := sarama.NewClient(addrs, config.Config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc, err := NewConsumerFromClient(client, zookeepers...
[ "0.76603764", "0.7496496", "0.7483704", "0.7291043", "0.72738576", "0.7219477", "0.71694016", "0.7165526", "0.70556706", "0.69840354", "0.6961893", "0.69204885", "0.6916017", "0.6884798", "0.6840952", "0.6827434", "0.6750205", "0.66685456", "0.6647801", "0.66370124", "0.65723...
0.7759017
0
InnerJoin selects records that have matching values in both tables. left datatable is used as reference datatable. InnerJoin transforms an expr column to a raw column
func (left *DataTable) InnerJoin(right *DataTable, on []JoinOn) (*DataTable, error) { return newJoinImpl(innerJoin, []*DataTable{left, right}, on).Compute() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (self Accessor) InnerJoin(expr interface{}) *SelectManager {\n\treturn self.From(self.Relation()).InnerJoin(expr)\n}", "func (sd *SelectDataset) InnerJoin(table exp.Expression, condition exp.JoinCondition) *SelectDataset {\n\treturn sd.joinTable(exp.NewConditionedJoinExpression(exp.InnerJoinType, table, con...
[ "0.66318774", "0.66049737", "0.63518083", "0.6313514", "0.6241781", "0.5914187", "0.58916134", "0.58709943", "0.57758653", "0.573988", "0.5735636", "0.56673557", "0.56110114", "0.55918485", "0.5525171", "0.5516812", "0.5477167", "0.54671127", "0.5388112", "0.5373619", "0.5368...
0.66840595
0
InnerJoin selects records that have matching values in both tables. tables[0] is used as reference datatable.
func InnerJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) { return newJoinImpl(innerJoin, tables, on).Compute() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (left *DataTable) InnerJoin(right *DataTable, on []JoinOn) (*DataTable, error) {\n\treturn newJoinImpl(innerJoin, []*DataTable{left, right}, on).Compute()\n}", "func (sd *SelectDataset) InnerJoin(table exp.Expression, condition exp.JoinCondition) *SelectDataset {\n\treturn sd.joinTable(exp.NewConditionedJoi...
[ "0.6751454", "0.65702766", "0.64586174", "0.6028002", "0.60178965", "0.59976506", "0.597665", "0.59714115", "0.59106946", "0.58595383", "0.58453965", "0.57453084", "0.56433755", "0.5607307", "0.56053597", "0.55745494", "0.5502053", "0.54919076", "0.54228294", "0.5411585", "0....
0.7018755
0
LeftJoin returns all records from the left table (table1), and the matched records from the right table (table2). The result is NULL from the right side, if there is no match. LeftJoin transforms an expr column to a raw column
func (left *DataTable) LeftJoin(right *DataTable, on []JoinOn) (*DataTable, error) { return newJoinImpl(leftJoin, []*DataTable{left, right}, on).Compute() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (stmt *statement) LeftJoin(table, on string) Statement {\n\tstmt.join(\"LEFT JOIN \", table, on)\n\treturn stmt\n}", "func (w *Wrapper) LeftJoin(table interface{}, condition string) *Wrapper {\n\tw.saveJoin(table, \"LEFT JOIN\", condition)\n\treturn w\n}", "func LeftJoin(tables []*DataTable, on []JoinOn) ...
[ "0.72299886", "0.70459723", "0.704144", "0.70356774", "0.686112", "0.68354493", "0.67730963", "0.67380315", "0.66573316", "0.65042645", "0.65006894", "0.64356035", "0.64321244", "0.64166707", "0.6370883", "0.6337108", "0.6249756", "0.62033296", "0.60057163", "0.5978834", "0.5...
0.7001835
4
LeftJoin the tables. tables[0] is used as reference datatable.
func LeftJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) { return newJoinImpl(leftJoin, tables, on).Compute() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (stmt *statement) LeftJoin(table, on string) Statement {\n\tstmt.join(\"LEFT JOIN \", table, on)\n\treturn stmt\n}", "func (left *DataTable) LeftJoin(right *DataTable, on []JoinOn) (*DataTable, error) {\n\treturn newJoinImpl(leftJoin, []*DataTable{left, right}, on).Compute()\n}", "func (w *Wrapper) LeftJo...
[ "0.7873163", "0.76610047", "0.7514192", "0.7485381", "0.7484619", "0.7296211", "0.7200829", "0.7158153", "0.7113473", "0.71128154", "0.66189706", "0.6592026", "0.65634686", "0.6533419", "0.6475337", "0.6456779", "0.64426446", "0.63812834", "0.6122921", "0.60929805", "0.607487...
0.8205081
0
RightJoin returns all records from the right table (table2), and the matched records from the left table (table1). The result is NULL from the left side, when there is no match. RightJoin transforms an expr column to a raw column
func (left *DataTable) RightJoin(right *DataTable, on []JoinOn) (*DataTable, error) { return newJoinImpl(rightJoin, []*DataTable{left, right}, on).Compute() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (stmt *statement) RightJoin(table, on string) Statement {\n\tstmt.join(\"RIGHT JOIN \", table, on)\n\treturn stmt\n}", "func (w *Wrapper) RightJoin(table interface{}, condition string) *Wrapper {\n\tw.saveJoin(table, \"RIGHT JOIN\", condition)\n\treturn w\n}", "func (sd *SelectDataset) RightJoin(table exp...
[ "0.7628548", "0.7389646", "0.7321759", "0.72971517", "0.7130319", "0.7081261", "0.7040699", "0.69593596", "0.69572276", "0.6703606", "0.6688393", "0.6547884", "0.65122604", "0.64553106", "0.6415866", "0.60450983", "0.5878921", "0.58000296", "0.50920373", "0.5038833", "0.50008...
0.7296182
4
RightJoin the tables. tables[0] is used as reference datatable.
func RightJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) { return newJoinImpl(rightJoin, tables, on).Compute() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (stmt *statement) RightJoin(table, on string) Statement {\n\tstmt.join(\"RIGHT JOIN \", table, on)\n\treturn stmt\n}", "func (left *DataTable) RightJoin(right *DataTable, on []JoinOn) (*DataTable, error) {\n\treturn newJoinImpl(rightJoin, []*DataTable{left, right}, on).Compute()\n}", "func (w *Wrapper) Ri...
[ "0.78055537", "0.7420944", "0.741076", "0.7111573", "0.7041436", "0.69916314", "0.6970857", "0.68913996", "0.68234277", "0.6683218", "0.6154301", "0.61236024", "0.61003006", "0.6057328", "0.6012464", "0.6009745", "0.5808238", "0.5495906", "0.53983474", "0.51418346", "0.513336...
0.7857376
0
OuterJoin returns all records when there is a match in either left or right table OuterJoin transforms an expr column to a raw column
func (left *DataTable) OuterJoin(right *DataTable, on []JoinOn) (*DataTable, error) { return newJoinImpl(outerJoin, []*DataTable{left, right}, on).Compute() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (self Accessor) OuterJoin(expr interface{}) *SelectManager {\n\treturn self.From(self.Relation()).OuterJoin(expr)\n}", "func OuterJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) {\n\treturn newJoinImpl(outerJoin, tables, on).Compute()\n}", "func OuterJoin(lx, rx reflect.Value) reflect.Value {\n...
[ "0.7141362", "0.6283584", "0.61286354", "0.6114805", "0.58095336", "0.5579841", "0.5528286", "0.54351157", "0.5422068", "0.53262335", "0.5302064", "0.5258188", "0.5202978", "0.51721895", "0.5171185", "0.51176786", "0.51153624", "0.50725424", "0.504998", "0.5015528", "0.500765...
0.6004231
4
OuterJoin the tables. tables[0] is used as reference datatable.
func OuterJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) { return newJoinImpl(outerJoin, tables, on).Compute() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (left *DataTable) OuterJoin(right *DataTable, on []JoinOn) (*DataTable, error) {\n\treturn newJoinImpl(outerJoin, []*DataTable{left, right}, on).Compute()\n}", "func (mySelf SQLJoin) Outer() SQLJoin {\n\tmySelf.outer = true\n\treturn mySelf\n}", "func (sd *SelectDataset) FullOuterJoin(table exp.Expression...
[ "0.72591054", "0.6385042", "0.6179653", "0.60917306", "0.5798085", "0.56046575", "0.5532318", "0.5531475", "0.5526659", "0.5441862", "0.52743226", "0.5258402", "0.5223004", "0.5183927", "0.51464397", "0.5036838", "0.49458668", "0.49448958", "0.4925887", "0.4893099", "0.488200...
0.7889248
0
On creates a "join on" expression ie, as SQL, SELECT FROM A INNER JOIN B ON B.id = A.user_id Syntax: "[table].[field]", "field"
func On(fields ...string) []JoinOn { var jon []JoinOn for _, f := range fields { matches := rgOn.FindStringSubmatch(f) switch len(matches) { case 0: jon = append(jon, JoinOn{Table: "*", Field: f}) case 3: t := matches[1] if len(t) == 0 { t = "*" } jon = append(jon, JoinOn{Table: t, Field: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewInnerJoinOn(table string, from string, to string) JoinQuery {\n\treturn NewJoinWith(\"INNER JOIN\", table, from, to)\n}", "func NewJoinOn(table string, from string, to string, filter ...FilterQuery) JoinQuery {\n\treturn NewJoinWith(\"JOIN\", table, from, to, filter...)\n}", "func NewJoinOn(table strin...
[ "0.68034065", "0.6787461", "0.6781993", "0.67451125", "0.6543356", "0.6212595", "0.61956203", "0.6015106", "0.59313536", "0.5923219", "0.5879308", "0.5878465", "0.5866631", "0.58613676", "0.5822869", "0.5781752", "0.5721144", "0.57195073", "0.5690846", "0.56610715", "0.566037...
0.61027235
7
Using creates a "join using" expression ie, as SQL, SELECT FROM A INNER JOIN B USING 'field'
func Using(fields ...string) []JoinOn { var jon []JoinOn for _, f := range fields { jon = append(jon, JoinOn{Table: "*", Field: f}) } return jon }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (mySelf SQLJoin) Using(column SQLColumn) SQLJoin {\n\tmySelf.using = column\n\treturn mySelf\n}", "func (b *JoinBuilder) Using(cols ...interface{}) *JoinBuilder {\n\tvar vals Columns\n\tfor _, c := range cols {\n\t\tvar name string\n\t\tswitch t := c.(type) {\n\t\tcase string:\n\t\t\tname = t\n\t\tcase ValE...
[ "0.7300421", "0.7030628", "0.695963", "0.63989073", "0.62903017", "0.6052447", "0.60412854", "0.59246576", "0.56960696", "0.5692112", "0.56797403", "0.5607766", "0.55761683", "0.5556999", "0.5433705", "0.53773844", "0.5347844", "0.5342743", "0.5314456", "0.5305886", "0.529641...
0.67135864
3
GetOrders retrieves paginated orders from the Mesh DB at a specific snapshot in time. Passing an empty string as `snapshotID` creates a new snapshot and returns the first set of results. To fetch all orders, continue to make requests supplying the `snapshotID` returned from the first request. After 1 minute of not rece...
func (app *App) GetOrders(page, perPage int, snapshotID string) (*rpc.GetOrdersResponse, error) { ordersInfos := []*zeroex.AcceptedOrderInfo{} if perPage <= 0 { return &rpc.GetOrdersResponse{ OrdersInfos: ordersInfos, SnapshotID: snapshotID, }, nil } var snapshot *db.Snapshot if snapshotID == "" { //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetOrders(c *gin.Context) {\n\tid := c.Params.ByName(\"id\")\n\n\tif id == \"\" {\n\t\terrors.ErrRequiredParam(c.Writer, http.StatusBadRequest, \"order id is required\")\n\t\treturn\n\t}\n\n\torder, err := s.client.GetOrder(id)\n\tif err != nil {\n\t\ts.l.Printf(\"failed to request order information: %s\\n\",...
[ "0.62642765", "0.6221663", "0.6110406", "0.6087194", "0.60676306", "0.6066977", "0.58781767", "0.5827594", "0.57684326", "0.57366395", "0.5724347", "0.57100785", "0.570299", "0.56688213", "0.56568563", "0.56561035", "0.56210774", "0.55994815", "0.559785", "0.55757976", "0.557...
0.8332623
0
AddOrders can be used to add orders to Mesh. It validates the given orders and if they are valid, will store and eventually broadcast the orders to peers.
func (app *App) AddOrders(signedOrdersRaw []*json.RawMessage) (*zeroex.ValidationResults, error) { allValidationResults := &zeroex.ValidationResults{ Accepted: []*zeroex.AcceptedOrderInfo{}, Rejected: []*zeroex.RejectedOrderInfo{}, } schemaValidOrders := []*zeroex.SignedOrder{} for _, signedOrderRaw := range si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (handler *rpcHandler) AddOrders(orders []*zeroex.SignedOrder) (*zeroex.ValidationResults, error) {\n\tlog.Debug(\"received AddOrders request via RPC\")\n\tvalidationResults, err := handler.app.AddOrders(orders)\n\tif err != nil {\n\t\t// We don't want to leak internal error details to the RPC client.\n\t\tlog...
[ "0.8132826", "0.7341831", "0.6482184", "0.64495546", "0.6072182", "0.60590833", "0.6049601", "0.6042386", "0.5945999", "0.5942374", "0.5904764", "0.5832294", "0.58172303", "0.57699704", "0.5737549", "0.57374513", "0.5730064", "0.5726372", "0.5662563", "0.56367064", "0.5607419...
0.7472578
1
AddPeer can be used to manually connect to a new peer.
func (app *App) AddPeer(peerInfo peerstore.PeerInfo) error { ctx, cancel := context.WithTimeout(context.Background(), peerConnectTimeout) defer cancel() return app.node.Connect(ctx, peerInfo) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func AddPeer(w http.ResponseWriter, r *http.Request) {\n\t// Connect to the peer\n\tvar newPeers peerStr\n\n\terr := json.NewDecoder(r.Body).Decode(&newPeers)\n\tif err != nil {\n\t\tlog.Println(\"AddPeer: could not decode peer\")\n\t}\n\tlog.Println(newPeers)\n\tlog.Printf(\"AddPeer: adding=%s\", newPeers.Peer)\n...
[ "0.8037111", "0.7986729", "0.7840991", "0.77524346", "0.7725641", "0.7709996", "0.76176715", "0.7593478", "0.73779005", "0.73482287", "0.7329669", "0.7313278", "0.7286379", "0.7278531", "0.7213862", "0.71712655", "0.71476495", "0.7099289", "0.7071857", "0.70617026", "0.705819...
0.81139016
0
SubscribeToOrderEvents let's one subscribe to order events emitted by the OrderWatcher
func (app *App) SubscribeToOrderEvents(sink chan<- []*zeroex.OrderEvent) event.Subscription { subscription := app.orderWatcher.Subscribe(sink) return subscription }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (handler *rpcHandler) SubscribeToOrders(ctx context.Context) (*ethRpc.Subscription, error) {\n\tlog.Debug(\"received order event subscription request via RPC\")\n\tsubscription, err := SetupOrderStream(ctx, handler.app)\n\tif err != nil {\n\t\tlog.WithField(\"error\", err.Error()).Error(\"internal error in `m...
[ "0.6924018", "0.6784168", "0.6600295", "0.6304606", "0.59060335", "0.5901376", "0.58783144", "0.58025783", "0.56605494", "0.5610966", "0.55999756", "0.55674213", "0.5540953", "0.55338764", "0.5472549", "0.5441667", "0.53214586", "0.52938116", "0.52710706", "0.5252714", "0.525...
0.80939853
0
Close closes the app
func (app *App) Close() { if err := app.node.Close(); err != nil { log.WithField("error", err.Error()).Error("error while closing node") } app.ethWatcher.Stop() if err := app.orderWatcher.Stop(); err != nil { log.WithField("error", err.Error()).Error("error while closing orderWatcher") } app.blockWatcherCance...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (v *App) Close() {\n\tif !v.opened {\n\t\treturn\n\t}\n\n\tlog.Println(\"\\nClosing App...\")\n\n\tlog.Println(\"Destroying font\")\n\tv.nFont.Destroy()\n\tlog.Println(\"Destroying text(s)\")\n\tv.txtSimStatus.Destroy()\n\t// v.dynaTxt.Destroy()\n\tv.txtActiveProperty.Destroy()\n\n\tlog.Println(\"Destroying g...
[ "0.766603", "0.7470319", "0.7057013", "0.68337286", "0.67127764", "0.6656304", "0.6617461", "0.6609202", "0.65968126", "0.6585093", "0.64652884", "0.64607316", "0.6456707", "0.6399147", "0.6339275", "0.63321006", "0.6327963", "0.62970155", "0.6246347", "0.62412775", "0.620200...
0.59153163
34
New returns wrapped go kit logger.
func New(out io.Writer) Logger { l := log.NewJSONLogger(log.NewSyncWriter(out)) l = log.With(l, "ts", log.DefaultTimestampUTC) return &logger{l} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New() logr.Logger {\n\treturn klogger{\n\t\tlevel: 0,\n\t\tprefix: \"\",\n\t\tvalues: nil,\n\t}\n}", "func New(format, level string, atomic zap.AtomicLevel) (*Logger, error) {\n\tlogFormat, err := logger.MapFormat(format)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlogLevel, err := logger.MapLevel(le...
[ "0.7956083", "0.76403785", "0.75820285", "0.7515588", "0.7464783", "0.7403431", "0.74015224", "0.73690116", "0.73249155", "0.7323101", "0.73066914", "0.7304487", "0.73012733", "0.72983545", "0.72934717", "0.72890353", "0.728749", "0.72861475", "0.72795135", "0.72777456", "0.7...
0.7361198
8
ServeHTTP populates the status page template with data and serves it when there is a request.
func (s *StatusPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if s.Authenticator != nil { _, err := s.Authenticator.Authenticate(r.Context(), w, r) if errors.Is(err, oidc.ErrRedirectRequired) { return } if err != nil { http.Error(w, "Error: Authentication failed", http.StatusInternalSer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *StatusPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tlog.Logger.Info(\"Applier status request\", \"time\", s.Clock.Now().String())\n\tif s.Template == nil {\n\t\thttp.Error(w, \"Error: Unable to load HTML template\", http.StatusInternalServerError)\n\t\tlog.Logger.Error(\"Request fail...
[ "0.76141816", "0.72446615", "0.7142075", "0.65824634", "0.65734637", "0.6462746", "0.6404384", "0.6377613", "0.63453937", "0.63208884", "0.63116246", "0.6259271", "0.62566614", "0.6254522", "0.6246605", "0.62242675", "0.6213871", "0.62105876", "0.62009305", "0.61627513", "0.6...
0.73742574
1
ServeHTTP handles requests for forcing a run by attempting to add to the runQueue, and writes a response including the result and a relevant message.
func (f *ForceRunHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { log.Logger("webserver").Info("Force run requested") var data struct { Result string `json:"result"` Message string `json:"message"` } switch r.Method { case "POST": var ( userEmail string err error ) if f.Authenti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (f *ForceRunHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tlog.Logger.Info(\"Force run requested\")\n\tvar data struct {\n\t\tResult string `json:\"result\"`\n\t\tMessage string `json:\"message\"`\n\t}\n\n\tswitch r.Method {\n\tcase \"POST\":\n\t\tselect {\n\t\tcase f.RunQueue <- true:\n\t\t...
[ "0.7462603", "0.6350784", "0.6070211", "0.59780586", "0.5962405", "0.59415954", "0.5859626", "0.57781273", "0.5730015", "0.5721918", "0.5712981", "0.56630534", "0.56535286", "0.56080145", "0.5604587", "0.5603869", "0.5594449", "0.5575713", "0.55648303", "0.5561466", "0.555710...
0.6533478
1
Start starts the webserver using the given port, and sets up handlers for: 1. Status page 2. Metrics 3. Static content 4. Endpoint for forcing a run
func (ws *WebServer) Start() error { if ws.server != nil { return fmt.Errorf("WebServer already running") } log.Logger("webserver").Info("Launching") templatePath := ws.TemplatePath if templatePath == "" { templatePath = defaultServerTemplatePath } template, err := createTemplate(templatePath) if err != n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func StartWebServer(port int) {\n\tsetuphandlers()\n\tportstring := fmt.Sprintf(\":%d\", port)\n\tfmt.Println(\"Running on \", portstring)\n\tlog.Fatal(http.ListenAndServe(portstring, nil))\n}", "func (ms *MicroService) StartOnPort(port int) {\n\n\t// add health\n\tms.Handle(\"GET\", \"/health\", ms.Health)\n\n\...
[ "0.7877176", "0.76225066", "0.75079435", "0.74484295", "0.74228203", "0.73930115", "0.7374604", "0.737105", "0.7370332", "0.73519176", "0.7309832", "0.7303029", "0.7263866", "0.7234094", "0.7230882", "0.7226243", "0.7224325", "0.71582234", "0.71568817", "0.7156688", "0.714439...
0.70987064
21
Shutdown gracefully shuts the webserver down.
func (ws *WebServer) Shutdown() error { err := ws.server.Shutdown(context.Background()) ws.server = nil return err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (sw *SimpleWebServer) Shutdown(ctx context.Context) error {\n\tif !sw.running {\n\t\treturn fmt.Errorf(\"not started\")\n\t}\n\tsw.running = false\n\treturn sw.Server.Shutdown(ctx)\n}", "func (p *Proxy) Shutdown() {\n\tlog.Info(\"Shutting down server gracefully\")\n\tclose(p.shutdown)\n\tgraceful.Shutdown()...
[ "0.7640571", "0.7272516", "0.7171907", "0.7166998", "0.7069365", "0.70634085", "0.69620883", "0.69575524", "0.69446343", "0.6941636", "0.6906725", "0.6897182", "0.6874807", "0.6861194", "0.684571", "0.6753442", "0.6734881", "0.67202586", "0.6720189", "0.6679935", "0.66797376"...
0.78245765
0
defaultConfig returns the default configs
func defaultConfig() *config { return &config{ Drop: false, RGBA: rgba{ R: 255, G: 255, B: 255, A: 1, }, Export: export{ Format: "jpeg", Quality: 85, }, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func defaultConfig() interface{} {\n\treturn &config{\n\t\tPools: make(pools),\n\t\tConfDirPath: \"/etc/cmk\",\n\t}\n}", "func defaultConfig() *config {\n\treturn &config{}\n}", "func defaultConfig() interface{} {\n\treturn &conf{\n\t\tPools: make(map[string]poolConfig),\n\t\tLabelNode: false,\n\t\tT...
[ "0.8458187", "0.8257558", "0.8144465", "0.79126495", "0.7902076", "0.7703992", "0.7674732", "0.76744676", "0.7656039", "0.75664085", "0.7556187", "0.75450176", "0.75397223", "0.7538148", "0.7524036", "0.7485726", "0.74851745", "0.74809283", "0.74773145", "0.74746037", "0.7470...
0.7397149
29
WithHTTPTimeout returns an HTTPCheckerOption that specifies the timeout for HTTP requests. Setting a timeout is highly recommended, but it needs to be carefully chosen to avoid false results.
func WithHTTPTimeout(timeout time.Duration) HTTPCheckerOption { return func(c *HTTPChecker) { c.timeout = timeout } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func HTTPTimeout(duration time.Duration) HTTPOption {\n\treturn func(c *HTTPCollector) { c.client.Timeout = duration }\n}", "func WithTimeout(t time.Duration) Option {\n\treturn func(c *Client) { c.httpClient.Timeout = t }\n}", "func OptTLSHandshakeTimeout(d time.Duration) Option {\n\treturn func(r *Request) e...
[ "0.7159275", "0.69684875", "0.6743757", "0.66001695", "0.65526265", "0.6522622", "0.64707696", "0.64276093", "0.64276093", "0.6423289", "0.6418356", "0.6373808", "0.63530564", "0.6339308", "0.63357085", "0.6263725", "0.6263725", "0.62461066", "0.6234871", "0.6172803", "0.6101...
0.8700442
0
WithHTTPMethod returns an HTTPCheckerOption that specifies the method for HTTP requests. The default method is "GET" which works in most of the cases, but another popular choice is "HEAD".
func WithHTTPMethod(method string) HTTPCheckerOption { return func(c *HTTPChecker) { c.method = method } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WithMethod(method string) Option {\n\treturn func(p *Protocol) error {\n\t\tif p == nil {\n\t\t\treturn fmt.Errorf(\"http method option can not set nil protocol\")\n\t\t}\n\t\tmethod = strings.TrimSpace(method)\n\t\tif method != \"\" {\n\t\t\tif p.RequestTemplate == nil {\n\t\t\t\tp.RequestTemplate = &nethttp...
[ "0.7333683", "0.68030214", "0.67774516", "0.6632889", "0.6376519", "0.6234125", "0.59104705", "0.57998", "0.5736446", "0.5736446", "0.5700958", "0.56578785", "0.56539893", "0.5588941", "0.55525637", "0.5535288", "0.5522277", "0.5516675", "0.5490813", "0.5489231", "0.54805845"...
0.85374355
0
NewHTTPChecker creates a new HTTPChecker with a URL and optional configuration. Example: checker := healthz.NewHTTPChecker(" healthz.WithHTTPTimeout(3time.Second))
func NewHTTPChecker(url string, opts ...HTTPCheckerOption) *HTTPChecker { checker := &HTTPChecker{ url: url, method: http.MethodGet, } for _, opt := range opts { opt(checker) } return checker }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewHTTPCheck(name, endpoint string) (Check, error) {\n\tep, err := url.Parse(endpoint)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thc := &httpCheck{\n\t\tcheck: newCheck(name, ep.Hostname(), CheckTypeHTTP),\n\t\tURL: ep.Path,\n\t}\n\n\tif ep.Scheme == \"https\" {\n\t\thc.Encryption = true\n\t}\n\n\t...
[ "0.77532184", "0.6886548", "0.6650926", "0.59350383", "0.5832938", "0.5832938", "0.57598746", "0.57598746", "0.5694342", "0.5670222", "0.5615457", "0.55585825", "0.555668", "0.5455581", "0.5411418", "0.5404947", "0.54013574", "0.5372818", "0.5300099", "0.5285249", "0.5270361"...
0.8291445
0
Check implements the Checker interface and checks the HTTP endpoint status.
func (c *HTTPChecker) Check() error { client := &http.Client{ Timeout: c.timeout, } req, err := http.NewRequest(c.method, c.url, nil) if err != nil { return err } resp, err := client.Do(req) if err != nil { return err } if resp.StatusCode != http.StatusOK { return ErrCheckFailed } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *Endpoint) Check(ctx echo.Context) error {\n\thealthData := e.service.HealthCheck()\n\n\tif !healthData.Database {\n\t\treturn ctx.JSON(http.StatusServiceUnavailable, healthData)\n\t}\n\treturn ctx.JSON(http.StatusOK, healthData)\n}", "func (h *HealthImpl) Check(ctx context.Context, req *grpc_health_v1.H...
[ "0.70563394", "0.69536537", "0.68326074", "0.6758303", "0.6734101", "0.6721828", "0.67087394", "0.66680324", "0.6665401", "0.6655878", "0.66553265", "0.6563348", "0.65447074", "0.6539294", "0.6532304", "0.65218896", "0.64806414", "0.64593005", "0.6453134", "0.6451852", "0.642...
0.76647353
0
Initialize the generator from a seed
func (m *MT) Seed(theseed int64) { // Lower 32bit seed := uint32(theseed) for m.lp = 0; m.lp < 624; m.lp++ { m.Key[m.lp] = seed seed = (uint32(1812433253)*(seed^(seed>>30)) + m.lp + 1) & 0xffffffff //m.arrayL[m.lp] = 0x6c078965*(m.arrayL[m.lp-1]^(m.arrayL[m.lp-1]>>30)) + m.lp } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Seed(seed int64) { globalRand.Seed(seed) }", "func (s CrSource) Seed(int64) {}", "func (rng *Rng) Seed(seed int64) {\n\trng.State = uint64(seed)\n}", "func (gen *CMWC) Seed(seed int64) {\n\tgen.lock.Lock()\n\tdefer gen.lock.Unlock()\n\n\tgen.c = cmwcC\n\ts := uint32(seed)\n\tfor i := 0; i < 4096; i++ {\...
[ "0.7424726", "0.73450845", "0.70709896", "0.70261484", "0.701139", "0.69750804", "0.69515306", "0.6946966", "0.69348735", "0.6905683", "0.69012666", "0.68930334", "0.6877657", "0.6824542", "0.6807385", "0.68068874", "0.6796626", "0.6760957", "0.67509663", "0.66529834", "0.661...
0.6204893
45
Given a string, this tests variants of buffer conversion: string with trailing 0's, string exactly filling the slice passed to CFieldString (simulating an exactlyfull field), and first character (exactly filling the field).
func teststring(t *testing.T, s string) { buf := toint8(s) r := kstat.CFieldString(buf[:]) if r != s { t.Fatalf("full buf mismatch: %q vs %q", s, r) } r = kstat.CFieldString(buf[:len(s)]) if r != s { t.Fatalf("exact buf mismatch: %q vs %q", s, r) } r = kstat.CFieldString(buf[:len(s)+1]) if r != s { t.Fat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestCFieldString(t *testing.T) {\n\tteststring(t, \"this is a test string\")\n\tteststring(t, \"\")\n\tbuf := toint8(\"abc\\x00def\")\n\tr := kstat.CFieldString(buf[:])\n\tif r != \"abc\" {\n\t\tt.Fatalf(\"embedded null not properly handled: %q\", r)\n\t}\n}", "func cString(b []byte) string {\n\tn := 0\n\tf...
[ "0.71062356", "0.61365825", "0.5933366", "0.5675437", "0.5614959", "0.55958104", "0.5578647", "0.55673254", "0.54978114", "0.5477876", "0.5457079", "0.5457079", "0.5457079", "0.5429246", "0.53562295", "0.5353006", "0.5353006", "0.5353006", "0.5353006", "0.53007644", "0.529628...
0.7072567
1
This function is sufficiently potentially tricky that I want to test it directly, including with some torture tests.
func TestCFieldString(t *testing.T) { teststring(t, "this is a test string") teststring(t, "") buf := toint8("abc\x00def") r := kstat.CFieldString(buf[:]) if r != "abc" { t.Fatalf("embedded null not properly handled: %q", r) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestGetNone4A(t *testing.T) {\n}", "func TestEmptyPrewrite4A(t *testing.T) {\n}", "func TestGetEmpty4A(t *testing.T) {\n}", "func TestSinglePrewrite4A(t *testing.T) {\n}", "func almostOkayFunction() {\n\treturn nil\n}", "func TestPrewriteMultiple4A(t *testing.T) {\n}", "func TestGetValueTs4A(t *te...
[ "0.58128554", "0.5600196", "0.5483316", "0.54533887", "0.53604615", "0.5296184", "0.5257959", "0.52424866", "0.5234794", "0.5217169", "0.51338357", "0.5128234", "0.50885046", "0.50372916", "0.50313133", "0.5021976", "0.50210726", "0.50012547", "0.4976728", "0.49484867", "0.49...
0.0
-1
Deprecated: Use Request.ProtoReflect.Descriptor instead.
func (*Request) Descriptor() ([]byte, []int) { return file_imgCode_proto_rawDescGZIP(), []int{0} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*ModifyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_engine_proto_rawDescGZIP(), []int{10}\n}", "func (*PatchCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{161}\n}", "func (*AddPeerRequest) Descriptor() ([]byte, []int)...
[ "0.7147806", "0.7124804", "0.70896095", "0.7056412", "0.7031377", "0.7022057", "0.6997947", "0.69858086", "0.69592947", "0.6954594", "0.69518965", "0.6942627", "0.69331664", "0.69186646", "0.6911725", "0.69091153", "0.69048876", "0.6903502", "0.6894547", "0.6889418", "0.68856...
0.0
-1
Deprecated: Use Response.ProtoReflect.Descriptor instead.
func (*Response) Descriptor() ([]byte, []int) { return file_imgCode_proto_rawDescGZIP(), []int{1} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*AddPeerResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{30}\n}", "func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateParamsResponse\n}", "func (*GetP...
[ "0.70776343", "0.7037685", "0.69777745", "0.69575745", "0.69492024", "0.6912672", "0.6911184", "0.6866258", "0.68466765", "0.68400687", "0.6833484", "0.6826143", "0.6821017", "0.68039095", "0.6800226", "0.6782455", "0.6780943", "0.67771107", "0.6770286", "0.6766262", "0.67604...
0.0
-1
Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.
func (*CheckRequest) Descriptor() ([]byte, []int) { return file_imgCode_proto_rawDescGZIP(), []int{2} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*CheckRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_api_servicecontrol_v1_service_controller_proto_rawDescGZIP(), []int{0}\n}", "func (*DescribeCheckRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_check_api_ocp_check_api_proto_rawDescGZIP(), []int{2}\n}", "func (*CheckPermi...
[ "0.7296165", "0.72562546", "0.72532135", "0.7185493", "0.7169828", "0.7153088", "0.7151416", "0.6986814", "0.69666773", "0.69412285", "0.6925985", "0.68989396", "0.68957925", "0.68830997", "0.6878103", "0.68631446", "0.68546945", "0.68501765", "0.6838815", "0.682475", "0.6823...
0.65349936
56
Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.
func (*CheckResponse) Descriptor() ([]byte, []int) { return file_imgCode_proto_rawDescGZIP(), []int{3} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (*DescribeCheckResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_check_api_ocp_check_api_proto_rawDescGZIP(), []int{3}\n}", "func (*RemoveCheckResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_check_api_ocp_check_api_proto_rawDescGZIP(), []int{11}\n}", "func (*CheckResponse) De...
[ "0.72049487", "0.71510273", "0.70745736", "0.7069298", "0.70513886", "0.7049406", "0.7048401", "0.70210135", "0.69132155", "0.6911588", "0.6868659", "0.6855346", "0.6838182", "0.68354154", "0.68328184", "0.6821605", "0.68125427", "0.6808781", "0.6804347", "0.67804843", "0.677...
0.0
-1
Open mysql connection using dsn.
func Open(dsn string) (*Adapter, error) { var err error adapter := &Adapter{sql.New("?", false, errorFunc, incrementFunc)} adapter.DB, err = db.Open("sqlite3", dsn) return adapter, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Open(user, addr, dbName string) (*sql.DB, error) {\n\tc := &mysql.Config{\n\t\tUser: user,\n\t\tNet: \"tcp\",\n\t\tAddr: addr,\n\t\tDBName: dbName,\n\t\tCollation: \"utf8mb4_bin\",\n\t\tParseTime: true,\n\t}\n\n\treturn sql.Open(\"mysql\", c.FormatDSN())\n}", "func openDB(dsn string) (*sq...
[ "0.7246999", "0.71910393", "0.7179003", "0.717448", "0.71717465", "0.71652126", "0.71652126", "0.71652126", "0.71397305", "0.7136143", "0.71265143", "0.7082557", "0.6925274", "0.69121253", "0.68631303", "0.6847047", "0.6728924", "0.67062306", "0.667542", "0.6663505", "0.65856...
0.0
-1
Updates settings for a FlexMatch matchmaking configuration. These changes affect all matches and game sessions that are created after the update. To update settings, specify the configuration name to be updated and provide the new settings. Learn more Design a FlexMatch matchmaker (
func (c *Client) UpdateMatchmakingConfiguration(ctx context.Context, params *UpdateMatchmakingConfigurationInput, optFns ...func(*Options)) (*UpdateMatchmakingConfigurationOutput, error) { if params == nil { params = &UpdateMatchmakingConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (runner *McRunner) applySettings() {\n\tpropPath := filepath.Join(McServerPath(), \"server.properties\")\n\tprops, err := ioutil.ReadFile(propPath)\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tnameExp, _ := regexp.Compile(\"displayname=.*\\\\n\")\n\tmotdExp, _ := regexp.Compile(\"motd=.*\\...
[ "0.5717687", "0.542755", "0.53194195", "0.52470493", "0.5154396", "0.5133524", "0.5035096", "0.5025223", "0.49815646", "0.48762172", "0.4805697", "0.4791137", "0.47735512", "0.47543612", "0.4748372", "0.47025505", "0.4683927", "0.46761623", "0.46550635", "0.46143624", "0.4608...
0.6018916
0
routeActiveHandler handles new route
func (rc *RouteConfig) RouteHandler(writer http.ResponseWriter, request *http.Request) { log := rc.route.Logger. WithEventSource(rc.route.EventSource.Name). WithEndpoint(rc.route.Webhook.Endpoint). WithPort(rc.route.Webhook.Port) log.Info("request received") if !helper.ActiveEndpoints[rc.route.Webhook.Endpoi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *router) handle(c *Context){\n\tn, params := r.getRoute(c.Method, c.Path)\n\tif n != nil {\n\t\tc.Params = params\n\t\t// connection between Context and Router!\n\t\t// it's important\n\t\tkey := c.Method + \"-\" + n.pattern\n\t\t// 两种函数都放到一起了\n\t\tc.handlers = append(c.handlers, r.handlers[key])\n\t\t//r....
[ "0.64635617", "0.64116824", "0.6350044", "0.62140054", "0.6200163", "0.6078606", "0.6064739", "0.60356003", "0.6023833", "0.6018736", "0.5923108", "0.59198534", "0.59184206", "0.59153384", "0.59059286", "0.58410233", "0.57837915", "0.57669526", "0.57576", "0.5736621", "0.5689...
0.5844667
15
StartEventSource starts an event source
func (ese *GitlabEventSourceExecutor) StartEventSource(eventSource *gateways.EventSource, eventStream gateways.Eventing_StartEventSourceServer) error { defer gateways.Recover(eventSource.Name) log := ese.Log.WithEventSource(eventSource.Name) log.Info("operating on event source") config, err := parseEventSource(ev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ese *SlackEventSourceExecutor) StartEventSource(eventSource *gateways.EventSource, eventStream gateways.Eventing_StartEventSourceServer) error {\n\tdefer gateways.Recover(eventSource.Name)\n\n\tlog := ese.Log.WithEventSource(eventSource.Name)\n\tlog.Info(\"operating on event source\")\n\n\tconfig, err := par...
[ "0.7883973", "0.77757585", "0.77590185", "0.7744084", "0.7744084", "0.7744084", "0.71178484", "0.610572", "0.5880223", "0.5854096", "0.58206666", "0.57460594", "0.5692862", "0.5670011", "0.55274093", "0.5522732", "0.54867756", "0.54613596", "0.5384841", "0.53692126", "0.53460...
0.7849933
1
FetchOrganization provides a mock function with given fields: filters
func (_m *OrganizationFetcher) FetchOrganization(filters []services.QueryFilter) (models.Organization, error) { ret := _m.Called(filters) var r0 models.Organization if rf, ok := ret.Get(0).(func([]services.QueryFilter) models.Organization); ok { r0 = rf(filters) } else { r0 = ret.Get(0).(models.Organization) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Test_OrganizationsRepo_Filter(t *testing.T) {\n\tq := query.NewQuery()\n\tresult, _, err := tc.organizationsRepo.Filter(context.Background(), q)\n\trequire.Nil(t, err, \"unexpected error\")\n\tassert.Len(t, result, len(f.Organizations), \"unexpected number of rows returned\")\n}", "func (m *MockOrganization...
[ "0.6240677", "0.6059997", "0.58044446", "0.5616137", "0.55219644", "0.5459781", "0.5447272", "0.54235154", "0.54216474", "0.53972083", "0.53289837", "0.5325005", "0.5287012", "0.5278028", "0.5263327", "0.5252575", "0.52465487", "0.5238369", "0.51930016", "0.5192341", "0.51545...
0.738788
0
Returns a string with a HMAC signature.
func SignString(value, key string) string { return fmt.Sprintf("%x----%s", hmac.New(sha1.New, []byte(key)).Sum([]byte(value)), value) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getSignature(signingKey []byte, stringToSign string) string {\n\treturn hex.EncodeToString(sumHMAC(signingKey, []byte(stringToSign)))\n}", "func (k Key) HMAC() []byte {\n\treturn k[len(k)/2:]\n}", "func HMAC(algo HashAlgo, s, key string) string {\n\tvar mac hash.Hash\n\n\tswitch algo {\n\tcase AlgoMD5:\n\...
[ "0.71829104", "0.7052024", "0.70093495", "0.6933789", "0.6795556", "0.67467207", "0.6733188", "0.66797465", "0.6621314", "0.66114676", "0.64573663", "0.6335612", "0.63065124", "0.6270065", "0.6256581", "0.6239818", "0.6217827", "0.620237", "0.6164223", "0.6156821", "0.6121654...
0.60221684
27
Returns a string if HMAC signature is valid.
func ValidateSignedString(value, key string) (string, error) { parts := strings.SplitN(value, "----", 2) if parts[0] == fmt.Sprintf("%x", hmac.New(sha1.New, []byte(key)).Sum([]byte(parts[1]))) { return parts[1], nil } return "", errors.New("data is tampered") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func checkSignature(s string) ([]byte, error) {\n\tif 128 != len(s) {\n\t\treturn nil, fault.TransactionIdIsRequired\n\t}\n\th, err := hex.DecodeString(s)\n\tif nil != err {\n\t\treturn nil, err\n\n\t}\n\treturn h, nil\n}", "func getSignature(signingKey []byte, stringToSign string) string {\n\treturn hex.EncodeT...
[ "0.65445095", "0.62604153", "0.5990109", "0.590877", "0.58225965", "0.58003604", "0.57954544", "0.57604545", "0.57391244", "0.572719", "0.5722057", "0.5715614", "0.56788564", "0.5632296", "0.56035364", "0.5602562", "0.5569063", "0.5566009", "0.55550116", "0.5551403", "0.55438...
0.51911163
58
pingLoop periodically sends a ping to all remote clusters.
func (rcs *Service) pingLoop(done <-chan struct{}) { pingChan := make(chan *model.RemoteCluster, MaxConcurrentSends*2) // create a thread pool to send pings concurrently to remotes. for i := 0; i < MaxConcurrentSends; i++ { go rcs.pingEmitter(pingChan, done) } go rcs.pingGenerator(pingChan, done) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func pingLoop(results chan Host, hostRegistry *HostRegistry, interval time.Duration, timeout time.Duration) {\n\tfor {\n\t\thostAddresses := hostRegistry.GetHostAddresses()\n\n\t\tlog.Info(\"Pinging these addresses: %q\\n\", hostAddresses)\n\n\t\tfor _, address := range hostAddresses {\n\t\t\tlog.Debug(\"Pinging: ...
[ "0.8008959", "0.73642355", "0.7354216", "0.716509", "0.6779733", "0.67345625", "0.6406868", "0.63669646", "0.6331098", "0.63261425", "0.626655", "0.6236336", "0.621892", "0.61981124", "0.60962933", "0.6069212", "0.6055444", "0.604405", "0.59858143", "0.5978686", "0.59705174",...
0.8445327
0
pingEmitter pulls Remotes from the ping queue (pingChan) and pings them. Pinging a remote cannot take longer than PingTimeoutMillis.
func (rcs *Service) pingEmitter(pingChan <-chan *model.RemoteCluster, done <-chan struct{}) { for { select { case rc := <-pingChan: if rc == nil { return } online := rc.IsOnline() if err := rcs.pingRemote(rc); err != nil { rcs.server.Log().Log(mlog.LvlRemoteClusterServiceWarn, "Remote cluster...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (rcs *Service) pingLoop(done <-chan struct{}) {\n\tpingChan := make(chan *model.RemoteCluster, MaxConcurrentSends*2)\n\n\t// create a thread pool to send pings concurrently to remotes.\n\tfor i := 0; i < MaxConcurrentSends; i++ {\n\t\tgo rcs.pingEmitter(pingChan, done)\n\t}\n\n\tgo rcs.pingGenerator(pingChan,...
[ "0.5540986", "0.5505406", "0.5427127", "0.5427127", "0.5427127", "0.5284718", "0.5107711", "0.50829035", "0.5076376", "0.50560343", "0.4966862", "0.49452683", "0.49294308", "0.4921673", "0.49036264", "0.48855567", "0.48285797", "0.47991693", "0.47748682", "0.47645676", "0.474...
0.74014896
0
pingRemote make a synchronous ping to a remote cluster. Return is error if ping is unsuccessful and nil on success.
func (rcs *Service) pingRemote(rc *model.RemoteCluster) error { frame, err := makePingFrame(rc) if err != nil { return err } url := fmt.Sprintf("%s/%s", rc.SiteURL, PingURL) resp, err := rcs.sendFrameToRemote(PingTimeout, rc, frame, url) if err != nil { return err } ping := model.RemoteClusterPing{} err ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (rn *RemoteNode) Ping() error {\n\tmsg, err := NewPingMessage()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = rn.SendMessageSync(msg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (a *Client) Ping(params *PingParams, authInfo runtime.ClientAuthInfoWriter) (*PingOK, error) {\n\t/...
[ "0.5757455", "0.54401505", "0.54391694", "0.53251994", "0.532496", "0.53082156", "0.5287487", "0.523717", "0.52331144", "0.52265793", "0.5207792", "0.51742476", "0.5154612", "0.51186514", "0.5075052", "0.5067131", "0.5061404", "0.5061404", "0.5060334", "0.5044561", "0.5040924...
0.7208622
0
IsUserInProtectBranchWhitelist returns true if given user is in the whitelist of a branch in a repository.
func IsUserInProtectBranchWhitelist(repoID, userID int64, branch string) bool { has, err := x.Where("repo_id = ?", repoID).And("user_id = ?", userID).And("name = ?", branch).Get(new(ProtectBranchWhitelist)) return has && err == nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cfg *Config) inWhitelist(addr net.Addr) bool {\n\tif len(cfg.Whitelists) == 0 {\n\t\treturn false\n\t}\n\n\thost, _, err := net.SplitHostPort(addr.String())\n\tif err != nil {\n\t\tlog.Warnf(\"Unable to SplitHostPort on '%s': %v\", addr, err)\n\t\treturn false\n\t}\n\tip := net.ParseIP(host)\n\tif ip == nil ...
[ "0.56163293", "0.5373006", "0.52983207", "0.5277685", "0.5266368", "0.5255747", "0.51754534", "0.5144733", "0.51208335", "0.50630087", "0.5051098", "0.4973124", "0.4966368", "0.49533182", "0.4888079", "0.4856383", "0.48513022", "0.4842797", "0.48176417", "0.4758936", "0.47584...
0.89497715
0
GetProtectBranchOfRepoByName returns ProtectBranch by branch name in given repository.
func GetProtectBranchOfRepoByName(repoID int64, name string) (*ProtectBranch, error) { protectBranch := &ProtectBranch{ RepoID: repoID, Name: name, } has, err := x.Get(protectBranch) if err != nil { return nil, err } else if !has { return nil, ErrBranchNotExist{args: map[string]any{"name": name}} } ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetBranchProtection(ctx *context.APIContext) {\n\t// swagger:operation GET /repos/{owner}/{repo}/branch_protections/{name} repository repoGetBranchProtection\n\t// ---\n\t// summary: Get a specific branch protection for the repository\n\t// produces:\n\t// - application/json\n\t// parameters:\n\t// - name: ow...
[ "0.563166", "0.56300473", "0.54814917", "0.53906345", "0.52956754", "0.5287144", "0.5120009", "0.5038256", "0.5038108", "0.5026133", "0.49994874", "0.49632233", "0.49617618", "0.49427322", "0.49369785", "0.49321407", "0.49279362", "0.48991442", "0.48990035", "0.4890306", "0.4...
0.8605521
0
IsBranchOfRepoRequirePullRequest returns true if branch requires pull request in given repository.
func IsBranchOfRepoRequirePullRequest(repoID int64, name string) bool { protectBranch, err := GetProtectBranchOfRepoByName(repoID, name) if err != nil { return false } return protectBranch.Protected && protectBranch.RequirePullRequest }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Client) IsPullRequestMerged(owner, repo string, index int64) (bool, *Response, error) {\n\tif err := escapeValidatePathSegments(&owner, &repo); err != nil {\n\t\treturn false, nil, err\n\t}\n\tstatus, resp, err := c.getStatusCode(\"GET\", fmt.Sprintf(\"/repos/%s/%s/pulls/%d/merge\", owner, repo, index), n...
[ "0.60033196", "0.56456953", "0.5529143", "0.55012417", "0.5406795", "0.5382219", "0.53821987", "0.5308959", "0.5265178", "0.5258808", "0.52289414", "0.52288187", "0.5203953", "0.5083942", "0.506576", "0.50482285", "0.50422275", "0.5011587", "0.500566", "0.49848372", "0.498483...
0.87552845
0
UpdateProtectBranch saves branch protection options. If ID is 0, it creates a new record. Otherwise, updates existing record.
func UpdateProtectBranch(protectBranch *ProtectBranch) (err error) { sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err } if protectBranch.ID == 0 { if _, err = sess.Insert(protectBranch); err != nil { return fmt.Errorf("Insert: %v", err) } } if _, err = sess.ID(p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func EditBranchProtection(ctx *context.APIContext) {\n\t// swagger:operation PATCH /repos/{owner}/{repo}/branch_protections/{name} repository repoEditBranchProtection\n\t// ---\n\t// summary: Edit a branch protections for a repository. Only fields that are set will be changed\n\t// consumes:\n\t// - application/js...
[ "0.6981953", "0.68028724", "0.67981833", "0.6534552", "0.57428634", "0.5720844", "0.56828713", "0.5580903", "0.5515201", "0.5496755", "0.5369292", "0.4983595", "0.49808177", "0.49740207", "0.48678598", "0.48411614", "0.4827034", "0.47039238", "0.46725774", "0.46675575", "0.45...
0.7305021
0
UpdateOrgProtectBranch saves branch protection options of organizational repository. If ID is 0, it creates a new record. Otherwise, updates existing record. This function also performs check if whitelist user and team's IDs have been changed to avoid unnecessary whitelist delete and regenerate.
func UpdateOrgProtectBranch(repo *Repository, protectBranch *ProtectBranch, whitelistUserIDs, whitelistTeamIDs string) (err error) { if err = repo.GetOwner(); err != nil { return fmt.Errorf("GetOwner: %v", err) } else if !repo.Owner.IsOrganization() { return fmt.Errorf("expect repository owner to be an organizati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func EditBranchProtection(ctx *context.APIContext) {\n\t// swagger:operation PATCH /repos/{owner}/{repo}/branch_protections/{name} repository repoEditBranchProtection\n\t// ---\n\t// summary: Edit a branch protections for a repository. Only fields that are set will be changed\n\t// consumes:\n\t// - application/js...
[ "0.6461851", "0.6423092", "0.6416864", "0.63546205", "0.61288905", "0.5720693", "0.5681801", "0.53321487", "0.5272768", "0.48651224", "0.4766242", "0.47318128", "0.45781916", "0.45240498", "0.45019257", "0.4427853", "0.4406283", "0.4384094", "0.43788534", "0.4349381", "0.4330...
0.758683
0
GetProtectBranchesByRepoID returns a list of ProtectBranch in given repository.
func GetProtectBranchesByRepoID(repoID int64) ([]*ProtectBranch, error) { protectBranches := make([]*ProtectBranch, 0, 2) return protectBranches, x.Where("repo_id = ? and protected = ?", repoID, true).Asc("name").Find(&protectBranches) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *client) GetBranches(org, repo string, onlyProtected bool) ([]Branch, error) {\n\tdurationLogger := c.log(\"GetBranches\", org, repo, onlyProtected)\n\tdefer durationLogger()\n\n\tvar branches []Branch\n\terr := c.readPaginatedResultsWithValues(\n\t\tfmt.Sprintf(\"/repos/%s/%s/branches\", org, repo),\n\t\t...
[ "0.63642013", "0.6320566", "0.5900391", "0.56682706", "0.5501149", "0.54667157", "0.54543006", "0.54134506", "0.51837456", "0.51545143", "0.4974663", "0.49698856", "0.496513", "0.494982", "0.49366364", "0.48883775", "0.48778513", "0.48493487", "0.48474577", "0.4751535", "0.47...
0.90316087
0
the following function catches SIGUSR1 and dumps runtime statistics there is no performance penalty for collecting these stats
func dumpInfo(c chan os.Signal) { for { <-c log.Println("Signal caught - dumping runtime stats") var m runtime.MemStats runtime.ReadMemStats(&m) s, _ := json.Marshal(m) log.Println("MemStats JSON follows") log.Printf("%s\n", s) var garC debug.GCStats debug.ReadGCStats(&garC) log.Printf("\nLastGC:\t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func handleDebugSignal(ctx context.Context) {\n\tsigCh := make(chan os.Signal, 1)\n\tsignal.Notify(sigCh, unix.SIGUSR2)\n\n\tfor {\n\t\tselect {\n\t\tcase <-sigCh:\n\t\t\tpprof.Lookup(\"goroutine\").WriteTo(os.Stderr, 1)\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\t}\n\t}\n}", "func sys_prof(p *proc.Proc_t, ptype,...
[ "0.6210038", "0.60277957", "0.59776646", "0.5906248", "0.56304824", "0.5578134", "0.55220157", "0.54440075", "0.5421208", "0.5403018", "0.5403018", "0.53950644", "0.5334088", "0.5245548", "0.5184892", "0.5180288", "0.515967", "0.51418954", "0.5081876", "0.5081836", "0.5056463...
0.59971803
2
QuickExec quick exec an simple command line
func QuickExec(cmdLine string, workDir ...string) (string, error) { return ExecLine(cmdLine, workDir...) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func main() {\n\tlines := util.ReadLines()\n\n\tansP1, ansP2 := Exec(lines)\n\tfmt.Printf(\"Part1: %v\\n\", ansP1)\n\tfmt.Printf(\"Part2: %v\\n\", ansP2)\n}", "func main() {\n\tInitVars()\n\ttfmBins := InitTfmBins(&OsPath)\n\tverConstraints, err := ParseTfmConfigs(\"./\")\n\tif err != nil {\n\t\tfmt.Fprintf(os.S...
[ "0.6264366", "0.6004395", "0.5772538", "0.5772538", "0.5772538", "0.5772538", "0.5772538", "0.5772538", "0.5772538", "0.57653713", "0.5761175", "0.57583976", "0.5720655", "0.566654", "0.5643779", "0.562086", "0.55483186", "0.5535528", "0.55332303", "0.553222", "0.55076367", ...
0.7113928
0
ExecLine quick exec an command line string
func ExecLine(cmdLine string, workDir ...string) (string, error) { p := cmdline.NewParser(cmdLine) // create a new Cmd instance cmd := p.NewExecCmd() if len(workDir) > 0 { cmd.Dir = workDir[0] } bs, err := cmd.Output() return string(bs), err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func QuickExec(cmdLine string, workDir ...string) (string, error) {\n\treturn ExecLine(cmdLine, workDir...)\n}", "func (ui *UI) exec(ctx context.Context, line string, reqCh chan execReq) int {\n\treq := execReq{\n\t\tctx: ctx,\n\t\tline: line,\n\t\tui: ui,\n\t\trespCh: make(chan int),\n\t}\n\tselect {\n...
[ "0.6906744", "0.6147474", "0.60744816", "0.60500157", "0.5863146", "0.58578545", "0.5813975", "0.5777007", "0.5759011", "0.5743766", "0.5711614", "0.5693573", "0.56703174", "0.56509113", "0.5646578", "0.5635001", "0.5626724", "0.5615617", "0.55758286", "0.5570272", "0.5558317...
0.7586125
0
ShellExec exec command by shell cmdLine. eg: "ls al"
func ShellExec(cmdLine string, shells ...string) (string, error) { // shell := "/bin/sh" shell := "sh" if len(shells) > 0 { shell = shells[0] } var out bytes.Buffer cmd := exec.Command(shell, "-c", cmdLine) cmd.Stdout = &out if err := cmd.Run(); err != nil { return "", err } return out.String(), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ExecuteShell(ctx context.Context) interface{} {\n\treturn func(line string) (io.Reader, error) {\n\t\tc := exec.Command(\"sh\", \"-\")\n\n\t\tcopyDone := make(chan error)\n\t\ttimeout := time.After(ContextGetTimeout(ctx))\n\n\t\toutput := new(bytes.Buffer)\n\t\tif stdout, err := c.StdoutPipe(); err == nil {\n...
[ "0.6343495", "0.61270344", "0.5937417", "0.5901834", "0.5735678", "0.5730066", "0.5700993", "0.567958", "0.562397", "0.56186557", "0.56005836", "0.5578034", "0.55685246", "0.55685246", "0.551668", "0.547903", "0.54406506", "0.543145", "0.54090106", "0.5396964", "0.53954333", ...
0.75436246
0
ThreeWay attempts a threeway merge between two candidates and a common ancestor. It considers the three of them recursively, applying some simple rules to identify conflicts: If any of the three nodes are different NomsKinds: conflict If we are dealing with a map: If the same key is both removed and inserted wrt parent...
func ThreeWay(a, b, parent types.Value, vwr types.ValueReadWriter) (merged types.Value, err error) { if a == nil && b == nil { return parent, nil } else if a == nil { return parent, newMergeConflict("Cannot merge nil Value with %s.", b.Type().Describe()) } else if b == nil { return parent, newMergeConflict("Ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *mergeBaseSuite) TestDoubleCommonAncestorInCrossMerge(c *C) {\n\trevs := []string{\"C\", \"D\"}\n\texpectedRevs := []string{\"CD1\", \"CD2\"}\n\ts.AssertMergeBase(c, revs, expectedRevs)\n}", "func createThreeWayMergePatch(found, child *unstructured.Unstructured) ([]byte, error) {\n\toriginal, err := getL...
[ "0.5305594", "0.530267", "0.5156637", "0.5114457", "0.49938747", "0.49833733", "0.4961236", "0.4697486", "0.46694422", "0.46552038", "0.4631997", "0.46033674", "0.45770454", "0.4563981", "0.4560225", "0.45419317", "0.4523825", "0.45117086", "0.4492587", "0.4451917", "0.443074...
0.6773516
0
a and b cannot be merged if they are of different NomsKind, or if at least one of the two is nil, or if either is a Noms primitive.
func unmergeable(a, b types.Value) bool { if a != nil && b != nil { aKind, bKind := a.Type().Kind(), b.Type().Kind() return aKind != bKind || types.IsPrimitiveKind(aKind) || types.IsPrimitiveKind(bKind) } return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MergedKnownPrimitiveTypes(a Expr, b Expr) PrimitiveType {\n\tx := KnownPrimitiveType(a)\n\ty := KnownPrimitiveType(b)\n\tif x == PrimitiveUnknown || y == PrimitiveUnknown {\n\t\treturn PrimitiveUnknown\n\t}\n\tif x == y {\n\t\treturn x\n\t}\n\treturn PrimitiveMixed // Definitely some kind of primitive\n}", ...
[ "0.5755972", "0.5697133", "0.5668373", "0.55909467", "0.5590817", "0.5558355", "0.5500499", "0.54455835", "0.54032934", "0.5354523", "0.51682526", "0.5137761", "0.511377", "0.51049376", "0.50986505", "0.5072738", "0.50718033", "0.506198", "0.5021708", "0.49960023", "0.4993717...
0.69784236
0