id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
23,400 | all-23401 | [
"NewGroup",
"makes",
"a",
"new",
"Group",
"with",
"the",
"given",
"name",
"options",
"and",
"rules",
"."
] | [
"func",
"NewGroup",
"(",
"name",
",",
"file",
"string",
",",
"interval",
"time",
".",
"Duration",
",",
"rules",
"[",
"]",
"Rule",
",",
"shouldRestore",
"bool",
",",
"opts",
"*",
"ManagerOptions",
")",
"*",
"Group",
"{",
"metrics",
":=",
"opts",
".",
"Metrics",
"\n",
"if",
"metrics",
"==",
"nil",
"{",
"metrics",
"=",
"NewGroupMetrics",
"(",
"opts",
".",
"Registerer",
")",
"\n",
"}",
"\n\n",
"metrics",
".",
"groupLastEvalTime",
".",
"WithLabelValues",
"(",
"groupKey",
"(",
"file",
",",
"name",
")",
")",
"\n",
"metrics",
".",
"groupLastDuration",
".",
"WithLabelValues",
"(",
"groupKey",
"(",
"file",
",",
"<mask>",
")",
")",
"\n",
"metrics",
".",
"groupRules",
".",
"WithLabelValues",
"(",
"groupKey",
"(",
"file",
",",
"name",
")",
")",
".",
"Set",
"(",
"float64",
"(",
"len",
"(",
"rules",
")",
")",
")",
"\n\n",
"return",
"&",
"Group",
"{",
"name",
":",
"name",
",",
"file",
":",
"file",
",",
"interval",
":",
"interval",
",",
"rules",
":",
"rules",
",",
"shouldRestore",
":",
"shouldRestore",
",",
"opts",
":",
"opts",
",",
"seriesInPreviousEval",
":",
"make",
"(",
"[",
"]",
"map",
"[",
"string",
"]",
"labels",
".",
"Labels",
",",
"len",
"(",
"rules",
")",
")",
",",
"done",
":",
"make",
"(",
"chan",
"struct",
"{",
"}",
")",
",",
"terminated",
":",
"make",
"(",
"chan",
"struct",
"{",
"}",
")",
",",
"logger",
":",
"log",
".",
"With",
"(",
"opts",
".",
"Logger",
",",
"\"",
"\"",
",",
"name",
")",
",",
"metrics",
":",
"metrics",
",",
"}",
"\n",
"}"
] |
23,401 | all-23402 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SeekAnimationsParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation3",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
23,402 | all-23403 | [
"NewPushCenter",
"creates",
"a",
"new",
"PushCenter",
"."
] | [
"func",
"NewPushCenter",
"(",
"<mask>",
"*",
"Session",
")",
"*",
"PushCenter",
"{",
"return",
"&",
"PushCenter",
"{",
"Channel",
":",
"make",
"(",
"NotificationsChannel",
")",
",",
"stop",
":",
"make",
"(",
"chan",
"bool",
")",
",",
"handlers",
":",
"eventHandlers",
"{",
"}",
",",
"session",
":",
"session",
",",
"}",
"\n",
"}"
] |
23,403 | all-23404 | [
"NewSizeLogger",
"return",
"a",
"logger",
"split",
"by",
"fileSize",
"Parameters",
":",
"file",
"directory",
"file",
"name",
"log",
"s",
"prefix",
"fileCount",
"holds",
"maxCount",
"of",
"bak",
"file",
"fileSize",
"holds",
"each",
"of",
"bak",
"file",
"s",
"size",
"unit",
"stands",
"for",
"kb",
"mb",
"gb",
"tb",
"logScan",
"after",
"a",
"logScan",
"time",
"will",
"check",
"fileLogger",
"isMustSplit",
"default",
"is",
"300s"
] | [
"func",
"NewSizeLogger",
"(",
"fileDir",
",",
"fileName",
",",
"prefix",
"string",
",",
"fileCount",
"int",
",",
"fileSize",
"int64",
",",
"unit",
"UNIT",
",",
"logScan",
"int64",
",",
"logSeq",
"int",
")",
"*",
"FileLogger",
"{",
"sizeLogger",
":=",
"&",
"FileLogger",
"{",
"splitType",
":",
"SplitType_Size",
",",
"mu",
":",
"new",
"(",
"sync",
".",
"RWMutex",
")",
",",
"fileDir",
":",
"fileDir",
",",
"fileName",
":",
"fileName",
",",
"fileCount",
":",
"fileCount",
",",
"fileSize",
":",
"fileSize",
"*",
"int64",
"(",
"<mask>",
")",
",",
"prefix",
":",
"prefix",
",",
"logScan",
":",
"logScan",
",",
"logChan",
":",
"make",
"(",
"chan",
"string",
",",
"logSeq",
")",
",",
"logLevel",
":",
"DEFAULT_LOG_LEVEL",
",",
"logConsole",
":",
"false",
",",
"}",
"\n\n",
"sizeLogger",
".",
"initLogger",
"(",
")",
"\n\n",
"return",
"sizeLogger",
"\n",
"}"
] |
23,404 | all-23405 | [
"Whisper",
"write",
"something",
"in",
"private",
"to",
"someone",
"on",
"twitch",
"whispers",
"are",
"heavily",
"spam",
"protected",
"so",
"your",
"message",
"might",
"get",
"blocked",
"because",
"of",
"this",
"verify",
"your",
"bot",
"to",
"prevent",
"this"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"Whisper",
"(",
"username",
",",
"<mask>",
"string",
")",
"{",
"c",
".",
"send",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"c",
".",
"ircUser",
",",
"username",
",",
"text",
")",
")",
"\n",
"}"
] |
23,405 | all-23406 | [
"parseShadow",
"parses",
"the",
"row",
"of",
"a",
"shadowed",
"password",
"."
] | [
"func",
"parseShadow",
"(",
"row",
"string",
")",
"(",
"*",
"Shadow",
",",
"error",
")",
"{",
"fields",
":=",
"strings",
".",
"Split",
"(",
"row",
",",
"\"",
"\"",
")",
"\n",
"if",
"len",
"(",
"fields",
")",
"!=",
"9",
"{",
"return",
"nil",
",",
"rowError",
"{",
"_SHADOW_FILE",
",",
"row",
"}",
"\n",
"}",
"\n\n",
"var",
"inactive",
",",
"expire",
",",
"flag",
"int",
"\n\n",
"changed",
",",
"err",
":=",
"parseChange",
"(",
"fields",
"[",
"2",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"atoiError",
"{",
"_SHADOW_FILE",
",",
"row",
",",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"min",
",",
"err",
":=",
"strconv",
".",
"Atoi",
"(",
"fields",
"[",
"3",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"atoiError",
"{",
"_SHADOW_FILE",
",",
"row",
",",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"max",
",",
"err",
":=",
"strconv",
".",
"Atoi",
"(",
"fields",
"[",
"4",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"atoiError",
"{",
"_SHADOW_FILE",
",",
"row",
",",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"warn",
",",
"err",
":=",
"strconv",
".",
"Atoi",
"(",
"fields",
"[",
"5",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"atoiError",
"{",
"_SHADOW_FILE",
",",
"row",
",",
"\"",
"\"",
"}",
"\n",
"}",
"\n\n",
"// Optional fields",
"if",
"fields",
"[",
"6",
"]",
"!=",
"\"",
"\"",
"{",
"if",
"inactive",
",",
"err",
"=",
"strconv",
".",
"Atoi",
"(",
"fields",
"[",
"6",
"]",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"atoiError",
"{",
"_SHADOW_FILE",
",",
"row",
",",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"fields",
"[",
"7",
"]",
"!=",
"\"",
"\"",
"{",
"if",
"expire",
",",
"err",
"=",
"strconv",
".",
"Atoi",
"(",
"fields",
"[",
"7",
"]",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"atoiError",
"{",
"_SHADOW_FILE",
",",
"row",
",",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"fields",
"[",
"8",
"]",
"!=",
"\"",
"\"",
"{",
"if",
"flag",
",",
"err",
"=",
"strconv",
".",
"Atoi",
"(",
"fields",
"[",
"8",
"]",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"atoiError",
"{",
"_SHADOW_FILE",
",",
"row",
",",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"&",
"Shadow",
"{",
"fields",
"[",
"0",
"]",
",",
"fields",
"[",
"1",
"]",
",",
"changed",
",",
"<mask>",
",",
"max",
",",
"warn",
",",
"inactive",
",",
"expire",
",",
"flag",
",",
"}",
",",
"nil",
"\n",
"}"
] |
23,406 | all-23407 | [
"Returns",
"whether",
"the",
"node",
"ID",
"is",
"considered",
"secure",
".",
"The",
"id",
"is",
"the",
"20",
"raw",
"bytes",
".",
"http",
":",
"//",
"www",
".",
"libtorrent",
".",
"org",
"/",
"dht_sec",
".",
"html"
] | [
"func",
"NodeIdSecure",
"(",
"id",
"[",
"20",
"]",
"byte",
",",
"ip",
"net",
".",
"IP",
")",
"bool",
"{",
"if",
"isLocalNetwork",
"(",
"<mask>",
")",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"ip4",
":=",
"ip",
".",
"To4",
"(",
")",
";",
"ip4",
"!=",
"nil",
"{",
"ip",
"=",
"ip4",
"\n",
"}",
"\n",
"crc",
":=",
"crcIP",
"(",
"ip",
",",
"id",
"[",
"19",
"]",
")",
"\n",
"if",
"id",
"[",
"0",
"]",
"!=",
"byte",
"(",
"crc",
">>",
"24",
"&",
"0xff",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"id",
"[",
"1",
"]",
"!=",
"byte",
"(",
"crc",
">>",
"16",
"&",
"0xff",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"id",
"[",
"2",
"]",
"&",
"0xf8",
"!=",
"byte",
"(",
"crc",
">>",
"8",
"&",
"0xf8",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}"
] |
23,407 | all-23408 | [
"WriteUsage",
"writes",
"usage",
"information",
"to",
"the",
"given",
"writer"
] | [
"func",
"(",
"p",
"*",
"Parser",
")",
"WriteUsage",
"(",
"w",
"io",
".",
"Writer",
")",
"{",
"var",
"positionals",
",",
"options",
"[",
"]",
"*",
"spec",
"\n",
"for",
"_",
",",
"spec",
":=",
"range",
"p",
".",
"specs",
"{",
"if",
"spec",
".",
"positional",
"{",
"positionals",
"=",
"append",
"(",
"positionals",
",",
"spec",
")",
"\n",
"}",
"else",
"{",
"options",
"=",
"append",
"(",
"options",
",",
"spec",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"p",
".",
"version",
"!=",
"\"",
"\"",
"{",
"fmt",
".",
"Fprintln",
"(",
"w",
",",
"p",
".",
"version",
")",
"\n",
"}",
"\n\n",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"",
"\"",
",",
"p",
".",
"config",
".",
"Program",
")",
"\n\n",
"// write the option component of the usage message",
"for",
"_",
",",
"spec",
":=",
"range",
"options",
"{",
"// prefix with a space",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\"",
")",
"\n",
"if",
"!",
"<mask>",
".",
"required",
"{",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"synopsis",
"(",
"spec",
",",
"\"",
"\"",
"+",
"spec",
".",
"long",
")",
")",
"\n",
"if",
"!",
"spec",
".",
"required",
"{",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"// write the positional component of the usage message",
"for",
"_",
",",
"spec",
":=",
"range",
"positionals",
"{",
"// prefix with a space",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\"",
")",
"\n",
"up",
":=",
"strings",
".",
"ToUpper",
"(",
"spec",
".",
"long",
")",
"\n",
"if",
"spec",
".",
"multiple",
"{",
"if",
"!",
"spec",
".",
"required",
"{",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"fmt",
".",
"Fprintf",
"(",
"w",
",",
"\"",
"\"",
",",
"up",
",",
"up",
")",
"\n",
"if",
"!",
"spec",
".",
"required",
"{",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"else",
"{",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"up",
")",
"\n",
"}",
"\n",
"}",
"\n",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\\n",
"\"",
")",
"\n",
"}"
] |
23,408 | all-23409 | [
"GetPathAtPos",
"is",
"a",
"wrapper",
"around",
"gtk_icon_view_get_path_at_pos",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"IconView",
")",
"GetPathAtPos",
"(",
"x",
",",
"y",
"int",
")",
"*",
"TreePath",
"{",
"var",
"(",
"cpath",
"*",
"C",
".",
"GtkTreePath",
"\n",
"path",
"*",
"TreePath",
"\n",
")",
"\n\n",
"cpath",
"=",
"C",
".",
"gtk_icon_view_get_path_at_pos",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"x",
")",
",",
"C",
".",
"gint",
"(",
"y",
")",
")",
"\n\n",
"if",
"cpath",
"!=",
"nil",
"{",
"path",
"=",
"&",
"TreePath",
"{",
"cpath",
"}",
"\n",
"runtime",
".",
"SetFinalizer",
"(",
"path",
",",
"(",
"*",
"TreePath",
")",
".",
"free",
")",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
23,409 | all-23410 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventRecordingStateChanged",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoBackgroundservice3",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
23,410 | all-23411 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"MediaQuery",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss30",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
23,411 | all-23412 | [
"DoTimeout",
"performs",
"the",
"given",
"request",
"and",
"waits",
"for",
"response",
"during",
"the",
"given",
"timeout",
"duration",
".",
"Request",
"must",
"contain",
"at",
"least",
"non",
"-",
"zero",
"RequestURI",
"with",
"full",
"url",
"(",
"including",
"scheme",
"and",
"host",
")",
"or",
"non",
"-",
"zero",
"Host",
"header",
"+",
"RequestURI",
".",
"The",
"function",
"doesn",
"t",
"follow",
"redirects",
".",
"Response",
"is",
"ignored",
"if",
"resp",
"is",
"nil",
".",
"ErrTimeout",
"is",
"returned",
"if",
"the",
"response",
"wasn",
"t",
"returned",
"during",
"the",
"given",
"timeout",
".",
"It",
"is",
"recommended",
"obtaining",
"req",
"and",
"resp",
"via",
"AcquireRequest",
"and",
"AcquireResponse",
"in",
"performance",
"-",
"critical",
"code",
".",
"Warning",
":",
"DoTimeout",
"does",
"not",
"terminate",
"the",
"request",
"itself",
".",
"The",
"request",
"will",
"continue",
"in",
"the",
"background",
"and",
"the",
"response",
"will",
"be",
"discarded",
".",
"If",
"requests",
"take",
"too",
"long",
"and",
"the",
"connection",
"pool",
"gets",
"filled",
"up",
"please",
"try",
"setting",
"a",
"ReadTimeout",
"."
] | [
"func",
"(",
"c",
"*",
"PipelineClient",
")",
"DoTimeout",
"(",
"req",
"*",
"Request",
",",
"resp",
"*",
"Response",
",",
"timeout",
"<mask>",
".",
"Duration",
")",
"error",
"{",
"return",
"c",
".",
"DoDeadline",
"(",
"req",
",",
"resp",
",",
"time",
".",
"Now",
"(",
")",
".",
"Add",
"(",
"timeout",
")",
")",
"\n",
"}"
] |
23,412 | all-23413 | [
"FrameRangePadded",
"returns",
"the",
"range",
"string",
"that",
"was",
"used",
"to",
"initialize",
"the",
"FrameSet",
"with",
"each",
"number",
"padded",
"out",
"with",
"zeros",
"to",
"a",
"given",
"width"
] | [
"func",
"(",
"s",
"*",
"FrameSet",
")",
"FrameRangePadded",
"(",
"pad",
"int",
")",
"string",
"{",
"return",
"PadFrameRange",
"(",
"s",
".",
"frange",
",",
"<mask>",
")",
"\n",
"}"
] |
23,413 | all-23414 | [
"Age",
"sets",
"the",
"maximum",
"time",
"duration",
"a",
"nonce",
"can",
"be",
"valid"
] | [
"func",
"Age",
"(",
"age",
"<mask>",
".",
"Duration",
")",
"Option",
"{",
"return",
"Option",
"{",
"func",
"(",
"o",
"*",
"options",
")",
"{",
"o",
".",
"age",
"=",
"age",
"\n",
"}",
"}",
"\n",
"}"
] |
23,414 | all-23415 | [
"Do",
"executes",
"LayerTree",
".",
"releaseSnapshot",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"ReleaseSnapshotParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandReleaseSnapshot",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
23,415 | all-23416 | [
"HasUserAgent",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"SyntheticsDevice",
")",
"HasUserAgent",
"(",
")",
"bool",
"{",
"if",
"s",
"!=",
"nil",
"&&",
"s",
".",
"UserAgent",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
23,416 | all-23417 | [
"HasAutoscale",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"q",
"*",
"QueryValueDefinition",
")",
"HasAutoscale",
"(",
")",
"bool",
"{",
"if",
"q",
"!=",
"nil",
"&&",
"q",
".",
"Autoscale",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
23,417 | all-23418 | [
"Get",
"returns",
"a",
"single",
"Transcription",
"or",
"an",
"error",
"."
] | [
"func",
"(",
"c",
"*",
"TranscriptionService",
")",
"Get",
"(",
"ctx",
"context",
".",
"Context",
",",
"sid",
"string",
")",
"(",
"*",
"Transcription",
",",
"error",
")",
"{",
"transcription",
":=",
"<mask>",
"(",
"Transcription",
")",
"\n",
"err",
":=",
"c",
".",
"client",
".",
"GetResource",
"(",
"ctx",
",",
"transcriptionPathPart",
",",
"sid",
",",
"transcription",
")",
"\n",
"return",
"transcription",
",",
"err",
"\n",
"}"
] |
23,418 | all-23419 | [
"FixLoads",
"removes",
"loads",
"of",
"unused",
"go",
"rules",
"and",
"adds",
"loads",
"of",
"newly",
"used",
"rules",
".",
"This",
"should",
"be",
"called",
"after",
"FixFile",
"and",
"MergeFile",
"since",
"symbols",
"may",
"be",
"introduced",
"that",
"aren",
"t",
"loaded",
".",
"This",
"function",
"calls",
"File",
".",
"Sync",
"before",
"processing",
"loads",
"."
] | [
"func",
"FixLoads",
"(",
"f",
"*",
"rule",
".",
"File",
",",
"knownLoads",
"[",
"]",
"rule",
".",
"LoadInfo",
")",
"{",
"knownFiles",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"bool",
")",
"\n",
"knownKinds",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"for",
"_",
",",
"l",
":=",
"range",
"knownLoads",
"{",
"knownFiles",
"[",
"l",
".",
"Name",
"]",
"=",
"true",
"\n",
"for",
"_",
",",
"k",
":=",
"<mask>",
"l",
".",
"Symbols",
"{",
"knownKinds",
"[",
"k",
"]",
"=",
"l",
".",
"Name",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Sync the file. We need File.Loads and File.Rules to contain inserted",
"// statements and not deleted statements.",
"f",
".",
"Sync",
"(",
")",
"\n\n",
"// Scan load statements in the file. Keep track of loads of known files,",
"// since these may be changed. Keep track of symbols loaded from unknown",
"// files; we will not add loads for these.",
"var",
"loads",
"[",
"]",
"*",
"rule",
".",
"Load",
"\n",
"otherLoadedKinds",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"bool",
")",
"\n",
"for",
"_",
",",
"l",
":=",
"range",
"f",
".",
"Loads",
"{",
"if",
"knownFiles",
"[",
"l",
".",
"Name",
"(",
")",
"]",
"{",
"loads",
"=",
"append",
"(",
"loads",
",",
"l",
")",
"\n",
"continue",
"\n",
"}",
"\n",
"for",
"_",
",",
"sym",
":=",
"range",
"l",
".",
"Symbols",
"(",
")",
"{",
"otherLoadedKinds",
"[",
"sym",
"]",
"=",
"true",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Make a map of all the symbols from known files used in this file.",
"usedKinds",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"map",
"[",
"string",
"]",
"bool",
")",
"\n",
"for",
"_",
",",
"r",
":=",
"range",
"f",
".",
"Rules",
"{",
"kind",
":=",
"r",
".",
"Kind",
"(",
")",
"\n",
"if",
"file",
",",
"ok",
":=",
"knownKinds",
"[",
"kind",
"]",
";",
"ok",
"&&",
"!",
"otherLoadedKinds",
"[",
"kind",
"]",
"{",
"if",
"usedKinds",
"[",
"file",
"]",
"==",
"nil",
"{",
"usedKinds",
"[",
"file",
"]",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"bool",
")",
"\n",
"}",
"\n",
"usedKinds",
"[",
"file",
"]",
"[",
"kind",
"]",
"=",
"true",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Fix the load statements. The order is important, so we iterate over",
"// knownLoads instead of knownFiles.",
"for",
"_",
",",
"known",
":=",
"range",
"knownLoads",
"{",
"file",
":=",
"known",
".",
"Name",
"\n",
"first",
":=",
"true",
"\n",
"for",
"_",
",",
"l",
":=",
"range",
"loads",
"{",
"if",
"l",
".",
"Name",
"(",
")",
"!=",
"file",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"first",
"{",
"fixLoad",
"(",
"l",
",",
"file",
",",
"usedKinds",
"[",
"file",
"]",
",",
"knownKinds",
")",
"\n",
"first",
"=",
"false",
"\n",
"}",
"else",
"{",
"fixLoad",
"(",
"l",
",",
"file",
",",
"nil",
",",
"knownKinds",
")",
"\n",
"}",
"\n",
"if",
"l",
".",
"IsEmpty",
"(",
")",
"{",
"l",
".",
"Delete",
"(",
")",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"first",
"{",
"load",
":=",
"fixLoad",
"(",
"nil",
",",
"file",
",",
"usedKinds",
"[",
"file",
"]",
",",
"knownKinds",
")",
"\n",
"if",
"load",
"!=",
"nil",
"{",
"index",
":=",
"newLoadIndex",
"(",
"f",
",",
"known",
".",
"After",
")",
"\n",
"load",
".",
"Insert",
"(",
"f",
",",
"index",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
23,419 | all-23420 | [
"readFile",
"reads",
"and",
"parses",
"the",
"Go",
"source",
"code",
"file",
"and",
"returns",
"whether",
"it",
"has",
"a",
"main",
"function",
"."
] | [
"func",
"readFile",
"(",
"filename",
"string",
")",
"(",
"hasMain",
"bool",
",",
"err",
"error",
")",
"{",
"var",
"src",
"[",
"]",
"byte",
"\n",
"src",
",",
"err",
"=",
"ioutil",
".",
"ReadFile",
"(",
"filename",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"fset",
":=",
"token",
".",
"NewFileSet",
"(",
")",
"\n",
"file",
",",
"err",
":=",
"parser",
".",
"ParseFile",
"(",
"fset",
",",
"filename",
",",
"src",
",",
"0",
")",
"\n",
"for",
"_",
",",
"decl",
":=",
"range",
"file",
".",
"Decls",
"{",
"funcDecl",
",",
"ok",
":=",
"decl",
".",
"(",
"*",
"ast",
".",
"FuncDecl",
")",
"\n",
"if",
"!",
"ok",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"!",
"isMain",
"(",
"funcDecl",
")",
"{",
"continue",
"\n",
"}",
"\n",
"hasMain",
"=",
"true",
"\n",
"<mask>",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
23,420 | all-23421 | [
"Delete",
"removes",
"the",
"option",
"from",
"the",
"specified",
"section",
"."
] | [
"func",
"(",
"c",
"*",
"Config",
")",
"Delete",
"(",
"section",
",",
"key",
"string",
")",
"{",
"for",
"sn",
",",
"sect",
":=",
"range",
"c",
".",
"sections",
"{",
"if",
"sect",
".",
"name",
"==",
"section",
"{",
"for",
"i",
",",
"opt",
":=",
"range",
"sect",
".",
"options",
"{",
"if",
"opt",
".",
"name",
"==",
"<mask>",
"{",
"c",
".",
"sections",
"[",
"sn",
"]",
".",
"options",
"=",
"append",
"(",
"sect",
".",
"options",
"[",
":",
"i",
"]",
",",
"sect",
".",
"options",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
23,421 | all-23422 | [
"StoragePoolVolumeDelete",
"deletes",
"the",
"storage",
"volume",
"attached",
"to",
"a",
"given",
"storage",
"pool",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"StoragePoolVolumeDelete",
"(",
"project",
",",
"volumeName",
"string",
",",
"volumeType",
"int",
",",
"poolID",
"int64",
")",
"error",
"{",
"volumeID",
",",
"_",
",",
"err",
":=",
"c",
".",
"StoragePoolNodeVolumeGetTypeByProject",
"(",
"project",
",",
"volumeName",
",",
"volumeType",
",",
"poolID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"err",
"=",
"c",
".",
"Transaction",
"(",
"func",
"(",
"tx",
"*",
"ClusterTx",
")",
"error",
"{",
"err",
":=",
"storagePoolVolumeReplicateIfCeph",
"(",
"tx",
".",
"tx",
",",
"volumeID",
",",
"project",
",",
"volumeName",
",",
"volumeType",
",",
"poolID",
",",
"func",
"(",
"volumeID",
"int64",
")",
"error",
"{",
"_",
",",
"err",
":=",
"<mask>",
".",
"tx",
".",
"Exec",
"(",
"\"",
"\"",
",",
"volumeID",
")",
"\n",
"return",
"err",
"\n",
"}",
")",
"\n",
"return",
"err",
"\n",
"}",
")",
"\n\n",
"return",
"err",
"\n",
"}"
] |
23,422 | all-23423 | [
"GetPageIterator",
"returns",
"a",
"ApplicationPageIterator",
"with",
"the",
"given",
"page",
"filters",
".",
"Call",
"iterator",
".",
"Next",
"()",
"to",
"get",
"the",
"first",
"page",
"of",
"resources",
"(",
"and",
"again",
"to",
"retrieve",
"subsequent",
"pages",
")",
"."
] | [
"func",
"(",
"c",
"*",
"ApplicationService",
")",
"GetPageIterator",
"(",
"data",
"url",
".",
"Values",
")",
"*",
"ApplicationPageIterator",
"{",
"iter",
":=",
"NewPageIterator",
"(",
"c",
".",
"<mask>",
",",
"data",
",",
"applicationPathPart",
")",
"\n",
"return",
"&",
"ApplicationPageIterator",
"{",
"p",
":",
"iter",
",",
"}",
"\n",
"}"
] |
23,423 | all-23424 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetEventListenerBreakpointParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger2",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
23,424 | all-23425 | [
"memberAddCommandFunc",
"executes",
"the",
"member",
"add",
"command",
"."
] | [
"func",
"memberAddCommandFunc",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
",",
"args",
"[",
"]",
"string",
")",
"{",
"if",
"len",
"(",
"args",
")",
"<",
"1",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"if",
"len",
"(",
"args",
")",
">",
"1",
"{",
"ev",
":=",
"\"",
"\"",
"\n",
"for",
"_",
",",
"s",
":=",
"range",
"args",
"{",
"if",
"strings",
".",
"HasPrefix",
"(",
"strings",
".",
"ToLower",
"(",
"s",
")",
",",
"\"",
"\"",
")",
"{",
"ev",
"+=",
"fmt",
".",
"Sprintf",
"(",
"`, did you mean --peer-urls=%s`",
",",
"s",
")",
"\n",
"}",
"\n",
"}",
"\n",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"errors",
".",
"New",
"(",
"ev",
")",
")",
"\n",
"}",
"\n",
"newMemberName",
":=",
"args",
"[",
"0",
"]",
"\n\n",
"if",
"len",
"(",
"memberPeerURLs",
")",
"==",
"0",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"urls",
":=",
"strings",
".",
"Split",
"(",
"memberPeerURLs",
",",
"\"",
"\"",
")",
"\n",
"ctx",
",",
"cancel",
":=",
"commandCtx",
"(",
"cmd",
")",
"\n",
"cli",
":=",
"mustClientFromCmd",
"(",
"cmd",
")",
"\n",
"resp",
",",
"err",
":=",
"cli",
".",
"MemberAdd",
"(",
"ctx",
",",
"urls",
")",
"\n",
"cancel",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitError",
",",
"err",
")",
"\n",
"}",
"\n",
"newID",
":=",
"resp",
".",
"Member",
".",
"ID",
"\n\n",
"display",
".",
"MemberAdd",
"(",
"*",
"resp",
")",
"\n\n",
"if",
"_",
",",
"ok",
":=",
"(",
"display",
")",
".",
"(",
"*",
"simplePrinter",
")",
";",
"<mask>",
"{",
"ctx",
",",
"cancel",
"=",
"commandCtx",
"(",
"cmd",
")",
"\n",
"listResp",
",",
"err",
":=",
"cli",
".",
"MemberList",
"(",
"ctx",
")",
"\n",
"// get latest member list; if there's failover new member might have outdated list",
"for",
"{",
"if",
"err",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitError",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"listResp",
".",
"Header",
".",
"MemberId",
"==",
"resp",
".",
"Header",
".",
"MemberId",
"{",
"break",
"\n",
"}",
"\n",
"// quorum get to sync cluster list",
"gresp",
",",
"gerr",
":=",
"cli",
".",
"Get",
"(",
"ctx",
",",
"\"",
"\"",
")",
"\n",
"if",
"gerr",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitError",
",",
"err",
")",
"\n",
"}",
"\n",
"resp",
".",
"Header",
".",
"MemberId",
"=",
"gresp",
".",
"Header",
".",
"MemberId",
"\n",
"listResp",
",",
"err",
"=",
"cli",
".",
"MemberList",
"(",
"ctx",
")",
"\n",
"}",
"\n",
"cancel",
"(",
")",
"\n\n",
"conf",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"_",
",",
"memb",
":=",
"range",
"listResp",
".",
"Members",
"{",
"for",
"_",
",",
"u",
":=",
"range",
"memb",
".",
"PeerURLs",
"{",
"n",
":=",
"memb",
".",
"Name",
"\n",
"if",
"memb",
".",
"ID",
"==",
"newID",
"{",
"n",
"=",
"newMemberName",
"\n",
"}",
"\n",
"conf",
"=",
"append",
"(",
"conf",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"n",
",",
"u",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"fmt",
".",
"Print",
"(",
"\"",
"\\n",
"\"",
")",
"\n",
"fmt",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"newMemberName",
")",
"\n",
"fmt",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"strings",
".",
"Join",
"(",
"conf",
",",
"\"",
"\"",
")",
")",
"\n",
"fmt",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"memberPeerURLs",
")",
"\n",
"fmt",
".",
"Printf",
"(",
"\"",
"\\\"",
"\\\"",
"\\n",
"\"",
")",
"\n",
"}",
"\n",
"}"
] |
23,425 | all-23426 | [
"specify",
"multisample",
"coverage",
"parameters"
] | [
"func",
"SampleCoverage",
"(",
"<mask>",
"float32",
",",
"invert",
"bool",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpSampleCoverage",
",",
"2",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"value",
")",
")",
",",
"boolToUintptr",
"(",
"invert",
")",
",",
"0",
")",
"\n",
"}"
] |
23,426 | all-23427 | [
"HasId",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"Screenboard",
")",
"HasId",
"(",
")",
"bool",
"{",
"if",
"s",
"!=",
"nil",
"&&",
"s",
".",
"<mask>",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
23,427 | all-23428 | [
"Languages",
"provides",
"the",
"handler",
"with",
"supported",
"languages",
"."
] | [
"func",
"Languages",
"(",
"tags",
"[",
"]",
"xlang",
".",
"Tag",
")",
"Option",
"{",
"return",
"Option",
"{",
"func",
"(",
"o",
"*",
"options",
")",
"{",
"o",
".",
"languages",
"=",
"<mask>",
"\n",
"}",
"}",
"\n",
"}"
] |
23,428 | all-23429 | [
"ServeHTTP",
"implements",
"the",
"middlware",
".",
"Handler",
"interface",
"."
] | [
"func",
"(",
"h",
"WebHook",
")",
"ServeHTTP",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"(",
"int",
",",
"error",
")",
"{",
"for",
"_",
",",
"repo",
":=",
"range",
"h",
".",
"Repos",
"{",
"if",
"r",
".",
"URL",
".",
"Path",
"==",
"repo",
".",
"Hook",
".",
"URL",
"{",
"// if handler type is specified.",
"if",
"handler",
",",
"ok",
":=",
"handlers",
"[",
"repo",
".",
"Hook",
".",
"Type",
"]",
";",
"<mask>",
"{",
"if",
"!",
"handler",
".",
"DoesHandle",
"(",
"r",
".",
"Header",
")",
"{",
"return",
"http",
".",
"StatusBadRequest",
",",
"errors",
".",
"New",
"(",
"http",
".",
"StatusText",
"(",
"http",
".",
"StatusBadRequest",
")",
")",
"\n",
"}",
"\n",
"status",
",",
"err",
":=",
"handler",
".",
"Handle",
"(",
"w",
",",
"r",
",",
"repo",
")",
"\n",
"// if the webhook is ignored, log it and allow request to continue.",
"if",
"hookIgnored",
"(",
"err",
")",
"{",
"Logger",
"(",
")",
".",
"Println",
"(",
"err",
")",
"\n",
"err",
"=",
"nil",
"\n",
"}",
"\n",
"return",
"status",
",",
"err",
"\n",
"}",
"\n\n",
"// auto detect handler",
"for",
"_",
",",
"h",
":=",
"range",
"defaultHandlers",
"{",
"// if a handler indicates it does handle the request,",
"// we do not try other handlers. Only one handler ever",
"// handles a specific request.",
"if",
"handlers",
"[",
"h",
"]",
".",
"DoesHandle",
"(",
"r",
".",
"Header",
")",
"{",
"status",
",",
"err",
":=",
"handlers",
"[",
"h",
"]",
".",
"Handle",
"(",
"w",
",",
"r",
",",
"repo",
")",
"\n",
"// if the webhook is ignored, log it and allow request to continue.",
"if",
"hookIgnored",
"(",
"err",
")",
"{",
"Logger",
"(",
")",
".",
"Println",
"(",
"err",
")",
"\n",
"err",
"=",
"nil",
"\n",
"}",
"\n",
"return",
"status",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"// no compatible handler",
"Logger",
"(",
")",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"h",
".",
"Next",
".",
"ServeHTTP",
"(",
"w",
",",
"r",
")",
"\n",
"}"
] |
23,429 | all-23430 | [
"GetTrustLine",
"retrieves",
"the",
"TrustLine",
"value",
"from",
"the",
"union",
"returning",
"ok",
"if",
"the",
"union",
"s",
"switch",
"indicated",
"the",
"value",
"is",
"valid",
"."
] | [
"func",
"(",
"u",
"LedgerEntryData",
")",
"GetTrustLine",
"(",
")",
"(",
"result",
"TrustLineEntry",
",",
"ok",
"bool",
")",
"{",
"armName",
",",
"_",
":=",
"u",
".",
"ArmForSwitch",
"(",
"int32",
"(",
"u",
".",
"Type",
")",
")",
"\n\n",
"if",
"armName",
"==",
"\"",
"\"",
"{",
"<mask>",
"=",
"*",
"u",
".",
"TrustLine",
"\n",
"ok",
"=",
"true",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
] |
23,430 | all-23431 | [
"ContainerConfig",
"gets",
"the",
"container",
"configuration",
"map",
"from",
"the",
"DB"
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"ContainerConfig",
"(",
"id",
"int",
")",
"(",
"map",
"[",
"string",
"]",
"string",
",",
"error",
")",
"{",
"var",
"key",
",",
"value",
"string",
"\n",
"q",
":=",
"`SELECT key, value FROM containers_config WHERE container_id=?`",
"\n\n",
"inargs",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"id",
"}",
"\n",
"outfmt",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"key",
",",
"value",
"}",
"\n\n",
"// Results is already a slice here, not db Rows anymore.",
"results",
",",
"err",
":=",
"queryScan",
"(",
"c",
".",
"db",
",",
"q",
",",
"inargs",
",",
"outfmt",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"//SmartError will wrap this and make \"not found\" errors pretty",
"\n",
"}",
"\n\n",
"config",
":=",
"<mask>",
"[",
"string",
"]",
"string",
"{",
"}",
"\n\n",
"for",
"_",
",",
"r",
":=",
"range",
"results",
"{",
"key",
"=",
"r",
"[",
"0",
"]",
".",
"(",
"string",
")",
"\n",
"value",
"=",
"r",
"[",
"1",
"]",
".",
"(",
"string",
")",
"\n\n",
"config",
"[",
"key",
"]",
"=",
"value",
"\n",
"}",
"\n\n",
"return",
"config",
",",
"nil",
"\n",
"}"
] |
23,431 | all-23432 | [
"GetLogset",
"returns",
"the",
"Logset",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"GetLogset",
"(",
")",
"<mask>",
"{",
"if",
"w",
"==",
"nil",
"||",
"w",
".",
"Logset",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"w",
".",
"Logset",
"\n",
"}"
] |
23,432 | all-23433 | [
"GetValueOk",
"returns",
"a",
"tuple",
"with",
"the",
"Value",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TriggeringValue",
")",
"GetValueOk",
"(",
")",
"(",
"int",
",",
"bool",
")",
"{",
"if",
"t",
"==",
"nil",
"||",
"t",
".",
"<mask>",
"==",
"nil",
"{",
"return",
"0",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"t",
".",
"Value",
",",
"true",
"\n",
"}"
] |
23,433 | all-23434 | [
"LoadStruct",
"loads",
"the",
"properties",
"from",
"p",
"to",
"dst",
".",
"dst",
"must",
"be",
"a",
"struct",
"pointer",
"."
] | [
"func",
"LoadStruct",
"(",
"dst",
"<mask>",
"{",
"}",
",",
"p",
"[",
"]",
"Property",
")",
"error",
"{",
"x",
",",
"err",
":=",
"newStructPLS",
"(",
"dst",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"x",
".",
"Load",
"(",
"p",
")",
"\n",
"}"
] |
23,434 | all-23435 | [
"MarkOffsets",
"marks",
"stashed",
"offsets",
"as",
"processed",
".",
"See",
"MarkOffset",
"for",
"additional",
"explanation",
"."
] | [
"func",
"(",
"c",
"*",
"Consumer",
")",
"MarkOffsets",
"(",
"s",
"*",
"OffsetStash",
")",
"{",
"s",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"for",
"tp",
",",
"info",
":=",
"range",
"s",
".",
"offsets",
"{",
"if",
"sub",
":=",
"c",
".",
"subs",
".",
"Fetch",
"(",
"tp",
".",
"<mask>",
",",
"tp",
".",
"Partition",
")",
";",
"sub",
"!=",
"nil",
"{",
"sub",
".",
"MarkOffset",
"(",
"info",
".",
"Offset",
",",
"info",
".",
"Metadata",
")",
"\n",
"}",
"\n",
"delete",
"(",
"s",
".",
"offsets",
",",
"tp",
")",
"\n",
"}",
"\n",
"}"
] |
23,435 | all-23436 | [
"copy",
"a",
"one",
"-",
"dimensional",
"texture",
"subimage"
] | [
"func",
"CopyTextureSubImage1D",
"(",
"texture",
"uint32",
",",
"level",
"int32",
",",
"xoffset",
"int32",
",",
"x",
"int32",
",",
"y",
"int32",
",",
"<mask>",
"int32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpCopyTextureSubImage1D",
",",
"6",
",",
"uintptr",
"(",
"texture",
")",
",",
"uintptr",
"(",
"level",
")",
",",
"uintptr",
"(",
"xoffset",
")",
",",
"uintptr",
"(",
"x",
")",
",",
"uintptr",
"(",
"y",
")",
",",
"uintptr",
"(",
"width",
")",
")",
"\n",
"}"
] |
23,436 | all-23437 | [
"setupMIMEHeaders",
"determines",
"content",
"transfer",
"encoding",
"generates",
"a",
"boundary",
"string",
"if",
"required",
"then",
"sets",
"the",
"Content",
"-",
"Type",
"(",
"type",
"charset",
"filename",
"boundary",
")",
"and",
"Content",
"-",
"Disposition",
"headers",
"."
] | [
"func",
"(",
"p",
"*",
"<mask>",
")",
"setupMIMEHeaders",
"(",
")",
"transferEncoding",
"{",
"// Determine content transfer encoding.",
"// If we are encoding a part that previously had content-transfer-encoding set, unset it so",
"// the correct encoding detection can be done below.",
"p",
".",
"Header",
".",
"Del",
"(",
"hnContentEncoding",
")",
"\n\n",
"cte",
":=",
"te7Bit",
"\n",
"if",
"len",
"(",
"p",
".",
"Content",
")",
">",
"0",
"{",
"cte",
"=",
"teBase64",
"\n",
"if",
"p",
".",
"TextContent",
"(",
")",
"{",
"cte",
"=",
"selectTransferEncoding",
"(",
"p",
".",
"Content",
",",
"false",
")",
"\n",
"if",
"p",
".",
"Charset",
"==",
"\"",
"\"",
"{",
"p",
".",
"Charset",
"=",
"utf8",
"\n",
"}",
"\n",
"}",
"\n",
"// RFC 2045: 7bit is assumed if CTE header not present.",
"switch",
"cte",
"{",
"case",
"teBase64",
":",
"p",
".",
"Header",
".",
"Set",
"(",
"hnContentEncoding",
",",
"cteBase64",
")",
"\n",
"case",
"teQuoted",
":",
"p",
".",
"Header",
".",
"Set",
"(",
"hnContentEncoding",
",",
"cteQuotedPrintable",
")",
"\n",
"}",
"\n",
"}",
"\n",
"// Setup headers.",
"if",
"p",
".",
"FirstChild",
"!=",
"nil",
"&&",
"p",
".",
"Boundary",
"==",
"\"",
"\"",
"{",
"// Multipart, generate random boundary marker.",
"p",
".",
"Boundary",
"=",
"\"",
"\"",
"+",
"stringutil",
".",
"UUID",
"(",
")",
"\n",
"}",
"\n",
"if",
"p",
".",
"ContentID",
"!=",
"\"",
"\"",
"{",
"p",
".",
"Header",
".",
"Set",
"(",
"hnContentID",
",",
"coding",
".",
"ToIDHeader",
"(",
"p",
".",
"ContentID",
")",
")",
"\n",
"}",
"\n",
"if",
"p",
".",
"ContentType",
"!=",
"\"",
"\"",
"{",
"// Build content type header.",
"param",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"setParamValue",
"(",
"param",
",",
"hpCharset",
",",
"p",
".",
"Charset",
")",
"\n",
"setParamValue",
"(",
"param",
",",
"hpName",
",",
"stringutil",
".",
"ToASCII",
"(",
"p",
".",
"FileName",
")",
")",
"\n",
"setParamValue",
"(",
"param",
",",
"hpBoundary",
",",
"p",
".",
"Boundary",
")",
"\n",
"mt",
":=",
"mime",
".",
"FormatMediaType",
"(",
"p",
".",
"ContentType",
",",
"param",
")",
"\n",
"if",
"mt",
"==",
"\"",
"\"",
"{",
"// There was an error, FormatMediaType couldn't encode the params.",
"mt",
"=",
"p",
".",
"ContentType",
"\n",
"}",
"\n",
"p",
".",
"Header",
".",
"Set",
"(",
"hnContentType",
",",
"mt",
")",
"\n",
"}",
"\n",
"if",
"p",
".",
"Disposition",
"!=",
"\"",
"\"",
"{",
"// Build disposition header.",
"param",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"setParamValue",
"(",
"param",
",",
"hpFilename",
",",
"stringutil",
".",
"ToASCII",
"(",
"p",
".",
"FileName",
")",
")",
"\n",
"if",
"!",
"p",
".",
"FileModDate",
".",
"IsZero",
"(",
")",
"{",
"setParamValue",
"(",
"param",
",",
"hpModDate",
",",
"p",
".",
"FileModDate",
".",
"Format",
"(",
"time",
".",
"RFC822",
")",
")",
"\n",
"}",
"\n",
"mt",
":=",
"mime",
".",
"FormatMediaType",
"(",
"p",
".",
"Disposition",
",",
"param",
")",
"\n",
"if",
"mt",
"==",
"\"",
"\"",
"{",
"// There was an error, FormatMediaType couldn't encode the params.",
"mt",
"=",
"p",
".",
"Disposition",
"\n",
"}",
"\n",
"p",
".",
"Header",
".",
"Set",
"(",
"hnContentDisposition",
",",
"mt",
")",
"\n",
"}",
"\n",
"return",
"cte",
"\n",
"}"
] |
23,437 | all-23438 | [
"NewTimeoutListener",
"returns",
"a",
"listener",
"that",
"listens",
"on",
"the",
"given",
"address",
".",
"If",
"read",
"/",
"write",
"on",
"the",
"accepted",
"connection",
"blocks",
"longer",
"than",
"its",
"time",
"limit",
"it",
"will",
"return",
"timeout",
"error",
"."
] | [
"func",
"NewTimeoutListener",
"(",
"addr",
"string",
",",
"scheme",
"string",
",",
"tlsinfo",
"*",
"TLSInfo",
",",
"rdtimeoutd",
",",
"wtimeoutd",
"<mask>",
".",
"Duration",
")",
"(",
"net",
".",
"Listener",
",",
"error",
")",
"{",
"ln",
",",
"err",
":=",
"newListener",
"(",
"addr",
",",
"scheme",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"ln",
"=",
"&",
"rwTimeoutListener",
"{",
"Listener",
":",
"ln",
",",
"rdtimeoutd",
":",
"rdtimeoutd",
",",
"wtimeoutd",
":",
"wtimeoutd",
",",
"}",
"\n",
"if",
"ln",
",",
"err",
"=",
"wrapTLS",
"(",
"scheme",
",",
"tlsinfo",
",",
"ln",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"ln",
",",
"nil",
"\n",
"}"
] |
23,438 | all-23439 | [
"PangoContext",
"*",
"pango_layout_get_context",
"(",
"PangoLayout",
"*",
"layout",
")",
";"
] | [
"func",
"(",
"v",
"*",
"Layout",
")",
"GetContext",
"(",
")",
"*",
"Context",
"{",
"c",
":=",
"C",
".",
"pango_layout_get_context",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n\n",
"context",
":=",
"<mask>",
"(",
"Context",
")",
"\n",
"context",
".",
"pangoContext",
"=",
"(",
"*",
"C",
".",
"PangoContext",
")",
"(",
"c",
")",
"\n\n",
"return",
"context",
"\n",
"}"
] |
23,439 | all-23440 | [
"/",
"*",
"taken",
"from",
"http",
":",
"//",
"blog",
".",
"golang",
".",
"org",
"/",
"slices",
"(",
"which",
"is",
"under",
"BSD",
"licence",
")"
] | [
"func",
"Extend",
"(",
"slice",
"[",
"]",
"IdmapEntry",
",",
"element",
"IdmapEntry",
")",
"[",
"]",
"IdmapEntry",
"{",
"n",
":=",
"len",
"(",
"slice",
")",
"\n",
"if",
"n",
"==",
"cap",
"(",
"slice",
")",
"{",
"// Slice is full; must grow.",
"// We double its size and add 1, so if the size is zero we still grow.",
"newSlice",
":=",
"make",
"(",
"[",
"]",
"IdmapEntry",
",",
"len",
"(",
"slice",
")",
",",
"2",
"*",
"len",
"(",
"slice",
")",
"+",
"1",
")",
"\n",
"<mask>",
"(",
"newSlice",
",",
"slice",
")",
"\n",
"slice",
"=",
"newSlice",
"\n",
"}",
"\n",
"slice",
"=",
"slice",
"[",
"0",
":",
"n",
"+",
"1",
"]",
"\n",
"slice",
"[",
"n",
"]",
"=",
"element",
"\n",
"return",
"slice",
"\n",
"}"
] |
23,440 | all-23441 | [
"Sub",
"returns",
"the",
"rectangle",
"r",
"translated",
"by",
"-",
"v",
"."
] | [
"func",
"(",
"r",
"Rectangle",
")",
"Sub",
"(",
"v",
"Vec3",
")",
"Rectangle",
"{",
"<mask>",
"Rectangle",
"{",
"Vec3",
"{",
"r",
".",
"Min",
"[",
"0",
"]",
"-",
"v",
"[",
"0",
"]",
",",
"r",
".",
"Min",
"[",
"1",
"]",
"-",
"v",
"[",
"1",
"]",
",",
"r",
".",
"Min",
"[",
"2",
"]",
"-",
"v",
"[",
"2",
"]",
"}",
",",
"Vec3",
"{",
"r",
".",
"Max",
"[",
"0",
"]",
"-",
"v",
"[",
"0",
"]",
",",
"r",
".",
"Max",
"[",
"1",
"]",
"-",
"v",
"[",
"1",
"]",
",",
"r",
".",
"Max",
"[",
"2",
"]",
"-",
"v",
"[",
"2",
"]",
"}",
",",
"}",
"\n",
"}"
] |
23,441 | all-23442 | [
"GetCombinedStatus",
"retrieves",
"the",
"CombinedStatus",
"for",
"the",
"specified",
"reference",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetCombinedStatus",
"(",
"owner",
",",
"repo",
",",
"ref",
"string",
")",
"(",
"*",
"github",
".",
"CombinedStatus",
",",
"error",
")",
"{",
"var",
"<mask>",
"*",
"github",
".",
"CombinedStatus",
"\n",
"listOpts",
":=",
"&",
"github",
".",
"ListOptions",
"{",
"}",
"\n\n",
"statuses",
",",
"err",
":=",
"c",
".",
"depaginate",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"ref",
")",
",",
"listOpts",
",",
"func",
"(",
")",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"*",
"github",
".",
"Response",
",",
"error",
")",
"{",
"combined",
",",
"resp",
",",
"err",
":=",
"c",
".",
"repoService",
".",
"GetCombinedStatus",
"(",
"context",
".",
"Background",
"(",
")",
",",
"owner",
",",
"repo",
",",
"ref",
",",
"listOpts",
",",
")",
"\n",
"if",
"result",
"==",
"nil",
"{",
"result",
"=",
"combined",
"\n",
"}",
"\n\n",
"var",
"interfaceList",
"[",
"]",
"interface",
"{",
"}",
"\n",
"if",
"err",
"==",
"nil",
"{",
"interfaceList",
"=",
"make",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"0",
",",
"len",
"(",
"combined",
".",
"Statuses",
")",
")",
"\n",
"for",
"_",
",",
"status",
":=",
"range",
"combined",
".",
"Statuses",
"{",
"interfaceList",
"=",
"append",
"(",
"interfaceList",
",",
"status",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"interfaceList",
",",
"resp",
",",
"err",
"\n",
"}",
",",
")",
"\n\n",
"if",
"result",
"!=",
"nil",
"{",
"result",
".",
"Statuses",
"=",
"make",
"(",
"[",
"]",
"github",
".",
"RepoStatus",
",",
"0",
",",
"len",
"(",
"statuses",
")",
")",
"\n",
"for",
"_",
",",
"status",
":=",
"range",
"statuses",
"{",
"result",
".",
"Statuses",
"=",
"append",
"(",
"result",
".",
"Statuses",
",",
"status",
".",
"(",
"github",
".",
"RepoStatus",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"result",
",",
"err",
"\n",
"}"
] |
23,442 | all-23443 | [
"Normalize",
"returns",
"the",
"driver",
"host",
"port",
"database",
"and",
"user",
"name",
"of",
"a",
"URL",
"joined",
"with",
"sep",
"populating",
"blank",
"fields",
"with",
"empty",
"."
] | [
"func",
"(",
"u",
"*",
"URL",
")",
"Normalize",
"(",
"sep",
",",
"empty",
"string",
",",
"cut",
"int",
")",
"string",
"{",
"s",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"5",
")",
"\n\n",
"s",
"[",
"0",
"]",
"=",
"u",
".",
"Unaliased",
"\n",
"if",
"u",
".",
"Proto",
"!=",
"\"",
"\"",
"&&",
"u",
".",
"Proto",
"!=",
"\"",
"\"",
"{",
"s",
"[",
"0",
"]",
"+=",
"\"",
"\"",
"+",
"u",
".",
"Proto",
"\n",
"}",
"\n\n",
"// set host port dbname fields",
"if",
"u",
".",
"hostPortDB",
"==",
"nil",
"{",
"if",
"u",
".",
"Opaque",
"!=",
"\"",
"\"",
"{",
"u",
".",
"hostPortDB",
"=",
"[",
"]",
"string",
"{",
"u",
".",
"Opaque",
",",
"\"",
"\"",
",",
"\"",
"\"",
"}",
"\n",
"}",
"else",
"{",
"u",
".",
"hostPortDB",
"=",
"[",
"]",
"string",
"{",
"hostname",
"(",
"u",
".",
"Host",
")",
",",
"hostport",
"(",
"u",
".",
"Host",
")",
",",
"strings",
".",
"TrimPrefix",
"(",
"u",
".",
"Path",
",",
"\"",
"\"",
")",
",",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"copy",
"(",
"s",
"[",
"1",
":",
"]",
",",
"u",
".",
"hostPortDB",
")",
"\n\n",
"// set user",
"if",
"u",
".",
"User",
"!=",
"nil",
"{",
"s",
"[",
"4",
"]",
"=",
"u",
".",
"User",
".",
"Username",
"(",
")",
"\n",
"}",
"\n\n",
"// replace blank entries ...",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"s",
")",
";",
"i",
"++",
"{",
"if",
"s",
"[",
"i",
"]",
"==",
"\"",
"\"",
"{",
"s",
"[",
"i",
"]",
"=",
"empty",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"cut",
">",
"0",
"{",
"// cut to only populated fields",
"i",
":=",
"len",
"(",
"s",
")",
"-",
"1",
"\n",
"for",
";",
"i",
">",
"cut",
";",
"i",
"--",
"{",
"if",
"s",
"[",
"i",
"]",
"!=",
"\"",
"\"",
"{",
"<mask>",
"\n",
"}",
"\n",
"}",
"\n",
"s",
"=",
"s",
"[",
":",
"i",
"]",
"\n",
"}",
"\n\n",
"// join",
"return",
"strings",
".",
"Join",
"(",
"s",
",",
"sep",
")",
"\n",
"}"
] |
23,443 | all-23444 | [
"Count",
"returns",
"the",
"number",
"of",
"rows",
"in",
"the",
"given",
"table",
"."
] | [
"func",
"Count",
"(",
"tx",
"*",
"sql",
".",
"Tx",
",",
"table",
"string",
",",
"where",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"int",
",",
"error",
")",
"{",
"stmt",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"table",
")",
"\n",
"if",
"where",
"!=",
"\"",
"\"",
"{",
"stmt",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"where",
")",
"\n",
"}",
"\n",
"rows",
",",
"err",
":=",
"tx",
".",
"Query",
"(",
"stmt",
",",
"args",
"...",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"err",
"\n",
"}",
"\n",
"defer",
"rows",
".",
"Close",
"(",
")",
"\n\n",
"// For sanity, make sure we read one and only one row.",
"if",
"!",
"rows",
".",
"Next",
"(",
")",
"{",
"return",
"-",
"1",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"var",
"count",
"int",
"\n",
"err",
"=",
"<mask>",
".",
"Scan",
"(",
"&",
"count",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"rows",
".",
"Next",
"(",
")",
"{",
"return",
"-",
"1",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"err",
"=",
"rows",
".",
"Err",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"count",
",",
"nil",
"\n",
"}"
] |
23,444 | all-23445 | [
"GetLabel",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_button_get_label",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Button",
")",
"GetLabel",
"(",
")",
"(",
"string",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gtk_button_get_label",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"return",
"goString",
"(",
"c",
")",
",",
"nil",
"\n",
"}"
] |
23,445 | all-23446 | [
"ToAST",
"demangles",
"a",
"C",
"++",
"symbol",
"name",
"into",
"an",
"abstract",
"syntax",
"tree",
"representing",
"the",
"symbol",
".",
"If",
"the",
"NoParams",
"option",
"is",
"passed",
"and",
"the",
"name",
"has",
"a",
"function",
"type",
"the",
"parameter",
"types",
"are",
"not",
"demangled",
".",
"If",
"the",
"name",
"does",
"not",
"appear",
"to",
"be",
"a",
"C",
"++",
"symbol",
"name",
"at",
"all",
"the",
"error",
"will",
"be",
"ErrNotMangledName",
"."
] | [
"func",
"ToAST",
"(",
"name",
"string",
",",
"options",
"...",
"Option",
")",
"(",
"AST",
",",
"error",
")",
"{",
"if",
"strings",
".",
"HasPrefix",
"(",
"name",
",",
"\"",
"\"",
")",
"{",
"a",
",",
"err",
":=",
"doDemangle",
"(",
"name",
"[",
"2",
":",
"]",
",",
"options",
"...",
")",
"\n",
"return",
"a",
",",
"adjustErr",
"(",
"err",
",",
"2",
")",
"\n",
"}",
"\n\n",
"const",
"prefix",
"=",
"\"",
"\"",
"\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"name",
",",
"<mask>",
")",
"{",
"// The standard demangler ignores NoParams for global",
"// constructors. We are compatible.",
"i",
":=",
"0",
"\n",
"for",
"i",
"<",
"len",
"(",
"options",
")",
"{",
"if",
"options",
"[",
"i",
"]",
"==",
"NoParams",
"{",
"options",
"=",
"append",
"(",
"options",
"[",
":",
"i",
"]",
",",
"options",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"}",
"else",
"{",
"i",
"++",
"\n",
"}",
"\n",
"}",
"\n",
"a",
",",
"err",
":=",
"globalCDtorName",
"(",
"name",
"[",
"len",
"(",
"prefix",
")",
":",
"]",
",",
"options",
"...",
")",
"\n",
"return",
"a",
",",
"adjustErr",
"(",
"err",
",",
"len",
"(",
"prefix",
")",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
",",
"ErrNotMangledName",
"\n",
"}"
] |
23,446 | all-23447 | [
"Status",
"returns",
"whether",
"the",
"maintenance",
"mode",
"is",
"enabled",
"."
] | [
"func",
"(",
"s",
"Service",
")",
"Status",
"(",
")",
"(",
"on",
"bool",
",",
"err",
"error",
")",
"{",
"return",
"s",
".",
"store",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
23,447 | all-23448 | [
"UnmarshalJSON",
"satisfies",
"json",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"VersionStatus",
")",
"UnmarshalJSON",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"error",
"{",
"return",
"easyjson",
".",
"Unmarshal",
"(",
"buf",
",",
"t",
")",
"\n",
"}"
] |
23,448 | all-23449 | [
"scoreAddr",
"scores",
"how",
"likely",
"the",
"given",
"addr",
"is",
"to",
"be",
"a",
"remote",
"address",
"and",
"returns",
"the",
"IP",
"to",
"use",
"when",
"listening",
".",
"Any",
"address",
"which",
"receives",
"a",
"negative",
"score",
"should",
"not",
"be",
"used",
".",
"Scores",
"are",
"calculated",
"as",
":",
"-",
"1",
"for",
"any",
"unknown",
"IP",
"addreseses",
".",
"+",
"300",
"for",
"IPv4",
"addresses",
"+",
"100",
"for",
"non",
"-",
"local",
"addresses",
"extra",
"+",
"100",
"for",
"up",
"interaces",
"."
] | [
"func",
"scoreAddr",
"(",
"iface",
"net",
".",
"Interface",
",",
"addr",
"net",
".",
"Addr",
")",
"(",
"int",
",",
"net",
".",
"IP",
")",
"{",
"var",
"ip",
"net",
".",
"IP",
"\n",
"if",
"netAddr",
",",
"ok",
":=",
"addr",
".",
"(",
"*",
"net",
".",
"IPNet",
")",
";",
"ok",
"{",
"ip",
"=",
"netAddr",
".",
"IP",
"\n",
"}",
"else",
"if",
"netIP",
",",
"ok",
":=",
"addr",
".",
"(",
"*",
"net",
".",
"IPAddr",
")",
";",
"ok",
"{",
"ip",
"=",
"netIP",
".",
"IP",
"\n",
"}",
"else",
"{",
"return",
"-",
"1",
",",
"nil",
"\n",
"}",
"\n\n",
"var",
"score",
"int",
"\n",
"if",
"ip",
".",
"To4",
"(",
")",
"!=",
"nil",
"{",
"score",
"+=",
"300",
"\n",
"}",
"\n",
"if",
"iface",
".",
"Flags",
"&",
"net",
".",
"FlagLoopback",
"==",
"0",
"&&",
"!",
"ip",
".",
"IsLoopback",
"(",
")",
"{",
"<mask>",
"+=",
"100",
"\n",
"if",
"iface",
".",
"Flags",
"&",
"net",
".",
"FlagUp",
"!=",
"0",
"{",
"score",
"+=",
"100",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"isLocalMacAddr",
"(",
"iface",
".",
"HardwareAddr",
")",
"{",
"score",
"-=",
"50",
"\n",
"}",
"\n",
"return",
"score",
",",
"ip",
"\n",
"}"
] |
23,449 | all-23450 | [
"MutatePayment",
"for",
"Destination",
"sets",
"the",
"PaymentOp",
"s",
"Destination",
"field"
] | [
"func",
"(",
"m",
"Destination",
")",
"MutatePayment",
"(",
"o",
"<mask>",
"{",
"}",
")",
"error",
"{",
"switch",
"o",
":=",
"o",
".",
"(",
"type",
")",
"{",
"default",
":",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"case",
"*",
"xdr",
".",
"PaymentOp",
":",
"return",
"setAccountId",
"(",
"m",
".",
"AddressOrSeed",
",",
"&",
"o",
".",
"Destination",
")",
"\n",
"case",
"*",
"xdr",
".",
"PathPaymentOp",
":",
"return",
"setAccountId",
"(",
"m",
".",
"AddressOrSeed",
",",
"&",
"o",
".",
"Destination",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
23,450 | all-23451 | [
"Do",
"executes",
"DOMDebugger",
".",
"getEventListeners",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"listeners",
"-",
"Array",
"of",
"relevant",
"listeners",
"."
] | [
"func",
"(",
"p",
"*",
"GetEventListenersParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"listeners",
"[",
"]",
"*",
"EventListener",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"GetEventListenersReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandGetEventListeners",
",",
"p",
",",
"&",
"res",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"res",
".",
"Listeners",
",",
"nil",
"\n",
"}"
] |
23,451 | all-23452 | [
"SetBSON",
"sets",
"the",
"UUID",
"from",
"raw",
"bson",
"data"
] | [
"func",
"(",
"u",
"*",
"UUID",
")",
"SetBSON",
"(",
"raw",
"bson",
".",
"Raw",
")",
"error",
"{",
"var",
"m",
"bson",
".",
"M",
"\n",
"if",
"err",
":=",
"<mask>",
".",
"Unmarshal",
"(",
"&",
"m",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"data",
",",
"ok",
":=",
"m",
"[",
"\"",
"\"",
"]",
".",
"(",
"string",
")",
";",
"ok",
"{",
"*",
"u",
"=",
"UUID",
"(",
"data",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n\n",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}"
] |
23,452 | all-23453 | [
"TODO",
":",
"is",
"it",
"okay",
"to",
"cast",
"c",
".",
"Conn",
"()",
".",
"RemotePeer",
"()",
"into",
"a",
"multiaddr?",
"might",
"be",
"user",
"input"
] | [
"func",
"(",
"c",
"*",
"Conn",
")",
"RemoteMultiaddr",
"(",
")",
"ma",
".",
"Multiaddr",
"{",
"proto",
":=",
"ma",
".",
"ProtocolWithCode",
"(",
"ma",
".",
"P_P2P",
")",
".",
"<mask>",
"\n",
"peerid",
":=",
"c",
".",
"Conn",
"(",
")",
".",
"RemotePeer",
"(",
")",
".",
"Pretty",
"(",
")",
"\n",
"p2paddr",
":=",
"ma",
".",
"StringCast",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"proto",
",",
"peerid",
")",
")",
"\n\n",
"circaddr",
":=",
"ma",
".",
"Cast",
"(",
"ma",
".",
"CodeToVarint",
"(",
"P_CIRCUIT",
")",
")",
"\n",
"return",
"p2paddr",
".",
"Encapsulate",
"(",
"circaddr",
")",
"\n",
"}"
] |
23,453 | all-23454 | [
"SavedVimSessionOrNew",
"either",
"loads",
"a",
"saved",
"SOAP",
"session",
"from",
"disk",
"or",
"creates",
"a",
"new",
"one",
"."
] | [
"func",
"(",
"c",
"*",
"Config",
")",
"SavedVimSessionOrNew",
"(",
"u",
"*",
"url",
".",
"URL",
")",
"(",
"*",
"govmomi",
".",
"Client",
",",
"error",
")",
"{",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"defaultAPITimeout",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n\n",
"client",
",",
"err",
":=",
"c",
".",
"LoadVimClient",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"client",
"==",
"nil",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"c",
".",
"VSphereServer",
")",
"\n",
"<mask>",
",",
"err",
"=",
"govmomi",
".",
"NewClient",
"(",
"ctx",
",",
"u",
",",
"c",
".",
"InsecureFlag",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"log",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"client",
",",
"nil",
"\n",
"}"
] |
23,454 | all-23455 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"ContinueRequestParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch13",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
23,455 | all-23456 | [
"GetSupportSelection",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_operation_get_support_selection",
"()",
"."
] | [
"func",
"(",
"po",
"*",
"PrintOperation",
")",
"GetSupportSelection",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_print_operation_get_support_selection",
"(",
"<mask>",
".",
"native",
"(",
")",
")",
"\n",
"return",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
23,456 | all-23457 | [
"SetPageComplete",
"is",
"a",
"wrapper",
"around",
"gtk_assistant_set_page_complete",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Assistant",
")",
"SetPageComplete",
"(",
"page",
"IWidget",
",",
"complete",
"bool",
")",
"{",
"C",
".",
"gtk_assistant_set_page_complete",
"(",
"v",
".",
"native",
"(",
")",
",",
"page",
".",
"toWidget",
"(",
")",
",",
"gbool",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
23,457 | all-23458 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetDeviceOrientationOverrideParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceorientation",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
23,458 | all-23459 | [
"SimpleActionNew",
"is",
"a",
"wrapper",
"around",
"g_simple_action_new"
] | [
"func",
"SimpleActionNew",
"(",
"name",
"string",
",",
"parameterType",
"*",
"VariantType",
")",
"*",
"SimpleAction",
"{",
"c",
":=",
"C",
".",
"g_simple_action_new",
"(",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"C",
".",
"CString",
"(",
"<mask>",
")",
")",
",",
"parameterType",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"wrapSimpleAction",
"(",
"wrapObject",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
")",
"\n",
"}"
] |
23,459 | all-23460 | [
"IsUserNotFound",
"returns",
"true",
"if",
"the",
"error",
"means",
"user",
"not",
"found",
"of",
"v2",
"API",
"."
] | [
"func",
"IsUserNotFound",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"ae",
",",
"ok",
":=",
"err",
".",
"(",
"authError",
")",
";",
"<mask>",
"{",
"return",
"userNotFoundRegExp",
".",
"MatchString",
"(",
"ae",
".",
"Message",
")",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
] |
23,460 | all-23461 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"ReloadParams",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage21",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
23,461 | all-23462 | [
"NewExpiringCountIndex",
"creates",
"an",
"index",
"which",
"maintains",
"an",
"expiring",
"counter",
"for",
"each",
"cell",
"."
] | [
"func",
"NewExpiringCountIndex",
"(",
"resolution",
"Meters",
",",
"expiration",
"Minutes",
")",
"*",
"CountIndex",
"{",
"newExpiringCounter",
":=",
"func",
"(",
")",
"interface",
"{",
"}",
"{",
"return",
"newExpiringCounter",
"(",
"expiration",
")",
"\n",
"}",
"\n\n",
"return",
"&",
"CountIndex",
"{",
"newGeoIndex",
"(",
"resolution",
",",
"newExpiringCounter",
")",
",",
"make",
"(",
"<mask>",
"[",
"string",
"]",
"Point",
")",
"}",
"\n",
"}"
] |
23,462 | all-23463 | [
"Appender",
"returns",
"a",
"new",
"appender",
"against",
"the",
"storage",
"."
] | [
"func",
"(",
"a",
"adapter",
")",
"Appender",
"(",
")",
"(",
"storage",
".",
"Appender",
",",
"error",
")",
"{",
"return",
"appender",
"{",
"a",
":",
"a",
".",
"<mask>",
".",
"Appender",
"(",
")",
"}",
",",
"nil",
"\n",
"}"
] |
23,463 | all-23464 | [
"HasShowDistribution",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TraceServiceDefinition",
")",
"HasShowDistribution",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"ShowDistribution",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
23,464 | all-23465 | [
"AddUsersToGroup",
"adds",
"the",
"members",
"to",
"a",
"group",
"."
] | [
"func",
"AddUsersToGroup",
"(",
"name",
"string",
",",
"members",
"...",
"string",
")",
"error",
"{",
"if",
"len",
"(",
"members",
")",
"==",
"0",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"for",
"i",
",",
"v",
":=",
"range",
"members",
"{",
"if",
"v",
"==",
"\"",
"\"",
"{",
"return",
"EmptyMemberError",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strconv",
".",
"Itoa",
"(",
"i",
")",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Group",
"gr",
",",
"err",
":=",
"LookupGroup",
"(",
"name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"err",
"=",
"_addMembers",
"(",
"&",
"gr",
".",
"UserList",
",",
"members",
"...",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Shadow group",
"sg",
",",
"err",
":=",
"LookupGShadow",
"(",
"name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"err",
"=",
"_addMembers",
"(",
"&",
"sg",
".",
"UserList",
",",
"members",
"...",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Editing",
"if",
"err",
"=",
"edit",
"(",
"name",
",",
"gr",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"err",
"=",
"edit",
"(",
"<mask>",
",",
"sg",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
23,465 | all-23466 | [
"NewStreamEncoder",
"returns",
"a",
"new",
"stream",
"encoder",
"that",
"outputs",
"to",
"w",
"."
] | [
"func",
"(",
"c",
"Codec",
")",
"NewStreamEncoder",
"(",
"w",
"io",
".",
"<mask>",
")",
"*",
"StreamEncoder",
"{",
"return",
"NewStreamEncoder",
"(",
"c",
".",
"NewEmitter",
"(",
"w",
")",
")",
"\n",
"}"
] |
23,466 | all-23467 | [
"Match",
"find",
"schema",
"for",
"metric"
] | [
"func",
"(",
"a",
"*",
"WhisperAggregation",
")",
"match",
"(",
"metric",
"string",
")",
"*",
"whisperAggregationItem",
"{",
"for",
"_",
",",
"s",
":=",
"range",
"a",
".",
"Data",
"{",
"if",
"s",
".",
"pattern",
".",
"MatchString",
"(",
"metric",
")",
"{",
"return",
"s",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"a",
".",
"<mask>",
"\n",
"}"
] |
23,467 | all-23468 | [
"NewAPIServer",
"creates",
"an",
"APIServer",
"."
] | [
"func",
"NewAPIServer",
"(",
"env",
"*",
"serviceenv",
".",
"ServiceEnv",
",",
"etcdPrefix",
"<mask>",
",",
"treeCache",
"*",
"hashtree",
".",
"Cache",
",",
"storageRoot",
"string",
",",
"memoryRequest",
"int64",
")",
"(",
"APIServer",
",",
"error",
")",
"{",
"return",
"newAPIServer",
"(",
"env",
",",
"etcdPrefix",
",",
"treeCache",
",",
"storageRoot",
",",
"memoryRequest",
")",
"\n",
"}"
] |
23,468 | all-23469 | [
"GetWidthChars",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_entry_get_width_chars",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"GetWidthChars",
"(",
")",
"int",
"{",
"c",
":=",
"C",
".",
"gtk_entry_get_width_chars",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"return",
"int",
"(",
"c",
")",
"\n",
"}"
] |
23,469 | all-23470 | [
"/",
"*",
"Set1D",
"sets",
"a",
"particular",
"element",
"in",
"the",
"image"
] | [
"func",
"(",
"img",
"*",
"IplImage",
")",
"Set1D",
"(",
"x",
"int",
",",
"<mask>",
"Scalar",
")",
"{",
"C",
".",
"cvSet1D",
"(",
"unsafe",
".",
"Pointer",
"(",
"img",
")",
",",
"C",
".",
"int",
"(",
"x",
")",
",",
"(",
"C",
".",
"CvScalar",
")",
"(",
"value",
")",
")",
"\n",
"}"
] |
23,470 | all-23471 | [
"GetActive",
"is",
"a",
"wrapper",
"around",
"gtk_switch_get_active",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Switch",
")",
"GetActive",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_switch_get_active",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
23,471 | all-23472 | [
"GetGroup",
"returns",
"the",
"Group",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"GetGroup",
"(",
")",
"string",
"{",
"if",
"w",
"==",
"nil",
"||",
"w",
".",
"Group",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"w",
".",
"<mask>",
"\n",
"}"
] |
23,472 | all-23473 | [
"NetworkConfigClear",
"resets",
"the",
"config",
"of",
"the",
"network",
"with",
"the",
"given",
"ID",
"associated",
"with",
"the",
"node",
"with",
"the",
"given",
"ID",
"."
] | [
"func",
"NetworkConfigClear",
"(",
"tx",
"*",
"sql",
".",
"Tx",
",",
"networkID",
",",
"nodeID",
"int64",
")",
"error",
"{",
"_",
",",
"err",
":=",
"<mask>",
".",
"Exec",
"(",
"\"",
"\"",
",",
"networkID",
",",
"nodeID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
23,473 | all-23474 | [
"NewStringArena",
"creates",
"an",
"arena",
"of",
"the",
"specified",
"size",
"."
] | [
"func",
"NewStringArena",
"(",
"size",
"int",
")",
"*",
"StringArena",
"{",
"sa",
":=",
"&",
"StringArena",
"{",
"buf",
":",
"<mask>",
"(",
"[",
"]",
"byte",
",",
"0",
",",
"size",
")",
"}",
"\n",
"pbytes",
":=",
"(",
"*",
"reflect",
".",
"SliceHeader",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"&",
"sa",
".",
"buf",
")",
")",
"\n",
"pstring",
":=",
"(",
"*",
"reflect",
".",
"StringHeader",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"&",
"sa",
".",
"str",
")",
")",
"\n",
"pstring",
".",
"Data",
"=",
"pbytes",
".",
"Data",
"\n",
"pstring",
".",
"Len",
"=",
"pbytes",
".",
"Cap",
"\n",
"return",
"sa",
"\n",
"}"
] |
23,474 | all-23475 | [
"ReleaseApplicationLock",
"releases",
"a",
"lock",
"hold",
"on",
"an",
"app",
"currently",
"it",
"s",
"called",
"by",
"a",
"middleware",
"however",
"ideally",
"it",
"should",
"be",
"called",
"individually",
"by",
"each",
"handler",
"since",
"they",
"might",
"be",
"doing",
"operations",
"in",
"background",
"."
] | [
"func",
"ReleaseApplicationLock",
"(",
"appName",
"string",
")",
"{",
"var",
"err",
"error",
"\n",
"retries",
":=",
"3",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"retries",
";",
"i",
"++",
"{",
"err",
"=",
"releaseApplicationLockOnce",
"(",
"appName",
")",
"\n",
"if",
"err",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"time",
".",
"Sleep",
"(",
"<mask>",
".",
"Second",
"*",
"time",
".",
"Duration",
"(",
"i",
"+",
"1",
")",
")",
"\n",
"}",
"\n",
"log",
".",
"Error",
"(",
"err",
")",
"\n",
"}"
] |
23,475 | all-23476 | [
"AllowUnexported",
"returns",
"an",
"Option",
"that",
"forcibly",
"allows",
"operations",
"on",
"unexported",
"fields",
"in",
"certain",
"structs",
"which",
"are",
"specified",
"by",
"passing",
"in",
"a",
"value",
"of",
"each",
"struct",
"type",
".",
"Users",
"of",
"this",
"option",
"must",
"understand",
"that",
"comparing",
"on",
"unexported",
"fields",
"from",
"external",
"packages",
"is",
"not",
"safe",
"since",
"changes",
"in",
"the",
"internal",
"implementation",
"of",
"some",
"external",
"package",
"may",
"cause",
"the",
"result",
"of",
"Equal",
"to",
"unexpectedly",
"change",
".",
"However",
"it",
"may",
"be",
"valid",
"to",
"use",
"this",
"option",
"on",
"types",
"defined",
"in",
"an",
"internal",
"package",
"where",
"the",
"semantic",
"meaning",
"of",
"an",
"unexported",
"field",
"is",
"in",
"the",
"control",
"of",
"the",
"user",
".",
"In",
"many",
"cases",
"a",
"custom",
"Comparer",
"should",
"be",
"used",
"instead",
"that",
"defines",
"equality",
"as",
"a",
"function",
"of",
"the",
"public",
"API",
"of",
"a",
"type",
"rather",
"than",
"the",
"underlying",
"unexported",
"implementation",
".",
"For",
"example",
"the",
"reflect",
".",
"Type",
"documentation",
"defines",
"equality",
"to",
"be",
"determined",
"by",
"the",
"==",
"operator",
"on",
"the",
"interface",
"(",
"essentially",
"performing",
"a",
"shallow",
"pointer",
"comparison",
")",
"and",
"most",
"attempts",
"to",
"compare",
"*",
"regexp",
".",
"Regexp",
"types",
"are",
"interested",
"in",
"only",
"checking",
"that",
"the",
"regular",
"expression",
"strings",
"are",
"equal",
".",
"Both",
"of",
"these",
"are",
"accomplished",
"using",
"Comparers",
":",
"Comparer",
"(",
"func",
"(",
"x",
"y",
"reflect",
".",
"Type",
")",
"bool",
"{",
"return",
"x",
"==",
"y",
"}",
")",
"Comparer",
"(",
"func",
"(",
"x",
"y",
"*",
"regexp",
".",
"Regexp",
")",
"bool",
"{",
"return",
"x",
".",
"String",
"()",
"==",
"y",
".",
"String",
"()",
"}",
")",
"In",
"other",
"cases",
"the",
"cmpopts",
".",
"IgnoreUnexported",
"option",
"can",
"be",
"used",
"to",
"ignore",
"all",
"unexported",
"fields",
"on",
"specified",
"struct",
"types",
"."
] | [
"func",
"AllowUnexported",
"(",
"types",
"...",
"interface",
"{",
"}",
")",
"Option",
"{",
"if",
"!",
"supportAllowUnexported",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"m",
":=",
"make",
"(",
"map",
"[",
"reflect",
".",
"Type",
"]",
"bool",
")",
"\n",
"for",
"_",
",",
"typ",
":=",
"range",
"<mask>",
"{",
"t",
":=",
"reflect",
".",
"TypeOf",
"(",
"typ",
")",
"\n",
"if",
"t",
".",
"Kind",
"(",
")",
"!=",
"reflect",
".",
"Struct",
"{",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"typ",
")",
")",
"\n",
"}",
"\n",
"m",
"[",
"t",
"]",
"=",
"true",
"\n",
"}",
"\n",
"return",
"visibleStructs",
"(",
"m",
")",
"\n",
"}"
] |
23,476 | all-23477 | [
"DeepCopyInto",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"writing",
"into",
"out",
".",
"in",
"must",
"be",
"non",
"-",
"nil",
"."
] | [
"func",
"(",
"in",
"*",
"ProwJobList",
")",
"DeepCopyInto",
"(",
"out",
"*",
"ProwJobList",
")",
"{",
"*",
"out",
"=",
"*",
"<mask>",
"\n",
"out",
".",
"TypeMeta",
"=",
"in",
".",
"TypeMeta",
"\n",
"out",
".",
"ListMeta",
"=",
"in",
".",
"ListMeta",
"\n",
"if",
"in",
".",
"Items",
"!=",
"nil",
"{",
"in",
",",
"out",
":=",
"&",
"in",
".",
"Items",
",",
"&",
"out",
".",
"Items",
"\n",
"*",
"out",
"=",
"make",
"(",
"[",
"]",
"ProwJob",
",",
"len",
"(",
"*",
"in",
")",
")",
"\n",
"for",
"i",
":=",
"range",
"*",
"in",
"{",
"(",
"*",
"in",
")",
"[",
"i",
"]",
".",
"DeepCopyInto",
"(",
"&",
"(",
"*",
"out",
")",
"[",
"i",
"]",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
23,477 | all-23478 | [
"GetState",
"returns",
"the",
"state",
"that",
"the",
"host",
"is",
"in",
"(",
"running",
"stopped",
"etc",
")"
] | [
"func",
"(",
"d",
"*",
"SerialDriver",
")",
"GetState",
"(",
")",
"(",
"<mask>",
".",
"State",
",",
"error",
")",
"{",
"d",
".",
"Lock",
"(",
")",
"\n",
"defer",
"d",
".",
"Unlock",
"(",
")",
"\n",
"return",
"d",
".",
"Driver",
".",
"GetState",
"(",
")",
"\n",
"}"
] |
23,478 | all-23479 | [
"/",
"*",
"As",
"near",
"as",
"I",
"can",
"tell",
"there",
"is",
"no",
"nice",
"way",
"of",
"extracting",
"an",
"underlying",
"net",
".",
"Conn",
"(",
"or",
"in",
"our",
"case",
"net",
".",
"UnixConn",
")",
"from",
"an",
"http",
".",
"Request",
"or",
"ResponseWriter",
"without",
"hijacking",
"it",
"[",
"1",
"]",
".",
"Since",
"we",
"want",
"to",
"send",
"and",
"receive",
"unix",
"creds",
"to",
"figure",
"out",
"which",
"container",
"this",
"request",
"came",
"from",
"we",
"need",
"to",
"do",
"this",
".",
"[",
"1",
"]",
":",
"https",
":",
"//",
"groups",
".",
"google",
".",
"com",
"/",
"forum",
"/",
"#!topic",
"/",
"golang",
"-",
"nuts",
"/",
"_FWdFXJa6QA"
] | [
"func",
"extractUnderlyingConn",
"(",
"w",
"http",
".",
"ResponseWriter",
")",
"*",
"net",
".",
"UnixConn",
"{",
"v",
":=",
"reflect",
".",
"Indirect",
"(",
"reflect",
".",
"ValueOf",
"(",
"w",
")",
")",
"\n",
"connPtr",
":=",
"v",
".",
"FieldByName",
"(",
"\"",
"\"",
")",
"\n",
"conn",
":=",
"reflect",
".",
"Indirect",
"(",
"connPtr",
")",
"\n",
"rwc",
":=",
"conn",
".",
"FieldByName",
"(",
"\"",
"\"",
")",
"\n\n",
"netConnPtr",
":=",
"(",
"*",
"<mask>",
".",
"Conn",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"rwc",
".",
"UnsafeAddr",
"(",
")",
")",
")",
"\n",
"unixConnPtr",
":=",
"(",
"*",
"netConnPtr",
")",
".",
"(",
"*",
"net",
".",
"UnixConn",
")",
"\n\n",
"return",
"unixConnPtr",
"\n",
"}"
] |
23,479 | all-23480 | [
"CellRendererPixbufNew",
"is",
"a",
"wrapper",
"around",
"gtk_cell_renderer_pixbuf_new",
"()",
"."
] | [
"func",
"CellRendererPixbufNew",
"(",
")",
"(",
"*",
"CellRendererPixbuf",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gtk_cell_renderer_pixbuf_new",
"(",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"obj",
":=",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"\n",
"return",
"wrapCellRendererPixbuf",
"(",
"obj",
")",
",",
"nil",
"\n",
"}"
] |
23,480 | all-23481 | [
"Compare",
"function",
"compares",
"node",
"index",
"and",
"value",
"with",
"provided",
"ones",
".",
"second",
"result",
"value",
"explains",
"result",
"and",
"equals",
"to",
"one",
"of",
"Compare",
"..",
"constants"
] | [
"func",
"(",
"n",
"*",
"node",
")",
"Compare",
"(",
"prevValue",
"string",
",",
"prevIndex",
"uint64",
")",
"(",
"ok",
"bool",
",",
"which",
"int",
")",
"{",
"indexMatch",
":=",
"prevIndex",
"==",
"0",
"||",
"n",
".",
"ModifiedIndex",
"==",
"prevIndex",
"\n",
"valueMatch",
":=",
"prevValue",
"==",
"\"",
"\"",
"||",
"n",
".",
"Value",
"==",
"prevValue",
"\n",
"ok",
"=",
"valueMatch",
"&&",
"indexMatch",
"\n",
"<mask>",
"{",
"case",
"valueMatch",
"&&",
"indexMatch",
":",
"which",
"=",
"CompareMatch",
"\n",
"case",
"indexMatch",
"&&",
"!",
"valueMatch",
":",
"which",
"=",
"CompareValueNotMatch",
"\n",
"case",
"valueMatch",
"&&",
"!",
"indexMatch",
":",
"which",
"=",
"CompareIndexNotMatch",
"\n",
"default",
":",
"which",
"=",
"CompareNotMatch",
"\n",
"}",
"\n",
"return",
"ok",
",",
"which",
"\n",
"}"
] |
23,481 | all-23482 | [
"From",
"creates",
"a",
"new",
"context",
"based",
"on",
"ctx",
".",
"See",
"the",
"Context",
"example",
"."
] | [
"func",
"From",
"(",
"ctx",
"context",
".",
"Context",
")",
"Context",
"{",
"if",
"c",
",",
"ok",
":=",
"ctx",
".",
"(",
"Context",
")",
";",
"<mask>",
"{",
"return",
"c",
"\n",
"}",
"\n",
"return",
"&",
"contextT",
"{",
"ctx",
":",
"ctx",
"}",
"\n",
"}"
] |
23,482 | all-23483 | [
"expandClusterOrchestrationInfo",
"reads",
"certain",
"ResourceData",
"keys",
"and",
"returns",
"a",
"ClusterOrchestrationInfo",
"."
] | [
"func",
"expandClusterOrchestrationInfo",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
")",
"*",
"<mask>",
".",
"ClusterOrchestrationInfo",
"{",
"obj",
":=",
"&",
"types",
".",
"ClusterOrchestrationInfo",
"{",
"DefaultVmReadiness",
":",
"&",
"types",
".",
"ClusterVmReadiness",
"{",
"PostReadyDelay",
":",
"int32",
"(",
"d",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"int",
")",
")",
",",
"ReadyCondition",
":",
"d",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"string",
")",
",",
"}",
",",
"}",
"\n\n",
"return",
"obj",
"\n",
"}"
] |
23,483 | all-23484 | [
"SetVolumes",
"sets",
"the",
"volumes",
"mounted",
"in",
"a",
"container"
] | [
"func",
"(",
"c",
"*",
"Container",
")",
"SetVolumes",
"(",
"volumes",
"[",
"]",
"types",
".",
"MountPoint",
")",
"{",
"c",
".",
"<mask>",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
"c",
".",
"VolumesUnsafe",
"=",
"volumes",
"\n",
"}"
] |
23,484 | all-23485 | [
"title",
":",
"list",
"units",
"by",
"node",
"path",
":",
"/",
"{",
"provisioner",
"}",
"/",
"node",
"/",
"{",
"address",
"}",
"/",
"containers",
"method",
":",
"GET",
"produce",
":",
"application",
"/",
"json",
"responses",
":",
"200",
":",
"Ok",
"204",
":",
"No",
"content",
"401",
":",
"Unauthorized",
"404",
":",
"Not",
"found"
] | [
"func",
"listUnitsByNode",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"t",
"auth",
".",
"Token",
")",
"error",
"{",
"address",
":=",
"r",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"_",
",",
"node",
",",
"err",
":=",
"node",
".",
"FindNode",
"(",
"address",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"err",
"==",
"provision",
".",
"ErrNodeNotFound",
"{",
"return",
"&",
"tsuruErrors",
".",
"HTTP",
"{",
"Code",
":",
"<mask>",
".",
"StatusNotFound",
",",
"Message",
":",
"err",
".",
"Error",
"(",
")",
",",
"}",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"hasAccess",
":=",
"permission",
".",
"Check",
"(",
"t",
",",
"permission",
".",
"PermNodeRead",
",",
"permission",
".",
"Context",
"(",
"permTypes",
".",
"CtxPool",
",",
"node",
".",
"Pool",
"(",
")",
")",
")",
"\n",
"if",
"!",
"hasAccess",
"{",
"return",
"permission",
".",
"ErrUnauthorized",
"\n",
"}",
"\n",
"units",
",",
"err",
":=",
"node",
".",
"Units",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"len",
"(",
"units",
")",
"==",
"0",
"{",
"w",
".",
"WriteHeader",
"(",
"http",
".",
"StatusNoContent",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"w",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"json",
".",
"NewEncoder",
"(",
"w",
")",
".",
"Encode",
"(",
"units",
")",
"\n",
"}"
] |
23,485 | all-23486 | [
"String",
"helpers"
] | [
"func",
"(",
"info",
"CONSOLE_SCREEN_BUFFER_INFO",
")",
"String",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"info",
".",
"Size",
",",
"<mask>",
".",
"CursorPosition",
",",
"info",
".",
"Window",
",",
"info",
".",
"MaximumWindowSize",
")",
"\n",
"}"
] |
23,486 | all-23487 | [
"SignRequest",
"will",
"add",
"an",
"Authorization",
"header"
] | [
"func",
"(",
"c",
"*",
"Credentials",
")",
"SignRequest",
"(",
"req",
"*",
"http",
".",
"Request",
")",
"(",
"err",
"error",
")",
"{",
"// s, err := c.SignHeader(req.Method, req.URL.String(), hash)",
"// req.Header.Set(\"Authorization\", s)",
"// return err",
"credentials",
":=",
"&",
"hawk",
".",
"Credentials",
"{",
"ID",
":",
"c",
".",
"ClientID",
",",
"Key",
":",
"c",
".",
"AccessToken",
",",
"Hash",
":",
"sha256",
".",
"New",
",",
"}",
"\n",
"reqAuth",
":=",
"hawk",
".",
"NewRequestAuth",
"(",
"req",
",",
"credentials",
",",
"0",
")",
"\n",
"reqAuth",
".",
"Ext",
",",
"err",
"=",
"getExtHeader",
"(",
"c",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\\n",
"\\n",
"\"",
",",
"c",
",",
"err",
")",
"\n",
"}",
"\n",
"req",
".",
"<mask>",
".",
"Set",
"(",
"\"",
"\"",
",",
"reqAuth",
".",
"RequestHeader",
"(",
")",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
23,487 | all-23488 | [
"MarshalEasyJSON",
"writes",
"the",
"ISBN13",
"to",
"a",
"easyjson",
".",
"Writer"
] | [
"func",
"(",
"u",
"ISBN13",
")",
"MarshalEasyJSON",
"(",
"w",
"*",
"jwriter",
".",
"<mask>",
")",
"{",
"w",
".",
"String",
"(",
"string",
"(",
"u",
")",
")",
"\n",
"}"
] |
23,488 | all-23489 | [
"UnmarshalJSON",
"overrides",
"the",
"logic",
"for",
"parsing",
"the",
"JSON",
"-",
"encoded",
"ResourceStatus",
"data"
] | [
"func",
"(",
"as",
"*",
"ASMAuthStatus",
")",
"UnmarshalJSON",
"(",
"b",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"strings",
".",
"ToLower",
"(",
"string",
"(",
"b",
")",
")",
"==",
"\"",
"\"",
"{",
"*",
"<mask>",
"=",
"ASMAuthStatusNone",
"\n",
"return",
"nil",
"\n",
"}",
"\n\n",
"if",
"b",
"[",
"0",
"]",
"!=",
"'\"'",
"||",
"b",
"[",
"len",
"(",
"b",
")",
"-",
"1",
"]",
"!=",
"'\"'",
"{",
"*",
"as",
"=",
"ASMAuthStatusNone",
"\n",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
"+",
"string",
"(",
"b",
")",
")",
"\n",
"}",
"\n\n",
"strStatus",
":=",
"string",
"(",
"b",
"[",
"1",
":",
"len",
"(",
"b",
")",
"-",
"1",
"]",
")",
"\n",
"stat",
",",
"ok",
":=",
"asmAuthStatusMap",
"[",
"strStatus",
"]",
"\n",
"if",
"!",
"ok",
"{",
"*",
"as",
"=",
"ASMAuthStatusNone",
"\n",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"*",
"as",
"=",
"stat",
"\n",
"return",
"nil",
"\n",
"}"
] |
23,489 | all-23490 | [
"GetStatus",
"returns",
"the",
"Status",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"g",
"*",
"GroupData",
")",
"GetStatus",
"(",
")",
"string",
"{",
"if",
"g",
"==",
"nil",
"||",
"g",
".",
"<mask>",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"g",
".",
"Status",
"\n",
"}"
] |
23,490 | all-23491 | [
"LayerInfosForCopy",
"()",
"returns",
"updated",
"layer",
"info",
"that",
"should",
"be",
"used",
"when",
"copying",
"in",
"preference",
"to",
"values",
"in",
"the",
"manifest",
"if",
"specified",
"."
] | [
"func",
"(",
"s",
"*",
"dirImageSource",
")",
"LayerInfosForCopy",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"[",
"]",
"<mask>",
".",
"BlobInfo",
",",
"error",
")",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}"
] |
23,491 | all-23492 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"EventChildNodeRemoved",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom63",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
23,492 | all-23493 | [
"Lookup",
"finds",
"the",
"OUI",
"the",
"address",
"belongs",
"to"
] | [
"func",
"(",
"m",
"*",
"OuiDb",
")",
"Lookup",
"(",
"address",
"HardwareAddr",
")",
"*",
"AddressBlock",
"{",
"for",
"_",
",",
"<mask>",
":=",
"range",
"m",
".",
"Blocks",
"{",
"if",
"block",
".",
"Contains",
"(",
"address",
")",
"{",
"return",
"&",
"block",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
23,493 | all-23494 | [
"NewKey",
"creates",
"a",
"new",
"key",
".",
"kind",
"cannot",
"be",
"empty",
".",
"Either",
"one",
"or",
"both",
"of",
"stringID",
"and",
"intID",
"must",
"be",
"zero",
".",
"If",
"both",
"are",
"zero",
"the",
"key",
"returned",
"is",
"incomplete",
".",
"parent",
"must",
"either",
"be",
"a",
"complete",
"key",
"or",
"nil",
"."
] | [
"func",
"NewKey",
"(",
"c",
"context",
".",
"Context",
",",
"kind",
",",
"stringID",
"string",
",",
"intID",
"int64",
",",
"parent",
"*",
"Key",
")",
"*",
"Key",
"{",
"// If there's a parent key, use its namespace.",
"// Otherwise, use any namespace attached to the context.",
"var",
"namespace",
"string",
"\n",
"if",
"parent",
"!=",
"nil",
"{",
"namespace",
"=",
"parent",
".",
"namespace",
"\n",
"}",
"else",
"{",
"namespace",
"=",
"internal",
".",
"NamespaceFromContext",
"(",
"c",
")",
"\n",
"}",
"\n\n",
"return",
"&",
"<mask>",
"{",
"kind",
":",
"kind",
",",
"stringID",
":",
"stringID",
",",
"intID",
":",
"intID",
",",
"parent",
":",
"parent",
",",
"appID",
":",
"internal",
".",
"FullyQualifiedAppID",
"(",
"c",
")",
",",
"namespace",
":",
"namespace",
",",
"}",
"\n",
"}"
] |
23,494 | all-23495 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"CustomPreview",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime43",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
23,495 | all-23496 | [
"logDir",
"if",
"non",
"-",
"empty",
"write",
"log",
"files",
"to",
"this",
"directory",
"."
] | [
"func",
"(",
"l",
"*",
"Log",
")",
"SetLogDir",
"(",
"logDir",
"string",
")",
"{",
"if",
"logDir",
"!=",
"\"",
"\"",
"{",
"l",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"l",
".",
"logDirs",
"=",
"<mask>",
"(",
"[",
"]",
"string",
"{",
"logDir",
"}",
",",
"l",
".",
"logDirs",
"...",
")",
"\n",
"}",
"\n",
"}"
] |
23,496 | all-23497 | [
"RouteLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] | [
"func",
"(",
"api",
"*",
"API",
")",
"RouteLocator",
"(",
"href",
"<mask>",
")",
"*",
"RouteLocator",
"{",
"return",
"&",
"RouteLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
23,497 | all-23498 | [
"SetSchemeBytes",
"sets",
"URI",
"scheme",
"i",
".",
"e",
".",
"http",
"https",
"ftp",
"etc",
"."
] | [
"func",
"(",
"u",
"*",
"URI",
")",
"SetSchemeBytes",
"(",
"scheme",
"[",
"]",
"<mask>",
")",
"{",
"u",
".",
"scheme",
"=",
"append",
"(",
"u",
".",
"scheme",
"[",
":",
"0",
"]",
",",
"scheme",
"...",
")",
"\n",
"lowercaseBytes",
"(",
"u",
".",
"scheme",
")",
"\n",
"}"
] |
23,498 | all-23499 | [
"Call",
"makes",
"a",
"call",
"to",
"the",
"given",
"hostPort",
"with",
"the",
"given",
"arguments",
"and",
"returns",
"the",
"response",
"args",
"."
] | [
"func",
"Call",
"(",
"ctx",
"context",
".",
"Context",
",",
"ch",
"*",
"tchannel",
".",
"Channel",
",",
"hostPort",
"string",
",",
"serviceName",
",",
"method",
"string",
",",
"arg2",
",",
"arg3",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"[",
"]",
"byte",
",",
"*",
"tchannel",
".",
"OutboundCallResponse",
",",
"error",
")",
"{",
"<mask>",
",",
"err",
":=",
"ch",
".",
"BeginCall",
"(",
"ctx",
",",
"hostPort",
",",
"serviceName",
",",
"method",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"nil",
",",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"WriteArgs",
"(",
"call",
",",
"arg2",
",",
"arg3",
")",
"\n",
"}"
] |
23,499 | all-23500 | [
"NewMockSSMClientCreator",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockSSMClientCreator",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockSSMClientCreator",
"{",
"mock",
":=",
"&",
"MockSSMClientCreator",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockSSMClientCreatorMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.