id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
5,600 | all-5601 | [
"The",
"V1",
"procotol",
"consists",
"of",
"the",
"protocol",
"identification",
"/",
"version",
"header",
"followed",
"by",
"a",
"stream",
"of",
"gobified",
"values",
".",
"The",
"first",
"value",
"is",
"the",
"encoded",
"features",
"map",
"(",
"never",
"enc... | [
"func",
"(",
"res",
"*",
"protocolIntroResults",
")",
"doIntroV1",
"(",
"params",
"protocolIntroParams",
",",
"pubKey",
",",
"privKey",
"*",
"[",
"32",
"]",
"byte",
")",
"error",
"{",
"features",
":=",
"filterV1Features",
"(",
"params",
".",
"Features",
")",... |
5,601 | all-5602 | [
"Depending",
"on",
"the",
"parameters",
"passed",
"and",
"on",
"local",
"state",
"this",
"endpoint",
"will",
"either",
":",
"-",
"bootstrap",
"a",
"new",
"cluster",
"(",
"if",
"this",
"node",
"is",
"not",
"clustered",
"yet",
")",
"-",
"request",
"to",
"j... | [
"func",
"clusterPut",
"(",
"d",
"*",
"Daemon",
",",
"r",
"*",
"<mask>",
".",
"Request",
")",
"Response",
"{",
"req",
":=",
"api",
".",
"ClusterPut",
"{",
"}",
"\n\n",
"// Parse the request",
"err",
":=",
"json",
".",
"NewDecoder",
"(",
"r",
".",
"Body"... |
5,602 | all-5603 | [
"printHistogram",
"prints",
"the",
"histogram",
"data",
"in",
"a",
"human",
"-",
"readable",
"format",
"."
] | [
"func",
"(",
"histogram",
"histogramData",
")",
"printHistogram",
"(",
")",
"{",
"fmt",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"histogram",
".",
"totalCount",
")",
"\n",
"fmt",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"histogram",
".",
"min",
... |
5,603 | all-5604 | [
"IsErrNotSignedIn",
"returns",
"true",
"if",
"err",
"is",
"a",
"ErrNotSignedIn"
] | [
"func",
"IsErrNotSignedIn",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"// TODO(msteffen) This is unstructured because we have no way to propagate",
"// structured errors across GRPC boundaries. Fix",
"return",
... |
5,604 | all-5605 | [
"AddException",
"adds",
"a",
"new",
"exception",
"into",
"the",
"context",
"."
] | [
"func",
"(",
"s",
"*",
"Seekret",
")",
"AddException",
"(",
"exception",
"models",
".",
"<mask>",
")",
"{",
"s",
".",
"exceptionList",
"=",
"append",
"(",
"s",
".",
"exceptionList",
",",
"exception",
")",
"\n",
"}"
] |
5,605 | all-5606 | [
"Add",
"creates",
"a",
"new",
"key",
"/",
"value",
"record",
"if",
"it",
"does",
"not",
"yet",
"exist",
"and",
"positions",
"the",
"iterator",
"on",
"it",
".",
"If",
"the",
"record",
"already",
"exists",
"then",
"Add",
"positions",
"the",
"iterator",
"on... | [
"func",
"(",
"it",
"*",
"Iterator",
")",
"Add",
"(",
"key",
"[",
"]",
"byte",
",",
"val",
"[",
"]",
"byte",
",",
"meta",
"uint16",
")",
"error",
"{",
"var",
"spl",
"[",
"maxHeight",
"]",
"splice",
"\n",
"if",
"it",
".",
"seekForSplice",
"(",
"key... |
5,606 | all-5607 | [
"GithookService",
"returns",
"a",
"k8s",
"service",
"that",
"exposes",
"a",
"public",
"IP"
] | [
"func",
"GithookService",
"(",
"namespace",
"string",
")",
"*",
"v1",
".",
"Service",
"{",
"name",
":=",
"\"",
"\"",
"\n",
"return",
"&",
"v1",
".",
"Service",
"{",
"TypeMeta",
":",
"metav1",
".",
"TypeMeta",
"{",
"Kind",
":",
"\"",
"\"",
",",
"APIVe... |
5,607 | all-5608 | [
"DockerReferenceIdentity",
"returns",
"a",
"string",
"representation",
"of",
"the",
"reference",
"suitable",
"for",
"policy",
"lookup",
"as",
"a",
"backend",
"for",
"ImageReference",
".",
"PolicyConfigurationIdentity",
".",
"The",
"reference",
"must",
"satisfy",
"!ref... | [
"func",
"DockerReferenceIdentity",
"(",
"ref",
"reference",
".",
"Named",
")",
"(",
"string",
",",
"error",
")",
"{",
"res",
":=",
"ref",
".",
"Name",
"(",
")",
"\n",
"tagged",
",",
"isTagged",
":=",
"ref",
".",
"(",
"reference",
".",
"NamedTagged",
")... |
5,608 | all-5609 | [
"clamp",
"clamps",
"v",
"to",
"the",
"range",
"[",
"min",
"max",
"]",
"."
] | [
"func",
"clamp",
"(",
"v",
",",
"min",
",",
"max",
"int",
")",
"int",
"{",
"if",
"min",
">",
"max",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"v",
"<",
"<mask>",
"{",
"return",
"min",
"\n",
"}",
"\n",
"if",
"max",
"<",
"v",... |
5,609 | all-5610 | [
"UpdateRuleSetGroup",
"updates",
"passed",
"rule",
"set",
"group",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"UpdateRuleSetGroup",
"(",
"cfg",
"*",
"RuleSetGroup",
")",
"(",
"*",
"RuleSetGroup",
",",
"error",
")",
"{",
"if",
"cfg",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
... |
5,610 | all-5611 | [
"Add",
"will",
"append",
"a",
"URL",
"parameter",
"to",
"the",
"end",
"of",
"the",
"route",
"param"
] | [
"func",
"(",
"s",
"*",
"RouteParams",
")",
"Add",
"(",
"key",
",",
"<mask>",
"string",
")",
"{",
"(",
"*",
"s",
")",
".",
"Keys",
"=",
"append",
"(",
"(",
"*",
"s",
")",
".",
"Keys",
",",
"key",
")",
"\n",
"(",
"*",
"s",
")",
".",
"Values",... |
5,611 | all-5612 | [
"Make",
"a",
"deep",
"copy",
"from",
"src",
"into",
"dst",
"."
] | [
"func",
"Copy",
"(",
"dst",
"interface",
"{",
"}",
",",
"src",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"dst",
"==",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"src",
"==",
"nil",
"{",
"retur... |
5,612 | all-5613 | [
"SetSupportSelection",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_operation_set_support_selection",
"()",
"."
] | [
"func",
"(",
"po",
"*",
"PrintOperation",
")",
"SetSupportSelection",
"(",
"selection",
"bool",
")",
"{",
"C",
".",
"gtk_print_operation_set_support_selection",
"(",
"<mask>",
".",
"native",
"(",
")",
",",
"gbool",
"(",
"selection",
")",
")",
"\n",
"}"
] |
5,613 | all-5614 | [
"getGubernatorMetadata",
"returns",
"a",
"JSON",
"string",
"with",
"machine",
"-",
"readable",
"information",
"about",
"approvers",
".",
"This",
"MUST",
"be",
"kept",
"in",
"sync",
"with",
"gubernator",
"/",
"github",
"/",
"classifier",
".",
"py",
"particularly"... | [
"func",
"getGubernatorMetadata",
"(",
"toBeAssigned",
"[",
"]",
"string",
")",
"string",
"{",
"bytes",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
"{",
"\"",
"\"",
":",
"toBeAssigned",
"}",
")",
"\n",
... |
5,614 | all-5615 | [
"Create",
"the",
"specified",
"image",
"alises",
"updating",
"those",
"that",
"already",
"exist"
] | [
"func",
"ensureImageAliases",
"(",
"client",
"lxd",
".",
"ContainerServer",
",",
"aliases",
"[",
"]",
"api",
".",
"ImageAlias",
",",
"fingerprint",
"string",
")",
"error",
"{",
"if",
"len",
"(",
"aliases",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",... |
5,615 | all-5616 | [
"Returns",
"the",
"Bottom",
"-",
"Right",
"Point",
"of",
"the",
"rectangle"
] | [
"func",
"(",
"r",
"*",
"Rect",
")",
"BR",
"(",
")",
"<mask>",
"{",
"return",
"Point",
"{",
"int",
"(",
"r",
".",
"x",
")",
"+",
"int",
"(",
"r",
".",
"width",
")",
",",
"int",
"(",
"r",
".",
"y",
")",
"+",
"int",
"(",
"r",
".",
"height",
... |
5,616 | all-5617 | [
"specify",
"the",
"organization",
"of",
"vertex",
"arrays"
] | [
"func",
"VertexAttribFormat",
"(",
"attribindex",
"uint32",
",",
"size",
"int32",
",",
"xtype",
"uint32",
",",
"normalized",
"bool",
",",
"relativeoffset",
"uint32",
")",
"{",
"C",
".",
"glowVertexAttribFormat",
"(",
"gpVertexAttribFormat",
",",
"(",
"C",
".",
... |
5,617 | all-5618 | [
"GetEvaluationDuration",
"returns",
"the",
"time",
"in",
"seconds",
"it",
"took",
"to",
"evaluate",
"the",
"alerting",
"rule",
"."
] | [
"func",
"(",
"r",
"*",
"AlertingRule",
")",
"GetEvaluationDuration",
"(",
")",
"<mask>",
".",
"Duration",
"{",
"r",
".",
"mtx",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r",
".",
"mtx",
".",
"Unlock",
"(",
")",
"\n",
"return",
"r",
".",
"evaluationDurat... |
5,618 | all-5619 | [
"Locator",
"returns",
"a",
"locator",
"for",
"the",
"given",
"resource"
] | [
"func",
"(",
"r",
"*",
"Network",
")",
"Locator",
"(",
"api",
"*",
"API",
")",
"*",
"NetworkLocator",
"{",
"for",
"_",
",",
"l",
":=",
"<mask>",
"r",
".",
"Links",
"{",
"if",
"l",
"[",
"\"",
"\"",
"]",
"==",
"\"",
"\"",
"{",
"return",
"api",
... |
5,619 | all-5620 | [
"getActiveConn",
"will",
"randomly",
"select",
"an",
"active",
"connection",
".",
"TODO",
"(",
"prashant",
")",
":",
"Should",
"we",
"clear",
"inactive",
"connections?",
"TODO",
"(",
"prashant",
")",
":",
"Do",
"we",
"want",
"some",
"sort",
"of",
"scoring",
... | [
"func",
"(",
"p",
"*",
"Peer",
")",
"getActiveConn",
"(",
")",
"(",
"*",
"Connection",
",",
"bool",
")",
"{",
"p",
".",
"RLock",
"(",
")",
"\n",
"conn",
",",
"ok",
":=",
"p",
".",
"getActiveConnLocked",
"(",
")",
"\n",
"p",
".",
"RUnlock",
"(",
... |
5,620 | all-5621 | [
"TLSConnectionState",
"returns",
"TLS",
"connection",
"state",
".",
"The",
"function",
"returns",
"nil",
"if",
"the",
"underlying",
"connection",
"isn",
"t",
"tls",
".",
"Conn",
".",
"The",
"returned",
"state",
"may",
"be",
"used",
"for",
"verifying",
"TLS",
... | [
"func",
"(",
"ctx",
"*",
"RequestCtx",
")",
"TLSConnectionState",
"(",
")",
"*",
"tls",
".",
"ConnectionState",
"{",
"tlsConn",
",",
"ok",
":=",
"ctx",
".",
"c",
".",
"(",
"connTLSer",
")",
"\n",
"if",
"!",
"<mask>",
"{",
"return",
"nil",
"\n",
"}",
... |
5,621 | all-5622 | [
"RunCommand",
"parses",
"and",
"runs",
"the",
"command",
"with",
"the",
"given",
"name",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"RunCommand",
"(",
"cmd",
"string",
")",
"(",
"*",
"http",
".",
"<mask>",
",",
"error",
")",
"{",
"parsed",
",",
"err",
":=",
"a",
".",
"ParseCommand",
"(",
"cmd",
",",
"\"",
"\"",
",",
"commandValues",
")",
"\n... |
5,622 | all-5623 | [
"HasCompareTo",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TileDefRequest",
")",
"HasCompareTo",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"CompareTo",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
5,623 | all-5624 | [
"Round",
"returns",
"a",
"point",
"inside",
"the",
"box",
"making",
"an",
"effort",
"to",
"round",
"to",
"minimal",
"precision",
"."
] | [
"func",
"(",
"b",
"Box",
")",
"Round",
"(",
")",
"(",
"<mask>",
",",
"lng",
"float64",
")",
"{",
"x",
":=",
"maxDecimalPower",
"(",
"b",
".",
"MaxLat",
"-",
"b",
".",
"MinLat",
")",
"\n",
"lat",
"=",
"math",
".",
"Ceil",
"(",
"b",
".",
"MinLat"... |
5,624 | all-5625 | [
"GetIncludeZero",
"returns",
"the",
"IncludeZero",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"y",
"*",
"Yaxis",
")",
"GetIncludeZero",
"(",
")",
"bool",
"{",
"if",
"y",
"==",
"nil",
"||",
"y",
".",
"IncludeZero",
"==",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"y",
".",
"IncludeZero",
"\n",
"}"
] |
5,625 | all-5626 | [
"WriteTaskMetadataResponse",
"writes",
"the",
"task",
"metadata",
"to",
"response",
"writer",
"."
] | [
"func",
"WriteTaskMetadataResponse",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"taskARN",
"string",
",",
"cluster",
"string",
",",
"state",
"dockerstate",
".",
"TaskEngineState",
",",
"ecsClient",
"api",
".",
"ECSClient",
",",
"az",
",",
"containerInstanceArn"... |
5,626 | all-5627 | [
"ToMap",
"is",
"used",
"to",
"walk",
"the",
"tree",
"and",
"convert",
"it",
"into",
"a",
"map"
] | [
"func",
"(",
"t",
"*",
"Tree",
")",
"ToMap",
"(",
")",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"out",
":=",
"<mask>",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"t",
".",
"size",
")",
"\n",
"t",
".",
"Walk",
"(... |
5,627 | all-5628 | [
"Read",
"reads",
"and",
"decrypts",
"data",
"into",
"p",
".",
"If",
"the",
"input",
"is",
"not",
"a",
"multiple",
"of",
"the",
"cipher",
"block",
"size",
"the",
"trailing",
"bytes",
"will",
"be",
"ignored",
"."
] | [
"func",
"(",
"cr",
"*",
"cipherBlockReader",
")",
"Read",
"(",
"p",
"[",
"]",
"byte",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"for",
"{",
"if",
"cr",
".",
"n",
"<",
"len",
"(",
"cr",
".",
"outbuf",
")",
"{",
"// return buffered outpu... |
5,628 | all-5629 | [
"Links",
"returns",
"URLs",
"or",
"identifies",
"from",
"third",
"parties",
"for",
"this",
"venue",
"https",
":",
"//",
"developer",
".",
"foursquare",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"venues",
"/",
"links"
] | [
"func",
"(",
"s",
"*",
"VenueService",
")",
"Links",
"(",
"id",
"string",
")",
"(",
"*",
"Links",
",",
"*",
"http",
".",
"Response",
",",
"error",
")",
"{",
"links",
":=",
"new",
"(",
"venueLinkResp",
")",
"\n",
"response",
":=",
"new",
"(",
"Respo... |
5,629 | all-5630 | [
"Default",
"returns",
"the",
"default",
"router"
] | [
"func",
"Default",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"plans",
",",
"err",
":=",
"List",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"if",
"len",
"(",
"plans",
")",
"==",
"0"... |
5,630 | all-5631 | [
"Resource",
"maps",
"an",
"implementation",
"of",
"the",
"Resource",
"interface",
"to",
"the",
"appropriate",
"RESTful",
"mappings",
".",
"Resource",
"returns",
"the",
"*",
"App",
"associated",
"with",
"this",
"group",
"of",
"mappings",
"so",
"you",
"can",
"se... | [
"func",
"(",
"a",
"*",
"App",
")",
"Resource",
"(",
"p",
"string",
",",
"r",
"Resource",
")",
"*",
"App",
"{",
"g",
":=",
"a",
".",
"Group",
"(",
"p",
")",
"\n",
"p",
"=",
"\"",
"\"",
"\n\n",
"rv",
":=",
"reflect",
".",
"ValueOf",
"(",
"r",
... |
5,631 | all-5632 | [
"ProcessChange",
"creates",
"new",
"presubmit",
"prowjobs",
"base",
"off",
"the",
"gerrit",
"changes"
] | [
"func",
"(",
"c",
"*",
"Controller",
")",
"ProcessChange",
"(",
"instance",
"string",
",",
"change",
"client",
".",
"ChangeInfo",
")",
"error",
"{",
"logger",
":=",
"logrus",
".",
"WithField",
"(",
"\"",
"\"",
",",
"change",
".",
"Number",
")",
"\n\n",
... |
5,632 | all-5633 | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"."
] | [
"func",
"(",
"m",
"*",
"policyTransportsMap",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"// We can't unmarshal directly into map values because it is not possible to take an address of a map value.",
"// So, use a temporary map of pointers-to-slices an... |
5,633 | all-5634 | [
"Reset",
"clears",
"response",
"header",
"."
] | [
"func",
"(",
"h",
"*",
"ResponseHeader",
")",
"Reset",
"(",
")",
"{",
"h",
".",
"disableNormalizing",
"=",
"<mask>",
"\n",
"h",
".",
"noDefaultContentType",
"=",
"false",
"\n",
"h",
".",
"resetSkipNormalize",
"(",
")",
"\n",
"}"
] |
5,634 | all-5635 | [
"MutateTX",
"runs",
"Mutate",
"on",
"the",
"underlying",
"transaction",
"using",
"the",
"provided",
"mutators",
"."
] | [
"func",
"(",
"b",
"*",
"TransactionEnvelopeBuilder",
")",
"MutateTX",
"(",
"muts",
"...",
"TransactionMutator",
")",
"{",
"b",
".",
"Init",
"(",
")",
"\n\n",
"if",
"b",
".",
"Err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"b",
".",
"child",
"."... |
5,635 | all-5636 | [
"TODO",
"(",
"amwat",
")",
":",
"remove",
"this",
"logic",
"when",
"we",
"get",
"rid",
"of",
"--",
"project",
"."
] | [
"func",
"<mask>",
"(",
"rtype",
"string",
")",
"string",
"{",
"splits",
":=",
"strings",
".",
"Split",
"(",
"rtype",
",",
"\"",
"\"",
")",
"\n",
"return",
"splits",
"[",
"len",
"(",
"splits",
")",
"-",
"1",
"]",
"\n",
"}"
] |
5,636 | all-5637 | [
"Encoder",
"returns",
"a",
"new",
"StreamEncoder",
"which",
"can",
"be",
"used",
"to",
"re",
"-",
"encode",
"the",
"stream",
"decoded",
"by",
"d",
"into",
"e",
".",
"The",
"method",
"panics",
"if",
"e",
"is",
"nil",
"."
] | [
"func",
"(",
"d",
"*",
"StreamDecoder",
")",
"Encoder",
"(",
"e",
"Emitter",
")",
"(",
"enc",
"*",
"StreamEncoder",
",",
"err",
"error",
")",
"{",
"var",
"typ",
"<mask>",
"\n\n",
"if",
"typ",
",",
"err",
"=",
"d",
".",
"Parser",
".",
"ParseType",
"... |
5,637 | all-5638 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SetFileInputFilesParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom7",
"(",
"&",
... |
5,638 | all-5639 | [
"Func",
"renderer",
"allows",
"for",
"easily",
"building",
"one",
"of",
"renderers",
"using",
"just",
"a",
"RendererFunc",
"and",
"not",
"having",
"to",
"build",
"a",
"whole",
"implementation",
"of",
"the",
"Render",
"interface",
"."
] | [
"func",
"(",
"e",
"*",
"<mask>",
")",
"Func",
"(",
"s",
"string",
",",
"fn",
"RendererFunc",
")",
"Renderer",
"{",
"return",
"Func",
"(",
"s",
",",
"fn",
")",
"\n",
"}"
] |
5,639 | all-5640 | [
"SetTransitionDuration",
"is",
"a",
"wrapper",
"around",
"gtk_stack_set_transition_duration",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Stack",
")",
"SetTransitionDuration",
"(",
"duration",
"uint",
")",
"{",
"C",
".",
"gtk_stack_set_transition_duration",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"guint",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
5,640 | all-5641 | [
"SetRadio",
"is",
"a",
"wrapper",
"around",
"gtk_cell_renderer_toggle_set_radio",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"CellRendererToggle",
")",
"SetRadio",
"(",
"<mask>",
"bool",
")",
"{",
"C",
".",
"gtk_cell_renderer_toggle_set_radio",
"(",
"v",
".",
"native",
"(",
")",
",",
"gbool",
"(",
"set",
")",
")",
"\n",
"}"
] |
5,641 | all-5642 | [
"applyCompare",
"applies",
"the",
"compare",
"request",
".",
"If",
"the",
"comparison",
"succeeds",
"it",
"returns",
"true",
".",
"Otherwise",
"returns",
"false",
"."
] | [
"func",
"applyCompare",
"(",
"rv",
"mvcc",
".",
"ReadView",
",",
"c",
"*",
"pb",
".",
"Compare",
")",
"bool",
"{",
"// TODO: possible optimizations",
"// * chunk reads for large ranges to conserve memory",
"// * rewrite rules for common patterns:",
"//\tex. \"[a, b) createrev >... |
5,642 | all-5643 | [
"SetGroup",
"is",
"a",
"wrapper",
"around",
"gtk_radio_menu_item_set_group",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"RadioMenuItem",
")",
"SetGroup",
"(",
"group",
"*",
"glib",
".",
"SList",
")",
"{",
"C",
".",
"gtk_radio_menu_item_set_group",
"(",
"v",
".",
"native",
"(",
")",
",",
"cGSList",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
5,643 | all-5644 | [
"RunServer",
"will",
"set",
"up",
"GET",
"PUT",
"and",
"DELETE",
"endpoints",
"for",
"the",
"specified",
"path",
"calling",
"the",
"appropriate",
"service",
"functions",
":",
"PUT",
"-",
">",
"Write",
"GET",
"-",
">",
"Read",
"DELETE",
"-",
">",
"Delete",
... | [
"func",
"RunServer",
"(",
"services",
"map",
"[",
"string",
"]",
"Service",
",",
"healthHandler",
"func",
"(",
"http",
".",
"ResponseWriter",
",",
"*",
"http",
".",
"<mask>",
")",
",",
"port",
"int",
",",
"serviceName",
"string",
",",
"env",
"string",
")... |
5,644 | all-5645 | [
"simultaneously",
"specify",
"storage",
"for",
"all",
"levels",
"of",
"a",
"one",
"-",
"dimensional",
"texture"
] | [
"func",
"TexStorage1D",
"(",
"target",
"uint32",
",",
"levels",
"int32",
",",
"internalformat",
"uint32",
",",
"<mask>",
"int32",
")",
"{",
"C",
".",
"glowTexStorage1D",
"(",
"gpTexStorage1D",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"target",
")",
",",
"... |
5,645 | all-5646 | [
"GetResourceTags",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockECSClient",
")",
"GetResourceTags",
"(",
"arg0",
"string",
")",
"(",
"[",
"]",
"*",
"ecs",
".",
"<mask>",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")... |
5,646 | all-5647 | [
"evalSubquery",
"evaluates",
"given",
"SubqueryExpr",
"and",
"returns",
"an",
"equivalent",
"evaluated",
"MatrixSelector",
"in",
"its",
"place",
".",
"Note",
"that",
"the",
"Name",
"and",
"LabelMatchers",
"are",
"not",
"set",
"."
] | [
"func",
"(",
"ev",
"*",
"evaluator",
")",
"evalSubquery",
"(",
"subq",
"*",
"SubqueryExpr",
")",
"*",
"MatrixSelector",
"{",
"val",
":=",
"ev",
".",
"eval",
"(",
"subq",
")",
".",
"(",
"Matrix",
")",
"\n",
"ms",
":=",
"&",
"MatrixSelector",
"{",
"Ran... |
5,647 | all-5648 | [
"startTask",
"creates",
"a",
"managedTask",
"construct",
"to",
"track",
"the",
"task",
"and",
"then",
"begins",
"pushing",
"it",
"towards",
"its",
"desired",
"state",
"when",
"allowed",
"startTask",
"is",
"protected",
"by",
"the",
"tasksLock",
"lock",
"of",
"A... | [
"func",
"(",
"engine",
"*",
"DockerTaskEngine",
")",
"startTask",
"(",
"task",
"*",
"apitask",
".",
"Task",
")",
"{",
"// Create a channel that may be used to communicate with this task, survey",
"// what tasks need to be waited for for this one to start, and then spin off",
"// a ... |
5,648 | all-5649 | [
"NewWatcher",
"wraps",
"a",
"Watcher",
"instance",
"so",
"that",
"all",
"Watch",
"requests",
"are",
"prefixed",
"with",
"a",
"given",
"string",
"and",
"all",
"Watch",
"responses",
"have",
"the",
"prefix",
"removed",
"."
] | [
"func",
"NewWatcher",
"(",
"w",
"clientv3",
".",
"Watcher",
",",
"prefix",
"string",
")",
"clientv3",
".",
"Watcher",
"{",
"return",
"&",
"watcherPrefix",
"{",
"Watcher",
":",
"w",
",",
"pfx",
":",
"<mask>",
",",
"stopc",
":",
"make",
"(",
"chan",
"str... |
5,649 | all-5650 | [
"read",
"reads",
"bytes",
"from",
"the",
"beginning",
"of",
"the",
"window",
"into",
"p"
] | [
"func",
"(",
"w",
"*",
"window",
")",
"read",
"(",
"p",
"[",
"]",
"<mask>",
")",
"(",
"n",
"int",
")",
"{",
"if",
"w",
".",
"r",
">",
"w",
".",
"w",
"{",
"n",
"=",
"copy",
"(",
"p",
",",
"w",
".",
"buf",
"[",
"w",
".",
"r",
":",
"]",
... |
5,650 | all-5651 | [
"StreamClientInterceptor",
"logs",
"streaming",
"RPCs",
"on",
"the",
"client",
"side"
] | [
"func",
"StreamClientInterceptor",
"(",
"log",
"ttnlog",
".",
"Interface",
")",
"grpc",
".",
"StreamClientInterceptor",
"{",
"return",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"desc",
"*",
"grpc",
".",
"StreamDesc",
",",
"cc",
"*",
"grpc",
".",
... |
5,651 | all-5652 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetEncodedResponseParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoAudits1",
"(",
"&"... |
5,652 | all-5653 | [
"Subscribe",
"adds",
"the",
"handler",
"to",
"be",
"called",
"into",
"EventStream"
] | [
"func",
"(",
"eventStream",
"*",
"EventStream",
")",
"Subscribe",
"(",
"name",
"string",
",",
"<mask>",
"eventHandler",
")",
"error",
"{",
"eventStream",
".",
"handlersLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"eventStream",
".",
"handlersLock",
".",
"Unl... |
5,653 | all-5654 | [
"AppendBodyString",
"appends",
"s",
"to",
"request",
"body",
"."
] | [
"func",
"(",
"req",
"*",
"<mask>",
")",
"AppendBodyString",
"(",
"s",
"string",
")",
"{",
"req",
".",
"RemoveMultipartFormFiles",
"(",
")",
"\n",
"req",
".",
"closeBodyStream",
"(",
")",
"\n",
"req",
".",
"bodyBuffer",
"(",
")",
".",
"WriteString",
"(",
... |
5,654 | all-5655 | [
"NewStateStore",
"returns",
"clusterStorer",
"object",
"based",
"on",
"type",
"."
] | [
"func",
"(",
"options",
"Options",
")",
"NewStateStore",
"(",
")",
"(",
"state",
".",
"ClusterStorer",
",",
"error",
")",
"{",
"var",
"stateStore",
"<mask>",
".",
"ClusterStorer",
"\n\n",
"switch",
"options",
".",
"StateStore",
"{",
"case",
"\"",
"\"",
":"... |
5,655 | all-5656 | [
"toRetryParameter",
"converts",
"RetryOptions",
"to",
"pb",
".",
"TaskQueueRetryParameters",
"."
] | [
"func",
"(",
"opt",
"*",
"RetryOptions",
")",
"toRetryParameters",
"(",
")",
"*",
"pb",
".",
"TaskQueueRetryParameters",
"{",
"params",
":=",
"&",
"<mask>",
".",
"TaskQueueRetryParameters",
"{",
"}",
"\n",
"if",
"opt",
".",
"RetryLimit",
">",
"0",
"{",
"pa... |
5,656 | all-5657 | [
"Private",
"function",
"for",
"now",
"."
] | [
"func",
"(",
"t",
"*",
"Trie",
")",
"printDebug",
"(",
")",
"{",
"fmt",
".",
"Print",
"(",
"\"",
"\\n",
"\"",
")",
"\n",
"t",
".",
"<mask>",
".",
"printDebug",
"(",
"0",
")",
"\n",
"fmt",
".",
"Print",
"(",
"\"",
"\\n",
"\"",
")",
"\n",
"}"
] |
5,657 | all-5658 | [
"Return",
"the",
"state",
"of",
"a",
"given",
"workertype",
"as",
"stored",
"by",
"the",
"provisioner",
".",
"This",
"state",
"is",
"stored",
"as",
"three",
"lists",
":",
"1",
"for",
"running",
"instances",
"1",
"for",
"pending",
"requests",
".",
"The",
... | [
"func",
"(",
"awsProvisioner",
"*",
"AwsProvisioner",
")",
"State",
"(",
"workerType",
"string",
")",
"error",
"{",
"cd",
":=",
"tcclient",
".",
"Client",
"(",
"*",
"awsProvisioner",
")",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"(",
"&",
"<mask>",
")",
... |
5,658 | all-5659 | [
"Errorf",
"records",
"the",
"log",
"with",
"error",
"level"
] | [
"func",
"(",
"l",
"*",
"Logger",
")",
"Errorf",
"(",
"format",
"string",
",",
"args",
"...",
"<mask>",
"{",
"}",
")",
"{",
"l",
".",
"Output",
"(",
"2",
",",
"LevelError",
",",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"args",
"...",
")",
")",
... |
5,659 | all-5660 | [
"Retry",
"on",
"transport",
"failures",
".",
"Does",
"not",
"retry",
"on",
"500s",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"requestRetryStream",
"(",
"r",
"*",
"request",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"if",
"c",
".",
"fake",
"&&",
"r",
".",
"deckPath",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"nil... |
5,660 | all-5661 | [
"/",
"*",
"Say",
"is",
"a",
"Gomega",
"matcher",
"that",
"operates",
"on",
"gbytes",
".",
"Buffers",
":"
] | [
"func",
"Say",
"(",
"expected",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"*",
"sayMatcher",
"{",
"if",
"len",
"(",
"args",
")",
">",
"0",
"{",
"<mask>",
"=",
"fmt",
".",
"Sprintf",
"(",
"expected",
",",
"args",
"...",
")",
"\n",
... |
5,661 | all-5662 | [
"successor",
"is",
"the",
"next",
"in",
"-",
"order",
"node",
"in",
"the",
"tree"
] | [
"func",
"(",
"x",
"*",
"intervalNode",
")",
"successor",
"(",
")",
"*",
"intervalNode",
"{",
"if",
"x",
".",
"<mask>",
"!=",
"nil",
"{",
"return",
"x",
".",
"right",
".",
"min",
"(",
")",
"\n",
"}",
"\n",
"y",
":=",
"x",
".",
"parent",
"\n",
"f... |
5,662 | all-5663 | [
"UnmarshalYAML",
"implements",
"the",
"yaml",
".",
"Unmarshaler",
"interface",
"."
] | [
"func",
"(",
"c",
"*",
"SDConfig",
")",
"UnmarshalYAML",
"(",
"unmarshal",
"func",
"(",
"interface",
"{",
"}",
")",
"error",
")",
"error",
"{",
"*",
"c",
"=",
"DefaultSDConfig",
"\n",
"type",
"plain",
"SDConfig",
"\n",
"err",
":=",
"unmarshal",
"(",
"(... |
5,663 | all-5664 | [
"Draw",
"paints",
"current",
"game",
"state",
"."
] | [
"func",
"(",
"w",
"*",
"World",
")",
"Draw",
"(",
"pix",
"[",
"]",
"byte",
")",
"{",
"for",
"i",
",",
"v",
":=",
"<mask>",
"w",
".",
"area",
"{",
"if",
"v",
"{",
"pix",
"[",
"4",
"*",
"i",
"]",
"=",
"0xff",
"\n",
"pix",
"[",
"4",
"*",
"... |
5,664 | all-5665 | [
"Conn",
"reads",
"the",
"tsuru",
"config",
"and",
"calls",
"storage",
".",
"Open",
"to",
"get",
"a",
"database",
"connection",
".",
"Most",
"tsuru",
"packages",
"should",
"probably",
"use",
"this",
"function",
".",
"storage",
".",
"Open",
"is",
"intended",
... | [
"func",
"Conn",
"(",
")",
"(",
"*",
"Storage",
",",
"error",
")",
"{",
"var",
"(",
"strg",
"<mask>",
"\n",
"err",
"error",
"\n",
")",
"\n",
"url",
",",
"dbname",
":=",
"DbConfig",
"(",
"\"",
"\"",
")",
"\n",
"strg",
".",
"Storage",
",",
"err",
... |
5,665 | all-5666 | [
"Stability",
":",
"***",
"EXPERIMENTAL",
"***",
"This",
"method",
"is",
"only",
"for",
"debugging",
"the",
"ec2",
"-",
"manager",
"Required",
"scopes",
":",
"ec2",
"-",
"manager",
":",
"internals",
"See",
"https",
":",
"//",
"docs",
".",
"taskcluster",
"."... | [
"func",
"(",
"eC2Manager",
"*",
"EC2Manager",
")",
"Regions",
"(",
")",
"error",
"{",
"cd",
":=",
"tcclient",
".",
"Client",
"(",
"*",
"eC2Manager",
")",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"(",
"&",
"<mask>",
")",
".",
"APICall",
"(",
"nil",
... |
5,666 | all-5667 | [
"GetOverwrite",
"is",
"a",
"wrapper",
"around",
"gtk_text_view_get_overwrite",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TextView",
")",
"GetOverwrite",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_text_view_get_overwrite",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
5,667 | all-5668 | [
"GetNewId",
"returns",
"the",
"NewId",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"d",
"*",
"Dashboard",
")",
"GetNewId",
"(",
")",
"string",
"{",
"if",
"d",
"==",
"nil",
"||",
"d",
".",
"NewId",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"<mask>",
"*",
"d",
".",
"NewId",
"\n",
"}"
] |
5,668 | all-5669 | [
"LinkByName",
"indicates",
"an",
"expected",
"call",
"of",
"LinkByName"
] | [
"func",
"(",
"mr",
"*",
"MockNetLinkMockRecorder",
")",
"LinkByName",
"(",
"arg0",
"<mask>",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"... |
5,669 | all-5670 | [
"Next",
"calls",
"the",
"next",
"handler",
"in",
"the",
"stack",
"but",
"only",
"if",
"the",
"response",
"isn",
"t",
"already",
"written",
"."
] | [
"func",
"(",
"ctx",
"*",
"Context",
")",
"Next",
"(",
")",
"{",
"// Call the next handler only if there is one and the response hasn't been written.",
"if",
"!",
"ctx",
".",
"Written",
"(",
")",
"&&",
"ctx",
".",
"<mask>",
"<",
"len",
"(",
"ctx",
".",
"handlersS... |
5,670 | all-5671 | [
"extractInboundSpan",
"attempts",
"to",
"create",
"a",
"new",
"OpenTracing",
"Span",
"for",
"inbound",
"request",
"using",
"only",
"trace",
"IDs",
"stored",
"in",
"the",
"frame",
"s",
"tracing",
"field",
".",
"It",
"only",
"works",
"if",
"the",
"tracer",
"un... | [
"func",
"(",
"c",
"*",
"Connection",
")",
"extractInboundSpan",
"(",
"callReq",
"*",
"callReq",
")",
"opentracing",
".",
"Span",
"{",
"spanCtx",
",",
"err",
":=",
"c",
".",
"Tracer",
"(",
")",
".",
"Extract",
"(",
"zipkinSpanFormat",
",",
"&",
"callReq",... |
5,671 | all-5672 | [
"LicenseHandler",
"creates",
"response",
"for",
"/",
"license",
"API",
"."
] | [
"func",
"LicenseHandler",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"h",
"*",
"http",
".",
"Request",
")",
"{",
"text",
",",
"err",
":=",
"licenseProvider",
".",
"GetText",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"w",
".",
"WriteHeader",
"... |
5,672 | all-5673 | [
"own",
"methods",
"AddItem",
"adds",
"a",
"new",
"item",
"to",
"item",
"list",
".",
"Returns",
"true",
"if",
"the",
"operation",
"is",
"successful"
] | [
"func",
"(",
"l",
"*",
"ListBox",
")",
"AddItem",
"(",
"item",
"string",
")",
"bool",
"{",
"l",
".",
"items",
"=",
"<mask>",
"(",
"l",
".",
"items",
",",
"item",
")",
"\n",
"return",
"true",
"\n",
"}"
] |
5,673 | all-5674 | [
"txnCommandFunc",
"executes",
"the",
"txn",
"command",
"."
] | [
"func",
"txnCommandFunc",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
",",
"args",
"[",
"]",
"string",
")",
"{",
"if",
"len",
"(",
"args",
")",
"!=",
"0",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
")",... |
5,674 | all-5675 | [
"SubscribeRaw",
"to",
"an",
"sse",
"endpoint"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"SubscribeRaw",
"(",
"handler",
"func",
"(",
"<mask>",
"*",
"Event",
")",
")",
"error",
"{",
"return",
"c",
".",
"Subscribe",
"(",
"\"",
"\"",
",",
"handler",
")",
"\n",
"}"
] |
5,675 | all-5676 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"RequestCachedResponseReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage2",
"(",
"&",
"w",
",... |
5,676 | all-5677 | [
"changesByZone",
"separates",
"a",
"multi",
"-",
"zone",
"change",
"into",
"a",
"single",
"change",
"per",
"zone",
"."
] | [
"func",
"changesByZone",
"(",
"zones",
"map",
"[",
"string",
"]",
"*",
"route53",
".",
"HostedZone",
",",
"changeSet",
"[",
"]",
"*",
"route53",
".",
"Change",
")",
"map",
"[",
"string",
"]",
"[",
"]",
"*",
"route53",
".",
"Change",
"{",
"changes",
"... |
5,677 | all-5678 | [
"MarshalJSON",
"returns",
"the",
"Email",
"as",
"JSON"
] | [
"func",
"(",
"e",
"Email",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"<mask>",
"w",
"jwriter",
".",
"Writer",
"\n",
"e",
".",
"MarshalEasyJSON",
"(",
"&",
"w",
")",
"\n",
"return",
"w",
".",
"BuildBytes",
"(",
"... |
5,678 | all-5679 | [
"Analyze",
"all",
"parameters",
"and",
"categorize",
"them",
"Initialize",
"all",
"fields",
"of",
"ParamAnalyzer",
"struct"
] | [
"func",
"(",
"p",
"*",
"ParamAnalyzer",
")",
"Analyze",
"(",
")",
"{",
"// Order params using their length so \"foo[bar]\" is analyzed before \"foo\"",
"params",
":=",
"p",
".",
"rawParams",
"\n",
"paths",
":=",
"<mask>",
"(",
"[",
"]",
"string",
",",
"len",
"(",
... |
5,679 | all-5680 | [
"recvRoutine",
"reads",
"msgPackets",
"and",
"reconstructs",
"the",
"message",
"using",
"the",
"channels",
"recving",
"buffer",
".",
"After",
"a",
"whole",
"message",
"has",
"been",
"assembled",
"it",
"s",
"pushed",
"to",
"onReceive",
"()",
".",
"Blocks",
"dep... | [
"func",
"(",
"c",
"*",
"MConnection",
")",
"recvRoutine",
"(",
")",
"{",
"defer",
"c",
".",
"_recover",
"(",
")",
"\n\n",
"FOR_LOOP",
":",
"for",
"{",
"// Block until .recvMonitor says we can read.",
"c",
".",
"recvMonitor",
".",
"Limit",
"(",
"maxMsgPacketTot... |
5,680 | all-5681 | [
"IsStub",
"reports",
"whether",
"a",
"function",
"is",
"a",
"stub",
".",
"A",
"function",
"is",
"considered",
"a",
"stub",
"if",
"it",
"has",
"no",
"instructions",
"or",
"exactly",
"one",
"instruction",
"which",
"must",
"be",
"either",
"returning",
"only",
... | [
"func",
"(",
"d",
"*",
"Descriptions",
")",
"IsStub",
"(",
"fn",
"*",
"ssa",
".",
"Function",
")",
"bool",
"{",
"if",
"len",
"(",
"fn",
".",
"Blocks",
")",
"==",
"0",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"len",
"(",
"fn",
".",
"Blocks"... |
5,681 | all-5682 | [
"HasChildren",
"checks",
"to",
"see",
"if",
"a",
"resource",
"pool",
"has",
"any",
"child",
"items",
"(",
"virtual",
"machines",
"vApps",
"or",
"resource",
"pools",
")",
"and",
"returns",
"true",
"if",
"that",
"is",
"the",
"case",
".",
"This",
"is",
"use... | [
"func",
"HasChildren",
"(",
"rp",
"*",
"object",
".",
"ResourcePool",
")",
"(",
"bool",
",",
"error",
")",
"{",
"props",
",",
"err",
":=",
"Properties",
"(",
"rp",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"<mask>",
",",
"err",
"\n",
"}",... |
5,682 | all-5683 | [
"/",
"*",
"polymorph",
"AppWrapper",
"app",
"false",
"/",
"*",
"polymorph",
"AppWrapper",
"error",
"false",
"Validate",
"validates",
"this",
"app",
"wrapper"
] | [
"func",
"(",
"m",
"*",
"AppWrapper",
")",
"Validate",
"(",
"formats",
"strfmt",
".",
"Registry",
")",
"error",
"{",
"var",
"res",
"[",
"]",
"error",
"\n\n",
"if",
"err",
":=",
"m",
".",
"validateApp",
"(",
"formats",
")",
";",
"err",
"!=",
"nil",
"... |
5,683 | all-5684 | [
"Glob",
"list",
"matched",
"files",
"from",
"assetfs"
] | [
"func",
"(",
"fs",
"*",
"AssetFileSystem",
")",
"Glob",
"(",
"pattern",
"string",
")",
"(",
"matches",
"[",
"]",
"string",
",",
"err",
"error",
")",
"{",
"for",
"_",
",",
"pth",
":=",
"range",
"fs",
".",
"paths",
"{",
"if",
"results",
",",
"err",
... |
5,684 | all-5685 | [
"applyCreate",
"will",
"dry",
"-",
"run",
"create",
"and",
"then",
"pipe",
"this",
"to",
"kubectl",
"apply",
".",
"If",
"we",
"use",
"the",
"create",
"verb",
"it",
"will",
"fail",
"if",
"the",
"secret",
"already",
"exists",
".",
"And",
"kubectl",
"will",... | [
"func",
"applyCreate",
"(",
"ctx",
"string",
",",
"args",
"...",
"string",
")",
"error",
"{",
"create",
":=",
"<mask>",
".",
"Command",
"(",
"\"",
"\"",
",",
"append",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
"}... |
5,685 | all-5686 | [
"NewMockFactory",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockFactory",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockFactory",
"{",
"mock",
":=",
"&",
"MockFactory",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockFactoryMockRecorder",
"{",
"mock",
"}",
"\n"... |
5,686 | all-5687 | [
"Select",
"an",
"available",
"port",
"trying",
"the",
"specified",
"port",
"first",
"falling",
"back",
"on",
"an",
"OS",
"selected",
"port",
"."
] | [
"func",
"getAvailableTCPPort",
"(",
"port",
"int",
")",
"(",
"int",
",",
"error",
")",
"{",
"for",
"i",
":=",
"0",
";",
"i",
"<=",
"10",
";",
"i",
"++",
"{",
"ln",
",",
"err",
":=",
"net",
".",
"Listen",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Spr... |
5,687 | all-5688 | [
"resourceVSphereDatastoreClusterVMAntiAffinityRuleFindEntryByName",
"attempts",
"to",
"locate",
"an",
"existing",
"VM",
"anti",
"-",
"affinity",
"rule",
"in",
"a",
"datastore",
"cluster",
"s",
"configuration",
"by",
"name",
".",
"It",
"differs",
"from",
"the",
"standa... | [
"func",
"resourceVSphereDatastoreClusterVMAntiAffinityRuleFindEntryByName",
"(",
"pod",
"*",
"object",
".",
"StoragePod",
",",
"name",
"string",
",",
")",
"(",
"*",
"<mask>",
".",
"ClusterAntiAffinityRuleSpec",
",",
"error",
")",
"{",
"props",
",",
"err",
":=",
"s... |
5,688 | all-5689 | [
"AddPeer",
"adds",
"a",
"peer",
"to",
"the",
"peer",
"heap",
"."
] | [
"func",
"(",
"ph",
"*",
"peerHeap",
")",
"addPeer",
"(",
"peerScore",
"*",
"peerScore",
")",
"{",
"ph",
".",
"pushPeer",
"(",
"peerScore",
")",
"\n\n",
"// Pick a random element, and swap the order with that peerScore.",
"r",
":=",
"ph",
".",
"rng",
".",
"Intn",... |
5,689 | all-5690 | [
"GetTitleSize",
"returns",
"the",
"TitleSize",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"a",
"*",
"AlertGraphDefinition",
")",
"GetTitleSize",
"(",
")",
"string",
"{",
"if",
"a",
"==",
"nil",
"||",
"a",
".",
"TitleSize",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"<mask>",
"*",
"a",
".",
"TitleSize",
"\n",
"... |
5,690 | all-5691 | [
"EncryptedKey",
"returns",
"encrypted",
"keystore",
".",
"Key",
"in",
"base64",
"."
] | [
"func",
"EncryptedKey",
"(",
"pkey",
"*",
"ecdsa",
".",
"PrivateKey",
",",
"auth",
"string",
")",
"(",
"Base64String",
",",
"error",
")",
"{",
"key",
":=",
"keystore",
".",
"NewKeyForDirectICAP",
"(",
"rand",
".",
"Reader",
")",
"\n",
"key",
".",
"Addres... |
5,691 | all-5692 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"a",
"specified",
"program",
"object"
] | [
"func",
"ProgramUniform3uiv",
"(",
"program",
"uint32",
",",
"<mask>",
"int32",
",",
"count",
"int32",
",",
"value",
"*",
"uint32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpProgramUniform3uiv",
",",
"4",
",",
"uintptr",
"(",
"program",
")",
",",
"uint... |
5,692 | all-5693 | [
"SetCreatedAt",
"sets",
"the",
"timestamp",
"for",
"resource",
"s",
"creation",
"time"
] | [
"func",
"(",
"secret",
"*",
"SSMSecretResource",
")",
"SetCreatedAt",
"(",
"createdAt",
"time",
".",
"Time",
")",
"{",
"if",
"createdAt",
".",
"IsZero",
"(",
")",
"{",
"return",
"\n",
"}",
"\n",
"secret",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"de... |
5,693 | all-5694 | [
"MemoryInUse",
"returns",
"total",
"memory",
"used",
"by",
"all",
"Nitro",
"instances",
"in",
"the",
"current",
"process"
] | [
"func",
"MemoryInUse",
"(",
")",
"(",
"sz",
"int64",
")",
"{",
"buf",
":=",
"dbInstances",
".",
"MakeBuf",
"(",
")",
"\n",
"defer",
"dbInstances",
".",
"FreeBuf",
"(",
"buf",
")",
"\n",
"iter",
":=",
"dbInstances",
".",
"NewIterator",
"(",
"CompareNitro"... |
5,694 | all-5695 | [
"resourceVSphereComputeClusterVMAntiAffinityRuleObjects",
"handles",
"the",
"fetching",
"of",
"the",
"cluster",
"and",
"rule",
"key",
"depending",
"on",
"what",
"attributes",
"are",
"available",
":",
"*",
"If",
"the",
"resource",
"ID",
"is",
"available",
"the",
"dat... | [
"func",
"resourceVSphereComputeClusterVMAntiAffinityRuleObjects",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"meta",
"<mask>",
"{",
"}",
",",
")",
"(",
"*",
"object",
".",
"ClusterComputeResource",
",",
"int32",
",",
"error",
")",
"{",
"if",
"d",
".",
... |
5,695 | all-5696 | [
"SetTimeoutPerAttempt",
"sets",
"TimeoutPerAttempt",
"in",
"RetryOptions",
"."
] | [
"func",
"(",
"cb",
"*",
"ContextBuilder",
")",
"SetTimeoutPerAttempt",
"(",
"timeoutPerAttempt",
"<mask>",
".",
"Duration",
")",
"*",
"ContextBuilder",
"{",
"if",
"cb",
".",
"RetryOptions",
"==",
"nil",
"{",
"cb",
".",
"RetryOptions",
"=",
"&",
"RetryOptions",... |
5,696 | all-5697 | [
"GetExtFromCert",
"returns",
"the",
"extension",
"with",
"the",
"matching",
"OID",
"if",
"present",
".",
"If",
"the",
"extension",
"if",
"not",
"present",
"it",
"returns",
"nil",
"."
] | [
"func",
"GetExtFromCert",
"(",
"cert",
"*",
"x509",
".",
"Certificate",
",",
"oid",
"asn1",
".",
"ObjectIdentifier",
")",
"*",
"pkix",
".",
"Extension",
"{",
"for",
"i",
":=",
"<mask>",
"cert",
".",
"Extensions",
"{",
"if",
"oid",
".",
"Equal",
"(",
"c... |
5,697 | all-5698 | [
"Raw",
"returns",
"the",
"bytes",
"of",
"the",
"key"
] | [
"func",
"(",
"k",
"*",
"Secp256k1PrivateKey",
")",
"Raw",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"return",
"(",
"*",
"btcec",
".",
"PrivateKey",
")",
"(",
"k",
")",
".",
"Serialize",
"(",
")",
",",
"nil",
"\n",
"}"
] |
5,698 | all-5699 | [
"String",
"returns",
"a",
"formatted",
"string",
"representation",
"of",
"the",
"integer",
"range"
] | [
"func",
"(",
"r",
"*",
"InclusiveRange",
")",
"String",
"(",
")",
"string",
"{",
"var",
"buf",
"strings",
".",
"Builder",
"\n\n",
"// Always for a single value",
"buf",
".",
"WriteString",
"(",
"strconv",
".",
"Itoa",
"(",
"r",
".",
"Start",
"(",
")",
")... |
5,699 | all-5700 | [
"Acquire",
"checks",
"out",
"a",
"type",
"of",
"resource",
"in",
"certain",
"state",
"without",
"an",
"owner",
"and",
"move",
"the",
"checked",
"out",
"resource",
"to",
"the",
"end",
"of",
"the",
"resource",
"list",
".",
"In",
":",
"rtype",
"-",
"name",
... | [
"func",
"(",
"r",
"*",
"Ranch",
")",
"Acquire",
"(",
"rType",
",",
"state",
",",
"dest",
",",
"owner",
"string",
")",
"(",
"*",
"common",
".",
"Resource",
",",
"error",
")",
"{",
"r",
".",
"resourcesLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.