id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
3,600 | all-3601 | [
"CONTRACT",
":",
"two",
"nodes",
"are",
"compatible",
"if",
"the",
"major",
"/",
"minor",
"versions",
"match",
"and",
"network",
"match"
] | [
"func",
"(",
"<mask>",
"*",
"NodeInfo",
")",
"CompatibleWith",
"(",
"other",
"*",
"NodeInfo",
")",
"error",
"{",
"iMajor",
",",
"iMinor",
",",
"_",
",",
"iErr",
":=",
"splitVersion",
"(",
"info",
".",
"Version",
")",
"\n",
"oMajor",
",",
"oMinor",
",",... |
3,601 | all-3602 | [
"Compare",
"compares",
"the",
"two",
"label",
"sets",
".",
"The",
"result",
"will",
"be",
"0",
"if",
"a",
"==",
"b",
"<0",
"if",
"a",
"<",
"b",
"and",
">",
"0",
"if",
"a",
">",
"b",
"."
] | [
"func",
"Compare",
"(",
"a",
",",
"b",
"Labels",
")",
"int",
"{",
"l",
":=",
"len",
"(",
"a",
")",
"\n",
"if",
"len",
"(",
"b",
")",
"<",
"l",
"{",
"l",
"=",
"len",
"(",
"b",
")",
"\n",
"}",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",... |
3,602 | all-3603 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"RemoveInstrumentationBreakpointParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugg... |
3,603 | all-3604 | [
"WithBody",
"adds",
"the",
"body",
"to",
"the",
"find",
"vms",
"by",
"filters",
"params"
] | [
"func",
"(",
"o",
"*",
"FindVmsByFiltersParams",
")",
"WithBody",
"(",
"<mask>",
"*",
"models",
".",
"VMFilter",
")",
"*",
"FindVmsByFiltersParams",
"{",
"o",
".",
"SetBody",
"(",
"body",
")",
"\n",
"return",
"o",
"\n",
"}"
] |
3,604 | all-3605 | [
"NewServerList",
"returns",
"a",
"new",
"ServerList",
"with",
"the",
"given",
"servers",
".",
"All",
"servers",
"have",
"the",
"same",
"weight",
".",
"To",
"give",
"a",
"server",
"more",
"weight",
"list",
"it",
"multiple",
"times",
".",
"NewServerList",
"ret... | [
"func",
"NewServerList",
"(",
"servers",
"...",
"string",
")",
"(",
"*",
"ServerList",
",",
"error",
")",
"{",
"addrs",
":=",
"make",
"(",
"[",
"]",
"*",
"Addr",
",",
"len",
"(",
"servers",
")",
")",
"\n",
"for",
"i",
",",
"server",
":=",
"range",
... |
3,605 | all-3606 | [
"New",
"creates",
"a",
"new",
"API",
"Client",
"for",
"a",
"Telegram",
"bot",
"using",
"the",
"apiKey",
"provided",
".",
"It",
"will",
"call",
"the",
"GetMe",
"method",
"to",
"retrieve",
"the",
"bots",
"id",
"name",
"and",
"username",
".",
"This",
"bot",... | [
"func",
"New",
"(",
"apiKey",
"string",
")",
"(",
"*",
"TelegramBotAPI",
",",
"error",
")",
"{",
"toReturn",
":=",
"TelegramBotAPI",
"{",
"Updates",
":",
"make",
"(",
"chan",
"BotUpdate",
")",
",",
"baseURIs",
":",
"createEndpoints",
"(",
"fmt",
".",
"Sp... |
3,606 | all-3607 | [
"expandStorageDrsPodConfigSpec",
"reads",
"certain",
"ResourceData",
"keys",
"and",
"returns",
"a",
"StorageDrsPodConfigSpec",
"."
] | [
"func",
"expandStorageDrsPodConfigSpec",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"version",
"viapi",
".",
"VSphereVersion",
")",
"*",
"types",
".",
"StorageDrsPodConfigSpec",
"{",
"obj",
":=",
"&",
"types",
".",
"StorageDrsPodConfigSpec",
"{",
"DefaultI... |
3,607 | all-3608 | [
"fileDescriptor",
"returns",
"the",
"file",
"descriptor",
"associated",
"with",
"the",
"writer",
"or",
"(",
"0",
"false",
")",
"if",
"no",
"file",
"descriptor",
"is",
"available",
"."
] | [
"func",
"fileDescriptor",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"fd",
"int",
",",
"<mask>",
"bool",
")",
"{",
"file",
",",
"ok",
":=",
"w",
".",
"(",
"interface",
"{",
"Fd",
"(",
")",
"uintptr",
"}",
")",
"\n",
"if",
"ok",
"{",
"fd",
"=",
... |
3,608 | all-3609 | [
"UnmarshalText",
"from",
"TOML"
] | [
"func",
"(",
"d",
"*",
"Duration",
")",
"UnmarshalText",
"(",
"text",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"d",
".",
"Duration",
",",
"err",
"=",
"<mask>",
".",
"ParseDuration",
"(",
"string",
"(",
"text",
")",
")",
"\n... |
3,609 | all-3610 | [
"cephRBDVolumeMap",
"maps",
"a",
"given",
"RBD",
"storage",
"volume",
"This",
"will",
"ensure",
"that",
"the",
"RBD",
"storage",
"volume",
"is",
"accessible",
"as",
"a",
"block",
"device",
"in",
"the",
"/",
"dev",
"directory",
"and",
"is",
"therefore",
"nece... | [
"func",
"cephRBDVolumeMap",
"(",
"clusterName",
"string",
",",
"poolName",
"string",
",",
"volumeName",
"string",
",",
"volumeType",
"string",
",",
"userName",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"devPath",
",",
"err",
":=",
"shared",
".",
... |
3,610 | all-3611 | [
"Get",
"fetches",
"the",
"raw",
"config",
"from",
"cache"
] | [
"func",
"(",
"c",
"*",
"cachedLoader",
")",
"Get",
"(",
"key",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"c",
".",
"cacheLock",
".",
"RLock",
"(",
")",
"\n",
"defer",
"c",
".",
"cacheLock",
".",
"RUnlock",
"(",
")",
"\n\n",
... |
3,611 | all-3612 | [
"DataType",
"converts",
"a",
"type",
"code",
"into",
"one",
"of",
"the",
"supported",
"data",
"types",
"by",
"the",
"driver",
"."
] | [
"func",
"(",
"k",
"TypeCode",
")",
"DataType",
"(",
")",
"DataType",
"{",
"<mask>",
"k",
"{",
"default",
":",
"return",
"DtUnknown",
"\n",
"case",
"tcTinyint",
":",
"return",
"DtTinyint",
"\n",
"case",
"tcSmallint",
":",
"return",
"DtSmallint",
"\n",
"case... |
3,612 | all-3613 | [
"LimitListener",
"returns",
"a",
"Listener",
"that",
"accepts",
"at",
"most",
"n",
"simultaneous",
"connections",
"from",
"the",
"provided",
"Listener",
"."
] | [
"func",
"LimitListener",
"(",
"l",
"net",
".",
"Listener",
",",
"n",
"int",
")",
"net",
".",
"Listener",
"{",
"return",
"&",
"limitListener",
"{",
"l",
",",
"<mask>",
"(",
"chan",
"struct",
"{",
"}",
",",
"n",
")",
"}",
"\n",
"}"
] |
3,613 | all-3614 | [
"ParseRoute",
"parses",
"a",
"API",
"1",
".",
"5",
"route",
"and",
"returns",
"corresponding",
"path",
"patterns",
"."
] | [
"func",
"ParseRoute",
"(",
"moniker",
"string",
",",
"routes",
"[",
"]",
"string",
")",
"(",
"pathPatterns",
"[",
"]",
"*",
"gen",
".",
"PathPattern",
")",
"{",
"// :(((( some routes are empty",
"var",
"paths",
"[",
"]",
"string",
"\n",
"var",
"method",
"s... |
3,614 | all-3615 | [
"URLsFromFlag",
"returns",
"a",
"slices",
"from",
"url",
"got",
"from",
"the",
"flag",
"."
] | [
"func",
"URLsFromFlag",
"(",
"fs",
"*",
"flag",
".",
"FlagSet",
",",
"urlsFlagName",
"string",
")",
"[",
"]",
"url",
".",
"<mask>",
"{",
"return",
"[",
"]",
"url",
".",
"URL",
"(",
"*",
"fs",
".",
"Lookup",
"(",
"urlsFlagName",
")",
".",
"Value",
"... |
3,615 | all-3616 | [
"GetSingleCommit",
"returns",
"a",
"single",
"commit",
"."
] | [
"func",
"(",
"f",
"*",
"FakeClient",
")",
"GetSingleCommit",
"(",
"org",
",",
"repo",
",",
"SHA",
"<mask>",
")",
"(",
"github",
".",
"SingleCommit",
",",
"error",
")",
"{",
"return",
"f",
".",
"Commits",
"[",
"SHA",
"]",
",",
"nil",
"\n",
"}"
] |
3,616 | all-3617 | [
"getBaseQueryString",
"gets",
"a",
"Querystring",
"representing",
"this",
"message",
"."
] | [
"func",
"(",
"op",
"*",
"outgoingBase",
")",
"getBaseQueryString",
"(",
")",
"querystring",
"{",
"toReturn",
":=",
"<mask>",
"[",
"string",
"]",
"string",
"{",
"}",
"\n",
"if",
"op",
".",
"Recipient",
".",
"isChannel",
"(",
")",
"{",
"//Channel",
"toRetu... |
3,617 | all-3618 | [
"BotName",
"returns",
"the",
"login",
"of",
"the",
"authenticated",
"identity",
".",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"users",
"/",
"#get",
"-",
"the",
"-",
"authenticated",
"-",
"user"
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"BotName",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"c",
".",
"mut",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mut",
".",
"Unlock",
"(",
")",
"\n",
"if",
"c",
".",
"botName",
"==",
"\"",
... |
3,618 | all-3619 | [
"Rescan",
"the",
"target",
".",
"Normally",
"used",
"for",
"finding",
"differences",
"between",
"scans",
"at",
"two",
"points",
"in",
"time",
"."
] | [
"func",
"(",
"h",
"Host",
")",
"Rescan",
"(",
")",
"(",
"scan",
"Scan",
")",
"{",
"return",
"Init",
"(",
")",
".",
"AddPorts",
"(",
"h",
".",
"parentScan",
".",
"configPorts",
"...",
")",
".",
"AddTCPPorts",
"(",
"h",
".",
"parentScan",
".",
"confi... |
3,619 | all-3620 | [
"WriteToRequest",
"writes",
"these",
"params",
"to",
"a",
"swagger",
"request"
] | [
"func",
"(",
"o",
"*",
"FindVmsByStatesParams",
")",
"WriteToRequest",
"(",
"r",
"runtime",
".",
"ClientRequest",
",",
"reg",
"strfmt",
".",
"Registry",
")",
"error",
"{",
"if",
"err",
":=",
"r",
".",
"SetTimeout",
"(",
"o",
".",
"timeout",
")",
";",
"... |
3,620 | all-3621 | [
"Html",
"retruns",
"a",
"TemplateView",
"witch",
"uses",
"HTML",
"templates",
"internally",
"."
] | [
"func",
"Html",
"(",
"<mask>",
",",
"contentType",
",",
"charSet",
"string",
")",
"template",
"{",
"if",
"htmlTemp",
".",
"Template",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"contentType",
"==",
"\"",
"\"",
"{",
"conte... |
3,621 | all-3622 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"BeginFrameParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental5",
"(",... |
3,622 | all-3623 | [
"Do",
"executes",
"Page",
".",
"setAdBlockingEnabled",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetAdBlockingEnabledParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetAdBlockingEnabled",
",",
"p",
",",
"nil",
")",
"\n",
... |
3,623 | all-3624 | [
"NewBoard",
"generates",
"a",
"new",
"Board",
"with",
"giving",
"a",
"size",
"."
] | [
"func",
"NewBoard",
"(",
"<mask>",
"int",
")",
"(",
"*",
"Board",
",",
"error",
")",
"{",
"b",
":=",
"&",
"Board",
"{",
"size",
":",
"size",
",",
"tiles",
":",
"map",
"[",
"*",
"Tile",
"]",
"struct",
"{",
"}",
"{",
"}",
",",
"}",
"\n",
"for",... |
3,624 | all-3625 | [
"GetVerifiedOk",
"returns",
"a",
"tuple",
"with",
"the",
"Verified",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"c",
"*",
"CreatedBy",
")",
"GetVerifiedOk",
"(",
")",
"(",
"bool",
",",
"bool",
")",
"{",
"if",
"c",
"==",
"nil",
"||",
"c",
".",
"Verified",
"==",
"nil",
"{",
"return",
"false",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"c",
... |
3,625 | all-3626 | [
"DrawTriangles",
"draws",
"a",
"triangle",
"with",
"the",
"specified",
"vertices",
"and",
"their",
"indices",
".",
"If",
"len",
"(",
"indices",
")",
"is",
"not",
"multiple",
"of",
"3",
"DrawTriangles",
"panics",
".",
"If",
"len",
"(",
"indices",
")",
"is",... | [
"func",
"(",
"i",
"*",
"Image",
")",
"DrawTriangles",
"(",
"vertices",
"[",
"]",
"Vertex",
",",
"indices",
"[",
"]",
"uint16",
",",
"img",
"*",
"Image",
",",
"options",
"*",
"DrawTrianglesOptions",
")",
"{",
"i",
".",
"copyCheck",
"(",
")",
"\n",
"if... |
3,626 | all-3627 | [
"OfferingMessage",
"returns",
"new",
"Offering",
"message"
] | [
"func",
"OfferingMessage",
"(",
"agent",
"*",
"data",
".",
"Account",
",",
"template",
"*",
"data",
".",
"<mask>",
",",
"offering",
"*",
"data",
".",
"Offering",
")",
"*",
"Message",
"{",
"msg",
":=",
"&",
"Message",
"{",
"AgentPubKey",
":",
"agent",
"... |
3,627 | all-3628 | [
"GetListeners",
"returns",
"the",
"socket",
"-",
"activated",
"network",
"listeners",
"if",
"any",
".",
"The",
"start",
"parameter",
"must",
"be",
"SystemdListenFDsStart",
"except",
"in",
"unit",
"tests",
"see",
"the",
"docstring",
"of",
"SystemdListenFDsStart",
"... | [
"func",
"GetListeners",
"(",
"start",
"int",
")",
"[",
"]",
"net",
".",
"Listener",
"{",
"defer",
"func",
"(",
")",
"{",
"<mask>",
".",
"Unsetenv",
"(",
"\"",
"\"",
")",
"\n",
"os",
".",
"Unsetenv",
"(",
"\"",
"\"",
")",
"\n",
"}",
"(",
")",
"\... |
3,628 | all-3629 | [
"Critf",
"logs",
"at",
"the",
"CRITICAL",
"log",
"level",
"using",
"a",
"standard",
"printf",
"format",
"string"
] | [
"func",
"Critf",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"if",
"<mask>",
"!=",
"nil",
"{",
"Log",
".",
"Crit",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"args",
"...",
")",
")",
"\n",
"}",
"\n",
"}"
] |
3,629 | all-3630 | [
"GetManifest",
"returns",
"the",
"image",
"s",
"manifest",
"along",
"with",
"its",
"MIME",
"type",
"(",
"which",
"may",
"be",
"empty",
"when",
"it",
"can",
"t",
"be",
"determined",
"but",
"the",
"manifest",
"is",
"available",
")",
".",
"It",
"may",
"use"... | [
"func",
"(",
"s",
"*",
"dockerImageSource",
")",
"GetManifest",
"(",
"ctx",
"context",
".",
"Context",
",",
"instanceDigest",
"*",
"digest",
".",
"Digest",
")",
"(",
"[",
"]",
"byte",
",",
"string",
",",
"error",
")",
"{",
"if",
"instanceDigest",
"!=",
... |
3,630 | all-3631 | [
"WithDepth",
"the",
"maximum",
"depth",
"at",
"which",
"children",
"should",
"be",
"retrieved",
"defaults",
"to",
"1",
".",
"Use",
"-",
"1",
"for",
"the",
"entire",
"subtree",
"or",
"provide",
"an",
"integer",
"larger",
"than",
"0",
"."
] | [
"func",
"(",
"p",
"DescribeNodeParams",
")",
"WithDepth",
"(",
"<mask>",
"int64",
")",
"*",
"DescribeNodeParams",
"{",
"p",
".",
"Depth",
"=",
"depth",
"\n",
"return",
"&",
"p",
"\n",
"}"
] |
3,631 | all-3632 | [
"RESTClient",
"returns",
"a",
"RESTClient",
"that",
"is",
"used",
"to",
"communicate",
"with",
"API",
"server",
"by",
"this",
"client",
"implementation",
"."
] | [
"func",
"(",
"c",
"*",
"ProwV1Client",
")",
"RESTClient",
"(",
")",
"<mask>",
".",
"Interface",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"c",
".",
"restClient",
"\n",
"}"
] |
3,632 | all-3633 | [
"===",
"timestamp",
"(",
"Vector",
"ValueTypeVector",
")",
"Vector",
"==="
] | [
"func",
"funcTimestamp",
"(",
"vals",
"[",
"]",
"Value",
",",
"args",
"Expressions",
",",
"enh",
"*",
"EvalNodeHelper",
")",
"Vector",
"{",
"vec",
":=",
"vals",
"[",
"0",
"]",
".",
"(",
"Vector",
")",
"\n",
"for",
"_",
",",
"el",
":=",
"range",
"ve... |
3,633 | all-3634 | [
"Handle",
"handles",
"an",
"incoming",
"TChannel",
"call",
"and",
"forwards",
"it",
"to",
"the",
"correct",
"handler",
"."
] | [
"func",
"(",
"s",
"*",
"Server",
")",
"Handle",
"(",
"ctx",
"context",
".",
"Context",
",",
"call",
"*",
"tchannel",
".",
"InboundCall",
")",
"{",
"op",
":=",
"<mask>",
".",
"MethodString",
"(",
")",
"\n",
"service",
",",
"method",
",",
"ok",
":=",
... |
3,634 | all-3635 | [
"DefaultLoader",
"sets",
"up",
"and",
"assigns",
"the",
"default",
"loader",
"to",
"be",
"used",
"by",
"Xslate",
"."
] | [
"func",
"DefaultLoader",
"(",
"tx",
"*",
"Xslate",
",",
"args",
"Args",
")",
"error",
"{",
"var",
"tmp",
"interface",
"{",
"}",
"\n\n",
"tmp",
",",
"ok",
":=",
"args",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"!",
"ok",
"{",
"tmp",
",",
"_... |
3,635 | all-3636 | [
"GetStyleOk",
"returns",
"a",
"tuple",
"with",
"the",
"Style",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"g",
"*",
"GraphDefinition",
")",
"GetStyleOk",
"(",
")",
"(",
"Style",
",",
"bool",
")",
"{",
"if",
"g",
"==",
"nil",
"||",
"g",
".",
"Style",
"==",
"nil",
"{",
"return",
"Style",
"{",
"}",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
... |
3,636 | all-3637 | [
"FontButtonNewWithFont",
"is",
"a",
"wrapper",
"around",
"gtk_font_button_new_with_font",
"()",
"."
] | [
"func",
"FontButtonNewWithFont",
"(",
"fontname",
"string",
")",
"(",
"*",
"FontButton",
",",
"error",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"fontname",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")"... |
3,637 | all-3638 | [
"return",
"the",
"address",
"of",
"the",
"specified",
"generic",
"vertex",
"attribute",
"pointer"
] | [
"func",
"GetVertexAttribPointerv",
"(",
"index",
"uint32",
",",
"pname",
"uint32",
",",
"pointer",
"*",
"unsafe",
".",
"Pointer",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpGetVertexAttribPointerv",
",",
"3",
",",
"uintptr",
"(",
"index",
")",
",",
"uintpt... |
3,638 | all-3639 | [
"native",
"()",
"returns",
"a",
"pointer",
"to",
"the",
"underlying",
"GObject",
"as",
"a",
"GtkEditable",
"."
] | [
"func",
"(",
"v",
"*",
"Editable",
")",
"native",
"(",
")",
"*",
"C",
".",
"GtkEditable",
"{",
"if",
"v",
"==",
"nil",
"||",
"v",
".",
"GObject",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"p",
":=",
"unsafe",
".",
"Pointer",
"(",
"v",... |
3,639 | all-3640 | [
"MustEnvelope",
"retrieves",
"the",
"Envelope",
"value",
"from",
"the",
"union",
"panicing",
"if",
"the",
"value",
"is",
"not",
"set",
"."
] | [
"func",
"(",
"u",
"StellarMessage",
")",
"MustEnvelope",
"(",
")",
"ScpEnvelope",
"{",
"val",
",",
"ok",
":=",
"u",
".",
"GetEnvelope",
"(",
")",
"\n\n",
"if",
"!",
"<mask>",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"val",
"... |
3,640 | all-3641 | [
"DFSRecursion",
"does",
"depth",
"-",
"first",
"search",
"recursively",
".",
"0",
".",
"DFS",
"(",
"G",
"v",
")",
":",
"1",
".",
"2",
".",
"if",
"v",
"is",
"visited",
":",
"3",
".",
"return",
"4",
".",
"5",
".",
"label",
"v",
"as",
"visited",
"... | [
"func",
"DFSRecursion",
"(",
"g",
"Graph",
",",
"id",
"ID",
")",
"[",
"]",
"ID",
"{",
"if",
"_",
",",
"err",
":=",
"g",
".",
"GetNode",
"(",
"id",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"visited",
":=",
"make",
... |
3,641 | all-3642 | [
"DeepCopy",
"copies",
"the",
"receiver",
"into",
"a",
"new",
"ISBN10",
"."
] | [
"func",
"(",
"u",
"*",
"ISBN10",
")",
"DeepCopy",
"(",
")",
"*",
"ISBN10",
"{",
"if",
"u",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ISBN10",
")",
"\n",
"u",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
"retur... |
3,642 | all-3643 | [
"GetResourceByType",
"gets",
"a",
"resource",
"by",
"type"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetResourceByType",
"(",
"resourcetype",
"string",
",",
"resourceid",
"string",
")",
"(",
"*",
"Resource",
",",
"error",
")",
"{",
"url",
":=",
"umResourcesTypePath",
"(",
"resourcetype",
",",
"resourceid",
")",
"+",
... |
3,643 | all-3644 | [
"PTCAddress",
"returns",
"Privatix",
"token",
"contract",
"address",
"."
] | [
"func",
"(",
"b",
"*",
"backendInstance",
")",
"PTCAddress",
"(",
")",
"<mask>",
".",
"Address",
"{",
"return",
"common",
".",
"HexToAddress",
"(",
"b",
".",
"cfg",
".",
"Contract",
".",
"PTCAddrHex",
")",
"\n",
"}"
] |
3,644 | all-3645 | [
"SeekFirst",
"moves",
"cursor",
"to",
"the",
"start"
] | [
"func",
"(",
"it",
"*",
"Iterator",
")",
"SeekFirst",
"(",
")",
"{",
"it",
".",
"prev",
"=",
"it",
".",
"s",
".",
"<mask>",
"\n",
"it",
".",
"curr",
",",
"_",
"=",
"it",
".",
"s",
".",
"head",
".",
"getNext",
"(",
"0",
")",
"\n",
"it",
".",... |
3,645 | all-3646 | [
"SetLongPolicy",
"sets",
"a",
"ResourceData",
"field",
"depending",
"on",
"if",
"a",
"LongPolicy",
"exists",
"or",
"not",
".",
"The",
"field",
"is",
"not",
"set",
"if",
"it",
"s",
"nil",
"."
] | [
"func",
"SetLongPolicy",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"key",
"string",
",",
"val",
"*",
"<mask>",
".",
"LongPolicy",
")",
"error",
"{",
"if",
"val",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"err",
":=",
"d",
".",
"S... |
3,646 | all-3647 | [
"Name",
"returns",
"the",
"command",
"s",
"name",
":",
"the",
"first",
"word",
"in",
"the",
"usage",
"line",
"."
] | [
"func",
"(",
"c",
"*",
"command",
")",
"Name",
"(",
")",
"string",
"{",
"name",
":=",
"c",
".",
"UsageLine",
"\n",
"i",
":=",
"strings",
".",
"IndexRune",
"(",
"name",
",",
"' '",
")",
"\n",
"if",
"i",
">=",
"0",
"{",
"name",
"=",
"name",
"[",
... |
3,647 | all-3648 | [
"UnmarshalJSON",
"satisfies",
"json",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"RecordMode",
")",
"UnmarshalJSON",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"error",
"{",
"return",
"easyjson",
".",
"Unmarshal",
"(",
"buf",
",",
"t",
")",
"\n",
"}"
] |
3,648 | all-3649 | [
"EditRepoHook",
"updates",
"an",
"existing",
"hook",
"with",
"new",
"info",
"(",
"events",
"/",
"url",
"/",
"secret",
")",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"repos",
"/",
"hooks",
"/",
"#edit",
"-",
"a",
"-",... | [
"func",
"(",
"c",
"*",
"Client",
")",
"EditRepoHook",
"(",
"org",
",",
"repo",
"string",
",",
"id",
"int",
",",
"req",
"HookRequest",
")",
"error",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
",",
"id",
")",
"\n",
"return",
... |
3,649 | all-3650 | [
"dot",
"returns",
"the",
"type",
"of",
"typ",
".",
"name",
"making",
"its",
"decision",
"using",
"the",
"type",
"information",
"in",
"cfg",
"."
] | [
"func",
"(",
"typ",
"*",
"Type",
")",
"dot",
"(",
"cfg",
"*",
"TypeConfig",
",",
"name",
"string",
")",
"string",
"{",
"if",
"typ",
".",
"Field",
"!=",
"nil",
"{",
"if",
"t",
":=",
"typ",
".",
"Field",
"[",
"name",
"]",
";",
"t",
"!=",
"\"",
... |
3,650 | all-3651 | [
"Describe",
"implements",
"prometheus",
".",
"Collector",
"."
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"Describe",
"(",
"ch",
"chan",
"<-",
"*",
"prometheus",
".",
"Desc",
")",
"{",
"ch",
"<-",
"c",
".",
"ignoredSamples",
".",
"Desc",
"(",
")",
"\n",
"}"
] |
3,651 | all-3652 | [
"Likes",
"returns",
"friends",
"and",
"a",
"total",
"count",
"of",
"users",
"who",
"have",
"liked",
"this",
"venue",
".",
"https",
":",
"//",
"developer",
".",
"foursquare",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"venues",
"/",
"likes"
] | [
"func",
"(",
"s",
"*",
"VenueService",
")",
"Likes",
"(",
"id",
"string",
")",
"(",
"*",
"LikesResp",
",",
"*",
"http",
".",
"Response",
",",
"error",
")",
"{",
"likes",
":=",
"new",
"(",
"venueLikesResp",
")",
"\n",
"response",
":=",
"<mask>",
"(",
... |
3,652 | all-3653 | [
"expandHostNasVolumeSpec",
"reads",
"certain",
"ResourceData",
"keys",
"and",
"returns",
"a",
"HostNasVolumeSpec",
"."
] | [
"func",
"expandHostNasVolumeSpec",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
")",
"*",
"<mask>",
".",
"HostNasVolumeSpec",
"{",
"obj",
":=",
"&",
"types",
".",
"HostNasVolumeSpec",
"{",
"AccessMode",
":",
"d",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"... |
3,653 | all-3654 | [
"ListPeers",
"returns",
"a",
"list",
"of",
"peers",
"we",
"are",
"connected",
"to",
"in",
"the",
"given",
"topic",
"."
] | [
"func",
"(",
"p",
"*",
"PubSub",
")",
"ListPeers",
"(",
"topic",
"string",
")",
"[",
"]",
"peer",
".",
"ID",
"{",
"out",
":=",
"make",
"(",
"chan",
"[",
"]",
"peer",
".",
"<mask>",
")",
"\n",
"p",
".",
"getPeers",
"<-",
"&",
"listPeerReq",
"{",
... |
3,654 | all-3655 | [
"NewMockTaskEngineState",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockTaskEngineState",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockTaskEngineState",
"{",
"mock",
":=",
"&",
"MockTaskEngineState",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockTaskEngineStateMockRecorder"... |
3,655 | all-3656 | [
"nextGUID",
"returns",
"the",
"next",
"free",
"group",
"id",
"to",
"use",
"according",
"to",
"whether",
"it",
"is",
"a",
"system",
"s",
"group",
"."
] | [
"func",
"nextGUID",
"(",
"isSystem",
"bool",
")",
"(",
"db",
"*",
"dbfile",
",",
"gid",
"int",
",",
"err",
"error",
")",
"{",
"loadConfig",
"(",
")",
"\n\n",
"db",
",",
"err",
"=",
"openDBFile",
"(",
"_GROUP_FILE",
",",
"os",
".",
"O_RDWR",
")",
"\... |
3,656 | all-3657 | [
"WithWorldName",
"an",
"optional",
"name",
"which",
"is",
"reported",
"in",
"the",
"Execution",
"Context",
"."
] | [
"func",
"(",
"p",
"CreateIsolatedWorldParams",
")",
"WithWorldName",
"(",
"worldName",
"<mask>",
")",
"*",
"CreateIsolatedWorldParams",
"{",
"p",
".",
"WorldName",
"=",
"worldName",
"\n",
"return",
"&",
"p",
"\n",
"}"
] |
3,657 | all-3658 | [
"overrideCgroupParent",
"updates",
"hostconfig",
"with",
"cgroup",
"parent",
"when",
"task",
"cgroups",
"are",
"enabled"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"overrideCgroupParent",
"(",
"hostConfig",
"*",
"dockercontainer",
".",
"HostConfig",
")",
"error",
"{",
"task",
".",
"lock",
".",
"RLock",
"(",
")",
"\n",
"defer",
"<mask>",
".",
"lock",
".",
"RUnlock",
"(",
")",
... |
3,658 | all-3659 | [
"parseExpr",
"parses",
"a",
"single",
"expression",
"from",
"the",
"input",
"."
] | [
"func",
"(",
"p",
"*",
"<mask>",
")",
"parseExpr",
"(",
")",
"(",
"expr",
"Expr",
",",
"err",
"error",
")",
"{",
"defer",
"p",
".",
"recover",
"(",
"&",
"err",
")",
"\n\n",
"for",
"p",
".",
"peek",
"(",
")",
".",
"typ",
"!=",
"ItemEOF",
"{",
... |
3,659 | all-3660 | [
"check",
"if",
"the",
"rendering",
"context",
"has",
"not",
"been",
"lost",
"due",
"to",
"software",
"or",
"hardware",
"issues"
] | [
"func",
"GetGraphicsResetStatus",
"(",
")",
"uint32",
"{",
"<mask>",
",",
"_",
",",
"_",
":=",
"syscall",
".",
"Syscall",
"(",
"gpGetGraphicsResetStatus",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
")",
"\n",
"return",
"(",
"uint32",
")",
"(",
"ret",
")... |
3,660 | all-3661 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetFramesWithManifestsReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache3... |
3,661 | all-3662 | [
"HasMonitorId",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"d",
"*",
"Downtime",
")",
"HasMonitorId",
"(",
")",
"bool",
"{",
"if",
"d",
"!=",
"nil",
"&&",
"d",
".",
"MonitorId",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
3,662 | all-3663 | [
"ProfileUsedByRef",
"returns",
"entities",
"used",
"by",
"profiles",
"."
] | [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"ProfileUsedByRef",
"(",
"filter",
"ProfileFilter",
")",
"(",
"map",
"[",
"string",
"]",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
",",
"error",
")",
"{",
"// Result slice.",
"objects",
":=",
"make",
"(",
"... |
3,663 | all-3664 | [
"NewKeepAliveListener",
"returns",
"a",
"listener",
"that",
"listens",
"on",
"the",
"given",
"address",
".",
"Be",
"careful",
"when",
"wrap",
"around",
"KeepAliveListener",
"with",
"another",
"Listener",
"if",
"TLSInfo",
"is",
"not",
"nil",
".",
"Some",
"pkgs",
... | [
"func",
"NewKeepAliveListener",
"(",
"l",
"net",
".",
"Listener",
",",
"scheme",
"string",
",",
"tlscfg",
"*",
"tls",
".",
"Config",
")",
"(",
"<mask>",
".",
"Listener",
",",
"error",
")",
"{",
"if",
"scheme",
"==",
"\"",
"\"",
"{",
"if",
"tlscfg",
"... |
3,664 | all-3665 | [
"server_cmd_path",
"returns",
"the",
"string",
"/",
"datacenters",
"/",
"<dcid",
">",
"/",
"servers",
"/",
"<srvid",
">",
"/",
"<cmd",
">"
] | [
"func",
"serverCommandPath",
"(",
"dcid",
",",
"srvid",
",",
"cmd",
"<mask>",
")",
"string",
"{",
"return",
"serverPath",
"(",
"dcid",
",",
"srvid",
")",
"+",
"slash",
"(",
"cmd",
")",
"\n",
"}"
] |
3,665 | all-3666 | [
"Eval",
"evaluates",
"the",
"rule",
"and",
"then",
"overrides",
"the",
"metric",
"names",
"and",
"labels",
"accordingly",
"."
] | [
"func",
"(",
"rule",
"*",
"RecordingRule",
")",
"Eval",
"(",
"ctx",
"context",
".",
"Context",
",",
"ts",
"time",
".",
"Time",
",",
"query",
"QueryFunc",
",",
"_",
"*",
"url",
".",
"URL",
")",
"(",
"promql",
".",
"<mask>",
",",
"error",
")",
"{",
... |
3,666 | all-3667 | [
"Finalize",
"ensures",
"the",
"configuration",
"has",
"no",
"nil",
"pointers",
"and",
"sets",
"default",
"values",
"."
] | [
"func",
"(",
"c",
"*",
"TemplateConfigs",
")",
"Finalize",
"(",
")",
"{",
"if",
"c",
"==",
"nil",
"{",
"*",
"c",
"=",
"*",
"DefaultTemplateConfigs",
"(",
")",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"t",
":=",
"<mask>",
"*",
"c",
"{",
"t",
".",
"Fi... |
3,667 | all-3668 | [
"If",
"full",
"is",
"false",
"exclude",
"potentially",
"large",
"fields",
"such",
"as",
"Objects",
"and",
"Children"
] | [
"func",
"nodeToFileInfo",
"(",
"ci",
"*",
"pfs",
".",
"CommitInfo",
",",
"<mask>",
"string",
",",
"node",
"*",
"hashtree",
".",
"NodeProto",
",",
"full",
"bool",
")",
"*",
"pfs",
".",
"FileInfo",
"{",
"fileInfo",
":=",
"&",
"pfs",
".",
"FileInfo",
"{",... |
3,668 | all-3669 | [
"WriteTo",
"writes",
"the",
"peer",
"s",
"public",
"key",
"to",
"w",
"."
] | [
"func",
"(",
"p",
"*",
"Peer",
")",
"WriteTo",
"(",
"w",
"<mask>",
".",
"Writer",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"var",
"n_",
"int",
"\n",
"wire",
".",
"WriteString",
"(",
"p",
".",
"Key",
",",
"w",
",",
"&",
"n_",
","... |
3,669 | all-3670 | [
"SetFormat",
"sets",
"the",
"Format",
"call",
"option",
"(",
"as",
"transport",
"header",
")",
"."
] | [
"func",
"(",
"cb",
"*",
"ContextBuilder",
")",
"SetFormat",
"(",
"f",
"Format",
")",
"*",
"ContextBuilder",
"{",
"if",
"cb",
".",
"CallOptions",
"==",
"nil",
"{",
"cb",
".",
"CallOptions",
"=",
"<mask>",
"(",
"CallOptions",
")",
"\n",
"}",
"\n",
"cb",
... |
3,670 | all-3671 | [
"newElement",
"creates",
"and",
"returns",
"an",
"element",
"."
] | [
"func",
"newElement",
"(",
"ln",
"*",
"line",
",",
"rslt",
"*",
"result",
",",
"src",
"*",
"source",
",",
"parent",
"element",
",",
"opts",
"*",
"Options",
")",
"(",
"element",
",",
"error",
")",
"{",
"var",
"e",
"element",
"\n",
"var",
"err",
"err... |
3,671 | all-3672 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"DialogType",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"DialogType",
"(",
"in",
".",
"String",
"(",
")",
")",
"{",
"case",
"DialogTypeAlert",
":",
"*",
"t",
"=",
"DialogTypeAlert",
"\n... |
3,672 | all-3673 | [
"Do",
"executes",
"HeapProfiler",
".",
"getHeapObjectId",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"heapSnapshotObjectID",
"-",
"Id",
"of",
"the",
"heap",
"snapshot",
"object",
"corresponding",
"to",
"the",
"passed",
"remote",
"object",
"id",
... | [
"func",
"(",
"p",
"*",
"GetHeapObjectIDParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"heapSnapshotObjectID",
"HeapSnapshotObjectID",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"GetHeapObjectIDReturns",
"\n",
"err",
"=",
"c... |
3,673 | all-3674 | [
"GetReadOnly",
"returns",
"the",
"ReadOnly",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"d",
"*",
"Dashboard",
")",
"GetReadOnly",
"(",
")",
"bool",
"{",
"if",
"d",
"==",
"nil",
"||",
"d",
".",
"ReadOnly",
"==",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"d",
".",
"ReadOnly",
"\n",
"}"
] |
3,674 | all-3675 | [
"Expanded",
"expands",
"the",
"ref",
"fields",
"in",
"the",
"spec",
"document",
"and",
"returns",
"a",
"new",
"spec",
"document"
] | [
"func",
"(",
"d",
"*",
"Document",
")",
"Expanded",
"(",
"options",
"...",
"*",
"spec",
".",
"ExpandOptions",
")",
"(",
"*",
"<mask>",
",",
"error",
")",
"{",
"swspec",
":=",
"new",
"(",
"spec",
".",
"Swagger",
")",
"\n",
"if",
"err",
":=",
"json",... |
3,675 | all-3676 | [
"Returns",
"time",
"in",
"RightScale",
"API",
"supported",
"format"
] | [
"func",
"formatTime",
"(",
"tm",
"time",
".",
"Time",
")",
"string",
"{",
"year",
",",
"month",
",",
"<mask>",
":=",
"tm",
".",
"Date",
"(",
")",
"\n",
"return",
"time",
".",
"Date",
"(",
"year",
",",
"month",
",",
"date",
",",
"0",
",",
"0",
"... |
3,676 | all-3677 | [
"bind",
"a",
"buffer",
"to",
"a",
"vertex",
"buffer",
"bind",
"point"
] | [
"func",
"BindVertexBuffer",
"(",
"bindingindex",
"uint32",
",",
"buffer",
"uint32",
",",
"offset",
"int",
",",
"stride",
"int32",
")",
"{",
"C",
".",
"glowBindVertexBuffer",
"(",
"gpBindVertexBuffer",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"bindingindex",
"... |
3,677 | all-3678 | [
"Using",
"the",
"classic",
"API",
"posts",
"a",
"count",
"to",
"a",
"stat",
"at",
"a",
"specific",
"time",
"."
] | [
"func",
"(",
"r",
"*",
"BasicReporter",
")",
"PostCountTime",
"(",
"statKey",
",",
"userKey",
"string",
",",
"count",
"int",
",",
"timestamp",
"int64",
")",
"error",
"{",
"x",
":=",
"newClassicStatCount",
"(",
"statKey",
",",
"userKey",
",",
"count",
")",
... |
3,678 | all-3679 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventBindingCalled",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime36",
"(",
"&",
"w",
",",
"v",
")... |
3,679 | all-3680 | [
"Async",
"converts",
"a",
"Check",
"into",
"an",
"asynchronous",
"check",
"that",
"runs",
"in",
"a",
"background",
"goroutine",
"at",
"a",
"fixed",
"interval",
".",
"The",
"check",
"is",
"called",
"at",
"a",
"fixed",
"rate",
"not",
"with",
"a",
"fixed",
... | [
"func",
"Async",
"(",
"check",
"Check",
",",
"interval",
"time",
".",
"Duration",
")",
"Check",
"{",
"return",
"AsyncWithContext",
"(",
"<mask>",
".",
"Background",
"(",
")",
",",
"check",
",",
"interval",
")",
"\n",
"}"
] |
3,680 | all-3681 | [
"Copy",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_copy",
"()",
"."
] | [
"func",
"(",
"<mask>",
"*",
"PrintSettings",
")",
"Copy",
"(",
")",
"(",
"*",
"PrintSettings",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_print_settings_copy",
"(",
"ps",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"retu... |
3,681 | all-3682 | [
"RegexPath",
"returns",
"a",
"handler",
"that",
"serves",
"HTTP",
"requests",
"with",
"the",
"first",
"match",
"of",
"the",
"the",
"given",
"regex",
"from",
"the",
"request",
"URL",
"s",
"Path",
"and",
"invoking",
"the",
"handler",
"h",
".",
"RegexPath",
"... | [
"func",
"RegexPath",
"(",
"reg",
"*",
"regexp",
".",
"Regexp",
",",
"h",
"http",
".",
"Handler",
")",
"<mask>",
".",
"Handler",
"{",
"if",
"reg",
"==",
"nil",
"{",
"return",
"h",
"\n",
"}",
"\n\n",
"return",
"http",
".",
"HandlerFunc",
"(",
"func",
... |
3,682 | all-3683 | [
"GetSnapshots",
"returns",
"the",
"list",
"of",
"current",
"live",
"snapshots",
"This",
"API",
"is",
"mainly",
"for",
"debugging",
"purpose"
] | [
"func",
"(",
"m",
"*",
"Nitro",
")",
"GetSnapshots",
"(",
")",
"[",
"]",
"*",
"Snapshot",
"{",
"<mask>",
"snaps",
"[",
"]",
"*",
"Snapshot",
"\n",
"buf",
":=",
"m",
".",
"snapshots",
".",
"MakeBuf",
"(",
")",
"\n",
"defer",
"m",
".",
"snapshots",
... |
3,683 | all-3684 | [
"MarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Marshaler",
"."
] | [
"func",
"(",
"t",
"ScopeType",
")",
"MarshalEasyJSON",
"(",
"out",
"*",
"jwriter",
".",
"<mask>",
")",
"{",
"out",
".",
"String",
"(",
"string",
"(",
"t",
")",
")",
"\n",
"}"
] |
3,684 | all-3685 | [
"raft",
".",
"Node",
"does",
"not",
"have",
"locks",
"in",
"Raft",
"package"
] | [
"func",
"(",
"r",
"*",
"raftNode",
")",
"<mask>",
"(",
")",
"{",
"r",
".",
"tickMu",
".",
"Lock",
"(",
")",
"\n",
"r",
".",
"Tick",
"(",
")",
"\n",
"r",
".",
"tickMu",
".",
"Unlock",
"(",
")",
"\n",
"}"
] |
3,685 | all-3686 | [
"SetSentStatus",
"safely",
"sets",
"the",
"SentStatus",
"of",
"the",
"task"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"SetSentStatus",
"(",
"status",
"apitaskstatus",
".",
"TaskStatus",
")",
"{",
"task",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"task",
".",
"<mask>",
".",
"Unlock",
"(",
")",
"\n\n",
"task",
".",
"Sent... |
3,686 | all-3687 | [
"ReadFileToString",
"reads",
"the",
"file",
"at",
"the",
"provided",
"path",
"to",
"a",
"string",
"."
] | [
"func",
"ReadFileToString",
"(",
"path",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"... |
3,687 | all-3688 | [
"ForceSave",
"saves",
"the",
"given",
"State",
"to",
"a",
"file",
".",
"It",
"is",
"an",
"atomic",
"operation",
"on",
"POSIX",
"systems",
"(",
"by",
"Renaming",
"over",
"the",
"target",
"file",
")",
".",
"This",
"function",
"logs",
"errors",
"at",
"will"... | [
"func",
"(",
"manager",
"*",
"basicStateManager",
")",
"ForceSave",
"(",
")",
"error",
"{",
"manager",
".",
"savingLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"manager",
".",
"savingLock",
".",
"Unlock",
"(",
")",
"\n",
"log",
".",
"Info",
"(",
"\"",
... |
3,688 | all-3689 | [
"Infom",
"executes",
"the",
"same",
"function",
"on",
"the",
"default",
"Base",
"instance"
] | [
"func",
"Infom",
"(",
"m",
"*",
"Attrs",
",",
"<mask>",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"curDefault",
".",
"Infom",
"(",
"m",
",",
"msg",
",",
"a",
"...",
")",
"\n",
"}"
] |
3,689 | all-3690 | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"that",
"has",
"the",
"specified",
"category"
] | [
"func",
"FindPerformancePrice",
"(",
"productPackage",
"datatypes",
".",
"Product_Package",
",",
"priceCategory",
"string",
")",
"(",
"datatypes",
".",
"Product_Item_Price",
",",
"error",
")",
"{",
"for",
"_",
",",
"item",
":=",
"range",
"productPackage",
".",
"... |
3,690 | all-3691 | [
"VisibleArea",
"returns",
"which",
"rows",
"and",
"columns",
"are",
"currently",
"visible",
".",
"It",
"can",
"be",
"used",
"instead",
"of",
"OnBeforeDraw",
"event",
"to",
"prepare",
"the",
"data",
"for",
"drawing",
"without",
"waiting",
"until",
"TableView",
... | [
"func",
"(",
"l",
"*",
"TableView",
")",
"VisibleArea",
"(",
")",
"(",
"firstCol",
",",
"firstRow",
",",
"colCount",
",",
"rowCount",
"int",
")",
"{",
"firstRow",
"=",
"l",
".",
"topRow",
"\n",
"maxDy",
":=",
"l",
".",
"height",
"-",
"3",
"\n",
"if... |
3,691 | all-3692 | [
"UserId",
"is",
"an",
"adaption",
"from",
"https",
":",
"//",
"codereview",
".",
"appspot",
".",
"com",
"/",
"4589049",
"."
] | [
"func",
"UserId",
"(",
"name",
"string",
")",
"(",
"int",
",",
"error",
")",
"{",
"var",
"pw",
"C",
".",
"struct_passwd",
"\n",
"var",
"result",
"*",
"C",
".",
"struct_passwd",
"\n\n",
"bufSize",
":=",
"C",
".",
"sysconf",
"(",
"C",
".",
"_SC_GETPW_R... |
3,692 | all-3693 | [
"Match",
"is",
"labeled",
"with",
"label"
] | [
"func",
"(",
"l",
"LabelEvent",
")",
"Match",
"(",
"eventName",
",",
"label",
"string",
")",
"bool",
"{",
"return",
"eventName",
"==",
"\"",
"\"",
"&&",
"label",
"==",
"l",
".",
"<mask>",
"\n",
"}"
] |
3,693 | all-3694 | [
"/",
"*",
"Start",
"starts",
"the",
"passed",
"-",
"in",
"*",
"exec",
".",
"Cmd",
"command",
".",
"It",
"wraps",
"the",
"command",
"in",
"a",
"*",
"gexec",
".",
"Session",
"."
] | [
"func",
"Start",
"(",
"command",
"*",
"exec",
".",
"Cmd",
",",
"outWriter",
"io",
".",
"Writer",
",",
"errWriter",
"io",
".",
"Writer",
")",
"(",
"*",
"Session",
",",
"error",
")",
"{",
"exited",
":=",
"make",
"(",
"chan",
"struct",
"{",
"}",
")",
... |
3,694 | all-3695 | [
"UnmarshalText",
"implements",
"encoding",
".",
"TextUnmarshaler",
".",
"It",
"will",
"unmarshal",
"to",
"a",
"null",
"Float",
"if",
"the",
"input",
"is",
"a",
"blank",
"or",
"not",
"an",
"integer",
".",
"It",
"will",
"return",
"an",
"error",
"if",
"the",
... | [
"func",
"(",
"f",
"*",
"<mask>",
")",
"UnmarshalText",
"(",
"text",
"[",
"]",
"byte",
")",
"error",
"{",
"str",
":=",
"string",
"(",
"text",
")",
"\n",
"if",
"str",
"==",
"\"",
"\"",
"||",
"str",
"==",
"\"",
"\"",
"{",
"f",
".",
"Valid",
"=",
... |
3,695 | all-3696 | [
"AlertingRules",
"returns",
"the",
"list",
"of",
"the",
"manager",
"s",
"alerting",
"rules",
"."
] | [
"func",
"(",
"m",
"*",
"Manager",
")",
"AlertingRules",
"(",
")",
"[",
"]",
"*",
"AlertingRule",
"{",
"m",
".",
"mtx",
".",
"RLock",
"(",
")",
"\n",
"defer",
"m",
".",
"mtx",
".",
"RUnlock",
"(",
")",
"\n\n",
"alerts",
":=",
"[",
"]",
"*",
"Ale... |
3,696 | all-3697 | [
"/",
"*",
"Set",
"transaction",
"category",
"name",
"e",
".",
"g",
".",
"Uri",
"in",
"WebTransaction",
"/",
"Uri",
"/",
"<txn_name",
">"
] | [
"func",
"TransactionSetCategory",
"(",
"<mask>",
"int64",
",",
"category",
"string",
")",
"(",
"int",
",",
"error",
")",
"{",
"ccategory",
":=",
"C",
".",
"CString",
"(",
"category",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
... |
3,697 | all-3698 | [
"Servers",
"returns",
"the",
"servers",
"that",
"are",
"currently",
"part",
"of",
"the",
"cluster",
".",
"If",
"this",
"raft",
"instance",
"is",
"not",
"the",
"leader",
"an",
"error",
"is",
"returned",
"."
] | [
"func",
"(",
"i",
"*",
"raftInstance",
")",
"Servers",
"(",
")",
"(",
"[",
"]",
"raft",
".",
"Server",
",",
"error",
")",
"{",
"if",
"i",
".",
"raft",
".",
"State",
"(",
")",
"!=",
"raft",
".",
"Leader",
"{",
"return",
"nil",
",",
"raft",
".",
... |
3,698 | all-3699 | [
"Encode",
"bits",
"of",
"64",
"-",
"bit",
"word",
"into",
"a",
"string",
"."
] | [
"func",
"(",
"e",
"*",
"encoding",
")",
"Encode",
"(",
"x",
"uint64",
")",
"string",
"{",
"b",
":=",
"[",
"12",
"]",
"<mask>",
"{",
"}",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"12",
";",
"i",
"++",
"{",
"b",
"[",
"11",
"-",
"i",
"]",... |
3,699 | all-3700 | [
"NewClient",
"returns",
"a",
"worker",
"client",
"for",
"the",
"worker",
"at",
"the",
"IP",
"address",
"passed",
"in",
"."
] | [
"func",
"NewClient",
"(",
"address",
"string",
")",
"(",
"Client",
",",
"error",
")",
"{",
"port",
",",
"err",
":=",
"strconv",
".",
"Atoi",
"(",
"os",
".",
"Getenv",
"(",
"client",
".",
"PPSWorkerPortEnv",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.