id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
11,700 | all-11701 | [
"GetImageAliasNames",
"returns",
"the",
"list",
"of",
"available",
"alias",
"names"
] | [
"func",
"(",
"r",
"*",
"ProtocolSimpleStreams",
")",
"GetImageAliasNames",
"(",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"// Get all the images from simplestreams",
"aliases",
",",
"err",
":=",
"r",
".",
"ssClient",
".",
"ListAliases",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// And now extract just the names",
"names",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"_",
",",
"alias",
":=",
"range",
"aliases",
"{",
"names",
"=",
"append",
"(",
"names",
",",
"alias",
".",
"<mask>",
")",
"\n",
"}",
"\n\n",
"return",
"names",
",",
"nil",
"\n",
"}"
] |
11,701 | all-11702 | [
"staticAddress",
"returns",
"the",
"external",
"static",
"IP",
"address",
"."
] | [
"func",
"(",
"c",
"*",
"ComputeUtil",
")",
"staticAddress",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"// is the address a name?",
"isName",
",",
"err",
":=",
"regexp",
".",
"MatchString",
"(",
"\"",
"\"",
",",
"c",
".",
"address",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"!",
"isName",
"{",
"return",
"c",
".",
"address",
",",
"nil",
"\n",
"}",
"\n\n",
"// resolve the address by name",
"externalAddress",
",",
"err",
":=",
"c",
".",
"service",
".",
"Addresses",
".",
"Get",
"(",
"c",
".",
"project",
",",
"c",
".",
"<mask>",
"(",
")",
",",
"c",
".",
"address",
")",
".",
"Do",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"externalAddress",
".",
"Address",
",",
"nil",
"\n",
"}"
] |
11,702 | all-11703 | [
"SshKeyLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] | [
"func",
"(",
"api",
"*",
"API",
")",
"SshKeyLocator",
"(",
"href",
"<mask>",
")",
"*",
"SshKeyLocator",
"{",
"return",
"&",
"SshKeyLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
11,703 | all-11704 | [
"GetCursor",
"is",
"a",
"wrapper",
"around",
"gtk_icon_view_get_cursor",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"IconView",
")",
"GetCursor",
"(",
")",
"(",
"*",
"TreePath",
",",
"*",
"CellRenderer",
")",
"{",
"var",
"(",
"cpath",
"*",
"C",
".",
"GtkTreePath",
"\n",
"ccell",
"*",
"C",
".",
"GtkCellRenderer",
"\n",
"path",
"*",
"TreePath",
"\n",
"cell",
"*",
"CellRenderer",
"\n",
")",
"\n\n",
"C",
".",
"gtk_icon_view_get_cursor",
"(",
"v",
".",
"native",
"(",
")",
",",
"&",
"cpath",
",",
"&",
"ccell",
")",
"\n\n",
"if",
"cpath",
"!=",
"nil",
"{",
"path",
"=",
"&",
"TreePath",
"{",
"cpath",
"}",
"\n",
"runtime",
".",
"SetFinalizer",
"(",
"<mask>",
",",
"(",
"*",
"TreePath",
")",
".",
"free",
")",
"\n",
"}",
"\n\n",
"if",
"ccell",
"!=",
"nil",
"{",
"cell",
"=",
"wrapCellRenderer",
"(",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"ccell",
")",
")",
")",
"\n",
"}",
"\n\n",
"return",
"path",
",",
"cell",
"\n",
"}"
] |
11,704 | all-11705 | [
"GetState",
"returns",
"the",
"current",
"state",
"of",
"a",
"terminal",
"which",
"may",
"be",
"useful",
"to",
"restore",
"the",
"terminal",
"after",
"a",
"signal",
"."
] | [
"func",
"GetState",
"(",
"fd",
"int",
")",
"(",
"*",
"State",
",",
"error",
")",
"{",
"state",
",",
"err",
":=",
"terminal",
".",
"GetState",
"(",
"fd",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"currentState",
":=",
"State",
"(",
"*",
"<mask>",
")",
"\n",
"return",
"&",
"currentState",
",",
"nil",
"\n",
"}"
] |
11,705 | all-11706 | [
"HasDisplayType",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TimeseriesRequest",
")",
"HasDisplayType",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"DisplayType",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
11,706 | all-11707 | [
"DefaultCompress",
"is",
"a",
"middleware",
"that",
"compresses",
"response",
"body",
"of",
"predefined",
"content",
"types",
"to",
"a",
"data",
"format",
"based",
"on",
"Accept",
"-",
"Encoding",
"request",
"header",
".",
"It",
"uses",
"a",
"default",
"compression",
"level",
".",
"DEPRECATED"
] | [
"func",
"DefaultCompress",
"(",
"next",
"http",
".",
"<mask>",
")",
"http",
".",
"Handler",
"{",
"return",
"Compress",
"(",
"flate",
".",
"DefaultCompression",
")",
"(",
"next",
")",
"\n",
"}"
] |
11,707 | all-11708 | [
"NewConfig",
"returns",
"a",
"Config",
"optionally",
"using",
"default",
"remotes",
"."
] | [
"func",
"NewConfig",
"(",
"configDir",
"<mask>",
",",
"defaults",
"bool",
")",
"*",
"Config",
"{",
"config",
":=",
"&",
"Config",
"{",
"ConfigDir",
":",
"configDir",
"}",
"\n",
"if",
"defaults",
"{",
"config",
".",
"Remotes",
"=",
"DefaultRemotes",
"\n",
"config",
".",
"DefaultRemote",
"=",
"\"",
"\"",
"\n",
"}",
"\n\n",
"return",
"config",
"\n",
"}"
] |
11,708 | all-11709 | [
"SetGroupName",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_notebook_set_group_name",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Notebook",
")",
"SetGroupName",
"(",
"groupName",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"groupName",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_notebook_set_group_name",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
11,709 | all-11710 | [
"UnmarshalJSON",
"satisfies",
"json",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"MixedContentType",
")",
"UnmarshalJSON",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"error",
"{",
"return",
"easyjson",
".",
"Unmarshal",
"(",
"buf",
",",
"t",
")",
"\n",
"}"
] |
11,710 | all-11711 | [
"Locator",
"returns",
"a",
"locator",
"for",
"the",
"given",
"resource"
] | [
"func",
"(",
"r",
"*",
"Volume",
")",
"Locator",
"(",
"api",
"*",
"API",
")",
"*",
"VolumeLocator",
"{",
"for",
"_",
",",
"l",
":=",
"<mask>",
"r",
".",
"Links",
"{",
"if",
"l",
"[",
"\"",
"\"",
"]",
"==",
"\"",
"\"",
"{",
"return",
"api",
".",
"VolumeLocator",
"(",
"l",
"[",
"\"",
"\"",
"]",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
11,711 | all-11712 | [
"PathToKey",
"converts",
"a",
"path",
"on",
"disk",
"to",
"a",
"key",
"assuming",
"the",
"path",
"is",
"actually",
"under",
"DiskRoot",
"()",
"..."
] | [
"func",
"(",
"c",
"*",
"Cache",
")",
"PathToKey",
"(",
"key",
"string",
")",
"string",
"{",
"return",
"strings",
".",
"TrimPrefix",
"(",
"key",
",",
"c",
".",
"diskRoot",
"+",
"string",
"(",
"<mask>",
".",
"PathSeparator",
")",
")",
"\n",
"}"
] |
11,712 | all-11713 | [
"MustQSet",
"retrieves",
"the",
"QSet",
"value",
"from",
"the",
"union",
"panicing",
"if",
"the",
"value",
"is",
"not",
"set",
"."
] | [
"func",
"(",
"u",
"StellarMessage",
")",
"MustQSet",
"(",
")",
"ScpQuorumSet",
"{",
"val",
",",
"<mask>",
":=",
"u",
".",
"GetQSet",
"(",
")",
"\n\n",
"if",
"!",
"ok",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"val",
"\n",
"}"
] |
11,713 | all-11714 | [
"zpool",
"is",
"a",
"helper",
"function",
"to",
"wrap",
"typical",
"calls",
"to",
"zpool",
"."
] | [
"func",
"zpool",
"(",
"arg",
"...",
"string",
")",
"(",
"[",
"]",
"[",
"]",
"string",
",",
"error",
")",
"{",
"c",
":=",
"<mask>",
"{",
"Command",
":",
"\"",
"\"",
"}",
"\n",
"return",
"c",
".",
"Run",
"(",
"arg",
"...",
")",
"\n",
"}"
] |
11,714 | all-11715 | [
"HasIndex",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"WidgetApmOrLogQuery",
")",
"HasIndex",
"(",
")",
"bool",
"{",
"if",
"w",
"!=",
"nil",
"&&",
"w",
".",
"<mask>",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
11,715 | all-11716 | [
"getFiles",
"returns",
"all",
"the",
"source",
"files",
"deduped",
"and",
"ordered",
"."
] | [
"func",
"getFiles",
"(",
"goroutines",
"[",
"]",
"*",
"Goroutine",
")",
"[",
"]",
"string",
"{",
"files",
":=",
"map",
"[",
"string",
"]",
"struct",
"{",
"}",
"{",
"}",
"\n",
"for",
"_",
",",
"g",
":=",
"range",
"goroutines",
"{",
"for",
"_",
",",
"c",
":=",
"range",
"g",
".",
"Stack",
".",
"Calls",
"{",
"files",
"[",
"c",
".",
"SrcPath",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"out",
":=",
"<mask>",
"(",
"[",
"]",
"string",
",",
"0",
",",
"len",
"(",
"files",
")",
")",
"\n",
"for",
"f",
":=",
"range",
"files",
"{",
"out",
"=",
"append",
"(",
"out",
",",
"f",
")",
"\n",
"}",
"\n",
"sort",
".",
"Strings",
"(",
"out",
")",
"\n",
"return",
"out",
"\n",
"}"
] |
11,716 | all-11717 | [
"/",
"*",
"Miscellaneous",
"Utility",
"Functions",
"GetHomeDir",
"is",
"a",
"wrapper",
"around",
"g_get_home_dir",
"()",
"."
] | [
"func",
"GetHomeDir",
"(",
")",
"string",
"{",
"c",
":=",
"C",
".",
"g_get_home_dir",
"(",
")",
"\n",
"return",
"C",
".",
"GoString",
"(",
"(",
"*",
"C",
".",
"<mask>",
")",
"(",
"c",
")",
")",
"\n",
"}"
] |
11,717 | all-11718 | [
"NewLimitedBufferReader",
"returns",
"a",
"reader",
"that",
"reads",
"from",
"the",
"given",
"reader",
"but",
"limits",
"the",
"amount",
"of",
"data",
"returned",
"to",
"at",
"most",
"n",
"bytes",
"."
] | [
"func",
"NewLimitedBufferReader",
"(",
"r",
"<mask>",
".",
"Reader",
",",
"n",
"int",
")",
"io",
".",
"Reader",
"{",
"return",
"&",
"limitedBufferReader",
"{",
"r",
":",
"r",
",",
"n",
":",
"n",
",",
"}",
"\n",
"}"
] |
11,718 | all-11719 | [
"Execute",
"-",
"removes",
"org",
"users"
] | [
"func",
"(",
"c",
"*",
"CleanupOrgUsersCommand",
")",
"Execute",
"(",
"[",
"]",
"<mask>",
")",
"error",
"{",
"if",
"cfMgmt",
",",
"err",
":=",
"InitializePeekManagers",
"(",
"c",
".",
"BaseCFConfigCommand",
",",
"c",
".",
"Peek",
")",
";",
"err",
"==",
"nil",
"{",
"return",
"cfMgmt",
".",
"UserManager",
".",
"CleanupOrgUsers",
"(",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
11,719 | all-11720 | [
"NewFacility",
"returns",
"a",
"new",
"logger",
"bound",
"to",
"the",
"named",
"facility",
"."
] | [
"func",
"(",
"l",
"*",
"logger",
")",
"NewFacility",
"(",
"facility",
"string",
")",
"Logger",
"{",
"l",
".",
"mut",
".",
"Lock",
"(",
")",
"\n",
"if",
"l",
".",
"debug",
"==",
"nil",
"{",
"l",
".",
"<mask>",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"bool",
")",
"\n",
"}",
"\n",
"l",
".",
"debug",
"[",
"facility",
"]",
"=",
"false",
"\n",
"l",
".",
"mut",
".",
"Unlock",
"(",
")",
"\n\n",
"return",
"&",
"facilityLogger",
"{",
"logger",
":",
"l",
",",
"facility",
":",
"facility",
",",
"}",
"\n",
"}"
] |
11,720 | all-11721 | [
"Do",
"executes",
"DOM",
".",
"getOuterHTML",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"outerHTML",
"-",
"Outer",
"HTML",
"markup",
"."
] | [
"func",
"(",
"p",
"*",
"GetOuterHTMLParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"outerHTML",
"string",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"GetOuterHTMLReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandGetOuterHTML",
",",
"p",
",",
"&",
"res",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"res",
".",
"OuterHTML",
",",
"nil",
"\n",
"}"
] |
11,721 | all-11722 | [
"parseEncryptionBlock",
"calculates",
"the",
"key",
"for",
"block",
"encryption",
"."
] | [
"func",
"(",
"a",
"*",
"archive50",
")",
"parseEncryptionBlock",
"(",
"b",
"readBuf",
")",
"error",
"{",
"if",
"ver",
":=",
"b",
".",
"uvarint",
"(",
")",
";",
"ver",
"!=",
"0",
"{",
"return",
"errUnknownEncMethod",
"\n",
"}",
"\n",
"flags",
":=",
"b",
".",
"uvarint",
"(",
")",
"\n",
"keys",
",",
"err",
":=",
"a",
".",
"getKeys",
"(",
"&",
"b",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"<mask>",
"&",
"enc5CheckPresent",
">",
"0",
"{",
"if",
"err",
":=",
"checkPassword",
"(",
"&",
"b",
",",
"keys",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"a",
".",
"blockKey",
"=",
"keys",
"[",
"0",
"]",
"\n",
"return",
"nil",
"\n",
"}"
] |
11,722 | all-11723 | [
"Diem",
"will",
"log",
"a",
"message",
"using",
"Fatalm",
"call",
"ShutdownLoggers",
"and",
"then",
"exit",
"the",
"application",
"with",
"the",
"provided",
"exit",
"code",
"."
] | [
"func",
"(",
"b",
"*",
"Base",
")",
"Diem",
"(",
"exitCode",
"int",
",",
"m",
"*",
"Attrs",
",",
"msg",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"b",
".",
"Log",
"(",
"LevelFatal",
",",
"m",
",",
"<mask>",
",",
"a",
"...",
")",
"\n",
"b",
".",
"ShutdownLoggers",
"(",
")",
"\n",
"curExiter",
".",
"Exit",
"(",
"exitCode",
")",
"\n",
"}"
] |
11,723 | all-11724 | [
"GetAuthURI",
"returns",
"the",
"AuthURI",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"i",
"*",
"IntegrationGCPCreateRequest",
")",
"GetAuthURI",
"(",
")",
"<mask>",
"{",
"if",
"i",
"==",
"nil",
"||",
"i",
".",
"AuthURI",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"i",
".",
"AuthURI",
"\n",
"}"
] |
11,724 | all-11725 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"DiscardSearchResultsParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom70",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
11,725 | all-11726 | [
"NetworkGet",
"returns",
"the",
"network",
"with",
"the",
"given",
"name",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"NetworkGet",
"(",
"name",
"string",
")",
"(",
"int64",
",",
"*",
"api",
".",
"Network",
",",
"error",
")",
"{",
"description",
":=",
"sql",
".",
"NullString",
"{",
"}",
"\n",
"id",
":=",
"int64",
"(",
"-",
"1",
")",
"\n",
"state",
":=",
"0",
"\n\n",
"q",
":=",
"\"",
"\"",
"\n",
"arg1",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"name",
"}",
"\n",
"arg2",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"&",
"id",
",",
"&",
"description",
",",
"&",
"state",
"}",
"\n",
"err",
":=",
"dbQueryRowScan",
"(",
"c",
".",
"db",
",",
"q",
",",
"arg1",
",",
"arg2",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"err",
"==",
"sql",
".",
"ErrNoRows",
"{",
"return",
"-",
"1",
",",
"nil",
",",
"ErrNoSuchObject",
"\n",
"}",
"\n\n",
"return",
"-",
"1",
",",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"config",
",",
"err",
":=",
"c",
".",
"NetworkConfigGet",
"(",
"id",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"network",
":=",
"api",
".",
"Network",
"{",
"Name",
":",
"name",
",",
"Managed",
":",
"true",
",",
"Type",
":",
"\"",
"\"",
",",
"}",
"\n",
"network",
".",
"Description",
"=",
"description",
".",
"String",
"\n",
"network",
".",
"Config",
"=",
"config",
"\n\n",
"switch",
"<mask>",
"{",
"case",
"networkPending",
":",
"network",
".",
"Status",
"=",
"\"",
"\"",
"\n",
"case",
"networkCreated",
":",
"network",
".",
"Status",
"=",
"\"",
"\"",
"\n",
"default",
":",
"network",
".",
"Status",
"=",
"\"",
"\"",
"\n",
"}",
"\n\n",
"nodes",
",",
"err",
":=",
"c",
".",
"networkNodes",
"(",
"id",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"nil",
",",
"err",
"\n",
"}",
"\n",
"network",
".",
"Locations",
"=",
"nodes",
"\n\n",
"return",
"id",
",",
"&",
"network",
",",
"nil",
"\n",
"}"
] |
11,726 | all-11727 | [
"SetMaxLength",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_entry_set_max_length",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"SetMaxLength",
"(",
"len",
"int",
")",
"{",
"C",
".",
"gtk_entry_set_max_length",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"len",
")",
")",
"\n",
"}"
] |
11,727 | all-11728 | [
"HasStyle",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"h",
"*",
"HostmapDefinition",
")",
"HasStyle",
"(",
")",
"bool",
"{",
"if",
"h",
"!=",
"nil",
"&&",
"h",
".",
"Style",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
11,728 | all-11729 | [
"define",
"an",
"array",
"of",
"vertex",
"data"
] | [
"func",
"VertexPointer",
"(",
"size",
"int32",
",",
"xtype",
"uint32",
",",
"stride",
"int32",
",",
"pointer",
"unsafe",
".",
"Pointer",
")",
"{",
"C",
".",
"glowVertexPointer",
"(",
"gpVertexPointer",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"size",
")",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"xtype",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"stride",
")",
",",
"<mask>",
")",
"\n",
"}"
] |
11,729 | all-11730 | [
"delete",
"removes",
"a",
"watcher",
"and",
"returns",
"the",
"number",
"of",
"remaining",
"watchers",
"."
] | [
"func",
"(",
"wbs",
"*",
"watchBroadcasts",
")",
"<mask>",
"(",
"w",
"*",
"watcher",
")",
"int",
"{",
"wbs",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"wbs",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"wb",
",",
"ok",
":=",
"wbs",
".",
"watchers",
"[",
"w",
"]",
"\n",
"if",
"!",
"ok",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"delete",
"(",
"wbs",
".",
"watchers",
",",
"w",
")",
"\n",
"wb",
".",
"delete",
"(",
"w",
")",
"\n",
"if",
"wb",
".",
"empty",
"(",
")",
"{",
"delete",
"(",
"wbs",
".",
"bcasts",
",",
"wb",
")",
"\n",
"wb",
".",
"stop",
"(",
")",
"\n",
"}",
"\n",
"return",
"len",
"(",
"wbs",
".",
"bcasts",
")",
"\n",
"}"
] |
11,730 | all-11731 | [
"Add",
"adds",
"a",
"new",
"element",
"to",
"the",
"set",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | [
"func",
"(",
"s",
"*",
"Set",
")",
"Add",
"(",
"d",
"Dependency",
")",
"bool",
"{",
"s",
".",
"init",
"(",
")",
"\n",
"s",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"Unlock",
"(",
")",
"\n",
"if",
"_",
",",
"ok",
":=",
"s",
".",
"set",
"[",
"d",
".",
"String",
"(",
")",
"]",
";",
"!",
"ok",
"{",
"s",
".",
"list",
"=",
"append",
"(",
"s",
".",
"list",
",",
"d",
".",
"<mask>",
"(",
")",
")",
"\n",
"s",
".",
"set",
"[",
"d",
".",
"String",
"(",
")",
"]",
"=",
"d",
"\n",
"return",
"true",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
] |
11,731 | all-11732 | [
"returns",
"OpenStack",
"Keystone",
"authentication",
"settings",
"by",
"obtaining",
"values",
"from",
"standard",
"environment",
"variables",
".",
"also",
"fixes",
"incompatibilities",
"between",
"gophercloud",
"implementation",
"and",
"*",
"-",
"stackrc",
"files",
"that",
"can",
"be",
"downloaded",
"from",
"OpenStack",
"dashboard",
"in",
"latest",
"versions"
] | [
"func",
"getAuthSettings",
"(",
")",
"(",
"gophercloud",
".",
"AuthOptions",
",",
"error",
")",
"{",
"remapEnv",
"(",
"map",
"[",
"string",
"]",
"string",
"{",
"\"",
"\"",
":",
"\"",
"\"",
",",
"\"",
"\"",
":",
"\"",
"\"",
",",
"\"",
"\"",
":",
"\"",
"\"",
",",
"\"",
"\"",
":",
"\"",
"\"",
",",
"}",
")",
"\n\n",
"opts",
",",
"err",
":=",
"openstack",
".",
"AuthOptionsFromEnv",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"gophercloud",
".",
"AuthOptions",
"{",
"}",
",",
"err",
"\n",
"}",
"\n",
"opts",
".",
"AllowReauth",
"=",
"<mask>",
"\n",
"if",
"!",
"strings",
".",
"HasSuffix",
"(",
"opts",
".",
"IdentityEndpoint",
",",
"\"",
"\"",
")",
"{",
"opts",
".",
"IdentityEndpoint",
"+=",
"\"",
"\"",
"\n",
"}",
"\n",
"if",
"!",
"strings",
".",
"HasSuffix",
"(",
"opts",
".",
"IdentityEndpoint",
",",
"\"",
"\"",
")",
"&&",
"!",
"strings",
".",
"HasSuffix",
"(",
"opts",
".",
"IdentityEndpoint",
",",
"\"",
"\"",
")",
"{",
"opts",
".",
"IdentityEndpoint",
"+=",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"opts",
",",
"nil",
"\n",
"}"
] |
11,732 | all-11733 | [
"GetStoragePoolVolumeSnapshot",
"returns",
"a",
"snapshots",
"for",
"the",
"storage",
"volume"
] | [
"func",
"(",
"r",
"*",
"ProtocolLXD",
")",
"GetStoragePoolVolumeSnapshot",
"(",
"pool",
"string",
",",
"volumeType",
"string",
",",
"volumeName",
"string",
",",
"snapshotName",
"string",
")",
"(",
"*",
"api",
".",
"StorageVolumeSnapshot",
",",
"string",
",",
"error",
")",
"{",
"if",
"!",
"r",
".",
"HasExtension",
"(",
"\"",
"\"",
")",
"{",
"return",
"nil",
",",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
")",
"\n",
"}",
"\n\n",
"snapshot",
":=",
"api",
".",
"StorageVolumeSnapshot",
"{",
"}",
"\n\n",
"<mask>",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"url",
".",
"QueryEscape",
"(",
"pool",
")",
",",
"url",
".",
"QueryEscape",
"(",
"volumeType",
")",
",",
"url",
".",
"QueryEscape",
"(",
"volumeName",
")",
",",
"url",
".",
"QueryEscape",
"(",
"snapshotName",
")",
")",
"\n",
"etag",
",",
"err",
":=",
"r",
".",
"queryStruct",
"(",
"\"",
"\"",
",",
"path",
",",
"nil",
",",
"\"",
"\"",
",",
"&",
"snapshot",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"snapshot",
",",
"etag",
",",
"nil",
"\n",
"}"
] |
11,733 | all-11734 | [
"DrawRawTextVertical",
"draws",
"the",
"part",
"of",
"text",
"that",
"is",
"inside",
"the",
"current",
"clipping",
"rectangle",
".",
"DrawRawTextVertical",
"always",
"paints",
"string",
"as",
"is",
"-",
"no",
"color",
"changes",
".",
"If",
"you",
"want",
"to",
"draw",
"string",
"with",
"color",
"changing",
"commands",
"included",
"then",
"use",
"DrawTextVertical",
"function"
] | [
"func",
"DrawRawTextVertical",
"(",
"x",
",",
"y",
"int",
",",
"<mask>",
"string",
")",
"{",
"cx",
",",
"cy",
",",
"cw",
",",
"ch",
":=",
"ClipRect",
"(",
")",
"\n",
"if",
"y",
">=",
"cy",
"+",
"ch",
"||",
"x",
"<",
"cx",
"||",
"x",
">=",
"cx",
"+",
"cw",
"{",
"return",
"\n",
"}",
"\n\n",
"length",
":=",
"xs",
".",
"Len",
"(",
"text",
")",
"\n",
"if",
"y",
"+",
"length",
"<",
"cy",
"{",
"return",
"\n",
"}",
"\n\n",
"if",
"y",
"<",
"cy",
"{",
"text",
"=",
"xs",
".",
"Slice",
"(",
"text",
",",
"cy",
"-",
"y",
",",
"-",
"1",
")",
"\n",
"length",
"=",
"length",
"-",
"(",
"cy",
"-",
"y",
")",
"\n",
"y",
"=",
"cy",
"\n",
"}",
"\n",
"text",
"=",
"CutText",
"(",
"text",
",",
"ch",
")",
"\n\n",
"dy",
":=",
"0",
"\n",
"for",
"_",
",",
"ch",
":=",
"range",
"text",
"{",
"putCharUnsafe",
"(",
"x",
",",
"y",
"+",
"dy",
",",
"ch",
")",
"\n",
"dy",
"++",
"\n",
"}",
"\n",
"}"
] |
11,734 | all-11735 | [
"DeleteRepoLabel",
"deletes",
"a",
"label",
"in",
"org",
"/",
"repo",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"issues",
"/",
"labels",
"/",
"#delete",
"-",
"a",
"-",
"label"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteRepoLabel",
"(",
"org",
",",
"repo",
",",
"label",
"string",
")",
"error",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
",",
"label",
")",
"\n",
"_",
",",
"err",
":=",
"c",
".",
"request",
"(",
"&",
"request",
"{",
"method",
":",
"http",
".",
"MethodDelete",
",",
"accept",
":",
"\"",
"\"",
",",
"// allow the description field -- https://developer.github.com/changes/2018-02-22-label-description-search-preview/",
"path",
":",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
",",
"label",
")",
",",
"requestBody",
":",
"Label",
"{",
"Name",
":",
"<mask>",
"}",
",",
"exitCodes",
":",
"[",
"]",
"int",
"{",
"204",
"}",
",",
"}",
",",
"nil",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
11,735 | all-11736 | [
"HasParentId",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"d",
"*",
"Downtime",
")",
"HasParentId",
"(",
")",
"bool",
"{",
"if",
"d",
"!=",
"nil",
"&&",
"d",
".",
"ParentId",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
11,736 | all-11737 | [
"Copy",
"returns",
"a",
"deep",
"copy",
"of",
"this",
"configuration",
"."
] | [
"func",
"(",
"c",
"*",
"SyslogConfig",
")",
"Copy",
"(",
")",
"*",
"SyslogConfig",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"<mask>",
"o",
"SyslogConfig",
"\n",
"o",
".",
"Enabled",
"=",
"c",
".",
"Enabled",
"\n",
"o",
".",
"Facility",
"=",
"c",
".",
"Facility",
"\n",
"return",
"&",
"o",
"\n",
"}"
] |
11,737 | all-11738 | [
"StartCommitParent",
"begins",
"the",
"process",
"of",
"committing",
"data",
"to",
"a",
"Repo",
".",
"Once",
"started",
"you",
"can",
"write",
"to",
"the",
"Commit",
"with",
"PutFile",
"and",
"when",
"all",
"the",
"data",
"has",
"been",
"written",
"you",
"must",
"finish",
"the",
"Commit",
"with",
"FinishCommit",
".",
"NOTE",
"data",
"is",
"not",
"persisted",
"until",
"FinishCommit",
"is",
"called",
".",
"branch",
"is",
"a",
"more",
"convenient",
"way",
"to",
"build",
"linear",
"chains",
"of",
"commits",
".",
"When",
"a",
"commit",
"is",
"started",
"with",
"a",
"non",
"empty",
"branch",
"the",
"value",
"of",
"branch",
"becomes",
"an",
"alias",
"for",
"the",
"created",
"Commit",
".",
"This",
"enables",
"a",
"more",
"intuitive",
"access",
"pattern",
".",
"When",
"the",
"commit",
"is",
"started",
"on",
"a",
"branch",
"the",
"previous",
"head",
"of",
"the",
"branch",
"is",
"used",
"as",
"the",
"parent",
"of",
"the",
"commit",
".",
"parentCommit",
"specifies",
"the",
"parent",
"Commit",
"upon",
"creation",
"the",
"new",
"Commit",
"will",
"appear",
"identical",
"to",
"the",
"parent",
"Commit",
"data",
"can",
"safely",
"be",
"added",
"to",
"the",
"new",
"commit",
"without",
"affecting",
"the",
"contents",
"of",
"the",
"parent",
"Commit",
".",
"You",
"may",
"pass",
"as",
"parentCommit",
"in",
"which",
"case",
"the",
"new",
"Commit",
"will",
"have",
"no",
"parent",
"and",
"will",
"initially",
"appear",
"empty",
"."
] | [
"func",
"(",
"c",
"APIClient",
")",
"StartCommitParent",
"(",
"repoName",
"string",
",",
"branch",
"string",
",",
"parentCommit",
"string",
")",
"(",
"*",
"pfs",
".",
"Commit",
",",
"error",
")",
"{",
"commit",
",",
"err",
":=",
"c",
".",
"PfsAPIClient",
".",
"StartCommit",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pfs",
".",
"StartCommitRequest",
"{",
"Parent",
":",
"&",
"pfs",
".",
"Commit",
"{",
"Repo",
":",
"&",
"pfs",
".",
"Repo",
"{",
"<mask>",
":",
"repoName",
",",
"}",
",",
"ID",
":",
"parentCommit",
",",
"}",
",",
"Branch",
":",
"branch",
",",
"}",
",",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"grpcutil",
".",
"ScrubGRPC",
"(",
"err",
")",
"\n",
"}",
"\n",
"return",
"commit",
",",
"nil",
"\n",
"}"
] |
11,738 | all-11739 | [
"It",
"s",
"unfortunate",
"that",
"the",
"two",
"semantically",
"equivalent",
"concepts",
"pb",
".",
"Reference",
"and",
"pb",
".",
"PropertyValue_ReferenceValue",
"aren",
"t",
"the",
"same",
"type",
".",
"For",
"example",
"the",
"two",
"have",
"different",
"protobuf",
"field",
"numbers",
".",
"referenceValueToKey",
"is",
"the",
"same",
"as",
"protoToKey",
"except",
"the",
"input",
"is",
"a",
"PropertyValue_ReferenceValue",
"instead",
"of",
"a",
"Reference",
"."
] | [
"func",
"referenceValueToKey",
"(",
"r",
"*",
"pb",
".",
"PropertyValue_ReferenceValue",
")",
"(",
"k",
"*",
"Key",
",",
"err",
"error",
")",
"{",
"appID",
":=",
"r",
".",
"GetApp",
"(",
")",
"\n",
"namespace",
":=",
"r",
".",
"GetNameSpace",
"(",
")",
"\n",
"for",
"_",
",",
"e",
":=",
"<mask>",
"r",
".",
"Pathelement",
"{",
"k",
"=",
"&",
"Key",
"{",
"kind",
":",
"e",
".",
"GetType",
"(",
")",
",",
"stringID",
":",
"e",
".",
"GetName",
"(",
")",
",",
"intID",
":",
"e",
".",
"GetId",
"(",
")",
",",
"parent",
":",
"k",
",",
"appID",
":",
"appID",
",",
"namespace",
":",
"namespace",
",",
"}",
"\n",
"if",
"!",
"k",
".",
"valid",
"(",
")",
"{",
"return",
"nil",
",",
"ErrInvalidKey",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
11,739 | all-11740 | [
"unsetenv",
"is",
"not",
"available",
"in",
"mingw"
] | [
"func",
"unsetenvGPGAgentInfo",
"(",
")",
"{",
"v",
":=",
"C",
".",
"CString",
"(",
"\"",
"\"",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"v",
")",
")",
"\n",
"C",
".",
"putenv",
"(",
"v",
")",
"\n",
"}"
] |
11,740 | all-11741 | [
"limitBitReader",
"returns",
"a",
"bitReader",
"that",
"reads",
"from",
"br",
"and",
"stops",
"with",
"io",
".",
"EOF",
"after",
"n",
"bits",
".",
"If",
"br",
"returns",
"an",
"io",
".",
"EOF",
"before",
"reading",
"n",
"bits",
"err",
"is",
"returned",
"."
] | [
"func",
"limitBitReader",
"(",
"br",
"bitReader",
",",
"n",
"int",
",",
"err",
"error",
")",
"bitReader",
"{",
"return",
"&",
"limitedBitReader",
"{",
"<mask>",
",",
"n",
",",
"err",
"}",
"\n",
"}"
] |
11,741 | all-11742 | [
"Recoverer",
"is",
"a",
"middleware",
"that",
"recovers",
"from",
"panics",
"logs",
"the",
"panic",
"(",
"and",
"a",
"backtrace",
")",
"and",
"returns",
"a",
"HTTP",
"500",
"(",
"Internal",
"Server",
"Error",
")",
"status",
"if",
"possible",
".",
"Recoverer",
"prints",
"a",
"request",
"ID",
"if",
"one",
"is",
"provided",
".",
"Alternatively",
"look",
"at",
"https",
":",
"//",
"github",
".",
"com",
"/",
"pressly",
"/",
"lg",
"middleware",
"pkgs",
"."
] | [
"func",
"Recoverer",
"(",
"next",
"http",
".",
"<mask>",
")",
"http",
".",
"Handler",
"{",
"fn",
":=",
"func",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"defer",
"func",
"(",
")",
"{",
"if",
"rvr",
":=",
"recover",
"(",
")",
";",
"rvr",
"!=",
"nil",
"{",
"logEntry",
":=",
"GetLogEntry",
"(",
"r",
")",
"\n",
"if",
"logEntry",
"!=",
"nil",
"{",
"logEntry",
".",
"Panic",
"(",
"rvr",
",",
"debug",
".",
"Stack",
"(",
")",
")",
"\n",
"}",
"else",
"{",
"fmt",
".",
"Fprintf",
"(",
"os",
".",
"Stderr",
",",
"\"",
"\\n",
"\"",
",",
"rvr",
")",
"\n",
"debug",
".",
"PrintStack",
"(",
")",
"\n",
"}",
"\n\n",
"http",
".",
"Error",
"(",
"w",
",",
"http",
".",
"StatusText",
"(",
"http",
".",
"StatusInternalServerError",
")",
",",
"http",
".",
"StatusInternalServerError",
")",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n\n",
"next",
".",
"ServeHTTP",
"(",
"w",
",",
"r",
")",
"\n",
"}",
"\n\n",
"return",
"http",
".",
"HandlerFunc",
"(",
"fn",
")",
"\n",
"}"
] |
11,742 | all-11743 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"the",
"current",
"program",
"object"
] | [
"func",
"Uniform4f",
"(",
"location",
"int32",
",",
"v0",
"float32",
",",
"v1",
"float32",
",",
"v2",
"float32",
",",
"v3",
"float32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpUniform4f",
",",
"5",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"v0",
")",
")",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"v1",
")",
")",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"v2",
")",
")",
",",
"uintptr",
"(",
"math",
".",
"Float32bits",
"(",
"v3",
")",
")",
",",
"0",
")",
"\n",
"}"
] |
11,743 | all-11744 | [
"GetArtists",
"is",
"a",
"wrapper",
"around",
"gtk_about_dialog_get_artists",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"AboutDialog",
")",
"GetArtists",
"(",
")",
"[",
"]",
"string",
"{",
"var",
"artists",
"[",
"]",
"string",
"\n",
"cartists",
":=",
"C",
".",
"gtk_about_dialog_get_artists",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"cartists",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"for",
"{",
"if",
"*",
"cartists",
"==",
"nil",
"{",
"<mask>",
"\n",
"}",
"\n",
"artists",
"=",
"append",
"(",
"artists",
",",
"C",
".",
"GoString",
"(",
"(",
"*",
"C",
".",
"char",
")",
"(",
"*",
"cartists",
")",
")",
")",
"\n",
"cartists",
"=",
"C",
".",
"next_gcharptr",
"(",
"cartists",
")",
"\n",
"}",
"\n",
"return",
"artists",
"\n",
"}"
] |
11,744 | all-11745 | [
"fill",
"a",
"buffer",
"object",
"s",
"data",
"store",
"with",
"a",
"fixed",
"value"
] | [
"func",
"ClearBufferData",
"(",
"target",
"uint32",
",",
"internalformat",
"uint32",
",",
"format",
"uint32",
",",
"xtype",
"uint32",
",",
"data",
"unsafe",
".",
"Pointer",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpClearBufferData",
",",
"5",
",",
"uintptr",
"(",
"target",
")",
",",
"uintptr",
"(",
"internalformat",
")",
",",
"uintptr",
"(",
"format",
")",
",",
"uintptr",
"(",
"xtype",
")",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"0",
")",
"\n",
"}"
] |
11,745 | all-11746 | [
"Update",
"takes",
"the",
"representation",
"of",
"a",
"app",
"and",
"updates",
"it",
".",
"Returns",
"the",
"server",
"s",
"representation",
"of",
"the",
"app",
"and",
"an",
"error",
"if",
"there",
"is",
"any",
"."
] | [
"func",
"(",
"c",
"*",
"FakeApps",
")",
"Update",
"(",
"app",
"*",
"tsuru_v1",
".",
"App",
")",
"(",
"<mask>",
"*",
"tsuru_v1",
".",
"App",
",",
"err",
"error",
")",
"{",
"obj",
",",
"err",
":=",
"c",
".",
"Fake",
".",
"Invokes",
"(",
"testing",
".",
"NewUpdateAction",
"(",
"appsResource",
",",
"c",
".",
"ns",
",",
"app",
")",
",",
"&",
"tsuru_v1",
".",
"App",
"{",
"}",
")",
"\n\n",
"if",
"obj",
"==",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"obj",
".",
"(",
"*",
"tsuru_v1",
".",
"App",
")",
",",
"err",
"\n",
"}"
] |
11,746 | all-11747 | [
"ApplyDefault",
"applies",
"the",
"defaults",
"for",
"the",
"ProwJob",
"decoration",
".",
"If",
"a",
"field",
"has",
"a",
"zero",
"value",
"it",
"replaces",
"that",
"with",
"the",
"value",
"set",
"in",
"def",
"."
] | [
"func",
"(",
"d",
"*",
"DecorationConfig",
")",
"ApplyDefault",
"(",
"def",
"*",
"DecorationConfig",
")",
"*",
"DecorationConfig",
"{",
"if",
"d",
"==",
"nil",
"&&",
"def",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"<mask>",
"merged",
"DecorationConfig",
"\n",
"if",
"d",
"!=",
"nil",
"{",
"merged",
"=",
"*",
"d",
"\n",
"}",
"else",
"{",
"merged",
"=",
"*",
"def",
"\n",
"}",
"\n",
"if",
"d",
"==",
"nil",
"||",
"def",
"==",
"nil",
"{",
"return",
"&",
"merged",
"\n",
"}",
"\n",
"merged",
".",
"UtilityImages",
"=",
"merged",
".",
"UtilityImages",
".",
"ApplyDefault",
"(",
"def",
".",
"UtilityImages",
")",
"\n",
"merged",
".",
"GCSConfiguration",
"=",
"merged",
".",
"GCSConfiguration",
".",
"ApplyDefault",
"(",
"def",
".",
"GCSConfiguration",
")",
"\n\n",
"if",
"merged",
".",
"Timeout",
".",
"Duration",
"==",
"0",
"{",
"merged",
".",
"Timeout",
"=",
"def",
".",
"Timeout",
"\n",
"}",
"\n",
"if",
"merged",
".",
"GracePeriod",
".",
"Duration",
"==",
"0",
"{",
"merged",
".",
"GracePeriod",
"=",
"def",
".",
"GracePeriod",
"\n",
"}",
"\n",
"if",
"merged",
".",
"GCSCredentialsSecret",
"==",
"\"",
"\"",
"{",
"merged",
".",
"GCSCredentialsSecret",
"=",
"def",
".",
"GCSCredentialsSecret",
"\n",
"}",
"\n",
"if",
"len",
"(",
"merged",
".",
"SSHKeySecrets",
")",
"==",
"0",
"{",
"merged",
".",
"SSHKeySecrets",
"=",
"def",
".",
"SSHKeySecrets",
"\n",
"}",
"\n",
"if",
"len",
"(",
"merged",
".",
"SSHHostFingerprints",
")",
"==",
"0",
"{",
"merged",
".",
"SSHHostFingerprints",
"=",
"def",
".",
"SSHHostFingerprints",
"\n",
"}",
"\n",
"if",
"merged",
".",
"SkipCloning",
"==",
"nil",
"{",
"merged",
".",
"SkipCloning",
"=",
"def",
".",
"SkipCloning",
"\n",
"}",
"\n",
"if",
"merged",
".",
"CookiefileSecret",
"==",
"\"",
"\"",
"{",
"merged",
".",
"CookiefileSecret",
"=",
"def",
".",
"CookiefileSecret",
"\n",
"}",
"\n\n",
"return",
"&",
"merged",
"\n",
"}"
] |
11,747 | all-11748 | [
"less",
"compares",
"two",
"Signature",
"where",
"the",
"ones",
"that",
"are",
"less",
"are",
"more",
"important",
"so",
"they",
"come",
"up",
"front",
".",
"A",
"Signature",
"with",
"more",
"private",
"functions",
"is",
"less",
"so",
"it",
"is",
"at",
"the",
"top",
".",
"Inversely",
"a",
"Signature",
"with",
"only",
"public",
"functions",
"is",
"more",
"so",
"it",
"is",
"at",
"the",
"bottom",
"."
] | [
"func",
"(",
"s",
"*",
"Signature",
")",
"less",
"(",
"r",
"*",
"Signature",
")",
"bool",
"{",
"if",
"s",
".",
"Stack",
".",
"less",
"(",
"&",
"r",
".",
"Stack",
")",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"r",
".",
"Stack",
".",
"less",
"(",
"&",
"s",
".",
"Stack",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"s",
".",
"Locked",
"&&",
"!",
"r",
".",
"Locked",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"r",
".",
"Locked",
"&&",
"!",
"s",
".",
"Locked",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"s",
".",
"State",
"<",
"r",
".",
"State",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"s",
".",
"State",
">",
"r",
".",
"State",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"<mask>",
"\n",
"}"
] |
11,748 | all-11749 | [
"attach",
"a",
"single",
"layer",
"of",
"a",
"texture",
"object",
"as",
"a",
"logical",
"buffer",
"of",
"a",
"framebuffer",
"object"
] | [
"func",
"FramebufferTextureLayer",
"(",
"<mask>",
"uint32",
",",
"attachment",
"uint32",
",",
"texture",
"uint32",
",",
"level",
"int32",
",",
"layer",
"int32",
")",
"{",
"C",
".",
"glowFramebufferTextureLayer",
"(",
"gpFramebufferTextureLayer",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"target",
")",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"attachment",
")",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"texture",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"level",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"layer",
")",
")",
"\n",
"}"
] |
11,749 | all-11750 | [
"UUIDs",
"returns",
"all",
"UUIDs",
"in",
"a",
"MOIDForUUIDResults",
"."
] | [
"func",
"(",
"r",
"MOIDForUUIDResults",
")",
"UUIDs",
"(",
")",
"[",
"]",
"string",
"{",
"var",
"uuids",
"[",
"]",
"string",
"\n",
"for",
"_",
",",
"result",
":=",
"range",
"r",
"{",
"uuids",
"=",
"<mask>",
"(",
"uuids",
",",
"result",
".",
"UUID",
")",
"\n",
"}",
"\n",
"return",
"uuids",
"\n",
"}"
] |
11,750 | all-11751 | [
"setConsoleTextAttribute",
"sets",
"the",
"attributes",
"of",
"characters",
"written",
"to",
"the",
"console",
"screen",
"buffer",
"by",
"the",
"WriteFile",
"or",
"WriteConsole",
"function",
".",
"See",
"http",
":",
"//",
"msdn",
".",
"microsoft",
".",
"com",
"/",
"en",
"-",
"us",
"/",
"library",
"/",
"windows",
"/",
"desktop",
"/",
"ms686047",
"(",
"v",
"=",
"vs",
".",
"85",
")",
".",
"aspx",
"."
] | [
"func",
"setConsoleTextAttribute",
"(",
"f",
"<mask>",
",",
"attribute",
"uint16",
")",
"bool",
"{",
"ok",
",",
"_",
",",
"_",
":=",
"setConsoleTextAttributeProc",
".",
"Call",
"(",
"f",
".",
"Fd",
"(",
")",
",",
"uintptr",
"(",
"attribute",
")",
",",
"0",
")",
"\n",
"return",
"ok",
"!=",
"0",
"\n",
"}"
] |
11,751 | all-11752 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"StateExplanation",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
11,752 | all-11753 | [
"Password",
"sets",
"the",
"query",
"key",
"from",
"which",
"to",
"obtain",
"the",
"password",
"."
] | [
"func",
"Password",
"(",
"password",
"string",
")",
"TokenOpt",
"{",
"return",
"TokenOpt",
"{",
"func",
"(",
"o",
"*",
"options",
")",
"{",
"o",
".",
"password",
"=",
"<mask>",
"\n",
"}",
"}",
"\n",
"}"
] |
11,753 | all-11754 | [
"UnmarshalECDSAPrivateKey",
"returns",
"a",
"private",
"key",
"from",
"x509",
"bytes"
] | [
"func",
"UnmarshalECDSAPrivateKey",
"(",
"data",
"[",
"]",
"byte",
")",
"(",
"PrivKey",
",",
"error",
")",
"{",
"priv",
",",
"err",
":=",
"x509",
".",
"ParseECPrivateKey",
"(",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"ECDSAPrivateKey",
"{",
"priv",
"}",
",",
"nil",
"\n",
"}"
] |
11,754 | all-11755 | [
"GetState",
"returns",
"the",
"state",
"of",
"the",
"virtual",
"machine",
"role",
"instance",
"."
] | [
"func",
"(",
"d",
"*",
"Driver",
")",
"GetState",
"(",
")",
"(",
"state",
".",
"State",
",",
"error",
")",
"{",
"if",
"err",
":=",
"d",
".",
"checkLegacyDriver",
"(",
"<mask>",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"state",
".",
"None",
",",
"err",
"\n",
"}",
"\n\n",
"c",
",",
"err",
":=",
"d",
".",
"newAzureClient",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"state",
".",
"None",
",",
"err",
"\n",
"}",
"\n",
"powerState",
",",
"err",
":=",
"c",
".",
"GetVirtualMachinePowerState",
"(",
"d",
".",
"ResourceGroup",
",",
"d",
".",
"naming",
"(",
")",
".",
"VM",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"state",
".",
"None",
",",
"err",
"\n",
"}",
"\n\n",
"machineState",
":=",
"machineStateForVMPowerState",
"(",
"powerState",
")",
"\n",
"log",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"powerState",
",",
"machineState",
")",
"\n",
"return",
"machineState",
",",
"nil",
"\n",
"}"
] |
11,755 | all-11756 | [
"ForeachKey",
"conforms",
"to",
"the",
"TextMapReader",
"interface",
"."
] | [
"func",
"(",
"c",
"tracingHeadersCarrier",
")",
"ForeachKey",
"(",
"handler",
"func",
"(",
"key",
",",
"val",
"string",
")",
"error",
")",
"error",
"{",
"for",
"k",
",",
"v",
":=",
"range",
"c",
"{",
"if",
"!",
"strings",
".",
"HasPrefix",
"(",
"k",
",",
"tracingKeyPrefix",
")",
"{",
"<mask>",
"\n",
"}",
"\n",
"noPrefixKey",
":=",
"tracingKeyDecoding",
".",
"mapAndCache",
"(",
"k",
")",
"\n",
"if",
"err",
":=",
"handler",
"(",
"noPrefixKey",
",",
"v",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
11,756 | all-11757 | [
"Print",
"outputs",
"query",
"log",
"using",
"format",
"template",
".",
"All",
"arguments",
"will",
"be",
"used",
"to",
"formatting",
"."
] | [
"func",
"(",
"l",
"*",
"templateLogger",
")",
"Print",
"(",
"start",
"time",
".",
"Time",
",",
"query",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"len",
"(",
"args",
")",
">",
"0",
"{",
"values",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"args",
")",
")",
"\n",
"for",
"i",
",",
"arg",
":=",
"range",
"args",
"{",
"values",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"arg",
")",
"\n",
"}",
"\n",
"query",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"query",
",",
"strings",
".",
"Join",
"(",
"values",
",",
"\"",
"\"",
")",
")",
"\n",
"}",
"else",
"{",
"query",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"query",
")",
"\n",
"}",
"\n",
"data",
":=",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"\"",
"\"",
":",
"start",
",",
"\"",
"\"",
":",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"<mask>",
"(",
")",
".",
"Sub",
"(",
"start",
")",
".",
"Seconds",
"(",
")",
"*",
"float64",
"(",
"time",
".",
"Microsecond",
")",
")",
",",
"\"",
"\"",
":",
"query",
",",
"}",
"\n",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"if",
"err",
":=",
"l",
".",
"t",
".",
"Execute",
"(",
"&",
"buf",
",",
"data",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"l",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"m",
".",
"Unlock",
"(",
")",
"\n",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprintln",
"(",
"l",
".",
"w",
",",
"strings",
".",
"TrimSuffix",
"(",
"buf",
".",
"String",
"(",
")",
",",
"\"",
"\\n",
"\"",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
11,757 | all-11758 | [
"numConnectedSince",
"counts",
"how",
"many",
"members",
"are",
"connected",
"to",
"the",
"local",
"member",
"since",
"the",
"given",
"time",
"."
] | [
"func",
"numConnectedSince",
"(",
"transport",
"rafthttp",
".",
"Transporter",
",",
"since",
"<mask>",
".",
"Time",
",",
"self",
"types",
".",
"ID",
",",
"members",
"[",
"]",
"*",
"membership",
".",
"Member",
")",
"int",
"{",
"connectedNum",
":=",
"0",
"\n",
"for",
"_",
",",
"m",
":=",
"range",
"members",
"{",
"if",
"m",
".",
"ID",
"==",
"self",
"||",
"isConnectedSince",
"(",
"transport",
",",
"since",
",",
"m",
".",
"ID",
")",
"{",
"connectedNum",
"++",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"connectedNum",
"\n",
"}"
] |
11,758 | all-11759 | [
"NewAmazonClientFromEnv",
"creates",
"a",
"Amazon",
"client",
"based",
"on",
"environment",
"variables",
"."
] | [
"func",
"NewAmazonClientFromEnv",
"(",
")",
"(",
"Client",
",",
"error",
")",
"{",
"region",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"AmazonRegionEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"AmazonRegionEnvVar",
")",
"\n",
"}",
"\n",
"bucket",
",",
"<mask>",
":=",
"os",
".",
"LookupEnv",
"(",
"AmazonBucketEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"AmazonBucketEnvVar",
")",
"\n",
"}",
"\n\n",
"var",
"creds",
"AmazonCreds",
"\n",
"creds",
".",
"ID",
",",
"_",
"=",
"os",
".",
"LookupEnv",
"(",
"AmazonIDEnvVar",
")",
"\n",
"creds",
".",
"Secret",
",",
"_",
"=",
"os",
".",
"LookupEnv",
"(",
"AmazonSecretEnvVar",
")",
"\n",
"creds",
".",
"Token",
",",
"_",
"=",
"os",
".",
"LookupEnv",
"(",
"AmazonTokenEnvVar",
")",
"\n",
"creds",
".",
"VaultAddress",
",",
"_",
"=",
"os",
".",
"LookupEnv",
"(",
"AmazonVaultAddrEnvVar",
")",
"\n",
"creds",
".",
"VaultRole",
",",
"_",
"=",
"os",
".",
"LookupEnv",
"(",
"AmazonVaultRoleEnvVar",
")",
"\n",
"creds",
".",
"VaultToken",
",",
"_",
"=",
"os",
".",
"LookupEnv",
"(",
"AmazonVaultTokenEnvVar",
")",
"\n\n",
"distribution",
",",
"_",
":=",
"os",
".",
"LookupEnv",
"(",
"AmazonDistributionEnvVar",
")",
"\n",
"return",
"NewAmazonClient",
"(",
"region",
",",
"bucket",
",",
"&",
"creds",
",",
"distribution",
")",
"\n",
"}"
] |
11,759 | all-11760 | [
"Change",
"the",
"fpath",
"file",
"object",
"to",
"the",
"SELinux",
"label",
"scon",
".",
"If",
"the",
"fpath",
"is",
"a",
"directory",
"and",
"recurse",
"is",
"true",
"Chcon",
"will",
"walk",
"the",
"directory",
"tree",
"setting",
"the",
"label"
] | [
"func",
"Chcon",
"(",
"fpath",
"string",
",",
"scon",
"string",
",",
"recurse",
"bool",
")",
"error",
"{",
"if",
"scon",
"==",
"\"",
"\"",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"err",
":=",
"badPrefix",
"(",
"fpath",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"callback",
":=",
"func",
"(",
"p",
"string",
",",
"info",
"os",
".",
"FileInfo",
",",
"err",
"error",
")",
"error",
"{",
"return",
"Setfilecon",
"(",
"p",
",",
"scon",
")",
"\n",
"}",
"\n\n",
"if",
"recurse",
"{",
"return",
"filepath",
".",
"Walk",
"(",
"fpath",
",",
"<mask>",
")",
"\n",
"}",
"\n\n",
"return",
"Setfilecon",
"(",
"fpath",
",",
"scon",
")",
"\n",
"}"
] |
11,760 | all-11761 | [
"Set",
"parses",
"a",
"command",
"line",
"set",
"of",
"strings",
"separated",
"by",
"comma",
".",
"Implements",
"flag",
".",
"Value",
"interface",
".",
"The",
"values",
"are",
"set",
"in",
"order",
"."
] | [
"func",
"(",
"us",
"*",
"UniqueStringsValue",
")",
"<mask>",
"(",
"s",
"string",
")",
"error",
"{",
"us",
".",
"Values",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"struct",
"{",
"}",
")",
"\n",
"for",
"_",
",",
"v",
":=",
"range",
"strings",
".",
"Split",
"(",
"s",
",",
"\"",
"\"",
")",
"{",
"us",
".",
"Values",
"[",
"v",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
11,761 | all-11762 | [
"Repeated",
"permtation",
"generator",
"for",
"int",
"slice"
] | [
"func",
"repeated_permutations",
"(",
"list",
"[",
"]",
"int",
",",
"select_num",
",",
"buf",
"int",
")",
"(",
"c",
"chan",
"[",
"]",
"int",
")",
"{",
"c",
"=",
"make",
"(",
"chan",
"[",
"]",
"int",
",",
"buf",
")",
"\n",
"go",
"func",
"(",
")",
"{",
"defer",
"close",
"(",
"c",
")",
"\n",
"switch",
"select_num",
"{",
"case",
"1",
":",
"for",
"_",
",",
"v",
":=",
"range",
"list",
"{",
"c",
"<-",
"[",
"]",
"int",
"{",
"v",
"}",
"\n",
"}",
"\n",
"default",
":",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"<mask>",
")",
";",
"i",
"++",
"{",
"for",
"perm",
":=",
"range",
"repeated_permutations",
"(",
"list",
",",
"select_num",
"-",
"1",
",",
"buf",
")",
"{",
"c",
"<-",
"append",
"(",
"[",
"]",
"int",
"{",
"list",
"[",
"i",
"]",
"}",
",",
"perm",
"...",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n",
"return",
"\n",
"}"
] |
11,762 | all-11763 | [
"CopyAllDevices",
"returns",
"all",
"Metal",
"devices",
"in",
"the",
"system",
".",
"Reference",
":",
"https",
":",
"//",
"developer",
".",
"apple",
".",
"com",
"/",
"documentation",
"/",
"metal",
"/",
"1433367",
"-",
"mtlcopyalldevices",
"."
] | [
"func",
"CopyAllDevices",
"(",
")",
"[",
"]",
"<mask>",
"{",
"d",
":=",
"C",
".",
"CopyAllDevices",
"(",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"d",
".",
"Devices",
")",
")",
"\n\n",
"ds",
":=",
"make",
"(",
"[",
"]",
"Device",
",",
"d",
".",
"Length",
")",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"ds",
")",
";",
"i",
"++",
"{",
"d",
":=",
"(",
"*",
"C",
".",
"struct_Device",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"d",
".",
"Devices",
")",
")",
"+",
"uintptr",
"(",
"i",
")",
"*",
"C",
".",
"sizeof_struct_Device",
")",
")",
"\n\n",
"ds",
"[",
"i",
"]",
".",
"device",
"=",
"d",
".",
"Device",
"\n",
"ds",
"[",
"i",
"]",
".",
"Headless",
"=",
"d",
".",
"Headless",
"!=",
"0",
"\n",
"ds",
"[",
"i",
"]",
".",
"LowPower",
"=",
"d",
".",
"LowPower",
"!=",
"0",
"\n",
"ds",
"[",
"i",
"]",
".",
"Name",
"=",
"C",
".",
"GoString",
"(",
"d",
".",
"Name",
")",
"\n",
"}",
"\n",
"return",
"ds",
"\n",
"}"
] |
11,763 | all-11764 | [
"DiscoverPollEndpoint",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockECSClient",
")",
"DiscoverPollEndpoint",
"(",
"arg0",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret0",
",",
"_",
":=",
"<mask>",
"[",
"0",
"]",
".",
"(",
"string",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] |
11,764 | all-11765 | [
"MemberList",
"wraps",
"member",
"list",
"API",
"with",
"following",
"rules",
":",
"-",
"If",
"advaddr",
"is",
"not",
"empty",
"and",
"prefix",
"is",
"not",
"empty",
"return",
"registered",
"member",
"lists",
"via",
"resolver",
"-",
"If",
"advaddr",
"is",
"not",
"empty",
"and",
"prefix",
"is",
"not",
"empty",
"and",
"registered",
"grpc",
"-",
"proxy",
"members",
"haven",
"t",
"been",
"fetched",
"return",
"the",
"advaddr",
"-",
"If",
"advaddr",
"is",
"not",
"empty",
"and",
"prefix",
"is",
"empty",
"return",
"advaddr",
"without",
"forcing",
"it",
"to",
"register",
"-",
"If",
"advaddr",
"is",
"empty",
"forward",
"to",
"member",
"list",
"API"
] | [
"func",
"(",
"cp",
"*",
"clusterProxy",
")",
"MemberList",
"(",
"ctx",
"context",
".",
"<mask>",
",",
"r",
"*",
"pb",
".",
"MemberListRequest",
")",
"(",
"*",
"pb",
".",
"MemberListResponse",
",",
"error",
")",
"{",
"if",
"cp",
".",
"advaddr",
"!=",
"\"",
"\"",
"{",
"if",
"cp",
".",
"prefix",
"!=",
"\"",
"\"",
"{",
"mbs",
",",
"err",
":=",
"cp",
".",
"membersFromUpdates",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"len",
"(",
"mbs",
")",
">",
"0",
"{",
"return",
"&",
"pb",
".",
"MemberListResponse",
"{",
"Members",
":",
"mbs",
"}",
",",
"nil",
"\n",
"}",
"\n",
"}",
"\n",
"// prefix is empty or no grpc-proxy members haven't been registered",
"hostname",
",",
"_",
":=",
"os",
".",
"Hostname",
"(",
")",
"\n",
"return",
"&",
"pb",
".",
"MemberListResponse",
"{",
"Members",
":",
"[",
"]",
"*",
"pb",
".",
"Member",
"{",
"{",
"Name",
":",
"hostname",
",",
"ClientURLs",
":",
"[",
"]",
"string",
"{",
"cp",
".",
"advaddr",
"}",
"}",
"}",
"}",
",",
"nil",
"\n",
"}",
"\n",
"mresp",
",",
"err",
":=",
"cp",
".",
"clus",
".",
"MemberList",
"(",
"ctx",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"resp",
":=",
"(",
"pb",
".",
"MemberListResponse",
")",
"(",
"*",
"mresp",
")",
"\n",
"return",
"&",
"resp",
",",
"err",
"\n",
"}"
] |
11,765 | all-11766 | [
"GetTransaction",
"gets",
"a",
"particular",
"transaction",
"referenced",
"by",
"id"
] | [
"func",
"(",
"c",
"Client",
")",
"GetTransaction",
"(",
"id",
"string",
")",
"(",
"*",
"transaction",
",",
"error",
")",
"{",
"holder",
":=",
"transactionHolder",
"{",
"}",
"\n",
"if",
"err",
":=",
"c",
".",
"Get",
"(",
"\"",
"\"",
"+",
"id",
",",
"nil",
",",
"&",
"holder",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"err",
":=",
"checkApiErrors",
"(",
"holder",
".",
"<mask>",
",",
"\"",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"&",
"holder",
".",
"Transaction",
",",
"nil",
"\n",
"}"
] |
11,766 | all-11767 | [
"StartSpan",
"defers",
"to",
"Tracer",
".",
"StartSpan",
".",
"See",
"GlobalTracer",
"()",
"."
] | [
"func",
"StartSpan",
"(",
"operationName",
"<mask>",
",",
"opts",
"...",
"StartSpanOption",
")",
"Span",
"{",
"return",
"globalTracer",
".",
"tracer",
".",
"StartSpan",
"(",
"operationName",
",",
"opts",
"...",
")",
"\n",
"}"
] |
11,767 | all-11768 | [
"Changes",
"returns",
"any",
"changes",
"within",
"the",
"bundle",
"that",
"apply",
"to",
"the",
"entry",
"identified",
"by",
"key",
"."
] | [
"func",
"(",
"b",
"*",
"Bundle",
")",
"Changes",
"(",
"<mask>",
"xdr",
".",
"LedgerKey",
")",
"(",
"ret",
"[",
"]",
"xdr",
".",
"LedgerEntryChange",
")",
"{",
"return",
"b",
".",
"changes",
"(",
"target",
",",
"math",
".",
"MaxInt32",
")",
"\n",
"}"
] |
11,768 | all-11769 | [
"BuildLoginRequest",
"builds",
"session",
"create",
"requests",
"from",
"users",
"email",
"and",
"password",
"."
] | [
"func",
"(",
"b",
"*",
"instanceLoginRequestBuilder",
")",
"BuildLoginRequest",
"(",
"host",
"string",
")",
"(",
"*",
"http",
".",
"Request",
",",
"error",
")",
"{",
"if",
"<mask>",
"==",
"\"",
"\"",
"{",
"host",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"accountHref",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"b",
".",
"accountID",
")",
"\n",
"jsonStr",
":=",
"fmt",
".",
"Sprintf",
"(",
"`{\"instance_token\":\"%s\",\"account_href\":\"%s\"}`",
",",
"b",
".",
"token",
",",
"accountHref",
")",
"\n",
"authReq",
",",
"err",
":=",
"http",
".",
"NewRequest",
"(",
"\"",
"\"",
",",
"buildURL",
"(",
"host",
",",
"\"",
"\"",
")",
",",
"bytes",
".",
"NewBufferString",
"(",
"jsonStr",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"authReq",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"authReq",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"authReq",
",",
"nil",
"\n",
"}"
] |
11,769 | all-11770 | [
"NetworkCreated",
"sets",
"the",
"state",
"of",
"the",
"given",
"network",
"to",
"Created",
"."
] | [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"NetworkCreated",
"(",
"<mask>",
"string",
")",
"error",
"{",
"return",
"c",
".",
"networkState",
"(",
"name",
",",
"networkCreated",
")",
"\n",
"}"
] |
11,770 | all-11771 | [
"SnapshotServer",
"issues",
"a",
"request",
"to",
"snapshot",
"the",
"disk",
"of",
"an",
"existing",
"server",
".",
"The",
"snapshot",
"is",
"allocated",
"an",
"Image",
"Id",
"which",
"is",
"returned",
"within",
"an",
"instance",
"of",
"Image",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"SnapshotServer",
"(",
"identifier",
"string",
")",
"(",
"*",
"<mask>",
",",
"error",
")",
"{",
"res",
",",
"err",
":=",
"c",
".",
"MakeApiRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"identifier",
"+",
"\"",
"\"",
",",
"nil",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"imageID",
":=",
"getLinkRel",
"(",
"res",
".",
"Header",
".",
"Get",
"(",
"\"",
"\"",
")",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"if",
"imageID",
"!=",
"nil",
"{",
"img",
":=",
"new",
"(",
"Image",
")",
"\n",
"img",
".",
"Id",
"=",
"*",
"imageID",
"\n",
"return",
"img",
",",
"nil",
"\n",
"}",
"\n",
"return",
"nil",
",",
"nil",
"\n",
"}"
] |
11,771 | all-11772 | [
"WaitForContents",
"is",
"a",
"wrapper",
"around",
"gtk_clipboard_wait_for_contents"
] | [
"func",
"(",
"v",
"*",
"Clipboard",
")",
"WaitForContents",
"(",
"target",
"gdk",
".",
"Atom",
")",
"(",
"*",
"SelectionData",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_clipboard_wait_for_contents",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GdkAtom",
"(",
"unsafe",
".",
"Pointer",
"(",
"<mask>",
")",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"p",
":=",
"&",
"SelectionData",
"{",
"c",
"}",
"\n",
"runtime",
".",
"SetFinalizer",
"(",
"p",
",",
"(",
"*",
"SelectionData",
")",
".",
"free",
")",
"\n",
"return",
"p",
",",
"nil",
"\n",
"}"
] |
11,772 | all-11773 | [
"nolint",
":",
"gocyclo"
] | [
"func",
"processConfig",
"(",
"config",
"*",
"Config",
")",
"(",
"<mask>",
"*",
"regexp",
".",
"Regexp",
",",
"exclude",
"*",
"regexp",
".",
"Regexp",
")",
"{",
"tmpl",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"",
"\"",
")",
".",
"Parse",
"(",
"config",
".",
"Format",
")",
"\n",
"kingpin",
".",
"FatalIfError",
"(",
"err",
",",
"\"",
"\"",
",",
"config",
".",
"Format",
")",
"\n",
"config",
".",
"formatTemplate",
"=",
"tmpl",
"\n\n",
"// Ensure that gometalinter manages threads, not linters.",
"os",
".",
"Setenv",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"// Force sorting by path if checkstyle mode is selected",
"// !jsonFlag check is required to handle:",
"// \tgometalinter --json --checkstyle --sort=severity",
"if",
"config",
".",
"Checkstyle",
"&&",
"!",
"config",
".",
"JSON",
"{",
"config",
".",
"Sort",
"=",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
"\n",
"}",
"\n\n",
"// PlaceHolder to skipping \"vendor\" directory if GO15VENDOREXPERIMENT=1 is enabled.",
"// TODO(alec): This will probably need to be enabled by default at a later time.",
"if",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"==",
"\"",
"\"",
"||",
"config",
".",
"Vendor",
"{",
"if",
"err",
":=",
"os",
".",
"Setenv",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"warning",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"config",
".",
"Skip",
"=",
"append",
"(",
"config",
".",
"Skip",
",",
"\"",
"\"",
")",
"\n",
"config",
".",
"Vendor",
"=",
"true",
"\n",
"}",
"\n",
"if",
"len",
"(",
"config",
".",
"Exclude",
")",
">",
"0",
"{",
"exclude",
"=",
"regexp",
".",
"MustCompile",
"(",
"strings",
".",
"Join",
"(",
"config",
".",
"Exclude",
",",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"config",
".",
"Include",
")",
">",
"0",
"{",
"include",
"=",
"regexp",
".",
"MustCompile",
"(",
"strings",
".",
"Join",
"(",
"config",
".",
"Include",
",",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"runtime",
".",
"GOMAXPROCS",
"(",
"config",
".",
"Concurrency",
")",
"\n",
"return",
"include",
",",
"exclude",
"\n",
"}"
] |
11,773 | all-11774 | [
"NowPoint",
"create",
"OnePoint",
"with",
"now",
"timestamp"
] | [
"func",
"NowPoint",
"(",
"metric",
"string",
",",
"<mask>",
"float64",
")",
"*",
"Points",
"{",
"return",
"OnePoint",
"(",
"metric",
",",
"value",
",",
"time",
".",
"Now",
"(",
")",
".",
"Unix",
"(",
")",
")",
"\n",
"}"
] |
11,774 | all-11775 | [
"MarshalJSON",
"implements",
"the",
"json",
".",
"Marshaler",
"interface",
"."
] | [
"func",
"(",
"e",
"LintStatus",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"s",
":=",
"e",
".",
"String",
"(",
")",
"\n",
"return",
"json",
".",
"Marshal",
"(",
"s",
")",
"\n",
"}"
] |
11,775 | all-11776 | [
"Op",
"is",
"an",
"operation",
"in",
"some",
"field",
"and",
"with",
"some",
"value",
"."
] | [
"func",
"Op",
"(",
"o",
"Operation",
",",
"field",
"string",
",",
"vleft",
"...",
"interface",
"{",
"}",
")",
"Ruler",
"{",
"if",
"len",
"(",
"vleft",
")",
">",
"1",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"<mask>",
"val",
"reflect",
".",
"Value",
"\n",
"if",
"len",
"(",
"vleft",
")",
"==",
"1",
"{",
"val",
"=",
"reflect",
".",
"Indirect",
"(",
"reflect",
".",
"ValueOf",
"(",
"vleft",
"[",
"0",
"]",
")",
")",
"\n",
"if",
"val",
".",
"IsValid",
"(",
")",
"&&",
"val",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Interface",
"{",
"val",
"=",
"val",
".",
"Elem",
"(",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"&",
"op",
"{",
"field",
":",
"field",
",",
"vright",
":",
"val",
",",
"op",
":",
"o",
",",
"}",
"\n",
"}"
] |
11,776 | all-11777 | [
"normalizeDiskDatastore",
"normalizes",
"the",
"datastore_id",
"field",
"in",
"a",
"disk",
"sub",
"-",
"resource",
".",
"If",
"the",
"VM",
"has",
"a",
"datastore",
"cluster",
"defined",
"it",
"checks",
"to",
"make",
"sure",
"the",
"datastore",
"in",
"the",
"current",
"state",
"of",
"the",
"disk",
"is",
"a",
"member",
"of",
"the",
"currently",
"defined",
"datastore",
"cluster",
"and",
"if",
"it",
"is",
"not",
"it",
"marks",
"the",
"disk",
"as",
"computed",
"so",
"that",
"it",
"can",
"be",
"migrated",
"back",
"to",
"the",
"datastore",
"cluster",
"on",
"the",
"next",
"update",
"."
] | [
"func",
"(",
"r",
"*",
"DiskSubresource",
")",
"normalizeDiskDatastore",
"(",
")",
"error",
"{",
"podID",
":=",
"r",
".",
"rdd",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"string",
")",
"\n",
"dsID",
",",
"_",
":=",
"r",
".",
"GetChange",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"podID",
"==",
"\"",
"\"",
"{",
"// We don't have a storage pod, just set the old ID and exit. We don't need",
"// to worry about whether or not the storage pod is computed here as if it",
"// is, the VM datastore will have been marked as computed and this function",
"// will have never ran.",
"r",
".",
"Set",
"(",
"\"",
"\"",
",",
"dsID",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n\n",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"r",
")",
"\n\n",
"pod",
",",
"err",
":=",
"storagepod",
".",
"FromID",
"(",
"r",
".",
"client",
",",
"podID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"podID",
",",
"err",
")",
"\n",
"}",
"\n\n",
"ds",
",",
"err",
":=",
"datastore",
".",
"FromID",
"(",
"r",
".",
"client",
",",
"dsID",
".",
"(",
"string",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"dsID",
",",
"err",
")",
"\n",
"}",
"\n\n",
"isMember",
",",
"err",
":=",
"storagepod",
".",
"IsMember",
"(",
"pod",
",",
"ds",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"!",
"isMember",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"r",
",",
"ds",
".",
"Name",
"(",
")",
",",
"pod",
".",
"<mask>",
"(",
")",
",",
")",
"\n",
"dsID",
"=",
"diskDatastoreComputedName",
"\n",
"}",
"\n\n",
"r",
".",
"Set",
"(",
"\"",
"\"",
",",
"dsID",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
11,777 | all-11778 | [
"Run",
"implements",
"the",
"Discoverer",
"interface",
"."
] | [
"func",
"(",
"p",
"*",
"Pod",
")",
"Run",
"(",
"ctx",
"context",
".",
"Context",
",",
"ch",
"chan",
"<-",
"[",
"]",
"*",
"targetgroup",
".",
"Group",
")",
"{",
"defer",
"p",
".",
"queue",
".",
"ShutDown",
"(",
")",
"\n\n",
"if",
"!",
"cache",
".",
"WaitForCacheSync",
"(",
"ctx",
".",
"Done",
"(",
")",
",",
"p",
".",
"informer",
".",
"HasSynced",
")",
"{",
"level",
".",
"Error",
"(",
"p",
".",
"logger",
")",
".",
"<mask>",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"go",
"func",
"(",
")",
"{",
"for",
"p",
".",
"process",
"(",
"ctx",
",",
"ch",
")",
"{",
"}",
"\n",
"}",
"(",
")",
"\n\n",
"// Block until the target provider is explicitly canceled.",
"<-",
"ctx",
".",
"Done",
"(",
")",
"\n",
"}"
] |
11,778 | all-11779 | [
"AddNetwork",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockCNI",
")",
"AddNetwork",
"(",
"arg0",
"*",
"libcni",
".",
"NetworkConfig",
",",
"arg1",
"*",
"libcni",
".",
"RuntimeConf",
")",
"(",
"types",
".",
"Result",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"types",
".",
"Result",
")",
"\n",
"ret1",
",",
"_",
":=",
"<mask>",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] |
11,779 | all-11780 | [
"FindSequenceOnDisk",
"takes",
"a",
"string",
"that",
"is",
"a",
"compatible",
"/",
"parsible",
"FileSequence",
"pattern",
"and",
"finds",
"a",
"sequence",
"on",
"disk",
"which",
"matches",
"the",
"Basename",
"and",
"Extension",
".",
"By",
"default",
"the",
"patterns",
"frame",
"value",
"and",
"padding",
"characters",
"are",
"ignored",
"and",
"replaced",
"by",
"a",
"wildcard",
"*",
"glob",
".",
"If",
"you",
"want",
"to",
"match",
"on",
"a",
"specific",
"frame",
"padding",
"length",
"pass",
"the",
"option",
"StrictPadding",
"If",
"no",
"match",
"is",
"found",
"a",
"nil",
"FileSequence",
"is",
"returned",
".",
"If",
"an",
"error",
"occurs",
"while",
"reading",
"the",
"filesystem",
"a",
"non",
"-",
"nil",
"error",
"is",
"returned",
".",
"Example",
":",
"//",
"Find",
"matches",
"with",
"any",
"frame",
"value",
"FindSequenceOnDisk",
"(",
"/",
"path",
"/",
"to",
"/",
"seq",
".",
"#",
".",
"ext",
")",
"//",
"Find",
"matches",
"specifically",
"having",
"4",
"-",
"padded",
"frames",
"FindSequenceOnDisk",
"(",
"/",
"path",
"/",
"to",
"/",
"seq",
".",
"#",
".",
"ext",
"StrictPadding",
")"
] | [
"func",
"FindSequenceOnDisk",
"(",
"pattern",
"string",
",",
"opts",
"...",
"FileOption",
")",
"(",
"*",
"FileSequence",
",",
"error",
")",
"{",
"return",
"FindSequenceOnDiskPad",
"(",
"<mask>",
",",
"PadStyleDefault",
",",
"opts",
"...",
")",
"\n",
"}"
] |
11,780 | all-11781 | [
"ParamsInt64",
"returns",
"params",
"result",
"in",
"int64",
"type",
".",
"e",
".",
"g",
".",
"ctx",
".",
"ParamsInt64",
"(",
":",
"uid",
")"
] | [
"func",
"(",
"ctx",
"*",
"Context",
")",
"ParamsInt64",
"(",
"<mask>",
"string",
")",
"int64",
"{",
"return",
"com",
".",
"StrTo",
"(",
"ctx",
".",
"Params",
"(",
"name",
")",
")",
".",
"MustInt64",
"(",
")",
"\n",
"}"
] |
11,781 | all-11782 | [
"AddGithubResource",
"github",
"specific",
"resource",
"add"
] | [
"func",
"(",
"s",
"*",
"ConcoursePipeline",
")",
"AddGithubResource",
"(",
"name",
"string",
",",
"<mask>",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"{",
"s",
".",
"AddResource",
"(",
"name",
",",
"GithubResourceName",
",",
"source",
")",
"\n",
"}"
] |
11,782 | all-11783 | [
"NewError",
"returns",
"an",
"error",
"corresponding",
"to",
"a",
"typed",
"error",
"returned",
"from",
"ACS",
".",
"It",
"is",
"expected",
"that",
"the",
"passed",
"in",
"interface",
"{}",
"is",
"really",
"a",
"struct",
"which",
"has",
"a",
"Message",
"field",
"of",
"type",
"*",
"string",
".",
"In",
"that",
"case",
"the",
"Message",
"will",
"be",
"conveyed",
"as",
"part",
"of",
"the",
"Error",
"string",
"as",
"well",
"as",
"the",
"type",
".",
"It",
"is",
"safe",
"to",
"pass",
"anything",
"into",
"this",
"constructor",
"and",
"it",
"will",
"also",
"work",
"reasonably",
"well",
"with",
"anything",
"fulfilling",
"the",
"error",
"interface",
"."
] | [
"func",
"(",
"ae",
"*",
"acsError",
")",
"NewError",
"(",
"err",
"<mask>",
"{",
"}",
")",
"*",
"wsclient",
".",
"WSError",
"{",
"return",
"&",
"wsclient",
".",
"WSError",
"{",
"ErrObj",
":",
"err",
",",
"Type",
":",
"errType",
",",
"WSUnretriableErrors",
":",
"&",
"ACSUnretriableErrors",
"{",
"}",
"}",
"\n",
"}"
] |
11,783 | all-11784 | [
"SetFillColor",
"sets",
"the",
"fill",
"and",
"text",
"color"
] | [
"func",
"(",
"gc",
"*",
"GraphicContext",
")",
"SetFillColor",
"(",
"c",
"<mask>",
".",
"Color",
")",
"{",
"gc",
".",
"StackGraphicContext",
".",
"SetFillColor",
"(",
"c",
")",
"\n",
"gc",
".",
"pdf",
".",
"SetFillColor",
"(",
"rgb",
"(",
"c",
")",
")",
"\n",
"gc",
".",
"pdf",
".",
"SetTextColor",
"(",
"rgb",
"(",
"c",
")",
")",
"\n",
"}"
] |
11,784 | all-11785 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetResourceContentReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage32",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
11,785 | all-11786 | [
"Logger",
"defines",
"the",
"logger",
"to",
"be",
"used",
"whenever",
"detailed",
"messages",
"have",
"to",
"be",
"printed",
"out",
"."
] | [
"func",
"Logger",
"(",
"l",
"<mask>",
".",
"Logger",
")",
"TokenOpt",
"{",
"return",
"TokenOpt",
"{",
"func",
"(",
"o",
"*",
"options",
")",
"{",
"o",
".",
"logger",
"=",
"l",
"\n",
"}",
"}",
"\n",
"}"
] |
11,786 | all-11787 | [
"CopyEvents",
"copies",
"the",
"event",
"into",
"the",
"buffer"
] | [
"func",
"(",
"buffer",
"*",
"InfiniteBuffer",
")",
"CopyEvents",
"(",
"event",
"*",
"events",
".",
"Message",
")",
"{",
"if",
"event",
".",
"ID",
"==",
"\"",
"\"",
"||",
"event",
".",
"Type",
"!=",
"containerTypeEvent",
"{",
"return",
"\n",
"}",
"\n\n",
"// Only add the events agent is interested",
"for",
"_",
",",
"containerEvent",
":=",
"range",
"containerEvents",
"{",
"if",
"event",
".",
"Status",
"==",
"containerEvent",
"{",
"buffer",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"buffer",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
"buffer",
".",
"events",
"=",
"<mask>",
"(",
"buffer",
".",
"events",
",",
"event",
")",
"\n",
"// Check if there is consumer waiting for events",
"if",
"buffer",
".",
"empty",
"{",
"buffer",
".",
"empty",
"=",
"false",
"\n\n",
"// Unblock the consumer",
"buffer",
".",
"waitForEvent",
".",
"Done",
"(",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
11,787 | all-11788 | [
"putToBottom",
"puts",
"Sentinel",
"address",
"to",
"the",
"bottom",
"of",
"address",
"list",
".",
"We",
"call",
"this",
"method",
"internally",
"when",
"see",
"that",
"some",
"Sentinel",
"failed",
"to",
"answer",
"on",
"application",
"request",
"so",
"next",
"time",
"we",
"start",
"with",
"another",
"one",
".",
"Lock",
"must",
"be",
"held",
"by",
"caller",
"."
] | [
"func",
"(",
"s",
"*",
"Sentinel",
")",
"putToBottom",
"(",
"addr",
"string",
")",
"{",
"addrs",
":=",
"s",
".",
"Addrs",
"\n",
"if",
"addrs",
"[",
"len",
"(",
"addrs",
")",
"-",
"1",
"]",
"==",
"addr",
"{",
"// Already on bottom.",
"return",
"\n",
"}",
"\n",
"newAddrs",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"_",
",",
"a",
":=",
"range",
"addrs",
"{",
"if",
"a",
"==",
"addr",
"{",
"<mask>",
"\n",
"}",
"\n",
"newAddrs",
"=",
"append",
"(",
"newAddrs",
",",
"a",
")",
"\n",
"}",
"\n",
"newAddrs",
"=",
"append",
"(",
"newAddrs",
",",
"addr",
")",
"\n",
"s",
".",
"Addrs",
"=",
"newAddrs",
"\n",
"}"
] |
11,788 | all-11789 | [
"Finalize",
"ensures",
"there",
"no",
"nil",
"pointers",
"."
] | [
"func",
"(",
"c",
"*",
"DedupConfig",
")",
"Finalize",
"(",
")",
"{",
"if",
"c",
".",
"Enabled",
"==",
"nil",
"{",
"c",
".",
"Enabled",
"=",
"Bool",
"(",
"false",
"||",
"TimeDurationPresent",
"(",
"c",
".",
"MaxStale",
")",
"||",
"StringPresent",
"(",
"c",
".",
"Prefix",
")",
"||",
"TimeDurationPresent",
"(",
"c",
".",
"TTL",
")",
")",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"MaxStale",
"==",
"nil",
"{",
"c",
".",
"MaxStale",
"=",
"TimeDuration",
"(",
"DefaultDedupMaxStale",
")",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"Prefix",
"==",
"nil",
"{",
"c",
".",
"Prefix",
"=",
"<mask>",
"(",
"DefaultDedupPrefix",
")",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"TTL",
"==",
"nil",
"{",
"c",
".",
"TTL",
"=",
"TimeDuration",
"(",
"DefaultDedupTTL",
")",
"\n",
"}",
"\n",
"}"
] |
11,789 | all-11790 | [
"ServeFile",
"serves",
"given",
"file",
"to",
"response",
"."
] | [
"func",
"(",
"ctx",
"*",
"Context",
")",
"ServeFile",
"(",
"file",
"string",
",",
"names",
"...",
"string",
")",
"{",
"var",
"name",
"string",
"\n",
"if",
"len",
"(",
"names",
")",
">",
"0",
"{",
"name",
"=",
"names",
"[",
"0",
"]",
"\n",
"}",
"else",
"{",
"name",
"=",
"path",
".",
"Base",
"(",
"file",
")",
"\n",
"}",
"\n",
"ctx",
".",
"Resp",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"ctx",
".",
"Resp",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"ctx",
".",
"Resp",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"name",
")",
"\n",
"ctx",
".",
"Resp",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"ctx",
".",
"Resp",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"ctx",
".",
"Resp",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"ctx",
".",
"Resp",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"http",
".",
"ServeFile",
"(",
"ctx",
".",
"Resp",
",",
"ctx",
".",
"Req",
".",
"<mask>",
",",
"file",
")",
"\n",
"}"
] |
11,790 | all-11791 | [
"next",
"returns",
"the",
"next",
"rune",
"in",
"the",
"input",
"."
] | [
"func",
"(",
"l",
"*",
"lexer",
")",
"next",
"(",
")",
"rune",
"{",
"if",
"int",
"(",
"l",
".",
"pos",
")",
">=",
"len",
"(",
"l",
".",
"input",
")",
"{",
"l",
".",
"width",
"=",
"0",
"\n",
"return",
"eof",
"\n",
"}",
"\n",
"r",
",",
"w",
":=",
"utf8",
".",
"DecodeRuneInString",
"(",
"l",
".",
"<mask>",
"[",
"l",
".",
"pos",
":",
"]",
")",
"\n",
"l",
".",
"width",
"=",
"Pos",
"(",
"w",
")",
"\n",
"l",
".",
"pos",
"+=",
"l",
".",
"width",
"\n",
"return",
"r",
"\n",
"}"
] |
11,791 | all-11792 | [
"lsCommandFunc",
"executes",
"the",
"ls",
"command",
"."
] | [
"func",
"lsCommandFunc",
"(",
"c",
"*",
"cli",
".",
"Context",
",",
"ki",
"client",
".",
"KeysAPI",
")",
"{",
"key",
":=",
"\"",
"\"",
"\n",
"if",
"len",
"(",
"c",
".",
"Args",
"(",
")",
")",
"!=",
"0",
"{",
"key",
"=",
"c",
".",
"Args",
"(",
")",
"[",
"0",
"]",
"\n",
"}",
"\n\n",
"sort",
":=",
"c",
".",
"Bool",
"(",
"\"",
"\"",
")",
"\n",
"recursive",
":=",
"c",
".",
"Bool",
"(",
"\"",
"\"",
")",
"\n",
"quorum",
":=",
"c",
".",
"Bool",
"(",
"\"",
"\"",
")",
"\n\n",
"ctx",
",",
"cancel",
":=",
"contextWithTotalTimeout",
"(",
"c",
")",
"\n",
"resp",
",",
"err",
":=",
"ki",
".",
"Get",
"(",
"ctx",
",",
"key",
",",
"&",
"<mask>",
".",
"GetOptions",
"{",
"Sort",
":",
"sort",
",",
"Recursive",
":",
"recursive",
",",
"Quorum",
":",
"quorum",
"}",
")",
"\n",
"cancel",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"handleError",
"(",
"c",
",",
"ExitServerError",
",",
"err",
")",
"\n",
"}",
"\n\n",
"printLs",
"(",
"c",
",",
"resp",
")",
"\n",
"}"
] |
11,792 | all-11793 | [
"SetPrinterLpi",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_set_printer_lpi",
"()",
"."
] | [
"func",
"(",
"<mask>",
"*",
"PrintSettings",
")",
"SetPrinterLpi",
"(",
"lpi",
"float64",
")",
"{",
"C",
".",
"gtk_print_settings_set_printer_lpi",
"(",
"ps",
".",
"native",
"(",
")",
",",
"C",
".",
"gdouble",
"(",
"lpi",
")",
")",
"\n",
"}"
] |
11,793 | all-11794 | [
"datastorePathHasBase",
"is",
"a",
"helper",
"to",
"check",
"if",
"a",
"datastore",
"path",
"s",
"file",
"matches",
"a",
"supplied",
"file",
"name",
"."
] | [
"func",
"datastorePathHasBase",
"(",
"p",
",",
"b",
"string",
")",
"bool",
"{",
"dp",
":=",
"&",
"object",
".",
"DatastorePath",
"{",
"}",
"\n",
"if",
"ok",
":=",
"dp",
".",
"FromString",
"(",
"p",
")",
";",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"path",
".",
"Base",
"(",
"dp",
".",
"<mask>",
")",
"==",
"path",
".",
"Base",
"(",
"b",
")",
"\n",
"}"
] |
11,794 | all-11795 | [
"GetRightMargin",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_page_setup_get_right_margin",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PageSetup",
")",
"GetRightMargin",
"(",
"<mask>",
"Unit",
")",
"float64",
"{",
"c",
":=",
"C",
".",
"gtk_page_setup_get_right_margin",
"(",
"ps",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkUnit",
"(",
"unit",
")",
")",
"\n",
"return",
"float64",
"(",
"c",
")",
"\n",
"}"
] |
11,795 | all-11796 | [
"DecodeConnectionError",
"decodes",
"some",
"of",
"the",
"connection",
"errors",
"returned",
"by",
"the",
"backend",
".",
"Some",
"differ",
"from",
"the",
"usual",
"ones",
"in",
"that",
"they",
"do",
"not",
"have",
"a",
"type",
"and",
"message",
"field",
"but",
"rather",
"are",
"of",
"the",
"form",
"{",
"ErrorType",
":",
"ErrorMessage",
"}"
] | [
"func",
"DecodeConnectionError",
"(",
"data",
"[",
"]",
"byte",
",",
"dec",
"TypeDecoder",
")",
"(",
"interface",
"{",
"}",
",",
"string",
",",
"error",
")",
"{",
"var",
"acsErr",
"map",
"[",
"string",
"]",
"string",
"\n",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"data",
",",
"&",
"acsErr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"\"",
"\"",
",",
"&",
"UndecodableMessage",
"{",
"string",
"(",
"data",
")",
"}",
"\n",
"}",
"\n",
"if",
"len",
"(",
"acsErr",
")",
"!=",
"1",
"{",
"return",
"nil",
",",
"\"",
"\"",
",",
"&",
"UndecodableMessage",
"{",
"string",
"(",
"data",
")",
"}",
"\n",
"}",
"\n",
"var",
"typeStr",
"string",
"\n",
"for",
"key",
":=",
"range",
"acsErr",
"{",
"typeStr",
"=",
"key",
"\n",
"}",
"\n",
"errType",
",",
"ok",
":=",
"dec",
".",
"NewOfType",
"(",
"typeStr",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"typeStr",
",",
"&",
"UnrecognizedWSRequestType",
"{",
"}",
"\n",
"}",
"\n\n",
"val",
":=",
"reflect",
".",
"ValueOf",
"(",
"errType",
")",
"\n",
"if",
"val",
".",
"Kind",
"(",
")",
"!=",
"reflect",
".",
"Ptr",
"{",
"return",
"nil",
",",
"typeStr",
",",
"&",
"UnrecognizedWSRequestType",
"{",
"\"",
"\"",
"+",
"val",
".",
"Kind",
"(",
")",
".",
"String",
"(",
")",
"}",
"\n",
"}",
"\n",
"<mask>",
":=",
"reflect",
".",
"New",
"(",
"val",
".",
"Elem",
"(",
")",
".",
"Type",
"(",
")",
")",
"\n",
"retObj",
":=",
"ret",
".",
"Elem",
"(",
")",
"\n\n",
"if",
"retObj",
".",
"Kind",
"(",
")",
"!=",
"reflect",
".",
"Struct",
"{",
"return",
"nil",
",",
"typeStr",
",",
"&",
"UnrecognizedWSRequestType",
"{",
"\"",
"\"",
"+",
"retObj",
".",
"Kind",
"(",
")",
".",
"String",
"(",
")",
"}",
"\n",
"}",
"\n\n",
"msgField",
":=",
"retObj",
".",
"FieldByName",
"(",
"\"",
"\"",
")",
"\n",
"if",
"!",
"msgField",
".",
"IsValid",
"(",
")",
"{",
"return",
"nil",
",",
"typeStr",
",",
"&",
"UnrecognizedWSRequestType",
"{",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"if",
"msgField",
".",
"IsValid",
"(",
")",
"&&",
"msgField",
".",
"CanSet",
"(",
")",
"{",
"msgStr",
":=",
"acsErr",
"[",
"typeStr",
"]",
"\n",
"msgStrVal",
":=",
"reflect",
".",
"ValueOf",
"(",
"&",
"msgStr",
")",
"\n",
"if",
"!",
"msgStrVal",
".",
"Type",
"(",
")",
".",
"AssignableTo",
"(",
"msgField",
".",
"Type",
"(",
")",
")",
"{",
"return",
"nil",
",",
"typeStr",
",",
"&",
"UnrecognizedWSRequestType",
"{",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"msgField",
".",
"Set",
"(",
"msgStrVal",
")",
"\n",
"return",
"ret",
".",
"Interface",
"(",
")",
",",
"typeStr",
",",
"nil",
"\n",
"}",
"\n",
"return",
"nil",
",",
"typeStr",
",",
"&",
"UnrecognizedWSRequestType",
"{",
"\"",
"\"",
"}",
"\n",
"}"
] |
11,796 | all-11797 | [
"Panic",
"records",
"the",
"log",
"with",
"fatal",
"level",
"and",
"panics"
] | [
"func",
"(",
"l",
"*",
"Logger",
")",
"Panic",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"msg",
":=",
"fmt",
".",
"Sprint",
"(",
"args",
"...",
")",
"\n",
"l",
".",
"Output",
"(",
"2",
",",
"LevelError",
",",
"msg",
")",
"\n",
"panic",
"(",
"<mask>",
")",
"\n",
"}"
] |
11,797 | all-11798 | [
"Do",
"executes",
"Animation",
".",
"setPlaybackRate",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetPlaybackRateParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetPlaybackRate",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
11,798 | all-11799 | [
"viewByTimeUnit",
"returns",
"the",
"view",
"name",
"for",
"time",
"with",
"a",
"given",
"quantum",
"unit",
"."
] | [
"func",
"viewByTimeUnit",
"(",
"t",
"time",
".",
"Time",
",",
"unit",
"rune",
")",
"string",
"{",
"switch",
"unit",
"{",
"case",
"'Y'",
":",
"return",
"t",
".",
"Format",
"(",
"\"",
"\"",
")",
"\n",
"case",
"'M'",
":",
"return",
"t",
".",
"Format",
"(",
"\"",
"\"",
")",
"\n",
"<mask>",
"'D'",
":",
"return",
"t",
".",
"Format",
"(",
"\"",
"\"",
")",
"\n",
"case",
"'H'",
":",
"return",
"t",
".",
"Format",
"(",
"\"",
"\"",
")",
"\n",
"default",
":",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"}"
] |
11,799 | all-11800 | [
"Signal",
"sends",
"the",
"signal",
"to",
"the",
"child",
"process",
"returning",
"any",
"errors",
"that",
"occur",
"."
] | [
"func",
"(",
"c",
"*",
"Child",
")",
"Signal",
"(",
"s",
"os",
".",
"Signal",
")",
"error",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"s",
".",
"<mask>",
"(",
")",
")",
"\n",
"c",
".",
"RLock",
"(",
")",
"\n",
"defer",
"c",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"c",
".",
"signal",
"(",
"s",
")",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.