id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
listlengths 1
418
| pl_tokens
listlengths 22
4.98k
|
---|---|---|---|
17,200 | all-17201 | [
"WithHeaders",
"if",
"set",
"this",
"allows",
"the",
"request",
"headers",
"to",
"be",
"changed",
".",
"Must",
"not",
"be",
"set",
"in",
"response",
"to",
"an",
"authChallenge",
"."
]
| [
"func",
"(",
"p",
"ContinueInterceptedRequestParams",
")",
"WithHeaders",
"(",
"<mask>",
"Headers",
")",
"*",
"ContinueInterceptedRequestParams",
"{",
"p",
".",
"Headers",
"=",
"headers",
"\n",
"return",
"&",
"p",
"\n",
"}"
]
|
17,201 | all-17202 | [
"Attach",
"attaches",
"the",
"files",
"to",
"the",
"email",
"."
]
| [
"func",
"(",
"m",
"*",
"Message",
")",
"Attach",
"(",
"<mask>",
"string",
",",
"settings",
"...",
"FileSetting",
")",
"{",
"m",
".",
"attachments",
"=",
"m",
".",
"appendFile",
"(",
"m",
".",
"attachments",
",",
"fileFromFilename",
"(",
"filename",
")",
",",
"settings",
")",
"\n",
"}"
]
|
17,202 | all-17203 | [
"SecondaryColors",
"returns",
"text",
"and",
"background",
"colors",
"for",
"empty",
"part",
"of",
"the",
"ProgressBar"
]
| [
"func",
"(",
"b",
"*",
"ProgressBar",
")",
"SecondaryColors",
"(",
")",
"(",
"term",
".",
"Attribute",
",",
"<mask>",
".",
"Attribute",
")",
"{",
"return",
"b",
".",
"emptyFg",
",",
"b",
".",
"emptyBg",
"\n",
"}"
]
|
17,203 | all-17204 | [
"ContainerConfigInsert",
"inserts",
"a",
"new",
"config",
"for",
"the",
"container",
"with",
"the",
"given",
"ID",
"."
]
| [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"ContainerConfigInsert",
"(",
"<mask>",
"int",
",",
"config",
"map",
"[",
"string",
"]",
"string",
")",
"error",
"{",
"return",
"ContainerConfigInsert",
"(",
"c",
".",
"tx",
",",
"id",
",",
"config",
")",
"\n",
"}"
]
|
17,204 | all-17205 | [
"NewImage",
"returns",
"a",
"types",
".",
"ImageCloser",
"for",
"this",
"reference",
"possibly",
"specialized",
"for",
"this",
"ImageTransport",
".",
"The",
"caller",
"must",
"call",
".",
"Close",
"()",
"on",
"the",
"returned",
"ImageCloser",
".",
"NOTE",
":",
"If",
"any",
"kind",
"of",
"signature",
"verification",
"should",
"happen",
"build",
"an",
"UnparsedImage",
"from",
"the",
"value",
"returned",
"by",
"NewImageSource",
"verify",
"that",
"UnparsedImage",
"and",
"convert",
"it",
"into",
"a",
"real",
"Image",
"via",
"image",
".",
"FromUnparsedImage",
".",
"WARNING",
":",
"This",
"may",
"not",
"do",
"the",
"right",
"thing",
"for",
"a",
"manifest",
"list",
"see",
"image",
".",
"FromSource",
"for",
"details",
"."
]
| [
"func",
"(",
"<mask>",
"dockerReference",
")",
"NewImage",
"(",
"ctx",
"context",
".",
"Context",
",",
"sys",
"*",
"types",
".",
"SystemContext",
")",
"(",
"types",
".",
"ImageCloser",
",",
"error",
")",
"{",
"return",
"newImage",
"(",
"ctx",
",",
"sys",
",",
"ref",
")",
"\n",
"}"
]
|
17,205 | all-17206 | [
"PutWriter",
"provides",
"a",
"writer",
"to",
"upload",
"data",
"as",
"multipart",
"upload",
"requests",
".",
"Each",
"header",
"in",
"h",
"is",
"added",
"to",
"the",
"HTTP",
"request",
"header",
".",
"This",
"is",
"useful",
"for",
"specifying",
"options",
"such",
"as",
"server",
"-",
"side",
"encryption",
"in",
"metadata",
"as",
"well",
"as",
"custom",
"user",
"metadata",
".",
"DefaultConfig",
"is",
"used",
"if",
"c",
"is",
"nil",
".",
"Callers",
"should",
"call",
"Close",
"on",
"w",
"to",
"ensure",
"that",
"all",
"resources",
"are",
"released",
"."
]
| [
"func",
"(",
"b",
"*",
"Bucket",
")",
"PutWriter",
"(",
"path",
"string",
",",
"h",
"http",
".",
"<mask>",
",",
"c",
"*",
"Config",
")",
"(",
"w",
"io",
".",
"WriteCloser",
",",
"err",
"error",
")",
"{",
"if",
"c",
"==",
"nil",
"{",
"c",
"=",
"b",
".",
"conf",
"(",
")",
"\n",
"}",
"\n",
"u",
",",
"err",
":=",
"b",
".",
"url",
"(",
"path",
",",
"c",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"newPutter",
"(",
"*",
"u",
",",
"h",
",",
"c",
",",
"b",
")",
"\n",
"}"
]
|
17,206 | all-17207 | [
"ApplyFirewallPolicy",
"issues",
"a",
"request",
"to",
"apply",
"the",
"given",
"firewall",
"policy",
"to",
"the",
"given",
"server",
"group",
"."
]
| [
"func",
"(",
"c",
"*",
"Client",
")",
"ApplyFirewallPolicy",
"(",
"policyId",
"string",
",",
"serverGroupId",
"string",
")",
"(",
"*",
"FirewallPolicy",
",",
"error",
")",
"{",
"policy",
":=",
"<mask>",
"(",
"FirewallPolicy",
")",
"\n",
"_",
",",
"err",
":=",
"c",
".",
"MakeApiRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"policyId",
"+",
"\"",
"\"",
",",
"map",
"[",
"string",
"]",
"string",
"{",
"\"",
"\"",
":",
"serverGroupId",
"}",
",",
"&",
"policy",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"policy",
",",
"nil",
"\n",
"}"
]
|
17,207 | all-17208 | [
"FromPathOrDefault",
"returns",
"a",
"ResourcePool",
"via",
"its",
"supplied",
"path",
"."
]
| [
"func",
"FromPathOrDefault",
"(",
"client",
"*",
"govmomi",
".",
"Client",
",",
"name",
"string",
",",
"dc",
"*",
"object",
".",
"Datacenter",
")",
"(",
"*",
"object",
".",
"ResourcePool",
",",
"error",
")",
"{",
"finder",
":=",
"find",
".",
"NewFinder",
"(",
"client",
".",
"Client",
",",
"false",
")",
"\n\n",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"provider",
".",
"DefaultAPITimeout",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n",
"t",
":=",
"client",
".",
"ServiceContent",
".",
"About",
".",
"ApiType",
"\n",
"switch",
"t",
"{",
"<mask>",
"\"",
"\"",
":",
"ddc",
",",
"err",
":=",
"finder",
".",
"DefaultDatacenter",
"(",
"ctx",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"finder",
".",
"SetDatacenter",
"(",
"ddc",
")",
"\n",
"return",
"finder",
".",
"DefaultResourcePool",
"(",
"ctx",
")",
"\n",
"case",
"\"",
"\"",
":",
"if",
"dc",
"!=",
"nil",
"{",
"finder",
".",
"SetDatacenter",
"(",
"dc",
")",
"\n",
"}",
"\n",
"if",
"name",
"!=",
"\"",
"\"",
"{",
"return",
"finder",
".",
"ResourcePool",
"(",
"ctx",
",",
"name",
")",
"\n",
"}",
"\n",
"return",
"finder",
".",
"DefaultResourcePool",
"(",
"ctx",
")",
"\n",
"}",
"\n",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"t",
")",
"\n",
"}"
]
|
17,208 | all-17209 | [
"GetUseUnderline",
"is",
"a",
"wrapper",
"around",
"gtk_tool_button_get_use_underline",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"ToolButton",
")",
"GetuseUnderline",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_tool_button_get_use_underline",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
]
|
17,209 | all-17210 | [
"vimSoapFault",
"extracts",
"the",
"VIM",
"fault",
".",
"Check",
"the",
"returned",
"boolean",
"value",
"to",
"see",
"if",
"you",
"have",
"a",
"fault",
"which",
"will",
"need",
"to",
"be",
"further",
"asserted",
"into",
"the",
"error",
"that",
"you",
"are",
"looking",
"for",
"."
]
| [
"func",
"vimSoapFault",
"(",
"err",
"error",
")",
"(",
"types",
".",
"AnyType",
",",
"bool",
")",
"{",
"if",
"sf",
",",
"ok",
":=",
"soapFault",
"(",
"err",
")",
";",
"ok",
"{",
"return",
"sf",
".",
"VimFault",
"(",
")",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"nil",
",",
"false",
"\n",
"}"
]
|
17,210 | all-17211 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"a",
"specified",
"program",
"object"
]
| [
"func",
"ProgramUniform2ui",
"(",
"program",
"uint32",
",",
"location",
"int32",
",",
"v0",
"uint32",
",",
"v1",
"uint32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpProgramUniform2ui",
",",
"4",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"location",
")",
",",
"uintptr",
"(",
"v0",
")",
",",
"uintptr",
"(",
"v1",
")",
",",
"0",
",",
"0",
")",
"\n",
"}"
]
|
17,211 | all-17212 | [
"GenODBC",
"generates",
"a",
"odbc",
"DSN",
"from",
"the",
"passed",
"URL",
"."
]
| [
"func",
"GenODBC",
"(",
"u",
"*",
"URL",
")",
"(",
"string",
",",
"error",
")",
"{",
"q",
":=",
"u",
".",
"Query",
"(",
")",
"\n\n",
"host",
",",
"port",
",",
"dbname",
":=",
"hostname",
"(",
"u",
".",
"Host",
")",
",",
"hostport",
"(",
"u",
".",
"Host",
")",
",",
"strings",
".",
"TrimPrefix",
"(",
"u",
".",
"Path",
",",
"\"",
"\"",
")",
"\n\n",
"// save host, port, dbname",
"if",
"u",
".",
"hostPortDB",
"==",
"nil",
"{",
"u",
".",
"hostPortDB",
"=",
"[",
"]",
"string",
"{",
"host",
",",
"port",
",",
"dbname",
"}",
"\n",
"}",
"\n\n",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"strings",
".",
"Replace",
"(",
"u",
".",
"Proto",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
"+",
"\"",
"\"",
")",
"\n",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"host",
")",
"\n\n",
"if",
"port",
"==",
"\"",
"\"",
"{",
"proto",
":=",
"strings",
".",
"ToLower",
"(",
"u",
".",
"Proto",
")",
"\n",
"switch",
"{",
"case",
"strings",
".",
"Contains",
"(",
"proto",
",",
"\"",
"\"",
")",
":",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"case",
"strings",
".",
"Contains",
"(",
"proto",
",",
"\"",
"\"",
")",
":",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"case",
"strings",
".",
"Contains",
"(",
"proto",
",",
"\"",
"\"",
")",
"||",
"strings",
".",
"Contains",
"(",
"proto",
",",
"\"",
"\"",
")",
":",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"default",
":",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"else",
"{",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"port",
")",
"\n",
"}",
"\n",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"dbname",
")",
"\n\n",
"// add user/pass",
"if",
"u",
".",
"User",
"!=",
"nil",
"{",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"u",
".",
"<mask>",
".",
"Username",
"(",
")",
")",
"\n",
"p",
",",
"_",
":=",
"u",
".",
"User",
".",
"Password",
"(",
")",
"\n",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"p",
")",
"\n",
"}",
"\n\n",
"return",
"genOptionsODBC",
"(",
"q",
",",
"true",
")",
",",
"nil",
"\n",
"}"
]
|
17,212 | all-17213 | [
"ClearAttributes",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_tree_view_column_clear_attributes",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"TreeViewColumn",
")",
"ClearAttributes",
"(",
"cell",
"*",
"CellRenderer",
")",
"{",
"C",
".",
"gtk_tree_view_column_clear_attributes",
"(",
"v",
".",
"native",
"(",
")",
",",
"<mask>",
".",
"native",
"(",
")",
")",
"\n",
"}"
]
|
17,213 | all-17214 | [
"invalidate",
"the",
"content",
"of",
"some",
"or",
"all",
"of",
"a",
"framebuffer",
"s",
"attachments"
]
| [
"func",
"InvalidateFramebuffer",
"(",
"target",
"uint32",
",",
"numAttachments",
"int32",
",",
"attachments",
"*",
"uint32",
")",
"{",
"C",
".",
"glowInvalidateFramebuffer",
"(",
"gpInvalidateFramebuffer",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"<mask>",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"numAttachments",
")",
",",
"(",
"*",
"C",
".",
"GLenum",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"attachments",
")",
")",
")",
"\n",
"}"
]
|
17,214 | all-17215 | [
"DeviceInfo",
"returns",
"information",
"about",
"a",
"particular",
"device"
]
| [
"func",
"(",
"p",
"Pushy",
")",
"DeviceInfo",
"(",
"deviceID",
"string",
")",
"(",
"*",
"DeviceInfo",
",",
"*",
"Error",
",",
"error",
")",
"{",
"url",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"p",
".",
"APIEndpoint",
",",
"deviceID",
",",
"p",
".",
"APIToken",
")",
"\n",
"<mask>",
"errResponse",
"*",
"Error",
"\n",
"var",
"info",
"*",
"DeviceInfo",
"\n",
"err",
":=",
"get",
"(",
"p",
".",
"httpClient",
",",
"url",
",",
"&",
"info",
",",
"&",
"errResponse",
")",
"\n",
"return",
"info",
",",
"errResponse",
",",
"err",
"\n",
"}"
]
|
17,215 | all-17216 | [
"Peek",
"returns",
"query",
"arg",
"value",
"for",
"the",
"given",
"key",
".",
"Returned",
"value",
"is",
"valid",
"until",
"the",
"next",
"Args",
"call",
"."
]
| [
"func",
"(",
"a",
"*",
"Args",
")",
"Peek",
"(",
"key",
"string",
")",
"[",
"]",
"byte",
"{",
"return",
"peekArgStr",
"(",
"a",
".",
"args",
",",
"<mask>",
")",
"\n",
"}"
]
|
17,216 | all-17217 | [
"NewInCluster",
"constructs",
"a",
"new",
"APIClient",
"using",
"env",
"vars",
"that",
"Kubernetes",
"creates",
".",
"This",
"should",
"be",
"used",
"to",
"access",
"Pachyderm",
"from",
"within",
"a",
"Kubernetes",
"cluster",
"with",
"Pachyderm",
"running",
"on",
"it",
"."
]
| [
"func",
"NewInCluster",
"(",
"options",
"...",
"Option",
")",
"(",
"*",
"APIClient",
",",
"error",
")",
"{",
"host",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"\"",
"\"",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"port",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"\"",
"\"",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"// create new pachctl client",
"return",
"NewFromAddress",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"<mask>",
",",
"port",
")",
",",
"options",
"...",
")",
"\n",
"}"
]
|
17,217 | all-17218 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"a",
"specified",
"program",
"object"
]
| [
"func",
"ProgramUniform3i",
"(",
"program",
"uint32",
",",
"<mask>",
"int32",
",",
"v0",
"int32",
",",
"v1",
"int32",
",",
"v2",
"int32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpProgramUniform3i",
",",
"5",
",",
"uintptr",
"(",
"program",
")",
",",
"uintptr",
"(",
"location",
")",
",",
"uintptr",
"(",
"v0",
")",
",",
"uintptr",
"(",
"v1",
")",
",",
"uintptr",
"(",
"v2",
")",
",",
"0",
")",
"\n",
"}"
]
|
17,218 | all-17219 | [
"WrapTransportListener",
"wraps",
"a",
"raw",
"transport",
".",
"Listener",
"in",
"an",
"iconn",
".",
"Listener",
".",
"If",
"sk",
"is",
"not",
"provided",
"transport",
"encryption",
"is",
"disabled",
".",
"The",
"Listener",
"will",
"accept",
"connections",
"in",
"the",
"background",
"and",
"attempt",
"to",
"negotiate",
"the",
"protocol",
"before",
"making",
"the",
"wrapped",
"connection",
"available",
"to",
"Accept",
".",
"If",
"the",
"negotiation",
"and",
"handshake",
"take",
"more",
"than",
"AcceptTimeout",
"the",
"connection",
"is",
"dropped",
".",
"However",
"note",
"that",
"once",
"a",
"connection",
"handshake",
"succeeds",
"it",
"will",
"wait",
"indefinitely",
"for",
"an",
"Accept",
"call",
"to",
"service",
"it",
"(",
"possibly",
"consuming",
"a",
"goroutine",
")",
".",
"The",
"context",
"covers",
"the",
"listener",
"and",
"its",
"background",
"activities",
"but",
"not",
"the",
"connections",
"once",
"returned",
"from",
"Accept",
".",
"Calling",
"Close",
"and",
"canceling",
"the",
"context",
"are",
"equivalent",
".",
"The",
"returned",
"Listener",
"implements",
"ListenerConnWrapper",
"."
]
| [
"func",
"WrapTransportListener",
"(",
"ctx",
"context",
".",
"Context",
",",
"ml",
"transport",
".",
"Listener",
",",
"local",
"peer",
".",
"ID",
",",
"sk",
"ic",
".",
"PrivKey",
")",
"(",
"iconn",
".",
"Listener",
",",
"error",
")",
"{",
"return",
"WrapTransportListenerWithProtector",
"(",
"ctx",
",",
"ml",
",",
"<mask>",
",",
"sk",
",",
"nil",
")",
"\n",
"}"
]
|
17,219 | all-17220 | [
"NewBackend",
"returns",
"eth",
"back",
"implementation",
"."
]
| [
"func",
"NewBackend",
"(",
"cfg",
"*",
"Config",
",",
"logger",
"log",
".",
"Logger",
")",
"Backend",
"{",
"conn",
",",
"ptc",
",",
"psc",
",",
"err",
":=",
"newInstance",
"(",
"cfg",
",",
"logger",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logger",
".",
"Fatal",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n\n",
"b",
":=",
"&",
"backendInstance",
"{",
"cfg",
":",
"cfg",
",",
"ptc",
":",
"ptc",
",",
"psc",
":",
"psc",
",",
"<mask>",
":",
"conn",
",",
"logger",
":",
"logger",
",",
"}",
"\n\n",
"go",
"b",
".",
"connectionControl",
"(",
")",
"\n\n",
"return",
"b",
"\n",
"}"
]
|
17,220 | all-17221 | [
"NewByteKeyItem",
"creates",
"a",
"new",
"item",
"from",
"bytes"
]
| [
"func",
"NewByteKeyItem",
"(",
"k",
"[",
"]",
"<mask>",
")",
"unsafe",
".",
"Pointer",
"{",
"itm",
":=",
"byteKeyItem",
"(",
"k",
")",
"\n",
"return",
"unsafe",
".",
"Pointer",
"(",
"&",
"itm",
")",
"\n",
"}"
]
|
17,221 | all-17222 | [
"CompactPrintFile",
"renders",
"f",
"as",
"a",
"compact",
"string",
"e",
".",
"g",
".",
"myrepo"
]
| [
"func",
"CompactPrintFile",
"(",
"f",
"*",
"pfs",
".",
"File",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"f",
".",
"Commit",
".",
"Repo",
".",
"Name",
",",
"f",
".",
"Commit",
".",
"ID",
",",
"f",
".",
"<mask>",
")",
"\n",
"}"
]
|
17,222 | all-17223 | [
"StoreLog",
"implements",
"the",
"LogStore",
"interface",
"."
]
| [
"func",
"(",
"i",
"*",
"InmemStore",
")",
"StoreLog",
"(",
"<mask>",
"*",
"Log",
")",
"error",
"{",
"return",
"i",
".",
"StoreLogs",
"(",
"[",
"]",
"*",
"Log",
"{",
"log",
"}",
")",
"\n",
"}"
]
|
17,223 | all-17224 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
]
| [
"func",
"(",
"v",
"*",
"SetGeolocationOverrideParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoEmulation7",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
]
|
17,224 | all-17225 | [
"secretFunc",
"returns",
"or",
"accumulates",
"secret",
"dependencies",
"from",
"Vault",
"."
]
| [
"func",
"secretFunc",
"(",
"b",
"*",
"Brain",
",",
"used",
",",
"missing",
"*",
"dep",
".",
"Set",
")",
"func",
"(",
"...",
"string",
")",
"(",
"*",
"dep",
".",
"Secret",
",",
"error",
")",
"{",
"return",
"func",
"(",
"s",
"...",
"string",
")",
"(",
"*",
"dep",
".",
"Secret",
",",
"error",
")",
"{",
"var",
"result",
"*",
"dep",
".",
"Secret",
"\n\n",
"if",
"len",
"(",
"s",
")",
"==",
"0",
"{",
"return",
"result",
",",
"nil",
"\n",
"}",
"\n\n",
"// TODO: Refactor into separate template functions",
"path",
",",
"rest",
":=",
"s",
"[",
"0",
"]",
",",
"s",
"[",
"1",
":",
"]",
"\n",
"data",
":=",
"<mask>",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"for",
"_",
",",
"str",
":=",
"range",
"rest",
"{",
"parts",
":=",
"strings",
".",
"SplitN",
"(",
"str",
",",
"\"",
"\"",
",",
"2",
")",
"\n",
"if",
"len",
"(",
"parts",
")",
"!=",
"2",
"{",
"return",
"result",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"str",
")",
"\n",
"}",
"\n\n",
"k",
",",
"v",
":=",
"strings",
".",
"TrimSpace",
"(",
"parts",
"[",
"0",
"]",
")",
",",
"strings",
".",
"TrimSpace",
"(",
"parts",
"[",
"1",
"]",
")",
"\n",
"data",
"[",
"k",
"]",
"=",
"v",
"\n",
"}",
"\n\n",
"var",
"d",
"dep",
".",
"Dependency",
"\n",
"var",
"err",
"error",
"\n\n",
"if",
"len",
"(",
"rest",
")",
"==",
"0",
"{",
"d",
",",
"err",
"=",
"dep",
".",
"NewVaultReadQuery",
"(",
"path",
")",
"\n",
"}",
"else",
"{",
"d",
",",
"err",
"=",
"dep",
".",
"NewVaultWriteQuery",
"(",
"path",
",",
"data",
")",
"\n",
"}",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"used",
".",
"Add",
"(",
"d",
")",
"\n\n",
"if",
"value",
",",
"ok",
":=",
"b",
".",
"Recall",
"(",
"d",
")",
";",
"ok",
"{",
"result",
"=",
"value",
".",
"(",
"*",
"dep",
".",
"Secret",
")",
"\n",
"return",
"result",
",",
"nil",
"\n",
"}",
"\n\n",
"missing",
".",
"Add",
"(",
"d",
")",
"\n\n",
"return",
"result",
",",
"nil",
"\n",
"}",
"\n",
"}"
]
|
17,225 | all-17226 | [
"Sequence",
"returns",
"a",
"filter",
"that",
"is",
"the",
"concatenation",
"of",
"all",
"filter",
"arguments",
".",
"The",
"output",
"of",
"a",
"filter",
"is",
"fed",
"as",
"input",
"to",
"the",
"next",
"filter",
"."
]
| [
"func",
"Sequence",
"(",
"filters",
"...",
"<mask>",
")",
"Filter",
"{",
"if",
"len",
"(",
"filters",
")",
"==",
"1",
"{",
"return",
"filters",
"[",
"0",
"]",
"\n",
"}",
"\n",
"return",
"FilterFunc",
"(",
"func",
"(",
"arg",
"Arg",
")",
"error",
"{",
"e",
":=",
"&",
"filterErrors",
"{",
"}",
"\n",
"in",
":=",
"arg",
".",
"In",
"\n",
"for",
"_",
",",
"f",
":=",
"range",
"filters",
"{",
"c",
":=",
"make",
"(",
"chan",
"string",
",",
"channelBuffer",
")",
"\n",
"go",
"runFilter",
"(",
"f",
",",
"Arg",
"{",
"In",
":",
"in",
",",
"Out",
":",
"c",
"}",
",",
"e",
")",
"\n",
"in",
"=",
"c",
"\n",
"}",
"\n",
"for",
"s",
":=",
"range",
"in",
"{",
"arg",
".",
"Out",
"<-",
"s",
"\n",
"}",
"\n",
"return",
"e",
".",
"getError",
"(",
")",
"\n",
"}",
")",
"\n",
"}"
]
|
17,226 | all-17227 | [
"toPB",
"converts",
"an",
"internal",
"progress",
"request",
"structure",
"to",
"its",
"protobuf",
"WatchRequest",
"structure",
"."
]
| [
"func",
"(",
"pr",
"*",
"progressRequest",
")",
"toPB",
"(",
")",
"*",
"pb",
".",
"WatchRequest",
"{",
"req",
":=",
"&",
"pb",
".",
"WatchProgressRequest",
"{",
"}",
"\n",
"cr",
":=",
"&",
"<mask>",
".",
"WatchRequest_ProgressRequest",
"{",
"ProgressRequest",
":",
"req",
"}",
"\n",
"return",
"&",
"pb",
".",
"WatchRequest",
"{",
"RequestUnion",
":",
"cr",
"}",
"\n",
"}"
]
|
17,227 | all-17228 | [
"NewBoshDirector",
"-"
]
| [
"func",
"NewBoshDirector",
"(",
"ip",
",",
"username",
",",
"password",
"string",
",",
"<mask>",
"int",
",",
"gateway",
"http",
".",
"HttpGateway",
")",
"*",
"BoshDirector",
"{",
"return",
"&",
"BoshDirector",
"{",
"ip",
":",
"ip",
",",
"port",
":",
"port",
",",
"username",
":",
"username",
",",
"password",
":",
"password",
",",
"gateway",
":",
"gateway",
",",
"}",
"\n",
"}"
]
|
17,228 | all-17229 | [
"IgnoreSliceElements",
"returns",
"an",
"Option",
"that",
"ignores",
"elements",
"of",
"[]",
"V",
".",
"The",
"discard",
"function",
"must",
"be",
"of",
"the",
"form",
"func",
"(",
"T",
")",
"bool",
"which",
"is",
"used",
"to",
"ignore",
"slice",
"elements",
"of",
"type",
"V",
"where",
"V",
"is",
"assignable",
"to",
"T",
".",
"Elements",
"are",
"ignored",
"if",
"the",
"function",
"reports",
"true",
"."
]
| [
"func",
"IgnoreSliceElements",
"(",
"discardFunc",
"interface",
"{",
"}",
")",
"cmp",
".",
"Option",
"{",
"vf",
":=",
"reflect",
".",
"ValueOf",
"(",
"discardFunc",
")",
"\n",
"if",
"!",
"function",
".",
"IsType",
"(",
"vf",
".",
"<mask>",
"(",
")",
",",
"function",
".",
"ValuePredicate",
")",
"||",
"vf",
".",
"IsNil",
"(",
")",
"{",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"discardFunc",
")",
")",
"\n",
"}",
"\n",
"return",
"cmp",
".",
"FilterPath",
"(",
"func",
"(",
"p",
"cmp",
".",
"Path",
")",
"bool",
"{",
"si",
",",
"ok",
":=",
"p",
".",
"Index",
"(",
"-",
"1",
")",
".",
"(",
"cmp",
".",
"SliceIndex",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"si",
".",
"Type",
"(",
")",
".",
"AssignableTo",
"(",
"vf",
".",
"Type",
"(",
")",
".",
"In",
"(",
"0",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"vx",
",",
"vy",
":=",
"si",
".",
"Values",
"(",
")",
"\n",
"if",
"vx",
".",
"IsValid",
"(",
")",
"&&",
"vf",
".",
"Call",
"(",
"[",
"]",
"reflect",
".",
"Value",
"{",
"vx",
"}",
")",
"[",
"0",
"]",
".",
"Bool",
"(",
")",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"vy",
".",
"IsValid",
"(",
")",
"&&",
"vf",
".",
"Call",
"(",
"[",
"]",
"reflect",
".",
"Value",
"{",
"vy",
"}",
")",
"[",
"0",
"]",
".",
"Bool",
"(",
")",
"{",
"return",
"true",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}",
",",
"cmp",
".",
"Ignore",
"(",
")",
")",
"\n",
"}"
]
|
17,229 | all-17230 | [
"NewReadBufferWithSize",
"returns",
"a",
"ReadBuffer",
"with",
"a",
"given",
"capacity"
]
| [
"func",
"NewReadBufferWithSize",
"(",
"<mask>",
"int",
")",
"*",
"ReadBuffer",
"{",
"return",
"&",
"ReadBuffer",
"{",
"buffer",
":",
"make",
"(",
"[",
"]",
"byte",
",",
"size",
")",
",",
"remaining",
":",
"nil",
"}",
"\n",
"}"
]
|
17,230 | all-17231 | [
"ServeConn",
"takes",
"ownership",
"of",
"the",
"conn",
"object",
"and",
"starts",
"service",
"the",
"commands",
"that",
"the",
"client",
"sends",
"to",
"the",
"discovery",
"handler",
"."
]
| [
"func",
"(",
"h",
"TCPHandler",
")",
"ServeConn",
"(",
"ctx",
"context",
".",
"Context",
",",
"conn",
"net",
".",
"Conn",
")",
"{",
"const",
"bufSize",
"=",
"2048",
"\n\n",
"var",
"r",
"=",
"bufio",
".",
"NewReaderSize",
"(",
"conn",
",",
"bufSize",
")",
"\n",
"var",
"w",
"=",
"bufio",
".",
"NewWriterSize",
"(",
"conn",
",",
"bufSize",
")",
"\n\n",
"if",
"h",
".",
"ReadTimeout",
"==",
"0",
"{",
"h",
".",
"ReadTimeout",
"=",
"DefaultReadTimeout",
"\n",
"}",
"\n\n",
"if",
"h",
".",
"WriteTimeout",
"==",
"0",
"{",
"h",
".",
"WriteTimeout",
"=",
"DefaultWriteTimeout",
"\n",
"}",
"\n\n",
"if",
"h",
".",
"EngineTimeout",
"==",
"0",
"{",
"h",
".",
"EngineTimeout",
"=",
"DefaultEngineTimeout",
"\n",
"}",
"\n\n",
"if",
"ctx",
"==",
"nil",
"{",
"ctx",
"=",
"context",
".",
"Background",
"(",
")",
"\n",
"}",
"\n\n",
"host",
",",
"port",
",",
"_",
":=",
"net",
".",
"SplitHostPort",
"(",
"conn",
".",
"LocalAddr",
"(",
")",
".",
"String",
"(",
")",
")",
"\n\n",
"if",
"h",
".",
"Info",
".",
"TcpPort",
"==",
"0",
"{",
"h",
".",
"Info",
".",
"TcpPort",
",",
"_",
"=",
"strconv",
".",
"Atoi",
"(",
"port",
")",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"h",
".",
"Info",
".",
"BroadcastAddress",
")",
"==",
"0",
"{",
"h",
".",
"Info",
".",
"BroadcastAddress",
"=",
"host",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"h",
".",
"Info",
".",
"Hostname",
")",
"==",
"0",
"{",
"h",
".",
"Info",
".",
"Hostname",
",",
"_",
"=",
"os",
".",
"Hostname",
"(",
")",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"h",
".",
"Info",
".",
"Version",
")",
"==",
"0",
"{",
"info",
",",
"_",
":=",
"h",
".",
"Engine",
".",
"LookupInfo",
"(",
"ctx",
")",
"\n",
"h",
".",
"Info",
".",
"Version",
"=",
"info",
".",
"Version",
"\n",
"}",
"\n\n",
"var",
"node",
"Node",
"\n",
"var",
"cmdChan",
"=",
"make",
"(",
"chan",
"Command",
")",
"\n",
"var",
"resChan",
"=",
"make",
"(",
"chan",
"Response",
")",
"\n",
"var",
"errChan",
"=",
"make",
"(",
"chan",
"error",
",",
"2",
")",
"\n",
"var",
"doneChan",
"=",
"ctx",
".",
"Done",
"(",
")",
"\n\n",
"defer",
"func",
"(",
")",
"{",
"if",
"node",
"!=",
"nil",
"{",
"err",
":=",
"node",
".",
"Unregister",
"(",
"ctx",
")",
"\n",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"node",
",",
"err",
")",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n",
"defer",
"close",
"(",
"resChan",
")",
"\n\n",
"go",
"h",
".",
"readLoop",
"(",
"ctx",
",",
"<mask>",
",",
"r",
",",
"cmdChan",
",",
"errChan",
")",
"\n",
"go",
"h",
".",
"writeLoop",
"(",
"ctx",
",",
"conn",
",",
"w",
",",
"resChan",
",",
"errChan",
")",
"\n\n",
"for",
"{",
"var",
"cmd",
"Command",
"\n",
"var",
"res",
"Response",
"\n",
"var",
"err",
"error",
"\n\n",
"select",
"{",
"case",
"<-",
"doneChan",
":",
"return",
"\n",
"case",
"<-",
"errChan",
":",
"return",
"\n",
"case",
"cmd",
"=",
"<-",
"cmdChan",
":",
"}",
"\n\n",
"switch",
"c",
":=",
"cmd",
".",
"(",
"type",
")",
"{",
"case",
"Ping",
":",
"res",
",",
"err",
"=",
"h",
".",
"ping",
"(",
"ctx",
",",
"node",
")",
"\n\n",
"case",
"Identify",
":",
"node",
",",
"res",
",",
"err",
"=",
"h",
".",
"identify",
"(",
"ctx",
",",
"node",
",",
"c",
".",
"Info",
",",
"conn",
")",
"\n\n",
"case",
"Register",
":",
"res",
",",
"err",
"=",
"h",
".",
"register",
"(",
"ctx",
",",
"node",
",",
"c",
".",
"Topic",
",",
"c",
".",
"Channel",
")",
"\n\n",
"case",
"Unregister",
":",
"node",
",",
"res",
",",
"err",
"=",
"h",
".",
"unregister",
"(",
"ctx",
",",
"node",
",",
"c",
".",
"Topic",
",",
"c",
".",
"Channel",
")",
"\n\n",
"default",
":",
"res",
"=",
"makeErrInvalid",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"switch",
"e",
":=",
"err",
".",
"(",
"type",
")",
"{",
"case",
"Error",
":",
"res",
"=",
"e",
"\n",
"default",
":",
"log",
".",
"Print",
"(",
"err",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n\n",
"select",
"{",
"case",
"<-",
"doneChan",
":",
"return",
"\n",
"case",
"<-",
"errChan",
":",
"return",
"\n",
"case",
"resChan",
"<-",
"res",
":",
"}",
"\n",
"}",
"\n",
"}"
]
|
17,231 | all-17232 | [
"HasDescription",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"d",
"*",
"Dashboard",
")",
"HasDescription",
"(",
")",
"bool",
"{",
"if",
"d",
"!=",
"nil",
"&&",
"d",
".",
"<mask>",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
]
|
17,232 | all-17233 | [
"GetTaskByArn",
"returns",
"the",
"task",
"identified",
"by",
"that",
"ARN"
]
| [
"func",
"(",
"engine",
"*",
"DockerTaskEngine",
")",
"GetTaskByArn",
"(",
"arn",
"string",
")",
"(",
"*",
"apitask",
".",
"Task",
",",
"bool",
")",
"{",
"return",
"<mask>",
".",
"state",
".",
"TaskByArn",
"(",
"arn",
")",
"\n",
"}"
]
|
17,233 | all-17234 | [
"SetHAlign",
"is",
"a",
"wrapper",
"around",
"gtk_widget_set_halign",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"Widget",
")",
"SetHAlign",
"(",
"<mask>",
"Align",
")",
"{",
"C",
".",
"gtk_widget_set_halign",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkAlign",
"(",
"align",
")",
")",
"\n",
"}"
]
|
17,234 | all-17235 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
]
| [
"func",
"(",
"v",
"GetCurrentTimeReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoAnimation11",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
]
|
17,235 | all-17236 | [
"ReadHTTP",
"fetches",
"file",
"contents",
"from",
"a",
"URL",
"with",
"retries",
"."
]
| [
"func",
"ReadHTTP",
"(",
"url",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"retryDelay",
":=",
"time",
".",
"Duration",
"(",
"2",
")",
"*",
"time",
".",
"Second",
"\n",
"for",
"retryCount",
":=",
"0",
";",
"retryCount",
"<",
"5",
";",
"retryCount",
"++",
"{",
"if",
"retryCount",
">",
"0",
"{",
"time",
".",
"Sleep",
"(",
"retryDelay",
")",
"\n",
"retryDelay",
"*=",
"time",
".",
"Duration",
"(",
"2",
")",
"\n",
"}",
"\n\n",
"resp",
",",
"err",
":=",
"http",
".",
"Get",
"(",
"<mask>",
")",
"\n",
"if",
"resp",
"!=",
"nil",
"&&",
"resp",
".",
"StatusCode",
">=",
"500",
"{",
"// Retry on this type of error.",
"continue",
"\n",
"}",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n\n",
"body",
",",
"err",
":=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"continue",
"\n",
"}",
"\n",
"return",
"body",
",",
"nil",
"\n",
"}",
"\n",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"url",
",",
"err",
")",
"\n",
"}"
]
|
17,236 | all-17237 | [
"Creates",
"a",
"new",
"minioClient",
"structure",
"and",
"returns"
]
| [
"func",
"newMinioClient",
"(",
"endpoint",
",",
"bucket",
",",
"id",
",",
"<mask>",
"string",
",",
"secure",
"bool",
")",
"(",
"*",
"minioClient",
",",
"error",
")",
"{",
"mclient",
",",
"err",
":=",
"minio",
".",
"New",
"(",
"endpoint",
",",
"id",
",",
"secret",
",",
"secure",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"&",
"minioClient",
"{",
"bucket",
":",
"bucket",
",",
"Client",
":",
"mclient",
",",
"}",
",",
"nil",
"\n",
"}"
]
|
17,237 | all-17238 | [
"NewTableBuilder",
"makes",
"a",
"new",
"TableBuilder",
"."
]
| [
"func",
"NewTableBuilder",
"(",
")",
"*",
"<mask>",
"{",
"return",
"&",
"Builder",
"{",
"keyBuf",
":",
"newBuffer",
"(",
"1",
"<<",
"20",
")",
",",
"buf",
":",
"newBuffer",
"(",
"1",
"<<",
"20",
")",
",",
"prevOffset",
":",
"math",
".",
"MaxUint32",
",",
"// Used for the first element!",
"}",
"\n",
"}"
]
|
17,238 | all-17239 | [
"Listen",
"is",
"a",
"readline",
"Listener",
"that",
"updates",
"internal",
"cursor",
"state",
"appropriately",
"."
]
| [
"func",
"(",
"c",
"*",
"Cursor",
")",
"Listen",
"(",
"line",
"[",
"]",
"rune",
",",
"pos",
"int",
",",
"key",
"rune",
")",
"(",
"[",
"]",
"rune",
",",
"int",
",",
"bool",
")",
"{",
"if",
"line",
"!=",
"nil",
"{",
"// no matter what, update our internal representation.",
"c",
".",
"Update",
"(",
"string",
"(",
"line",
")",
")",
"\n",
"}",
"\n\n",
"switch",
"key",
"{",
"case",
"0",
":",
"// empty",
"case",
"KeyEnter",
":",
"return",
"[",
"]",
"rune",
"(",
"c",
".",
"Get",
"(",
")",
")",
",",
"c",
".",
"Position",
",",
"false",
"\n",
"case",
"KeyBackspace",
":",
"if",
"c",
".",
"erase",
"{",
"c",
".",
"erase",
"=",
"false",
"\n",
"c",
".",
"Replace",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"c",
".",
"Backspace",
"(",
")",
"\n",
"case",
"KeyForward",
":",
"// the user wants to edit the default, despite how we set it up. Let",
"// them.",
"c",
".",
"erase",
"=",
"false",
"\n",
"c",
".",
"Move",
"(",
"1",
")",
"\n",
"<mask>",
"KeyBackward",
":",
"c",
".",
"Move",
"(",
"-",
"1",
")",
"\n",
"default",
":",
"if",
"c",
".",
"erase",
"{",
"c",
".",
"erase",
"=",
"false",
"\n",
"c",
".",
"Replace",
"(",
"\"",
"\"",
")",
"\n",
"c",
".",
"Update",
"(",
"string",
"(",
"key",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"[",
"]",
"rune",
"(",
"c",
".",
"Get",
"(",
")",
")",
",",
"c",
".",
"Position",
",",
"true",
"\n",
"}"
]
|
17,239 | all-17240 | [
"SetRange",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_range_set_range",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"Range",
")",
"SetRange",
"(",
"min",
",",
"<mask>",
"float64",
")",
"{",
"C",
".",
"gtk_range_set_range",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gdouble",
"(",
"min",
")",
",",
"C",
".",
"gdouble",
"(",
"max",
")",
")",
"\n",
"}"
]
|
17,240 | all-17241 | [
"GetHeaderKeys",
"returns",
"a",
"list",
"of",
"header",
"keys",
"seen",
"in",
"this",
"message",
".",
"Get",
"individual",
"headers",
"with",
"GetHeader",
"(",
"name",
")"
]
| [
"func",
"(",
"e",
"*",
"Envelope",
")",
"GetHeaderKeys",
"(",
")",
"(",
"<mask>",
"[",
"]",
"string",
")",
"{",
"if",
"e",
".",
"header",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"for",
"key",
":=",
"range",
"*",
"e",
".",
"header",
"{",
"headers",
"=",
"append",
"(",
"headers",
",",
"key",
")",
"\n",
"}",
"\n",
"return",
"headers",
"\n",
"}"
]
|
17,241 | all-17242 | [
"LookupInUser",
"looks",
"up",
"an",
"user",
"by",
"the",
"given",
"values",
".",
"The",
"count",
"determines",
"the",
"number",
"of",
"fields",
"to",
"return",
":",
"n",
">",
"0",
":",
"at",
"most",
"n",
"fields",
"n",
"==",
"0",
":",
"the",
"result",
"is",
"nil",
"(",
"zero",
"fields",
")",
"n",
"<",
"0",
":",
"all",
"fields"
]
| [
"func",
"LookupInUser",
"(",
"field",
"userField",
",",
"value",
"interface",
"{",
"}",
",",
"n",
"int",
")",
"(",
"[",
"]",
"*",
"User",
",",
"error",
")",
"{",
"iEntries",
",",
"err",
":=",
"lookUp",
"(",
"&",
"User",
"{",
"}",
",",
"<mask>",
",",
"value",
",",
"n",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// == Convert to type user",
"valueSlice",
":=",
"reflect",
".",
"ValueOf",
"(",
"iEntries",
")",
"\n",
"entries",
":=",
"make",
"(",
"[",
"]",
"*",
"User",
",",
"valueSlice",
".",
"Len",
"(",
")",
")",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"valueSlice",
".",
"Len",
"(",
")",
";",
"i",
"++",
"{",
"entries",
"[",
"i",
"]",
"=",
"valueSlice",
".",
"Index",
"(",
"i",
")",
".",
"Interface",
"(",
")",
".",
"(",
"*",
"User",
")",
"\n",
"}",
"\n\n",
"return",
"entries",
",",
"err",
"\n",
"}"
]
|
17,242 | all-17243 | [
"RectWH",
"returns",
"a",
"rectangle",
"whose",
"origin",
"is",
"Vec2",
"{",
"x",
"y",
"}",
"w",
"and",
"h",
"are",
"its",
"width",
"and",
"height",
"."
]
| [
"func",
"RectWH",
"(",
"x",
",",
"y",
",",
"w",
",",
"h",
"float32",
")",
"Rectangle",
"{",
"<mask>",
"Rectangle",
"{",
"Min",
":",
"Vec2",
"{",
"x",
",",
"y",
"}",
",",
"Max",
":",
"Vec2",
"{",
"x",
"+",
"w",
",",
"y",
"+",
"h",
"}",
",",
"}",
"\n",
"}"
]
|
17,243 | all-17244 | [
"fetchCert",
"fetches",
"CA",
"certificate",
"using",
"Circonus",
"API"
]
| [
"func",
"(",
"cm",
"*",
"CheckManager",
")",
"fetchCert",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"!",
"cm",
".",
"<mask>",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"response",
",",
"err",
":=",
"cm",
".",
"apih",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"cadata",
":=",
"new",
"(",
"CACert",
")",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"response",
",",
"cadata",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"cadata",
".",
"Contents",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"cadata",
")",
"\n",
"}",
"\n\n",
"return",
"[",
"]",
"byte",
"(",
"cadata",
".",
"Contents",
")",
",",
"nil",
"\n",
"}"
]
|
17,244 | all-17245 | [
"WithTimeout",
"adds",
"the",
"timeout",
"to",
"the",
"patch",
"apps",
"app",
"routes",
"route",
"params"
]
| [
"func",
"(",
"o",
"*",
"PatchAppsAppRoutesRouteParams",
")",
"WithTimeout",
"(",
"timeout",
"<mask>",
".",
"Duration",
")",
"*",
"PatchAppsAppRoutesRouteParams",
"{",
"o",
".",
"SetTimeout",
"(",
"timeout",
")",
"\n",
"return",
"o",
"\n",
"}"
]
|
17,245 | all-17246 | [
"ErrorAndExit",
"errors",
"with",
"the",
"given",
"format",
"and",
"args",
"and",
"then",
"exits",
"."
]
| [
"func",
"ErrorAndExit",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"if",
"errString",
":=",
"strings",
".",
"TrimSpace",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"args",
"...",
")",
")",
";",
"errString",
"!=",
"\"",
"\"",
"{",
"fmt",
".",
"Fprintf",
"(",
"os",
".",
"Stderr",
",",
"\"",
"\\n",
"\"",
",",
"errString",
")",
"\n",
"}",
"\n",
"<mask>",
".",
"Exit",
"(",
"1",
")",
"\n",
"}"
]
|
17,246 | all-17247 | [
"null",
"values",
":",
"most",
"sig",
"bit",
"unset",
"year",
":",
"unset",
"second",
"most",
"sig",
"bit",
"(",
"subtract",
"2^15",
")",
"--",
">",
"read",
"year",
"as",
"unsigned",
"month",
"is",
"0",
"-",
"based",
"day",
"is",
"1",
"byte"
]
| [
"func",
"readDate",
"(",
"rd",
"*",
"bufio",
".",
"Reader",
")",
"(",
"int",
",",
"<mask>",
".",
"Month",
",",
"int",
",",
"bool",
")",
"{",
"year",
":=",
"rd",
".",
"ReadUint16",
"(",
")",
"\n",
"null",
":=",
"(",
"(",
"year",
"&",
"0x8000",
")",
"==",
"0",
")",
"//null value",
"\n",
"year",
"&=",
"0x3fff",
"\n",
"month",
":=",
"rd",
".",
"ReadInt8",
"(",
")",
"\n",
"month",
"++",
"\n",
"day",
":=",
"rd",
".",
"ReadInt8",
"(",
")",
"\n",
"return",
"int",
"(",
"year",
")",
",",
"time",
".",
"Month",
"(",
"month",
")",
",",
"int",
"(",
"day",
")",
",",
"null",
"\n",
"}"
]
|
17,247 | all-17248 | [
"HandlerUnblock",
"is",
"a",
"wrapper",
"around",
"g_signal_handler_unblock",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"Object",
")",
"HandlerUnblock",
"(",
"handle",
"SignalHandle",
")",
"{",
"C",
".",
"g_signal_handler_unblock",
"(",
"C",
".",
"gpointer",
"(",
"v",
".",
"GObject",
")",
",",
"C",
".",
"gulong",
"(",
"<mask>",
")",
")",
"\n",
"}"
]
|
17,248 | all-17249 | [
"PushSMS",
"sends",
"an",
"SMS",
"to",
"the",
"specific",
"user",
"from",
"the",
"device",
"with",
"the",
"given",
"title",
"and",
"url"
]
| [
"func",
"(",
"d",
"*",
"Device",
")",
"PushSMS",
"(",
"deviceIden",
",",
"phoneNumber",
",",
"<mask>",
"string",
")",
"error",
"{",
"return",
"d",
".",
"Client",
".",
"PushSMS",
"(",
"d",
".",
"Iden",
",",
"deviceIden",
",",
"phoneNumber",
",",
"message",
")",
"\n",
"}"
]
|
17,249 | all-17250 | [
"Valid",
"returns",
"whether",
"a",
"GeoPoint",
"is",
"within",
"[",
"-",
"90",
"90",
"]",
"latitude",
"and",
"[",
"-",
"180",
"180",
"]",
"longitude",
"."
]
| [
"func",
"(",
"g",
"GeoPoint",
")",
"Valid",
"(",
")",
"bool",
"{",
"<mask>",
"-",
"90",
"<=",
"g",
".",
"Lat",
"&&",
"g",
".",
"Lat",
"<=",
"90",
"&&",
"-",
"180",
"<=",
"g",
".",
"Lng",
"&&",
"g",
".",
"Lng",
"<=",
"180",
"\n",
"}"
]
|
17,250 | all-17251 | [
"Returns",
"the",
"handles",
"of",
"the",
"shader",
"objects",
"attached",
"to",
"a",
"program",
"object"
]
| [
"func",
"GetAttachedShaders",
"(",
"program",
"uint32",
",",
"maxCount",
"int32",
",",
"count",
"*",
"int32",
",",
"shaders",
"*",
"uint32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpGetAttachedShaders",
",",
"4",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"maxCount",
")",
",",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"count",
")",
")",
",",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"shaders",
")",
")",
",",
"0",
",",
"0",
")",
"\n",
"}"
]
|
17,251 | all-17252 | [
"Expire",
"returns",
"cookie",
"expiration",
"time",
".",
"CookieExpireUnlimited",
"is",
"returned",
"if",
"cookie",
"doesn",
"t",
"expire"
]
| [
"func",
"(",
"c",
"*",
"Cookie",
")",
"Expire",
"(",
")",
"<mask>",
".",
"Time",
"{",
"expire",
":=",
"c",
".",
"expire",
"\n",
"if",
"expire",
".",
"IsZero",
"(",
")",
"{",
"expire",
"=",
"CookieExpireUnlimited",
"\n",
"}",
"\n",
"return",
"expire",
"\n",
"}"
]
|
17,252 | all-17253 | [
"Abort",
"cancels",
"an",
"in",
"-",
"progress",
"write",
"preventing",
"the",
"file",
"from",
"being",
"automically",
"created",
"and",
"ensuring",
"previously",
"written",
"chunks",
"are",
"removed",
"when",
"the",
"file",
"is",
"closed",
".",
"It",
"is",
"a",
"runtime",
"error",
"to",
"call",
"Abort",
"when",
"the",
"file",
"was",
"not",
"opened",
"for",
"writing",
"."
]
| [
"func",
"(",
"file",
"*",
"GridFile",
")",
"Abort",
"(",
")",
"{",
"if",
"file",
".",
"mode",
"!=",
"gfsWriting",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"file",
".",
"err",
"=",
"<mask>",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}"
]
|
17,253 | all-17254 | [
"Start",
"a",
"goroutine",
"and",
"properly",
"handle",
"the",
"race",
"between",
"a",
"routine",
"starting",
"and",
"incrementing",
"and",
"exiting",
"and",
"decrementing",
"."
]
| [
"func",
"(",
"r",
"*",
"raftState",
")",
"goFunc",
"(",
"f",
"func",
"(",
")",
")",
"{",
"r",
".",
"routinesGroup",
".",
"Add",
"(",
"1",
")",
"\n",
"<mask>",
"func",
"(",
")",
"{",
"defer",
"r",
".",
"routinesGroup",
".",
"Done",
"(",
")",
"\n",
"f",
"(",
")",
"\n",
"}",
"(",
")",
"\n",
"}"
]
|
17,254 | all-17255 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
]
| [
"func",
"(",
"v",
"*",
"ResolveNodeReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom10",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
]
|
17,255 | all-17256 | [
"addEvent",
"function",
"adds",
"event",
"into",
"the",
"eventHistory"
]
| [
"func",
"(",
"eh",
"*",
"EventHistory",
")",
"addEvent",
"(",
"e",
"*",
"Event",
")",
"*",
"<mask>",
"{",
"eh",
".",
"rwl",
".",
"Lock",
"(",
")",
"\n",
"defer",
"eh",
".",
"rwl",
".",
"Unlock",
"(",
")",
"\n\n",
"eh",
".",
"Queue",
".",
"insert",
"(",
"e",
")",
"\n\n",
"eh",
".",
"LastIndex",
"=",
"e",
".",
"Index",
"(",
")",
"\n\n",
"eh",
".",
"StartIndex",
"=",
"eh",
".",
"Queue",
".",
"Events",
"[",
"eh",
".",
"Queue",
".",
"Front",
"]",
".",
"Index",
"(",
")",
"\n\n",
"return",
"e",
"\n",
"}"
]
|
17,256 | all-17257 | [
"Clone",
"returns",
"a",
"clone",
"of",
"the",
"Client",
".",
"The",
"cloned",
"Client",
"inherits",
"its",
"configuration",
"from",
"its",
"parent",
".",
"All",
"cloned",
"Clients",
"share",
"the",
"same",
"connection",
"so",
"cloning",
"a",
"Client",
"is",
"a",
"cheap",
"operation",
"."
]
| [
"func",
"(",
"c",
"*",
"Client",
")",
"Clone",
"(",
"opts",
"...",
"Option",
")",
"*",
"Client",
"{",
"tf",
":=",
"c",
".",
"conn",
".",
"tagFormat",
"\n",
"conf",
":=",
"&",
"config",
"{",
"Client",
":",
"clientConfig",
"{",
"Rate",
":",
"c",
".",
"rate",
",",
"Prefix",
":",
"c",
".",
"prefix",
",",
"Tags",
":",
"splitTags",
"(",
"tf",
",",
"c",
".",
"tags",
")",
",",
"}",
",",
"}",
"\n",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"o",
"(",
"conf",
")",
"\n",
"}",
"\n\n",
"clone",
":=",
"&",
"<mask>",
"{",
"conn",
":",
"c",
".",
"conn",
",",
"muted",
":",
"c",
".",
"muted",
"||",
"conf",
".",
"Client",
".",
"Muted",
",",
"rate",
":",
"conf",
".",
"Client",
".",
"Rate",
",",
"prefix",
":",
"conf",
".",
"Client",
".",
"Prefix",
",",
"tags",
":",
"joinTags",
"(",
"tf",
",",
"conf",
".",
"Client",
".",
"Tags",
")",
",",
"}",
"\n",
"clone",
".",
"conn",
"=",
"c",
".",
"conn",
"\n",
"return",
"clone",
"\n",
"}"
]
|
17,257 | all-17258 | [
"FileFilterNew",
"is",
"a",
"wrapper",
"around",
"gtk_file_filter_new",
"()",
"."
]
| [
"func",
"FileFilterNew",
"(",
")",
"(",
"*",
"FileFilter",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gtk_file_filter_new",
"(",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"obj",
":=",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"\n",
"return",
"wrapFileFilter",
"(",
"obj",
")",
",",
"nil",
"\n",
"}"
]
|
17,258 | all-17259 | [
"replaceParent",
"replaces",
"x",
"s",
"parent",
"with",
"y"
]
| [
"func",
"(",
"ivt",
"*",
"IntervalTree",
")",
"replaceParent",
"(",
"x",
"*",
"intervalNode",
",",
"y",
"*",
"intervalNode",
")",
"{",
"y",
".",
"parent",
"=",
"x",
".",
"parent",
"\n",
"if",
"x",
".",
"<mask>",
"==",
"nil",
"{",
"ivt",
".",
"root",
"=",
"y",
"\n",
"}",
"else",
"{",
"if",
"x",
"==",
"x",
".",
"parent",
".",
"left",
"{",
"x",
".",
"parent",
".",
"left",
"=",
"y",
"\n",
"}",
"else",
"{",
"x",
".",
"parent",
".",
"right",
"=",
"y",
"\n",
"}",
"\n",
"x",
".",
"parent",
".",
"updateMax",
"(",
")",
"\n",
"}",
"\n",
"x",
".",
"parent",
"=",
"y",
"\n",
"}"
]
|
17,259 | all-17260 | [
"GetFillMax",
"returns",
"the",
"FillMax",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
]
| [
"func",
"(",
"t",
"*",
"TileDefStyle",
")",
"GetFillMax",
"(",
")",
"json",
".",
"Number",
"{",
"if",
"t",
"==",
"nil",
"||",
"t",
".",
"FillMax",
"==",
"nil",
"{",
"<mask>",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"t",
".",
"FillMax",
"\n",
"}"
]
|
17,260 | all-17261 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
]
| [
"func",
"(",
"v",
"*",
"GetHistogramsReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser11",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
]
|
17,261 | all-17262 | [
"Signal",
"sends",
"a",
"signal",
"to",
"the",
"Process",
"."
]
| [
"func",
"(",
"p",
"<mask>",
")",
"Signal",
"(",
"sig",
"os",
".",
"Signal",
")",
"error",
"{",
"if",
"p",
".",
"ops",
"==",
"nil",
"{",
"return",
"newGenericError",
"(",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
",",
"ProcessNotExecuted",
")",
"\n",
"}",
"\n",
"return",
"p",
".",
"ops",
".",
"signal",
"(",
"sig",
")",
"\n",
"}"
]
|
17,262 | all-17263 | [
"IconThemeGetDefault",
"is",
"a",
"wrapper",
"around",
"gtk_icon_theme_get_default",
"()",
"."
]
| [
"func",
"IconThemeGetDefault",
"(",
")",
"(",
"*",
"IconTheme",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gtk_icon_theme_get_default",
"(",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"return",
"&",
"IconTheme",
"{",
"c",
"}",
",",
"nil",
"\n",
"}"
]
|
17,263 | all-17264 | [
"WriteTo",
"writes",
"request",
"header",
"to",
"w",
".",
"WriteTo",
"implements",
"io",
".",
"WriterTo",
"interface",
"."
]
| [
"func",
"(",
"h",
"*",
"RequestHeader",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"n",
",",
"err",
":=",
"w",
".",
"Write",
"(",
"h",
".",
"<mask>",
"(",
")",
")",
"\n",
"return",
"int64",
"(",
"n",
")",
",",
"err",
"\n",
"}"
]
|
17,264 | all-17265 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
]
| [
"func",
"(",
"v",
"*",
"ValueSource",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
]
|
17,265 | all-17266 | [
"Error",
"records",
"the",
"log",
"with",
"error",
"level"
]
| [
"func",
"(",
"l",
"*",
"Logger",
")",
"Error",
"(",
"args",
"...",
"<mask>",
"{",
"}",
")",
"{",
"l",
".",
"Output",
"(",
"2",
",",
"LevelError",
",",
"fmt",
".",
"Sprint",
"(",
"args",
"...",
")",
")",
"\n",
"}"
]
|
17,266 | all-17267 | [
"EditTeam",
"patches",
"team",
".",
"ID",
"to",
"contain",
"the",
"specified",
"other",
"values",
".",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"teams",
"/",
"#edit",
"-",
"team"
]
| [
"func",
"(",
"c",
"*",
"Client",
")",
"EditTeam",
"(",
"t",
"Team",
")",
"(",
"*",
"Team",
",",
"error",
")",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"t",
")",
"\n",
"if",
"t",
".",
"ID",
"==",
"0",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"c",
".",
"dry",
"{",
"return",
"&",
"t",
",",
"nil",
"\n",
"}",
"\n",
"id",
":=",
"t",
".",
"ID",
"\n",
"t",
".",
"ID",
"=",
"0",
"\n",
"// Need to send parent_team_id: null",
"team",
":=",
"struct",
"{",
"Team",
"\n",
"ParentTeamID",
"*",
"int",
"`json:\"parent_team_id\"`",
"\n",
"}",
"{",
"Team",
":",
"t",
",",
"ParentTeamID",
":",
"t",
".",
"ParentTeamID",
",",
"}",
"\n",
"var",
"retTeam",
"Team",
"\n",
"path",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"id",
")",
"\n",
"_",
",",
"err",
":=",
"c",
".",
"request",
"(",
"&",
"request",
"{",
"method",
":",
"http",
".",
"MethodPatch",
",",
"path",
":",
"<mask>",
",",
"// This accept header enables the nested teams preview.",
"// https://developer.github.com/changes/2017-08-30-preview-nested-teams/",
"accept",
":",
"\"",
"\"",
",",
"requestBody",
":",
"&",
"team",
",",
"exitCodes",
":",
"[",
"]",
"int",
"{",
"200",
",",
"201",
"}",
",",
"}",
",",
"&",
"retTeam",
")",
"\n",
"return",
"&",
"retTeam",
",",
"err",
"\n",
"}"
]
|
17,267 | all-17268 | [
"SetNodeInterface",
"selects",
"the",
"hardware",
"address",
"to",
"be",
"used",
"for",
"Version",
"1",
"UUIDs",
".",
"If",
"name",
"is",
"then",
"the",
"first",
"usable",
"interface",
"found",
"will",
"be",
"used",
"or",
"a",
"random",
"Node",
"ID",
"will",
"be",
"generated",
".",
"If",
"a",
"named",
"interface",
"cannot",
"be",
"found",
"then",
"false",
"is",
"returned",
".",
"SetNodeInterface",
"never",
"fails",
"when",
"name",
"is",
"."
]
| [
"func",
"SetNodeInterface",
"(",
"name",
"string",
")",
"bool",
"{",
"defer",
"nodeMu",
".",
"Unlock",
"(",
")",
"\n",
"nodeMu",
".",
"Lock",
"(",
")",
"\n",
"return",
"setNodeInterface",
"(",
"<mask>",
")",
"\n",
"}"
]
|
17,268 | all-17269 | [
"preprocessTags",
"adds",
"some",
"tags",
"which",
"are",
"on",
"by",
"default",
"before",
"they",
"are",
"used",
"to",
"match",
"files",
"."
]
| [
"func",
"(",
"gc",
"*",
"goConfig",
")",
"preprocessTags",
"(",
")",
"{",
"if",
"gc",
".",
"genericTags",
"==",
"nil",
"{",
"gc",
".",
"genericTags",
"=",
"make",
"(",
"<mask>",
"[",
"string",
"]",
"bool",
")",
"\n",
"}",
"\n",
"gc",
".",
"genericTags",
"[",
"\"",
"\"",
"]",
"=",
"true",
"\n",
"}"
]
|
17,269 | all-17270 | [
"Validate",
"that",
"options",
"are",
"usuable"
]
| [
"func",
"(",
"opts",
"*",
"Options",
")",
"Validate",
"(",
")",
"error",
"{",
"if",
"len",
"(",
"opts",
".",
"Name",
")",
"==",
"0",
"{",
"return",
"<mask>",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"opts",
".",
"Actions",
")",
"==",
"0",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"opts",
".",
"App",
".",
"IsZero",
"(",
")",
"{",
"opts",
".",
"App",
"=",
"meta",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"opts",
".",
"Method",
")",
"==",
"0",
"{",
"opts",
".",
"Method",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
]
|
17,270 | all-17271 | [
"Version",
"mocks",
"base",
"method"
]
| [
"func",
"(",
"m",
"*",
"MockDockerClient",
")",
"Version",
"(",
"arg0",
"context",
".",
"Context",
",",
"arg1",
"time",
".",
"Duration",
")",
"(",
"string",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
")",
"\n",
"ret0",
",",
"_",
":=",
"<mask>",
"[",
"0",
"]",
".",
"(",
"string",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
]
|
17,271 | all-17272 | [
"Equal",
"is",
"the",
"equality",
"test",
"for",
"2",
"networks",
"."
]
| [
"func",
"(",
"n",
"Network",
")",
"Equal",
"(",
"n1",
"Network",
")",
"bool",
"{",
"return",
"n",
".",
"<mask>",
"(",
")",
"==",
"n1",
".",
"String",
"(",
")",
"\n",
"}"
]
|
17,272 | all-17273 | [
"ActivateMetric",
"determines",
"if",
"a",
"given",
"metric",
"should",
"be",
"activated"
]
| [
"func",
"(",
"cm",
"*",
"CheckManager",
")",
"ActivateMetric",
"(",
"name",
"string",
")",
"bool",
"{",
"cm",
".",
"availableMetricsmu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"cm",
".",
"availableMetricsmu",
".",
"Unlock",
"(",
")",
"\n\n",
"active",
",",
"exists",
":=",
"cm",
".",
"availableMetrics",
"[",
"<mask>",
"]",
"\n\n",
"if",
"!",
"exists",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"if",
"!",
"active",
"&&",
"cm",
".",
"forceMetricActivation",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
]
|
17,273 | all-17274 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
]
| [
"func",
"(",
"v",
"*",
"GetEventListenersReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
]
|
17,274 | all-17275 | [
"Min",
"returns",
"the",
"smaller",
"of",
"a",
"and",
"b",
"."
]
| [
"func",
"(",
"a",
"<mask>",
")",
"Min",
"(",
"b",
"Address",
")",
"Address",
"{",
"if",
"a",
"<",
"b",
"{",
"return",
"a",
"\n",
"}",
"\n",
"return",
"b",
"\n",
"}"
]
|
17,275 | all-17276 | [
"Extract",
"returns",
"positional",
"and",
"named",
"variables",
"extracted",
"from",
"the",
"URL",
"path",
"."
]
| [
"func",
"(",
"m",
"*",
"RegexpPath",
")",
"Extract",
"(",
"<mask>",
"*",
"Result",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"result",
".",
"Values",
"=",
"mergeValues",
"(",
"result",
".",
"Values",
",",
"m",
".",
"Values",
"(",
"r",
".",
"URL",
".",
"Path",
")",
")",
"\n",
"}"
]
|
17,276 | all-17277 | [
"Clear",
"draws",
"a",
"white",
"rectangle",
"over",
"the",
"whole",
"page"
]
| [
"func",
"(",
"gc",
"*",
"GraphicContext",
")",
"Clear",
"(",
")",
"{",
"<mask>",
",",
"height",
":=",
"gc",
".",
"pdf",
".",
"GetPageSize",
"(",
")",
"\n",
"clearRect",
"(",
"gc",
",",
"0",
",",
"0",
",",
"width",
",",
"height",
")",
"\n",
"}"
]
|
17,277 | all-17278 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
]
| [
"func",
"(",
"v",
"ContinueWithAuthParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoFetch12",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
]
|
17,278 | all-17279 | [
"ToString",
"is",
"a",
"wrapper",
"around",
"gtk_css_provider_to_string",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"CssProvider",
")",
"ToString",
"(",
")",
"(",
"<mask>",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_css_provider_to_string",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"return",
"C",
".",
"GoString",
"(",
"c",
")",
",",
"nil",
"\n",
"}"
]
|
17,279 | all-17280 | [
"Finish",
"will",
"finish",
"all",
"leftover",
"spans",
"and",
"the",
"root",
"span",
"if",
"requested",
"."
]
| [
"func",
"(",
"t",
"*",
"Tracer",
")",
"Finish",
"(",
"root",
"bool",
")",
"{",
"for",
"_",
",",
"<mask>",
":=",
"range",
"t",
".",
"spans",
"{",
"span",
".",
"Finish",
"(",
")",
"\n",
"}",
"\n\n",
"if",
"root",
"{",
"t",
".",
"root",
".",
"Finish",
"(",
")",
"\n",
"}",
"\n",
"}"
]
|
17,280 | all-17281 | [
"Contains",
"returns",
"bool",
"indicating",
"whether",
"given",
"ip",
"is",
"contained",
"by",
"any",
"network",
"in",
"ranger",
"."
]
| [
"func",
"(",
"b",
"*",
"bruteRanger",
")",
"Contains",
"(",
"ip",
"net",
".",
"IP",
")",
"(",
"bool",
",",
"error",
")",
"{",
"entries",
",",
"err",
":=",
"b",
".",
"getEntriesByVersion",
"(",
"ip",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
",",
"err",
"\n",
"}",
"\n",
"for",
"_",
",",
"<mask>",
":=",
"range",
"entries",
"{",
"network",
":=",
"entry",
".",
"Network",
"(",
")",
"\n",
"if",
"network",
".",
"Contains",
"(",
"ip",
")",
"{",
"return",
"true",
",",
"nil",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"false",
",",
"nil",
"\n",
"}"
]
|
17,281 | all-17282 | [
"DoubleClick",
"double",
"clicks",
"the",
"left",
"mouse",
"button",
"at",
"the",
"current",
"mouse",
"position",
"."
]
| [
"func",
"(",
"p",
"*",
"Page",
")",
"DoubleClick",
"(",
")",
"error",
"{",
"if",
"err",
":=",
"p",
".",
"<mask>",
".",
"DoubleClick",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
]
|
17,282 | all-17283 | [
"add",
"puts",
"a",
"watcher",
"in",
"the",
"group",
"."
]
| [
"func",
"(",
"wg",
"*",
"watcherGroup",
")",
"add",
"(",
"wa",
"*",
"watcher",
")",
"{",
"wg",
".",
"watchers",
".",
"add",
"(",
"wa",
")",
"\n",
"if",
"wa",
".",
"end",
"==",
"nil",
"{",
"wg",
".",
"keyWatchers",
".",
"add",
"(",
"wa",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"// interval already registered?",
"ivl",
":=",
"adt",
".",
"NewStringAffineInterval",
"(",
"string",
"(",
"wa",
".",
"key",
")",
",",
"string",
"(",
"wa",
".",
"end",
")",
")",
"\n",
"if",
"iv",
":=",
"wg",
".",
"ranges",
".",
"Find",
"(",
"ivl",
")",
";",
"iv",
"!=",
"nil",
"{",
"iv",
".",
"Val",
".",
"(",
"watcherSet",
")",
".",
"add",
"(",
"wa",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"// not registered, put in interval tree",
"ws",
":=",
"make",
"(",
"watcherSet",
")",
"\n",
"<mask>",
".",
"add",
"(",
"wa",
")",
"\n",
"wg",
".",
"ranges",
".",
"Insert",
"(",
"ivl",
",",
"ws",
")",
"\n",
"}"
]
|
17,283 | all-17284 | [
"Locator",
"returns",
"a",
"locator",
"for",
"the",
"given",
"resource"
]
| [
"func",
"(",
"r",
"*",
"Alert",
")",
"Locator",
"(",
"api",
"*",
"API",
")",
"*",
"AlertLocator",
"{",
"for",
"_",
",",
"l",
":=",
"<mask>",
"r",
".",
"Links",
"{",
"if",
"l",
"[",
"\"",
"\"",
"]",
"==",
"\"",
"\"",
"{",
"return",
"api",
".",
"AlertLocator",
"(",
"l",
"[",
"\"",
"\"",
"]",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
]
|
17,284 | all-17285 | [
"Do",
"executes",
"Target",
".",
"setDiscoverTargets",
"against",
"the",
"provided",
"context",
"."
]
| [
"func",
"(",
"p",
"*",
"SetDiscoverTargetsParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetDiscoverTargets",
",",
"p",
",",
"nil",
")",
"\n",
"}"
]
|
17,285 | all-17286 | [
"FetchUser",
"retrieves",
"user",
"with",
"passed",
"cid",
".",
"Pass",
"nil",
"for",
"/",
"user",
"/",
"current",
"."
]
| [
"func",
"(",
"a",
"*",
"API",
")",
"FetchUser",
"(",
"cid",
"CIDType",
")",
"(",
"*",
"User",
",",
"error",
")",
"{",
"var",
"userCID",
"string",
"\n\n",
"if",
"cid",
"==",
"nil",
"||",
"*",
"cid",
"==",
"\"",
"\"",
"{",
"userCID",
"=",
"config",
".",
"UserPrefix",
"+",
"\"",
"\"",
"\n",
"}",
"else",
"{",
"userCID",
"=",
"string",
"(",
"*",
"cid",
")",
"\n",
"}",
"\n\n",
"matched",
",",
"err",
":=",
"regexp",
".",
"MatchString",
"(",
"config",
".",
"UserCIDRegex",
",",
"userCID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"!",
"matched",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"userCID",
")",
"\n",
"}",
"\n\n",
"result",
",",
"err",
":=",
"a",
".",
"Get",
"(",
"userCID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"a",
".",
"Debug",
"{",
"a",
".",
"Log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"string",
"(",
"result",
")",
")",
"\n",
"}",
"\n\n",
"user",
":=",
"<mask>",
"(",
"User",
")",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"result",
",",
"user",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"user",
",",
"nil",
"\n",
"}"
]
|
17,286 | all-17287 | [
"Insert",
"is",
"a",
"wrapper",
"around",
"gtk_toolbar_insert",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"Toolbar",
")",
"Insert",
"(",
"<mask>",
"IToolItem",
",",
"pos",
"int",
")",
"{",
"C",
".",
"gtk_toolbar_insert",
"(",
"v",
".",
"native",
"(",
")",
",",
"item",
".",
"toToolItem",
"(",
")",
",",
"C",
".",
"gint",
"(",
"pos",
")",
")",
"\n",
"}"
]
|
17,287 | all-17288 | [
"GetOptionsOk",
"returns",
"a",
"tuple",
"with",
"the",
"Options",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"m",
"*",
"Monitor",
")",
"GetOptionsOk",
"(",
")",
"(",
"Options",
",",
"bool",
")",
"{",
"if",
"m",
"==",
"nil",
"||",
"m",
".",
"Options",
"==",
"nil",
"{",
"return",
"<mask>",
"{",
"}",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"m",
".",
"Options",
",",
"true",
"\n",
"}"
]
|
17,288 | all-17289 | [
"Return",
"a",
"generic",
"vertex",
"attribute",
"parameter"
]
| [
"func",
"GetVertexAttribfv",
"(",
"<mask>",
"uint32",
",",
"pname",
"uint32",
",",
"params",
"*",
"float32",
")",
"{",
"C",
".",
"glowGetVertexAttribfv",
"(",
"gpGetVertexAttribfv",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"index",
")",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"pname",
")",
",",
"(",
"*",
"C",
".",
"GLfloat",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"params",
")",
")",
")",
"\n",
"}"
]
|
17,289 | all-17290 | [
"LoadWorkspaceData",
"is",
"similar",
"to",
"LoadData",
"but",
"parses",
"the",
"data",
"as",
"a",
"WORKSPACE",
"file",
"."
]
| [
"func",
"LoadWorkspaceData",
"(",
"path",
",",
"pkg",
"string",
",",
"<mask>",
"[",
"]",
"byte",
")",
"(",
"*",
"File",
",",
"error",
")",
"{",
"ast",
",",
"err",
":=",
"bzl",
".",
"ParseWorkspace",
"(",
"path",
",",
"data",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"ScanAST",
"(",
"pkg",
",",
"ast",
")",
",",
"nil",
"\n",
"}"
]
|
17,290 | all-17291 | [
"MarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Marshaler",
"."
]
| [
"func",
"(",
"t",
"Level",
")",
"MarshalEasyJSON",
"(",
"out",
"*",
"jwriter",
".",
"Writer",
")",
"{",
"<mask>",
".",
"String",
"(",
"string",
"(",
"t",
")",
")",
"\n",
"}"
]
|
17,291 | all-17292 | [
"GetProjectColumns",
"returns",
"the",
"list",
"of",
"columns",
"for",
"a",
"given",
"project",
"."
]
| [
"func",
"(",
"f",
"*",
"FakeClient",
")",
"GetProjectColumns",
"(",
"projectID",
"int",
")",
"(",
"[",
"]",
"github",
".",
"ProjectColumn",
",",
"error",
")",
"{",
"// Get project name",
"for",
"_",
",",
"projects",
":=",
"range",
"f",
".",
"RepoProjects",
"{",
"for",
"_",
",",
"project",
":=",
"range",
"projects",
"{",
"if",
"projectID",
"==",
"project",
".",
"ID",
"{",
"return",
"f",
".",
"ProjectColumnsMap",
"[",
"<mask>",
".",
"Name",
"]",
",",
"nil",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}"
]
|
17,292 | all-17293 | [
"GetEscalationMessage",
"returns",
"the",
"EscalationMessage",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
]
| [
"func",
"(",
"o",
"*",
"<mask>",
")",
"GetEscalationMessage",
"(",
")",
"string",
"{",
"if",
"o",
"==",
"nil",
"||",
"o",
".",
"EscalationMessage",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"o",
".",
"EscalationMessage",
"\n",
"}"
]
|
17,293 | all-17294 | [
"HasMetricQuery",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"d",
"*",
"DistributionRequest",
")",
"HasMetricQuery",
"(",
")",
"bool",
"{",
"if",
"d",
"!=",
"nil",
"&&",
"d",
".",
"MetricQuery",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
]
|
17,294 | all-17295 | [
"Sections",
"returns",
"the",
"list",
"of",
"sections",
"in",
"the",
"file",
"."
]
| [
"func",
"(",
"c",
"*",
"Config",
")",
"Sections",
"(",
")",
"[",
"]",
"string",
"{",
"var",
"sections",
"[",
"]",
"string",
"\n",
"for",
"_",
",",
"sect",
":=",
"range",
"c",
".",
"sections",
"{",
"sections",
"=",
"append",
"(",
"sections",
",",
"sect",
".",
"<mask>",
")",
"\n",
"}",
"\n",
"return",
"sections",
"\n",
"}"
]
|
17,295 | all-17296 | [
"HasType",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"t",
"*",
"TileDefMarker",
")",
"HasType",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"Type",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
]
|
17,296 | all-17297 | [
"Stop",
"stops",
"the",
"member",
"but",
"the",
"data",
"dir",
"of",
"the",
"member",
"is",
"preserved",
"."
]
| [
"func",
"(",
"m",
"*",
"member",
")",
"Stop",
"(",
"t",
"testing",
".",
"TB",
")",
"{",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"Name",
")",
",",
"zap",
".",
"Strings",
"(",
"\"",
"\"",
",",
"m",
".",
"PeerURLs",
".",
"StringSlice",
"(",
")",
")",
",",
"zap",
".",
"Strings",
"(",
"\"",
"\"",
",",
"m",
".",
"ClientURLs",
".",
"StringSlice",
"(",
")",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"grpcAddr",
")",
",",
")",
"\n",
"m",
".",
"Close",
"(",
")",
"\n",
"m",
".",
"serverClosers",
"=",
"nil",
"\n",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"<mask>",
")",
",",
"zap",
".",
"Strings",
"(",
"\"",
"\"",
",",
"m",
".",
"PeerURLs",
".",
"StringSlice",
"(",
")",
")",
",",
"zap",
".",
"Strings",
"(",
"\"",
"\"",
",",
"m",
".",
"ClientURLs",
".",
"StringSlice",
"(",
")",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"grpcAddr",
")",
",",
")",
"\n",
"}"
]
|
17,297 | all-17298 | [
"withTop",
"gets",
"the",
"first",
"key",
"over",
"the",
"get",
"s",
"prefix",
"given",
"a",
"sort",
"order"
]
| [
"func",
"withTop",
"(",
"target",
"SortTarget",
",",
"<mask>",
"SortOrder",
")",
"[",
"]",
"OpOption",
"{",
"return",
"[",
"]",
"OpOption",
"{",
"WithPrefix",
"(",
")",
",",
"WithSort",
"(",
"target",
",",
"order",
")",
",",
"WithLimit",
"(",
"1",
")",
"}",
"\n",
"}"
]
|
17,298 | all-17299 | [
"isPkgDot",
"returns",
"true",
"if",
"t",
"is",
"the",
"expression",
"pkg",
".",
"name",
"where",
"pkg",
"is",
"an",
"imported",
"identifier",
"."
]
| [
"func",
"isPkgDot",
"(",
"t",
"ast",
".",
"Expr",
",",
"pkg",
",",
"<mask>",
"string",
")",
"bool",
"{",
"sel",
",",
"ok",
":=",
"t",
".",
"(",
"*",
"ast",
".",
"SelectorExpr",
")",
"\n",
"return",
"ok",
"&&",
"isTopName",
"(",
"sel",
".",
"X",
",",
"pkg",
")",
"&&",
"sel",
".",
"Sel",
".",
"String",
"(",
")",
"==",
"name",
"\n",
"}"
]
|
17,299 | all-17300 | [
"newETCDClient",
"is",
"an",
"etcd",
"client",
"constructor"
]
| [
"func",
"newETCDClient",
"(",
")",
"(",
"coreDNSClient",
",",
"error",
")",
"{",
"cfg",
",",
"err",
":=",
"getETCDConfig",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"c",
",",
"err",
":=",
"etcdcv3",
".",
"New",
"(",
"*",
"cfg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"etcdClient",
"{",
"c",
",",
"<mask>",
".",
"Background",
"(",
")",
"}",
",",
"nil",
"\n",
"}"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.