id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
9,600 | all-9601 | [
"SetCookie",
"sets",
"key",
":",
"value",
"cookies",
"."
] | [
"func",
"(",
"h",
"*",
"RequestHeader",
")",
"SetCookie",
"(",
"key",
",",
"<mask>",
"string",
")",
"{",
"h",
".",
"parseRawHeaders",
"(",
")",
"\n",
"h",
".",
"collectCookies",
"(",
")",
"\n",
"h",
".",
"cookies",
"=",
"setArg",
"(",
"h",
".",
"co... |
9,601 | all-9602 | [
"HasType",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"g",
"*",
"GroupDefinition",
")",
"HasType",
"(",
")",
"bool",
"{",
"if",
"g",
"!=",
"nil",
"&&",
"g",
".",
"<mask>",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
9,602 | all-9603 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"the",
"current",
"program",
"object"
] | [
"func",
"UniformMatrix2fv",
"(",
"location",
"int32",
",",
"count",
"int32",
",",
"transpose",
"bool",
",",
"value",
"*",
"float32",
")",
"{",
"C",
".",
"glowUniformMatrix2fv",
"(",
"gpUniformMatrix2fv",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"location",
"... |
9,603 | all-9604 | [
"voteResponseType",
"maps",
"vote",
"and",
"prevote",
"message",
"types",
"to",
"their",
"corresponding",
"responses",
"."
] | [
"func",
"voteRespMsgType",
"(",
"msgt",
"pb",
".",
"MessageType",
")",
"pb",
".",
"MessageType",
"{",
"<mask>",
"msgt",
"{",
"case",
"pb",
".",
"MsgVote",
":",
"return",
"pb",
".",
"MsgVoteResp",
"\n",
"case",
"pb",
".",
"MsgPreVote",
":",
"return",
"pb"... |
9,604 | all-9605 | [
"Walk",
"walks",
"the",
"pfs",
"filesystem",
"rooted",
"at",
"path",
".",
"walkFn",
"will",
"be",
"called",
"for",
"each",
"file",
"found",
"under",
"path",
"in",
"lexicographical",
"order",
".",
"This",
"includes",
"both",
"regular",
"files",
"and",
"direct... | [
"func",
"(",
"c",
"APIClient",
")",
"Walk",
"(",
"repoName",
"string",
",",
"commitID",
"string",
",",
"path",
"string",
",",
"f",
"WalkFn",
")",
"error",
"{",
"<mask>",
",",
"err",
":=",
"c",
".",
"PfsAPIClient",
".",
"WalkFile",
"(",
"c",
".",
"Ctx... |
9,605 | all-9606 | [
"JustConnectedGamepadIDs",
"returns",
"gamepad",
"IDs",
"that",
"are",
"connected",
"just",
"in",
"the",
"current",
"frame",
".",
"JustConnectedGamepadIDs",
"might",
"return",
"nil",
"when",
"there",
"is",
"no",
"connected",
"gamepad",
".",
"JustConnectedGamepadIDs",
... | [
"func",
"JustConnectedGamepadIDs",
"(",
")",
"[",
"]",
"int",
"{",
"var",
"ids",
"[",
"]",
"int",
"\n",
"theInputState",
".",
"m",
".",
"RLock",
"(",
")",
"\n",
"for",
"id",
":=",
"range",
"theInputState",
".",
"gamepadIDs",
"{",
"if",
"_",
",",
"ok"... |
9,606 | all-9607 | [
"PrependItem",
"is",
"a",
"wrapper",
"around",
"g_menu_prepend_item",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Menu",
")",
"PrependItem",
"(",
"item",
"*",
"MenuItem",
")",
"{",
"C",
".",
"g_menu_prepend_item",
"(",
"v",
".",
"native",
"(",
")",
",",
"<mask>",
".",
"native",
"(",
")",
")",
"\n",
"}"
] |
9,607 | all-9608 | [
"GetUserConfigDir",
"is",
"a",
"wrapper",
"around",
"g_get_user_config_dir",
"()",
"."
] | [
"func",
"GetUserConfigDir",
"(",
")",
"string",
"{",
"c",
":=",
"C",
".",
"g_get_user_config_dir",
"(",
")",
"\n",
"return",
"C",
".",
"GoString",
"(",
"(",
"*",
"C",
".",
"<mask>",
")",
"(",
"c",
")",
")",
"\n",
"}"
] |
9,608 | all-9609 | [
"GetCCs",
"gets",
"the",
"list",
"of",
"suggested",
"approvers",
"for",
"a",
"pull",
"-",
"request",
".",
"It",
"now",
"considers",
"current",
"assignees",
"as",
"potential",
"approvers",
".",
"Here",
"is",
"how",
"it",
"works",
":",
"-",
"We",
"find",
"... | [
"func",
"(",
"ap",
"Approvers",
")",
"GetCCs",
"(",
")",
"[",
"]",
"string",
"{",
"randomizedApprovers",
":=",
"ap",
".",
"owners",
".",
"GetShuffledApprovers",
"(",
")",
"\n\n",
"currentApprovers",
":=",
"ap",
".",
"GetCurrentApproversSet",
"(",
")",
"\n",
... |
9,609 | all-9610 | [
"NewTokenAuthenticator",
"returns",
"an",
"authenticator",
"that",
"use",
"an",
"oauth",
"access",
"token",
"to",
"do",
"authentication",
".",
"This",
"is",
"useful",
"if",
"the",
"oauth",
"handshake",
"has",
"already",
"happened",
".",
"Use",
"the",
"OAuthAuthe... | [
"func",
"NewTokenAuthenticator",
"(",
"token",
"string",
",",
"accountID",
"int",
")",
"Authenticator",
"{",
"return",
"&",
"tokenAuthenticator",
"{",
"<mask>",
":",
"token",
",",
"accountID",
":",
"accountID",
"}",
"\n",
"}"
] |
9,610 | all-9611 | [
"SendFile",
"registers",
"file",
"on",
"the",
"given",
"path",
"to",
"be",
"used",
"as",
"response",
"body",
"when",
"Write",
"is",
"called",
".",
"Note",
"that",
"SendFile",
"doesn",
"t",
"set",
"Content",
"-",
"Type",
"so",
"set",
"it",
"yourself",
"wi... | [
"func",
"(",
"resp",
"*",
"Response",
")",
"SendFile",
"(",
"path",
"string",
")",
"error",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"fileInfo",
",",... |
9,611 | all-9612 | [
"ReadAll",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockFileSystem",
")",
"ReadAll",
"(",
"arg0",
"io",
".",
"Reader",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret... |
9,612 | all-9613 | [
"isFullscreen",
"must",
"be",
"called",
"from",
"the",
"main",
"thread",
"."
] | [
"func",
"(",
"u",
"*",
"UserInterface",
")",
"isFullscreen",
"(",
")",
"bool",
"{",
"if",
"!",
"u",
".",
"isRunning",
"(",
")",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"u",
".",
"<mask>",
".",
"GetMonitor",
"(",
")",
"!=",
... |
9,613 | all-9614 | [
"/",
"*",
"Warningf",
"uses",
"msg",
"as",
"a",
"format",
"string",
"with",
"subsequent",
"parameters",
"as",
"values",
"and",
"logs",
"the",
"resulting",
"message",
"to",
"all",
"added",
"loggers",
"at",
"LogLevel",
".",
"LevelWarning"
] | [
"func",
"(",
"la",
"*",
"LogAdapter",
")",
"Warningf",
"(",
"<mask>",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"la",
".",
"Log",
"(",
"LevelWarning",
",",
"nil",
",",
"msg",
",",
"a",
"...",
")",
"\n",
"}"
] |
9,614 | all-9615 | [
"GetIncreaseGoodOk",
"returns",
"a",
"tuple",
"with",
"the",
"IncreaseGood",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"c",
"*",
"ChangeRequest",
")",
"GetIncreaseGoodOk",
"(",
")",
"(",
"bool",
",",
"bool",
")",
"{",
"if",
"c",
"==",
"nil",
"||",
"c",
".",
"IncreaseGood",
"==",
"nil",
"{",
"return",
"<mask>",
",",
"false",
"\n",
"}",
"\n",
"return",
"... |
9,615 | all-9616 | [
"ListImages",
"returns",
"an",
"Collection",
"struct"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListImages",
"(",
")",
"(",
"*",
"Images",
",",
"error",
")",
"{",
"url",
":=",
"imageColPath",
"(",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
"+",
"strconv",
".",
"Forma... |
9,616 | all-9617 | [
"maybeDecrTo",
"returns",
"false",
"if",
"the",
"given",
"to",
"index",
"comes",
"from",
"an",
"out",
"of",
"order",
"message",
".",
"Otherwise",
"it",
"decreases",
"the",
"progress",
"next",
"index",
"to",
"min",
"(",
"rejected",
"last",
")",
"and",
"retu... | [
"func",
"(",
"pr",
"*",
"Progress",
")",
"maybeDecrTo",
"(",
"rejected",
",",
"last",
"uint64",
")",
"bool",
"{",
"if",
"pr",
".",
"State",
"==",
"ProgressStateReplicate",
"{",
"// the rejection must be stale if the progress has matched and \"rejected\"",
"// is smaller... |
9,617 | all-9618 | [
"PolicyConfigurationIdentity",
"returns",
"a",
"string",
"representation",
"of",
"the",
"reference",
"suitable",
"for",
"policy",
"lookup",
".",
"This",
"MUST",
"reflect",
"user",
"intent",
"not",
"e",
".",
"g",
".",
"after",
"processing",
"of",
"third",
"-",
... | [
"func",
"(",
"ref",
"daemonReference",
")",
"PolicyConfigurationIdentity",
"(",
")",
"string",
"{",
"// We must allow referring to images in the daemon by image ID, otherwise untagged images would not be accessible.",
"// But the existence of image IDs means that we can’t truly well namespace ... |
9,618 | all-9619 | [
"Reset",
"clears",
"the",
"cookie",
"."
] | [
"func",
"(",
"c",
"*",
"Cookie",
")",
"Reset",
"(",
")",
"{",
"c",
".",
"key",
"=",
"c",
".",
"key",
"[",
":",
"0",
"]",
"\n",
"c",
".",
"value",
"=",
"c",
".",
"value",
"[",
":",
"0",
"]",
"\n",
"c",
".",
"expire",
"=",
"zeroTime",
"\n",... |
9,619 | all-9620 | [
"GRPCCode",
"returns",
"the",
"corresponding",
"http",
"status",
"code",
"from",
"an",
"error"
] | [
"func",
"GRPCCode",
"(",
"err",
"error",
")",
"codes",
".",
"Code",
"{",
"e",
",",
"ok",
":=",
"err",
".",
"(",
"Error",
")",
"\n",
"if",
"<mask>",
"{",
"return",
"e",
".",
"Type",
"(",
")",
".",
"GRPCCode",
"(",
")",
"\n",
"}",
"\n\n",
"return... |
9,620 | all-9621 | [
"handle",
"drives",
"the",
"pull",
"request",
"to",
"the",
"desired",
"state",
".",
"If",
"any",
"user",
"adds",
"a",
"/",
"hold",
"directive",
"we",
"want",
"to",
"add",
"a",
"label",
"if",
"one",
"does",
"not",
"already",
"exist",
".",
"If",
"they",
... | [
"func",
"handle",
"(",
"gc",
"githubClient",
",",
"log",
"*",
"logrus",
".",
"<mask>",
",",
"e",
"*",
"github",
".",
"GenericCommentEvent",
",",
"f",
"hasLabelFunc",
")",
"error",
"{",
"if",
"e",
".",
"Action",
"!=",
"github",
".",
"GenericCommentActionCre... |
9,621 | all-9622 | [
"GetActiveText",
"is",
"a",
"wrapper",
"around",
"gtk_combo_box_text_get_active_text",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"ComboBoxText",
")",
"GetActiveText",
"(",
")",
"string",
"{",
"c",
":=",
"(",
"*",
"C",
".",
"<mask>",
")",
"(",
"C",
".",
"gtk_combo_box_text_get_active_text",
"(",
"v",
".",
"native",
"(",
")",
")",
")",
"\n",
"defer",
"C",
... |
9,622 | all-9623 | [
"Equals",
"returns",
"whether",
"the",
"contents",
"of",
"two",
"sets",
"are",
"identical"
] | [
"func",
"(",
"us",
"*",
"unsafeSet",
")",
"Equals",
"(",
"other",
"Set",
")",
"bool",
"{",
"v1",
":=",
"sort",
".",
"StringSlice",
"(",
"us",
".",
"Values",
"(",
")",
")",
"\n",
"v2",
":=",
"<mask>",
".",
"StringSlice",
"(",
"other",
".",
"Values",... |
9,623 | all-9624 | [
"Given",
"a",
"path",
"and",
"whatever",
"the",
"http",
"method",
"return",
"all",
"the",
"matching",
"routes",
"."
] | [
"func",
"(",
"t",
"*",
"Trie",
")",
"FindRoutesForPath",
"(",
"path",
"string",
")",
"[",
"]",
"*",
"Match",
"{",
"context",
":=",
"newFindContext",
"(",
")",
"\n",
"matches",
":=",
"[",
"]",
"*",
"Match",
"{",
"}",
"\n",
"context",
".",
"matchFunc",... |
9,624 | all-9625 | [
"WriteTo",
"writes",
"data",
"to",
"w",
"."
] | [
"func",
"(",
"e",
"*",
"plainText",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"var",
"bf",
"bytes",
".",
"Buffer",
"\n\n",
"// Write the plain text.",
"bf",
".",
"WriteString",
"(",
"strings",
".",
"Join"... |
9,625 | all-9626 | [
"Update",
"updates",
"the",
"value",
"/",
"ttl",
"of",
"the",
"node",
".",
"If",
"the",
"node",
"is",
"a",
"file",
"the",
"value",
"and",
"the",
"ttl",
"can",
"be",
"updated",
".",
"If",
"the",
"node",
"is",
"a",
"directory",
"only",
"the",
"ttl",
... | [
"func",
"(",
"s",
"*",
"store",
")",
"Update",
"(",
"nodePath",
"string",
",",
"newValue",
"string",
",",
"expireOpts",
"TTLOptionSet",
")",
"(",
"*",
"Event",
",",
"error",
")",
"{",
"<mask>",
"err",
"*",
"v2error",
".",
"Error",
"\n\n",
"s",
".",
"... |
9,626 | all-9627 | [
"RegisterTopicValidator",
"registers",
"a",
"validator",
"for",
"topic",
"."
] | [
"func",
"(",
"p",
"*",
"PubSub",
")",
"RegisterTopicValidator",
"(",
"topic",
"string",
",",
"val",
"Validator",
",",
"opts",
"...",
"ValidatorOpt",
")",
"error",
"{",
"addVal",
":=",
"&",
"addValReq",
"{",
"topic",
":",
"topic",
",",
"validate",
":",
"v... |
9,627 | all-9628 | [
"MiddlewareFunc",
"makes",
"ContentTypeCheckerMiddleware",
"implement",
"the",
"Middleware",
"interface",
"."
] | [
"func",
"(",
"mw",
"*",
"ContentTypeCheckerMiddleware",
")",
"MiddlewareFunc",
"(",
"handler",
"HandlerFunc",
")",
"HandlerFunc",
"{",
"return",
"func",
"(",
"w",
"ResponseWriter",
",",
"r",
"*",
"Request",
")",
"{",
"mediatype",
",",
"params",
",",
"_",
":=... |
9,628 | all-9629 | [
"Synchronous",
"."
] | [
"func",
"(",
"<mask>",
"*",
"localPeer",
")",
"doDeleteConnection",
"(",
"conn",
"ourConnection",
")",
"{",
"resultChan",
":=",
"make",
"(",
"chan",
"interface",
"{",
"}",
")",
"\n",
"peer",
".",
"actionChan",
"<-",
"func",
"(",
")",
"{",
"peer",
".",
... |
9,629 | all-9630 | [
"logPanic",
"logs",
"the",
"caller",
"tree",
"when",
"a",
"panic",
"occurs",
"."
] | [
"func",
"logPanic",
"(",
"r",
"interface",
"{",
"}",
")",
"{",
"callers",
":=",
"\"",
"\"",
"\n",
"for",
"i",
":=",
"0",
";",
"true",
";",
"i",
"++",
"{",
"_",
",",
"file",
",",
"line",
",",
"ok",
":=",
"runtime",
".",
"Caller",
"(",
"i",
")"... |
9,630 | all-9631 | [
"MustGetScpLedgerSeq",
"retrieves",
"the",
"GetScpLedgerSeq",
"value",
"from",
"the",
"union",
"panicing",
"if",
"the",
"value",
"is",
"not",
"set",
"."
] | [
"func",
"(",
"u",
"StellarMessage",
")",
"MustGetScpLedgerSeq",
"(",
")",
"Uint32",
"{",
"val",
",",
"<mask>",
":=",
"u",
".",
"GetGetScpLedgerSeq",
"(",
")",
"\n\n",
"if",
"!",
"ok",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"... |
9,631 | all-9632 | [
"ClearMilestone",
"clears",
"the",
"milestone",
"from",
"the",
"specified",
"issue",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"issues",
"/",
"#edit",
"-",
"an",
"-",
"issue"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"ClearMilestone",
"(",
"org",
",",
"repo",
"string",
",",
"num",
"int",
")",
"error",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
",",
"num",
")",
"\n\n",
"issue",
":=",
"&",
"struct",
"... |
9,632 | all-9633 | [
"RowsColumn",
"creates",
"a",
"Rows",
"query",
"with",
"the",
"given",
"column",
"ID",
"/",
"key"
] | [
"func",
"(",
"f",
"*",
"Field",
")",
"RowsColumn",
"(",
"columnIDOrKey",
"<mask>",
"{",
"}",
")",
"*",
"PQLRowsQuery",
"{",
"idKey",
",",
"err",
":=",
"formatIDKey",
"(",
"columnIDOrKey",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"NewPQLRowsQue... |
9,633 | all-9634 | [
"GetDashboardList",
"returns",
"a",
"single",
"dashboard",
"list",
"created",
"on",
"this",
"account",
"."
] | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetDashboardList",
"(",
"<mask>",
"int",
")",
"(",
"*",
"DashboardList",
",",
"error",
")",
"{",
"var",
"out",
"DashboardList",
"\n",
"if",
"err",
":=",
"client",
".",
"doJsonRequest",
"(",
"\"",
"\"",
",",
"... |
9,634 | all-9635 | [
"Listen",
"bind",
"port",
".",
"Receive",
"messages",
"and",
"send",
"to",
"out",
"channel"
] | [
"func",
"(",
"api",
"*",
"Api",
")",
"Listen",
"(",
"addr",
"*",
"net",
".",
"TCPAddr",
")",
"error",
"{",
"return",
"api",
".",
"StartFunc",
"(",
"func",
"(",
")",
"error",
"{",
"tcpListener",
",",
"err",
":=",
"net",
".",
"ListenTCP",
"(",
"\"",
... |
9,635 | all-9636 | [
"Add",
"a",
"new",
"operation",
"to",
"the",
"bundle",
".",
"The",
"operation",
"will",
"be",
"invoked",
"with",
"a",
"context",
"that",
"will",
"be",
"cancelled",
"if",
"any",
"other",
"operation",
"fails",
"or",
"has",
"already",
"failed",
"."
] | [
"func",
"(",
"b",
"*",
"Bundle",
")",
"Add",
"(",
"f",
"func",
"(",
"context",
".",
"Context",
")",
"error",
")",
"{",
"b",
".",
"waitGroup",
".",
"Add",
"(",
"1",
")",
"\n\n",
"// Run the function in the background.",
"<mask>",
"func",
"(",
")",
"{",
... |
9,636 | all-9637 | [
"Output",
"records",
"the",
"log",
"with",
"special",
"callstack",
"depth",
"and",
"log",
"level",
"."
] | [
"func",
"(",
"l",
"*",
"Logger",
")",
"Output",
"(",
"callDepth",
"int",
",",
"level",
"Level",
",",
"msg",
"string",
")",
"{",
"if",
"l",
".",
"level",
">",
"level",
"{",
"return",
"\n",
"}",
"\n\n",
"buf",
":=",
"l",
".",
"bufs",
".",
"Get",
... |
9,637 | all-9638 | [
"Start",
"-",
"starts",
"a",
"service",
"for",
"remote",
"clients",
"to",
"subscribe",
"to",
"events"
] | [
"func",
"(",
"server",
"*",
"Server",
")",
"Start",
"(",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"service",
":=",
"server",
".",
"service",
"\n",
"if",
"!",
"service",
".",
"started",
"{",
"rpcServer",
":=",
"rpc",
".",
"NewServer",
"(",
")",... |
9,638 | all-9639 | [
"IterNthChild",
"is",
"a",
"wrapper",
"around",
"gtk_tree_model_iter_nth_child",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TreeModel",
")",
"IterNthChild",
"(",
"iter",
"*",
"TreeIter",
",",
"parent",
"*",
"TreeIter",
",",
"n",
"int",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_tree_model_iter_nth_child",
"(",
"v",
".",
"native",
"(",
")",
",",
"i... |
9,639 | all-9640 | [
"UpdateOutlierReport",
"updates",
"passed",
"outlier",
"report",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"UpdateOutlierReport",
"(",
"cfg",
"*",
"OutlierReport",
")",
"(",
"*",
"OutlierReport",
",",
"error",
")",
"{",
"if",
"cfg",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n... |
9,640 | all-9641 | [
"At",
"implements",
"storage",
".",
"SeriesIterator",
"."
] | [
"func",
"(",
"c",
"*",
"concreteSeriesIterator",
")",
"At",
"(",
")",
"(",
"t",
"int64",
",",
"v",
"float64",
")",
"{",
"s",
":=",
"c",
".",
"series",
".",
"samples",
"[",
"c",
".",
"cur",
"]",
"\n",
"return",
"s",
".",
"Timestamp",
",",
"s",
"... |
9,641 | all-9642 | [
"Rows",
"creates",
"a",
"Rows",
"query",
"with",
"defaults"
] | [
"func",
"(",
"f",
"*",
"Field",
")",
"Rows",
"(",
")",
"*",
"PQLRowsQuery",
"{",
"text",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"f",
".",
"name",
")",
"\n",
"return",
"NewPQLRowsQuery",
"(",
"text",
",",
"f",
".",
"<mask>",
",",
"nil"... |
9,642 | all-9643 | [
"NewDBFromConnStr",
"connects",
"to",
"db",
"and",
"returns",
"db",
"instance",
"."
] | [
"func",
"NewDBFromConnStr",
"(",
"connStr",
"string",
")",
"(",
"*",
"reform",
".",
"<mask>",
",",
"error",
")",
"{",
"conn",
",",
"err",
":=",
"dbConnect",
"(",
"connStr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
... |
9,643 | all-9644 | [
"UpdateMessagePact",
"adds",
"a",
"pact",
"message",
"to",
"a",
"contract",
"file"
] | [
"func",
"(",
"p",
"*",
"PactClient",
")",
"UpdateMessagePact",
"(",
"request",
"types",
".",
"PactMessageRequest",
")",
"error",
"{",
"log",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n\n",
"// Convert request into flags, and validate request",
"err",
":=",
"<mask>",... |
9,644 | all-9645 | [
"**************************************************************************************",
"\\",
"Drawing",
"*",
"\\",
"***************************************************************************************",
"/",
"*",
"Draws",
"4",
"-",
"connected",
"8",
"-",
"connected",
"or",
"ant... | [
"func",
"Line",
"(",
"image",
"*",
"IplImage",
",",
"pt1",
",",
"pt2",
"Point",
",",
"color",
"Scalar",
",",
"thickness",
",",
"line_type",
",",
"shift",
"int",
")",
"{",
"C",
".",
"cvLine",
"(",
"unsafe",
".",
"Pointer",
"(",
"image",
")",
",",
"C... |
9,645 | all-9646 | [
"AddSystemUser",
"adds",
"a",
"system",
"user",
"to",
"both",
"user",
"and",
"shadow",
"files",
"."
] | [
"func",
"AddSystemUser",
"(",
"name",
",",
"homeDir",
"string",
",",
"gid",
"int",
")",
"(",
"uid",
"int",
",",
"err",
"error",
")",
"{",
"s",
":=",
"NewShadow",
"(",
"name",
")",
"\n",
"if",
"err",
"=",
"s",
".",
"Add",
"(",
"nil",
")",
";",
"... |
9,646 | all-9647 | [
"rate",
"returns",
"the",
"per",
"-",
"second",
"rate",
"."
] | [
"func",
"(",
"r",
"*",
"ewmaRate",
")",
"<mask>",
"(",
")",
"float64",
"{",
"r",
".",
"mutex",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r",
".",
"mutex",
".",
"Unlock",
"(",
")",
"\n",
"return",
"r",
".",
"lastRate",
"\n",
"}"
] |
9,647 | all-9648 | [
"Diem",
"will",
"log",
"a",
"message",
"using",
"Fatalm",
"call",
"ShutdownLoggers",
"and",
"then",
"exit",
"the",
"application",
"with",
"the",
"provided",
"exit",
"code",
"."
] | [
"func",
"(",
"la",
"*",
"LogAdapter",
")",
"Diem",
"(",
"exitCode",
"int",
",",
"m",
"*",
"Attrs",
",",
"<mask>",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"la",
".",
"Log",
"(",
"LevelFatal",
",",
"m",
",",
"msg",
",",
"a",
"... |
9,648 | all-9649 | [
"GetLogger",
"returns",
"a",
"logger",
"suitable",
"for",
"using",
"as",
"logger",
".",
"Log",
"."
] | [
"func",
"GetLogger",
"(",
"syslog",
"string",
",",
"logfile",
"string",
",",
"verbose",
"bool",
",",
"debug",
"bool",
",",
"customHandler",
"log",
".",
"Handler",
")",
"(",
"logger",
".",
"Logger",
",",
"error",
")",
"{",
"Log",
":=",
"log",
".",
"New"... |
9,649 | all-9650 | [
"SetShowRecommended",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_app_chooser_widget_set_show_recommended",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"AppChooserWidget",
")",
"SetShowRecommended",
"(",
"<mask>",
"bool",
")",
"{",
"C",
".",
"gtk_app_chooser_widget_set_show_recommended",
"(",
"v",
".",
"native",
"(",
")",
",",
"gbool",
"(",
"setting",
")",
")",
"\n",
"}"
] |
9,650 | all-9651 | [
"Move",
"enqueues",
"tile",
"moving",
"tasks",
"."
] | [
"func",
"(",
"b",
"*",
"Board",
")",
"Move",
"(",
"dir",
"Dir",
")",
"error",
"{",
"for",
"t",
":=",
"range",
"b",
".",
"tiles",
"{",
"t",
".",
"stopAnimation",
"(",
")",
"\n",
"}",
"\n",
"if",
"!",
"MoveTiles",
"(",
"b",
".",
"tiles",
",",
"... |
9,651 | all-9652 | [
"DeepCopyObject",
"implements",
"Collection",
"interface"
] | [
"func",
"(",
"in",
"*",
"ResourceCollection",
")",
"DeepCopyObject",
"(",
")",
"runtime",
".",
"Object",
"{",
"if",
"c",
":=",
"<mask>",
".",
"deepCopy",
"(",
")",
";",
"c",
"!=",
"nil",
"{",
"return",
"c",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"... |
9,652 | all-9653 | [
"OSFamily",
"uses",
"the",
"resource",
"pool",
"s",
"environment",
"browser",
"to",
"get",
"the",
"OS",
"family",
"for",
"a",
"specific",
"guest",
"ID",
"."
] | [
"func",
"OSFamily",
"(",
"client",
"*",
"govmomi",
".",
"Client",
",",
"pool",
"*",
"object",
".",
"ResourcePool",
",",
"guest",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"guest",
")",
"\n",
"... |
9,653 | all-9654 | [
"Start",
"the",
"server"
] | [
"func",
"(",
"s",
"*",
"TLS",
")",
"Start",
"(",
"c",
"context",
".",
"Context",
",",
"h",
"<mask>",
".",
"Handler",
")",
"error",
"{",
"s",
".",
"Handler",
"=",
"h",
"\n",
"return",
"s",
".",
"ListenAndServeTLS",
"(",
"s",
".",
"CertFile",
",",
... |
9,654 | all-9655 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetInstrumentationBreakpointParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger1",
"(",
"&",
"w... |
9,655 | all-9656 | [
"IMPLEMENTATION",
"MakeHub",
"returns",
"new",
"instance",
"of",
"the",
"pubsub",
"hub",
"."
] | [
"func",
"MakeHub",
"(",
"config",
"HubConfig",
")",
"(",
"Hub",
",",
"error",
")",
"{",
"if",
"config",
"==",
"nil",
"{",
"return",
"NewHub",
"(",
")",
",",
"nil",
"\n",
"}",
"\n\n",
"driverName",
":=",
"getDriverName",
"(",
"config",
")",
"\n",
"if"... |
9,656 | all-9657 | [
"PrettyPrintCode",
"renders",
"h",
"as",
"<error",
"code",
">",
"<description",
">",
"e",
".",
"g",
".",
"200",
"OK"
] | [
"func",
"PrettyPrintCode",
"(",
"h",
"*",
"HTTPError",
")",
"string",
"{",
"codeNumber",
":=",
"h",
".",
"Code",
"(",
")",
"\n",
"codeText",
":=",
"<mask>",
".",
"StatusText",
"(",
"h",
".",
"Code",
"(",
")",
")",
"\n",
"return",
"fmt",
".",
"Sprintf... |
9,657 | all-9658 | [
"AddEntry",
"add",
"new",
"child",
"entry",
".",
"Child",
"entries",
"are",
"sorted",
"irrespective",
"of",
"order",
"they",
"are",
"added",
".",
"Static",
"patterns",
"would",
"be",
"indexed",
"ahead",
"of",
"match",
"patterns",
"."
] | [
"func",
"(",
"e",
"*",
"Entry",
")",
"AddEntry",
"(",
"child",
"*",
"Entry",
")",
"{",
"length",
":=",
"len",
"(",
"e",
".",
"entries",
")",
"\n",
"if",
"length",
"==",
"0",
"{",
"e",
".",
"entries",
"=",
"append",
"(",
"e",
".",
"entries",
","... |
9,658 | all-9659 | [
"Do",
"executes",
"Overlay",
".",
"setInspectMode",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetInspectModeParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetInspectMode",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
9,659 | all-9660 | [
"String",
"returns",
"a",
"human",
"-",
"readable",
"string",
"representing",
"the",
"edit",
"-",
"script",
"where",
"Identity",
"UniqueX",
"UniqueY",
"and",
"Modified",
"are",
"represented",
"by",
"the",
".",
"X",
"Y",
"and",
"M",
"characters",
"respectively"... | [
"func",
"(",
"es",
"EditScript",
")",
"String",
"(",
")",
"string",
"{",
"b",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"len",
"(",
"es",
")",
")",
"\n",
"for",
"i",
",",
"e",
":=",
"range",
"es",
"{",
"<mask>",
"e",
"{",
"case",
"Identity",
... |
9,660 | all-9661 | [
"AddMetadata",
"adds",
"necessary",
"metadata",
"(",
"including",
"authentication",
"credentials",
")",
"to",
"the",
"context",
"ctx",
"preserving",
"any",
"metadata",
"that",
"is",
"present",
"in",
"either",
"the",
"incoming",
"or",
"outgoing",
"metadata",
"of",
... | [
"func",
"(",
"c",
"*",
"APIClient",
")",
"AddMetadata",
"(",
"ctx",
"context",
".",
"Context",
")",
"context",
".",
"<mask>",
"{",
"// TODO(msteffen): There are several places in this client where it's possible",
"// to set per-request metadata (specifically auth tokens): client.... |
9,661 | all-9662 | [
"verifyTaskMetadata",
"verifies",
"the",
"number",
"of",
"containers",
"in",
"task",
"metadata",
"make",
"sure",
"each",
"necessary",
"field",
"is",
"not",
"empty",
"we",
"cannot",
"check",
"the",
"values",
"of",
"those",
"fields",
"since",
"they",
"are",
"dyn... | [
"func",
"verifyTaskMetadata",
"(",
"taskMetadataRawMsg",
"json",
".",
"RawMessage",
")",
"error",
"{",
"taskMetadataMap",
":=",
"make",
"(",
"<mask>",
"[",
"string",
"]",
"json",
".",
"RawMessage",
")",
"\n",
"json",
".",
"Unmarshal",
"(",
"taskMetadataRawMsg",
... |
9,662 | all-9663 | [
"SupportsSignatures",
"returns",
"an",
"error",
"(",
"to",
"be",
"displayed",
"to",
"the",
"user",
")",
"if",
"the",
"destination",
"certainly",
"can",
"t",
"store",
"signatures"
] | [
"func",
"(",
"d",
"*",
"ociArchiveImageDestination",
")",
"SupportsSignatures",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"error",
"{",
"return",
"d",
".",
"unpackedDest",
".",
"SupportsSignatures",
"(",
"ctx",
")",
"\n",
"}"
] |
9,663 | all-9664 | [
"NewImageDestination",
"returns",
"a",
"types",
".",
"ImageDestination",
"for",
"this",
"reference",
".",
"The",
"caller",
"must",
"call",
".",
"Close",
"()",
"on",
"the",
"returned",
"ImageDestination",
"."
] | [
"func",
"(",
"<mask>",
"archiveReference",
")",
"NewImageDestination",
"(",
"ctx",
"context",
".",
"Context",
",",
"sys",
"*",
"types",
".",
"SystemContext",
")",
"(",
"types",
".",
"ImageDestination",
",",
"error",
")",
"{",
"return",
"newImageDestination",
"... |
9,664 | all-9665 | [
"StorageVolumeCleanupImages",
"removes",
"the",
"volumes",
"with",
"the",
"given",
"fingerprints",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"StorageVolumeCleanupImages",
"(",
"fingerprints",
"[",
"]",
"string",
")",
"error",
"{",
"stmt",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"query",
".",
"Params",
"(",
"len",
"(",
"fingerprints",
")",
")... |
9,665 | all-9666 | [
"appendIterators",
"appends",
"iterators",
"to",
"an",
"array",
"of",
"iterators",
"for",
"merging",
".",
"Note",
":",
"This",
"obtains",
"references",
"for",
"the",
"table",
"handlers",
".",
"Remember",
"to",
"close",
"these",
"iterators",
"."
] | [
"func",
"(",
"s",
"*",
"levelsController",
")",
"appendIterators",
"(",
"iters",
"[",
"]",
"y",
".",
"Iterator",
",",
"opt",
"*",
"IteratorOptions",
")",
"[",
"]",
"y",
".",
"Iterator",
"{",
"// Just like with get, it's important we iterate the levels from 0 on upwa... |
9,666 | all-9667 | [
"MonitoringMetricLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] | [
"func",
"(",
"api",
"*",
"API",
")",
"MonitoringMetricLocator",
"(",
"href",
"<mask>",
")",
"*",
"MonitoringMetricLocator",
"{",
"return",
"&",
"MonitoringMetricLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
9,667 | all-9668 | [
"GetDouble",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_get_double",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PrintSettings",
")",
"GetDouble",
"(",
"key",
"string",
")",
"float64",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"<mask>",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n"... |
9,668 | all-9669 | [
"ReadAll",
"reads",
"all",
"available",
"pod",
"logs",
"failing",
"if",
"they",
"are",
"too",
"large"
] | [
"func",
"(",
"a",
"*",
"PodLogArtifact",
")",
"ReadAll",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"<mask>",
",",
"err",
":=",
"a",
".",
"Size",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"... |
9,669 | all-9670 | [
"GetPerspectiveTransform",
"calculates",
"a",
"perspective",
"transform",
"from",
"four",
"pairs",
"of",
"the",
"corresponding",
"points",
".",
"Parameters",
":",
"src",
"–",
"Coordinates",
"of",
"quadrangle",
"vertices",
"in",
"the",
"source",
"image",
".",
"dst"... | [
"func",
"GetPerspectiveTransform",
"(",
"rect",
",",
"dst",
"[",
"]",
"CvPoint2D32f",
")",
"*",
"Mat",
"{",
"mat",
":=",
"CreateMat",
"(",
"3",
",",
"3",
",",
"CV_64F",
")",
"\n",
"result",
":=",
"C",
".",
"cvGetPerspectiveTransform",
"(",
"(",
"*",
"C... |
9,670 | all-9671 | [
"ParseCommits",
"converts",
"all",
"arguments",
"to",
"*",
"pfs",
".",
"Commit",
"structs",
"using",
"the",
"semantics",
"of",
"ParseCommit"
] | [
"func",
"ParseCommits",
"(",
"args",
"[",
"]",
"string",
")",
"(",
"[",
"]",
"*",
"pfs",
".",
"Commit",
",",
"error",
")",
"{",
"var",
"results",
"[",
"]",
"*",
"pfs",
".",
"Commit",
"\n",
"for",
"_",
",",
"arg",
":=",
"range",
"args",
"{",
"co... |
9,671 | all-9672 | [
"MarshalYAML",
"implements",
"the",
"yaml",
".",
"Marshaler",
"interface",
"."
] | [
"func",
"(",
"tg",
"Group",
")",
"MarshalYAML",
"(",
")",
"(",
"<mask>",
"{",
"}",
",",
"error",
")",
"{",
"g",
":=",
"&",
"struct",
"{",
"Targets",
"[",
"]",
"string",
"`yaml:\"targets\"`",
"\n",
"Labels",
"model",
".",
"LabelSet",
"`yaml:\"labels,omite... |
9,672 | all-9673 | [
"ApplyRuleIf",
"test",
"if",
"condition",
"is",
"true",
"than",
"apply",
"rule",
".",
"If",
"condition",
"is",
"false",
"do",
"nothing",
"return",
"true",
"."
] | [
"func",
"ApplyRuleIf",
"(",
"condition",
",",
"rule",
"Ruler",
")",
"Ruler",
"{",
"return",
"&",
"apply",
"{",
"<mask>",
":",
"condition",
",",
"rule",
":",
"rule",
",",
"}",
"\n",
"}"
] |
9,673 | all-9674 | [
"GetTriggerWindowOk",
"returns",
"a",
"tuple",
"with",
"the",
"TriggerWindow",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"ThresholdWindows",
")",
"GetTriggerWindowOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"t",
"==",
"nil",
"||",
"t",
".",
"TriggerWindow",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"r... |
9,674 | all-9675 | [
"HasIncreaseGood",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TileDefRequest",
")",
"HasIncreaseGood",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"IncreaseGood",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
9,675 | all-9676 | [
"Calculates",
"approximate",
"distance",
"between",
"two",
"points",
"using",
"euclidian",
"distance",
".",
"The",
"assumption",
"here",
"is",
"that",
"the",
"points",
"are",
"relatively",
"close",
"to",
"each",
"other",
"."
] | [
"func",
"approximateSquareDistance",
"(",
"p1",
",",
"p2",
"Point",
")",
"Meters",
"{",
"avgLat",
":=",
"(",
"p1",
".",
"Lat",
"(",
")",
"+",
"p2",
".",
"Lat",
"(",
")",
")",
"/",
"2.0",
"\n\n",
"latLen",
":=",
"math",
".",
"Abs",
"(",
"p1",
".",... |
9,676 | all-9677 | [
"RunWithRetry",
"will",
"take",
"a",
"function",
"that",
"makes",
"the",
"TChannel",
"call",
"and",
"will",
"rerun",
"it",
"as",
"specifed",
"in",
"the",
"RetryOptions",
"in",
"the",
"Context",
"."
] | [
"func",
"(",
"ch",
"*",
"Channel",
")",
"RunWithRetry",
"(",
"runCtx",
"context",
".",
"Context",
",",
"f",
"RetriableFunc",
")",
"error",
"{",
"var",
"err",
"error",
"\n\n",
"opts",
":=",
"getRetryOptions",
"(",
"runCtx",
")",
"\n",
"rs",
":=",
"ch",
... |
9,677 | all-9678 | [
"Augment",
"processes",
"source",
"files",
"to",
"improve",
"calls",
"to",
"be",
"more",
"descriptive",
".",
"It",
"modifies",
"goroutines",
"in",
"place",
".",
"It",
"requires",
"calling",
"ParseDump",
"()",
"with",
"guesspaths",
"set",
"to",
"true",
"to",
... | [
"func",
"Augment",
"(",
"goroutines",
"[",
"]",
"*",
"Goroutine",
")",
"{",
"c",
":=",
"&",
"cache",
"{",
"}",
"\n",
"for",
"_",
",",
"g",
":=",
"<mask>",
"goroutines",
"{",
"c",
".",
"augmentGoroutine",
"(",
"g",
")",
"\n",
"}",
"\n",
"}"
] |
9,678 | all-9679 | [
"GetUint64",
"implements",
"the",
"StableStore",
"interface",
"."
] | [
"func",
"(",
"i",
"*",
"InmemStore",
")",
"GetUint64",
"(",
"key",
"[",
"]",
"byte",
")",
"(",
"uint64",
",",
"error",
")",
"{",
"i",
".",
"l",
".",
"RLock",
"(",
")",
"\n",
"defer",
"i",
".",
"l",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"i... |
9,679 | all-9680 | [
"add",
"adds",
"a",
"new",
"service",
"to",
"list",
"of",
"services",
"."
] | [
"func",
"(",
"s",
"*",
"services",
")",
"<mask>",
"(",
"r",
"*",
"repoService",
")",
"{",
"s",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"Unlock",
"(",
")",
"\n\n",
"s",
".",
"services",
"=",
"append",
"(",
"s",
".",
"services",
",",
"r",... |
9,680 | all-9681 | [
"GetClient",
"on",
"linux",
"will",
"simply",
"return",
"the",
"cached",
"client",
"from",
"the",
"map"
] | [
"func",
"(",
"f",
"*",
"factory",
")",
"GetClient",
"(",
"<mask>",
"dockerclient",
".",
"DockerVersion",
")",
"(",
"sdkclient",
".",
"Client",
",",
"error",
")",
"{",
"return",
"f",
".",
"getClient",
"(",
"version",
")",
"\n",
"}"
] |
9,681 | all-9682 | [
"DrawLine",
"draws",
"a",
"line",
"segment",
"on",
"the",
"given",
"destination",
"dst",
".",
"DrawLine",
"is",
"intended",
"to",
"be",
"used",
"mainly",
"for",
"debugging",
"or",
"prototyping",
"purpose",
"."
] | [
"func",
"DrawLine",
"(",
"dst",
"*",
"ebiten",
".",
"<mask>",
",",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
"float64",
",",
"clr",
"color",
".",
"Color",
")",
"{",
"ew",
",",
"eh",
":=",
"emptyImage",
".",
"Size",
"(",
")",
"\n",
"length",
":=",
... |
9,682 | all-9683 | [
"GetMinLocationFailedOk",
"returns",
"a",
"tuple",
"with",
"the",
"MinLocationFailed",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"SyntheticsOptions",
")",
"GetMinLocationFailedOk",
"(",
")",
"(",
"int",
",",
"bool",
")",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"MinLocationFailed",
"==",
"nil",
"{",
"return",
"0",
",",
"<mask>",
"\n",
"}",
"\n",
"ret... |
9,683 | all-9684 | [
"DeleteResourcePolicyRequest",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockSecretsManagerAPI",
")",
"DeleteResourcePolicyRequest",
"(",
"arg0",
"*",
"secretsmanager",
".",
"DeleteResourcePolicyInput",
")",
"(",
"*",
"request",
".",
"Request",
",",
"*",
"secretsmanager",
".",
"DeleteResourcePolicyOutput",
")",
"{... |
9,684 | all-9685 | [
"HasCreatedAt",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"SyntheticsTest",
")",
"HasCreatedAt",
"(",
")",
"bool",
"{",
"if",
"s",
"!=",
"nil",
"&&",
"s",
".",
"CreatedAt",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
9,685 | all-9686 | [
"FirstByName",
"finds",
"the",
"first",
"element",
"with",
"the",
"provided",
"name",
"attribute",
"."
] | [
"func",
"(",
"s",
"*",
"selectable",
")",
"FirstByName",
"(",
"name",
"string",
")",
"*",
"Selection",
"{",
"return",
"newSelection",
"(",
"s",
".",
"<mask>",
",",
"s",
".",
"selectors",
".",
"Append",
"(",
"target",
".",
"Name",
",",
"name",
")",
".... |
9,686 | all-9687 | [
"HasType",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"m",
"*",
"Monitor",
")",
"HasType",
"(",
")",
"bool",
"{",
"if",
"m",
"!=",
"nil",
"&&",
"m",
".",
"Type",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
9,687 | all-9688 | [
"Run",
"is",
"a",
"wrapper",
"around",
"g_application_run",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Application",
")",
"Run",
"(",
"args",
"[",
"]",
"string",
")",
"int",
"{",
"cargs",
":=",
"C",
".",
"make_strings",
"(",
"C",
".",
"int",
"(",
"len",
"(",
"args",
")",
")",
")",
"\n",
"defer",
"C",
".",
"destroy_strings",... |
9,688 | all-9689 | [
"Do",
"executes",
"CSS",
".",
"getBackgroundColors",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"backgroundColors",
"-",
"The",
"range",
"of",
"background",
"colors",
"behind",
"this",
"element",
"if",
"it",
"contains",
"any",
"visible",
"text... | [
"func",
"(",
"p",
"*",
"GetBackgroundColorsParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"backgroundColors",
"[",
"]",
"string",
",",
"computedFontSize",
"string",
",",
"computedFontWeight",
"string",
",",
"err",
"error",
")",
"{",
"//... |
9,689 | all-9690 | [
"native",
"()",
"returns",
"a",
"pointer",
"to",
"the",
"underlying",
"GtkBuilder",
"."
] | [
"func",
"(",
"b",
"*",
"<mask>",
")",
"native",
"(",
")",
"*",
"C",
".",
"GtkBuilder",
"{",
"if",
"b",
"==",
"nil",
"||",
"b",
".",
"GObject",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"p",
":=",
"unsafe",
".",
"Pointer",
"(",
"b",
... |
9,690 | all-9691 | [
"copy",
"a",
"two",
"-",
"dimensional",
"texture",
"subimage"
] | [
"func",
"CopyTexSubImage2D",
"(",
"target",
"uint32",
",",
"level",
"int32",
",",
"xoffset",
"int32",
",",
"yoffset",
"int32",
",",
"x",
"int32",
",",
"y",
"int32",
",",
"<mask>",
"int32",
",",
"height",
"int32",
")",
"{",
"syscall",
".",
"Syscall9",
"("... |
9,691 | all-9692 | [
"Get",
"a",
"registered",
"ErrorHandler",
"for",
"this",
"status",
"code",
".",
"If",
"no",
"ErrorHandler",
"has",
"been",
"registered",
"a",
"default",
"one",
"will",
"be",
"returned",
"."
] | [
"func",
"(",
"e",
"ErrorHandlers",
")",
"Get",
"(",
"status",
"int",
")",
"ErrorHandler",
"{",
"if",
"eh",
",",
"ok",
":=",
"e",
"[",
"status",
"]",
";",
"ok",
"{",
"return",
"eh",
"\n",
"}",
"\n",
"if",
"eh",
",",
"ok",
":=",
"e",
"[",
"0",
... |
9,692 | all-9693 | [
"StrLenIn",
"param",
"is",
"a",
"string",
"length",
"is",
"in",
"array"
] | [
"func",
"(",
"c",
"*",
"Controller",
")",
"StrLenIn",
"(",
"fieldName",
"string",
",",
"p",
"interface",
"{",
"}",
",",
"l",
"...",
"int",
")",
"string",
"{",
"if",
"p",
"==",
"nil",
"{",
"p",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"v",
",",
"ok",
... |
9,693 | all-9694 | [
"StatusString",
"returns",
"a",
"human",
"readable",
"string",
"representation",
"of",
"this",
"object"
] | [
"func",
"(",
"as",
"ASMSecretStatus",
")",
"<mask>",
"(",
")",
"string",
"{",
"for",
"k",
",",
"v",
":=",
"range",
"asmSecretStatusMap",
"{",
"if",
"v",
"==",
"as",
"{",
"return",
"k",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
"\n",
"}"
] |
9,694 | all-9695 | [
"ProduceCovList",
"summarizes",
"profiles",
"and",
"returns",
"the",
"result"
] | [
"func",
"ProduceCovList",
"(",
"profiles",
"[",
"]",
"*",
"cover",
".",
"Profile",
")",
"*",
"CoverageList",
"{",
"covList",
":=",
"newCoverageList",
"(",
"\"",
"\"",
")",
"\n",
"for",
"_",
",",
"prof",
":=",
"range",
"profiles",
"{",
"covList",
".",
"... |
9,695 | all-9696 | [
"JSON",
"-"
] | [
"func",
"(",
"s",
"*",
"FakeRenderer",
")",
"JSON",
"(",
"status",
"int",
",",
"v",
"<mask>",
"{",
"}",
")",
"{",
"s",
".",
"SpyStatus",
"=",
"status",
"\n",
"s",
".",
"SpyValue",
"=",
"v",
"\n",
"}"
] |
9,696 | all-9697 | [
"RestoreSecret",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockSecretsManagerAPI",
")",
"RestoreSecret",
"(",
"arg0",
"*",
"secretsmanager",
".",
"RestoreSecretInput",
")",
"(",
"*",
"secretsmanager",
".",
"RestoreSecretOutput",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Cal... |
9,697 | all-9698 | [
"Set",
"is",
"required",
"for",
"kingpin",
"interfaces",
"to",
"allow",
"command",
"line",
"params",
"to",
"be",
"set",
"to",
"our",
"map",
"datatype"
] | [
"func",
"(",
"o",
"*",
"MapUint8Option",
")",
"Set",
"(",
"value",
"string",
")",
"error",
"{",
"parts",
":=",
"stringMapRegex",
".",
"Split",
"(",
"value",
",",
"2",
")",
"\n",
"if",
"len",
"(",
"parts",
")",
"!=",
"2",
"{",
"return",
"fmt",
".",
... |
9,698 | all-9699 | [
"ParseConfig",
"loads",
"config",
"from",
"config",
"file",
"schemas",
".",
"conf",
"aggregation",
".",
"conf"
] | [
"func",
"(",
"app",
"*",
"App",
")",
"ParseConfig",
"(",
")",
"<mask>",
"{",
"app",
".",
"Lock",
"(",
")",
"\n",
"defer",
"app",
".",
"Unlock",
"(",
")",
"\n\n",
"err",
":=",
"app",
".",
"configure",
"(",
")",
"\n\n",
"if",
"app",
".",
"PromRegis... |
9,699 | all-9700 | [
"EndOfMonth",
"end",
"of",
"month"
] | [
"func",
"(",
"now",
"*",
"Now",
")",
"EndOfMonth",
"(",
")",
"<mask>",
".",
"Time",
"{",
"return",
"now",
".",
"BeginningOfMonth",
"(",
")",
".",
"AddDate",
"(",
"0",
",",
"1",
",",
"0",
")",
".",
"Add",
"(",
"-",
"time",
".",
"Nanosecond",
")",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.