id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
24,200 | all-24201 | [
"Reconstruct",
"query",
"from",
"flatten",
"values"
] | [
"func",
"buildQuery",
"(",
"values",
"[",
"]",
"APIParams",
")",
"(",
"APIParams",
",",
"error",
")",
"{",
"query",
":=",
"APIParams",
"{",
"}",
"\n",
"for",
"_",
",",
"value",
":=",
"range",
"values",
"{",
"// Only one iteration below, flatten params only have one element each",
"for",
"name",
",",
"param",
":=",
"range",
"value",
"{",
"if",
"q",
",",
"ok",
":=",
"query",
"[",
"name",
"]",
";",
"ok",
"{",
"if",
"a",
",",
"<mask>",
":=",
"q",
".",
"(",
"[",
"]",
"interface",
"{",
"}",
")",
";",
"ok",
"{",
"query",
"[",
"name",
"]",
"=",
"append",
"(",
"a",
",",
"param",
")",
"\n",
"}",
"else",
"{",
"query",
"[",
"name",
"]",
"=",
"[",
"]",
"interface",
"{",
"}",
"{",
"q",
",",
"param",
"}",
"\n",
"}",
"\n",
"}",
"else",
"{",
"query",
"[",
"name",
"]",
"=",
"param",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"query",
",",
"nil",
"\n",
"}"
] |
24,201 | all-24202 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventWindowOpen",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage50",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
24,202 | all-24203 | [
"ImageUpdate",
"updates",
"the",
"image",
"with",
"the",
"given",
"ID",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"ImageUpdate",
"(",
"id",
"int",
",",
"fname",
"string",
",",
"sz",
"int64",
",",
"public",
"bool",
",",
"autoUpdate",
"bool",
",",
"architecture",
"string",
",",
"createdAt",
"time",
".",
"Time",
",",
"expiresAt",
"time",
".",
"Time",
",",
"properties",
"map",
"[",
"string",
"]",
"string",
")",
"error",
"{",
"arch",
",",
"err",
":=",
"osarch",
".",
"ArchitectureId",
"(",
"architecture",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"arch",
"=",
"0",
"\n",
"}",
"\n\n",
"err",
"=",
"c",
".",
"Transaction",
"(",
"func",
"(",
"tx",
"*",
"ClusterTx",
")",
"error",
"{",
"publicInt",
":=",
"0",
"\n",
"if",
"public",
"{",
"publicInt",
"=",
"1",
"\n",
"}",
"\n\n",
"autoUpdateInt",
":=",
"0",
"\n",
"if",
"autoUpdate",
"{",
"autoUpdateInt",
"=",
"1",
"\n",
"}",
"\n\n",
"stmt",
",",
"err",
":=",
"tx",
".",
"tx",
".",
"Prepare",
"(",
"`UPDATE images SET filename=?, size=?, public=?, auto_update=?, architecture=?, creation_date=?, expiry_date=? WHERE id=?`",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defer",
"stmt",
".",
"Close",
"(",
")",
"\n\n",
"_",
",",
"err",
"=",
"stmt",
".",
"Exec",
"(",
"fname",
",",
"sz",
",",
"publicInt",
",",
"autoUpdateInt",
",",
"arch",
",",
"createdAt",
",",
"expiresAt",
",",
"id",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"_",
",",
"err",
"=",
"tx",
".",
"tx",
".",
"Exec",
"(",
"`DELETE FROM images_properties WHERE image_id=?`",
",",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"stmt2",
",",
"err",
":=",
"tx",
".",
"tx",
".",
"Prepare",
"(",
"`INSERT INTO images_properties (image_id, type, key, value) VALUES (?, ?, ?, ?)`",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defer",
"stmt2",
".",
"Close",
"(",
")",
"\n\n",
"for",
"key",
",",
"value",
":=",
"range",
"properties",
"{",
"_",
",",
"err",
"=",
"stmt2",
".",
"Exec",
"(",
"id",
",",
"0",
",",
"key",
",",
"value",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
24,203 | all-24204 | [
"Retrieves",
"the",
"GObject",
"instance",
"used",
"as",
"the",
"source",
"of",
"the",
"binding"
] | [
"func",
"(",
"v",
"*",
"Binding",
")",
"GetSource",
"(",
")",
"*",
"<mask>",
"{",
"obj",
":=",
"C",
".",
"g_binding_get_source",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"obj",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"wrapObject",
"(",
"unsafe",
".",
"Pointer",
"(",
"obj",
")",
")",
"\n",
"}"
] |
24,204 | all-24205 | [
"Target",
"constructs",
"a",
"endpoint",
"resolver",
"target",
"."
] | [
"func",
"Target",
"(",
"id",
",",
"endpoint",
"string",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"scheme",
",",
"<mask>",
",",
"endpoint",
")",
"\n",
"}"
] |
24,205 | all-24206 | [
"Assert",
"that",
"the",
"Key",
"with",
"the",
"given",
"name",
"as",
"the",
"given",
"type",
".",
"Panic",
"if",
"no",
"Key",
"with",
"such",
"name",
"exists",
"or",
"if",
"it",
"does",
"not",
"match",
"the",
"tiven",
"type",
"."
] | [
"func",
"(",
"s",
"Schema",
")",
"assertKeyType",
"(",
"name",
"string",
",",
"code",
"Type",
")",
"{",
"key",
":=",
"s",
".",
"mustGetKey",
"(",
"name",
")",
"\n",
"if",
"key",
".",
"Type",
"!=",
"code",
"{",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"name",
",",
"key",
".",
"Type",
",",
"<mask>",
")",
")",
"\n",
"}",
"\n",
"}"
] |
24,206 | all-24207 | [
"FindRef",
"returns",
"a",
"query",
"that",
"looks",
"for",
"the",
"document",
"in",
"the",
"provided",
"reference",
".",
"For",
"a",
"DBRef",
"to",
"be",
"resolved",
"correctly",
"at",
"the",
"session",
"level",
"it",
"must",
"necessarily",
"have",
"the",
"optional",
"DB",
"field",
"defined",
".",
"See",
"also",
"the",
"DBRef",
"type",
"and",
"the",
"FindRef",
"method",
"on",
"Database",
".",
"Relevant",
"documentation",
":",
"http",
":",
"//",
"www",
".",
"mongodb",
".",
"org",
"/",
"display",
"/",
"DOCS",
"/",
"Database",
"+",
"References"
] | [
"func",
"(",
"s",
"*",
"Session",
")",
"FindRef",
"(",
"ref",
"*",
"DBRef",
")",
"*",
"Query",
"{",
"if",
"ref",
".",
"Database",
"==",
"\"",
"\"",
"{",
"panic",
"(",
"errors",
".",
"New",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"ref",
")",
")",
")",
"\n",
"}",
"\n",
"c",
":=",
"s",
".",
"DB",
"(",
"ref",
".",
"<mask>",
")",
".",
"C",
"(",
"ref",
".",
"Collection",
")",
"\n",
"return",
"c",
".",
"FindId",
"(",
"ref",
".",
"Id",
")",
"\n",
"}"
] |
24,207 | all-24208 | [
"getSSMSecretsResource",
"retrieves",
"ssmsecret",
"resource",
"from",
"resource",
"map"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"getSSMSecretsResource",
"(",
")",
"(",
"[",
"]",
"taskresource",
".",
"TaskResource",
",",
"bool",
")",
"{",
"task",
".",
"lock",
".",
"RLock",
"(",
")",
"\n",
"defer",
"task",
".",
"<mask>",
".",
"RUnlock",
"(",
")",
"\n\n",
"res",
",",
"ok",
":=",
"task",
".",
"ResourcesMapUnsafe",
"[",
"ssmsecret",
".",
"ResourceName",
"]",
"\n",
"return",
"res",
",",
"ok",
"\n",
"}"
] |
24,208 | all-24209 | [
"Delete",
"the",
"Key",
"with",
"the",
"given",
"sid",
".",
"If",
"the",
"Key",
"has",
"already",
"been",
"deleted",
"or",
"does",
"not",
"exist",
"Delete",
"returns",
"nil",
".",
"If",
"another",
"error",
"or",
"a",
"timeout",
"occurs",
"the",
"error",
"is",
"returned",
"."
] | [
"func",
"(",
"r",
"*",
"KeyService",
")",
"Delete",
"(",
"ctx",
"<mask>",
".",
"Context",
",",
"sid",
"string",
")",
"error",
"{",
"return",
"r",
".",
"client",
".",
"DeleteResource",
"(",
"ctx",
",",
"keyPathPart",
",",
"sid",
")",
"\n",
"}"
] |
24,209 | all-24210 | [
"GetLogsetOk",
"returns",
"a",
"tuple",
"with",
"the",
"Logset",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"l",
"*",
"LogStreamDefinition",
")",
"GetLogsetOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"l",
"==",
"nil",
"||",
"l",
".",
"Logset",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"l",
".",
"Logset",
",",
"<mask>",
"\n",
"}"
] |
24,210 | all-24211 | [
"Delete",
"the",
"Recording",
"with",
"the",
"given",
"sid",
".",
"If",
"the",
"Recording",
"has",
"already",
"been",
"deleted",
"or",
"does",
"not",
"exist",
"Delete",
"returns",
"nil",
".",
"If",
"another",
"error",
"or",
"a",
"timeout",
"occurs",
"the",
"error",
"is",
"returned",
"."
] | [
"func",
"(",
"r",
"*",
"RecordingService",
")",
"Delete",
"(",
"ctx",
"<mask>",
".",
"Context",
",",
"sid",
"string",
")",
"error",
"{",
"return",
"r",
".",
"client",
".",
"DeleteResource",
"(",
"ctx",
",",
"recordingsPathPart",
",",
"sid",
")",
"\n",
"}"
] |
24,211 | all-24212 | [
"String",
"implements",
"flag",
".",
"Value",
"interface",
"."
] | [
"func",
"(",
"us",
"*",
"URLsValue",
")",
"String",
"(",
")",
"string",
"{",
"all",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"*",
"us",
")",
")",
"\n",
"for",
"i",
",",
"u",
":=",
"range",
"*",
"us",
"{",
"<mask>",
"[",
"i",
"]",
"=",
"u",
".",
"String",
"(",
")",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Join",
"(",
"all",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
24,212 | all-24213 | [
"GetRequireFullWindowOk",
"returns",
"a",
"tuple",
"with",
"the",
"RequireFullWindow",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"o",
"*",
"Options",
")",
"GetRequireFullWindowOk",
"(",
")",
"(",
"bool",
",",
"bool",
")",
"{",
"if",
"o",
"==",
"nil",
"||",
"o",
".",
"RequireFullWindow",
"==",
"nil",
"{",
"return",
"false",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"o",
".",
"RequireFullWindow",
",",
"<mask>",
"\n",
"}"
] |
24,213 | all-24214 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"AddScriptToEvaluateOnNewDocumentParams",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage84",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
24,214 | all-24215 | [
"GetResourcePolicy",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockSecretsManagerAPI",
")",
"GetResourcePolicy",
"(",
"arg0",
"*",
"secretsmanager",
".",
"GetResourcePolicyInput",
")",
"(",
"*",
"secretsmanager",
".",
"GetResourcePolicyOutput",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"*",
"secretsmanager",
".",
"GetResourcePolicyOutput",
")",
"\n",
"ret1",
",",
"_",
":=",
"<mask>",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] |
24,215 | all-24216 | [
"DeepCopyInto",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"writing",
"into",
"out",
".",
"in",
"must",
"be",
"non",
"-",
"nil",
"."
] | [
"func",
"(",
"in",
"*",
"DNSEndpointSpec",
")",
"DeepCopyInto",
"(",
"<mask>",
"*",
"DNSEndpointSpec",
")",
"{",
"*",
"out",
"=",
"*",
"in",
"\n",
"if",
"in",
".",
"Endpoints",
"!=",
"nil",
"{",
"in",
",",
"out",
":=",
"&",
"in",
".",
"Endpoints",
",",
"&",
"out",
".",
"Endpoints",
"\n",
"*",
"out",
"=",
"make",
"(",
"[",
"]",
"*",
"Endpoint",
",",
"len",
"(",
"*",
"in",
")",
")",
"\n",
"for",
"i",
":=",
"range",
"*",
"in",
"{",
"if",
"(",
"*",
"in",
")",
"[",
"i",
"]",
"==",
"nil",
"{",
"(",
"*",
"out",
")",
"[",
"i",
"]",
"=",
"nil",
"\n",
"}",
"else",
"{",
"(",
"*",
"out",
")",
"[",
"i",
"]",
"=",
"new",
"(",
"Endpoint",
")",
"\n",
"(",
"*",
"in",
")",
"[",
"i",
"]",
".",
"DeepCopyInto",
"(",
"(",
"*",
"out",
")",
"[",
"i",
"]",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
24,216 | all-24217 | [
"specify",
"a",
"one",
"-",
"dimensional",
"texture",
"subimage"
] | [
"func",
"TexSubImage1D",
"(",
"target",
"uint32",
",",
"level",
"int32",
",",
"xoffset",
"int32",
",",
"width",
"int32",
",",
"format",
"uint32",
",",
"xtype",
"uint32",
",",
"pixels",
"unsafe",
".",
"Pointer",
")",
"{",
"syscall",
".",
"Syscall9",
"(",
"gpTexSubImage1D",
",",
"7",
",",
"uintptr",
"(",
"target",
")",
",",
"uintptr",
"(",
"level",
")",
",",
"uintptr",
"(",
"xoffset",
")",
",",
"uintptr",
"(",
"width",
")",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"xtype",
")",
",",
"uintptr",
"(",
"pixels",
")",
",",
"0",
",",
"0",
")",
"\n",
"}"
] |
24,217 | all-24218 | [
"FindMachine",
"parses",
"the",
"netrc",
"file",
"identified",
"by",
"filename",
"and",
"returns",
"the",
"Machine",
"named",
"by",
"name",
".",
"If",
"no",
"Machine",
"with",
"name",
"name",
"is",
"found",
"the",
"default",
"machine",
"is",
"returned",
"."
] | [
"func",
"FindMachine",
"(",
"filename",
",",
"name",
"string",
")",
"(",
"*",
"Machine",
",",
"error",
")",
"{",
"mach",
",",
"_",
",",
"err",
":=",
"ParseFile",
"(",
"filename",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"var",
"def",
"*",
"Machine",
"\n",
"for",
"_",
",",
"m",
":=",
"<mask>",
"mach",
"{",
"if",
"m",
".",
"Name",
"==",
"name",
"{",
"return",
"m",
",",
"nil",
"\n",
"}",
"\n",
"if",
"m",
".",
"Name",
"==",
"\"",
"\"",
"{",
"def",
"=",
"m",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"def",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"def",
",",
"nil",
"\n",
"}"
] |
24,218 | all-24219 | [
"LoginURLFederated",
"is",
"like",
"LoginURL",
"but",
"accepts",
"a",
"user",
"s",
"OpenID",
"identifier",
"."
] | [
"func",
"LoginURLFederated",
"(",
"c",
"context",
".",
"Context",
",",
"dest",
",",
"identity",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"req",
":=",
"&",
"<mask>",
".",
"CreateLoginURLRequest",
"{",
"DestinationUrl",
":",
"proto",
".",
"String",
"(",
"dest",
")",
",",
"}",
"\n",
"if",
"identity",
"!=",
"\"",
"\"",
"{",
"req",
".",
"FederatedIdentity",
"=",
"proto",
".",
"String",
"(",
"identity",
")",
"\n",
"}",
"\n",
"res",
":=",
"&",
"pb",
".",
"CreateLoginURLResponse",
"{",
"}",
"\n",
"if",
"err",
":=",
"internal",
".",
"Call",
"(",
"c",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"req",
",",
"res",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"return",
"*",
"res",
".",
"LoginUrl",
",",
"nil",
"\n",
"}"
] |
24,219 | all-24220 | [
"Source",
"sets",
"ipv4",
"/",
"ipv6",
"source",
"IP",
"for",
"sending",
"ICMP",
"packets",
"and",
"returns",
"the",
"previous",
"setting",
".",
"Empty",
"value",
"indicates",
"to",
"use",
"system",
"default",
"one",
"(",
"for",
"both",
"ipv4",
"and",
"ipv6",
")",
"."
] | [
"func",
"(",
"p",
"*",
"Pinger",
")",
"Source",
"(",
"source",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"// using ipv4 previous value for new empty one",
"origSource",
":=",
"p",
".",
"source",
"\n",
"if",
"\"",
"\"",
"==",
"source",
"{",
"p",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"p",
".",
"source",
"=",
"\"",
"\"",
"\n",
"p",
".",
"source6",
"=",
"\"",
"\"",
"\n",
"p",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"origSource",
",",
"nil",
"\n",
"}",
"\n\n",
"addr",
":=",
"net",
".",
"ParseIP",
"(",
"source",
")",
"\n",
"if",
"addr",
"==",
"nil",
"{",
"return",
"origSource",
",",
"errors",
".",
"New",
"(",
"source",
"+",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"isIPv4",
"(",
"addr",
")",
"{",
"p",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"p",
".",
"source",
"=",
"source",
"\n",
"p",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"}",
"else",
"if",
"isIPv6",
"(",
"addr",
")",
"{",
"origSource",
"=",
"p",
".",
"source6",
"\n",
"p",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"p",
".",
"source6",
"=",
"<mask>",
"\n",
"p",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"}",
"else",
"{",
"return",
"origSource",
",",
"errors",
".",
"New",
"(",
"source",
"+",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"origSource",
",",
"nil",
"\n",
"}"
] |
24,220 | all-24221 | [
"title",
":",
"rebalance",
"units",
"in",
"nodes",
"path",
":",
"/",
"node",
"/",
"rebalance",
"method",
":",
"POST",
"consume",
":",
"application",
"/",
"x",
"-",
"www",
"-",
"form",
"-",
"urlencoded",
"produce",
":",
"application",
"/",
"x",
"-",
"json",
"-",
"stream",
"responses",
":",
"200",
":",
"Ok",
"400",
":",
"Invalid",
"data",
"401",
":",
"Unauthorized"
] | [
"func",
"rebalanceNodesHandler",
"(",
"w",
"<mask>",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"t",
"auth",
".",
"Token",
")",
"(",
"err",
"error",
")",
"{",
"var",
"params",
"provision",
".",
"RebalanceNodesOptions",
"\n",
"err",
"=",
"ParseInput",
"(",
"r",
",",
"&",
"params",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"&",
"tsuruErrors",
".",
"HTTP",
"{",
"Code",
":",
"http",
".",
"StatusBadRequest",
",",
"Message",
":",
"err",
".",
"Error",
"(",
")",
",",
"}",
"\n",
"}",
"\n",
"params",
".",
"Force",
"=",
"true",
"\n",
"var",
"permContexts",
"[",
"]",
"permTypes",
".",
"PermissionContext",
"\n",
"var",
"ok",
"bool",
"\n",
"evtTarget",
":=",
"event",
".",
"Target",
"{",
"Type",
":",
"event",
".",
"TargetTypeGlobal",
"}",
"\n",
"params",
".",
"Pool",
",",
"ok",
"=",
"params",
".",
"MetadataFilter",
"[",
"provision",
".",
"PoolMetadataName",
"]",
"\n",
"if",
"ok",
"{",
"delete",
"(",
"params",
".",
"MetadataFilter",
",",
"provision",
".",
"PoolMetadataName",
")",
"\n",
"permContexts",
"=",
"append",
"(",
"permContexts",
",",
"permission",
".",
"Context",
"(",
"permTypes",
".",
"CtxPool",
",",
"params",
".",
"Pool",
")",
")",
"\n",
"evtTarget",
"=",
"event",
".",
"Target",
"{",
"Type",
":",
"event",
".",
"TargetTypePool",
",",
"Value",
":",
"params",
".",
"Pool",
"}",
"\n",
"}",
"\n",
"if",
"!",
"permission",
".",
"Check",
"(",
"t",
",",
"permission",
".",
"PermNodeUpdateRebalance",
",",
"permContexts",
"...",
")",
"{",
"return",
"permission",
".",
"ErrUnauthorized",
"\n",
"}",
"\n",
"evt",
",",
"err",
":=",
"event",
".",
"New",
"(",
"&",
"event",
".",
"Opts",
"{",
"Target",
":",
"evtTarget",
",",
"Kind",
":",
"permission",
".",
"PermNodeUpdateRebalance",
",",
"Owner",
":",
"t",
",",
"CustomData",
":",
"event",
".",
"FormToCustomData",
"(",
"InputFields",
"(",
"r",
")",
")",
",",
"DisableLock",
":",
"true",
",",
"Allowed",
":",
"event",
".",
"Allowed",
"(",
"permission",
".",
"PermPoolReadEvents",
",",
"permContexts",
"...",
")",
",",
"Cancelable",
":",
"true",
",",
"AllowedCancel",
":",
"event",
".",
"Allowed",
"(",
"permission",
".",
"PermAppUpdateEvents",
",",
"permContexts",
"...",
")",
",",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defer",
"func",
"(",
")",
"{",
"evt",
".",
"Done",
"(",
"err",
")",
"}",
"(",
")",
"\n",
"w",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"keepAliveWriter",
":=",
"tsuruIo",
".",
"NewKeepAliveWriter",
"(",
"w",
",",
"15",
"*",
"time",
".",
"Second",
",",
"\"",
"\"",
")",
"\n",
"defer",
"keepAliveWriter",
".",
"Stop",
"(",
")",
"\n",
"writer",
":=",
"&",
"tsuruIo",
".",
"SimpleJsonMessageEncoderWriter",
"{",
"Encoder",
":",
"json",
".",
"NewEncoder",
"(",
"keepAliveWriter",
")",
"}",
"\n",
"evt",
".",
"SetLogWriter",
"(",
"writer",
")",
"\n",
"params",
".",
"Event",
"=",
"evt",
"\n",
"var",
"provs",
"[",
"]",
"provision",
".",
"Provisioner",
"\n",
"if",
"params",
".",
"Pool",
"!=",
"\"",
"\"",
"{",
"var",
"p",
"*",
"pool",
".",
"Pool",
"\n",
"var",
"prov",
"provision",
".",
"Provisioner",
"\n",
"p",
",",
"err",
"=",
"pool",
".",
"GetPoolByName",
"(",
"params",
".",
"Pool",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"prov",
",",
"err",
"=",
"p",
".",
"GetProvisioner",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"_",
",",
"ok",
":=",
"prov",
".",
"(",
"provision",
".",
"NodeRebalanceProvisioner",
")",
";",
"!",
"ok",
"{",
"return",
"provision",
".",
"ProvisionerNotSupported",
"{",
"Prov",
":",
"prov",
",",
"Action",
":",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"provs",
"=",
"append",
"(",
"provs",
",",
"prov",
")",
"\n",
"}",
"else",
"{",
"provs",
",",
"err",
"=",
"provision",
".",
"Registry",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"_",
",",
"prov",
":=",
"range",
"provs",
"{",
"rebalanceProv",
",",
"ok",
":=",
"prov",
".",
"(",
"provision",
".",
"NodeRebalanceProvisioner",
")",
"\n",
"if",
"!",
"ok",
"{",
"continue",
"\n",
"}",
"\n",
"_",
",",
"err",
"=",
"rebalanceProv",
".",
"RebalanceNodes",
"(",
"params",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n",
"fmt",
".",
"Fprintf",
"(",
"writer",
",",
"\"",
"\\n",
"\"",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
24,221 | all-24222 | [
"Close",
"frees",
"the",
"Lua",
"reference",
"of",
"this",
"object",
"."
] | [
"func",
"(",
"lo",
"*",
"LuaObject",
")",
"Close",
"(",
")",
"{",
"lo",
".",
"l",
".",
"Unref",
"(",
"lua",
".",
"LUA_REGISTRYINDEX",
",",
"lo",
".",
"<mask>",
")",
"\n",
"}"
] |
24,222 | all-24223 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"CookieParam",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork61",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
24,223 | all-24224 | [
"New",
"returns",
"a",
"new",
"Stream",
"with",
"the",
"given",
"buffer",
"size",
"and",
"setup",
"function",
"."
] | [
"func",
"New",
"(",
"bufferSize",
"int",
",",
"<mask>",
"func",
"(",
")",
"(",
"grpc",
".",
"ClientStream",
",",
"error",
")",
")",
"*",
"Stream",
"{",
"return",
"&",
"Stream",
"{",
"setupFunc",
":",
"setup",
",",
"sendBuffer",
":",
"make",
"(",
"chan",
"interface",
"{",
"}",
",",
"bufferSize",
")",
",",
"log",
":",
"ttnlog",
".",
"Get",
"(",
")",
",",
"}",
"\n",
"}"
] |
24,224 | all-24225 | [
"NewListener",
"creates",
"a",
"new",
"listner",
"."
] | [
"func",
"NewListener",
"(",
"addr",
",",
"scheme",
"string",
",",
"tlsinfo",
"*",
"TLSInfo",
")",
"(",
"l",
"<mask>",
".",
"Listener",
",",
"err",
"error",
")",
"{",
"if",
"l",
",",
"err",
"=",
"newListener",
"(",
"addr",
",",
"scheme",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"wrapTLS",
"(",
"scheme",
",",
"tlsinfo",
",",
"l",
")",
"\n",
"}"
] |
24,225 | all-24226 | [
"UnmarshalText",
"attempts",
"to",
"unmarshal",
"buf",
"into",
"an",
"Algorithm",
"."
] | [
"func",
"(",
"alg",
"*",
"Algorithm",
")",
"UnmarshalText",
"(",
"buf",
"[",
"]",
"byte",
")",
"error",
"{",
"switch",
"string",
"(",
"buf",
")",
"{",
"// hmac",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"HS256",
"\n",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"HS384",
"\n",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"HS512",
"\n\n",
"// rsa-pkcs1v15",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"RS256",
"\n",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"RS384",
"\n",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"RS512",
"\n\n",
"// ecc",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"ES256",
"\n",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"ES384",
"\n",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"ES512",
"\n\n",
"// rsa-pss",
"<mask>",
"\"",
"\"",
":",
"*",
"alg",
"=",
"PS256",
"\n",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"PS384",
"\n",
"case",
"\"",
"\"",
":",
"*",
"alg",
"=",
"PS512",
"\n\n",
"// error",
"default",
":",
"return",
"ErrInvalidAlgorithm",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
24,226 | all-24227 | [
"AddInRange",
"increments",
"a",
"value",
"by",
"the",
"passed",
"quantity",
"while",
"ensuring",
"the",
"values",
"always",
"remain",
"within",
"the",
"supplied",
"min",
"/",
"max",
"range",
"."
] | [
"func",
"addInRange",
"(",
"n",
"int16",
",",
"increment",
"int16",
",",
"min",
"int16",
",",
"max",
"int16",
")",
"int16",
"{",
"return",
"ensureInRange",
"(",
"n",
"+",
"increment",
",",
"min",
",",
"<mask>",
")",
"\n",
"}"
] |
24,227 | all-24228 | [
"MatchDatum",
"checks",
"if",
"a",
"datum",
"matches",
"a",
"filter",
".",
"To",
"match",
"each",
"string",
"in",
"filter",
"must",
"correspond",
"match",
"at",
"least",
"1",
"datum",
"s",
"Path",
"or",
"Hash",
".",
"Order",
"of",
"filter",
"and",
"data",
"is",
"irrelevant",
"."
] | [
"func",
"MatchDatum",
"(",
"filter",
"[",
"]",
"string",
",",
"data",
"[",
"]",
"*",
"pps",
".",
"InputFile",
")",
"bool",
"{",
"// All paths in request.DataFilters must appear somewhere in the log",
"// line's inputs, or it's filtered",
"matchesData",
":=",
"true",
"\n",
"dataFilters",
":",
"for",
"_",
",",
"dataFilter",
":=",
"range",
"filter",
"{",
"for",
"_",
",",
"datum",
":=",
"range",
"data",
"{",
"if",
"dataFilter",
"==",
"datum",
".",
"<mask>",
"||",
"dataFilter",
"==",
"base64",
".",
"StdEncoding",
".",
"EncodeToString",
"(",
"datum",
".",
"Hash",
")",
"||",
"dataFilter",
"==",
"hex",
".",
"EncodeToString",
"(",
"datum",
".",
"Hash",
")",
"{",
"continue",
"dataFilters",
"// Found, move to next filter",
"\n",
"}",
"\n",
"}",
"\n",
"matchesData",
"=",
"false",
"\n",
"break",
"\n",
"}",
"\n",
"return",
"matchesData",
"\n",
"}"
] |
24,228 | all-24229 | [
"GetColumns",
"returns",
"the",
"Columns",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"GetColumns",
"(",
")",
"<mask>",
"{",
"if",
"w",
"==",
"nil",
"||",
"w",
".",
"Columns",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"w",
".",
"Columns",
"\n",
"}"
] |
24,229 | all-24230 | [
"HasCompareTo",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"c",
"*",
"ChangeRequest",
")",
"HasCompareTo",
"(",
")",
"bool",
"{",
"if",
"c",
"!=",
"nil",
"&&",
"c",
".",
"CompareTo",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
24,230 | all-24231 | [
"GetStdLogger",
"returns",
"a",
"standard",
"Logger",
"instance",
"useful",
"for",
"configuring",
"log",
"in",
"external",
"packages",
"."
] | [
"func",
"(",
"t",
"*",
"Target",
")",
"GetStdLogger",
"(",
")",
"*",
"<mask>",
".",
"Logger",
"{",
"t",
".",
"mut",
".",
"RLock",
"(",
")",
"\n",
"defer",
"t",
".",
"mut",
".",
"RUnlock",
"(",
")",
"\n",
"if",
"t",
".",
"logger",
"!=",
"nil",
"{",
"return",
"t",
".",
"logger",
".",
"GetStdLogger",
"(",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
24,231 | all-24232 | [
"resourceVSphereFolderMigrateStateV1",
"migrates",
"the",
"state",
"of",
"the",
"vsphere_folder",
"from",
"version",
"0",
"to",
"version",
"1",
"."
] | [
"func",
"resourceVSphereFolderMigrateStateV1",
"(",
"s",
"*",
"terraform",
".",
"InstanceState",
",",
"meta",
"interface",
"{",
"}",
")",
"error",
"{",
"// Our path for migration here is pretty much the same as our import path, so",
"// we just leverage that functionality.",
"//",
"// We just need the path and the datacenter to proceed. We don't have an",
"// analog in for existing_path in the new resource, so we just drop that on",
"// the floor.",
"dcp",
":=",
"folder",
".",
"NormalizePath",
"(",
"s",
".",
"Attributes",
"[",
"\"",
"\"",
"]",
")",
"\n",
"p",
":=",
"folder",
".",
"NormalizePath",
"(",
"s",
".",
"Attributes",
"[",
"\"",
"\"",
"]",
")",
"\n\n",
"// Discover our datacenter first. This field can be empty, so we have to",
"// search for it as we normally would.",
"<mask>",
":=",
"meta",
".",
"(",
"*",
"VSphereClient",
")",
".",
"vimClient",
"\n",
"dc",
",",
"err",
":=",
"getDatacenter",
"(",
"client",
",",
"dcp",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// The old resource only supported VM folders, so this part is easy enough,",
"// we can derive our full path by combining the VM path particle and our",
"// relative path.",
"fp",
":=",
"folder",
".",
"RootPathParticleVM",
".",
"PathFromDatacenter",
"(",
"dc",
",",
"p",
")",
"\n",
"folder",
",",
"err",
":=",
"folder",
".",
"FromAbsolutePath",
"(",
"client",
",",
"fp",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// We got our folder!",
"//",
"// Read will handle everything except for the ID, so just wipe attributes,",
"// update the ID, and let read take care of the rest.",
"s",
".",
"Attributes",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"s",
".",
"ID",
"=",
"folder",
".",
"Reference",
"(",
")",
".",
"Value",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
24,232 | all-24233 | [
"GetOrderDirection",
"returns",
"the",
"OrderDirection",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"g",
"*",
"GraphDefinitionRequest",
")",
"GetOrderDirection",
"(",
")",
"<mask>",
"{",
"if",
"g",
"==",
"nil",
"||",
"g",
".",
"OrderDirection",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"g",
".",
"OrderDirection",
"\n",
"}"
] |
24,233 | all-24234 | [
"Initialize",
"the",
"Discoverer",
"run",
"."
] | [
"func",
"(",
"d",
"*",
"Discovery",
")",
"initialize",
"(",
"ctx",
"context",
".",
"Context",
")",
"{",
"// Loop until we manage to get the local datacenter.",
"for",
"{",
"// We have to check the context at least once. The checks during channel sends",
"// do not guarantee that.",
"select",
"{",
"case",
"<-",
"ctx",
".",
"Done",
"(",
")",
":",
"return",
"\n",
"default",
":",
"}",
"\n\n",
"// Get the local datacenter first, if necessary.",
"err",
":=",
"d",
".",
"getDatacenter",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"<mask>",
".",
"Sleep",
"(",
"retryInterval",
")",
"\n",
"continue",
"\n",
"}",
"\n",
"// We are good to go.",
"return",
"\n",
"}",
"\n",
"}"
] |
24,234 | all-24235 | [
"EnvelopeToMarkdown",
"renders",
"the",
"contents",
"of",
"an",
"enmime",
".",
"Envelope",
"in",
"Markdown",
"format",
".",
"Used",
"by",
"mime",
"-",
"dump",
"and",
"mime",
"-",
"extractor",
"commands",
"."
] | [
"func",
"EnvelopeToMarkdown",
"(",
"w",
"io",
".",
"Writer",
",",
"e",
"*",
"enmime",
".",
"Envelope",
",",
"name",
"string",
")",
"error",
"{",
"<mask>",
":=",
"&",
"markdown",
"{",
"bufio",
".",
"NewWriter",
"(",
"w",
")",
"}",
"\n\n",
"md",
".",
"H1",
"(",
"name",
")",
"\n\n",
"// Output a sorted list of headers, minus the ones displayed later",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"if",
"e",
".",
"Root",
"!=",
"nil",
"&&",
"e",
".",
"Root",
".",
"Header",
"!=",
"nil",
"{",
"keys",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
",",
"len",
"(",
"e",
".",
"Root",
".",
"Header",
")",
")",
"\n",
"for",
"k",
":=",
"range",
"e",
".",
"Root",
".",
"Header",
"{",
"switch",
"strings",
".",
"ToLower",
"(",
"k",
")",
"{",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"continue",
"\n",
"}",
"\n",
"keys",
"=",
"append",
"(",
"keys",
",",
"k",
")",
"\n",
"}",
"\n",
"sort",
".",
"Strings",
"(",
"keys",
")",
"\n",
"for",
"_",
",",
"k",
":=",
"range",
"keys",
"{",
"md",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"k",
",",
"e",
".",
"GetHeader",
"(",
"k",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"md",
".",
"Println",
"(",
")",
"\n\n",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"for",
"_",
",",
"hkey",
":=",
"range",
"addressHeaders",
"{",
"addrlist",
",",
"err",
":=",
"e",
".",
"AddressList",
"(",
"hkey",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"err",
"==",
"mail",
".",
"ErrHeaderNotPresent",
"{",
"continue",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"md",
".",
"H3",
"(",
"hkey",
")",
"\n",
"for",
"_",
",",
"addr",
":=",
"range",
"addrlist",
"{",
"md",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"addr",
".",
"Name",
",",
"addr",
".",
"Address",
")",
"\n",
"}",
"\n",
"md",
".",
"Println",
"(",
")",
"\n",
"}",
"\n",
"md",
".",
"H3",
"(",
"\"",
"\"",
")",
"\n",
"md",
".",
"Println",
"(",
"e",
".",
"GetHeader",
"(",
"\"",
"\"",
")",
")",
"\n",
"md",
".",
"Println",
"(",
")",
"\n\n",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"md",
".",
"Println",
"(",
"e",
".",
"Text",
")",
"\n",
"md",
".",
"Println",
"(",
")",
"\n\n",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"md",
".",
"Println",
"(",
"e",
".",
"HTML",
")",
"\n",
"md",
".",
"Println",
"(",
")",
"\n\n",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"for",
"_",
",",
"a",
":=",
"range",
"e",
".",
"Attachments",
"{",
"md",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"a",
".",
"FileName",
",",
"a",
".",
"ContentType",
")",
"\n",
"if",
"a",
".",
"ContentID",
"!=",
"\"",
"\"",
"{",
"md",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"a",
".",
"ContentID",
")",
"\n",
"}",
"\n",
"}",
"\n",
"md",
".",
"Println",
"(",
")",
"\n\n",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"for",
"_",
",",
"a",
":=",
"range",
"e",
".",
"Inlines",
"{",
"md",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"a",
".",
"FileName",
",",
"a",
".",
"ContentType",
")",
"\n",
"if",
"a",
".",
"ContentID",
"!=",
"\"",
"\"",
"{",
"md",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"a",
".",
"ContentID",
")",
"\n",
"}",
"\n",
"}",
"\n",
"md",
".",
"Println",
"(",
")",
"\n\n",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"for",
"_",
",",
"a",
":=",
"range",
"e",
".",
"OtherParts",
"{",
"md",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"a",
".",
"FileName",
",",
"a",
".",
"ContentType",
")",
"\n",
"if",
"a",
".",
"ContentID",
"!=",
"\"",
"\"",
"{",
"md",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"a",
".",
"ContentID",
")",
"\n",
"}",
"\n",
"}",
"\n",
"md",
".",
"Println",
"(",
")",
"\n\n",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"if",
"e",
".",
"Root",
"==",
"nil",
"{",
"md",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n",
"}",
"else",
"{",
"FormatPart",
"(",
"md",
",",
"e",
".",
"Root",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"e",
".",
"Errors",
")",
">",
"0",
"{",
"md",
".",
"Println",
"(",
")",
"\n",
"md",
".",
"H2",
"(",
"\"",
"\"",
")",
"\n",
"for",
"_",
",",
"perr",
":=",
"range",
"e",
".",
"Errors",
"{",
"md",
".",
"Println",
"(",
"\"",
"\"",
",",
"perr",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"md",
".",
"Flush",
"(",
")",
"\n",
"}"
] |
24,235 | all-24236 | [
"GoString",
"defines",
"the",
"printable",
"version",
"of",
"this",
"struct",
"."
] | [
"func",
"(",
"c",
"*",
"WaitConfig",
")",
"GoString",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"<mask>",
"\"",
"\"",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
",",
"BoolGoString",
"(",
"c",
".",
"Enabled",
")",
",",
"TimeDurationGoString",
"(",
"c",
".",
"Min",
")",
",",
"TimeDurationGoString",
"(",
"c",
".",
"Max",
")",
",",
")",
"\n",
"}"
] |
24,236 | all-24237 | [
"checkMountDestination",
"checks",
"to",
"ensure",
"that",
"the",
"mount",
"destination",
"is",
"not",
"over",
"the",
"top",
"of",
"/",
"proc",
"or",
"/",
"sys",
".",
"dest",
"is",
"required",
"to",
"be",
"an",
"abs",
"path",
"and",
"have",
"any",
"symlinks",
"resolved",
"before",
"calling",
"this",
"function",
"."
] | [
"func",
"checkMountDestination",
"(",
"rootfs",
",",
"dest",
"string",
")",
"error",
"{",
"if",
"filepath",
".",
"Clean",
"(",
"rootfs",
")",
"==",
"filepath",
".",
"Clean",
"(",
"dest",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"invalidDestinations",
":=",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"}",
"\n",
"for",
"_",
",",
"invalid",
":=",
"range",
"invalidDestinations",
"{",
"path",
",",
"err",
":=",
"filepath",
".",
"Rel",
"(",
"filepath",
".",
"Join",
"(",
"rootfs",
",",
"invalid",
")",
",",
"dest",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"path",
"==",
"\"",
"\"",
"||",
"!",
"strings",
".",
"HasPrefix",
"(",
"<mask>",
",",
"\"",
"\"",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"dest",
",",
"invalid",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
24,237 | all-24238 | [
"loadKeyData",
"loads",
"key",
"data",
"from",
"the",
"path",
".",
"Attempts",
"to",
"json",
"-",
"decode",
"the",
"file",
"first",
"otherwise",
"passes",
"it",
"to",
"pemutil",
".",
"If",
"the",
"file",
"appears",
"to",
"be",
"a",
"Google",
"service",
"account",
"JSON",
"file",
"(",
"ie",
"contains",
"gserviceaccount",
".",
"com",
")",
"then",
"jwt",
".",
"RS256",
"will",
"be",
"returned",
"otherwise",
"jwt",
".",
"NONE",
"is",
"returned",
"."
] | [
"func",
"loadKeyData",
"(",
"path",
"string",
")",
"(",
"pemutil",
".",
"Store",
",",
"jwt",
".",
"Algorithm",
",",
"error",
")",
"{",
"// check if it's json data",
"buf",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"jwt",
".",
"NONE",
",",
"err",
"\n",
"}",
"\n\n",
"// attempt json decode",
"v",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"buf",
",",
"&",
"v",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"// not json encoded, so skip",
"keyset",
",",
"err",
":=",
"pemutil",
".",
"LoadFile",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"jwt",
".",
"NONE",
",",
"err",
"\n",
"}",
"\n",
"return",
"keyset",
",",
"jwt",
".",
"NONE",
",",
"nil",
"\n",
"}",
"\n\n",
"// attempt decode on each field of the json decoded values, and ignoring",
"// any errors",
"keyset",
":=",
"pemutil",
".",
"<mask>",
"{",
"}",
"\n",
"for",
"_",
",",
"val",
":=",
"range",
"v",
"{",
"if",
"str",
",",
"ok",
":=",
"val",
".",
"(",
"string",
")",
";",
"ok",
"{",
"_",
"=",
"keyset",
".",
"Decode",
"(",
"[",
"]",
"byte",
"(",
"str",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"keyset",
".",
"AddPublicKeys",
"(",
")",
"\n\n",
"if",
"len",
"(",
"keyset",
")",
"<",
"1",
"{",
"return",
"nil",
",",
"jwt",
".",
"NONE",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"path",
")",
"\n",
"}",
"\n\n",
"// if it's a google service account, return RS256",
"if",
"bytes",
".",
"Contains",
"(",
"buf",
",",
"[",
"]",
"byte",
"(",
"\"",
"\"",
")",
")",
"{",
"return",
"keyset",
",",
"jwt",
".",
"RS256",
",",
"nil",
"\n",
"}",
"\n\n",
"return",
"keyset",
",",
"jwt",
".",
"NONE",
",",
"nil",
"\n",
"}"
] |
24,238 | all-24239 | [
"LeaseValue",
"compares",
"a",
"key",
"s",
"LeaseID",
"to",
"a",
"value",
"of",
"your",
"choosing",
".",
"The",
"empty",
"LeaseID",
"is",
"0",
"otherwise",
"known",
"as",
"NoLease",
"."
] | [
"func",
"LeaseValue",
"(",
"key",
"string",
")",
"Cmp",
"{",
"return",
"Cmp",
"{",
"Key",
":",
"[",
"]",
"byte",
"(",
"key",
")",
",",
"Target",
":",
"<mask>",
".",
"Compare_LEASE",
"}",
"\n",
"}"
] |
24,239 | all-24240 | [
"GetLogQueryOk",
"returns",
"a",
"tuple",
"with",
"the",
"LogQuery",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"h",
"*",
"HeatmapRequest",
")",
"GetLogQueryOk",
"(",
")",
"(",
"WidgetApmOrLogQuery",
",",
"bool",
")",
"{",
"if",
"h",
"==",
"nil",
"||",
"h",
".",
"LogQuery",
"==",
"nil",
"{",
"return",
"WidgetApmOrLogQuery",
"{",
"}",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"h",
".",
"LogQuery",
",",
"true",
"\n",
"}"
] |
24,240 | all-24241 | [
"encodeConfiguration",
"serializes",
"a",
"Configuration",
"using",
"MsgPack",
"or",
"panics",
"on",
"errors",
"."
] | [
"func",
"encodeConfiguration",
"(",
"configuration",
"Configuration",
")",
"[",
"]",
"<mask>",
"{",
"buf",
",",
"err",
":=",
"encodeMsgPack",
"(",
"configuration",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
")",
"\n",
"}",
"\n",
"return",
"buf",
".",
"Bytes",
"(",
")",
"\n",
"}"
] |
24,241 | all-24242 | [
"ChangeContactModhattr",
"creates",
"a",
"new",
"CHANGE_CONTACT_MODHATTR",
"Nagios",
"command",
".",
"This",
"command",
"changes",
"the",
"modified",
"host",
"attributes",
"value",
"for",
"the",
"specified",
"contact",
".",
"Modified",
"attributes",
"values",
"are",
"used",
"by",
"Nagios",
"to",
"determine",
"which",
"object",
"properties",
"should",
"be",
"retained",
"across",
"program",
"restarts",
".",
"Thus",
"modifying",
"the",
"value",
"of",
"the",
"attributes",
"can",
"affect",
"data",
"retention",
".",
"This",
"is",
"an",
"advanced",
"option",
"and",
"should",
"only",
"be",
"used",
"by",
"people",
"who",
"are",
"intimately",
"familiar",
"with",
"the",
"data",
"retention",
"logic",
"in",
"Nagios",
"."
] | [
"func",
"ChangeContactModhattr",
"(",
"contact_name",
"string",
",",
"<mask>",
"string",
",",
")",
"*",
"livestatus",
".",
"Command",
"{",
"return",
"livestatus",
".",
"NewCommand",
"(",
"\"",
"\"",
",",
"stringifyArg",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"contact_name",
")",
",",
"stringifyArg",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"value",
")",
",",
")",
"\n",
"}"
] |
24,242 | all-24243 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"RequestDatabaseParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoIndexeddb1",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
24,243 | all-24244 | [
"ImageRemove",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockClient",
")",
"ImageRemove",
"(",
"arg0",
"context",
".",
"Context",
",",
"arg1",
"string",
",",
"arg2",
"types",
".",
"ImageRemoveOptions",
")",
"(",
"[",
"]",
"types",
".",
"ImageDeleteResponseItem",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
",",
"arg2",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"[",
"]",
"<mask>",
".",
"ImageDeleteResponseItem",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] |
24,244 | all-24245 | [
"With",
"adds",
"inline",
"middlewares",
"for",
"an",
"endpoint",
"handler",
"."
] | [
"func",
"(",
"mx",
"*",
"Mux",
")",
"With",
"(",
"middlewares",
"...",
"func",
"(",
"http",
".",
"Handler",
")",
"http",
".",
"Handler",
")",
"Router",
"{",
"// Similarly as in handle(), we must build the mux handler once further",
"// middleware registration isn't allowed for this stack, like now.",
"if",
"!",
"mx",
".",
"inline",
"&&",
"mx",
".",
"handler",
"==",
"nil",
"{",
"mx",
".",
"buildRouteHandler",
"(",
")",
"\n",
"}",
"\n\n",
"// Copy middlewares from parent inline muxs",
"var",
"mws",
"Middlewares",
"\n",
"if",
"mx",
".",
"inline",
"{",
"mws",
"=",
"make",
"(",
"Middlewares",
",",
"len",
"(",
"mx",
".",
"middlewares",
")",
")",
"\n",
"<mask>",
"(",
"mws",
",",
"mx",
".",
"middlewares",
")",
"\n",
"}",
"\n",
"mws",
"=",
"append",
"(",
"mws",
",",
"middlewares",
"...",
")",
"\n\n",
"im",
":=",
"&",
"Mux",
"{",
"pool",
":",
"mx",
".",
"pool",
",",
"inline",
":",
"true",
",",
"parent",
":",
"mx",
",",
"tree",
":",
"mx",
".",
"tree",
",",
"middlewares",
":",
"mws",
"}",
"\n\n",
"return",
"im",
"\n",
"}"
] |
24,245 | all-24246 | [
"control",
"the",
"reporting",
"of",
"debug",
"messages",
"in",
"a",
"debug",
"context"
] | [
"func",
"DebugMessageControl",
"(",
"<mask>",
"uint32",
",",
"xtype",
"uint32",
",",
"severity",
"uint32",
",",
"count",
"int32",
",",
"ids",
"*",
"uint32",
",",
"enabled",
"bool",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpDebugMessageControl",
",",
"6",
",",
"uintptr",
"(",
"source",
")",
",",
"uintptr",
"(",
"xtype",
")",
",",
"uintptr",
"(",
"severity",
")",
",",
"uintptr",
"(",
"count",
")",
",",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"ids",
")",
")",
",",
"boolToUintptr",
"(",
"enabled",
")",
")",
"\n",
"}"
] |
24,246 | all-24247 | [
"AccelMapAddEntry",
"is",
"a",
"wrapper",
"around",
"gtk_accel_map_add_entry",
"()",
"."
] | [
"func",
"AccelMapAddEntry",
"(",
"path",
"string",
",",
"<mask>",
"uint",
",",
"mods",
"gdk",
".",
"ModifierType",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"path",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n\n",
"C",
".",
"gtk_accel_map_add_entry",
"(",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
",",
"C",
".",
"guint",
"(",
"key",
")",
",",
"C",
".",
"GdkModifierType",
"(",
"mods",
")",
")",
"\n",
"}"
] |
24,247 | all-24248 | [
"DisableSvcFlapDetection",
"creates",
"a",
"new",
"DISABLE_SVC_FLAP_DETECTION",
"Nagios",
"command",
".",
"Disables",
"flap",
"detection",
"for",
"the",
"specified",
"service",
"."
] | [
"func",
"DisableSvcFlapDetection",
"(",
"host_name",
"<mask>",
",",
"service_description",
"string",
",",
")",
"*",
"livestatus",
".",
"Command",
"{",
"return",
"livestatus",
".",
"NewCommand",
"(",
"\"",
"\"",
",",
"stringifyArg",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"host_name",
")",
",",
"stringifyArg",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"service_description",
")",
",",
")",
"\n",
"}"
] |
24,248 | all-24249 | [
"MarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Marshaler",
"."
] | [
"func",
"(",
"t",
"ValueNativeSourceType",
")",
"MarshalEasyJSON",
"(",
"<mask>",
"*",
"jwriter",
".",
"Writer",
")",
"{",
"out",
".",
"String",
"(",
"string",
"(",
"t",
")",
")",
"\n",
"}"
] |
24,249 | all-24250 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"a",
"specified",
"program",
"object"
] | [
"func",
"ProgramUniformMatrix4x2fv",
"(",
"program",
"uint32",
",",
"location",
"int32",
",",
"<mask>",
"int32",
",",
"transpose",
"bool",
",",
"value",
"*",
"float32",
")",
"{",
"C",
".",
"glowProgramUniformMatrix4x2fv",
"(",
"gpProgramUniformMatrix4x2fv",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"program",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"location",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"count",
")",
",",
"(",
"C",
".",
"GLboolean",
")",
"(",
"boolToInt",
"(",
"transpose",
")",
")",
",",
"(",
"*",
"C",
".",
"GLfloat",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"value",
")",
")",
")",
"\n",
"}"
] |
24,250 | all-24251 | [
"UpdateRecord",
"wraps",
"the",
"Update",
"method",
"of",
"the",
"API",
"s",
"Record",
"service"
] | [
"func",
"(",
"n",
"NS1DomainService",
")",
"UpdateRecord",
"(",
"r",
"*",
"dns",
".",
"Record",
")",
"(",
"*",
"http",
".",
"Response",
",",
"error",
")",
"{",
"return",
"n",
".",
"<mask>",
".",
"Records",
".",
"Update",
"(",
"r",
")",
"\n",
"}"
] |
24,251 | all-24252 | [
"export",
"FileSequence_SetFrameSet"
] | [
"func",
"FileSequence_SetFrameSet",
"(",
"id",
"FileSeqId",
",",
"fsetId",
"FrameSetId",
")",
"bool",
"{",
"fs",
",",
"ok",
":=",
"sFileSeqs",
".",
"Get",
"(",
"id",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"fset",
",",
"ok",
":=",
"sFrameSets",
".",
"Get",
"(",
"fsetId",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"<mask>",
".",
"SetFrameSet",
"(",
"&",
"fset",
".",
"FrameSet",
")",
"\n",
"return",
"true",
"\n",
"}"
] |
24,252 | all-24253 | [
"GetHeading",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_app_chooser_button_get_heading",
"()",
".",
"In",
"case",
"when",
"gtk_app_chooser_button_get_heading",
"()",
"returns",
"a",
"nil",
"string",
"GetHeading",
"()",
"returns",
"a",
"non",
"-",
"nil",
"error",
"."
] | [
"func",
"(",
"v",
"*",
"AppChooserButton",
")",
"GetHeading",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"cstr",
":=",
"C",
".",
"gtk_app_chooser_button_get_heading",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"cstr",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"return",
"C",
".",
"GoString",
"(",
"(",
"*",
"C",
".",
"<mask>",
")",
"(",
"cstr",
")",
")",
",",
"nil",
"\n",
"}"
] |
24,253 | all-24254 | [
"NewTCPTransportWithConfig",
"returns",
"a",
"NetworkTransport",
"that",
"is",
"built",
"on",
"top",
"of",
"a",
"TCP",
"streaming",
"transport",
"layer",
"using",
"the",
"given",
"config",
"struct",
"."
] | [
"func",
"NewTCPTransportWithConfig",
"(",
"bindAddr",
"string",
",",
"advertise",
"net",
".",
"Addr",
",",
"config",
"*",
"NetworkTransportConfig",
",",
")",
"(",
"*",
"NetworkTransport",
",",
"error",
")",
"{",
"return",
"newTCPTransport",
"(",
"bindAddr",
",",
"advertise",
",",
"func",
"(",
"<mask>",
"StreamLayer",
")",
"*",
"NetworkTransport",
"{",
"config",
".",
"Stream",
"=",
"stream",
"\n",
"return",
"NewNetworkTransportWithConfig",
"(",
"config",
")",
"\n",
"}",
")",
"\n",
"}"
] |
24,254 | all-24255 | [
"squeeze",
"Performs",
"a",
"squeeze",
"operation",
"using",
"Blake2b",
"s",
"G",
"function",
"as",
"the",
"internal",
"permutation"
] | [
"func",
"squeeze",
"(",
"state",
"[",
"]",
"uint64",
",",
"out",
"[",
"]",
"byte",
")",
"{",
"tmp",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"blockLenBytes",
")",
"\n",
"for",
"j",
":=",
"0",
";",
"j",
"<",
"len",
"(",
"<mask>",
")",
"/",
"blockLenBytes",
"+",
"1",
";",
"j",
"++",
"{",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"blockLenInt64",
";",
"i",
"++",
"{",
"binary",
".",
"LittleEndian",
".",
"PutUint64",
"(",
"tmp",
"[",
"i",
"*",
"8",
":",
"]",
",",
"state",
"[",
"i",
"]",
")",
"\n",
"}",
"\n",
"copy",
"(",
"out",
"[",
"j",
"*",
"blockLenBytes",
":",
"]",
",",
"tmp",
")",
"//be care in case of len(out[i:])<len(tmp)",
"\n",
"blake2bLyra",
"(",
"state",
")",
"\n",
"}",
"\n",
"}"
] |
24,255 | all-24256 | [
"handleContainerStoppedTransitionError",
"handles",
"an",
"error",
"when",
"transitioning",
"a",
"container",
"to",
"STOPPED",
".",
"It",
"returns",
"a",
"boolean",
"indicating",
"whether",
"the",
"tak",
"can",
"continue",
"with",
"updating",
"its",
"state"
] | [
"func",
"(",
"mtask",
"*",
"managedTask",
")",
"handleContainerStoppedTransitionError",
"(",
"event",
"dockerapi",
".",
"DockerContainerChangeEvent",
",",
"container",
"*",
"apicontainer",
".",
"Container",
",",
"currentKnownStatus",
"apicontainerstatus",
".",
"ContainerStatus",
")",
"bool",
"{",
"// If we were trying to transition to stopped and had a timeout error",
"// from docker, reset the known status to the current status and return",
"// This ensures that we don't emit a containerstopped event; a",
"// terminal container event from docker event stream will instead be",
"// responsible for the transition. Alternatively, the steadyState check",
"// could also trigger the progress and have another go at stopping the",
"// container",
"if",
"event",
".",
"Error",
".",
"ErrorName",
"(",
")",
"==",
"dockerapi",
".",
"DockerTimeoutErrorName",
"{",
"seelog",
".",
"Infof",
"(",
"\"",
"\"",
",",
"mtask",
".",
"Arn",
",",
"dockerapi",
".",
"DockerTimeoutErrorName",
",",
"container",
".",
"Name",
",",
"event",
".",
"<mask>",
".",
"Error",
"(",
")",
")",
"\n",
"container",
".",
"SetKnownStatus",
"(",
"currentKnownStatus",
")",
"\n",
"return",
"false",
"\n",
"}",
"\n",
"// If docker returned a transient error while trying to stop a container,",
"// reset the known status to the current status and return",
"cannotStopContainerError",
",",
"ok",
":=",
"event",
".",
"Error",
".",
"(",
"cannotStopContainerError",
")",
"\n",
"if",
"ok",
"&&",
"cannotStopContainerError",
".",
"IsRetriableError",
"(",
")",
"{",
"seelog",
".",
"Infof",
"(",
"\"",
"\"",
",",
"mtask",
".",
"Arn",
",",
"container",
".",
"Name",
",",
"cannotStopContainerError",
".",
"Error",
"(",
")",
")",
"\n",
"container",
".",
"SetKnownStatus",
"(",
"currentKnownStatus",
")",
"\n",
"return",
"false",
"\n",
"}",
"\n\n",
"// If we were trying to transition to stopped and had an error, we",
"// clearly can't just continue trying to transition it to stopped",
"// again and again. In this case, assume it's stopped (or close",
"// enough) and get on with it",
"// This can happen in cases where the container we tried to stop",
"// was already stopped or did not exist at all.",
"seelog",
".",
"Warnf",
"(",
"\"",
"\"",
",",
"mtask",
".",
"Arn",
",",
"container",
".",
"Name",
",",
"event",
".",
"Error",
".",
"ErrorName",
"(",
")",
",",
"event",
".",
"Error",
".",
"Error",
"(",
")",
")",
"\n",
"container",
".",
"SetKnownStatus",
"(",
"apicontainerstatus",
".",
"ContainerStopped",
")",
"\n",
"container",
".",
"SetDesiredStatus",
"(",
"apicontainerstatus",
".",
"ContainerStopped",
")",
"\n",
"return",
"true",
"\n",
"}"
] |
24,256 | all-24257 | [
"GetFilesApprovers",
"returns",
"a",
"map",
"from",
"files",
"-",
">",
"list",
"of",
"current",
"approvers",
"."
] | [
"func",
"(",
"ap",
"Approvers",
")",
"GetFilesApprovers",
"(",
")",
"map",
"[",
"string",
"]",
"sets",
".",
"<mask>",
"{",
"filesApprovers",
":=",
"map",
"[",
"string",
"]",
"sets",
".",
"String",
"{",
"}",
"\n",
"currentApprovers",
":=",
"ap",
".",
"GetCurrentApproversSetCased",
"(",
")",
"\n",
"for",
"fn",
",",
"potentialApprovers",
":=",
"range",
"ap",
".",
"owners",
".",
"GetApprovers",
"(",
")",
"{",
"// The order of parameter matters here:",
"// - currentApprovers is the list of github handles that have approved",
"// - potentialApprovers is the list of handles in the OWNER",
"// files (lower case).",
"//",
"// We want to keep the syntax of the github handle",
"// rather than the potential mis-cased username found in",
"// the OWNERS file, that's why it's the first parameter.",
"filesApprovers",
"[",
"fn",
"]",
"=",
"IntersectSetsCase",
"(",
"currentApprovers",
",",
"potentialApprovers",
")",
"\n",
"}",
"\n\n",
"return",
"filesApprovers",
"\n",
"}"
] |
24,257 | all-24258 | [
"HasRequests",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"ScatterplotDefinition",
")",
"HasRequests",
"(",
")",
"bool",
"{",
"if",
"s",
"!=",
"nil",
"&&",
"s",
".",
"Requests",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
24,258 | all-24259 | [
"GetComment",
"returns",
"the",
"Comment",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"r",
"*",
"reqComment",
")",
"GetComment",
"(",
")",
"Comment",
"{",
"if",
"r",
"==",
"nil",
"||",
"r",
".",
"Comment",
"==",
"nil",
"{",
"return",
"Comment",
"{",
"}",
"\n",
"}",
"\n",
"return",
"*",
"r",
".",
"<mask>",
"\n",
"}"
] |
24,259 | all-24260 | [
"recordsForPrivateZone",
"gets",
"the",
"current",
"records",
".",
"Returns",
"the",
"current",
"records",
"or",
"an",
"error",
"if",
"the",
"operation",
"failed",
"."
] | [
"func",
"(",
"p",
"*",
"AlibabaCloudProvider",
")",
"privateZoneRecords",
"(",
")",
"(",
"endpoints",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
",",
"_",
"error",
")",
"{",
"zones",
",",
"err",
":=",
"p",
".",
"getPrivateZones",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"<mask>",
":=",
"range",
"zones",
"{",
"recordMap",
":=",
"p",
".",
"groupPrivateZoneRecords",
"(",
"zone",
")",
"\n",
"for",
"_",
",",
"recordList",
":=",
"range",
"recordMap",
"{",
"name",
":=",
"p",
".",
"getDNSName",
"(",
"recordList",
"[",
"0",
"]",
".",
"Rr",
",",
"zone",
".",
"ZoneName",
")",
"\n",
"recordType",
":=",
"recordList",
"[",
"0",
"]",
".",
"Type",
"\n",
"ttl",
":=",
"recordList",
"[",
"0",
"]",
".",
"Ttl",
"\n",
"if",
"ttl",
"==",
"defaultAlibabaCloudPrivateZoneRecordTTL",
"{",
"ttl",
"=",
"0",
"\n",
"}",
"\n",
"var",
"targets",
"[",
"]",
"string",
"\n",
"for",
"_",
",",
"record",
":=",
"range",
"recordList",
"{",
"target",
":=",
"record",
".",
"Value",
"\n",
"if",
"recordType",
"==",
"\"",
"\"",
"{",
"target",
"=",
"p",
".",
"unescapeTXTRecordValue",
"(",
"target",
")",
"\n",
"}",
"\n",
"targets",
"=",
"append",
"(",
"targets",
",",
"target",
")",
"\n",
"}",
"\n",
"ep",
":=",
"endpoint",
".",
"NewEndpointWithTTL",
"(",
"name",
",",
"recordType",
",",
"endpoint",
".",
"TTL",
"(",
"ttl",
")",
",",
"targets",
"...",
")",
"\n",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"ep",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"endpoints",
",",
"nil",
"\n",
"}"
] |
24,260 | all-24261 | [
"PeekNextPattern",
"returns",
"next",
"entry",
"pattern",
"with",
"offset",
"size"
] | [
"func",
"PeekNextPattern",
"(",
"p",
"[",
"]",
"string",
")",
"(",
"pat",
"string",
",",
"size",
"int",
")",
"{",
"if",
"isNextSuffixPattern",
"(",
"p",
")",
"{",
"pat",
",",
"size",
"=",
"(",
"p",
"[",
"0",
"]",
"+",
"p",
"[",
"1",
"]",
")",
",",
"2",
"\n",
"}",
"else",
"{",
"pat",
",",
"<mask>",
"=",
"p",
"[",
"0",
"]",
",",
"1",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
24,261 | all-24262 | [
"SetVAlign",
"is",
"a",
"wrapper",
"around",
"gtk_widget_set_valign",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Widget",
")",
"SetVAlign",
"(",
"align",
"Align",
")",
"{",
"C",
".",
"gtk_widget_set_valign",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkAlign",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
24,262 | all-24263 | [
"NewBufferIterator",
"returns",
"a",
"new",
"iterator",
"that",
"buffers",
"the",
"values",
"within",
"the",
"time",
"range",
"of",
"the",
"current",
"element",
"and",
"the",
"duration",
"of",
"delta",
"before",
"."
] | [
"func",
"NewBufferIterator",
"(",
"it",
"SeriesIterator",
",",
"delta",
"int64",
")",
"*",
"BufferedSeriesIterator",
"{",
"bit",
":=",
"&",
"BufferedSeriesIterator",
"{",
"buf",
":",
"newSampleRing",
"(",
"delta",
",",
"16",
")",
",",
"delta",
":",
"delta",
",",
"}",
"\n",
"bit",
".",
"Reset",
"(",
"<mask>",
")",
"\n\n",
"return",
"bit",
"\n",
"}"
] |
24,263 | all-24264 | [
"WithModifiers",
"bit",
"field",
"representing",
"pressed",
"modifier",
"keys",
".",
"Alt",
"=",
"1",
"Ctrl",
"=",
"2",
"Meta",
"/",
"Command",
"=",
"4",
"Shift",
"=",
"8",
"(",
"default",
":",
"0",
")",
"."
] | [
"func",
"(",
"p",
"DispatchTouchEventParams",
")",
"WithModifiers",
"(",
"modifiers",
"Modifier",
")",
"*",
"DispatchTouchEventParams",
"{",
"p",
".",
"Modifiers",
"=",
"modifiers",
"\n",
"<mask>",
"&",
"p",
"\n",
"}"
] |
24,264 | all-24265 | [
"Apps",
"returns",
"a",
"AppInformer",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"Apps",
"(",
")",
"AppInformer",
"{",
"return",
"&",
"appInformer",
"{",
"factory",
":",
"v",
".",
"factory",
",",
"namespace",
":",
"v",
".",
"namespace",
",",
"tweakListOptions",
":",
"v",
".",
"tweakListOptions",
"}",
"\n",
"}"
] |
24,265 | all-24266 | [
"Match",
"finds",
"the",
"schema",
"for",
"metric",
"or",
"returns",
"false",
"if",
"none",
"found"
] | [
"func",
"(",
"s",
"WhisperSchemas",
")",
"Match",
"(",
"metric",
"string",
")",
"(",
"Schema",
",",
"bool",
")",
"{",
"for",
"_",
",",
"schema",
":=",
"range",
"s",
"{",
"if",
"schema",
".",
"<mask>",
".",
"MatchString",
"(",
"metric",
")",
"{",
"return",
"schema",
",",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"Schema",
"{",
"}",
",",
"false",
"\n",
"}"
] |
24,266 | all-24267 | [
"Load",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockCgroupFactory",
")",
"Load",
"(",
"arg0",
"cgroups",
".",
"Hierarchy",
",",
"arg1",
"cgroups",
".",
"Path",
")",
"(",
"cgroups",
".",
"Cgroup",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"cgroups",
".",
"Cgroup",
")",
"\n",
"ret1",
",",
"_",
":=",
"<mask>",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] |
24,267 | all-24268 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetShowScrollBottleneckRectsParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoOverlay1",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
24,268 | all-24269 | [
"HasTickPos",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"n",
"*",
"NoteDefinition",
")",
"HasTickPos",
"(",
")",
"bool",
"{",
"if",
"n",
"!=",
"nil",
"&&",
"n",
".",
"TickPos",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
24,269 | all-24270 | [
"apiRequest",
"manages",
"retry",
"strategy",
"for",
"exponential",
"backoffs"
] | [
"func",
"(",
"a",
"*",
"API",
")",
"apiRequest",
"(",
"reqMethod",
"string",
",",
"reqPath",
"string",
",",
"data",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"backoffs",
":=",
"[",
"]",
"uint",
"{",
"2",
",",
"4",
",",
"8",
",",
"16",
",",
"32",
"}",
"\n",
"attempts",
":=",
"0",
"\n",
"success",
":=",
"false",
"\n\n",
"var",
"result",
"[",
"]",
"byte",
"\n",
"var",
"err",
"error",
"\n\n",
"for",
"!",
"success",
"{",
"result",
",",
"err",
"=",
"a",
".",
"apiCall",
"(",
"reqMethod",
",",
"reqPath",
",",
"data",
")",
"\n",
"if",
"err",
"==",
"nil",
"{",
"success",
"=",
"true",
"\n",
"}",
"\n\n",
"// break and return error if not using exponential backoff",
"if",
"err",
"!=",
"nil",
"{",
"if",
"!",
"a",
".",
"useExponentialBackoff",
"{",
"break",
"\n",
"}",
"\n",
"if",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"\"",
"\"",
")",
"{",
"break",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"!",
"success",
"{",
"var",
"wait",
"float64",
"\n",
"if",
"attempts",
">=",
"len",
"(",
"backoffs",
")",
"{",
"wait",
"=",
"backoff",
"(",
"backoffs",
"[",
"len",
"(",
"backoffs",
")",
"-",
"1",
"]",
")",
"\n",
"}",
"else",
"{",
"wait",
"=",
"backoff",
"(",
"backoffs",
"[",
"attempts",
"]",
")",
"\n",
"}",
"\n",
"attempts",
"++",
"\n",
"a",
".",
"Log",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"err",
".",
"Error",
"(",
")",
",",
"uint",
"(",
"wait",
")",
")",
"\n",
"time",
".",
"Sleep",
"(",
"time",
".",
"Duration",
"(",
"wait",
")",
"*",
"<mask>",
".",
"Second",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"result",
",",
"err",
"\n",
"}"
] |
24,270 | all-24271 | [
"Get",
"the",
"instance",
"number",
"of",
"an",
"instance",
"in",
"a",
"server",
"array",
".",
"This",
"assumes",
"that",
"the",
"server",
"array",
"instance",
"is",
"not",
"renamed",
"from",
"the",
"default",
"name",
".",
"For",
"example",
"if",
"the",
"instance",
"name",
"is",
"App",
"Server",
"#4",
"this",
"will",
"return",
"#4",
"."
] | [
"func",
"getInstanceNumber",
"(",
"name",
"string",
")",
"string",
"{",
"<mask>",
",",
"_",
":=",
"regexp",
".",
"Compile",
"(",
"`#\\d+$`",
")",
"\n",
"matches",
":=",
"re",
".",
"FindStringSubmatch",
"(",
"name",
")",
"\n",
"if",
"len",
"(",
"matches",
")",
"==",
"0",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"matches",
"[",
"len",
"(",
"matches",
")",
"-",
"1",
"]",
"\n",
"}"
] |
24,271 | all-24272 | [
"Calculates",
"the",
"per",
"-",
"element",
"difference",
"between",
"a",
"scalar",
"and",
"an",
"array",
"with",
"a",
"mask",
".",
"dst",
"=",
"value",
"-",
"src"
] | [
"func",
"SubScalarWithMaskRev",
"(",
"value",
"Scalar",
",",
"src",
",",
"dst",
",",
"mask",
"*",
"IplImage",
")",
"{",
"C",
".",
"cvSubRS",
"(",
"unsafe",
".",
"Pointer",
"(",
"src",
")",
",",
"(",
"C",
".",
"CvScalar",
")",
"(",
"value",
")",
",",
"unsafe",
".",
"Pointer",
"(",
"dst",
")",
",",
"unsafe",
".",
"Pointer",
"(",
"<mask>",
")",
",",
")",
"\n",
"}"
] |
24,272 | all-24273 | [
"UpdateCheckBundleMetrics",
"updates",
"passed",
"metrics",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"UpdateCheckBundleMetrics",
"(",
"cfg",
"*",
"CheckBundleMetrics",
")",
"(",
"*",
"CheckBundleMetrics",
",",
"error",
")",
"{",
"if",
"cfg",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"metricsCID",
":=",
"string",
"(",
"cfg",
".",
"CID",
")",
"\n\n",
"matched",
",",
"err",
":=",
"regexp",
".",
"MatchString",
"(",
"config",
".",
"CheckBundleMetricsCIDRegex",
",",
"metricsCID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"!",
"matched",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"metricsCID",
")",
"\n",
"}",
"\n\n",
"jsonCfg",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"cfg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"a",
".",
"Debug",
"{",
"a",
".",
"Log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"string",
"(",
"jsonCfg",
")",
")",
"\n",
"}",
"\n\n",
"<mask>",
",",
"err",
":=",
"a",
".",
"Put",
"(",
"metricsCID",
",",
"jsonCfg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"metrics",
":=",
"&",
"CheckBundleMetrics",
"{",
"}",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"result",
",",
"metrics",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"metrics",
",",
"nil",
"\n",
"}"
] |
24,273 | all-24274 | [
"ReadCommand",
"reads",
"a",
"command",
"from",
"the",
"buffered",
"input",
"r",
"returning",
"it",
"or",
"an",
"error",
"if",
"something",
"went",
"wrong",
".",
"if",
"cmd",
"err",
":",
"=",
"nsq",
".",
"ReadCommand",
"(",
"r",
")",
";",
"err",
"!",
"=",
"nil",
"{",
"//",
"handle",
"the",
"error",
"...",
"}",
"else",
"{",
"switch",
"c",
":",
"=",
"cmd",
".",
"(",
"type",
")",
"{",
"case",
"nsq",
".",
"Pub",
":",
"...",
"}",
"}"
] | [
"func",
"ReadCommand",
"(",
"r",
"*",
"bufio",
".",
"Reader",
")",
"(",
"cmd",
"Command",
",",
"err",
"error",
")",
"{",
"var",
"line",
"string",
"\n\n",
"if",
"line",
",",
"err",
"=",
"r",
".",
"ReadString",
"(",
"'\\n'",
")",
";",
"err",
"!=",
"nil",
"{",
"err",
"=",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"if",
"n",
":=",
"len",
"(",
"<mask>",
")",
";",
"n",
"==",
"0",
"||",
"line",
"[",
"n",
"-",
"1",
"]",
"!=",
"'\\n'",
"{",
"err",
"=",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"else",
"{",
"line",
"=",
"line",
"[",
":",
"n",
"-",
"1",
"]",
"\n",
"}",
"\n\n",
"if",
"line",
"==",
"\"",
"\"",
"{",
"return",
"readIdentify",
"(",
"r",
")",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"{",
"return",
"readSub",
"(",
"line",
"[",
"4",
":",
"]",
")",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"{",
"return",
"readPub",
"(",
"line",
"[",
"4",
":",
"]",
",",
"r",
")",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"{",
"return",
"readMPub",
"(",
"line",
"[",
"5",
":",
"]",
",",
"r",
")",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"{",
"return",
"readRdy",
"(",
"line",
"[",
"4",
":",
"]",
")",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"{",
"return",
"readFin",
"(",
"line",
"[",
"4",
":",
"]",
")",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"{",
"return",
"readReq",
"(",
"line",
"[",
"4",
":",
"]",
")",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"{",
"return",
"readTouch",
"(",
"line",
"[",
"6",
":",
"]",
")",
"\n",
"}",
"\n\n",
"if",
"line",
"==",
"\"",
"\"",
"{",
"return",
"readAuth",
"(",
"r",
")",
"\n",
"}",
"\n\n",
"if",
"line",
"==",
"\"",
"\"",
"{",
"cmd",
"=",
"Cls",
"{",
"}",
"\n",
"return",
"\n",
"}",
"\n\n",
"if",
"line",
"==",
"\"",
"\"",
"{",
"cmd",
"=",
"Nop",
"{",
"}",
"\n",
"return",
"\n",
"}",
"\n\n",
"err",
"=",
"errors",
".",
"New",
"(",
"\"",
"\"",
"+",
"line",
")",
"\n",
"return",
"\n",
"}"
] |
24,274 | all-24275 | [
"UpdateStatus",
"was",
"generated",
"because",
"the",
"type",
"contains",
"a",
"Status",
"member",
".",
"Add",
"a",
"+",
"genclient",
":",
"noStatus",
"comment",
"above",
"the",
"type",
"to",
"avoid",
"generating",
"UpdateStatus",
"()",
"."
] | [
"func",
"(",
"c",
"*",
"FakeProwJobs",
")",
"UpdateStatus",
"(",
"prowJob",
"*",
"prowjobsv1",
".",
"ProwJob",
")",
"(",
"*",
"prowjobsv1",
".",
"ProwJob",
",",
"error",
")",
"{",
"obj",
",",
"err",
":=",
"c",
".",
"Fake",
".",
"Invokes",
"(",
"testing",
".",
"NewUpdateSubresourceAction",
"(",
"prowjobsResource",
",",
"\"",
"\"",
",",
"c",
".",
"<mask>",
",",
"prowJob",
")",
",",
"&",
"prowjobsv1",
".",
"ProwJob",
"{",
"}",
")",
"\n\n",
"if",
"obj",
"==",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"obj",
".",
"(",
"*",
"prowjobsv1",
".",
"ProwJob",
")",
",",
"err",
"\n",
"}"
] |
24,275 | all-24276 | [
"Wrap",
"returns",
"a",
"handler",
"which",
"adds",
"the",
"following",
"URLs",
"as",
"special",
"cases",
":",
"/",
"debug",
"/",
"pprof",
"/",
"--",
"an",
"HTML",
"index",
"of",
"pprof",
"endpoints",
"/",
"debug",
"/",
"pprof",
"/",
"cmdline",
"--",
"the",
"running",
"process",
"s",
"command",
"line",
"/",
"debug",
"/",
"pprof",
"/",
"profile",
"--",
"pprof",
"profiling",
"endpoint",
"/",
"debug",
"/",
"pprof",
"/",
"symbol",
"--",
"pprof",
"debugging",
"symbols",
"/",
"debug",
"/",
"vars",
"--",
"JSON",
"-",
"formatted",
"expvars"
] | [
"func",
"Wrap",
"(",
"handler",
"http",
".",
"<mask>",
")",
"http",
".",
"Handler",
"{",
"mux",
":=",
"http",
".",
"NewServeMux",
"(",
")",
"\n",
"mux",
".",
"HandleFunc",
"(",
"\"",
"\"",
",",
"pprof",
".",
"Index",
")",
"\n",
"mux",
".",
"HandleFunc",
"(",
"\"",
"\"",
",",
"pprof",
".",
"Cmdline",
")",
"\n",
"mux",
".",
"HandleFunc",
"(",
"\"",
"\"",
",",
"pprof",
".",
"Profile",
")",
"\n",
"mux",
".",
"HandleFunc",
"(",
"\"",
"\"",
",",
"pprof",
".",
"Symbol",
")",
"\n",
"mux",
".",
"HandleFunc",
"(",
"\"",
"\"",
",",
"blockHandler",
")",
"\n",
"mux",
".",
"HandleFunc",
"(",
"\"",
"\"",
",",
"expvarHandler",
")",
"\n",
"mux",
".",
"HandleFunc",
"(",
"\"",
"\"",
",",
"performGC",
")",
"\n",
"mux",
".",
"Handle",
"(",
"\"",
"\"",
",",
"handler",
")",
"\n",
"return",
"mux",
"\n",
"}"
] |
24,276 | all-24277 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"Viewport",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage2",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
24,277 | all-24278 | [
"SetScheme",
"sets",
"URI",
"scheme",
"i",
".",
"e",
".",
"http",
"https",
"ftp",
"etc",
"."
] | [
"func",
"(",
"u",
"*",
"URI",
")",
"SetScheme",
"(",
"scheme",
"string",
")",
"{",
"u",
".",
"scheme",
"=",
"<mask>",
"(",
"u",
".",
"scheme",
"[",
":",
"0",
"]",
",",
"scheme",
"...",
")",
"\n",
"lowercaseBytes",
"(",
"u",
".",
"scheme",
")",
"\n",
"}"
] |
24,278 | all-24279 | [
"AddFlagsWithoutDefaultGitHubTokenPath",
"injects",
"GitHub",
"options",
"into",
"the",
"given",
"Flagset",
"without",
"setting",
"a",
"default",
"for",
"for",
"the",
"githubTokenPath",
"allowing",
"to",
"use",
"an",
"anonymous",
"GitHub",
"client"
] | [
"func",
"(",
"o",
"*",
"GitHubOptions",
")",
"AddFlagsWithoutDefaultGitHubTokenPath",
"(",
"<mask>",
"*",
"flag",
".",
"FlagSet",
")",
"{",
"o",
".",
"addFlags",
"(",
"false",
",",
"fs",
")",
"\n",
"}"
] |
24,279 | all-24280 | [
"DiscoverWalk",
"will",
"make",
"HTTPS",
"requests",
"to",
"find",
"discovery",
"meta",
"tags",
"and",
"optionally",
"will",
"use",
"HTTP",
"if",
"insecure",
"is",
"set",
".",
"Based",
"on",
"the",
"response",
"of",
"the",
"discoverFn",
"it",
"will",
"continue",
"to",
"recurse",
"up",
"the",
"tree",
"."
] | [
"func",
"DiscoverWalk",
"(",
"app",
"App",
",",
"insecure",
"discovery",
".",
"InsecureOption",
",",
"discoverFn",
"DiscoverWalkFunc",
")",
"(",
"err",
"error",
")",
"{",
"var",
"(",
"eps",
"*",
"Endpoints",
"\n",
")",
"\n\n",
"parts",
":=",
"strings",
".",
"Split",
"(",
"string",
"(",
"app",
".",
"<mask>",
")",
",",
"\"",
"\"",
")",
"\n",
"for",
"i",
":=",
"range",
"parts",
"{",
"end",
":=",
"len",
"(",
"parts",
")",
"-",
"i",
"\n",
"pre",
":=",
"strings",
".",
"Join",
"(",
"parts",
"[",
":",
"end",
"]",
",",
"\"",
"\"",
")",
"\n\n",
"eps",
",",
"err",
"=",
"doDiscover",
"(",
"pre",
",",
"app",
",",
"insecure",
")",
"\n",
"if",
"derr",
":=",
"discoverFn",
"(",
"pre",
",",
"eps",
",",
"err",
")",
";",
"derr",
"!=",
"nil",
"{",
"return",
"derr",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
] |
24,280 | all-24281 | [
"GetPage",
"returns",
"a",
"single",
"page",
"of",
"resources",
".",
"To",
"retrieve",
"multiple",
"pages",
"use",
"GetPageIterator",
"."
] | [
"func",
"(",
"m",
"*",
"MessageService",
")",
"GetPage",
"(",
"ctx",
"context",
".",
"Context",
",",
"<mask>",
"url",
".",
"Values",
")",
"(",
"*",
"MessagePage",
",",
"error",
")",
"{",
"iter",
":=",
"m",
".",
"GetPageIterator",
"(",
"data",
")",
"\n",
"return",
"iter",
".",
"Next",
"(",
"ctx",
")",
"\n",
"}"
] |
24,281 | all-24282 | [
"Query",
"runs",
"a",
"GraphQL",
"query",
"using",
"shurcooL",
"/",
"githubql",
"s",
"client",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"Query",
"(",
"ctx",
"context",
".",
"Context",
",",
"q",
"interface",
"{",
"}",
",",
"vars",
"map",
"[",
"string",
"]",
"<mask>",
"{",
"}",
")",
"error",
"{",
"// Don't log query here because Query is typically called multiple times to get all pages.",
"// Instead log once per search and include total search cost.",
"return",
"c",
".",
"gqlc",
".",
"Query",
"(",
"ctx",
",",
"q",
",",
"vars",
")",
"\n",
"}"
] |
24,282 | all-24283 | [
"GetNoIssueApproversSet",
"returns",
"the",
"set",
"of",
"no",
"-",
"issue",
"approvers",
"(",
"login",
"only",
")"
] | [
"func",
"(",
"ap",
"Approvers",
")",
"GetNoIssueApproversSet",
"(",
")",
"sets",
".",
"<mask>",
"{",
"approvers",
":=",
"sets",
".",
"NewString",
"(",
")",
"\n\n",
"for",
"approver",
":=",
"range",
"ap",
".",
"NoIssueApprovers",
"(",
")",
"{",
"approvers",
".",
"Insert",
"(",
"approver",
")",
"\n",
"}",
"\n\n",
"return",
"approvers",
"\n",
"}"
] |
24,283 | all-24284 | [
"AddMessage",
"creates",
"a",
"new",
"asynchronous",
"consumer",
"expectation"
] | [
"func",
"(",
"p",
"*",
"Pact",
")",
"AddMessage",
"(",
")",
"*",
"Message",
"{",
"log",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n\n",
"m",
":=",
"&",
"Message",
"{",
"}",
"\n",
"p",
".",
"MessageInteractions",
"=",
"<mask>",
"(",
"p",
".",
"MessageInteractions",
",",
"m",
")",
"\n",
"return",
"m",
"\n",
"}"
] |
24,284 | all-24285 | [
"InsertWithValues",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_list_store_insert_with_valuesv",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"ListStore",
")",
"InsertWithValues",
"(",
"iter",
"*",
"TreeIter",
",",
"position",
"int",
",",
"inColumns",
"[",
"]",
"int",
",",
"inValues",
"[",
"]",
"interface",
"{",
"}",
")",
"error",
"{",
"length",
":=",
"len",
"(",
"inColumns",
")",
"\n",
"if",
"len",
"(",
"inValues",
")",
"<",
"length",
"{",
"length",
"=",
"len",
"(",
"inValues",
")",
"\n",
"}",
"\n\n",
"var",
"cColumns",
"[",
"]",
"C",
".",
"gint",
"\n",
"var",
"cValues",
"[",
"]",
"C",
".",
"GValue",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
"{",
"cColumns",
"=",
"append",
"(",
"cColumns",
",",
"C",
".",
"gint",
"(",
"inColumns",
"[",
"i",
"]",
")",
")",
"\n\n",
"gv",
",",
"err",
":=",
"glib",
".",
"GValue",
"(",
"inValues",
"[",
"i",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"var",
"cvp",
"*",
"C",
".",
"GValue",
"=",
"(",
"*",
"C",
".",
"GValue",
")",
"(",
"gv",
".",
"Native",
"(",
")",
")",
"\n",
"cValues",
"=",
"<mask>",
"(",
"cValues",
",",
"*",
"cvp",
")",
"\n",
"}",
"\n",
"var",
"cColumnsPointer",
"*",
"C",
".",
"gint",
"=",
"&",
"cColumns",
"[",
"0",
"]",
"\n",
"var",
"cValuesPointer",
"*",
"C",
".",
"GValue",
"=",
"&",
"cValues",
"[",
"0",
"]",
"\n\n",
"C",
".",
"gtk_list_store_insert_with_valuesv",
"(",
"v",
".",
"native",
"(",
")",
",",
"iter",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"position",
")",
",",
"cColumnsPointer",
",",
"cValuesPointer",
",",
"C",
".",
"gint",
"(",
"length",
")",
")",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
24,285 | all-24286 | [
"ImageAliasRename",
"renames",
"the",
"alias",
"with",
"the",
"given",
"ID",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"ImageAliasRename",
"(",
"id",
"int",
",",
"name",
"string",
")",
"error",
"{",
"err",
":=",
"exec",
"(",
"c",
".",
"db",
",",
"\"",
"\"",
",",
"<mask>",
",",
"id",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
24,286 | all-24287 | [
"Println",
"throw",
"logstr",
"to",
"channel",
"to",
"print",
"to",
"the",
"logger",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Println",
"."
] | [
"func",
"(",
"f",
"*",
"FileLogger",
")",
"Println",
"(",
"v",
"...",
"interface",
"{",
"}",
")",
"{",
"_",
",",
"file",
",",
"line",
",",
"_",
":=",
"runtime",
".",
"Caller",
"(",
"1",
")",
"//calldepth=2",
"\n",
"f",
".",
"logChan",
"<-",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"shortFileName",
"(",
"file",
")",
",",
"<mask>",
")",
"+",
"fmt",
".",
"Sprintln",
"(",
"v",
"...",
")",
"\n",
"}"
] |
24,287 | all-24288 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"ReplayXHRParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork26",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
24,288 | all-24289 | [
"ChildAt",
"returns",
"the",
"children",
"of",
"parent",
"control",
"that",
"is",
"at",
"absolute",
"coordinates",
"x",
"y",
".",
"Returns",
"nil",
"if",
"x",
"y",
"are",
"outside",
"parent",
"control",
"and",
"returns",
"parent",
"if",
"no",
"child",
"is",
"at",
"x",
"y"
] | [
"func",
"ChildAt",
"(",
"parent",
"Control",
",",
"x",
",",
"y",
"int",
")",
"Control",
"{",
"px",
",",
"py",
":=",
"parent",
".",
"Pos",
"(",
")",
"\n",
"pw",
",",
"ph",
":=",
"parent",
".",
"Size",
"(",
")",
"\n",
"if",
"px",
">",
"x",
"||",
"py",
">",
"y",
"||",
"px",
"+",
"pw",
"<=",
"x",
"||",
"py",
"+",
"ph",
"<=",
"y",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"parent",
".",
"Children",
"(",
")",
")",
"==",
"0",
"{",
"return",
"parent",
"\n",
"}",
"\n\n",
"<mask>",
"ctrl",
"Control",
"\n",
"ctrl",
"=",
"parent",
"\n",
"for",
"_",
",",
"child",
":=",
"range",
"parent",
".",
"Children",
"(",
")",
"{",
"if",
"!",
"child",
".",
"Visible",
"(",
")",
"{",
"continue",
"\n",
"}",
"\n\n",
"check",
":=",
"ChildAt",
"(",
"child",
",",
"x",
",",
"y",
")",
"\n",
"if",
"check",
"!=",
"nil",
"{",
"ctrl",
"=",
"check",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"ctrl",
"\n",
"}"
] |
24,289 | all-24290 | [
"NoCache",
"is",
"a",
"simple",
"piece",
"of",
"middleware",
"that",
"sets",
"a",
"number",
"of",
"HTTP",
"headers",
"to",
"prevent",
"a",
"router",
"(",
"or",
"subrouter",
")",
"from",
"being",
"cached",
"by",
"an",
"upstream",
"proxy",
"and",
"/",
"or",
"client",
".",
"As",
"per",
"http",
":",
"//",
"wiki",
".",
"nginx",
".",
"org",
"/",
"HttpProxyModule",
"-",
"NoCache",
"sets",
":",
"Expires",
":",
"Thu",
"01",
"Jan",
"1970",
"00",
":",
"00",
":",
"00",
"UTC",
"Cache",
"-",
"Control",
":",
"no",
"-",
"cache",
"private",
"max",
"-",
"age",
"=",
"0",
"X",
"-",
"Accel",
"-",
"Expires",
":",
"0",
"Pragma",
":",
"no",
"-",
"cache",
"(",
"for",
"HTTP",
"/",
"1",
".",
"0",
"proxies",
"/",
"clients",
")"
] | [
"func",
"NoCache",
"(",
"h",
"http",
".",
"Handler",
")",
"http",
".",
"Handler",
"{",
"fn",
":=",
"func",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"// Delete any ETag headers that may have been set",
"for",
"_",
",",
"v",
":=",
"range",
"etagHeaders",
"{",
"if",
"r",
".",
"Header",
".",
"Get",
"(",
"v",
")",
"!=",
"\"",
"\"",
"{",
"r",
".",
"Header",
".",
"Del",
"(",
"v",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Set our NoCache headers",
"for",
"k",
",",
"v",
":=",
"<mask>",
"noCacheHeaders",
"{",
"w",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"k",
",",
"v",
")",
"\n",
"}",
"\n\n",
"h",
".",
"ServeHTTP",
"(",
"w",
",",
"r",
")",
"\n",
"}",
"\n\n",
"return",
"http",
".",
"HandlerFunc",
"(",
"fn",
")",
"\n",
"}"
] |
24,290 | all-24291 | [
"LookupColor",
"is",
"a",
"wrapper",
"around",
"gtk_style_context_lookup_color",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"StyleContext",
")",
"LookupColor",
"(",
"colorName",
"string",
")",
"(",
"*",
"gdk",
".",
"RGBA",
",",
"bool",
")",
"{",
"cstr",
":=",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"C",
".",
"CString",
"(",
"colorName",
")",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"gdkColor",
":=",
"gdk",
".",
"NewRGBA",
"(",
")",
"\n",
"ret",
":=",
"C",
".",
"gtk_style_context_lookup_color",
"(",
"v",
".",
"native",
"(",
")",
",",
"cstr",
",",
"(",
"*",
"C",
".",
"GdkRGBA",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"gdkColor",
".",
"Native",
"(",
")",
")",
")",
")",
"\n",
"return",
"gdkColor",
",",
"gobool",
"(",
"<mask>",
")",
"\n",
"}"
] |
24,291 | all-24292 | [
"Closed",
"is",
"used",
"to",
"shutdown",
"the",
"pipeline",
"connection",
"."
] | [
"func",
"(",
"n",
"*",
"netPipeline",
")",
"Close",
"(",
")",
"error",
"{",
"n",
".",
"shutdownLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"n",
".",
"shutdownLock",
".",
"Unlock",
"(",
")",
"\n",
"if",
"n",
".",
"shutdown",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"// Release the connection",
"n",
".",
"conn",
".",
"Release",
"(",
")",
"\n\n",
"n",
".",
"shutdown",
"=",
"true",
"\n",
"<mask>",
"(",
"n",
".",
"shutdownCh",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
24,292 | all-24293 | [
"GetKeyContent",
"retrieves",
"and",
"returns",
"the",
"content",
"of",
"the",
"key",
"at",
"the",
"given",
"keystore",
"path",
".",
"Private",
"keys",
"are",
"write",
"-",
"only",
"so",
"they",
"cannot",
"be",
"retrieved",
"via",
"this",
"interface",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetKeyContent",
"(",
"path",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"return",
"c",
".",
"rawGet",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"<mask>",
"}",
",",
"nil",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
24,293 | all-24294 | [
"NaturalKey",
"returns",
"the",
"struct",
"fields",
"that",
"can",
"be",
"used",
"as",
"natural",
"key",
"for",
"uniquely",
"identifying",
"a",
"row",
"in",
"the",
"underlying",
"table",
"(",
"==",
".",
"By",
"convention",
"the",
"natural",
"key",
"field",
"is",
"the",
"one",
"called",
"Name",
"unless",
"specified",
"otherwise",
"with",
"the",
"db",
":",
"natural_key",
"tags",
"."
] | [
"func",
"(",
"m",
"*",
"Mapping",
")",
"NaturalKey",
"(",
")",
"[",
"]",
"*",
"<mask>",
"{",
"key",
":=",
"[",
"]",
"*",
"Field",
"{",
"}",
"\n\n",
"for",
"_",
",",
"field",
":=",
"range",
"m",
".",
"Fields",
"{",
"if",
"field",
".",
"Config",
".",
"Get",
"(",
"\"",
"\"",
")",
"!=",
"\"",
"\"",
"{",
"key",
"=",
"append",
"(",
"key",
",",
"field",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"key",
")",
"==",
"0",
"{",
"// Default primary key.",
"key",
"=",
"append",
"(",
"key",
",",
"m",
".",
"FieldByName",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"return",
"key",
"\n",
"}"
] |
24,294 | all-24295 | [
"FromUnparsedImage",
"returns",
"a",
"types",
".",
"Image",
"implementation",
"for",
"unparsed",
".",
"If",
"unparsed",
"represents",
"a",
"manifest",
"list",
".",
"Manifest",
"()",
"still",
"returns",
"the",
"manifest",
"list",
"but",
"other",
"methods",
"transparently",
"return",
"data",
"from",
"an",
"appropriate",
"single",
"image",
".",
"The",
"Image",
"must",
"not",
"be",
"used",
"after",
"the",
"underlying",
"ImageSource",
"is",
"Close",
"()",
"d",
"."
] | [
"func",
"FromUnparsedImage",
"(",
"ctx",
"context",
".",
"Context",
",",
"sys",
"*",
"<mask>",
".",
"SystemContext",
",",
"unparsed",
"*",
"UnparsedImage",
")",
"(",
"types",
".",
"Image",
",",
"error",
")",
"{",
"// Note that the input parameter above is specifically *image.UnparsedImage, not types.UnparsedImage:",
"// we want to be able to use unparsed.src. We could make that an explicit interface, but, well,",
"// this is the only UnparsedImage implementation around, anyway.",
"// NOTE: It is essential for signature verification that all parsing done in this object happens on the same manifest which is returned by unparsed.Manifest().",
"manifestBlob",
",",
"manifestMIMEType",
",",
"err",
":=",
"unparsed",
".",
"Manifest",
"(",
"ctx",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"parsedManifest",
",",
"err",
":=",
"manifestInstanceFromBlob",
"(",
"ctx",
",",
"sys",
",",
"unparsed",
".",
"src",
",",
"manifestBlob",
",",
"manifestMIMEType",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"sourcedImage",
"{",
"UnparsedImage",
":",
"unparsed",
",",
"manifestBlob",
":",
"manifestBlob",
",",
"manifestMIMEType",
":",
"manifestMIMEType",
",",
"genericManifest",
":",
"parsedManifest",
",",
"}",
",",
"nil",
"\n",
"}"
] |
24,295 | all-24296 | [
"WithTemplateFromFiles",
"adds",
"a",
"template",
"parsed",
"from",
"files",
"."
] | [
"func",
"WithTemplateFromFiles",
"(",
"name",
"string",
",",
"files",
"...",
"string",
")",
"Option",
"{",
"return",
"func",
"(",
"o",
"*",
"Options",
")",
"{",
"o",
".",
"files",
"[",
"<mask>",
"]",
"=",
"files",
"}",
"\n",
"}"
] |
24,296 | all-24297 | [
"SetKeyframeKey",
"modifies",
"the",
"keyframe",
"rule",
"key",
"text",
".",
"See",
":",
"https",
":",
"//",
"chromedevtools",
".",
"github",
".",
"io",
"/",
"devtools",
"-",
"protocol",
"/",
"tot",
"/",
"CSS#method",
"-",
"setKeyframeKey",
"parameters",
":",
"styleSheetID",
"range",
"keyText"
] | [
"func",
"SetKeyframeKey",
"(",
"styleSheetID",
"StyleSheetID",
",",
"rangeVal",
"*",
"SourceRange",
",",
"keyText",
"string",
")",
"*",
"SetKeyframeKeyParams",
"{",
"return",
"&",
"SetKeyframeKeyParams",
"{",
"StyleSheetID",
":",
"styleSheetID",
",",
"<mask>",
":",
"rangeVal",
",",
"KeyText",
":",
"keyText",
",",
"}",
"\n",
"}"
] |
24,297 | all-24298 | [
"Setup",
"a",
"NAT",
"port",
"forwarding",
"entry",
"."
] | [
"func",
"setPortForwarding",
"(",
"d",
"*",
"Driver",
",",
"interfaceNum",
"int",
",",
"mapName",
",",
"protocol",
"string",
",",
"guestPort",
",",
"desiredHostPort",
"int",
")",
"(",
"int",
",",
"error",
")",
"{",
"actualHostPort",
",",
"err",
":=",
"getAvailableTCPPort",
"(",
"desiredHostPort",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"err",
"\n",
"}",
"\n",
"if",
"desiredHostPort",
"!=",
"actualHostPort",
"&&",
"desiredHostPort",
"!=",
"0",
"{",
"<mask>",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"guestPort",
",",
"mapName",
",",
"desiredHostPort",
",",
"actualHostPort",
")",
"\n",
"}",
"\n",
"cmd",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"interfaceNum",
")",
"\n",
"d",
".",
"vbm",
"(",
"\"",
"\"",
",",
"d",
".",
"MachineName",
",",
"cmd",
",",
"\"",
"\"",
",",
"mapName",
")",
"\n",
"if",
"err",
":=",
"d",
".",
"vbm",
"(",
"\"",
"\"",
",",
"d",
".",
"MachineName",
",",
"cmd",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"mapName",
",",
"protocol",
",",
"actualHostPort",
",",
"guestPort",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"err",
"\n",
"}",
"\n",
"return",
"actualHostPort",
",",
"nil",
"\n",
"}"
] |
24,298 | all-24299 | [
"GetEnqueuedBuilds",
"lists",
"all",
"enqueued",
"builds",
"for",
"the",
"provided",
"jobs",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetEnqueuedBuilds",
"(",
"jobs",
"[",
"]",
"BuildQueryParams",
")",
"(",
"map",
"[",
"string",
"]",
"Build",
",",
"error",
")",
"{",
"c",
".",
"logger",
".",
"Debug",
"(",
"\"",
"\"",
")",
"\n\n",
"data",
",",
"err",
":=",
"c",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"page",
":=",
"struct",
"{",
"QueuedBuilds",
"[",
"]",
"Build",
"`json:\"items\"`",
"\n",
"}",
"{",
"}",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"data",
",",
"&",
"page",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"jenkinsBuilds",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"Build",
")",
"\n",
"for",
"_",
",",
"jb",
":=",
"range",
"page",
".",
"QueuedBuilds",
"{",
"prowJobID",
":=",
"jb",
".",
"ProwJobID",
"(",
")",
"\n",
"// Ignore builds with missing buildID parameters.",
"if",
"prowJobID",
"==",
"\"",
"\"",
"{",
"continue",
"\n",
"}",
"\n",
"// Ignore builds for jobs we didn't ask for.",
"var",
"exists",
"bool",
"\n",
"for",
"_",
",",
"job",
":=",
"range",
"<mask>",
"{",
"if",
"prowJobID",
"==",
"job",
".",
"ProwJobID",
"{",
"exists",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"!",
"exists",
"{",
"continue",
"\n",
"}",
"\n",
"jb",
".",
"enqueued",
"=",
"true",
"\n",
"jenkinsBuilds",
"[",
"prowJobID",
"]",
"=",
"jb",
"\n",
"}",
"\n",
"return",
"jenkinsBuilds",
",",
"nil",
"\n",
"}"
] |
24,299 | all-24300 | [
"Decode",
"decodes",
"the",
"header",
"."
] | [
"func",
"(",
"h",
"*",
"header",
")",
"Decode",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"int",
"{",
"h",
".",
"plen",
"=",
"binary",
".",
"BigEndian",
".",
"Uint16",
"(",
"buf",
"[",
"0",
":",
"2",
"]",
")",
"\n",
"h",
".",
"klen",
"=",
"binary",
".",
"BigEndian",
".",
"Uint16",
"(",
"buf",
"[",
"2",
":",
"4",
"]",
")",
"\n",
"h",
".",
"vlen",
"=",
"binary",
".",
"BigEndian",
".",
"Uint16",
"(",
"buf",
"[",
"4",
":",
"6",
"]",
")",
"\n",
"h",
".",
"prev",
"=",
"binary",
".",
"BigEndian",
".",
"Uint32",
"(",
"buf",
"[",
"6",
":",
"10",
"]",
")",
"\n",
"return",
"h",
".",
"Size",
"(",
")",
"\n",
"}"
] |
Subsets and Splits