id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
listlengths 1
418
| pl_tokens
listlengths 22
4.98k
|
---|---|---|---|
14,700 | all-14701 | [
"Load",
"loads",
"YAML",
"files",
"from",
"configPaths",
".",
"and",
"assigns",
"decoded",
"values",
"into",
"the",
"conf",
"value",
"."
] | [
"func",
"Load",
"(",
"conf",
"<mask>",
"{",
"}",
",",
"configPaths",
"...",
"string",
")",
"error",
"{",
"return",
"loadWithFunc",
"(",
"conf",
",",
"configPaths",
",",
"nil",
",",
"yaml",
".",
"Unmarshal",
")",
"\n",
"}"
] |
14,701 | all-14702 | [
"AddRawResource",
"helper",
"to",
"add",
"a",
"resource",
"to",
"the",
"pipeline",
"manifest"
] | [
"func",
"(",
"s",
"*",
"ConcoursePipeline",
")",
"AddRawResource",
"(",
"rawResource",
"atc",
".",
"ResourceConfig",
")",
"{",
"s",
".",
"Resources",
"=",
"<mask>",
"(",
"s",
".",
"Resources",
",",
"rawResource",
")",
"\n",
"}"
] |
14,702 | all-14703 | [
"Retrieve",
"the",
"PPS",
"master",
"token",
"or",
"generate",
"it",
"and",
"put",
"it",
"in",
"etcd",
".",
"TODO",
"This",
"is",
"a",
"hack",
".",
"It",
"avoids",
"the",
"need",
"to",
"return",
"superuser",
"tokens",
"from",
"GetAuthToken",
"(",
"essentially",
"PPS",
"and",
"Auth",
"communicate",
"through",
"etcd",
"instead",
"of",
"an",
"API",
")",
"but",
"we",
"should",
"define",
"an",
"internal",
"API",
"and",
"use",
"that",
"instead",
"."
] | [
"func",
"(",
"a",
"*",
"apiServer",
")",
"retrieveOrGeneratePPSToken",
"(",
")",
"{",
"var",
"tokenProto",
"types",
".",
"StringValue",
"// will contain PPS token",
"\n",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"2",
"*",
"time",
".",
"Minute",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n",
"b",
":=",
"backoff",
".",
"NewExponentialBackOff",
"(",
")",
"\n",
"b",
".",
"MaxElapsedTime",
"=",
"60",
"*",
"time",
".",
"Second",
"\n",
"b",
".",
"MaxInterval",
"=",
"5",
"*",
"time",
".",
"Second",
"\n",
"if",
"err",
":=",
"backoff",
".",
"Retry",
"(",
"func",
"(",
")",
"error",
"{",
"if",
"_",
",",
"err",
":=",
"col",
".",
"NewSTM",
"(",
"ctx",
",",
"a",
".",
"env",
".",
"GetEtcdClient",
"(",
")",
",",
"func",
"(",
"stm",
"col",
".",
"STM",
")",
"error",
"{",
"superUserTokenCol",
":=",
"<mask>",
".",
"NewCollection",
"(",
"a",
".",
"env",
".",
"GetEtcdClient",
"(",
")",
",",
"ppsconsts",
".",
"PPSTokenKey",
",",
"nil",
",",
"&",
"types",
".",
"StringValue",
"{",
"}",
",",
"nil",
",",
"nil",
")",
".",
"ReadWrite",
"(",
"stm",
")",
"\n",
"// TODO(msteffen): Don't use an empty key, as it will not be erased by",
"// superUserTokenCol.DeleteAll()",
"err",
":=",
"superUserTokenCol",
".",
"Get",
"(",
"\"",
"\"",
",",
"&",
"tokenProto",
")",
"\n",
"if",
"err",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"col",
".",
"IsErrNotFound",
"(",
"err",
")",
"{",
"// no existing token yet -- generate token",
"token",
":=",
"uuid",
".",
"NewWithoutDashes",
"(",
")",
"\n",
"tokenProto",
".",
"Value",
"=",
"token",
"\n",
"if",
"err",
":=",
"superUserTokenCol",
".",
"Create",
"(",
"\"",
"\"",
",",
"&",
"tokenProto",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"a",
".",
"ppsToken",
"=",
"tokenProto",
".",
"Value",
"\n",
"return",
"nil",
"\n",
"}",
",",
"b",
")",
";",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"err",
")",
")",
"\n",
"}",
"\n",
"}"
] |
14,703 | all-14704 | [
"MutateTransaction",
"for",
"AllowTrustBuilder",
"causes",
"the",
"underylying",
"AllowTrustOp",
"to",
"be",
"added",
"to",
"the",
"operation",
"list",
"for",
"the",
"provided",
"transaction"
] | [
"func",
"(",
"m",
"AllowTrustBuilder",
")",
"MutateTransaction",
"(",
"o",
"*",
"TransactionBuilder",
")",
"error",
"{",
"if",
"m",
".",
"Err",
"!=",
"nil",
"{",
"return",
"m",
".",
"Err",
"\n",
"}",
"\n\n",
"m",
".",
"O",
".",
"Body",
",",
"m",
".",
"Err",
"=",
"xdr",
".",
"NewOperationBody",
"(",
"xdr",
".",
"OperationTypeAllowTrust",
",",
"m",
".",
"AT",
")",
"\n",
"o",
".",
"TX",
".",
"Operations",
"=",
"<mask>",
"(",
"o",
".",
"TX",
".",
"Operations",
",",
"m",
".",
"O",
")",
"\n",
"return",
"m",
".",
"Err",
"\n",
"}"
] |
14,704 | all-14705 | [
"validRoleType",
"returns",
"false",
"if",
"the",
"RoleType",
"in",
"the",
"acs",
"refresh",
"payload",
"is",
"not",
"one",
"of",
"the",
"expected",
"types",
".",
"TaskApplication",
"TaskExecution"
] | [
"func",
"validRoleType",
"(",
"roleType",
"string",
")",
"bool",
"{",
"switch",
"roleType",
"{",
"case",
"credentials",
".",
"ApplicationRoleType",
":",
"return",
"<mask>",
"\n",
"case",
"credentials",
".",
"ExecutionRoleType",
":",
"return",
"true",
"\n",
"default",
":",
"return",
"false",
"\n",
"}",
"\n",
"}"
] |
14,705 | all-14706 | [
"HasTimeAggregator",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"ThresholdCount",
")",
"HasTimeAggregator",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"TimeAggregator",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
14,706 | all-14707 | [
"Change",
"the",
"file",
"mode",
"of",
"the",
"given",
"unix",
"socket",
"file"
] | [
"func",
"socketUnixSetPermissions",
"(",
"path",
"string",
",",
"mode",
"<mask>",
".",
"FileMode",
")",
"error",
"{",
"err",
":=",
"os",
".",
"Chmod",
"(",
"path",
",",
"mode",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,707 | all-14708 | [
"Trim",
"off",
"leading",
"apostropes",
".",
"(",
"Slight",
"variation",
"from",
"NLTK",
"implementation",
"here",
"in",
"which",
"only",
"the",
"first",
"is",
"removed",
".",
")"
] | [
"func",
"trimLeftApostrophes",
"(",
"word",
"*",
"snowballword",
".",
"SnowballWord",
")",
"{",
"var",
"(",
"numApostrophes",
"int",
"\n",
"r",
"rune",
"\n",
")",
"\n\n",
"for",
"numApostrophes",
",",
"r",
"=",
"<mask>",
"word",
".",
"RS",
"{",
"// Check for \"'\", which is unicode code point 39",
"if",
"r",
"!=",
"39",
"{",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"numApostrophes",
">",
"0",
"{",
"word",
".",
"RS",
"=",
"word",
".",
"RS",
"[",
"numApostrophes",
":",
"]",
"\n",
"word",
".",
"R1start",
"=",
"word",
".",
"R1start",
"-",
"numApostrophes",
"\n",
"word",
".",
"R2start",
"=",
"word",
".",
"R2start",
"-",
"numApostrophes",
"\n",
"}",
"\n",
"}"
] |
14,708 | all-14709 | [
"RegisterActionCommands",
"implements",
"APICommandRegistrar",
"."
] | [
"func",
"(",
"r",
"*",
"Registrar",
")",
"RegisterActionCommands",
"(",
"apiName",
"string",
",",
"res",
"map",
"[",
"string",
"]",
"*",
"metadata",
".",
"Resource",
",",
"cmds",
"ActionCommands",
")",
"{",
"// Add special \"actions\" action",
"_",
",",
"ok",
":=",
"cmds",
"[",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"r",
".",
"APICmd",
".",
"FullCommand",
"(",
")",
",",
"\"",
"\"",
")",
"]",
"\n",
"if",
"!",
"ok",
"{",
"pattern",
":=",
"\"",
"\"",
"\n",
"description",
":=",
"fmt",
".",
"Sprintf",
"(",
"pattern",
",",
"apiName",
")",
"\n",
"actionsCmd",
":=",
"r",
".",
"APICmd",
".",
"Command",
"(",
"\"",
"\"",
",",
"description",
")",
"\n",
"actionsCmdValue",
":=",
"ActionCommand",
"{",
"}",
"\n",
"hrefMsg",
":=",
"\"",
"\"",
"\n",
"actionsCmd",
".",
"Arg",
"(",
"\"",
"\"",
",",
"hrefMsg",
")",
".",
"StringVar",
"(",
"&",
"actionsCmdValue",
".",
"Href",
")",
"\n",
"cmds",
"[",
"actionsCmd",
".",
"FullCommand",
"(",
")",
"]",
"=",
"&",
"actionsCmdValue",
"\n",
"}",
"\n\n",
"// Add resource actions",
"var",
"actionNames",
"[",
"]",
"string",
"\n",
"for",
"_",
",",
"r",
":=",
"range",
"res",
"{",
"for",
"_",
",",
"a",
":=",
"range",
"r",
".",
"Actions",
"{",
"name",
":=",
"a",
".",
"Name",
"\n",
"exists",
":=",
"false",
"\n",
"for",
"_",
",",
"e",
":=",
"range",
"actionNames",
"{",
"if",
"e",
"==",
"name",
"{",
"exists",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"exists",
"{",
"actionNames",
"=",
"append",
"(",
"actionNames",
",",
"name",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"sort",
".",
"Strings",
"(",
"actionNames",
")",
"\n",
"for",
"_",
",",
"action",
":=",
"range",
"actionNames",
"{",
"if",
"_",
",",
"ok",
":=",
"cmds",
"[",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"r",
".",
"APICmd",
".",
"FullCommand",
"(",
")",
",",
"action",
")",
"]",
";",
"<mask>",
"{",
"continue",
"// Already registered - can happen with SS where multiple APIs are registered under the same command",
"\n",
"}",
"\n",
"resources",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"var",
"description",
"string",
"\n",
"for",
"name",
",",
"resource",
":=",
"range",
"res",
"{",
"for",
"_",
",",
"a",
":=",
"range",
"resource",
".",
"Actions",
"{",
"if",
"a",
".",
"Name",
"==",
"action",
"{",
"if",
"description",
"==",
"\"",
"\"",
"{",
"description",
"=",
"a",
".",
"Description",
"\n",
"}",
"\n",
"resources",
"=",
"append",
"(",
"resources",
",",
"name",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"len",
"(",
"resources",
")",
">",
"1",
"||",
"description",
"==",
"\"",
"\"",
"{",
"switch",
"action",
"{",
"case",
"\"",
"\"",
":",
"description",
"=",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
":",
"description",
"=",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
":",
"description",
"=",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
":",
"description",
"=",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
":",
"description",
"=",
"\"",
"\"",
"\n",
"default",
":",
"if",
"len",
"(",
"resources",
")",
">",
"1",
"{",
"description",
"=",
"\"",
"\"",
"+",
"strings",
".",
"Join",
"(",
"resources",
"[",
":",
"len",
"(",
"resources",
")",
"-",
"1",
"]",
",",
"\"",
"\"",
")",
"+",
"\"",
"\"",
"+",
"resources",
"[",
"len",
"(",
"resources",
")",
"-",
"1",
"]",
"\n",
"}",
"else",
"{",
"description",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"}",
"\n\n",
"}",
"\n",
"actionCmd",
":=",
"r",
".",
"APICmd",
".",
"Command",
"(",
"action",
",",
"description",
")",
"\n",
"actionCmdValue",
":=",
"ActionCommand",
"{",
"}",
"\n",
"hrefMsg",
":=",
"\"",
"\"",
"\n",
"paramsMsg",
":=",
"\"",
"\"",
"\n",
"actionCmd",
".",
"Arg",
"(",
"\"",
"\"",
",",
"hrefMsg",
")",
".",
"Required",
"(",
")",
".",
"StringVar",
"(",
"&",
"actionCmdValue",
".",
"Href",
")",
"\n",
"actionCmd",
".",
"Arg",
"(",
"\"",
"\"",
",",
"paramsMsg",
")",
".",
"StringsVar",
"(",
"&",
"actionCmdValue",
".",
"Params",
")",
"\n",
"cmds",
"[",
"actionCmd",
".",
"FullCommand",
"(",
")",
"]",
"=",
"&",
"actionCmdValue",
"\n",
"}",
"\n",
"}"
] |
14,709 | all-14710 | [
"memberUpdateCommandFunc",
"executes",
"the",
"member",
"update",
"command",
"."
] | [
"func",
"memberUpdateCommandFunc",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
",",
"args",
"[",
"]",
"string",
")",
"{",
"if",
"len",
"(",
"args",
")",
"!=",
"1",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"id",
",",
"err",
":=",
"strconv",
".",
"ParseUint",
"(",
"args",
"[",
"0",
"]",
",",
"16",
",",
"64",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
")",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"memberPeerURLs",
")",
"==",
"0",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"urls",
":=",
"strings",
".",
"Split",
"(",
"memberPeerURLs",
",",
"\"",
"\"",
")",
"\n\n",
"ctx",
",",
"cancel",
":=",
"commandCtx",
"(",
"cmd",
")",
"\n",
"resp",
",",
"err",
":=",
"mustClientFromCmd",
"(",
"cmd",
")",
".",
"MemberUpdate",
"(",
"ctx",
",",
"id",
",",
"urls",
")",
"\n",
"cancel",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitError",
",",
"err",
")",
"\n",
"}",
"\n\n",
"<mask>",
".",
"MemberUpdate",
"(",
"id",
",",
"*",
"resp",
")",
"\n",
"}"
] |
14,710 | all-14711 | [
"ContainerStop",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockClient",
")",
"ContainerStop",
"(",
"arg0",
"context",
".",
"<mask>",
",",
"arg1",
"string",
",",
"arg2",
"*",
"time",
".",
"Duration",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
",",
"arg2",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] |
14,711 | all-14712 | [
"NewTokenizer",
"creates",
"a",
"new",
"tokenizer",
"from",
"an",
"input",
"stream",
"."
] | [
"func",
"NewTokenizer",
"(",
"r",
"io",
".",
"Reader",
")",
"*",
"Tokenizer",
"{",
"input",
":=",
"bufio",
".",
"NewReader",
"(",
"r",
")",
"\n",
"classifier",
":=",
"newDefaultClassifier",
"(",
")",
"\n",
"return",
"&",
"Tokenizer",
"{",
"input",
":",
"*",
"<mask>",
",",
"classifier",
":",
"classifier",
"}",
"\n",
"}"
] |
14,712 | all-14713 | [
"MarshalJSONIndent",
"calls",
"json",
".",
"Indent",
"on",
"the",
"output",
"of",
"cdc",
".",
"MarshalJSON",
"using",
"the",
"given",
"prefix",
"and",
"indent",
"string",
"."
] | [
"func",
"(",
"cdc",
"*",
"Codec",
")",
"MarshalJSONIndent",
"(",
"o",
"interface",
"{",
"}",
",",
"prefix",
",",
"indent",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"bz",
",",
"err",
":=",
"cdc",
".",
"MarshalJSON",
"(",
"o",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"var",
"out",
"bytes",
".",
"Buffer",
"\n",
"err",
"=",
"json",
".",
"Indent",
"(",
"&",
"<mask>",
",",
"bz",
",",
"prefix",
",",
"indent",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"out",
".",
"Bytes",
"(",
")",
",",
"nil",
"\n",
"}"
] |
14,713 | all-14714 | [
"DqliteLog",
"redirects",
"dqlite",
"s",
"logs",
"to",
"our",
"own",
"logger"
] | [
"func",
"DqliteLog",
"(",
"l",
"dqlite",
".",
"LogLevel",
",",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"format",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"format",
")",
"\n",
"switch",
"l",
"{",
"case",
"dqlite",
".",
"LogDebug",
":",
"logger",
".",
"Debugf",
"(",
"format",
",",
"a",
"...",
")",
"\n",
"case",
"dqlite",
".",
"LogInfo",
":",
"logger",
".",
"Debugf",
"(",
"format",
",",
"a",
"...",
")",
"\n",
"case",
"dqlite",
".",
"LogWarn",
":",
"logger",
".",
"Warnf",
"(",
"<mask>",
",",
"a",
"...",
")",
"\n",
"case",
"dqlite",
".",
"LogError",
":",
"logger",
".",
"Errorf",
"(",
"format",
",",
"a",
"...",
")",
"\n",
"}",
"\n",
"}"
] |
14,714 | all-14715 | [
"RotateRight",
"rotates",
"the",
"player",
"p",
"in",
"the",
"right",
"direction",
"."
] | [
"func",
"(",
"p",
"*",
"<mask>",
")",
"RotateRight",
"(",
")",
"{",
"p",
".",
"angle",
"++",
"\n",
"if",
"maxAngle",
"<=",
"p",
".",
"angle",
"{",
"p",
".",
"angle",
"-=",
"maxAngle",
"\n",
"}",
"\n",
"p",
".",
"lean",
"++",
"\n",
"if",
"maxLean",
"<",
"p",
".",
"lean",
"{",
"p",
".",
"lean",
"=",
"maxLean",
"\n",
"}",
"\n",
"}"
] |
14,715 | all-14716 | [
"HttpRequest",
"sends",
"an",
"HTTP",
"request",
"to",
"the",
"Pilosa",
"server",
".",
"**",
"NOTE",
"**",
":",
"This",
"function",
"is",
"experimental",
"and",
"may",
"be",
"removed",
"in",
"later",
"revisions",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"HttpRequest",
"(",
"method",
"string",
",",
"path",
"string",
",",
"<mask>",
"[",
"]",
"byte",
",",
"headers",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"*",
"http",
".",
"Response",
",",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"span",
":=",
"c",
".",
"tracer",
".",
"StartSpan",
"(",
"\"",
"\"",
")",
"\n",
"defer",
"span",
".",
"Finish",
"(",
")",
"\n\n",
"return",
"c",
".",
"httpRequest",
"(",
"method",
",",
"path",
",",
"data",
",",
"headers",
",",
"false",
")",
"\n",
"}"
] |
14,716 | all-14717 | [
"PublishNamedEventContext",
"publish",
"named",
"event",
"for",
"given",
"ctx",
".",
"The",
"name",
"infered",
"from",
"eventBody",
"interface",
"name",
"."
] | [
"func",
"PublishNamedEventContext",
"(",
"ctx",
"context",
".",
"Context",
",",
"eventBody",
"interface",
"{",
"}",
")",
"{",
"name",
":=",
"reflect",
".",
"TypeOf",
"(",
"eventBody",
")",
".",
"<mask>",
"(",
")",
"\n",
"PublishEventContext",
"(",
"ctx",
",",
"name",
",",
"eventBody",
")",
"\n",
"}"
] |
14,717 | all-14718 | [
"Establishes",
"a",
"panic",
"handler",
"that",
"will",
"execute",
"the",
"specified",
"Tracer",
"in",
"response",
".",
"If",
"repanic",
"is",
"true",
"this",
"will",
"repanic",
"again",
"after",
"Tracer",
"execution",
"completes",
"(",
"with",
"the",
"original",
"value",
"returned",
"by",
"recover",
"()",
")",
".",
"This",
"must",
"be",
"used",
"with",
"Go",
"s",
"defer",
"panic",
"and",
"recover",
"pattern",
";",
"see",
"https",
":",
"//",
"blog",
".",
"golang",
".",
"org",
"/",
"defer",
"-",
"panic",
"-",
"and",
"-",
"recover",
"."
] | [
"func",
"Recover",
"(",
"t",
"Tracer",
",",
"repanic",
"bool",
",",
"options",
"*",
"TraceOptions",
")",
"{",
"if",
"r",
":=",
"recover",
"(",
")",
";",
"r",
"!=",
"nil",
"{",
"err",
",",
"ok",
":=",
"r",
".",
"(",
"error",
")",
"\n",
"if",
"!",
"ok",
"{",
"// We use the runtime type of the error object for",
"// classification (and thus potential grouping);",
"// *bcd.PanicError is a more descriptive classifier",
"// than something like *errors.errorString.",
"err",
"=",
"&",
"panicError",
"{",
"r",
"}",
"\n",
"}",
"\n\n",
"Trace",
"(",
"t",
",",
"err",
",",
"<mask>",
")",
"\n\n",
"if",
"repanic",
"{",
"panic",
"(",
"r",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
14,718 | all-14719 | [
"ReadInt32",
"reads",
"and",
"returns",
"an",
"int32",
"."
] | [
"func",
"(",
"r",
"*",
"Reader",
")",
"ReadInt32",
"(",
")",
"int32",
"{",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"0",
"\n",
"}",
"\n",
"var",
"n",
"int",
"\n",
"n",
",",
"r",
".",
"err",
"=",
"io",
".",
"ReadFull",
"(",
"r",
".",
"rd",
",",
"r",
".",
"b",
"[",
":",
"4",
"]",
")",
"\n",
"r",
".",
"cnt",
"+=",
"n",
"\n",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"0",
"\n",
"}",
"\n",
"return",
"int32",
"(",
"<mask>",
".",
"LittleEndian",
".",
"Uint32",
"(",
"r",
".",
"b",
"[",
":",
"4",
"]",
")",
")",
"\n",
"}"
] |
14,719 | all-14720 | [
"ListActionDescriptions",
"is",
"a",
"wrapper",
"around",
"gtk_application_list_action_descriptions",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Application",
")",
"ListActionDescriptions",
"(",
")",
"[",
"]",
"string",
"{",
"var",
"descs",
"[",
"]",
"string",
"\n",
"c",
":=",
"C",
".",
"gtk_application_list_action_descriptions",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"originalc",
":=",
"c",
"\n",
"defer",
"C",
".",
"g_strfreev",
"(",
"originalc",
")",
"\n\n",
"for",
"*",
"c",
"!=",
"nil",
"{",
"descs",
"=",
"<mask>",
"(",
"descs",
",",
"C",
".",
"GoString",
"(",
"(",
"*",
"C",
".",
"char",
")",
"(",
"*",
"c",
")",
")",
")",
"\n",
"c",
"=",
"C",
".",
"next_gcharptr",
"(",
"c",
")",
"\n",
"}",
"\n\n",
"return",
"descs",
"\n",
"}"
] |
14,720 | all-14721 | [
"parseCommaDelimitedList",
"parses",
"values",
"in",
"the",
"format",
":",
"org",
"/",
"repo",
"org2",
"/",
"repo2",
"org",
"/",
"repo3",
"into",
"a",
"mapping",
"of",
"org",
"to",
"repos",
"i",
".",
"e",
".",
":",
"org",
":",
"repo",
"repo3",
"org2",
":",
"repo2"
] | [
"func",
"parseCommaDelimitedList",
"(",
"list",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
",",
"error",
")",
"{",
"mapping",
":=",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"_",
",",
"r",
":=",
"range",
"strings",
".",
"Split",
"(",
"list",
",",
"\"",
"\"",
")",
"{",
"value",
":=",
"strings",
".",
"TrimSpace",
"(",
"r",
")",
"\n",
"if",
"strings",
".",
"Count",
"(",
"<mask>",
",",
"\"",
"\"",
")",
"!=",
"1",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"value",
")",
"\n",
"}",
"\n",
"parts",
":=",
"strings",
".",
"SplitN",
"(",
"value",
",",
"\"",
"\"",
",",
"2",
")",
"\n",
"if",
"others",
",",
"exist",
":=",
"mapping",
"[",
"parts",
"[",
"0",
"]",
"]",
";",
"!",
"exist",
"{",
"mapping",
"[",
"parts",
"[",
"0",
"]",
"]",
"=",
"[",
"]",
"string",
"{",
"parts",
"[",
"1",
"]",
"}",
"\n",
"}",
"else",
"{",
"mapping",
"[",
"parts",
"[",
"0",
"]",
"]",
"=",
"append",
"(",
"others",
",",
"parts",
"[",
"1",
"]",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"mapping",
",",
"nil",
"\n",
"}"
] |
14,721 | all-14722 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"FailRequestParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch7",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
14,722 | all-14723 | [
"int",
"pango_layout_get_indent",
"(",
"PangoLayout",
"*",
"layout",
")",
";"
] | [
"func",
"(",
"v",
"*",
"Layout",
")",
"GetIndent",
"(",
")",
"int",
"{",
"c",
":=",
"C",
".",
"pango_layout_get_indent",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"int",
"(",
"c",
")",
"\n",
"}"
] |
14,723 | all-14724 | [
"DynamicType",
"returns",
"the",
"concrete",
"type",
"stored",
"in",
"the",
"interface",
"type",
"t",
"at",
"address",
"a",
".",
"If",
"the",
"interface",
"is",
"nil",
"returns",
"nil",
"."
] | [
"func",
"(",
"p",
"*",
"Process",
")",
"DynamicType",
"(",
"t",
"*",
"Type",
",",
"a",
"core",
".",
"Address",
")",
"*",
"Type",
"{",
"<mask>",
"t",
".",
"Kind",
"{",
"default",
":",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"case",
"KindEface",
":",
"x",
":=",
"p",
".",
"proc",
".",
"ReadPtr",
"(",
"a",
")",
"\n",
"if",
"x",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"p",
".",
"runtimeType2Type",
"(",
"x",
")",
"\n",
"case",
"KindIface",
":",
"x",
":=",
"p",
".",
"proc",
".",
"ReadPtr",
"(",
"a",
")",
"\n",
"if",
"x",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"// Read type out of itab.",
"x",
"=",
"p",
".",
"proc",
".",
"ReadPtr",
"(",
"x",
".",
"Add",
"(",
"p",
".",
"proc",
".",
"PtrSize",
"(",
")",
")",
")",
"\n",
"return",
"p",
".",
"runtimeType2Type",
"(",
"x",
")",
"\n",
"}",
"\n",
"}"
] |
14,724 | all-14725 | [
"Diff",
"gets",
"the",
"difference",
"between",
"the",
"the",
"target",
"host",
"and",
"the",
"argument",
"host",
".",
"The",
"first",
"returned",
"value",
"is",
"the",
"added",
"ports",
"and",
"the",
"second",
"returned",
"value",
"is",
"the",
"removed",
"ports",
"."
] | [
"func",
"(",
"h",
"Host",
")",
"Diff",
"(",
"altHost",
"Host",
")",
"(",
"<mask>",
"[",
"]",
"Port",
",",
"removed",
"[",
"]",
"Port",
")",
"{",
"targetPorts",
":=",
"h",
".",
"Ports",
"\n",
"altPorts",
":=",
"altHost",
".",
"Ports",
"\n\n",
"addedWithClosed",
":=",
"array",
".",
"Except",
"(",
"altPorts",
",",
"targetPorts",
")",
".",
"(",
"[",
"]",
"Port",
")",
"\n",
"for",
"_",
",",
"add",
":=",
"range",
"addedWithClosed",
"{",
"if",
"add",
".",
"State",
"!=",
"\"",
"\"",
"{",
"added",
"=",
"append",
"(",
"added",
",",
"add",
")",
"\n",
"}",
"\n",
"}",
"\n",
"removedWithClosed",
":=",
"array",
".",
"Except",
"(",
"targetPorts",
",",
"altPorts",
")",
".",
"(",
"[",
"]",
"Port",
")",
"\n",
"for",
"_",
",",
"remove",
":=",
"range",
"removedWithClosed",
"{",
"if",
"remove",
".",
"State",
"!=",
"\"",
"\"",
"{",
"removed",
"=",
"append",
"(",
"removed",
",",
"remove",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
] |
14,725 | all-14726 | [
"findRepo",
"will",
"attempt",
"to",
"find",
"a",
"repo",
"in",
"logical",
"locations",
"under",
"path",
".",
"It",
"will",
"first",
"try",
"to",
"find",
"foo",
"/",
"bar",
"somewhere",
"under",
"$PWD",
"or",
"a",
"$PWD",
"dir",
".",
"AKA",
"if",
"$PWD",
"is",
"/",
"go",
"/",
"src",
"it",
"will",
"match",
"/",
"go",
"/",
"src",
"/",
"foo",
"/",
"bar",
"/",
"go",
"/",
"foo",
"/",
"bar",
"or",
"/",
"foo",
"/",
"bar",
"Next",
"it",
"will",
"look",
"for",
"the",
"basename",
"somewhere",
"under",
"$PWD",
"or",
"a",
"$PWD",
"dir",
".",
"AKA",
"if",
"$PWD",
"is",
"/",
"go",
"/",
"src",
"it",
"will",
"match",
"/",
"go",
"/",
"src",
"/",
"bar",
"/",
"go",
"/",
"bar",
"or",
"/",
"bar",
"If",
"both",
"of",
"these",
"strategies",
"fail",
"it",
"will",
"return",
"an",
"error",
"."
] | [
"func",
"findRepo",
"(",
"wd",
",",
"path",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"opwd",
",",
"err",
":=",
"realPath",
"(",
"wd",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"path",
",",
"\"",
"\"",
")",
"{",
"path",
"=",
"strings",
".",
"Replace",
"(",
"path",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"1",
")",
"\n",
"}",
"\n\n",
"var",
"old",
"string",
"\n",
"pwd",
":=",
"opwd",
"\n",
"for",
"old",
"!=",
"pwd",
"{",
"old",
"=",
"pwd",
"\n",
"if",
"strings",
".",
"HasSuffix",
"(",
"pwd",
",",
"\"",
"\"",
"+",
"path",
")",
"{",
"return",
"pwd",
",",
"nil",
"\n",
"}",
"\n",
"pwd",
"=",
"filepath",
".",
"Dir",
"(",
"pwd",
")",
"\n",
"}",
"\n",
"pwd",
"=",
"opwd",
"\n",
"for",
"old",
"!=",
"pwd",
"{",
"old",
"=",
"pwd",
"\n",
"check",
":=",
"filepath",
".",
"Join",
"(",
"pwd",
",",
"path",
")",
"\n",
"if",
"info",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"check",
")",
";",
"err",
"==",
"nil",
"&&",
"info",
".",
"IsDir",
"(",
")",
"{",
"return",
"check",
",",
"nil",
"\n",
"}",
"\n",
"pwd",
"=",
"filepath",
".",
"Dir",
"(",
"pwd",
")",
"\n",
"}",
"\n\n",
"base",
":=",
"filepath",
".",
"Base",
"(",
"path",
")",
"\n",
"pwd",
"=",
"opwd",
"\n",
"for",
"old",
"!=",
"pwd",
"{",
"old",
"=",
"pwd",
"\n",
"<mask>",
":=",
"filepath",
".",
"Join",
"(",
"pwd",
",",
"base",
")",
"\n",
"if",
"info",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"check",
")",
";",
"err",
"==",
"nil",
"&&",
"info",
".",
"IsDir",
"(",
")",
"{",
"return",
"check",
",",
"nil",
"\n",
"}",
"\n",
"pwd",
"=",
"filepath",
".",
"Dir",
"(",
"pwd",
")",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}"
] |
14,726 | all-14727 | [
"Check",
"that",
"there",
"is",
"no",
"left",
"-",
"over",
"cluster",
"certificate",
"in",
"the",
"LXD",
"var",
"dir",
"of",
"this",
"node",
"."
] | [
"func",
"membershipCheckNoLeftoverClusterCert",
"(",
"dir",
"string",
")",
"error",
"{",
"// Sanity check that there's no leftover cluster certificate",
"for",
"_",
",",
"basename",
":=",
"<mask>",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
"}",
"{",
"if",
"shared",
".",
"PathExists",
"(",
"filepath",
".",
"Join",
"(",
"dir",
",",
"basename",
")",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,727 | all-14728 | [
"UpdateSecretVersionStageWithContext",
"indicates",
"an",
"expected",
"call",
"of",
"UpdateSecretVersionStageWithContext"
] | [
"func",
"(",
"mr",
"*",
"MockSecretsManagerAPIMockRecorder",
")",
"UpdateSecretVersionStageWithContext",
"(",
"arg0",
",",
"arg1",
"interface",
"{",
"}",
",",
"arg2",
"...",
"<mask>",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"varargs",
":=",
"append",
"(",
"[",
"]",
"interface",
"{",
"}",
"{",
"arg0",
",",
"arg1",
"}",
",",
"arg2",
"...",
")",
"\n",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockSecretsManagerAPI",
")",
"(",
"nil",
")",
".",
"UpdateSecretVersionStageWithContext",
")",
",",
"varargs",
"...",
")",
"\n",
"}"
] |
14,728 | all-14729 | [
"SetMargin",
"is",
"a",
"wrapper",
"around",
"gtk_icon_view_set_margin",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"IconView",
")",
"SetMargin",
"(",
"margin",
"int",
")",
"{",
"C",
".",
"gtk_icon_view_set_margin",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
14,729 | all-14730 | [
"DatabaseNames",
"returns",
"the",
"names",
"of",
"non",
"-",
"empty",
"databases",
"present",
"in",
"the",
"cluster",
"."
] | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"DatabaseNames",
"(",
")",
"(",
"names",
"[",
"]",
"string",
",",
"err",
"error",
")",
"{",
"var",
"result",
"dbNames",
"\n",
"err",
"=",
"s",
".",
"Run",
"(",
"\"",
"\"",
",",
"&",
"result",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"for",
"_",
",",
"db",
":=",
"range",
"result",
".",
"Databases",
"{",
"if",
"!",
"db",
".",
"Empty",
"{",
"names",
"=",
"append",
"(",
"names",
",",
"db",
".",
"Name",
")",
"\n",
"}",
"\n",
"}",
"\n",
"sort",
".",
"Strings",
"(",
"names",
")",
"\n",
"return",
"names",
",",
"nil",
"\n",
"}"
] |
14,730 | all-14731 | [
"NewConfiguration",
"creates",
"a",
"configuration",
"for",
"server"
] | [
"func",
"NewConfiguration",
"(",
"provider",
"SecretProvider",
",",
"audience",
"[",
"]",
"string",
",",
"issuer",
"string",
",",
"method",
"jose",
".",
"SignatureAlgorithm",
")",
"Configuration",
"{",
"return",
"Configuration",
"{",
"secretProvider",
":",
"provider",
",",
"expectedClaims",
":",
"jwt",
".",
"Expected",
"{",
"Issuer",
":",
"issuer",
",",
"Audience",
":",
"audience",
"}",
",",
"signIn",
":",
"<mask>",
",",
"}",
"\n",
"}"
] |
14,731 | all-14732 | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"GCSConfiguration",
"."
] | [
"func",
"(",
"in",
"*",
"GCSConfiguration",
")",
"DeepCopy",
"(",
")",
"*",
"GCSConfiguration",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"<mask>",
":=",
"new",
"(",
"GCSConfiguration",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
"return",
"out",
"\n",
"}"
] |
14,732 | all-14733 | [
"Wait",
"waits",
"for",
"all",
"message",
"/",
"connection",
"handler",
"goroutines",
"to",
"exit",
".",
"Returns",
"error",
"if",
"wait",
"timeouts",
"(",
"in",
"seconds",
")",
"."
] | [
"func",
"(",
"c",
"*",
"Conn",
")",
"Wait",
"(",
"timeout",
"int",
")",
"error",
"{",
"done",
":=",
"make",
"(",
"chan",
"bool",
")",
"\n\n",
"go",
"func",
"(",
")",
"{",
"c",
".",
"wg",
".",
"Wait",
"(",
")",
";",
"done",
"<-",
"true",
"}",
"(",
")",
"\n\n",
"<mask>",
"{",
"case",
"<-",
"done",
":",
"return",
"nil",
"\n",
"case",
"<-",
"time",
".",
"After",
"(",
"time",
".",
"Second",
"*",
"time",
".",
"Duration",
"(",
"timeout",
")",
")",
":",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}"
] |
14,733 | all-14734 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"StartObservingParams",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice1",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
14,734 | all-14735 | [
"setTaskChangeSent",
"sets",
"the",
"event",
"s",
"task",
"change",
"object",
"as",
"sent"
] | [
"func",
"setTaskChangeSent",
"(",
"event",
"*",
"sendableEvent",
")",
"{",
"taskChangeStatus",
":=",
"event",
".",
"taskChange",
".",
"Status",
"\n",
"task",
":=",
"event",
".",
"taskChange",
".",
"Task",
"\n",
"if",
"task",
"!=",
"nil",
"&&",
"task",
".",
"GetSentStatus",
"(",
")",
"<",
"taskChangeStatus",
"{",
"task",
".",
"SetSentStatus",
"(",
"taskChangeStatus",
")",
"\n",
"}",
"\n",
"for",
"_",
",",
"containerStateChange",
":=",
"range",
"event",
".",
"taskChange",
".",
"Containers",
"{",
"container",
":=",
"containerStateChange",
".",
"Container",
"\n",
"containerChangeStatus",
":=",
"containerStateChange",
".",
"<mask>",
"\n",
"if",
"container",
".",
"GetSentStatus",
"(",
")",
"<",
"containerChangeStatus",
"{",
"container",
".",
"SetSentStatus",
"(",
"containerStateChange",
".",
"Status",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
14,735 | all-14736 | [
"policyIdentityLogName",
"returns",
"a",
"string",
"description",
"of",
"the",
"image",
"identity",
"for",
"policy",
"purposes",
".",
"ONLY",
"use",
"this",
"for",
"log",
"messages",
"not",
"for",
"any",
"decisions!"
] | [
"func",
"policyIdentityLogName",
"(",
"<mask>",
"types",
".",
"ImageReference",
")",
"string",
"{",
"return",
"ref",
".",
"Transport",
"(",
")",
".",
"Name",
"(",
")",
"+",
"\"",
"\"",
"+",
"ref",
".",
"PolicyConfigurationIdentity",
"(",
")",
"\n",
"}"
] |
14,736 | all-14737 | [
"Capture",
"extracts",
"the",
"first",
"placeholder",
"value",
"from",
"the",
"comments",
"."
] | [
"func",
"(",
"l",
"*",
"Line",
")",
"Capture",
"(",
")",
"string",
"{",
"if",
"len",
"(",
"l",
".",
"<mask>",
")",
"==",
"0",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"matches",
":=",
"placeholderRegexp",
".",
"FindSubmatch",
"(",
"l",
".",
"Comment",
")",
"\n",
"if",
"len",
"(",
"matches",
")",
"<",
"2",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"string",
"(",
"matches",
"[",
"1",
"]",
")",
"\n",
"}"
] |
14,737 | all-14738 | [
"Next",
"increments",
"the",
"state",
"and",
"reports",
"whether",
"a",
"check",
"should",
"be",
"performed",
".",
"Checks",
"occur",
"every",
"Nth",
"function",
"call",
"where",
"N",
"is",
"a",
"triangular",
"number",
":",
"0",
"1",
"3",
"6",
"10",
"15",
"21",
"28",
"36",
"45",
"55",
"66",
"78",
"91",
"105",
"120",
"136",
"153",
"171",
"190",
"...",
"See",
"https",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Triangular_number",
"This",
"sequence",
"ensures",
"that",
"the",
"cost",
"of",
"checks",
"drops",
"significantly",
"as",
"the",
"number",
"of",
"functions",
"calls",
"grows",
"larger",
"."
] | [
"func",
"(",
"dc",
"*",
"dynChecker",
")",
"Next",
"(",
")",
"bool",
"{",
"ok",
":=",
"dc",
".",
"curr",
"==",
"dc",
".",
"next",
"\n",
"if",
"ok",
"{",
"dc",
".",
"curr",
"=",
"0",
"\n",
"dc",
".",
"next",
"++",
"\n",
"}",
"\n",
"dc",
".",
"curr",
"++",
"\n",
"return",
"<mask>",
"\n",
"}"
] |
14,738 | all-14739 | [
"ColumnUnmarshallerWithTimestamp",
"creates",
"a",
"RecordUnmarshaller",
"for",
"importing",
"columns",
"with",
"the",
"given",
"format",
"and",
"timestamp",
"format",
"."
] | [
"func",
"ColumnUnmarshallerWithTimestamp",
"(",
"format",
"Format",
",",
"timestampFormat",
"string",
")",
"RecordUnmarshaller",
"{",
"return",
"func",
"(",
"text",
"string",
")",
"(",
"pilosa",
".",
"Record",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"column",
":=",
"pilosa",
".",
"Column",
"{",
"}",
"\n",
"parts",
":=",
"strings",
".",
"Split",
"(",
"text",
",",
"\"",
"\"",
")",
"\n",
"if",
"len",
"(",
"parts",
")",
"<",
"2",
"{",
"return",
"nil",
",",
"<mask>",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"hasRowKey",
":=",
"format",
"==",
"RowKeyColumnID",
"||",
"format",
"==",
"RowKeyColumnKey",
"\n",
"hasColumnKey",
":=",
"format",
"==",
"RowIDColumnKey",
"||",
"format",
"==",
"RowKeyColumnKey",
"\n\n",
"if",
"hasRowKey",
"{",
"column",
".",
"RowKey",
"=",
"parts",
"[",
"0",
"]",
"\n",
"}",
"else",
"{",
"column",
".",
"RowID",
",",
"err",
"=",
"strconv",
".",
"ParseUint",
"(",
"parts",
"[",
"0",
"]",
",",
"10",
",",
"64",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"hasColumnKey",
"{",
"column",
".",
"ColumnKey",
"=",
"parts",
"[",
"1",
"]",
"\n",
"}",
"else",
"{",
"column",
".",
"ColumnID",
",",
"err",
"=",
"strconv",
".",
"ParseUint",
"(",
"parts",
"[",
"1",
"]",
",",
"10",
",",
"64",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"timestamp",
":=",
"0",
"\n",
"if",
"len",
"(",
"parts",
")",
"==",
"3",
"{",
"if",
"timestampFormat",
"==",
"\"",
"\"",
"{",
"timestamp",
",",
"err",
"=",
"strconv",
".",
"Atoi",
"(",
"parts",
"[",
"2",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"else",
"{",
"t",
",",
"err",
":=",
"time",
".",
"Parse",
"(",
"timestampFormat",
",",
"parts",
"[",
"2",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"timestamp",
"=",
"int",
"(",
"t",
".",
"Unix",
"(",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"column",
".",
"Timestamp",
"=",
"int64",
"(",
"timestamp",
")",
"\n\n",
"return",
"column",
",",
"nil",
"\n",
"}",
"\n",
"}"
] |
14,739 | all-14740 | [
"as",
"in",
"https",
":",
"//",
"github",
".",
"com",
"/",
"graphite",
"-",
"project",
"/",
"carbon",
"/",
"blob",
"/",
"master",
"/",
"lib",
"/",
"carbon",
"/",
"util",
".",
"py"
] | [
"func",
"normalizeOriginal",
"(",
"s",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"arr",
":=",
"strings",
".",
"Split",
"(",
"s",
",",
"\"",
"\"",
")",
"\n\n",
"if",
"len",
"(",
"arr",
"[",
"0",
"]",
")",
"==",
"0",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"s",
")",
"\n",
"}",
"\n\n",
"tags",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n\n",
"for",
"i",
":=",
"1",
";",
"i",
"<",
"len",
"(",
"arr",
")",
";",
"i",
"++",
"{",
"kv",
":=",
"strings",
".",
"SplitN",
"(",
"arr",
"[",
"i",
"]",
",",
"\"",
"\"",
",",
"2",
")",
"\n\n",
"if",
"len",
"(",
"kv",
")",
"!=",
"2",
"||",
"len",
"(",
"kv",
"[",
"0",
"]",
")",
"==",
"0",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"s",
",",
"arr",
"[",
"i",
"]",
")",
"\n",
"}",
"\n\n",
"tags",
"[",
"kv",
"[",
"0",
"]",
"]",
"=",
"kv",
"[",
"1",
"]",
"\n",
"}",
"\n\n",
"tmp",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"tags",
")",
")",
"\n",
"i",
":=",
"0",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"tags",
"{",
"tmp",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"k",
",",
"v",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"sort",
".",
"Strings",
"(",
"tmp",
")",
"\n\n",
"<mask>",
":=",
"arr",
"[",
"0",
"]",
"+",
"strings",
".",
"Join",
"(",
"tmp",
",",
"\"",
"\"",
")",
"\n\n",
"return",
"result",
",",
"nil",
"\n",
"}"
] |
14,740 | all-14741 | [
"Runs",
"a",
"cascaded",
"delete",
"operation",
"with",
"one",
"configuration"
] | [
"func",
"cascadeDeleteWithConfig",
"(",
"conf",
"*",
"CascadeConfig",
")",
"(",
"*",
"mgo",
".",
"ChangeInfo",
",",
"error",
")",
"{",
"switch",
"conf",
".",
"RelType",
"{",
"case",
"REL_ONE",
":",
"update",
":=",
"map",
"[",
"string",
"]",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"\"",
"\"",
":",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"}",
",",
"}",
"\n\n",
"if",
"len",
"(",
"conf",
".",
"ThroughProp",
")",
">",
"0",
"{",
"update",
"[",
"\"",
"\"",
"]",
"[",
"conf",
".",
"ThroughProp",
"]",
"=",
"nil",
"\n",
"}",
"else",
"{",
"for",
"_",
",",
"p",
":=",
"range",
"conf",
".",
"Properties",
"{",
"update",
"[",
"\"",
"\"",
"]",
"[",
"p",
"]",
"=",
"nil",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"conf",
".",
"Collection",
".",
"Collection",
"(",
")",
".",
"UpdateAll",
"(",
"conf",
".",
"Query",
",",
"update",
")",
"\n",
"case",
"REL_MANY",
":",
"update",
":=",
"map",
"[",
"string",
"]",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"\"",
"\"",
":",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"}",
",",
"}",
"\n\n",
"q",
":=",
"bson",
".",
"M",
"{",
"}",
"\n",
"for",
"_",
",",
"f",
":=",
"range",
"conf",
".",
"ReferenceQuery",
"{",
"q",
"[",
"f",
".",
"BsonName",
"]",
"=",
"f",
".",
"Value",
"\n",
"}",
"\n",
"update",
"[",
"\"",
"\"",
"]",
"[",
"conf",
".",
"ThroughProp",
"]",
"=",
"q",
"\n",
"return",
"conf",
".",
"Collection",
".",
"<mask>",
"(",
")",
".",
"UpdateAll",
"(",
"conf",
".",
"Query",
",",
"update",
")",
"\n",
"}",
"\n\n",
"return",
"&",
"mgo",
".",
"ChangeInfo",
"{",
"}",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}"
] |
14,741 | all-14742 | [
"PopupAtMouse",
"()",
"is",
"a",
"wrapper",
"for",
"gtk_menu_popup",
"()",
"without",
"the",
"option",
"for",
"a",
"custom",
"positioning",
"function",
"."
] | [
"func",
"(",
"v",
"*",
"Menu",
")",
"PopupAtMouseCursor",
"(",
"parentMenuShell",
"IMenu",
",",
"parentMenuItem",
"IMenuItem",
",",
"<mask>",
"int",
",",
"activateTime",
"uint32",
")",
"{",
"wshell",
":=",
"nullableWidget",
"(",
"parentMenuShell",
")",
"\n",
"witem",
":=",
"nullableWidget",
"(",
"parentMenuItem",
")",
"\n\n",
"C",
".",
"gtk_menu_popup",
"(",
"v",
".",
"native",
"(",
")",
",",
"wshell",
",",
"witem",
",",
"nil",
",",
"nil",
",",
"C",
".",
"guint",
"(",
"button",
")",
",",
"C",
".",
"guint32",
"(",
"activateTime",
")",
")",
"\n",
"}"
] |
14,742 | all-14743 | [
"SetDither",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_set_dither",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PrintSettings",
")",
"SetDither",
"(",
"dither",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"dither",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_print_settings_set_dither",
"(",
"ps",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
14,743 | all-14744 | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"."
] | [
"func",
"(",
"prm",
"*",
"prmExactReference",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"*",
"prm",
"=",
"prmExactReference",
"{",
"}",
"\n",
"var",
"tmp",
"prmExactReference",
"\n",
"if",
"err",
":=",
"paranoidUnmarshalJSONObjectExactFields",
"(",
"data",
",",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"\"",
"\"",
":",
"&",
"tmp",
".",
"Type",
",",
"\"",
"\"",
":",
"&",
"tmp",
".",
"DockerReference",
",",
"}",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"tmp",
".",
"Type",
"!=",
"prmTypeExactReference",
"{",
"return",
"InvalidPolicyFormatError",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
",",
"tmp",
".",
"Type",
")",
")",
"\n",
"}",
"\n\n",
"res",
",",
"err",
":=",
"newPRMExactReference",
"(",
"tmp",
".",
"DockerReference",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"*",
"prm",
"=",
"*",
"res",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,744 | all-14745 | [
"POST",
"/",
"api",
"/",
"governance",
"/",
"projects",
"/",
"{",
"project_id",
"}",
"/",
"applied_policies",
"Create",
"applies",
"a",
"policy",
"template",
"to",
"a",
"given",
"project",
".",
"The",
"applied",
"policy",
"will",
"continually",
"run",
"until",
"deleted",
"."
] | [
"func",
"(",
"loc",
"*",
"AppliedPolicyLocator",
")",
"Create",
"(",
"name",
"string",
",",
"templateHref",
"string",
",",
"options",
"rsapi",
".",
"APIParams",
")",
"(",
"*",
"AppliedPolicy",
",",
"error",
")",
"{",
"var",
"res",
"*",
"AppliedPolicy",
"\n",
"if",
"name",
"==",
"\"",
"\"",
"{",
"return",
"res",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"templateHref",
"==",
"\"",
"\"",
"{",
"return",
"res",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"var",
"params",
"rsapi",
".",
"APIParams",
"\n",
"var",
"p",
"rsapi",
".",
"APIParams",
"\n",
"p",
"=",
"rsapi",
".",
"APIParams",
"{",
"\"",
"\"",
":",
"name",
",",
"\"",
"\"",
":",
"templateHref",
",",
"}",
"\n",
"var",
"descriptionOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"descriptionOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"descriptionOpt",
"\n",
"}",
"\n",
"var",
"dryRunOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"dryRunOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"dryRunOpt",
"\n",
"}",
"\n",
"var",
"frequencyOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"frequencyOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"frequencyOpt",
"\n",
"}",
"\n",
"var",
"optionsOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"optionsOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"optionsOpt",
"\n",
"}",
"\n",
"uri",
",",
"err",
":=",
"loc",
".",
"ActionPath",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"res",
",",
"err",
"\n",
"}",
"\n",
"req",
",",
"err",
":=",
"loc",
".",
"api",
".",
"BuildHTTPRequest",
"(",
"uri",
".",
"HTTPMethod",
",",
"uri",
".",
"Path",
",",
"APIVersion",
",",
"params",
",",
"p",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"<mask>",
",",
"err",
"\n",
"}",
"\n",
"resp",
",",
"err",
":=",
"loc",
".",
"api",
".",
"PerformRequest",
"(",
"req",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"res",
",",
"err",
"\n",
"}",
"\n",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n",
"if",
"resp",
".",
"StatusCode",
"<",
"200",
"||",
"resp",
".",
"StatusCode",
">",
"299",
"{",
"respBody",
",",
"_",
":=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"sr",
":=",
"string",
"(",
"respBody",
")",
"\n",
"if",
"sr",
"!=",
"\"",
"\"",
"{",
"sr",
"=",
"\"",
"\"",
"+",
"sr",
"\n",
"}",
"\n",
"return",
"res",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"resp",
".",
"Status",
",",
"sr",
")",
"\n",
"}",
"\n",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n",
"respBody",
",",
"err",
":=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"res",
",",
"err",
"\n",
"}",
"\n",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"respBody",
",",
"&",
"res",
")",
"\n",
"return",
"res",
",",
"err",
"\n",
"}"
] |
14,745 | all-14746 | [
"NewMockTaskEngine",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockTaskEngine",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockTaskEngine",
"{",
"mock",
":=",
"&",
"MockTaskEngine",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockTaskEngineMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] |
14,746 | all-14747 | [
"Run",
"implements",
"the",
"Discoverer",
"interface",
"."
] | [
"func",
"(",
"s",
"*",
"Service",
")",
"Run",
"(",
"ctx",
"context",
".",
"Context",
",",
"ch",
"chan",
"<-",
"[",
"]",
"*",
"targetgroup",
".",
"Group",
")",
"{",
"defer",
"s",
".",
"queue",
".",
"ShutDown",
"(",
")",
"\n\n",
"if",
"!",
"cache",
".",
"WaitForCacheSync",
"(",
"ctx",
".",
"Done",
"(",
")",
",",
"s",
".",
"informer",
".",
"HasSynced",
")",
"{",
"level",
".",
"Error",
"(",
"s",
".",
"logger",
")",
".",
"<mask>",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"go",
"func",
"(",
")",
"{",
"for",
"s",
".",
"process",
"(",
"ctx",
",",
"ch",
")",
"{",
"}",
"\n",
"}",
"(",
")",
"\n\n",
"// Block until the target provider is explicitly canceled.",
"<-",
"ctx",
".",
"Done",
"(",
")",
"\n",
"}"
] |
14,747 | all-14748 | [
"Cancel",
"is",
"used",
"to",
"indicate",
"an",
"unsuccessful",
"end",
"."
] | [
"func",
"(",
"s",
"*",
"FileSnapshotSink",
")",
"Cancel",
"(",
")",
"error",
"{",
"// Make sure close is idempotent",
"if",
"s",
".",
"closed",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"s",
".",
"<mask>",
"=",
"true",
"\n\n",
"// Close the open handles",
"if",
"err",
":=",
"s",
".",
"finalize",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"s",
".",
"logger",
".",
"Printf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n\n",
"// Attempt to remove all artifacts",
"return",
"os",
".",
"RemoveAll",
"(",
"s",
".",
"dir",
")",
"\n",
"}"
] |
14,748 | all-14749 | [
"Remove",
"deletes",
"all",
"files",
"with",
"the",
"provided",
"name",
"from",
"the",
"GridFS",
"."
] | [
"func",
"(",
"gfs",
"*",
"GridFS",
")",
"Remove",
"(",
"<mask>",
"string",
")",
"(",
"err",
"error",
")",
"{",
"iter",
":=",
"gfs",
".",
"Files",
".",
"Find",
"(",
"bson",
".",
"M",
"{",
"\"",
"\"",
":",
"name",
"}",
")",
".",
"Select",
"(",
"bson",
".",
"M",
"{",
"\"",
"\"",
":",
"1",
"}",
")",
".",
"Iter",
"(",
")",
"\n",
"var",
"doc",
"gfsDocId",
"\n",
"for",
"iter",
".",
"Next",
"(",
"&",
"doc",
")",
"{",
"if",
"e",
":=",
"gfs",
".",
"RemoveId",
"(",
"doc",
".",
"Id",
")",
";",
"e",
"!=",
"nil",
"{",
"err",
"=",
"e",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"err",
"==",
"nil",
"{",
"err",
"=",
"iter",
".",
"Close",
"(",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
] |
14,749 | all-14750 | [
"NewAngularWriter",
"creates",
"a",
"new",
"code",
"writer",
"that",
"generates",
"angular",
".",
"js",
"types",
"."
] | [
"func",
"NewAngularWriter",
"(",
")",
"(",
"*",
"AngularWriter",
",",
"error",
")",
"{",
"funcMap",
":=",
"template",
".",
"FuncMap",
"{",
"\"",
"\"",
":",
"comment",
",",
"\"",
"\"",
":",
"commandLine",
",",
"\"",
"\"",
":",
"<mask>",
",",
"\"",
"\"",
":",
"mandatory",
",",
"}",
"\n",
"resourceT",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"",
"\"",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"Parse",
"(",
"angularTmpl",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"&",
"AngularWriter",
"{",
"angularTmpl",
":",
"resourceT",
",",
"}",
",",
"nil",
"\n",
"}"
] |
14,750 | all-14751 | [
"SetIncrements",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_range_set_increments",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"SetIncrements",
"(",
"step",
",",
"page",
"float64",
")",
"{",
"C",
".",
"gtk_range_set_increments",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gdouble",
"(",
"step",
")",
",",
"C",
".",
"gdouble",
"(",
"page",
")",
")",
"\n",
"}"
] |
14,751 | all-14752 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"DocumentSnapshot",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot10",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
14,752 | all-14753 | [
"Value",
"returns",
"the",
"value",
"of",
"of",
"the",
"current",
"Url",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"Value",
"(",
")",
"interface",
"{",
"}",
"{",
"// if we have not yet performed a look-up, do it so a value is returned",
"if",
"c",
".",
"value",
"==",
"nil",
"{",
"var",
"v",
"<mask>",
"{",
"}",
"\n",
"c",
"=",
"c",
".",
"Child",
"(",
"\"",
"\"",
",",
"nil",
",",
"v",
")",
"\n",
"}",
"\n\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"return",
"c",
".",
"value",
"\n",
"}"
] |
14,753 | all-14754 | [
"StaticFile",
"returns",
"the",
"view",
"which",
"can",
"serve",
"static",
"files",
"."
] | [
"func",
"StaticFile",
"(",
"<mask>",
"string",
",",
"contentType",
"string",
")",
"staticFile",
"{",
"if",
"contentType",
"==",
"\"",
"\"",
"{",
"contentType",
"=",
"mime",
".",
"TypeByExtension",
"(",
"path",
".",
"Ext",
"(",
"filename",
")",
")",
"\n",
"}",
"\n",
"header",
":=",
"make",
"(",
"http",
".",
"Header",
")",
"\n",
"header",
".",
"Set",
"(",
"\"",
"\"",
",",
"contentType",
")",
"\n",
"return",
"staticFile",
"{",
"filename",
",",
"header",
"}",
"\n",
"}"
] |
14,754 | all-14755 | [
"UnescapeHTML",
"returns",
"s",
"with",
"<",
"and",
">",
"unescaped",
"."
] | [
"func",
"UnescapeHTML",
"(",
"s",
"string",
")",
"string",
"{",
"s",
"=",
"strings",
".",
"Replace",
"(",
"s",
",",
"\"",
"\\\\",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
"\n",
"s",
"=",
"strings",
".",
"Replace",
"(",
"s",
",",
"\"",
"\\\\",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
"\n",
"<mask>",
"s",
"\n",
"}"
] |
14,755 | all-14756 | [
"Sign",
"sets",
"the",
"OAuth",
"authorization",
"header"
] | [
"func",
"(",
"t",
"*",
"tokenAuthenticator",
")",
"Sign",
"(",
"r",
"*",
"http",
".",
"<mask>",
")",
"error",
"{",
"r",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"t",
".",
"token",
")",
"\n",
"if",
"t",
".",
"accountID",
"!=",
"0",
"{",
"r",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"strconv",
".",
"Itoa",
"(",
"t",
".",
"accountID",
")",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,756 | all-14757 | [
"SaveConfigData",
"writes",
"configuration",
"to",
"a",
"writer"
] | [
"func",
"SaveConfigData",
"(",
"c",
"*",
"ConfigFile",
",",
"out",
"io",
".",
"Writer",
")",
"(",
"err",
"error",
")",
"{",
"equalSign",
":=",
"\"",
"\"",
"\n",
"if",
"PrettyFormat",
"{",
"equalSign",
"=",
"\"",
"\"",
"\n",
"}",
"\n\n",
"buf",
":=",
"bytes",
".",
"NewBuffer",
"(",
"nil",
")",
"\n",
"for",
"_",
",",
"section",
":=",
"range",
"c",
".",
"sectionList",
"{",
"// Write section comments.",
"if",
"len",
"(",
"c",
".",
"GetSectionComments",
"(",
"section",
")",
")",
">",
"0",
"{",
"if",
"_",
",",
"err",
"=",
"buf",
".",
"WriteString",
"(",
"c",
".",
"GetSectionComments",
"(",
"section",
")",
"+",
"LineBreak",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"section",
"!=",
"DEFAULT_SECTION",
"{",
"// Write section name.",
"if",
"_",
",",
"err",
"=",
"buf",
".",
"WriteString",
"(",
"\"",
"\"",
"+",
"section",
"+",
"\"",
"\"",
"+",
"LineBreak",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"key",
":=",
"range",
"c",
".",
"keyList",
"[",
"section",
"]",
"{",
"if",
"key",
"!=",
"\"",
"\"",
"{",
"// Write key comments.",
"if",
"len",
"(",
"c",
".",
"GetKeyComments",
"(",
"section",
",",
"key",
")",
")",
">",
"0",
"{",
"if",
"_",
",",
"err",
"=",
"buf",
".",
"WriteString",
"(",
"c",
".",
"GetKeyComments",
"(",
"section",
",",
"key",
")",
"+",
"LineBreak",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"keyName",
":=",
"key",
"\n",
"// Check if it's auto increment.",
"if",
"keyName",
"[",
"0",
"]",
"==",
"'#'",
"{",
"keyName",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"//[SWH|+]:支持键名包含等号和冒号",
"if",
"strings",
".",
"Contains",
"(",
"keyName",
",",
"`=`",
")",
"||",
"strings",
".",
"Contains",
"(",
"keyName",
",",
"`:`",
")",
"{",
"if",
"strings",
".",
"Contains",
"(",
"keyName",
",",
"\"",
"\"",
")",
"{",
"if",
"strings",
".",
"Contains",
"(",
"keyName",
",",
"`\"`",
")",
"{",
"keyName",
"=",
"`\"\"\"`",
"+",
"keyName",
"+",
"`\"\"\"`",
"\n",
"}",
"else",
"{",
"keyName",
"=",
"`\"`",
"+",
"keyName",
"+",
"`\"`",
"\n",
"}",
"\n",
"}",
"else",
"{",
"keyName",
"=",
"\"",
"\"",
"+",
"keyName",
"+",
"\"",
"\"",
"\n",
"}",
"\n",
"}",
"\n",
"value",
":=",
"c",
".",
"data",
"[",
"section",
"]",
"[",
"key",
"]",
"\n",
"// In case key value contains \"`\" or \"\\\"\".",
"if",
"strings",
".",
"Contains",
"(",
"value",
",",
"\"",
"\"",
")",
"{",
"if",
"strings",
".",
"Contains",
"(",
"value",
",",
"`\"`",
")",
"{",
"value",
"=",
"`\"\"\"`",
"+",
"value",
"+",
"`\"\"\"`",
"\n",
"}",
"else",
"{",
"value",
"=",
"`\"`",
"+",
"<mask>",
"+",
"`\"`",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Write key and value.",
"if",
"_",
",",
"err",
"=",
"buf",
".",
"WriteString",
"(",
"keyName",
"+",
"equalSign",
"+",
"value",
"+",
"LineBreak",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Put a line between sections.",
"if",
"_",
",",
"err",
"=",
"buf",
".",
"WriteString",
"(",
"LineBreak",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"_",
",",
"err",
":=",
"buf",
".",
"WriteTo",
"(",
"out",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,757 | all-14758 | [
"GetText",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_entry_buffer_get_text",
"()",
".",
"A",
"non",
"-",
"nil",
"error",
"is",
"returned",
"in",
"the",
"case",
"that",
"gtk_entry_buffer_get_text",
"returns",
"NULL",
"to",
"differentiate",
"between",
"NULL",
"and",
"an",
"empty",
"string",
"."
] | [
"func",
"(",
"v",
"*",
"EntryBuffer",
")",
"GetText",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_entry_buffer_get_text",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"<mask>",
"\"",
"\"",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"return",
"goString",
"(",
"c",
")",
",",
"nil",
"\n",
"}"
] |
14,758 | all-14759 | [
"updatePeer",
"is",
"called",
"to",
"update",
"the",
"score",
"of",
"the",
"peer",
"given",
"the",
"existing",
"score",
".",
"Note",
"that",
"a",
"Write",
"lock",
"must",
"be",
"held",
"to",
"call",
"this",
"function",
"."
] | [
"func",
"(",
"l",
"*",
"PeerList",
")",
"updatePeer",
"(",
"<mask>",
"*",
"peerScore",
",",
"newScore",
"uint64",
")",
"{",
"if",
"ps",
".",
"score",
"==",
"newScore",
"{",
"return",
"\n",
"}",
"\n\n",
"ps",
".",
"score",
"=",
"newScore",
"\n",
"l",
".",
"peerHeap",
".",
"updatePeer",
"(",
"ps",
")",
"\n",
"}"
] |
14,759 | all-14760 | [
"registerInternal",
"registers",
"the",
"following",
"internal",
"handlers",
"which",
"return",
"runtime",
"state",
":",
"_gometa_introspect",
":",
"TChannel",
"internal",
"state",
".",
"_gometa_runtime",
":",
"Golang",
"runtime",
"stats",
"."
] | [
"func",
"(",
"ch",
"*",
"Channel",
")",
"registerInternal",
"(",
")",
"{",
"endpoints",
":=",
"[",
"]",
"struct",
"{",
"name",
"string",
"\n",
"handler",
"func",
"(",
"[",
"]",
"byte",
")",
"interface",
"{",
"}",
"\n",
"}",
"{",
"{",
"\"",
"\"",
",",
"ch",
".",
"handleIntrospection",
"}",
",",
"{",
"\"",
"\"",
",",
"handleInternalRuntime",
"}",
",",
"}",
"\n\n",
"tchanSC",
":=",
"ch",
".",
"GetSubChannel",
"(",
"\"",
"\"",
")",
"\n",
"for",
"_",
",",
"ep",
":=",
"range",
"endpoints",
"{",
"// We need ep in our closure.",
"ep",
":=",
"ep",
"\n",
"handler",
":=",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"<mask>",
"*",
"InboundCall",
")",
"{",
"var",
"arg2",
",",
"arg3",
"[",
"]",
"byte",
"\n",
"if",
"err",
":=",
"NewArgReader",
"(",
"call",
".",
"Arg2Reader",
"(",
")",
")",
".",
"Read",
"(",
"&",
"arg2",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"err",
":=",
"NewArgReader",
"(",
"call",
".",
"Arg3Reader",
"(",
")",
")",
".",
"Read",
"(",
"&",
"arg3",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"err",
":=",
"NewArgWriter",
"(",
"call",
".",
"Response",
"(",
")",
".",
"Arg2Writer",
"(",
")",
")",
".",
"Write",
"(",
"nil",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"NewArgWriter",
"(",
"call",
".",
"Response",
"(",
")",
".",
"Arg3Writer",
"(",
")",
")",
".",
"WriteJSON",
"(",
"ep",
".",
"handler",
"(",
"arg3",
")",
")",
"\n",
"}",
"\n",
"ch",
".",
"Register",
"(",
"HandlerFunc",
"(",
"handler",
")",
",",
"ep",
".",
"name",
")",
"\n",
"tchanSC",
".",
"Register",
"(",
"HandlerFunc",
"(",
"handler",
")",
",",
"ep",
".",
"name",
")",
"\n",
"}",
"\n",
"}"
] |
14,760 | all-14761 | [
"SetOverwriteMode",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_entry_set_overwrite_mode",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"SetOverwriteMode",
"(",
"overwrite",
"bool",
")",
"{",
"C",
".",
"gtk_entry_set_overwrite_mode",
"(",
"v",
".",
"native",
"(",
")",
",",
"gbool",
"(",
"overwrite",
")",
")",
"\n",
"}"
] |
14,761 | all-14762 | [
"GetLineTypeOk",
"returns",
"a",
"tuple",
"with",
"the",
"LineType",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TimeseriesRequestStyle",
")",
"GetLineTypeOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"t",
"==",
"nil",
"||",
"t",
".",
"LineType",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"t",
".",
"LineType",
",",
"<mask>",
"\n",
"}"
] |
14,762 | all-14763 | [
"Delete",
"deletes",
"a",
"customer"
] | [
"func",
"(",
"c",
"*",
"CustomerIO",
")",
"Delete",
"(",
"customerID",
"string",
")",
"error",
"{",
"status",
",",
"responseBody",
",",
"err",
":=",
"c",
".",
"request",
"(",
"\"",
"\"",
",",
"c",
".",
"customerURL",
"(",
"customerID",
")",
",",
"[",
"]",
"<mask>",
"{",
"}",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"else",
"if",
"status",
"!=",
"200",
"{",
"return",
"&",
"CustomerIOError",
"{",
"status",
",",
"c",
".",
"customerURL",
"(",
"customerID",
")",
",",
"responseBody",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
14,763 | all-14764 | [
"FillStroke",
"first",
"fills",
"the",
"paths",
"and",
"than",
"strokes",
"them"
] | [
"func",
"(",
"gc",
"*",
"GraphicContext",
")",
"FillStroke",
"(",
"paths",
"...",
"*",
"draw2d",
".",
"Path",
")",
"{",
"paths",
"=",
"append",
"(",
"paths",
",",
"gc",
".",
"Current",
".",
"<mask>",
")",
"\n",
"gc",
".",
"fillRasterizer",
".",
"UseNonZeroWinding",
"=",
"gc",
".",
"Current",
".",
"FillRule",
"==",
"draw2d",
".",
"FillRuleWinding",
"\n",
"gc",
".",
"strokeRasterizer",
".",
"UseNonZeroWinding",
"=",
"true",
"\n\n",
"flattener",
":=",
"draw2dbase",
".",
"Transformer",
"{",
"Tr",
":",
"gc",
".",
"Current",
".",
"Tr",
",",
"Flattener",
":",
"FtLineBuilder",
"{",
"Adder",
":",
"gc",
".",
"fillRasterizer",
"}",
"}",
"\n\n",
"stroker",
":=",
"draw2dbase",
".",
"NewLineStroker",
"(",
"gc",
".",
"Current",
".",
"Cap",
",",
"gc",
".",
"Current",
".",
"Join",
",",
"draw2dbase",
".",
"Transformer",
"{",
"Tr",
":",
"gc",
".",
"Current",
".",
"Tr",
",",
"Flattener",
":",
"FtLineBuilder",
"{",
"Adder",
":",
"gc",
".",
"strokeRasterizer",
"}",
"}",
")",
"\n",
"stroker",
".",
"HalfLineWidth",
"=",
"gc",
".",
"Current",
".",
"LineWidth",
"/",
"2",
"\n\n",
"var",
"liner",
"draw2dbase",
".",
"Flattener",
"\n",
"if",
"gc",
".",
"Current",
".",
"Dash",
"!=",
"nil",
"&&",
"len",
"(",
"gc",
".",
"Current",
".",
"Dash",
")",
">",
"0",
"{",
"liner",
"=",
"draw2dbase",
".",
"NewDashConverter",
"(",
"gc",
".",
"Current",
".",
"Dash",
",",
"gc",
".",
"Current",
".",
"DashOffset",
",",
"stroker",
")",
"\n",
"}",
"else",
"{",
"liner",
"=",
"stroker",
"\n",
"}",
"\n\n",
"demux",
":=",
"draw2dbase",
".",
"DemuxFlattener",
"{",
"Flatteners",
":",
"[",
"]",
"draw2dbase",
".",
"Flattener",
"{",
"flattener",
",",
"liner",
"}",
"}",
"\n",
"for",
"_",
",",
"p",
":=",
"range",
"paths",
"{",
"draw2dbase",
".",
"Flatten",
"(",
"p",
",",
"demux",
",",
"gc",
".",
"Current",
".",
"Tr",
".",
"GetScale",
"(",
")",
")",
"\n",
"}",
"\n\n",
"// Fill",
"gc",
".",
"paint",
"(",
"gc",
".",
"fillRasterizer",
",",
"gc",
".",
"Current",
".",
"FillColor",
")",
"\n",
"// Stroke",
"gc",
".",
"paint",
"(",
"gc",
".",
"strokeRasterizer",
",",
"gc",
".",
"Current",
".",
"StrokeColor",
")",
"\n",
"}"
] |
14,764 | all-14765 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GPUInfo",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoSysteminfo5",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
14,765 | all-14766 | [
"/",
"*",
"Performs",
"advanced",
"morphological",
"transformations",
"."
] | [
"func",
"MorphologyEx",
"(",
"src",
",",
"dst",
",",
"<mask>",
"*",
"IplImage",
",",
"element",
"*",
"IplConvKernel",
",",
"operation",
"int",
",",
"iterations",
"int",
")",
"{",
"C",
".",
"cvMorphologyEx",
"(",
"unsafe",
".",
"Pointer",
"(",
"src",
")",
",",
"unsafe",
".",
"Pointer",
"(",
"dst",
")",
",",
"unsafe",
".",
"Pointer",
"(",
"temp",
")",
",",
"(",
"*",
"C",
".",
"IplConvKernel",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"element",
")",
")",
",",
"C",
".",
"int",
"(",
"operation",
")",
",",
"C",
".",
"int",
"(",
"iterations",
")",
",",
")",
"\n",
"}"
] |
14,766 | all-14767 | [
"SetFont",
"sets",
"the",
"font",
"used",
"to",
"draw",
"text",
"."
] | [
"func",
"(",
"gc",
"*",
"GraphicContext",
")",
"SetFont",
"(",
"<mask>",
"*",
"truetype",
".",
"Font",
")",
"{",
"gc",
".",
"Current",
".",
"Font",
"=",
"font",
"\n",
"}"
] |
14,767 | all-14768 | [
"SetCurrentPage",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_operation_set_current_page",
"()",
"."
] | [
"func",
"(",
"po",
"*",
"PrintOperation",
")",
"SetCurrentPage",
"(",
"<mask>",
"int",
")",
"{",
"C",
".",
"gtk_print_operation_set_current_page",
"(",
"po",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"page",
")",
")",
"\n",
"}"
] |
14,768 | all-14769 | [
"PushClip",
"saves",
"the",
"current",
"clipping",
"window"
] | [
"func",
"PushClip",
"(",
")",
"{",
"c",
":=",
"rect",
"{",
"x",
":",
"canvas",
".",
"clipX",
",",
"y",
":",
"canvas",
".",
"clipY",
",",
"w",
":",
"canvas",
".",
"clipW",
",",
"h",
":",
"canvas",
".",
"clipH",
"}",
"\n",
"canvas",
".",
"clipStack",
"=",
"<mask>",
"(",
"canvas",
".",
"clipStack",
",",
"c",
")",
"\n",
"}"
] |
14,769 | all-14770 | [
"DecrementCurrentSupply",
"finds",
"offering",
"and",
"decrements",
"its",
"current",
"supply",
"."
] | [
"func",
"(",
"w",
"*",
"Worker",
")",
"DecrementCurrentSupply",
"(",
"<mask>",
"*",
"data",
".",
"Job",
")",
"error",
"{",
"logger",
":=",
"w",
".",
"logger",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"job",
")",
"\n",
"offering",
",",
"err",
":=",
"w",
".",
"relatedOffering",
"(",
"logger",
",",
"job",
",",
"data",
".",
"JobDecrementCurrentSupply",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"offering",
".",
"CurrentSupply",
"--",
"\n\n",
"err",
"=",
"data",
".",
"Save",
"(",
"w",
".",
"db",
".",
"Querier",
",",
"offering",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logger",
".",
"Error",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"return",
"ErrInternal",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
14,770 | all-14771 | [
"Parameter",
"callback",
"has",
"type",
"C",
".",
"GLDEBUGPROCKHR",
"."
] | [
"func",
"DebugMessageCallbackKHR",
"(",
"callback",
"unsafe",
".",
"Pointer",
",",
"userParam",
"unsafe",
".",
"Pointer",
")",
"{",
"C",
".",
"glowDebugMessageCallbackKHR",
"(",
"gpDebugMessageCallbackKHR",
",",
"(",
"C",
".",
"GLDEBUGPROCKHR",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"&",
"<mask>",
")",
")",
",",
"userParam",
")",
"\n",
"}"
] |
14,771 | all-14772 | [
"SetFromDocker",
"parses",
"port",
"as",
"provided",
"by",
"Docker",
"and",
"extract",
"protocol",
"and",
"port",
"number",
"."
] | [
"func",
"(",
"s",
"*",
"NetworkNode",
")",
"SetFromDocker",
"(",
"port",
"string",
")",
"error",
"{",
"split",
":=",
"strings",
".",
"Split",
"(",
"port",
",",
"\"",
"\"",
")",
"\n",
"iPort",
",",
"err",
":=",
"strconv",
".",
"ParseUint",
"(",
"<mask>",
"[",
"0",
"]",
",",
"10",
",",
"16",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"s",
".",
"Port",
",",
"s",
".",
"Protocol",
"=",
"uint16",
"(",
"iPort",
")",
",",
"split",
"[",
"1",
"]",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,772 | all-14773 | [
"retrieve",
"a",
"sub",
"-",
"region",
"of",
"a",
"compressed",
"texture",
"image",
"from",
"a",
"compressed",
"texture",
"object"
] | [
"func",
"GetCompressedTextureSubImage",
"(",
"texture",
"uint32",
",",
"level",
"int32",
",",
"xoffset",
"int32",
",",
"yoffset",
"int32",
",",
"zoffset",
"int32",
",",
"<mask>",
"int32",
",",
"height",
"int32",
",",
"depth",
"int32",
",",
"bufSize",
"int32",
",",
"pixels",
"unsafe",
".",
"Pointer",
")",
"{",
"syscall",
".",
"Syscall12",
"(",
"gpGetCompressedTextureSubImage",
",",
"10",
",",
"uintptr",
"(",
"texture",
")",
",",
"uintptr",
"(",
"level",
")",
",",
"uintptr",
"(",
"xoffset",
")",
",",
"uintptr",
"(",
"yoffset",
")",
",",
"uintptr",
"(",
"zoffset",
")",
",",
"uintptr",
"(",
"width",
")",
",",
"uintptr",
"(",
"height",
")",
",",
"uintptr",
"(",
"depth",
")",
",",
"uintptr",
"(",
"bufSize",
")",
",",
"uintptr",
"(",
"pixels",
")",
",",
"0",
",",
"0",
")",
"\n",
"}"
] |
14,773 | all-14774 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetOuterHTMLReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom36",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
14,774 | all-14775 | [
"UnmarshalJSON",
"is",
"a",
"custom",
"method",
"for",
"handling",
"datetime",
"unmarshalling"
] | [
"func",
"(",
"k",
"*",
"APIKey",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"<mask>",
"Alias",
"APIKey",
"\n",
"aux",
":=",
"&",
"struct",
"{",
"Created",
"*",
"string",
"`json:\"created,omitempty\"`",
"\n",
"*",
"Alias",
"\n",
"}",
"{",
"Alias",
":",
"(",
"*",
"Alias",
")",
"(",
"k",
")",
",",
"}",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"data",
",",
"&",
"aux",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"created",
",",
"err",
":=",
"time",
".",
"Parse",
"(",
"createdTimeLayout",
",",
"*",
"aux",
".",
"Created",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"else",
"{",
"k",
".",
"Created",
"=",
"&",
"created",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
14,775 | all-14776 | [
"Remove",
"deletes",
"a",
"symbol",
"from",
"the",
"load",
"statement",
".",
"This",
"has",
"no",
"effect",
"if",
"the",
"symbol",
"is",
"not",
"loaded",
"."
] | [
"func",
"(",
"l",
"*",
"Load",
")",
"Remove",
"(",
"sym",
"string",
")",
"{",
"if",
"_",
",",
"ok",
":=",
"l",
".",
"symbols",
"[",
"sym",
"]",
";",
"ok",
"{",
"delete",
"(",
"l",
".",
"symbols",
",",
"sym",
")",
"\n",
"l",
".",
"updated",
"=",
"<mask>",
"\n",
"}",
"\n",
"}"
] |
14,776 | all-14777 | [
"DialWithTimeout",
"works",
"like",
"Dial",
"but",
"uses",
"timeout",
"as",
"the",
"amount",
"of",
"time",
"to",
"wait",
"for",
"a",
"server",
"to",
"respond",
"when",
"first",
"connecting",
"and",
"also",
"on",
"follow",
"up",
"operations",
"in",
"the",
"session",
".",
"If",
"timeout",
"is",
"zero",
"the",
"call",
"may",
"block",
"forever",
"waiting",
"for",
"a",
"connection",
"to",
"be",
"made",
".",
"See",
"SetSyncTimeout",
"for",
"customizing",
"the",
"timeout",
"for",
"the",
"session",
"."
] | [
"func",
"DialWithTimeout",
"(",
"url",
"string",
",",
"timeout",
"time",
".",
"Duration",
")",
"(",
"*",
"Session",
",",
"error",
")",
"{",
"info",
",",
"err",
":=",
"ParseURL",
"(",
"url",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"info",
".",
"Timeout",
"=",
"timeout",
"\n",
"return",
"DialWithInfo",
"(",
"<mask>",
")",
"\n",
"}"
] |
14,777 | all-14778 | [
"MustStringFormatter",
"is",
"equivalent",
"to",
"NewStringFormatter",
"with",
"a",
"call",
"to",
"panic",
"on",
"error",
"."
] | [
"func",
"MustStringFormatter",
"(",
"format",
"string",
")",
"Formatter",
"{",
"f",
",",
"err",
":=",
"NewStringFormatter",
"(",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
"+",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"return",
"f",
"\n",
"}"
] |
14,778 | all-14779 | [
"DoDeadline",
"performs",
"the",
"given",
"request",
"and",
"waits",
"for",
"response",
"until",
"the",
"given",
"deadline",
".",
"Request",
"must",
"contain",
"at",
"least",
"non",
"-",
"zero",
"RequestURI",
"with",
"full",
"url",
"(",
"including",
"scheme",
"and",
"host",
")",
"or",
"non",
"-",
"zero",
"Host",
"header",
"+",
"RequestURI",
".",
"Client",
"determines",
"the",
"server",
"to",
"be",
"requested",
"in",
"the",
"following",
"order",
":",
"-",
"from",
"RequestURI",
"if",
"it",
"contains",
"full",
"url",
"with",
"scheme",
"and",
"host",
";",
"-",
"from",
"Host",
"header",
"otherwise",
".",
"The",
"function",
"doesn",
"t",
"follow",
"redirects",
".",
"Use",
"Get",
"*",
"for",
"following",
"redirects",
".",
"Response",
"is",
"ignored",
"if",
"resp",
"is",
"nil",
".",
"ErrTimeout",
"is",
"returned",
"if",
"the",
"response",
"wasn",
"t",
"returned",
"until",
"the",
"given",
"deadline",
".",
"ErrNoFreeConns",
"is",
"returned",
"if",
"all",
"Client",
".",
"MaxConnsPerHost",
"connections",
"to",
"the",
"requested",
"host",
"are",
"busy",
".",
"It",
"is",
"recommended",
"obtaining",
"req",
"and",
"resp",
"via",
"AcquireRequest",
"and",
"AcquireResponse",
"in",
"performance",
"-",
"critical",
"code",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"DoDeadline",
"(",
"req",
"*",
"Request",
",",
"resp",
"*",
"Response",
",",
"deadline",
"<mask>",
".",
"Time",
")",
"error",
"{",
"return",
"clientDoDeadline",
"(",
"req",
",",
"resp",
",",
"deadline",
",",
"c",
")",
"\n",
"}"
] |
14,779 | all-14780 | [
"RequestUsers",
"will",
"send",
"an",
"outgoing",
"request",
"to",
"get",
"the",
"user",
"information",
"for",
"all",
"users"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"RequestUsers",
"(",
")",
"{",
"c",
".",
"<mask>",
".",
"Roster",
"(",
"c",
".",
"Id",
",",
"c",
".",
"domain",
")",
"\n",
"}"
] |
14,780 | all-14781 | [
"LineNum",
"returns",
"the",
"current",
"line",
"based",
"on",
"the",
"data",
"processed",
"so",
"far"
] | [
"func",
"(",
"l",
"*",
"Lexer",
")",
"LineNum",
"(",
")",
"int",
"{",
"return",
"strings",
".",
"Count",
"(",
"l",
".",
"<mask>",
"[",
":",
"l",
".",
"Pos",
"]",
",",
"\"",
"\\n",
"\"",
")",
"\n",
"}"
] |
14,781 | all-14782 | [
"NewPolicyFromFile",
"returns",
"a",
"policy",
"configured",
"in",
"the",
"specified",
"file",
"."
] | [
"func",
"NewPolicyFromFile",
"(",
"fileName",
"string",
")",
"(",
"*",
"Policy",
",",
"error",
")",
"{",
"contents",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"fileName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"policy",
",",
"err",
":=",
"NewPolicyFromBytes",
"(",
"contents",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
",",
"fileName",
")",
"\n",
"}",
"\n",
"return",
"<mask>",
",",
"nil",
"\n",
"}"
] |
14,782 | all-14783 | [
"CurrentModule",
"will",
"attempt",
"to",
"return",
"the",
"module",
"name",
"from",
"go",
".",
"mod",
"if",
"modules",
"are",
"enabled",
".",
"If",
"modules",
"are",
"not",
"enabled",
"it",
"will",
"fallback",
"to",
"using",
"CurrentPackage",
"instead",
"."
] | [
"func",
"CurrentModule",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"!",
"Mods",
"(",
")",
"{",
"return",
"CurrentPackage",
"(",
")",
",",
"nil",
"\n",
"}",
"\n",
"moddata",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"packagePath",
":=",
"modfile",
".",
"ModulePath",
"(",
"moddata",
")",
"\n",
"if",
"packagePath",
"==",
"\"",
"\"",
"{",
"return",
"\"",
"\"",
",",
"<mask>",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"packagePath",
",",
"nil",
"\n",
"}"
] |
14,783 | all-14784 | [
"HasColumns",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"HasColumns",
"(",
")",
"bool",
"{",
"if",
"w",
"!=",
"nil",
"&&",
"w",
".",
"Columns",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
14,784 | all-14785 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"AuthChallengeResponse",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoFetch14",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
14,785 | all-14786 | [
"SetExecutionRoleCredentialsID",
"sets",
"the",
"ID",
"for",
"the",
"task",
"execution",
"role",
"credentials"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"SetExecutionRoleCredentialsID",
"(",
"id",
"string",
")",
"{",
"task",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"task",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
"<mask>",
".",
"ExecutionCredentialsID",
"=",
"id",
"\n",
"}"
] |
14,786 | all-14787 | [
"ForResource",
"gives",
"generic",
"access",
"to",
"a",
"shared",
"informer",
"of",
"the",
"matching",
"type",
"TODO",
"extend",
"this",
"to",
"unknown",
"resources",
"with",
"a",
"client",
"pool"
] | [
"func",
"(",
"f",
"*",
"sharedInformerFactory",
")",
"ForResource",
"(",
"resource",
"schema",
".",
"GroupVersionResource",
")",
"(",
"GenericInformer",
",",
"error",
")",
"{",
"switch",
"resource",
"{",
"// Group=prow.k8s.io, Version=v1",
"<mask>",
"v1",
".",
"SchemeGroupVersion",
".",
"WithResource",
"(",
"\"",
"\"",
")",
":",
"return",
"&",
"genericInformer",
"{",
"resource",
":",
"resource",
".",
"GroupResource",
"(",
")",
",",
"informer",
":",
"f",
".",
"Prow",
"(",
")",
".",
"V1",
"(",
")",
".",
"ProwJobs",
"(",
")",
".",
"Informer",
"(",
")",
"}",
",",
"nil",
"\n\n",
"}",
"\n\n",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"resource",
")",
"\n",
"}"
] |
14,787 | all-14788 | [
"runGazelle",
"invokes",
"gazelle",
"with",
"bazel",
"run",
".",
"In",
"fullMode",
"gazelle",
"will",
"run",
"in",
"the",
"entire",
"repository",
".",
"In",
"fastMode",
"gazelle",
"will",
"only",
"run",
"in",
"the",
"given",
"directories",
"."
] | [
"func",
"runGazelle",
"(",
"mode",
"mode",
",",
"dirs",
"[",
"]",
"string",
")",
"error",
"{",
"if",
"mode",
"==",
"fastMode",
"&&",
"len",
"(",
"dirs",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"args",
":=",
"[",
"]",
"string",
"{",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
",",
"\"",
"\"",
",",
"*",
"gazelleLabel",
",",
"\"",
"\"",
",",
"\"",
"\"",
"}",
"\n",
"args",
"=",
"append",
"(",
"args",
",",
"\"",
"\"",
")",
"\n",
"if",
"mode",
"==",
"fastMode",
"{",
"args",
"=",
"append",
"(",
"args",
",",
"\"",
"\"",
")",
"\n",
"args",
"=",
"append",
"(",
"args",
",",
"dirs",
"...",
")",
"\n",
"}",
"\n\n",
"cmd",
":=",
"<mask>",
".",
"Command",
"(",
"args",
"[",
"0",
"]",
",",
"args",
"[",
"1",
":",
"]",
"...",
")",
"\n",
"cmd",
".",
"Stdout",
"=",
"os",
".",
"Stdout",
"\n",
"cmd",
".",
"Stderr",
"=",
"os",
".",
"Stderr",
"\n",
"log",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"strings",
".",
"Join",
"(",
"cmd",
".",
"Args",
",",
"\"",
"\"",
")",
")",
"\n",
"return",
"cmd",
".",
"Run",
"(",
")",
"\n",
"}"
] |
14,788 | all-14789 | [
"load",
"a",
"program",
"object",
"with",
"a",
"program",
"binary"
] | [
"func",
"ProgramBinary",
"(",
"program",
"uint32",
",",
"binaryFormat",
"uint32",
",",
"<mask>",
"unsafe",
".",
"Pointer",
",",
"length",
"int32",
")",
"{",
"C",
".",
"glowProgramBinary",
"(",
"gpProgramBinary",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"program",
")",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"binaryFormat",
")",
",",
"binary",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"length",
")",
")",
"\n",
"}"
] |
14,789 | all-14790 | [
"render",
"primitives",
"from",
"array",
"data",
"with",
"a",
"per",
"-",
"element",
"offset"
] | [
"func",
"DrawElementsBaseVertex",
"(",
"mode",
"uint32",
",",
"<mask>",
"int32",
",",
"xtype",
"uint32",
",",
"indices",
"unsafe",
".",
"Pointer",
",",
"basevertex",
"int32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpDrawElementsBaseVertex",
",",
"5",
",",
"uintptr",
"(",
"mode",
")",
",",
"uintptr",
"(",
"count",
")",
",",
"uintptr",
"(",
"xtype",
")",
",",
"uintptr",
"(",
"indices",
")",
",",
"uintptr",
"(",
"basevertex",
")",
",",
"0",
")",
"\n",
"}"
] |
14,790 | all-14791 | [
"NodeName",
"returns",
"the",
"name",
"of",
"the",
"node",
"this",
"method",
"is",
"invoked",
"on",
"."
] | [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"NodeName",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"stmt",
":=",
"\"",
"\"",
"\n",
"names",
",",
"err",
":=",
"query",
".",
"SelectStrings",
"(",
"c",
".",
"tx",
",",
"stmt",
",",
"c",
".",
"nodeID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"switch",
"len",
"(",
"names",
")",
"{",
"case",
"0",
":",
"return",
"\"",
"\"",
",",
"nil",
"\n",
"<mask>",
"1",
":",
"return",
"names",
"[",
"0",
"]",
",",
"nil",
"\n",
"default",
":",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}"
] |
14,791 | all-14792 | [
"HasVerified",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"u",
"*",
"User",
")",
"HasVerified",
"(",
")",
"bool",
"{",
"if",
"u",
"!=",
"nil",
"&&",
"u",
".",
"Verified",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
14,792 | all-14793 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"LayoutTreeSnapshot",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
14,793 | all-14794 | [
"OpenFile",
"opens",
"file",
"using",
"HTTP",
"protocol",
"and",
"uses",
"Range",
"headers",
"to",
"seek",
"to",
"various",
"positions",
"in",
"the",
"file",
"this",
"means",
"that",
"server",
"has",
"to",
"support",
"the",
"flags",
"Range",
"and",
"Content",
"-",
"Range"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"OpenFile",
"(",
"ctx",
"context",
".",
"<mask>",
",",
"endpoint",
"string",
",",
"params",
"url",
".",
"Values",
")",
"(",
"ReadSeekCloser",
",",
"error",
")",
"{",
"// If the sanitizer is enabled, make sure the requested path is safe.",
"if",
"c",
".",
"sanitizerEnabled",
"{",
"err",
":=",
"isPathSafe",
"(",
"endpoint",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"u",
",",
"err",
":=",
"url",
".",
"Parse",
"(",
"endpoint",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"u",
".",
"RawQuery",
"=",
"params",
".",
"Encode",
"(",
")",
"\n\n",
"return",
"newSeeker",
"(",
"c",
",",
"ctx",
",",
"u",
".",
"String",
"(",
")",
")",
"\n",
"}"
] |
14,794 | all-14795 | [
"specify",
"clear",
"values",
"for",
"the",
"color",
"buffers"
] | [
"func",
"ClearColor",
"(",
"red",
"float32",
",",
"green",
"float32",
",",
"blue",
"float32",
",",
"alpha",
"float32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpClearColor",
",",
"4",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"red",
")",
")",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"green",
")",
")",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"blue",
")",
")",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"<mask>",
")",
")",
",",
"0",
",",
"0",
")",
"\n",
"}"
] |
14,795 | all-14796 | [
"GetInt",
"returns",
"an",
"integer",
"value",
"for",
"a",
"specific",
"column",
"."
] | [
"func",
"(",
"r",
"Record",
")",
"GetInt",
"(",
"column",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"r",
".",
"getKey",
"(",
"reflect",
".",
"Float64",
",",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"int64",
"(",
"v",
".",
"(",
"float64",
")",
")",
",",
"nil",
"\n",
"}"
] |
14,796 | all-14797 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventBufferUsage",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoTracing10",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
14,797 | all-14798 | [
"filterPaeth",
"applies",
"the",
"Paeth",
"filter",
"to",
"the",
"cdat",
"slice",
".",
"cdat",
"is",
"the",
"current",
"row",
"s",
"data",
"pdat",
"is",
"the",
"previous",
"row",
"s",
"data",
"."
] | [
"func",
"filterPaeth",
"(",
"cdat",
",",
"pdat",
"[",
"]",
"byte",
",",
"bytesPerPixel",
"int",
")",
"{",
"var",
"a",
",",
"b",
",",
"c",
",",
"pa",
",",
"<mask>",
",",
"pc",
"int",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"bytesPerPixel",
";",
"i",
"++",
"{",
"a",
",",
"c",
"=",
"0",
",",
"0",
"\n",
"for",
"j",
":=",
"i",
";",
"j",
"<",
"len",
"(",
"cdat",
")",
";",
"j",
"+=",
"bytesPerPixel",
"{",
"b",
"=",
"int",
"(",
"pdat",
"[",
"j",
"]",
")",
"\n",
"pa",
"=",
"b",
"-",
"c",
"\n",
"pb",
"=",
"a",
"-",
"c",
"\n",
"pc",
"=",
"abs",
"(",
"pa",
"+",
"pb",
")",
"\n",
"pa",
"=",
"abs",
"(",
"pa",
")",
"\n",
"pb",
"=",
"abs",
"(",
"pb",
")",
"\n",
"if",
"pa",
"<=",
"pb",
"&&",
"pa",
"<=",
"pc",
"{",
"// No-op.",
"}",
"else",
"if",
"pb",
"<=",
"pc",
"{",
"a",
"=",
"b",
"\n",
"}",
"else",
"{",
"a",
"=",
"c",
"\n",
"}",
"\n",
"a",
"+=",
"int",
"(",
"cdat",
"[",
"j",
"]",
")",
"\n",
"a",
"&=",
"0xff",
"\n",
"cdat",
"[",
"j",
"]",
"=",
"uint8",
"(",
"a",
")",
"\n",
"c",
"=",
"b",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
14,798 | all-14799 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetPauseOnExceptionsParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger8",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
14,799 | all-14800 | [
"SaveStruct",
"returns",
"the",
"properties",
"from",
"src",
"as",
"a",
"slice",
"of",
"Properties",
".",
"src",
"must",
"be",
"a",
"struct",
"pointer",
"."
] | [
"func",
"SaveStruct",
"(",
"src",
"<mask>",
"{",
"}",
")",
"(",
"[",
"]",
"Property",
",",
"error",
")",
"{",
"x",
",",
"err",
":=",
"newStructPLS",
"(",
"src",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"x",
".",
"Save",
"(",
")",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.