id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
4,100 | all-4101 | [
"just",
"archive",
"the",
"first",
"file"
] | [
"func",
"(",
"srv",
"*",
"Server",
")",
"createEtcdLogFile",
"(",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"srv",
".",
"etcdLogFile",
",",
"err",
"=",
"<mask>",
".",
"Create",
"(",
"srv",
".",
"Member",
".",
"Etcd",
".",
"LogOutputs",
"[",
"0",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"srv",
".",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"srv",
".",
"Member",
".",
"Etcd",
".",
"LogOutputs",
"[",
"0",
"]",
")",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
4,101 | all-4102 | [
"NewAdapter",
"creates",
"a",
"new",
"instance",
"of",
"Adapter",
"."
] | [
"func",
"NewAdapter",
"(",
"ctx",
"<mask>",
".",
"Context",
",",
"file",
"string",
",",
"name",
"string",
",",
"d",
"discovery",
".",
"Discoverer",
",",
"logger",
"log",
".",
"Logger",
")",
"*",
"Adapter",
"{",
"return",
"&",
"Adapter",
"{",
"ctx",
":",
"ctx",
",",
"disc",
":",
"d",
",",
"groups",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"customSD",
")",
",",
"manager",
":",
"discovery",
".",
"NewManager",
"(",
"ctx",
",",
"logger",
")",
",",
"output",
":",
"file",
",",
"name",
":",
"name",
",",
"logger",
":",
"logger",
",",
"}",
"\n",
"}"
] |
4,102 | all-4103 | [
"SetDocumentContent",
"sets",
"given",
"markup",
"as",
"the",
"document",
"s",
"HTML",
".",
"See",
":",
"https",
":",
"//",
"chromedevtools",
".",
"github",
".",
"io",
"/",
"devtools",
"-",
"protocol",
"/",
"tot",
"/",
"Page#method",
"-",
"setDocumentContent",
"parameters",
":",
"frameID",
"-",
"Frame",
"id",
"to",
"set",
"HTML",
"for",
".",
"html",
"-",
"HTML",
"content",
"to",
"set",
"."
] | [
"func",
"SetDocumentContent",
"(",
"frameID",
"cdp",
".",
"FrameID",
",",
"html",
"string",
")",
"*",
"SetDocumentContentParams",
"{",
"return",
"&",
"SetDocumentContentParams",
"{",
"FrameID",
":",
"frameID",
",",
"HTML",
":",
"<mask>",
",",
"}",
"\n",
"}"
] |
4,103 | all-4104 | [
"AddPorts",
"appends",
"a",
"list",
"of",
"ports",
"to",
"the",
"list",
"of",
"ports",
"to",
"be",
"scanned"
] | [
"func",
"(",
"s",
"Scan",
")",
"AddPorts",
"(",
"<mask>",
"...",
"uint16",
")",
"Scan",
"{",
"s",
".",
"configPorts",
"=",
"append",
"(",
"s",
".",
"configPorts",
",",
"ports",
"...",
")",
"\n",
"return",
"s",
"\n",
"}"
] |
4,104 | all-4105 | [
"List",
"lists",
"all",
"ProwJobs",
"in",
"the",
"indexer",
"for",
"a",
"given",
"namespace",
"."
] | [
"func",
"(",
"s",
"prowJobNamespaceLister",
")",
"List",
"(",
"selector",
"labels",
".",
"Selector",
")",
"(",
"ret",
"[",
"]",
"*",
"v1",
".",
"ProwJob",
",",
"err",
"error",
")",
"{",
"err",
"=",
"<mask>",
".",
"ListAllByNamespace",
"(",
"s",
".",
"indexer",
",",
"s",
".",
"namespace",
",",
"selector",
",",
"func",
"(",
"m",
"interface",
"{",
"}",
")",
"{",
"ret",
"=",
"append",
"(",
"ret",
",",
"m",
".",
"(",
"*",
"v1",
".",
"ProwJob",
")",
")",
"\n",
"}",
")",
"\n",
"return",
"ret",
",",
"err",
"\n",
"}"
] |
4,105 | all-4106 | [
"RegistriesConfPath",
"is",
"the",
"path",
"to",
"the",
"system",
"-",
"wide",
"registry",
"configuration",
"file"
] | [
"func",
"RegistriesConfPath",
"(",
"ctx",
"*",
"types",
".",
"SystemContext",
")",
"string",
"{",
"<mask>",
":=",
"systemRegistriesConfPath",
"\n",
"if",
"ctx",
"!=",
"nil",
"{",
"if",
"ctx",
".",
"SystemRegistriesConfPath",
"!=",
"\"",
"\"",
"{",
"path",
"=",
"ctx",
".",
"SystemRegistriesConfPath",
"\n",
"}",
"else",
"if",
"ctx",
".",
"RootForImplicitAbsolutePaths",
"!=",
"\"",
"\"",
"{",
"path",
"=",
"filepath",
".",
"Join",
"(",
"ctx",
".",
"RootForImplicitAbsolutePaths",
",",
"systemRegistriesConfPath",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"path",
"\n",
"}"
] |
4,106 | all-4107 | [
"legacyEndpointsFromMoleculeService",
"tries",
"to",
"retrieve",
"Endpoints",
"from",
"Services",
"annotated",
"with",
"Molecule",
"Software",
"s",
"annotation",
"semantics",
"."
] | [
"func",
"legacyEndpointsFromMoleculeService",
"(",
"svc",
"*",
"v1",
".",
"Service",
")",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
"{",
"var",
"endpoints",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
"\n\n",
"// Check that the Service opted-in to being processed.",
"if",
"svc",
".",
"Labels",
"[",
"\"",
"\"",
"]",
"!=",
"\"",
"\"",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"// Get the desired hostname of the service from the annotation.",
"hostnameAnnotation",
",",
"exists",
":=",
"svc",
".",
"Annotations",
"[",
"moleculeAnnotationKey",
"]",
"\n",
"if",
"!",
"exists",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"hostnameList",
":=",
"strings",
".",
"Split",
"(",
"strings",
".",
"Replace",
"(",
"hostnameAnnotation",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
",",
"\"",
"\"",
")",
"\n\n",
"for",
"_",
",",
"hostname",
":=",
"range",
"hostnameList",
"{",
"// Create a corresponding endpoint for each configured external entrypoint.",
"for",
"_",
",",
"lb",
":=",
"<mask>",
"svc",
".",
"Status",
".",
"LoadBalancer",
".",
"Ingress",
"{",
"if",
"lb",
".",
"IP",
"!=",
"\"",
"\"",
"{",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"endpoint",
".",
"NewEndpoint",
"(",
"hostname",
",",
"endpoint",
".",
"RecordTypeA",
",",
"lb",
".",
"IP",
")",
")",
"\n",
"}",
"\n",
"if",
"lb",
".",
"Hostname",
"!=",
"\"",
"\"",
"{",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"endpoint",
".",
"NewEndpoint",
"(",
"hostname",
",",
"endpoint",
".",
"RecordTypeCNAME",
",",
"lb",
".",
"Hostname",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"endpoints",
"\n",
"}"
] |
4,107 | all-4108 | [
"puts",
"is",
"the",
"list",
"of",
"ops",
"for",
"all",
"pending",
"writes"
] | [
"func",
"(",
"ws",
"writeSet",
")",
"puts",
"(",
")",
"[",
"]",
"v3",
".",
"Op",
"{",
"puts",
":=",
"make",
"(",
"[",
"]",
"v3",
".",
"Op",
",",
"0",
",",
"len",
"(",
"ws",
")",
")",
"\n",
"for",
"_",
",",
"v",
":=",
"range",
"ws",
"{",
"puts",
"=",
"<mask>",
"(",
"puts",
",",
"v",
".",
"op",
")",
"\n",
"}",
"\n",
"return",
"puts",
"\n",
"}"
] |
4,108 | all-4109 | [
"Exec",
"executes",
"a",
"newScreenFramebufferImageCommand",
"."
] | [
"func",
"(",
"c",
"*",
"newScreenFramebufferImageCommand",
")",
"Exec",
"(",
"indexOffset",
"int",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"c",
".",
"result",
".",
"image",
",",
"err",
"=",
"theGraphicsDriver",
".",
"NewScreenFramebufferImage",
"(",
"c",
".",
"width",
",",
"c",
".",
"<mask>",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
4,109 | all-4110 | [
"parseTextOnlyBody",
"parses",
"a",
"plain",
"text",
"message",
"in",
"root",
"that",
"has",
"MIME",
"-",
"like",
"headers",
"but",
"only",
"contains",
"a",
"single",
"part",
"-",
"no",
"boundaries",
"etc",
".",
"The",
"result",
"is",
"placed",
"in",
"e",
"."
] | [
"func",
"parseTextOnlyBody",
"(",
"<mask>",
"*",
"Part",
",",
"e",
"*",
"Envelope",
")",
"error",
"{",
"// Determine character set",
"var",
"charset",
"string",
"\n",
"var",
"isHTML",
"bool",
"\n",
"if",
"ctype",
":=",
"root",
".",
"Header",
".",
"Get",
"(",
"hnContentType",
")",
";",
"ctype",
"!=",
"\"",
"\"",
"{",
"if",
"mediatype",
",",
"mparams",
",",
"_",
",",
"err",
":=",
"parseMediaType",
"(",
"ctype",
")",
";",
"err",
"==",
"nil",
"{",
"isHTML",
"=",
"(",
"mediatype",
"==",
"ctTextHTML",
")",
"\n",
"if",
"mparams",
"[",
"hpCharset",
"]",
"!=",
"\"",
"\"",
"{",
"charset",
"=",
"mparams",
"[",
"hpCharset",
"]",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Read transcoded text",
"if",
"isHTML",
"{",
"rawHTML",
":=",
"string",
"(",
"root",
".",
"Content",
")",
"\n",
"// Note: Empty e.Text will trigger html2text conversion",
"e",
".",
"HTML",
"=",
"rawHTML",
"\n",
"if",
"charset",
"==",
"\"",
"\"",
"{",
"// Search for charset in HTML metadata",
"if",
"charset",
"=",
"coding",
".",
"FindCharsetInHTML",
"(",
"rawHTML",
")",
";",
"charset",
"!=",
"\"",
"\"",
"{",
"// Found charset in HTML",
"if",
"convHTML",
",",
"err",
":=",
"coding",
".",
"ConvertToUTF8String",
"(",
"charset",
",",
"root",
".",
"Content",
")",
";",
"err",
"==",
"nil",
"{",
"// Successful conversion",
"e",
".",
"HTML",
"=",
"convHTML",
"\n",
"}",
"else",
"{",
"// Conversion failed",
"root",
".",
"addWarning",
"(",
"ErrorCharsetConversion",
",",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"// Converted from charset in HTML",
"return",
"nil",
"\n",
"}",
"\n",
"}",
"else",
"{",
"e",
".",
"Text",
"=",
"string",
"(",
"root",
".",
"Content",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
4,110 | all-4111 | [
"MiddlewareFunc",
"makes",
"JsonIndentMiddleware",
"implement",
"the",
"Middleware",
"interface",
"."
] | [
"func",
"(",
"mw",
"*",
"JsonIndentMiddleware",
")",
"MiddlewareFunc",
"(",
"handler",
"HandlerFunc",
")",
"HandlerFunc",
"{",
"if",
"mw",
".",
"Indent",
"==",
"\"",
"\"",
"{",
"mw",
".",
"Indent",
"=",
"\"",
"\"",
"\n",
"}",
"\n\n",
"return",
"func",
"(",
"w",
"ResponseWriter",
",",
"r",
"*",
"Request",
")",
"{",
"writer",
":=",
"&",
"jsonIndentResponseWriter",
"{",
"w",
",",
"<mask>",
",",
"mw",
".",
"Prefix",
",",
"mw",
".",
"Indent",
"}",
"\n",
"// call the wrapped handler",
"handler",
"(",
"writer",
",",
"r",
")",
"\n",
"}",
"\n",
"}"
] |
4,111 | all-4112 | [
"GetTitleAlign",
"returns",
"the",
"TitleAlign",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"e",
"*",
"EventStreamDefinition",
")",
"GetTitleAlign",
"(",
")",
"string",
"{",
"if",
"e",
"==",
"nil",
"||",
"e",
".",
"TitleAlign",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"<mask>",
"*",
"e",
".",
"TitleAlign",
"\n",
"}"
] |
4,112 | all-4113 | [
"ProtoSendControl",
"sends",
"a",
"migration",
"control",
"message",
"over",
"a",
"websocket"
] | [
"func",
"ProtoSendControl",
"(",
"ws",
"*",
"websocket",
".",
"Conn",
",",
"err",
"error",
")",
"{",
"message",
":=",
"\"",
"\"",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"message",
"=",
"err",
".",
"Error",
"(",
")",
"\n",
"}",
"\n\n",
"msg",
":=",
"MigrationControl",
"{",
"Success",
":",
"proto",
".",
"Bool",
"(",
"err",
"==",
"nil",
")",
",",
"Message",
":",
"proto",
".",
"String",
"(",
"<mask>",
")",
",",
"}",
"\n\n",
"ProtoSend",
"(",
"ws",
",",
"&",
"msg",
")",
"\n",
"}"
] |
4,113 | all-4114 | [
"Do",
"executes",
"CSS",
".",
"getInlineStylesForNode",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"inlineStyle",
"-",
"Inline",
"style",
"for",
"the",
"specified",
"DOM",
"node",
".",
"attributesStyle",
"-",
"Attribute",
"-",
"defined",
"element",
"style",
"(",
"e",
".",
"g",
".",
"resulting",
"from",
"width",
"=",
"20",
"height",
"=",
"100%",
")",
"."
] | [
"func",
"(",
"p",
"*",
"GetInlineStylesForNodeParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"inlineStyle",
"*",
"Style",
",",
"attributesStyle",
"*",
"Style",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"GetInlineStylesForNodeReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandGetInlineStylesForNode",
",",
"p",
",",
"&",
"res",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"res",
".",
"InlineStyle",
",",
"<mask>",
".",
"AttributesStyle",
",",
"nil",
"\n",
"}"
] |
4,114 | all-4115 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"BoxModel",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom78",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
4,115 | all-4116 | [
"ApplyChanges",
"applies",
"a",
"given",
"set",
"of",
"changes",
"in",
"a",
"given",
"zone",
"."
] | [
"func",
"(",
"p",
"*",
"GoogleProvider",
")",
"ApplyChanges",
"(",
"changes",
"*",
"plan",
".",
"Changes",
")",
"error",
"{",
"change",
":=",
"&",
"dns",
".",
"Change",
"{",
"}",
"\n\n",
"<mask>",
".",
"Additions",
"=",
"append",
"(",
"change",
".",
"Additions",
",",
"p",
".",
"newFilteredRecords",
"(",
"changes",
".",
"Create",
")",
"...",
")",
"\n\n",
"change",
".",
"Additions",
"=",
"append",
"(",
"change",
".",
"Additions",
",",
"p",
".",
"newFilteredRecords",
"(",
"changes",
".",
"UpdateNew",
")",
"...",
")",
"\n",
"change",
".",
"Deletions",
"=",
"append",
"(",
"change",
".",
"Deletions",
",",
"p",
".",
"newFilteredRecords",
"(",
"changes",
".",
"UpdateOld",
")",
"...",
")",
"\n\n",
"change",
".",
"Deletions",
"=",
"append",
"(",
"change",
".",
"Deletions",
",",
"p",
".",
"newFilteredRecords",
"(",
"changes",
".",
"Delete",
")",
"...",
")",
"\n\n",
"return",
"p",
".",
"submitChange",
"(",
"change",
")",
"\n",
"}"
] |
4,116 | all-4117 | [
"NewPolicyContext",
"sets",
"up",
"and",
"initializes",
"a",
"context",
"for",
"the",
"specified",
"policy",
".",
"The",
"policy",
"must",
"not",
"be",
"modified",
"while",
"the",
"context",
"exists",
".",
"FIXME",
":",
"make",
"a",
"deep",
"copy?",
"If",
"this",
"function",
"succeeds",
"the",
"caller",
"should",
"call",
"PolicyContext",
".",
"Destroy",
"()",
"when",
"done",
"."
] | [
"func",
"NewPolicyContext",
"(",
"policy",
"*",
"Policy",
")",
"(",
"*",
"PolicyContext",
",",
"error",
")",
"{",
"<mask>",
":=",
"&",
"PolicyContext",
"{",
"Policy",
":",
"policy",
",",
"state",
":",
"pcInitializing",
"}",
"\n",
"// FIXME: initialize",
"if",
"err",
":=",
"pc",
".",
"changeState",
"(",
"pcInitializing",
",",
"pcReady",
")",
";",
"err",
"!=",
"nil",
"{",
"// Huh?! This should never fail, we didn't give the pointer to anybody.",
"// Just give up and leave unclean state around.",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"pc",
",",
"nil",
"\n",
"}"
] |
4,117 | all-4118 | [
"TagsClient",
"returns",
"the",
"embedded",
"REST",
"client",
"used",
"for",
"tags",
"after",
"determining",
"if",
"the",
"connection",
"is",
"eligible",
":",
"*",
"The",
"connection",
"information",
"in",
"vimClient",
"is",
"valid",
"vCenter",
"connection",
"*",
"The",
"provider",
"has",
"a",
"connection",
"to",
"the",
"CIS",
"REST",
"client",
".",
"This",
"is",
"true",
"if",
"tagsClient",
"!",
"=",
"nil",
".",
"This",
"function",
"should",
"be",
"used",
"whenever",
"possible",
"to",
"return",
"the",
"client",
"from",
"the",
"provider",
"meta",
"variable",
"for",
"use",
"to",
"determine",
"if",
"it",
"can",
"be",
"used",
"at",
"all",
".",
"The",
"nil",
"value",
"that",
"is",
"returned",
"on",
"an",
"unsupported",
"connection",
"can",
"be",
"considered",
"stable",
"behavior",
"for",
"read",
"purposes",
"on",
"resources",
"that",
"need",
"to",
"be",
"able",
"to",
"read",
"tags",
"if",
"they",
"are",
"present",
".",
"You",
"can",
"use",
"the",
"snippet",
"below",
"in",
"a",
"Read",
"call",
"to",
"determine",
"if",
"tags",
"are",
"supported",
"on",
"this",
"connection",
"and",
"if",
"they",
"are",
"read",
"them",
"from",
"the",
"object",
"and",
"save",
"them",
"in",
"the",
"resource",
":",
"if",
"tagsClient",
"_",
":",
"=",
"meta",
".",
"(",
"*",
"VSphereClient",
")",
".",
"TagsClient",
"()",
";",
"tagsClient",
"!",
"=",
"nil",
"{",
"if",
"err",
":",
"=",
"readTagsForResource",
"(",
"tagsClient",
"obj",
"d",
")",
";",
"err",
"!",
"=",
"nil",
"{",
"return",
"err",
"}",
"}"
] | [
"func",
"(",
"c",
"*",
"VSphereClient",
")",
"TagsClient",
"(",
")",
"(",
"*",
"<mask>",
".",
"RestClient",
",",
"error",
")",
"{",
"if",
"err",
":=",
"viapi",
".",
"ValidateVirtualCenter",
"(",
"c",
".",
"vimClient",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"c",
".",
"tagsClient",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"tagsMinVersion",
")",
"\n",
"}",
"\n",
"return",
"c",
".",
"tagsClient",
",",
"nil",
"\n",
"}"
] |
4,118 | all-4119 | [
"Receive",
"implements",
"TCPReceiver",
"by",
"reading",
"from",
"the",
"wrapped",
"TCPReceiver",
"and",
"unboxing",
"the",
"encrypted",
"message",
"returning",
"the",
"decoded",
"message",
"."
] | [
"func",
"(",
"receiver",
"*",
"encryptedTCPReceiver",
")",
"Receive",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"msg",
",",
"err",
":=",
"receiver",
".",
"receiver",
".",
"Receive",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"decodedMsg",
",",
"success",
":=",
"secretbox",
".",
"Open",
"(",
"nil",
",",
"msg",
",",
"&",
"receiver",
".",
"state",
".",
"nonce",
",",
"receiver",
".",
"<mask>",
".",
"sessionKey",
")",
"\n",
"if",
"!",
"success",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"receiver",
".",
"state",
".",
"advance",
"(",
")",
"\n",
"return",
"decodedMsg",
",",
"nil",
"\n",
"}"
] |
4,119 | all-4120 | [
"newGPGSigningMechanismInDirectory",
"returns",
"a",
"new",
"GPG",
"/",
"OpenPGP",
"signing",
"mechanism",
"using",
"optionalDir",
"if",
"not",
"empty",
".",
"The",
"caller",
"must",
"call",
".",
"Close",
"()",
"on",
"the",
"returned",
"SigningMechanism",
"."
] | [
"func",
"newGPGSigningMechanismInDirectory",
"(",
"optionalDir",
"string",
")",
"(",
"SigningMechanism",
",",
"error",
")",
"{",
"m",
":=",
"&",
"openpgpSigningMechanism",
"{",
"keyring",
":",
"openpgp",
".",
"EntityList",
"{",
"}",
",",
"}",
"\n\n",
"gpgHome",
":=",
"optionalDir",
"\n",
"if",
"gpgHome",
"==",
"\"",
"\"",
"{",
"gpgHome",
"=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n",
"if",
"gpgHome",
"==",
"\"",
"\"",
"{",
"gpgHome",
"=",
"<mask>",
".",
"Join",
"(",
"homedir",
".",
"Get",
"(",
")",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"pubring",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"path",
".",
"Join",
"(",
"gpgHome",
",",
"\"",
"\"",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"!",
"os",
".",
"IsNotExist",
"(",
"err",
")",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"else",
"{",
"_",
",",
"err",
":=",
"m",
".",
"importKeysFromBytes",
"(",
"pubring",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"m",
",",
"nil",
"\n",
"}"
] |
4,120 | all-4121 | [
"tick",
"updates",
"the",
"minimum",
"quiescence",
"timer",
"."
] | [
"func",
"(",
"q",
"*",
"quiescence",
")",
"tick",
"(",
")",
"{",
"now",
":=",
"time",
".",
"Now",
"(",
")",
"\n\n",
"// If this is the first tick, set up the timer and calculate the max",
"// deadline.",
"if",
"q",
".",
"timer",
"==",
"nil",
"{",
"q",
".",
"<mask>",
"=",
"time",
".",
"NewTimer",
"(",
"q",
".",
"min",
")",
"\n",
"go",
"func",
"(",
")",
"{",
"select",
"{",
"case",
"<-",
"q",
".",
"timer",
".",
"C",
":",
"q",
".",
"ch",
"<-",
"q",
".",
"template",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n\n",
"q",
".",
"deadline",
"=",
"now",
".",
"Add",
"(",
"q",
".",
"max",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"// Snooze the timer for the min time, or snooze less if we are coming",
"// up against the max time. If the timer has already fired and the reset",
"// doesn't work that's ok because we guarantee that the channel gets our",
"// template which means that we are obsolete and a fresh quiescence will",
"// be set up.",
"if",
"now",
".",
"Add",
"(",
"q",
".",
"min",
")",
".",
"Before",
"(",
"q",
".",
"deadline",
")",
"{",
"q",
".",
"timer",
".",
"Reset",
"(",
"q",
".",
"min",
")",
"\n",
"}",
"else",
"if",
"dur",
":=",
"q",
".",
"deadline",
".",
"Sub",
"(",
"now",
")",
";",
"dur",
">",
"0",
"{",
"q",
".",
"timer",
".",
"Reset",
"(",
"dur",
")",
"\n",
"}",
"\n",
"}"
] |
4,121 | all-4122 | [
"Convert",
"*",
"mat64",
".",
"Dense",
"to",
"Mat"
] | [
"func",
"Mat64ToGcvMat",
"(",
"mat",
"*",
"mat64",
".",
"Dense",
")",
"GcvMat",
"{",
"row",
",",
"col",
":=",
"mat",
".",
"Dims",
"(",
")",
"\n\n",
"rawData",
":=",
"NewGcvFloat64Vector",
"(",
"int64",
"(",
"row",
"*",
"col",
")",
")",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"row",
";",
"i",
"++",
"{",
"for",
"j",
":=",
"0",
";",
"j",
"<",
"<mask>",
";",
"j",
"++",
"{",
"rawData",
".",
"Set",
"(",
"i",
"*",
"col",
"+",
"j",
",",
"mat",
".",
"At",
"(",
"i",
",",
"j",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"Mat64ToGcvMat_",
"(",
"row",
",",
"col",
",",
"rawData",
")",
"\n",
"}"
] |
4,122 | all-4123 | [
"StopFunc",
"..."
] | [
"func",
"(",
"s",
"*",
"Stoppable",
")",
"StopFunc",
"(",
"callable",
"func",
"(",
")",
")",
"{",
"s",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"Unlock",
"(",
")",
"\n\n",
"// already stopped",
"if",
"s",
".",
"<mask>",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"s",
".",
"doStop",
"(",
"callable",
")",
"\n",
"}"
] |
4,123 | all-4124 | [
"SetDefaultText",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_app_chooser_widget_set_default_text",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"AppChooserWidget",
")",
"SetDefaultText",
"(",
"<mask>",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"text",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_app_chooser_widget_set_default_text",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
4,124 | all-4125 | [
"Errorf",
"returns",
"a",
"traceable",
"error",
"with",
"the",
"given",
"formatted",
"message",
"."
] | [
"func",
"Errorf",
"(",
"message",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"wrap",
"(",
"fmt",
".",
"Errorf",
"(",
"<mask>",
",",
"a",
"...",
")",
")",
"\n",
"}"
] |
4,125 | all-4126 | [
"makePipelineGitResource",
"creates",
"a",
"pipeline",
"git",
"resource",
"from",
"prow",
"job"
] | [
"func",
"makePipelineGitResource",
"(",
"pj",
"prowjobv1",
".",
"ProwJob",
")",
"*",
"pipelinev1alpha1",
".",
"PipelineResource",
"{",
"<mask>",
"revision",
"string",
"\n",
"if",
"pj",
".",
"Spec",
".",
"Refs",
"!=",
"nil",
"{",
"if",
"len",
"(",
"pj",
".",
"Spec",
".",
"Refs",
".",
"Pulls",
")",
">",
"0",
"{",
"revision",
"=",
"pj",
".",
"Spec",
".",
"Refs",
".",
"Pulls",
"[",
"0",
"]",
".",
"SHA",
"\n",
"}",
"else",
"{",
"revision",
"=",
"pj",
".",
"Spec",
".",
"Refs",
".",
"BaseSHA",
"\n",
"}",
"\n",
"}",
"\n",
"pr",
":=",
"pipelinev1alpha1",
".",
"PipelineResource",
"{",
"ObjectMeta",
":",
"pipelineMeta",
"(",
"pj",
")",
",",
"Spec",
":",
"pipelinev1alpha1",
".",
"PipelineResourceSpec",
"{",
"Type",
":",
"pipelinev1alpha1",
".",
"PipelineResourceTypeGit",
",",
"Params",
":",
"[",
"]",
"pipelinev1alpha1",
".",
"Param",
"{",
"{",
"Name",
":",
"\"",
"\"",
",",
"Value",
":",
"sourceURL",
"(",
"pj",
")",
",",
"}",
",",
"{",
"Name",
":",
"\"",
"\"",
",",
"Value",
":",
"revision",
",",
"}",
",",
"}",
",",
"}",
",",
"}",
"\n",
"return",
"&",
"pr",
"\n",
"}"
] |
4,126 | all-4127 | [
"CreateServer",
"creates",
"a",
"new",
"server",
".",
"It",
"takes",
"a",
"ServerOptions",
"struct",
"which",
"requires",
"at",
"minimum",
"a",
"valid",
"Image",
"identifier",
".",
"Not",
"all",
"attributes",
"can",
"be",
"specified",
"at",
"create",
"time",
"(",
"such",
"as",
"Id",
"which",
"is",
"allocated",
"for",
"you",
")"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateServer",
"(",
"newServer",
"*",
"ServerOptions",
")",
"(",
"*",
"Server",
",",
"error",
")",
"{",
"server",
":=",
"new",
"(",
"Server",
")",
"\n",
"_",
",",
"err",
":=",
"c",
".",
"MakeApiRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"newServer",
",",
"&",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"server",
",",
"nil",
"\n",
"}"
] |
4,127 | all-4128 | [
"GetOverlayPassThrough",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_overlay_get_overlay_pass_through",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Overlay",
")",
"GetOverlayPassThrough",
"(",
"widget",
"IWidget",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_overlay_get_overlay_pass_through",
"(",
"v",
".",
"native",
"(",
")",
",",
"widget",
".",
"toWidget",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
4,128 | all-4129 | [
"SetNetworkSettings",
"sets",
"the",
"networks",
"field",
"in",
"a",
"container"
] | [
"func",
"(",
"c",
"*",
"Container",
")",
"SetNetworkSettings",
"(",
"networks",
"*",
"<mask>",
".",
"NetworkSettings",
")",
"{",
"c",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
"c",
".",
"NetworkSettingsUnsafe",
"=",
"networks",
"\n",
"}"
] |
4,129 | all-4130 | [
"label",
"a",
"a",
"sync",
"object",
"identified",
"by",
"a",
"pointer"
] | [
"func",
"ObjectPtrLabel",
"(",
"ptr",
"unsafe",
".",
"Pointer",
",",
"length",
"int32",
",",
"label",
"*",
"uint8",
")",
"{",
"C",
".",
"glowObjectPtrLabel",
"(",
"gpObjectPtrLabel",
",",
"ptr",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"length",
")",
",",
"(",
"*",
"C",
".",
"GLchar",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"<mask>",
")",
")",
")",
"\n",
"}"
] |
4,130 | all-4131 | [
"HasKey",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_has_key",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PrintSettings",
")",
"HasKey",
"(",
"<mask>",
"string",
")",
"bool",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"key",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"c",
":=",
"C",
".",
"gtk_print_settings_has_key",
"(",
"ps",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"return",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
4,131 | all-4132 | [
"String",
"returns",
"the",
"string",
"representation",
"of",
"a",
"prow",
"job",
"identifier"
] | [
"func",
"(",
"i",
"*",
"jobIndentifier",
")",
"String",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"i",
".",
"<mask>",
",",
"i",
".",
"organization",
",",
"i",
".",
"repository",
",",
"i",
".",
"pullRequest",
")",
"\n",
"}"
] |
4,132 | all-4133 | [
"Response",
"provides",
"access",
"to",
"the",
"InboundCallResponse",
"object",
"which",
"can",
"be",
"used",
"to",
"write",
"back",
"to",
"the",
"calling",
"peer"
] | [
"func",
"(",
"<mask>",
"*",
"InboundCall",
")",
"Response",
"(",
")",
"*",
"InboundCallResponse",
"{",
"if",
"call",
".",
"err",
"!=",
"nil",
"{",
"// While reading Thrift, we cannot distinguish between malformed Thrift and other errors,",
"// and so we may try to respond with a bad request. We should ensure that the response",
"// is marked as failed if the request has failed so that we don't try to shutdown the exchange",
"// a second time.",
"call",
".",
"response",
".",
"err",
"=",
"call",
".",
"err",
"\n",
"}",
"\n",
"return",
"call",
".",
"response",
"\n",
"}"
] |
4,133 | all-4134 | [
"HasUrl",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"HasUrl",
"(",
")",
"bool",
"{",
"if",
"c",
"!=",
"nil",
"&&",
"c",
".",
"Url",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
4,134 | all-4135 | [
"Query",
"loads",
"the",
"data",
"for",
"the",
"query",
"paging",
"if",
"necessary",
"and",
"return",
"the",
"data",
"rows",
"headers",
"and",
"error"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"Query",
"(",
"dataset",
",",
"<mask>",
",",
"queryStr",
"string",
")",
"(",
"[",
"]",
"[",
"]",
"interface",
"{",
"}",
",",
"[",
"]",
"string",
",",
"error",
")",
"{",
"return",
"c",
".",
"pagedQuery",
"(",
"defaultPageSize",
",",
"dataset",
",",
"project",
",",
"queryStr",
",",
"nil",
")",
"\n",
"}"
] |
4,135 | all-4136 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"RunScriptReturns",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime5",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
4,136 | all-4137 | [
"destructivelyPrioritizeReplacementCandidatesWithMax",
"is",
"destructivelyPrioritizeReplacementCandidates",
"with",
"a",
"parameter",
"for",
"the",
"number",
"of",
"entries",
"to",
"limit",
"only",
"to",
"make",
"testing",
"simpler",
"."
] | [
"func",
"destructivelyPrioritizeReplacementCandidatesWithMax",
"(",
"cs",
"[",
"]",
"CandidateWithTime",
",",
"primaryDigest",
",",
"uncompressedDigest",
"digest",
".",
"Digest",
",",
"maxCandidates",
"int",
")",
"[",
"]",
"<mask>",
".",
"BICReplacementCandidate",
"{",
"// We don't need to use sort.Stable() because nanosecond timestamps are (presumably?) unique, so no two elements should",
"// compare equal.",
"sort",
".",
"Sort",
"(",
"&",
"candidateSortState",
"{",
"cs",
":",
"cs",
",",
"primaryDigest",
":",
"primaryDigest",
",",
"uncompressedDigest",
":",
"uncompressedDigest",
",",
"}",
")",
"\n\n",
"resLength",
":=",
"len",
"(",
"cs",
")",
"\n",
"if",
"resLength",
">",
"maxCandidates",
"{",
"resLength",
"=",
"maxCandidates",
"\n",
"}",
"\n",
"res",
":=",
"make",
"(",
"[",
"]",
"types",
".",
"BICReplacementCandidate",
",",
"resLength",
")",
"\n",
"for",
"i",
":=",
"range",
"res",
"{",
"res",
"[",
"i",
"]",
"=",
"cs",
"[",
"i",
"]",
".",
"Candidate",
"\n",
"}",
"\n",
"return",
"res",
"\n",
"}"
] |
4,137 | all-4138 | [
"GetServiceDetail",
"returns",
"detail",
"of",
"given",
"service"
] | [
"func",
"(",
"p",
"*",
"AWSSDProvider",
")",
"GetServiceDetail",
"(",
"serviceID",
"*",
"string",
")",
"(",
"*",
"sd",
".",
"Service",
",",
"error",
")",
"{",
"output",
",",
"err",
":=",
"p",
".",
"<mask>",
".",
"GetService",
"(",
"&",
"sd",
".",
"GetServiceInput",
"{",
"Id",
":",
"serviceID",
",",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"output",
".",
"Service",
",",
"nil",
"\n",
"}"
] |
4,138 | all-4139 | [
"HasEventType",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"e",
"*",
"Event",
")",
"HasEventType",
"(",
")",
"bool",
"{",
"if",
"e",
"!=",
"nil",
"&&",
"e",
".",
"EventType",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
4,139 | all-4140 | [
"SliceColorized",
"returns",
"a",
"slice",
"of",
"text",
"with",
"correct",
"color",
"tags",
".",
"start",
"and",
"end",
"are",
"real",
"printable",
"rune",
"indices"
] | [
"func",
"SliceColorized",
"(",
"str",
"string",
",",
"start",
",",
"end",
"int",
")",
"string",
"{",
"if",
"str",
"==",
"\"",
"\"",
"{",
"return",
"str",
"\n",
"}",
"\n",
"if",
"start",
"<",
"0",
"{",
"start",
"=",
"0",
"\n",
"}",
"\n\n",
"fgChanged",
",",
"bgChanged",
":=",
"false",
",",
"false",
"\n",
"curr",
":=",
"0",
"\n",
"parser",
":=",
"NewColorParser",
"(",
"str",
",",
"term",
".",
"ColorBlack",
",",
"term",
".",
"ColorBlack",
")",
"\n",
"var",
"out",
"string",
"\n",
"for",
"{",
"if",
"<mask>",
"!=",
"-",
"1",
"&&",
"curr",
">=",
"end",
"{",
"break",
"\n",
"}",
"\n",
"elem",
":=",
"parser",
".",
"NextElement",
"(",
")",
"\n",
"if",
"elem",
".",
"Type",
"==",
"ElemEndOfText",
"{",
"break",
"\n",
"}",
"\n\n",
"switch",
"elem",
".",
"Type",
"{",
"case",
"ElemTextColor",
":",
"fgChanged",
"=",
"true",
"\n",
"if",
"out",
"!=",
"\"",
"\"",
"{",
"out",
"+=",
"\"",
"\"",
"+",
"ColorToString",
"(",
"elem",
".",
"Fg",
")",
"+",
"\"",
"\"",
"\n",
"}",
"\n",
"case",
"ElemBackColor",
":",
"bgChanged",
"=",
"true",
"\n",
"if",
"out",
"!=",
"\"",
"\"",
"{",
"out",
"+=",
"\"",
"\"",
"+",
"ColorToString",
"(",
"elem",
".",
"Bg",
")",
"+",
"\"",
"\"",
"\n",
"}",
"\n",
"case",
"ElemPrintable",
":",
"if",
"curr",
"==",
"start",
"{",
"if",
"fgChanged",
"{",
"out",
"+=",
"\"",
"\"",
"+",
"ColorToString",
"(",
"elem",
".",
"Fg",
")",
"+",
"\"",
"\"",
"\n",
"}",
"\n",
"if",
"bgChanged",
"{",
"out",
"+=",
"\"",
"\"",
"+",
"ColorToString",
"(",
"elem",
".",
"Bg",
")",
"+",
"\"",
"\"",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"curr",
">=",
"start",
"{",
"out",
"+=",
"string",
"(",
"elem",
".",
"Ch",
")",
"\n",
"}",
"\n",
"curr",
"++",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"out",
"\n",
"}"
] |
4,140 | all-4141 | [
"AddAlternativeWriter",
"adds",
"an",
"alternative",
"part",
"to",
"the",
"message",
".",
"It",
"can",
"be",
"useful",
"with",
"the",
"text",
"/",
"template",
"or",
"html",
"/",
"template",
"packages",
"."
] | [
"func",
"(",
"m",
"*",
"Message",
")",
"AddAlternativeWriter",
"(",
"contentType",
"string",
",",
"f",
"func",
"(",
"io",
".",
"Writer",
")",
"error",
",",
"settings",
"...",
"PartSetting",
")",
"{",
"m",
".",
"parts",
"=",
"<mask>",
"(",
"m",
".",
"parts",
",",
"m",
".",
"newPart",
"(",
"contentType",
",",
"f",
",",
"settings",
")",
")",
"\n",
"}"
] |
4,141 | all-4142 | [
"SetSefaultSource",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_set_default_source",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PrintSettings",
")",
"SetSefaultSource",
"(",
"defaultSource",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"defaultSource",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_print_settings_set_default_source",
"(",
"<mask>",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
4,142 | all-4143 | [
"setAllowLargeResults",
"-",
"private",
"function",
"to",
"set",
"the",
"AllowLargeResults",
"and",
"tempTableName",
"values"
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"setAllowLargeResults",
"(",
"shouldAllow",
"bool",
",",
"tempTableName",
"string",
",",
"flattenResults",
"bool",
")",
"error",
"{",
"c",
".",
"allowLargeResults",
"=",
"shouldAllow",
"\n",
"c",
".",
"tempTableName",
"=",
"tempTableName",
"\n",
"c",
".",
"flattenResults",
"=",
"flattenResults",
"\n",
"return",
"nil",
"\n",
"}"
] |
4,143 | all-4144 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SetInspectedNodeParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom6",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
4,144 | all-4145 | [
"Gets",
"a",
"pointer",
"to",
"the",
"element",
"at",
"the",
"index"
] | [
"func",
"(",
"seq",
"*",
"Seq",
")",
"GetElemAt",
"(",
"<mask>",
"int",
")",
"unsafe",
".",
"Pointer",
"{",
"return",
"(",
"unsafe",
".",
"Pointer",
")",
"(",
"C",
".",
"cvGetSeqElem",
"(",
"(",
"*",
"C",
".",
"struct_CvSeq",
")",
"(",
"seq",
")",
",",
"C",
".",
"int",
"(",
"index",
")",
",",
")",
")",
"\n",
"}"
] |
4,145 | all-4146 | [
"OptIndexKeys",
"sets",
"whether",
"index",
"uses",
"string",
"keys",
"."
] | [
"func",
"OptIndexKeys",
"(",
"keys",
"bool",
")",
"IndexOption",
"{",
"return",
"func",
"(",
"options",
"*",
"IndexOptions",
")",
"{",
"options",
".",
"keys",
"=",
"<mask>",
"\n",
"options",
".",
"keysSet",
"=",
"true",
"\n",
"}",
"\n",
"}"
] |
4,146 | all-4147 | [
"applyENIHostname",
"adds",
"the",
"hostname",
"provided",
"by",
"the",
"ENI",
"message",
"to",
"the",
"container",
"s",
"docker",
"config",
".",
"At",
"the",
"time",
"of",
"implmentation",
"we",
"are",
"only",
"using",
"it",
"to",
"configure",
"the",
"pause",
"container",
"for",
"awsvpc",
"tasks"
] | [
"func",
"(",
"<mask>",
"*",
"Task",
")",
"applyENIHostname",
"(",
"dockerConfig",
"*",
"dockercontainer",
".",
"Config",
")",
"*",
"dockercontainer",
".",
"Config",
"{",
"eni",
":=",
"task",
".",
"GetTaskENI",
"(",
")",
"\n",
"if",
"eni",
"==",
"nil",
"{",
"return",
"dockerConfig",
"\n",
"}",
"\n\n",
"hostname",
":=",
"eni",
".",
"GetHostname",
"(",
")",
"\n",
"if",
"hostname",
"==",
"\"",
"\"",
"{",
"return",
"dockerConfig",
"\n",
"}",
"\n\n",
"dockerConfig",
".",
"Hostname",
"=",
"hostname",
"\n",
"return",
"dockerConfig",
"\n",
"}"
] |
4,147 | all-4148 | [
"Get",
"all",
"networks",
"matching",
"the",
"given",
"WHERE",
"filter",
"(",
"if",
"given",
")",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"networks",
"(",
"where",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"q",
":=",
"\"",
"\"",
"\n",
"inargs",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"}",
"\n\n",
"if",
"where",
"!=",
"\"",
"\"",
"{",
"q",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"where",
")",
"\n",
"for",
"_",
",",
"arg",
":=",
"range",
"args",
"{",
"inargs",
"=",
"append",
"(",
"inargs",
",",
"arg",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"var",
"<mask>",
"string",
"\n",
"outfmt",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"name",
"}",
"\n",
"result",
",",
"err",
":=",
"queryScan",
"(",
"c",
".",
"db",
",",
"q",
",",
"inargs",
",",
"outfmt",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"[",
"]",
"string",
"{",
"}",
",",
"err",
"\n",
"}",
"\n\n",
"response",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"_",
",",
"r",
":=",
"range",
"result",
"{",
"response",
"=",
"append",
"(",
"response",
",",
"r",
"[",
"0",
"]",
".",
"(",
"string",
")",
")",
"\n",
"}",
"\n\n",
"return",
"response",
",",
"nil",
"\n",
"}"
] |
4,148 | all-4149 | [
"GenerateFromPassword",
"returns",
"the",
"bcrypt",
"hash",
"of",
"the",
"password",
"at",
"the",
"given",
"cost",
".",
"If",
"the",
"cost",
"given",
"is",
"less",
"than",
"MinCost",
"the",
"cost",
"will",
"be",
"set",
"to",
"DefaultCost",
"instead",
".",
"Use",
"CompareHashAndPassword",
"as",
"defined",
"in",
"this",
"package",
"to",
"compare",
"the",
"returned",
"hashed",
"password",
"with",
"its",
"cleartext",
"version",
"."
] | [
"func",
"GenerateFromPassword",
"(",
"salt",
"[",
"]",
"byte",
",",
"password",
"[",
"]",
"byte",
",",
"cost",
"int",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"len",
"(",
"salt",
")",
"!=",
"maxSaltSize",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"maxSaltSize",
")",
"\n",
"}",
"\n",
"p",
",",
"err",
":=",
"newFromPassword",
"(",
"salt",
",",
"password",
",",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"p",
".",
"Hash",
"(",
")",
",",
"nil",
"\n",
"}"
] |
4,149 | all-4150 | [
"SendRequestArr",
"sends",
"a",
"JSON",
"-",
"RPC",
"request",
"through",
"the",
"connection",
"denoted",
"by",
"the",
"connection",
"ID",
"with",
"array",
"params",
"and",
"auto",
"generated",
"request",
"ID",
".",
"resHandler",
"is",
"called",
"when",
"a",
"response",
"is",
"returned",
"."
] | [
"func",
"(",
"s",
"*",
"Server",
")",
"SendRequestArr",
"(",
"connID",
"string",
",",
"<mask>",
"string",
",",
"resHandler",
"func",
"(",
"ctx",
"*",
"ResCtx",
")",
"error",
",",
"params",
"...",
"interface",
"{",
"}",
")",
"(",
"reqID",
"string",
",",
"err",
"error",
")",
"{",
"return",
"s",
".",
"SendRequest",
"(",
"connID",
",",
"method",
",",
"params",
",",
"resHandler",
")",
"\n",
"}"
] |
4,150 | all-4151 | [
"setPeerURLsHeader",
"reports",
"local",
"urls",
"for",
"peer",
"discovery"
] | [
"func",
"setPeerURLsHeader",
"(",
"req",
"*",
"http",
".",
"Request",
",",
"urls",
"types",
".",
"URLs",
")",
"{",
"if",
"urls",
"==",
"nil",
"{",
"// often not set in unit tests",
"return",
"\n",
"}",
"\n",
"peerURLs",
":=",
"<mask>",
"(",
"[",
"]",
"string",
",",
"urls",
".",
"Len",
"(",
")",
")",
"\n",
"for",
"i",
":=",
"range",
"urls",
"{",
"peerURLs",
"[",
"i",
"]",
"=",
"urls",
"[",
"i",
"]",
".",
"String",
"(",
")",
"\n",
"}",
"\n",
"req",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"peerURLs",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
] |
4,151 | all-4152 | [
"Logf",
"will",
"record",
"a",
"formatted",
"message",
"to",
"the",
"contained",
"debug",
"log"
] | [
"func",
"(",
"a",
"*",
"LoggerAdapter",
")",
"Logf",
"(",
"s",
"string",
",",
"v",
"...",
"<mask>",
"{",
"}",
")",
"{",
"a",
".",
"log",
".",
"Printf",
"(",
"s",
",",
"v",
"...",
")",
"\n",
"}"
] |
4,152 | all-4153 | [
"//////////////////",
"private",
"funcitons"
] | [
"func",
"(",
"gc",
"*",
"GraphicContext",
")",
"drawPaths",
"(",
"drawType",
"drawType",
",",
"paths",
"...",
"*",
"draw2d",
".",
"Path",
")",
"{",
"// create elements",
"svgPath",
":=",
"Path",
"{",
"}",
"\n",
"group",
":=",
"gc",
".",
"newGroup",
"(",
"drawType",
")",
"\n\n",
"// set attrs to path element",
"paths",
"=",
"append",
"(",
"paths",
",",
"gc",
".",
"Current",
".",
"Path",
")",
"\n",
"svgPathsDesc",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"paths",
")",
")",
"\n",
"// multiple pathes has to be joined to single svg path description",
"// because fill-rule wont work for whole group as excepted",
"for",
"i",
",",
"path",
":=",
"range",
"paths",
"{",
"svgPathsDesc",
"[",
"i",
"]",
"=",
"toSvgPathDesc",
"(",
"path",
")",
"\n",
"}",
"\n",
"svgPath",
".",
"Desc",
"=",
"strings",
".",
"Join",
"(",
"svgPathsDesc",
",",
"\"",
"\"",
")",
"\n\n",
"// attach to group",
"group",
".",
"Paths",
"=",
"[",
"]",
"*",
"<mask>",
"{",
"&",
"svgPath",
"}",
"\n",
"}"
] |
4,153 | all-4154 | [
"handleSingleMessage",
"processes",
"a",
"single",
"refresh",
"credentials",
"message",
"."
] | [
"func",
"(",
"refreshHandler",
"*",
"refreshCredentialsHandler",
")",
"handleSingleMessage",
"(",
"message",
"*",
"ecsacs",
".",
"IAMRoleCredentialsMessage",
")",
"error",
"{",
"// Validate fields in the message",
"err",
":=",
"validateIAMRoleCredentialsMessage",
"(",
"message",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"seelog",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"taskArn",
":=",
"aws",
".",
"StringValue",
"(",
"message",
".",
"TaskArn",
")",
"\n",
"messageId",
":=",
"aws",
".",
"StringValue",
"(",
"message",
".",
"MessageId",
")",
"\n",
"task",
",",
"<mask>",
":=",
"refreshHandler",
".",
"taskEngine",
".",
"GetTaskByArn",
"(",
"taskArn",
")",
"\n",
"if",
"!",
"ok",
"{",
"seelog",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"taskArn",
",",
"messageId",
")",
"\n",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"taskArn",
")",
"\n",
"}",
"\n\n",
"roleType",
":=",
"aws",
".",
"StringValue",
"(",
"message",
".",
"RoleType",
")",
"\n",
"if",
"!",
"validRoleType",
"(",
"roleType",
")",
"{",
"seelog",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"roleType",
",",
"taskArn",
",",
"messageId",
")",
"\n",
"}",
"else",
"{",
"err",
"=",
"refreshHandler",
".",
"credentialsManager",
".",
"SetTaskCredentials",
"(",
"&",
"(",
"credentials",
".",
"TaskIAMRoleCredentials",
"{",
"ARN",
":",
"taskArn",
",",
"IAMRoleCredentials",
":",
"credentials",
".",
"IAMRoleCredentialsFromACS",
"(",
"message",
".",
"RoleCredentials",
",",
"roleType",
")",
",",
"}",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"seelog",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
",",
"messageId",
")",
"\n",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"if",
"roleType",
"==",
"credentials",
".",
"ApplicationRoleType",
"{",
"task",
".",
"SetCredentialsID",
"(",
"aws",
".",
"StringValue",
"(",
"message",
".",
"RoleCredentials",
".",
"CredentialsId",
")",
")",
"\n",
"}",
"\n",
"if",
"roleType",
"==",
"credentials",
".",
"ExecutionRoleType",
"{",
"task",
".",
"SetExecutionRoleCredentialsID",
"(",
"aws",
".",
"StringValue",
"(",
"message",
".",
"RoleCredentials",
".",
"CredentialsId",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"go",
"func",
"(",
")",
"{",
"response",
":=",
"&",
"ecsacs",
".",
"IAMRoleCredentialsAckRequest",
"{",
"Expiration",
":",
"message",
".",
"RoleCredentials",
".",
"Expiration",
",",
"MessageId",
":",
"message",
".",
"MessageId",
",",
"CredentialsId",
":",
"message",
".",
"RoleCredentials",
".",
"CredentialsId",
",",
"}",
"\n",
"refreshHandler",
".",
"ackRequest",
"<-",
"response",
"\n",
"}",
"(",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
4,154 | all-4155 | [
"ArmForSwitch",
"returns",
"which",
"field",
"name",
"should",
"be",
"used",
"for",
"storing",
"the",
"value",
"for",
"an",
"instance",
"of",
"ManageDataResult"
] | [
"func",
"(",
"u",
"ManageDataResult",
")",
"ArmForSwitch",
"(",
"sw",
"int32",
")",
"(",
"string",
",",
"bool",
")",
"{",
"switch",
"ManageDataResultCode",
"(",
"sw",
")",
"{",
"<mask>",
"ManageDataResultCodeManageDataSuccess",
":",
"return",
"\"",
"\"",
",",
"true",
"\n",
"default",
":",
"return",
"\"",
"\"",
",",
"true",
"\n",
"}",
"\n",
"}"
] |
4,155 | all-4156 | [
"Step",
"1a",
"is",
"normalization",
"of",
"various",
"special",
"s",
"-",
"endings",
"."
] | [
"func",
"step1a",
"(",
"w",
"*",
"snowballword",
".",
"SnowballWord",
")",
"bool",
"{",
"suffix",
",",
"suffixRunes",
":=",
"w",
".",
"FirstSuffix",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"switch",
"suffix",
"{",
"case",
"\"",
"\"",
":",
"// Replace by ss",
"w",
".",
"ReplaceSuffixRunes",
"(",
"suffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"return",
"true",
"\n\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"// Replace by i if preceded by more than one letter,",
"// otherwise by ie (so ties -> tie, cries -> cri).",
"var",
"repl",
"string",
"\n",
"if",
"len",
"(",
"w",
".",
"RS",
")",
">",
"4",
"{",
"repl",
"=",
"\"",
"\"",
"\n",
"}",
"else",
"{",
"repl",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"w",
".",
"ReplaceSuffixRunes",
"(",
"suffixRunes",
",",
"[",
"]",
"rune",
"(",
"repl",
")",
",",
"true",
")",
"\n",
"return",
"true",
"\n\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"// Do nothing",
"return",
"false",
"\n\n",
"<mask>",
"\"",
"\"",
":",
"// Delete if the preceding word part contains a vowel",
"// not immediately before the s (so gas and this retain",
"// the s, gaps and kiwis lose it)",
"//",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"w",
".",
"RS",
")",
"-",
"2",
";",
"i",
"++",
"{",
"if",
"isLowerVowel",
"(",
"w",
".",
"RS",
"[",
"i",
"]",
")",
"{",
"w",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
] |
4,156 | all-4157 | [
"Addr",
"returns",
"binded",
"socket",
"address",
".",
"For",
"bind",
"port",
"0",
"in",
"tests"
] | [
"func",
"(",
"api",
"*",
"Api",
")",
"Addr",
"(",
")",
"<mask>",
".",
"Addr",
"{",
"if",
"api",
".",
"listener",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"api",
".",
"listener",
".",
"Addr",
"(",
")",
"\n",
"}"
] |
4,157 | all-4158 | [
"Do",
"executes",
"Debugger",
".",
"setPauseOnExceptions",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetPauseOnExceptionsParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetPauseOnExceptions",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
4,158 | all-4159 | [
"Closes",
"the",
"compressedResponseWriter",
"and",
"ensures",
"to",
"flush",
"all",
"data",
"before",
"."
] | [
"func",
"(",
"c",
"*",
"compressedResponseWriter",
")",
"Close",
"(",
")",
"{",
"if",
"zlibWriter",
",",
"ok",
":=",
"c",
".",
"writer",
".",
"(",
"*",
"zlib",
".",
"Writer",
")",
";",
"ok",
"{",
"zlibWriter",
".",
"Flush",
"(",
")",
"\n",
"}",
"\n",
"if",
"gzipWriter",
",",
"ok",
":=",
"c",
".",
"writer",
".",
"(",
"*",
"gzip",
".",
"Writer",
")",
";",
"<mask>",
"{",
"gzipWriter",
".",
"Flush",
"(",
")",
"\n",
"}",
"\n",
"if",
"closer",
",",
"ok",
":=",
"c",
".",
"writer",
".",
"(",
"io",
".",
"Closer",
")",
";",
"ok",
"{",
"defer",
"closer",
".",
"Close",
"(",
")",
"\n",
"}",
"\n",
"}"
] |
4,159 | all-4160 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GlobalLexicalScopeNamesReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime19",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
4,160 | all-4161 | [
"Increment",
"an",
"item",
"of",
"type",
"int",
"by",
"n",
".",
"Returns",
"an",
"error",
"if",
"the",
"item",
"s",
"value",
"is",
"not",
"an",
"int",
"or",
"if",
"it",
"was",
"not",
"found",
".",
"If",
"there",
"is",
"no",
"error",
"the",
"incremented",
"value",
"is",
"returned",
"."
] | [
"func",
"(",
"c",
"*",
"cache",
")",
"IncrementInt",
"(",
"k",
"string",
",",
"n",
"int",
")",
"(",
"int",
",",
"error",
")",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"v",
",",
"found",
":=",
"c",
".",
"items",
"[",
"k",
"]",
"\n",
"if",
"!",
"found",
"||",
"v",
".",
"Expired",
"(",
")",
"{",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"0",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"k",
")",
"\n",
"}",
"\n",
"rv",
",",
"ok",
":=",
"v",
".",
"Object",
".",
"(",
"int",
")",
"\n",
"if",
"!",
"ok",
"{",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"0",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"k",
")",
"\n",
"}",
"\n",
"nv",
":=",
"rv",
"+",
"n",
"\n",
"v",
".",
"<mask>",
"=",
"nv",
"\n",
"c",
".",
"items",
"[",
"k",
"]",
"=",
"v",
"\n",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"nv",
",",
"nil",
"\n",
"}"
] |
4,161 | all-4162 | [
"Stacktraces",
"for",
"all",
"goroutines",
"."
] | [
"func",
"stacks",
"(",
")",
"[",
"]",
"byte",
"{",
"buf",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"1024",
"*",
"16",
")",
"\n",
"for",
"{",
"n",
":=",
"runtime",
".",
"Stack",
"(",
"buf",
",",
"true",
")",
"\n",
"if",
"n",
"<",
"len",
"(",
"buf",
")",
"{",
"return",
"buf",
"[",
":",
"n",
"]",
"\n",
"}",
"\n",
"buf",
"=",
"<mask>",
"(",
"[",
"]",
"byte",
",",
"2",
"*",
"len",
"(",
"buf",
")",
")",
"\n",
"}",
"\n",
"}"
] |
4,162 | all-4163 | [
"GetKeyList",
"returns",
"the",
"list",
"of",
"all",
"keys",
"in",
"give",
"section",
"in",
"the",
"same",
"order",
"in",
"the",
"file",
".",
"It",
"returns",
"nil",
"if",
"given",
"section",
"does",
"not",
"exist",
"."
] | [
"func",
"(",
"c",
"*",
"ConfigFile",
")",
"GetKeyList",
"(",
"section",
"string",
")",
"[",
"]",
"string",
"{",
"// Blank section name represents DEFAULT section.",
"if",
"len",
"(",
"section",
")",
"==",
"0",
"{",
"section",
"=",
"DEFAULT_SECTION",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"BlockMode",
"{",
"c",
".",
"lock",
".",
"RLock",
"(",
")",
"\n",
"defer",
"c",
".",
"lock",
".",
"RUnlock",
"(",
")",
"\n",
"}",
"\n\n",
"// Check if section exists.",
"if",
"_",
",",
"ok",
":=",
"c",
".",
"data",
"[",
"section",
"]",
";",
"!",
"ok",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"// Non-default section has a blank key as section keeper.",
"list",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
",",
"len",
"(",
"c",
".",
"keyList",
"[",
"section",
"]",
")",
")",
"\n",
"for",
"_",
",",
"key",
":=",
"range",
"c",
".",
"keyList",
"[",
"section",
"]",
"{",
"if",
"key",
"!=",
"\"",
"\"",
"{",
"<mask>",
"=",
"append",
"(",
"list",
",",
"key",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"list",
"\n",
"}"
] |
4,163 | all-4164 | [
"prop",
"value",
"enum"
] | [
"func",
"(",
"m",
"*",
"Route",
")",
"validateFormatEnum",
"(",
"path",
",",
"<mask>",
"string",
",",
"value",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"err",
":=",
"validate",
".",
"Enum",
"(",
"path",
",",
"location",
",",
"value",
",",
"routeTypeFormatPropEnum",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
4,164 | all-4165 | [
"SetVisibleColumn",
"is",
"a",
"wrapper",
"around",
"gtk_tree_model_filter_set_visible_column",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TreeModelFilter",
")",
"SetVisibleColumn",
"(",
"column",
"int",
")",
"{",
"C",
".",
"gtk_tree_model_filter_set_visible_column",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
4,165 | all-4166 | [
"peek",
"peeks",
"at",
"the",
"next",
"event",
"in",
"the",
"event",
"stream",
"puts",
"the",
"results",
"into",
"p",
".",
"event",
"and",
"returns",
"the",
"event",
"type",
"."
] | [
"func",
"(",
"p",
"*",
"parser",
")",
"peek",
"(",
")",
"yaml_event_type_t",
"{",
"if",
"p",
".",
"event",
".",
"typ",
"!=",
"yaml_NO_EVENT",
"{",
"return",
"p",
".",
"event",
".",
"typ",
"\n",
"}",
"\n",
"if",
"!",
"yaml_parser_parse",
"(",
"&",
"p",
".",
"parser",
",",
"&",
"p",
".",
"<mask>",
")",
"{",
"p",
".",
"fail",
"(",
")",
"\n",
"}",
"\n",
"return",
"p",
".",
"event",
".",
"typ",
"\n",
"}"
] |
4,166 | all-4167 | [
"Enable",
"or",
"disable",
"a",
"generic",
"vertex",
"attribute",
"array"
] | [
"func",
"DisableVertexArrayAttrib",
"(",
"vaobj",
"uint32",
",",
"index",
"uint32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpDisableVertexArrayAttrib",
",",
"2",
",",
"uintptr",
"(",
"vaobj",
")",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"0",
")",
"\n",
"}"
] |
4,167 | all-4168 | [
"SendKeepAlive",
"sends",
"a",
"whitespace",
"keepalive",
"as",
"described",
"in",
"chapter",
"4",
".",
"6",
".",
"1",
"of",
"RFC6120",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"SendKeepAlive",
"(",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"return",
"fmt",
".",
"Fprintf",
"(",
"c",
".",
"<mask>",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
4,168 | all-4169 | [
"String",
"is",
"a",
"representation",
"of",
"gdk_rgba_to_string",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"RGBA",
")",
"<mask>",
"(",
")",
"string",
"{",
"return",
"C",
".",
"GoString",
"(",
"(",
"*",
"C",
".",
"char",
")",
"(",
"C",
".",
"gdk_rgba_to_string",
"(",
"v",
".",
"rgba",
")",
")",
")",
"\n",
"}"
] |
4,169 | all-4170 | [
"ConfigLoad",
"loads",
"a",
"new",
"Config",
"object",
"with",
"the",
"current",
"node",
"-",
"local",
"configuration",
"values",
"fetched",
"from",
"the",
"database",
".",
"An",
"optional",
"list",
"of",
"config",
"value",
"triggers",
"can",
"be",
"passed",
"each",
"config",
"key",
"must",
"have",
"at",
"most",
"one",
"trigger",
"."
] | [
"func",
"ConfigLoad",
"(",
"tx",
"*",
"db",
".",
"NodeTx",
")",
"(",
"*",
"Config",
",",
"error",
")",
"{",
"// Load current raw values from the database, any error is fatal.",
"values",
",",
"err",
":=",
"tx",
".",
"Config",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"m",
",",
"err",
":=",
"config",
".",
"SafeLoad",
"(",
"ConfigSchema",
",",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"return",
"&",
"Config",
"{",
"tx",
":",
"tx",
",",
"m",
":",
"m",
"}",
",",
"nil",
"\n",
"}"
] |
4,170 | all-4171 | [
"set",
"the",
"blend",
"color"
] | [
"func",
"BlendColor",
"(",
"red",
"float32",
",",
"green",
"float32",
",",
"blue",
"float32",
",",
"alpha",
"float32",
")",
"{",
"C",
".",
"glowBlendColor",
"(",
"gpBlendColor",
",",
"(",
"C",
".",
"GLfloat",
")",
"(",
"red",
")",
",",
"(",
"C",
".",
"GLfloat",
")",
"(",
"<mask>",
")",
",",
"(",
"C",
".",
"GLfloat",
")",
"(",
"blue",
")",
",",
"(",
"C",
".",
"GLfloat",
")",
"(",
"alpha",
")",
")",
"\n",
"}"
] |
4,171 | all-4172 | [
"JavaScript",
"renders",
"the",
"named",
"files",
"using",
"the",
"application",
"/",
"javascript",
"content",
"type",
"and",
"the",
"github",
".",
"com",
"/",
"gobuffalo",
"/",
"plush",
"package",
"for",
"templating",
".",
"If",
"more",
"than",
"1",
"file",
"is",
"provided",
"the",
"second",
"file",
"will",
"be",
"considered",
"a",
"layout",
"file",
"and",
"the",
"first",
"file",
"will",
"be",
"the",
"content",
"file",
"which",
"will",
"be",
"placed",
"into",
"the",
"layout",
"using",
"<%",
"=",
"yield",
"%",
">",
".",
"If",
"no",
"second",
"file",
"is",
"provided",
"and",
"an",
"JavaScriptLayout",
"is",
"specified",
"in",
"the",
"options",
"then",
"that",
"layout",
"file",
"will",
"be",
"used",
"automatically",
"."
] | [
"func",
"(",
"e",
"*",
"Engine",
")",
"JavaScript",
"(",
"names",
"...",
"string",
")",
"Renderer",
"{",
"if",
"e",
".",
"JavaScriptLayout",
"!=",
"\"",
"\"",
"&&",
"len",
"(",
"names",
")",
"==",
"1",
"{",
"names",
"=",
"append",
"(",
"names",
",",
"e",
".",
"JavaScriptLayout",
")",
"\n",
"}",
"\n",
"hr",
":=",
"&",
"templateRenderer",
"{",
"Engine",
":",
"e",
",",
"contentType",
":",
"\"",
"\"",
",",
"<mask>",
":",
"names",
",",
"}",
"\n",
"return",
"hr",
"\n",
"}"
] |
4,172 | all-4173 | [
"NewRouters",
"initailizes",
"Routers",
"instance",
"."
] | [
"func",
"NewRouters",
"(",
")",
"*",
"Routers",
"{",
"return",
"&",
"Routers",
"{",
"s",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"struct",
"{",
"r",
"router",
".",
"Router",
"\n",
"v",
"<mask>",
".",
"View",
"\n",
"h",
"HandlerFunc",
"\n",
"}",
")",
",",
"l",
":",
"list",
".",
"New",
"(",
")",
",",
"}",
"\n",
"}"
] |
4,173 | all-4174 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventLayerPainted",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoLayertree16",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
4,174 | all-4175 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"RemoveBindingParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime8",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
4,175 | all-4176 | [
"CredentialsHandler",
"creates",
"response",
"for",
"the",
"v2",
"/",
"credentials",
"API",
"."
] | [
"func",
"CredentialsHandler",
"(",
"credentialsManager",
"credentials",
".",
"Manager",
",",
"auditLogger",
"audit",
".",
"AuditLogger",
")",
"func",
"(",
"http",
".",
"ResponseWriter",
",",
"*",
"http",
".",
"Request",
")",
"{",
"return",
"func",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"<mask>",
".",
"Request",
")",
"{",
"credentialsID",
":=",
"getCredentialsID",
"(",
"r",
")",
"\n",
"errPrefix",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"apiVersion",
")",
"\n",
"v1",
".",
"CredentialsHandlerImpl",
"(",
"w",
",",
"r",
",",
"auditLogger",
",",
"credentialsManager",
",",
"credentialsID",
",",
"errPrefix",
")",
"\n",
"}",
"\n",
"}"
] |
4,176 | all-4177 | [
"Remove",
"indicates",
"an",
"expected",
"call",
"of",
"Remove"
] | [
"func",
"(",
"mr",
"*",
"MockFileSystemMockRecorder",
")",
"Remove",
"(",
"arg0",
"<mask>",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockFileSystem",
")",
"(",
"nil",
")",
".",
"Remove",
")",
",",
"arg0",
")",
"\n",
"}"
] |
4,177 | all-4178 | [
"CreateOutlierReport",
"creates",
"a",
"new",
"outlier",
"report",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"CreateOutlierReport",
"(",
"cfg",
"*",
"OutlierReport",
")",
"(",
"*",
"OutlierReport",
",",
"error",
")",
"{",
"if",
"cfg",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"jsonCfg",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"cfg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"a",
".",
"Debug",
"{",
"a",
".",
"Log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"string",
"(",
"jsonCfg",
")",
")",
"\n",
"}",
"\n\n",
"<mask>",
",",
"err",
":=",
"a",
".",
"Post",
"(",
"config",
".",
"OutlierReportPrefix",
",",
"jsonCfg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"report",
":=",
"&",
"OutlierReport",
"{",
"}",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"result",
",",
"report",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"report",
",",
"nil",
"\n",
"}"
] |
4,178 | all-4179 | [
"IsInTLDMap",
"checks",
"that",
"a",
"label",
"is",
"present",
"in",
"the",
"TLD",
"map",
".",
"It",
"does",
"not",
"consider",
"the",
"TLD",
"s",
"validity",
"period",
"and",
"whether",
"the",
"TLD",
"may",
"have",
"been",
"removed",
"only",
"whether",
"it",
"was",
"ever",
"a",
"TLD",
"that",
"was",
"delegated",
"."
] | [
"func",
"IsInTLDMap",
"(",
"label",
"string",
")",
"bool",
"{",
"label",
"=",
"strings",
".",
"ToLower",
"(",
"label",
")",
"\n",
"if",
"_",
",",
"ok",
":=",
"tldMap",
"[",
"label",
"]",
";",
"<mask>",
"{",
"return",
"true",
"\n",
"}",
"else",
"{",
"return",
"false",
"\n",
"}",
"\n",
"}"
] |
4,179 | all-4180 | [
"fixUnquotedSpecials",
"as",
"defined",
"in",
"RFC",
"2045",
"section",
"5",
".",
"1",
":",
"https",
":",
"//",
"tools",
".",
"ietf",
".",
"org",
"/",
"html",
"/",
"rfc2045#section",
"-",
"5",
".",
"1"
] | [
"func",
"fixUnquotedSpecials",
"(",
"s",
"string",
")",
"string",
"{",
"idx",
":=",
"strings",
".",
"IndexByte",
"(",
"s",
",",
"';'",
")",
"\n",
"if",
"idx",
"<",
"0",
"||",
"idx",
"==",
"len",
"(",
"s",
")",
"{",
"// No parameters",
"return",
"s",
"\n",
"}",
"\n\n",
"clean",
":=",
"strings",
".",
"Builder",
"{",
"}",
"\n",
"clean",
".",
"WriteString",
"(",
"s",
"[",
":",
"idx",
"+",
"1",
"]",
")",
"\n",
"s",
"=",
"s",
"[",
"idx",
"+",
"1",
":",
"]",
"\n\n",
"for",
"len",
"(",
"s",
")",
">",
"0",
"{",
"var",
"consumed",
"string",
"\n",
"consumed",
",",
"s",
"=",
"consumeParam",
"(",
"s",
")",
"\n\n",
"if",
"len",
"(",
"consumed",
")",
"==",
"0",
"{",
"<mask>",
".",
"WriteString",
"(",
"s",
")",
"\n",
"return",
"clean",
".",
"String",
"(",
")",
"\n",
"}",
"\n\n",
"clean",
".",
"WriteString",
"(",
"consumed",
")",
"\n",
"}",
"\n\n",
"return",
"clean",
".",
"String",
"(",
")",
"\n",
"}"
] |
4,180 | all-4181 | [
"OutgoingContextWithKey",
"returns",
"an",
"outgoing",
"context",
"with",
"the",
"key"
] | [
"func",
"OutgoingContextWithKey",
"(",
"ctx",
"context",
".",
"<mask>",
",",
"key",
"string",
")",
"context",
".",
"Context",
"{",
"return",
"outgoingContextWithMergedMetadata",
"(",
"ctx",
",",
"\"",
"\"",
",",
"key",
")",
"\n",
"}"
] |
4,181 | all-4182 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetTargetsParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget7",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
4,182 | all-4183 | [
"OffHandler",
"can",
"be",
"used",
"in",
"JSON",
"-",
"encoded",
"HTTP",
"API",
"to",
"disable",
"maintenance",
"."
] | [
"func",
"(",
"s",
"Service",
")",
"OffHandler",
"(",
"w",
"<mask>",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"changed",
",",
"err",
":=",
"s",
".",
"store",
".",
"Off",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"s",
".",
"logger",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"jsonInternalServerErrorResponse",
"(",
"w",
")",
"\n",
"return",
"\n",
"}",
"\n",
"if",
"changed",
"{",
"s",
".",
"logger",
".",
"Infof",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"jsonOKResponse",
"(",
"w",
")",
"\n",
"}"
] |
4,183 | all-4184 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"RequestPattern",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoFetch2",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
4,184 | all-4185 | [
"doRequest",
"executes",
"a",
"request",
"with",
"the",
"provided",
"method",
"and",
"path",
"exactly",
"once",
".",
"It",
"sets",
"up",
"authentication",
"if",
"the",
"jenkins",
"client",
"is",
"configured",
"accordingly",
".",
"It",
"s",
"up",
"to",
"callers",
"of",
"this",
"function",
"to",
"build",
"retries",
"and",
"error",
"handling",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"doRequest",
"(",
"method",
",",
"path",
"string",
")",
"(",
"*",
"<mask>",
".",
"Response",
",",
"error",
")",
"{",
"req",
",",
"err",
":=",
"http",
".",
"NewRequest",
"(",
"method",
",",
"path",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"c",
".",
"authConfig",
"!=",
"nil",
"{",
"if",
"c",
".",
"authConfig",
".",
"Basic",
"!=",
"nil",
"{",
"req",
".",
"SetBasicAuth",
"(",
"c",
".",
"authConfig",
".",
"Basic",
".",
"User",
",",
"string",
"(",
"c",
".",
"authConfig",
".",
"Basic",
".",
"GetToken",
"(",
")",
")",
")",
"\n",
"}",
"\n",
"if",
"c",
".",
"authConfig",
".",
"BearerToken",
"!=",
"nil",
"{",
"req",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"c",
".",
"authConfig",
".",
"BearerToken",
".",
"GetToken",
"(",
")",
")",
")",
"\n",
"}",
"\n",
"if",
"c",
".",
"authConfig",
".",
"CSRFProtect",
"&&",
"c",
".",
"authConfig",
".",
"csrfRequestField",
"!=",
"\"",
"\"",
"&&",
"c",
".",
"authConfig",
".",
"csrfToken",
"!=",
"\"",
"\"",
"{",
"req",
".",
"Header",
".",
"Set",
"(",
"c",
".",
"authConfig",
".",
"csrfRequestField",
",",
"c",
".",
"authConfig",
".",
"csrfToken",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"c",
".",
"client",
".",
"Do",
"(",
"req",
")",
"\n",
"}"
] |
4,185 | all-4186 | [
"RowActivated",
"is",
"a",
"wrapper",
"around",
"gtk_tree_view_row_activated",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TreeView",
")",
"RowActivated",
"(",
"<mask>",
"*",
"TreePath",
",",
"column",
"*",
"TreeViewColumn",
")",
"{",
"C",
".",
"gtk_tree_view_row_activated",
"(",
"v",
".",
"native",
"(",
")",
",",
"path",
".",
"native",
"(",
")",
",",
"column",
".",
"native",
"(",
")",
")",
"\n",
"}"
] |
4,186 | all-4187 | [
"Decode",
"verifies",
"decrypts",
"and",
"decompresses",
"given",
"JWT",
"token",
"using",
"management",
"key",
".",
"Management",
"key",
"is",
"of",
"different",
"type",
"for",
"different",
"key",
"management",
"or",
"signing",
"algorithms",
"see",
"specific",
"alg",
"implementation",
"documentation",
".",
"Returns",
"decoded",
"payload",
"as",
"a",
"raw",
"bytes",
"headers",
"and",
"not",
"nil",
"error",
"if",
"something",
"went",
"wrong",
"."
] | [
"func",
"DecodeBytes",
"(",
"token",
"string",
",",
"key",
"interface",
"{",
"}",
")",
"(",
"[",
"]",
"byte",
",",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"parts",
",",
"err",
":=",
"compact",
".",
"Parse",
"(",
"token",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"parts",
")",
"==",
"3",
"{",
"return",
"verify",
"(",
"parts",
",",
"key",
")",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"parts",
")",
"==",
"5",
"{",
"return",
"decrypt",
"(",
"parts",
",",
"<mask>",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
",",
"nil",
",",
"errors",
".",
"New",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"len",
"(",
"parts",
")",
")",
")",
"\n",
"}"
] |
4,187 | all-4188 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"Header",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage6",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
4,188 | all-4189 | [
"validateRequiredVersion",
"validates",
"docker",
"version",
".",
"Minimum",
"docker",
"version",
"supported",
"is",
"1",
".",
"9",
".",
"0",
"maps",
"to",
"api",
"version",
"1",
".",
"21",
"see",
"https",
":",
"//",
"docs",
".",
"docker",
".",
"com",
"/",
"develop",
"/",
"sdk",
"/",
"#api",
"-",
"version",
"-",
"matrix"
] | [
"func",
"(",
"agent",
"*",
"ecsAgent",
")",
"verifyRequiredDockerVersion",
"(",
")",
"(",
"int",
",",
"bool",
")",
"{",
"supportedVersions",
":=",
"agent",
".",
"dockerClient",
".",
"SupportedVersions",
"(",
")",
"\n",
"if",
"len",
"(",
"supportedVersions",
")",
"==",
"0",
"{",
"seelog",
".",
"Critical",
"(",
"\"",
"\"",
")",
"\n",
"return",
"exitcodes",
".",
"ExitError",
",",
"false",
"\n",
"}",
"\n\n",
"// if api version 1.21 is supported, it means docker version is at least 1.9.0",
"for",
"_",
",",
"version",
":=",
"range",
"supportedVersions",
"{",
"if",
"<mask>",
"==",
"dockerclient",
".",
"Version_1_21",
"{",
"return",
"-",
"1",
",",
"true",
"\n",
"}",
"\n",
"}",
"\n\n",
"// api 1.21 is not supported, docker version is older than 1.9.0",
"seelog",
".",
"Criticalf",
"(",
"\"",
"\"",
",",
"dockerclient",
".",
"Version_1_21",
")",
"\n",
"return",
"exitcodes",
".",
"ExitTerminal",
",",
"false",
"\n",
"}"
] |
4,189 | all-4190 | [
"NewEdit",
"is",
"the",
"Edit",
"initializer",
".",
"This",
"call",
"implements",
"the",
"NewWidget",
"convention",
"by",
"taking",
"a",
"*",
"Window",
"and",
"and",
"an",
"anchor",
"point",
"to",
"render",
"the",
"widget",
"."
] | [
"func",
"NewEdit",
"(",
"w",
"*",
"Window",
",",
"x",
",",
"y",
"int",
")",
"(",
"Widgeter",
",",
"<mask>",
")",
"{",
"return",
"&",
"Edit",
"{",
"Widget",
":",
"MakeWidget",
"(",
"w",
",",
"x",
",",
"y",
")",
",",
"}",
",",
"nil",
"\n",
"}"
] |
4,190 | all-4191 | [
"Do",
"executes",
"CacheStorage",
".",
"deleteEntry",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"DeleteEntryParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandDeleteEntry",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
4,191 | all-4192 | [
"ServeConn",
"serves",
"HTTP",
"requests",
"from",
"the",
"given",
"connection",
"using",
"the",
"given",
"handler",
".",
"ServeConn",
"returns",
"nil",
"if",
"all",
"requests",
"from",
"the",
"c",
"are",
"successfully",
"served",
".",
"It",
"returns",
"non",
"-",
"nil",
"error",
"otherwise",
".",
"Connection",
"c",
"must",
"immediately",
"propagate",
"all",
"the",
"data",
"passed",
"to",
"Write",
"()",
"to",
"the",
"client",
".",
"Otherwise",
"requests",
"processing",
"may",
"hang",
".",
"ServeConn",
"closes",
"c",
"before",
"returning",
"."
] | [
"func",
"ServeConn",
"(",
"c",
"net",
".",
"Conn",
",",
"handler",
"RequestHandler",
")",
"error",
"{",
"v",
":=",
"serverPool",
".",
"Get",
"(",
")",
"\n",
"if",
"v",
"==",
"nil",
"{",
"v",
"=",
"&",
"<mask>",
"{",
"}",
"\n",
"}",
"\n",
"s",
":=",
"v",
".",
"(",
"*",
"Server",
")",
"\n",
"s",
".",
"Handler",
"=",
"handler",
"\n",
"err",
":=",
"s",
".",
"ServeConn",
"(",
"c",
")",
"\n",
"s",
".",
"Handler",
"=",
"nil",
"\n",
"serverPool",
".",
"Put",
"(",
"v",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
4,192 | all-4193 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"StartTrackingHeapObjectsParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler4",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
4,193 | all-4194 | [
"DrawImage",
"draws",
"an",
"image",
"into",
"dest",
"using",
"an",
"affine",
"transformation",
"matrix",
"an",
"op",
"and",
"a",
"filter"
] | [
"func",
"DrawImage",
"(",
"src",
"image",
".",
"Image",
",",
"dest",
"draw",
".",
"<mask>",
",",
"tr",
"draw2d",
".",
"Matrix",
",",
"op",
"draw",
".",
"Op",
",",
"filter",
"ImageFilter",
")",
"{",
"var",
"transformer",
"draw",
".",
"Transformer",
"\n",
"switch",
"filter",
"{",
"case",
"LinearFilter",
":",
"transformer",
"=",
"draw",
".",
"NearestNeighbor",
"\n",
"case",
"BilinearFilter",
":",
"transformer",
"=",
"draw",
".",
"BiLinear",
"\n",
"case",
"BicubicFilter",
":",
"transformer",
"=",
"draw",
".",
"CatmullRom",
"\n",
"}",
"\n",
"transformer",
".",
"Transform",
"(",
"dest",
",",
"f64",
".",
"Aff3",
"{",
"tr",
"[",
"0",
"]",
",",
"tr",
"[",
"1",
"]",
",",
"tr",
"[",
"4",
"]",
",",
"tr",
"[",
"2",
"]",
",",
"tr",
"[",
"3",
"]",
",",
"tr",
"[",
"5",
"]",
"}",
",",
"src",
",",
"src",
".",
"Bounds",
"(",
")",
",",
"op",
",",
"nil",
")",
"\n",
"}"
] |
4,194 | all-4195 | [
"NewRClient",
"creates",
"a",
"RClient",
"which",
"will",
"run",
"commands",
"on",
"the",
"RServe",
"server",
"located",
"at",
"the",
"provided",
"host",
"and",
"port"
] | [
"func",
"NewRClient",
"(",
"host",
"string",
",",
"<mask>",
"int64",
")",
"(",
"RClient",
",",
"error",
")",
"{",
"return",
"NewRClientWithAuth",
"(",
"host",
",",
"port",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
4,195 | all-4196 | [
"cephOSDPoolExists",
"checks",
"whether",
"a",
"given",
"OSD",
"pool",
"exists",
"."
] | [
"func",
"cephOSDPoolExists",
"(",
"ClusterName",
"string",
",",
"poolName",
"string",
",",
"userName",
"string",
")",
"bool",
"{",
"_",
",",
"err",
":=",
"shared",
".",
"RunCommand",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"userName",
")",
",",
"\"",
"\"",
",",
"ClusterName",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"poolName",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
4,196 | all-4197 | [
"NewMetadataWriter",
"creates",
"a",
"new",
"writer",
"that",
"generates",
"metadata",
"data",
"structures",
"."
] | [
"func",
"NewMetadataWriter",
"(",
")",
"(",
"*",
"MetadataWriter",
",",
"error",
")",
"{",
"funcMap",
":=",
"template",
".",
"FuncMap",
"{",
"\"",
"\"",
":",
"comment",
",",
"\"",
"\"",
":",
"strings",
".",
"Join",
",",
"\"",
"\"",
":",
"commandLine",
",",
"\"",
"\"",
":",
"toStringArray",
",",
"\"",
"\"",
":",
"flagType",
",",
"\"",
"\"",
":",
"<mask>",
",",
"\"",
"\"",
":",
"escapeBackticks",
",",
"}",
"\n",
"headerT",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"",
"\"",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"Parse",
"(",
"headerMetadataTmpl",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"resourceT",
",",
"err",
":=",
"template",
".",
"New",
"(",
"\"",
"\"",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"Parse",
"(",
"resourceMetadataTmpl",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"&",
"MetadataWriter",
"{",
"headerTmpl",
":",
"headerT",
",",
"resourceTmpl",
":",
"resourceT",
",",
"}",
",",
"nil",
"\n",
"}"
] |
4,197 | all-4198 | [
"Do",
"executes",
"DOM",
".",
"querySelectorAll",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"nodeIds",
"-",
"Query",
"selector",
"result",
"."
] | [
"func",
"(",
"p",
"*",
"QuerySelectorAllParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"nodeIds",
"[",
"]",
"cdp",
".",
"NodeID",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"<mask>",
"QuerySelectorAllReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandQuerySelectorAll",
",",
"p",
",",
"&",
"res",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"res",
".",
"NodeIds",
",",
"nil",
"\n",
"}"
] |
4,198 | all-4199 | [
"ProjectUsedByRef",
"returns",
"entities",
"used",
"by",
"projects",
"."
] | [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"ProjectUsedByRef",
"(",
"filter",
"ProjectFilter",
")",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
",",
"error",
")",
"{",
"// Result slice.",
"objects",
":=",
"make",
"(",
"[",
"]",
"struct",
"{",
"Name",
"string",
"\n",
"Value",
"string",
"\n",
"}",
",",
"0",
")",
"\n\n",
"// Check which filter criteria are active.",
"criteria",
":=",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"}",
"\n",
"if",
"filter",
".",
"Name",
"!=",
"\"",
"\"",
"{",
"criteria",
"[",
"\"",
"\"",
"]",
"=",
"filter",
".",
"Name",
"\n",
"}",
"\n\n",
"// Pick the prepared statement and arguments to use based on active criteria.",
"var",
"stmt",
"*",
"sql",
".",
"Stmt",
"\n",
"var",
"args",
"[",
"]",
"interface",
"{",
"}",
"\n\n",
"if",
"criteria",
"[",
"\"",
"\"",
"]",
"!=",
"nil",
"{",
"stmt",
"=",
"c",
".",
"stmt",
"(",
"projectUsedByRefByName",
")",
"\n",
"args",
"=",
"[",
"]",
"interface",
"{",
"}",
"{",
"filter",
".",
"Name",
",",
"}",
"\n",
"}",
"else",
"{",
"stmt",
"=",
"c",
".",
"stmt",
"(",
"projectUsedByRef",
")",
"\n",
"args",
"=",
"[",
"]",
"interface",
"{",
"}",
"{",
"}",
"\n",
"}",
"\n\n",
"// Dest function for scanning a row.",
"dest",
":=",
"func",
"(",
"i",
"int",
")",
"[",
"]",
"interface",
"{",
"}",
"{",
"objects",
"=",
"append",
"(",
"objects",
",",
"struct",
"{",
"Name",
"string",
"\n",
"Value",
"string",
"\n",
"}",
"{",
"}",
")",
"\n",
"return",
"[",
"]",
"interface",
"{",
"}",
"{",
"&",
"objects",
"[",
"i",
"]",
".",
"Name",
",",
"&",
"objects",
"[",
"i",
"]",
".",
"Value",
",",
"}",
"\n",
"}",
"\n\n",
"// Select.",
"err",
":=",
"query",
".",
"SelectObjects",
"(",
"stmt",
",",
"dest",
",",
"args",
"...",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// Build index by primary name.",
"index",
":=",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
"{",
"}",
"\n\n",
"for",
"_",
",",
"object",
":=",
"range",
"objects",
"{",
"item",
",",
"ok",
":=",
"index",
"[",
"object",
".",
"Name",
"]",
"\n",
"if",
"!",
"ok",
"{",
"item",
"=",
"[",
"]",
"string",
"{",
"}",
"\n",
"}",
"\n\n",
"<mask>",
"[",
"object",
".",
"Name",
"]",
"=",
"append",
"(",
"item",
",",
"object",
".",
"Value",
")",
"\n",
"}",
"\n\n",
"return",
"index",
",",
"nil",
"\n",
"}"
] |
4,199 | all-4200 | [
"Value",
"converts",
"a",
"value",
"to",
"a",
"database",
"driver",
"value"
] | [
"func",
"(",
"u",
"UUID5",
")",
"Value",
"(",
")",
"(",
"<mask>",
".",
"Value",
",",
"error",
")",
"{",
"return",
"driver",
".",
"Value",
"(",
"string",
"(",
"u",
")",
")",
",",
"nil",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.