id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
1,400 | all-1401 | [
"HasLink",
"returns",
"whether",
"the",
"resource",
"has",
"a",
"link",
"with",
"the",
"given",
"name",
"."
] | [
"func",
"(",
"r",
"*",
"Resource",
")",
"HasLink",
"(",
"name",
"string",
")",
"bool",
"{",
"for",
"n",
",",
"_",
":=",
"range",
"r",
".",
"Links",
"{",
"if",
"n",
"==",
"name",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"<mas... |
1,401 | all-1402 | [
"Ellipse",
"draws",
"an",
"ellipse",
"using",
"a",
"path",
"with",
"center",
"(",
"cx",
"cy",
")",
"and",
"radius",
"(",
"rx",
"ry",
")"
] | [
"func",
"Ellipse",
"(",
"path",
"draw2d",
".",
"PathBuilder",
",",
"cx",
",",
"cy",
",",
"rx",
",",
"ry",
"float64",
")",
"{",
"<mask>",
".",
"ArcTo",
"(",
"cx",
",",
"cy",
",",
"rx",
",",
"ry",
",",
"0",
",",
"-",
"math",
".",
"Pi",
"*",
"2"... |
1,402 | all-1403 | [
"CopyTo",
"copies",
"src",
"cookie",
"to",
"c",
"."
] | [
"func",
"(",
"c",
"*",
"Cookie",
")",
"CopyTo",
"(",
"src",
"*",
"Cookie",
")",
"{",
"c",
".",
"Reset",
"(",
")",
"\n",
"c",
".",
"key",
"=",
"append",
"(",
"c",
".",
"key",
"[",
":",
"0",
"]",
",",
"src",
".",
"key",
"...",
")",
"\n",
"c... |
1,403 | all-1404 | [
"UpdateScreenboard",
"in",
"essence",
"takes",
"a",
"Screenboard",
"struct",
"and",
"persists",
"it",
"back",
"to",
"the",
"server",
".",
"Use",
"this",
"if",
"you",
"ve",
"updated",
"your",
"local",
"and",
"need",
"to",
"push",
"it",
"back",
"."
] | [
"func",
"(",
"client",
"*",
"<mask>",
")",
"UpdateScreenboard",
"(",
"board",
"*",
"Screenboard",
")",
"error",
"{",
"return",
"client",
".",
"doJsonRequest",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"board",
".",
"Id",
... |
1,404 | all-1405 | [
"Sum",
"returns",
"the",
"first",
"20",
"bytes",
"of",
"SHA256",
"of",
"the",
"bz",
"."
] | [
"func",
"Sum",
"(",
"bz",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"hash",
":=",
"sha256",
".",
"Sum256",
"(",
"bz",
")",
"\n",
"return",
"<mask>",
"[",
":",
"Size",
"]",
"\n",
"}"
] |
1,405 | all-1406 | [
"Fetch",
"queries",
"the",
"Consul",
"API",
"defined",
"by",
"the",
"given",
"client",
"and",
"returns",
"a",
"slice",
"of",
"CatalogService",
"objects",
"."
] | [
"func",
"(",
"d",
"*",
"CatalogServicesQuery",
")",
"Fetch",
"(",
"clients",
"*",
"ClientSet",
",",
"opts",
"*",
"QueryOptions",
")",
"(",
"interface",
"{",
"}",
",",
"*",
"ResponseMetadata",
",",
"error",
")",
"{",
"select",
"{",
"<mask>",
"<-",
"d",
... |
1,406 | all-1407 | [
"SetName",
"sets",
"header",
"name",
"of",
"current",
"instance",
"."
] | [
"func",
"(",
"s",
"*",
"HttpHeader",
")",
"SetName",
"(",
"<mask>",
"string",
")",
"*",
"HttpHeader",
"{",
"s",
".",
"Name",
"=",
"name",
"\n",
"return",
"s",
"\n",
"}"
] |
1,407 | all-1408 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"Bounds",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21",
"(",
"&",
"r",
","... |
1,408 | all-1409 | [
"cleanupResourceIfExists",
"checks",
"if",
"the",
"resource",
"exists",
"if",
"it",
"does",
"and",
"it",
"does",
"not",
"have",
"any",
"attached",
"resources",
"then",
"deletes",
"the",
"resource",
".",
"If",
"the",
"resource",
"does",
"not",
"exist",
"or",
... | [
"func",
"(",
"a",
"AzureClient",
")",
"cleanupResourceIfExists",
"(",
"r",
"cleanupResource",
")",
"error",
"{",
"f",
":=",
"r",
".",
"LogFields",
"(",
")",
"\n",
"log",
".",
"Info",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"r",
".",
"Resour... |
1,409 | all-1410 | [
"Open",
"takes",
"a",
"urlstr",
"like",
"protocol",
"+",
"transport",
":",
"//",
"user",
":",
"pass"
] | [
"func",
"Open",
"(",
"urlstr",
"string",
")",
"(",
"*",
"sql",
".",
"<mask>",
",",
"error",
")",
"{",
"u",
",",
"err",
":=",
"Parse",
"(",
"urlstr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"retu... |
1,410 | all-1411 | [
"Merge",
"combines",
"all",
"values",
"in",
"this",
"configuration",
"with",
"the",
"values",
"in",
"the",
"other",
"configuration",
"with",
"values",
"in",
"the",
"other",
"configuration",
"taking",
"precedence",
".",
"Maps",
"and",
"slices",
"are",
"merged",
... | [
"func",
"(",
"c",
"*",
"TemplateConfig",
")",
"Merge",
"(",
"o",
"*",
"TemplateConfig",
")",
"*",
"TemplateConfig",
"{",
"if",
"c",
"==",
"nil",
"{",
"if",
"o",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"o",
".",
"Copy",
"(",
... |
1,411 | all-1412 | [
"SetMnemonicModifier",
"is",
"a",
"wrapper",
"around",
"gtk_window_set_mnemonic_modifier",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Window",
")",
"SetMnemonicModifier",
"(",
"<mask>",
"gdk",
".",
"ModifierType",
")",
"{",
"C",
".",
"gtk_window_set_mnemonic_modifier",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GdkModifierType",
"(",
"mods",
")",
")",
"\... |
1,412 | all-1413 | [
"DeepCopy",
"copies",
"the",
"receiver",
"into",
"a",
"new",
"CIDR",
"."
] | [
"func",
"(",
"u",
"*",
"CIDR",
")",
"DeepCopy",
"(",
")",
"*",
"CIDR",
"{",
"if",
"u",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"<mask>",
"(",
"CIDR",
")",
"\n",
"u",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
"return",... |
1,413 | all-1414 | [
"CreateSnapshot",
"creates",
"a",
"volume",
"snapshot"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateSnapshot",
"(",
"dcid",
"string",
",",
"volid",
"string",
",",
"name",
"string",
",",
"description",
"string",
")",
"(",
"*",
"Snapshot",
",",
"error",
")",
"{",
"path",
":=",
"volumePath",
"(",
"dcid",
",",... |
1,414 | all-1415 | [
"DefaultCache",
"returns",
"the",
"default",
"BlobInfoCache",
"implementation",
"appropriate",
"for",
"sys",
"."
] | [
"func",
"DefaultCache",
"(",
"sys",
"*",
"<mask>",
".",
"SystemContext",
")",
"types",
".",
"BlobInfoCache",
"{",
"dir",
",",
"err",
":=",
"blobInfoCacheDir",
"(",
"sys",
",",
"getRootlessUID",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logrus"... |
1,415 | all-1416 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"a",
"specified",
"program",
"object"
] | [
"func",
"ProgramUniform1i",
"(",
"program",
"uint32",
",",
"<mask>",
"int32",
",",
"v0",
"int32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpProgramUniform1i",
",",
"3",
",",
"uintptr",
"(",
"program",
")",
",",
"uintptr",
"(",
"location",
")",
",",
"u... |
1,416 | all-1417 | [
"title",
":",
"list",
"provisioners",
"path",
":",
"/",
"provisioner",
"method",
":",
"GET",
"produce",
":",
"application",
"/",
"json",
"responses",
":",
"200",
":",
"Ok",
"204",
":",
"No",
"Content",
"401",
":",
"Unauthorized"
] | [
"func",
"provisionerList",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"t",
"auth",
".",
"Token",
")",
"(",
"err",
"error",
")",
"{",
"allowed",
":=",
"permission",
".",
"Check",
"(",
"t",
",",
"permission",
"... |
1,417 | all-1418 | [
"NewAccountEntryExt",
"creates",
"a",
"new",
"AccountEntryExt",
"."
] | [
"func",
"NewAccountEntryExt",
"(",
"v",
"int32",
",",
"value",
"interface",
"{",
"}",
")",
"(",
"result",
"AccountEntryExt",
",",
"err",
"error",
")",
"{",
"<mask>",
".",
"V",
"=",
"v",
"\n",
"switch",
"int32",
"(",
"v",
")",
"{",
"case",
"0",
":",
... |
1,418 | all-1419 | [
"RatioForMatrix",
"returns",
"the",
"Levenshtein",
"ratio",
"for",
"the",
"given",
"matrix",
".",
"The",
"ratio",
"is",
"computed",
"as",
"follows",
":",
"(",
"sourceLength",
"+",
"targetLength",
"-",
"distance",
")",
"/",
"(",
"sourceLength",
"+",
"targetLeng... | [
"func",
"RatioForMatrix",
"(",
"matrix",
"[",
"]",
"[",
"]",
"int",
")",
"float64",
"{",
"sourcelength",
":=",
"len",
"(",
"matrix",
")",
"-",
"1",
"\n",
"targetlength",
":=",
"len",
"(",
"matrix",
"[",
"0",
"]",
")",
"-",
"1",
"\n",
"<mask>",
":="... |
1,419 | all-1420 | [
"MarshalString",
"appends",
"the",
"string",
"to",
"the",
"buffer",
"with",
"a",
"size",
"prefix",
"and",
"correct",
"padding",
"."
] | [
"func",
"(",
"m",
"*",
"Marshaller",
")",
"MarshalString",
"(",
"s",
"string",
")",
"{",
"if",
"m",
".",
"Error",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"len",
"(",
"m",
".",
"Data",
")",
"<",
"m",
".",
"offset",
"+",
"4",
"+",
"l... |
1,420 | all-1421 | [
"WriteLen16String",
"writes",
"a",
"16",
"-",
"bit",
"length",
"preceded",
"string"
] | [
"func",
"(",
"w",
"*",
"WriteBuffer",
")",
"WriteLen16String",
"(",
"s",
"<mask>",
")",
"{",
"if",
"int",
"(",
"uint16",
"(",
"len",
"(",
"s",
")",
")",
")",
"!=",
"len",
"(",
"s",
")",
"{",
"w",
".",
"setErr",
"(",
"errStringTooLong",
")",
"\n",... |
1,421 | all-1422 | [
"EmbedReader",
"embeds",
"the",
"images",
"to",
"the",
"email",
"."
] | [
"func",
"(",
"m",
"*",
"Message",
")",
"EmbedReader",
"(",
"name",
"string",
",",
"r",
"io",
".",
"Reader",
",",
"settings",
"...",
"FileSetting",
")",
"{",
"m",
".",
"embedded",
"=",
"m",
".",
"appendFile",
"(",
"m",
".",
"embedded",
",",
"fileFromR... |
1,422 | all-1423 | [
"go",
":",
"generate",
"go",
"run",
"internal",
"/",
"generate",
"-",
"commands",
"/",
"main",
".",
"go",
"-",
"o",
"commands",
".",
"go"
] | [
"func",
"stringifyArg",
"(",
"name",
",",
"typ",
"string",
",",
"v",
"interface",
"{",
"}",
")",
"string",
"{",
"switch",
"typ",
"{",
"case",
"\"",
"\"",
":",
"if",
"!",
"v",
".",
"(",
"bool",
")",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"else",
... |
1,423 | all-1424 | [
"resourceVSphereDatastoreClusterGetPod",
"gets",
"the",
"StoragePod",
"from",
"the",
"ID",
"in",
"the",
"supplied",
"ResourceData",
"."
] | [
"func",
"resourceVSphereDatastoreClusterGetPod",
"(",
"d",
"structure",
".",
"ResourceIDStringer",
",",
"meta",
"<mask>",
"{",
"}",
")",
"(",
"*",
"object",
".",
"StoragePod",
",",
"error",
")",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"resourceVSphe... |
1,424 | all-1425 | [
"initialAdvertise",
"will",
"do",
"the",
"initial",
"Advertise",
"call",
"to",
"Hyperbahn",
"with",
"additional",
"retries",
"on",
"top",
"of",
"the",
"built",
"-",
"in",
"TChannel",
"retries",
".",
"It",
"will",
"use",
"exponential",
"backoff",
"between",
"ea... | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"initialAdvertise",
"(",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"for",
"attempt",
":=",
"uint",
"(",
"0",
")",
";",
"attempt",
"<",
"maxAdvertiseFailures",
";",
"attempt",
"++",
"{",
"err",
"=",
"c",
"."... |
1,425 | all-1426 | [
"seekNextFrame",
"seeks",
"the",
"next",
"frame",
"and",
"returns",
"the",
"new",
"buffer",
"with",
"the",
"new",
"position",
".",
"seekNextFrame",
"also",
"returns",
"true",
"when",
"seeking",
"is",
"successful",
"or",
"false",
"otherwise",
".",
"Seeking",
"i... | [
"func",
"seekNextFrame",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"(",
"[",
"]",
"byte",
",",
"bool",
")",
"{",
"// TODO: Need to skip tags explicitly? (hajimehoshi/go-mp3#9)",
"if",
"len",
"(",
"buf",
")",
"<",
"1",
"{",
"return",
"nil",
",",
"false",
"\n",
"... |
1,426 | all-1427 | [
"Return",
"a",
"string",
"representation",
"of",
"a",
"QueryTiming",
"span",
"operation",
"."
] | [
"func",
"(",
"s",
"QueryTiming",
")",
"SpanOperation",
"(",
")",
"string",
"{",
"switch",
"s",
"{",
"case",
"EvalTotalTime",
":",
"return",
"\"",
"\"",
"\n",
"case",
"ResultSortTime",
":",
"return",
"\"",
"\"",
"\n",
"case",
"QueryPreparationTime",
":",
"r... |
1,427 | all-1428 | [
"RequiredMatchersFilter",
"returns",
"a",
"storage",
".",
"Queryable",
"which",
"creates",
"a",
"requiredMatchersQuerier",
"."
] | [
"func",
"RequiredMatchersFilter",
"(",
"next",
"storage",
".",
"Queryable",
",",
"required",
"[",
"]",
"*",
"labels",
".",
"Matcher",
")",
"storage",
".",
"Queryable",
"{",
"return",
"storage",
".",
"QueryableFunc",
"(",
"func",
"(",
"ctx",
"context",
".",
... |
1,428 | all-1429 | [
"Step",
"4",
"is",
"the",
"undoubling",
"of",
"double",
"non",
"-",
"vowel",
"endings",
"and",
"removal",
"of",
"superlative",
"endings",
"."
] | [
"func",
"step4",
"(",
"word",
"*",
"snowballword",
".",
"SnowballWord",
")",
"bool",
"{",
"// (1) Undouble \"н\", or, 2) if the word ends with a SUPERLATIVE ending,",
"// (remove it and undouble н n), or 3) if the word ends ь (') (soft sign)",
"// remove it.",
"// Undouble \"н\"",
"if"... |
1,429 | all-1430 | [
"StringToColor",
"returns",
"attribute",
"by",
"its",
"string",
"description",
".",
"Description",
"is",
"the",
"list",
"of",
"attributes",
"separated",
"with",
"spaces",
"plus",
"or",
"pipe",
"symbols",
".",
"You",
"can",
"use",
"8",
"base",
"colors",
":",
... | [
"func",
"StringToColor",
"(",
"str",
"string",
")",
"term",
".",
"Attribute",
"{",
"var",
"parts",
"[",
"]",
"string",
"\n",
"if",
"strings",
".",
"ContainsRune",
"(",
"str",
",",
"'+'",
")",
"{",
"parts",
"=",
"strings",
".",
"Split",
"(",
"str",
",... |
1,430 | all-1431 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SetNodeNameReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom4",
"(",
"&",
"r"... |
1,431 | all-1432 | [
"createConfigChangeEnts",
"creates",
"a",
"series",
"of",
"Raft",
"entries",
"(",
"i",
".",
"e",
".",
"EntryConfChange",
")",
"to",
"remove",
"the",
"set",
"of",
"given",
"IDs",
"from",
"the",
"cluster",
".",
"The",
"ID",
"self",
"is",
"_not_",
"removed",
... | [
"func",
"createConfigChangeEnts",
"(",
"lg",
"*",
"zap",
".",
"Logger",
",",
"ids",
"[",
"]",
"uint64",
",",
"self",
"uint64",
",",
"term",
",",
"index",
"uint64",
")",
"[",
"]",
"raftpb",
".",
"Entry",
"{",
"ents",
":=",
"make",
"(",
"[",
"]",
"ra... |
1,432 | all-1433 | [
"DeleteCollection",
"deletes",
"a",
"collection",
"of",
"objects",
"."
] | [
"func",
"(",
"c",
"*",
"FakeApps",
")",
"DeleteCollection",
"(",
"options",
"*",
"v1",
".",
"DeleteOptions",
",",
"listOptions",
"v1",
".",
"ListOptions",
")",
"error",
"{",
"<mask>",
":=",
"testing",
".",
"NewDeleteCollectionAction",
"(",
"appsResource",
",",... |
1,433 | all-1434 | [
"void",
"pango_cairo_layout_line_path",
"(",
"cairo_t",
"*",
"cr",
"PangoLayoutLine",
"*",
"line",
")",
";"
] | [
"func",
"CairoLayoutLinePath",
"(",
"cr",
"*",
"cairo",
".",
"<mask>",
",",
"line",
"*",
"LayoutLine",
")",
"{",
"C",
".",
"pango_cairo_layout_line_path",
"(",
"cairo_context",
"(",
"cr",
")",
",",
"line",
".",
"native",
"(",
")",
")",
"\n",
"}"
] |
1,434 | all-1435 | [
"Rollback",
"a",
"transaction",
"after",
"the",
"given",
"error",
"occurred",
".",
"If",
"the",
"rollback",
"succeeds",
"the",
"given",
"error",
"is",
"returned",
"otherwise",
"a",
"new",
"error",
"that",
"wraps",
"it",
"gets",
"generated",
"and",
"returned",
... | [
"func",
"rollback",
"(",
"tx",
"*",
"sql",
".",
"Tx",
",",
"reason",
"error",
")",
"error",
"{",
"err",
":=",
"<mask>",
".",
"Rollback",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logger",
".",
"Warnf",
"(",
"\"",
"\"",
",",
"reason",
",",
... |
1,435 | all-1436 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"RareBooleanData",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot3",
"(",
"&",
... |
1,436 | all-1437 | [
"Get",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockCache",
")",
"Get",
"(",
"arg0",
"string",
")",
"(",
"async",
".",
"Value",
",",
"bool",
")",
"{",
"<mask>",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret0",
",",
"_",... |
1,437 | all-1438 | [
"GarbageCollect",
"takes",
"a",
"lock",
"triggers",
"a",
"GC",
"and",
"invokes",
"the",
"accumulated",
"GC",
"callbacks",
"."
] | [
"func",
"(",
"peers",
"*",
"Peers",
")",
"GarbageCollect",
"(",
")",
"{",
"peers",
".",
"Lock",
"(",
")",
"\n",
"<mask>",
"pending",
"peersPendingNotifications",
"\n",
"defer",
"peers",
".",
"unlockAndNotify",
"(",
"&",
"pending",
")",
"\n\n",
"peers",
"."... |
1,438 | all-1439 | [
"create",
"a",
"dynect",
"client",
"and",
"performs",
"login",
".",
"You",
"need",
"to",
"clean",
"it",
"up",
".",
"This",
"method",
"also",
"stores",
"the",
"DynAPI",
"version",
".",
"Don",
"t",
"user",
"the",
"dynect",
".",
"Client",
".",
"Login",
"(... | [
"func",
"(",
"d",
"*",
"dynProviderState",
")",
"login",
"(",
")",
"(",
"*",
"dynect",
".",
"Client",
",",
"error",
")",
"{",
"if",
"d",
".",
"LastLoginErrorTime",
"!=",
"0",
"{",
"secondsSinceLastError",
":=",
"unixNow",
"(",
")",
"-",
"d",
".",
"La... |
1,439 | all-1440 | [
"FindCharsetInHTML",
"looks",
"for",
"charset",
"in",
"the",
"HTML",
"meta",
"tag",
"(",
"v4",
".",
"01",
"and",
"v5",
")",
"."
] | [
"func",
"FindCharsetInHTML",
"(",
"html",
"string",
")",
"string",
"{",
"charsetMatches",
":=",
"metaTagCharsetRegexp",
".",
"FindAllStringSubmatch",
"(",
"<mask>",
",",
"-",
"1",
")",
"\n",
"if",
"len",
"(",
"charsetMatches",
")",
">",
"0",
"{",
"return",
"... |
1,440 | all-1441 | [
"Query",
"executes",
"a",
"query",
"."
] | [
"func",
"(",
"s",
"*",
"Session",
")",
"Query",
"(",
"stmtID",
"uint64",
",",
"prmFieldSet",
"*",
"ParameterFieldSet",
",",
"resultFieldSet",
"*",
"ResultFieldSet",
",",
"args",
"[",
"]",
"driver",
".",
"NamedValue",
")",
"(",
"uint64",
",",
"*",
"FieldVal... |
1,441 | all-1442 | [
"MetadataAsStringSlice",
"parses",
"the",
"Response",
"metadata",
"into",
"a",
"slice",
"of",
"string"
] | [
"func",
"(",
"r",
"*",
"<mask>",
")",
"MetadataAsStringSlice",
"(",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"sl",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"err",
":=",
"r",
".",
"MetadataAsStruct",
"(",
"&",
"sl",
")",
"\n",
"if",
... |
1,442 | all-1443 | [
"Observe",
"observes",
"an",
"event",
"for",
"given",
"id",
".",
"It",
"returns",
"false",
"and",
"exceeded",
"duration",
"if",
"the",
"interval",
"is",
"longer",
"than",
"the",
"expectation",
"."
] | [
"func",
"(",
"td",
"*",
"TimeoutDetector",
")",
"Observe",
"(",
"which",
"uint64",
")",
"(",
"bool",
",",
"time",
".",
"Duration",
")",
"{",
"td",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"td",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
... |
1,443 | all-1444 | [
"Value",
"retrieves",
"the",
"value",
"of",
"the",
"item",
"from",
"the",
"value",
"log",
".",
"This",
"method",
"must",
"be",
"called",
"within",
"a",
"transaction",
".",
"Calling",
"it",
"outside",
"a",
"transaction",
"is",
"considered",
"undefined",
"beha... | [
"func",
"(",
"item",
"*",
"Item",
")",
"Value",
"(",
"fn",
"func",
"(",
"val",
"[",
"]",
"byte",
")",
"error",
")",
"error",
"{",
"item",
".",
"wg",
".",
"Wait",
"(",
")",
"\n",
"if",
"item",
".",
"<mask>",
"==",
"prefetched",
"{",
"if",
"item"... |
1,444 | all-1445 | [
"Exec",
"executes",
"the",
"disposeCommand",
"."
] | [
"func",
"(",
"c",
"*",
"disposeCommand",
")",
"Exec",
"(",
"indexOffset",
"int",
")",
"error",
"{",
"c",
".",
"<mask>",
".",
"image",
".",
"Dispose",
"(",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
1,445 | all-1446 | [
"HasShared",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"Screenboard",
")",
"HasShared",
"(",
")",
"bool",
"{",
"if",
"s",
"!=",
"nil",
"&&",
"s",
".",
"Shared",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
1,446 | all-1447 | [
"Close",
"stops",
"all",
"servers",
"by",
"calling",
"Close",
"method",
"on",
"each",
"of",
"them",
"."
] | [
"func",
"(",
"s",
"*",
"Servers",
")",
"Close",
"(",
")",
"{",
"wg",
":=",
"&",
"sync",
".",
"WaitGroup",
"{",
"}",
"\n",
"for",
"_",
",",
"srv",
":=",
"range",
"s",
".",
"servers",
"{",
"wg",
".",
"Add",
"(",
"1",
")",
"\n",
"<mask>",
"func"... |
1,447 | all-1448 | [
"Do",
"executes",
"ServiceWorker",
".",
"setForceUpdateOnPageLoad",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetForceUpdateOnPageLoadParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetForceUpdateOnPageLoad",
",",
"p",
",",
"nil",
")",
... |
1,448 | all-1449 | [
"StartMockServersOnNetwork",
"creates",
"mock",
"servers",
"on",
"either",
"tcp",
"or",
"unix",
"sockets",
"."
] | [
"func",
"StartMockServersOnNetwork",
"(",
"count",
"int",
",",
"network",
"string",
")",
"(",
"ms",
"*",
"MockServers",
",",
"err",
"error",
")",
"{",
"switch",
"network",
"{",
"case",
"\"",
"\"",
":",
"return",
"startMockServersTcp",
"(",
"count",
")",
"\... |
1,449 | all-1450 | [
"expandCustomizationGuiUnattended",
"reads",
"certain",
"ResourceData",
"keys",
"and",
"returns",
"a",
"CustomizationGuiUnattended",
"."
] | [
"func",
"expandCustomizationGuiUnattended",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
")",
"types",
".",
"CustomizationGuiUnattended",
"{",
"obj",
":=",
"types",
".",
"CustomizationGuiUnattended",
"{",
"TimeZone",
":",
"int32",
"(",
"d",
".",
"Get",
"(",
"cW... |
1,450 | all-1451 | [
"lookupDockerUser",
"looks",
"up",
"users",
"given",
"the",
"argument",
"to",
"a",
"Dockerfile",
"USER",
"directive",
".",
"According",
"to",
"Docker",
"s",
"docs",
"this",
"directive",
"looks",
"like",
":",
"USER",
"<user",
">",
"[",
":",
"<group",
">",
"... | [
"func",
"lookupDockerUser",
"(",
"userArg",
"string",
")",
"(",
"_",
"*",
"user",
".",
"User",
",",
"retErr",
"error",
")",
"{",
"userParts",
":=",
"strings",
".",
"Split",
"(",
"userArg",
",",
"\"",
"\"",
")",
"\n",
"userOrUID",
":=",
"userParts",
"["... |
1,451 | all-1452 | [
"title",
":",
"profile",
"index",
"handler",
"path",
":",
"/",
"debug",
"/",
"pprof",
"method",
":",
"GET",
"responses",
":",
"200",
":",
"Ok",
"401",
":",
"Unauthorized"
] | [
"func",
"indexHandler",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"<mask>",
",",
"t",
"auth",
".",
"Token",
")",
"error",
"{",
"if",
"!",
"permission",
".",
"Check",
"(",
"t",
",",
"permission",
".",
"PermDebug",
")",
"{",
... |
1,452 | all-1453 | [
"flattenVirtualMachineConfigInfo",
"reads",
"various",
"fields",
"from",
"a",
"VirtualMachineConfigInfo",
"into",
"the",
"passed",
"in",
"ResourceData",
".",
"This",
"is",
"the",
"flatten",
"counterpart",
"to",
"expandVirtualMachineConfigSpec",
"."
] | [
"func",
"flattenVirtualMachineConfigInfo",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"obj",
"*",
"types",
".",
"VirtualMachineConfigInfo",
")",
"error",
"{",
"d",
".",
"Set",
"(",
"\"",
"\"",
",",
"obj",
".",
"Name",
")",
"\n",
"d",
".",
"Set",
... |
1,453 | all-1454 | [
"Description",
"returns",
"user",
"defined",
"description",
"for",
"the",
"snapshot",
"."
] | [
"func",
"(",
"s",
"*",
"Snapshot",
")",
"Description",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"<mask>",
"err",
"C",
".",
"VixError",
"=",
"C",
".",
"VIX_OK",
"\n",
"var",
"desc",
"*",
"C",
".",
"char",
"\n\n",
"err",
"=",
"C",
".",
"g... |
1,454 | all-1455 | [
"min",
"tests",
"whether",
"a",
"variable",
"value",
"is",
"larger",
"or",
"equal",
"to",
"a",
"given",
"number",
".",
"For",
"number",
"types",
"it",
"s",
"a",
"simple",
"lesser",
"-",
"than",
"test",
";",
"for",
"strings",
"it",
"tests",
"the",
"numb... | [
"func",
"hasMinOf",
"(",
"top",
"interface",
"{",
"}",
",",
"current",
"interface",
"{",
"}",
",",
"<mask>",
"interface",
"{",
"}",
",",
"param",
"string",
")",
"bool",
"{",
"return",
"isGte",
"(",
"top",
",",
"current",
",",
"field",
",",
"param",
"... |
1,455 | all-1456 | [
"ChompRightF",
"is",
"the",
"filter",
"form",
"of",
"ChompRight",
"."
] | [
"func",
"ChompRightF",
"(",
"suffix",
"string",
")",
"func",
"(",
"string",
")",
"string",
"{",
"return",
"func",
"(",
"s",
"<mask>",
")",
"string",
"{",
"return",
"ChompRight",
"(",
"s",
",",
"suffix",
")",
"\n",
"}",
"\n",
"}"
] |
1,456 | all-1457 | [
"handleReviewEvent",
"should",
"only",
"handle",
"reviews",
"that",
"have",
"no",
"approval",
"command",
".",
"Reviews",
"with",
"approval",
"commands",
"will",
"be",
"handled",
"by",
"handleGenericCommentEvent",
"."
] | [
"func",
"handleReviewEvent",
"(",
"pc",
"plugins",
".",
"Agent",
",",
"re",
"github",
".",
"ReviewEvent",
")",
"error",
"{",
"return",
"handleReview",
"(",
"<mask>",
".",
"Logger",
",",
"pc",
".",
"GitHubClient",
",",
"pc",
".",
"OwnersClient",
",",
"pc",
... |
1,457 | all-1458 | [
"Sign",
"adds",
"the",
"username",
"and",
"password",
"authorization",
"cookies",
"to",
"the",
"request",
".",
"Checks",
"the",
"freshness",
"of",
"the",
"session",
"and",
"creates",
"a",
"new",
"one",
"if",
"needed",
"."
] | [
"func",
"(",
"s",
"*",
"cookieSigner",
")",
"Sign",
"(",
"req",
"*",
"http",
".",
"<mask>",
")",
"error",
"{",
"if",
"time",
".",
"Now",
"(",
")",
".",
"After",
"(",
"s",
".",
"refreshAt",
")",
"{",
"authReq",
",",
"authErr",
":=",
"s",
".",
"b... |
1,458 | all-1459 | [
"ListBranch",
"lists",
"the",
"active",
"branches",
"on",
"a",
"Repo",
"."
] | [
"func",
"(",
"c",
"APIClient",
")",
"ListBranch",
"(",
"repoName",
"string",
")",
"(",
"[",
"]",
"*",
"pfs",
".",
"BranchInfo",
",",
"<mask>",
")",
"{",
"branchInfos",
",",
"err",
":=",
"c",
".",
"PfsAPIClient",
".",
"ListBranch",
"(",
"c",
".",
"Ctx... |
1,459 | all-1460 | [
"Gauge",
"fetches",
"an",
"instrument",
"from",
"the",
"registry",
"or",
"creates",
"a",
"new",
"one",
".",
"If",
"another",
"instrument",
"type",
"is",
"already",
"registered",
"with",
"the",
"same",
"name",
"/",
"tags",
"a",
"blank",
"one",
"will",
"be",... | [
"func",
"(",
"r",
"*",
"Registry",
")",
"Gauge",
"(",
"<mask>",
"string",
",",
"tags",
"[",
"]",
"string",
")",
"*",
"Gauge",
"{",
"return",
"r",
".",
"fetchGauge",
"(",
"name",
",",
"tags",
",",
"newGauge",
")",
"\n",
"}"
] |
1,460 | all-1461 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetResponseBodyReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoFetch4",
"(",
"&",
"w",
",",
"v",
... |
1,461 | all-1462 | [
"RateLimit",
"is",
"a",
"Gin",
"middleware",
"for",
"rate",
"limitting",
"incoming",
"requests",
"based",
"on",
"the",
"client",
"s",
"IP",
"address",
".",
"The",
"resulting",
"middleware",
"will",
"use",
"the",
"client",
"to",
"talk",
"to",
"the",
"Redis",
... | [
"func",
"RateLimit",
"(",
"client",
"*",
"redis",
".",
"Client",
",",
"hasher",
"speedbump",
".",
"RateHasher",
",",
"max",
"int64",
")",
"gin",
".",
"HandlerFunc",
"{",
"limiter",
":=",
"speedbump",
".",
"NewLimiter",
"(",
"<mask>",
",",
"hasher",
",",
... |
1,462 | all-1463 | [
"ID",
"generates",
"a",
"base64",
"encoded",
"URL",
"safe",
"unique",
"ID",
"using",
"crypto",
"/",
"rand",
".",
"This",
"is",
"a",
"cryptographically",
"secure",
"pseudorandom",
"number",
"presented",
"as",
"an",
"unpadded",
"base64",
"encoded",
"string",
"."... | [
"func",
"ID",
"(",
"bits",
"int",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"math",
".",
"Mod",
"(",
"float64",
"(",
"bits",
")",
",",
"8",
")",
"!=",
"0",
"{",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
... |
1,463 | all-1464 | [
"Go",
"is",
"much",
"like",
"go",
":",
"it",
"runs",
"a",
"function",
"in",
"a",
"newly",
"spawned",
"goroutine",
".",
"The",
"neat",
"part",
"of",
"Go",
"is",
"that",
"it",
"provides",
"Process",
"object",
"to",
"communicate",
"between",
"the",
"functio... | [
"func",
"Go",
"(",
"f",
"ProcessFunc",
")",
"<mask>",
"{",
"// return GoChild(Background(), f)",
"// we use two processes, one for communication, and",
"// one for ensuring we wait on the function (unclosable from the outside).",
"p",
":=",
"newProcess",
"(",
"nil",
")",
"\n",
"w... |
1,464 | all-1465 | [
"GetEncodedResponse",
"returns",
"the",
"response",
"body",
"and",
"size",
"if",
"it",
"were",
"re",
"-",
"encoded",
"with",
"the",
"specified",
"settings",
".",
"Only",
"applies",
"to",
"images",
".",
"See",
":",
"https",
":",
"//",
"chromedevtools",
".",
... | [
"func",
"GetEncodedResponse",
"(",
"requestID",
"<mask>",
".",
"RequestID",
",",
"encoding",
"GetEncodedResponseEncoding",
")",
"*",
"GetEncodedResponseParams",
"{",
"return",
"&",
"GetEncodedResponseParams",
"{",
"RequestID",
":",
"requestID",
",",
"Encoding",
":",
"... |
1,465 | all-1466 | [
"SetHost",
"sets",
"host",
"for",
"the",
"uri",
"."
] | [
"func",
"(",
"u",
"*",
"URI",
")",
"SetHost",
"(",
"<mask>",
"string",
")",
"{",
"u",
".",
"host",
"=",
"append",
"(",
"u",
".",
"host",
"[",
":",
"0",
"]",
",",
"host",
"...",
")",
"\n",
"lowercaseBytes",
"(",
"u",
".",
"host",
")",
"\n",
"}... |
1,466 | all-1467 | [
"HandleFunc",
"registers",
"the",
"handler",
"function",
"for",
"the",
"given",
"pattern",
"."
] | [
"func",
"(",
"mux",
"*",
"LoggingServeMux",
")",
"HandleFunc",
"(",
"pattern",
"string",
",",
"handler",
"func",
"(",
"http",
".",
"ResponseWriter",
",",
"*",
"http",
".",
"<mask>",
")",
")",
"{",
"mux",
".",
"serveMux",
".",
"Handle",
"(",
"pattern",
... |
1,467 | all-1468 | [
"validateNoIPCollisions",
"ensures",
"no",
"conflicts",
"between",
"the",
"host",
"s",
"network",
"interfaces",
"and",
"the",
"vbox",
"host",
"-",
"only",
"network",
"that",
"will",
"be",
"used",
"for",
"machine",
"vm",
"instances",
"."
] | [
"func",
"validateNoIPCollisions",
"(",
"hif",
"HostInterfaces",
",",
"hostOnlyNet",
"*",
"<mask>",
".",
"IPNet",
",",
"currHostOnlyNets",
"map",
"[",
"string",
"]",
"*",
"hostOnlyNetwork",
")",
"error",
"{",
"hostOnlyByCIDR",
":=",
"map",
"[",
"string",
"]",
"... |
1,468 | all-1469 | [
"RemoveENIAttachment",
"removes",
"the",
"eni",
"from",
"state",
"and",
"stop",
"managing"
] | [
"func",
"(",
"state",
"*",
"DockerTaskEngineState",
")",
"RemoveENIAttachment",
"(",
"mac",
"string",
")",
"{",
"if",
"mac",
"==",
"\"",
"\"",
"{",
"log",
".",
"Debug",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
"state",
".",
"<mask>",
".... |
1,469 | all-1470 | [
"NetworkErrored",
"sets",
"the",
"state",
"of",
"the",
"given",
"network",
"to",
"Errored",
"."
] | [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"NetworkErrored",
"(",
"name",
"string",
")",
"error",
"{",
"return",
"c",
".",
"networkState",
"(",
"<mask>",
",",
"networkErrored",
")",
"\n",
"}"
] |
1,470 | all-1471 | [
"ServeHTTP",
"adds",
"compression",
"to",
"the",
"original",
"http",
".",
"Handler",
"s",
"ServeHTTP",
"()",
"method",
"."
] | [
"func",
"(",
"c",
"CompressionHandler",
")",
"ServeHTTP",
"(",
"<mask>",
"http",
".",
"ResponseWriter",
",",
"req",
"*",
"http",
".",
"Request",
")",
"{",
"compWriter",
":=",
"newCompressedResponseWriter",
"(",
"writer",
",",
"req",
")",
"\n",
"c",
".",
"H... |
1,471 | all-1472 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"Module",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory7",
"(",
"&",
"r",
",",
... |
1,472 | all-1473 | [
"goFileInfo",
"returns",
"information",
"about",
"a",
".",
"go",
"file",
".",
"It",
"will",
"parse",
"part",
"of",
"the",
"file",
"to",
"determine",
"the",
"package",
"name",
"imports",
"and",
"build",
"constraints",
".",
"If",
"the",
"file",
"can",
"t",
... | [
"func",
"goFileInfo",
"(",
"path",
",",
"rel",
"string",
")",
"fileInfo",
"{",
"info",
":=",
"fileNameInfo",
"(",
"path",
")",
"\n",
"fset",
":=",
"token",
".",
"NewFileSet",
"(",
")",
"\n",
"pf",
",",
"err",
":=",
"parser",
".",
"ParseFile",
"(",
"f... |
1,473 | all-1474 | [
"Build",
"is",
"called",
"initially",
"when",
"creating",
"ccBalancerWrapper",
".",
"grpc",
".",
"Dial",
"is",
"called",
"to",
"this",
"client",
"connection",
".",
"Then",
"resolved",
"addresses",
"will",
"be",
"handled",
"via",
"HandleResolvedAddrs",
"."
] | [
"func",
"(",
"b",
"*",
"builder",
")",
"Build",
"(",
"cc",
"balancer",
".",
"ClientConn",
",",
"opt",
"balancer",
".",
"BuildOptions",
")",
"balancer",
".",
"Balancer",
"{",
"bb",
":=",
"&",
"baseBalancer",
"{",
"id",
":",
"strconv",
".",
"FormatInt",
... |
1,474 | all-1475 | [
"Update",
"updates",
"the",
"metadata",
"file",
"after",
"container",
"starts",
"and",
"dynamic",
"metadata",
"is",
"available"
] | [
"func",
"(",
"manager",
"*",
"metadataManager",
")",
"Update",
"(",
"ctx",
"context",
".",
"Context",
",",
"dockerID",
"string",
",",
"task",
"*",
"apitask",
".",
"Task",
",",
"containerName",
"string",
")",
"error",
"{",
"// Get docker container information thr... |
1,475 | all-1476 | [
"Equals",
"returns",
"true",
"if",
"other",
"is",
"equivalent",
"to",
"a"
] | [
"func",
"(",
"a",
"Asset",
")",
"Equals",
"(",
"other",
"Asset",
")",
"bool",
"{",
"if",
"a",
".",
"Type",
"!=",
"other",
".",
"Type",
"{",
"return",
"false",
"\n",
"}",
"\n",
"switch",
"a",
".",
"Type",
"{",
"<mask>",
"AssetTypeAssetTypeNative",
":"... |
1,476 | all-1477 | [
"Delete",
"takes",
"name",
"of",
"the",
"app",
"and",
"deletes",
"it",
".",
"Returns",
"an",
"error",
"if",
"one",
"occurs",
"."
] | [
"func",
"(",
"c",
"*",
"apps",
")",
"Delete",
"(",
"name",
"string",
",",
"options",
"*",
"meta_v1",
".",
"DeleteOptions",
")",
"error",
"{",
"return",
"c",
".",
"<mask>",
".",
"Delete",
"(",
")",
".",
"Namespace",
"(",
"c",
".",
"ns",
")",
".",
... |
1,477 | all-1478 | [
"OCI1FromManifest",
"creates",
"an",
"OCI1",
"manifest",
"instance",
"from",
"a",
"manifest",
"blob",
"."
] | [
"func",
"OCI1FromManifest",
"(",
"manifest",
"[",
"]",
"<mask>",
")",
"(",
"*",
"OCI1",
",",
"error",
")",
"{",
"oci1",
":=",
"OCI1",
"{",
"}",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"manifest",
",",
"&",
"oci1",
")",
";",
"err",
... |
1,478 | all-1479 | [
"Enumerate",
"peeks",
"at",
"each",
"element",
"of",
"this",
"queue",
"without",
"mutating",
"it",
"."
] | [
"func",
"(",
"q",
"*",
"Queue",
")",
"Enumerate",
"(",
"cancel",
"<-",
"chan",
"struct",
"{",
"}",
")",
"Enumerator",
"{",
"q",
".",
"key",
".",
"RLock",
"(",
")",
"\n",
"defer",
"q",
".",
"<mask>",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"q",
... |
1,479 | all-1480 | [
"SeekAnimations",
"seek",
"a",
"set",
"of",
"animations",
"to",
"a",
"particular",
"time",
"within",
"each",
"animation",
".",
"See",
":",
"https",
":",
"//",
"chromedevtools",
".",
"github",
".",
"io",
"/",
"devtools",
"-",
"protocol",
"/",
"tot",
"/",
... | [
"func",
"SeekAnimations",
"(",
"animations",
"[",
"]",
"<mask>",
",",
"currentTime",
"float64",
")",
"*",
"SeekAnimationsParams",
"{",
"return",
"&",
"SeekAnimationsParams",
"{",
"Animations",
":",
"animations",
",",
"CurrentTime",
":",
"currentTime",
",",
"}",
... |
1,480 | all-1481 | [
"OperationAdd",
"adds",
"a",
"new",
"operations",
"to",
"the",
"table",
"."
] | [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"OperationAdd",
"(",
"project",
",",
"uuid",
"string",
",",
"typ",
"OperationType",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"projectID",
"interface",
"{",
"}",
"\n\n",
"if",
"project",
"!=",
"\"",
"\""... |
1,481 | all-1482 | [
"warnDeprecated",
"prints",
"a",
"deprecation",
"warning",
"for",
"a",
"particular",
"configuration",
"option",
"."
] | [
"func",
"warnDeprecated",
"(",
"last",
"*",
"time",
".",
"Time",
",",
"freq",
"time",
".",
"Duration",
",",
"msg",
"string",
")",
"{",
"// have we warned within the last freq?",
"warnLock",
".",
"RLock",
"(",
")",
"\n",
"fresh",
":=",
"time",
".",
"Now",
"... |
1,482 | all-1483 | [
"UpdateRepoLabel",
"updates",
"a",
"org",
"/",
"repo",
"label",
"to",
"new",
"name",
"description",
"and",
"color",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"issues",
"/",
"labels",
"/",
"#update",
"-",
"a",
"-... | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateRepoLabel",
"(",
"org",
",",
"repo",
",",
"label",
",",
"newName",
",",
"description",
",",
"color",
"string",
")",
"error",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
",",
"label",
... |
1,483 | all-1484 | [
"calculateComputedPolicy",
"is",
"a",
"utility",
"function",
"to",
"compute",
"a",
"map",
"of",
"state",
"attributes",
"for",
"the",
"port",
"group",
"s",
"effective",
"policy",
".",
"It",
"uses",
"a",
"bit",
"of",
"a",
"roundabout",
"way",
"to",
"set",
"t... | [
"func",
"calculateComputedPolicy",
"(",
"policy",
"types",
".",
"HostNetworkPolicy",
")",
"(",
"<mask>",
"[",
"string",
"]",
"string",
",",
"error",
")",
"{",
"cpr",
":=",
"&",
"schema",
".",
"Resource",
"{",
"Schema",
":",
"schemaHostNetworkPolicy",
"(",
")... |
1,484 | all-1485 | [
"AddPrefix",
"will",
"wrap",
"a",
"UI",
"that",
"will",
"prefix",
"the",
"message",
"on",
"top",
"of",
"ui",
".",
"If",
"a",
"prefix",
"is",
"set",
"to",
"nothing",
"(",
")",
"then",
"there",
"will",
"be",
"no",
"prefix",
"for",
"that",
"message",
"t... | [
"func",
"AddPrefix",
"(",
"askPre",
",",
"errorPre",
",",
"infoPre",
",",
"logPre",
",",
"outputPre",
",",
"runningPre",
",",
"successPre",
",",
"warnPre",
"<mask>",
",",
"ui",
"UI",
")",
"*",
"PrefixUI",
"{",
"return",
"&",
"PrefixUI",
"{",
"LogPrefix",
... |
1,485 | all-1486 | [
"NewThen",
"creates",
"a",
"new",
"Then",
"command",
"."
] | [
"func",
"NewThen",
"(",
"command",
"string",
",",
"args",
"...",
"string",
")",
"Then",
"{",
"return",
"&",
"gitCmd",
"{",
"command",
":",
"<mask>",
",",
"args",
":",
"args",
"}",
"\n",
"}"
] |
1,486 | all-1487 | [
"NameSpace",
"return",
"namespaced",
"filesystem"
] | [
"func",
"(",
"fs",
"*",
"AssetFileSystem",
")",
"NameSpace",
"(",
"nameSpace",
"string",
")",
"Interface",
"{",
"if",
"<mask>",
".",
"nameSpacedFS",
"==",
"nil",
"{",
"fs",
".",
"nameSpacedFS",
"=",
"map",
"[",
"string",
"]",
"Interface",
"{",
"}",
"\n",... |
1,487 | all-1488 | [
"GetReverseMap",
"returns",
"a",
"map",
"from",
"people",
"-",
">",
"OWNERS",
"files",
"for",
"which",
"they",
"are",
"an",
"approver"
] | [
"func",
"(",
"o",
"Owners",
")",
"GetReverseMap",
"(",
"approvers",
"map",
"[",
"string",
"]",
"sets",
".",
"String",
")",
"map",
"[",
"string",
"]",
"sets",
".",
"String",
"{",
"approverOwnersfiles",
":=",
"map",
"[",
"string",
"]",
"sets",
".",
"Stri... |
1,488 | all-1489 | [
"/",
"*",
"polymorph",
"AppsWrapper",
"apps",
"false",
"/",
"*",
"polymorph",
"AppsWrapper",
"error",
"false",
"Validate",
"validates",
"this",
"apps",
"wrapper"
] | [
"func",
"(",
"m",
"*",
"AppsWrapper",
")",
"Validate",
"(",
"formats",
"strfmt",
".",
"Registry",
")",
"error",
"{",
"var",
"res",
"[",
"]",
"error",
"\n\n",
"if",
"err",
":=",
"m",
".",
"validateApps",
"(",
"formats",
")",
";",
"err",
"!=",
"nil",
... |
1,489 | all-1490 | [
"List",
"entries",
"at",
"the",
"given",
"path"
] | [
"func",
"(",
"s",
"*",
"Shell",
")",
"List",
"(",
"path",
"string",
")",
"(",
"[",
"]",
"*",
"LsLink",
",",
"error",
")",
"{",
"<mask>",
"out",
"struct",
"{",
"Objects",
"[",
"]",
"LsObject",
"}",
"\n",
"err",
":=",
"s",
".",
"Request",
"(",
"\... |
1,490 | all-1491 | [
"ListMilestones",
"lists",
"milestones",
"."
] | [
"func",
"(",
"f",
"*",
"FakeClient",
")",
"ListMilestones",
"(",
"org",
",",
"repo",
"string",
")",
"(",
"[",
"]",
"github",
".",
"Milestone",
",",
"error",
")",
"{",
"milestones",
":=",
"[",
"]",
"github",
".",
"Milestone",
"{",
"}",
"\n",
"for",
... |
1,491 | all-1492 | [
"closestInRange",
"finds",
"the",
"closest",
"valid",
"value",
"within",
"the",
"range",
"to",
"a",
"given",
"value",
".",
"Values",
"outside",
"the",
"range",
"are",
"clipped",
"to",
"either",
"the",
"range",
"min",
"or",
"max",
"."
] | [
"func",
"(",
"*",
"InclusiveRange",
")",
"closestInRange",
"(",
"value",
",",
"start",
",",
"end",
",",
"step",
"int",
")",
"int",
"{",
"// Possibly clamp the value if it is outside the range",
"if",
"end",
">=",
"start",
"{",
"if",
"value",
"<",
"start",
"{",... |
1,492 | all-1493 | [
"SetLevel",
"changes",
"the",
"logging",
"level",
"to",
"the",
"passed",
"level",
".",
"This",
"is",
"part",
"of",
"the",
"Logger",
"interface",
"implementation",
"."
] | [
"func",
"(",
"l",
"*",
"slog",
")",
"SetLevel",
"(",
"<mask>",
"Level",
")",
"{",
"atomic",
".",
"StoreUint32",
"(",
"(",
"*",
"uint32",
")",
"(",
"&",
"l",
".",
"lvl",
")",
",",
"uint32",
"(",
"level",
")",
")",
"\n",
"}"
] |
1,493 | all-1494 | [
"Returns",
"the",
"value",
"of",
"a",
"uniform",
"variable"
] | [
"func",
"GetUniformfv",
"(",
"program",
"uint32",
",",
"location",
"int32",
",",
"params",
"*",
"float32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpGetUniformfv",
",",
"3",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"location",
")",
","... |
1,494 | all-1495 | [
"newGatewayCommand",
"returns",
"the",
"cobra",
"command",
"for",
"gateway",
"."
] | [
"func",
"newGatewayCommand",
"(",
")",
"*",
"cobra",
".",
"Command",
"{",
"lpc",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Use",
":",
"\"",
"\"",
",",
"Short",
":",
"\"",
"\"",
",",
"}",
"\n",
"lpc",
".",
"AddCommand",
"(",
"newGatewayStartCommand",
... |
1,495 | all-1496 | [
"bind",
"stages",
"of",
"a",
"program",
"object",
"to",
"a",
"program",
"pipeline"
] | [
"func",
"UseProgramStages",
"(",
"pipeline",
"uint32",
",",
"stages",
"uint32",
",",
"program",
"uint32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpUseProgramStages",
",",
"3",
",",
"uintptr",
"(",
"pipeline",
")",
",",
"uintptr",
"(",
"stages",
")",
",... |
1,496 | all-1497 | [
"getTasksToEventsLen",
"returns",
"the",
"length",
"of",
"the",
"tasksToEvents",
"map",
".",
"It",
"is",
"used",
"only",
"in",
"the",
"test",
"code",
"to",
"ascertain",
"that",
"map",
"has",
"been",
"cleaned",
"up"
] | [
"func",
"(",
"handler",
"*",
"TaskHandler",
")",
"getTasksToEventsLen",
"(",
")",
"int",
"{",
"<mask>",
".",
"lock",
".",
"RLock",
"(",
")",
"\n",
"defer",
"handler",
".",
"lock",
".",
"RUnlock",
"(",
")",
"\n\n",
"return",
"len",
"(",
"handler",
".",
... |
1,497 | all-1498 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"FocusParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom54",
"(",
"&",
"w",
",",
"v",
")",
"\n",
... |
1,498 | all-1499 | [
"Lookup",
"returns",
"the",
"codec",
"associated",
"with",
"mimetype",
"ok",
"is",
"set",
"to",
"true",
"or",
"false",
"based",
"on",
"whether",
"a",
"codec",
"was",
"found",
"."
] | [
"func",
"(",
"reg",
"*",
"Registry",
")",
"Lookup",
"(",
"mimetype",
"string",
")",
"(",
"codec",
"Codec",
",",
"ok",
"bool",
")",
"{",
"reg",
".",
"mutex",
".",
"RLock",
"(",
")",
"\n",
"codec",
",",
"<mask>",
"=",
"reg",
".",
"codecs",
"[",
"mi... |
1,499 | all-1500 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"NavigateParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage27",
"(",
"&",
"r",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.