id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
listlengths 1
418
| pl_tokens
listlengths 22
4.98k
|
---|---|---|---|
14,600 | all-14601 | [
"BuildFromSpec",
"triggers",
"a",
"Jenkins",
"build",
"for",
"the",
"provided",
"ProwJobSpec",
".",
"prowJobID",
"helps",
"us",
"track",
"the",
"build",
"before",
"it",
"s",
"scheduled",
"by",
"Jenkins",
"."
]
| [
"func",
"(",
"c",
"*",
"Client",
")",
"BuildFromSpec",
"(",
"spec",
"*",
"prowapi",
".",
"ProwJobSpec",
",",
"buildID",
",",
"prowJobID",
"string",
")",
"error",
"{",
"if",
"c",
".",
"dryRun",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"env",
",",
"err",
":=",
"downwardapi",
".",
"EnvForSpec",
"(",
"downwardapi",
".",
"NewJobSpec",
"(",
"*",
"spec",
",",
"buildID",
",",
"prowJobID",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"params",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"for",
"key",
",",
"value",
":=",
"range",
"env",
"{",
"params",
".",
"<mask>",
"(",
"key",
",",
"value",
")",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"c",
".",
"EnsureBuildableJob",
"(",
"spec",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"spec",
".",
"Job",
",",
"err",
")",
"\n",
"}",
"\n\n",
"return",
"c",
".",
"LaunchBuild",
"(",
"spec",
",",
"params",
")",
"\n",
"}"
]
|
14,601 | all-14602 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
]
| [
"func",
"(",
"v",
"*",
"SetScriptSourceReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDebugger5",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
]
|
14,602 | all-14603 | [
"AddWeighted",
"calculates",
"the",
"weighted",
"sum",
"of",
"two",
"images",
"."
]
| [
"func",
"AddWeighted",
"(",
"src1",
"*",
"IplImage",
",",
"alpha",
"float64",
",",
"src2",
"*",
"IplImage",
",",
"<mask>",
"float64",
",",
"gamma",
"float64",
",",
"dst",
"*",
"IplImage",
")",
"{",
"C",
".",
"cvAddWeighted",
"(",
"unsafe",
".",
"Pointer",
"(",
"src1",
")",
",",
"C",
".",
"double",
"(",
"alpha",
")",
",",
"unsafe",
".",
"Pointer",
"(",
"src2",
")",
",",
"C",
".",
"double",
"(",
"beta",
")",
",",
"C",
".",
"double",
"(",
"gamma",
")",
",",
"unsafe",
".",
"Pointer",
"(",
"dst",
")",
",",
")",
"\n",
"}"
]
|
14,603 | all-14604 | [
"Format",
"implements",
"logrus",
".",
"Formatter",
"s",
"Format",
".",
"We",
"allocate",
"a",
"new",
"Fields",
"map",
"in",
"order",
"to",
"not",
"modify",
"the",
"caller",
"s",
"Entry",
"as",
"that",
"is",
"not",
"a",
"thread",
"safe",
"operation",
"."
]
| [
"func",
"(",
"d",
"*",
"DefaultFieldsFormatter",
")",
"Format",
"(",
"entry",
"*",
"logrus",
".",
"Entry",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"data",
":=",
"<mask>",
"(",
"logrus",
".",
"Fields",
",",
"len",
"(",
"entry",
".",
"Data",
")",
"+",
"len",
"(",
"d",
".",
"DefaultFields",
")",
")",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"d",
".",
"DefaultFields",
"{",
"data",
"[",
"k",
"]",
"=",
"v",
"\n",
"}",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"entry",
".",
"Data",
"{",
"data",
"[",
"k",
"]",
"=",
"v",
"\n",
"}",
"\n",
"return",
"d",
".",
"WrappedFormatter",
".",
"Format",
"(",
"&",
"logrus",
".",
"Entry",
"{",
"Logger",
":",
"entry",
".",
"Logger",
",",
"Data",
":",
"data",
",",
"Time",
":",
"entry",
".",
"Time",
",",
"Level",
":",
"entry",
".",
"Level",
",",
"Message",
":",
"entry",
".",
"Message",
",",
"}",
")",
"\n",
"}"
]
|
14,604 | all-14605 | [
"AppendIPv4",
"appends",
"string",
"representation",
"of",
"the",
"given",
"ip",
"v4",
"to",
"dst",
"and",
"returns",
"the",
"extended",
"dst",
"."
]
| [
"func",
"AppendIPv4",
"(",
"dst",
"[",
"]",
"byte",
",",
"ip",
"net",
".",
"IP",
")",
"[",
"]",
"byte",
"{",
"ip",
"=",
"<mask>",
".",
"To4",
"(",
")",
"\n",
"if",
"ip",
"==",
"nil",
"{",
"return",
"append",
"(",
"dst",
",",
"\"",
"\"",
"...",
")",
"\n",
"}",
"\n\n",
"dst",
"=",
"AppendUint",
"(",
"dst",
",",
"int",
"(",
"ip",
"[",
"0",
"]",
")",
")",
"\n",
"for",
"i",
":=",
"1",
";",
"i",
"<",
"4",
";",
"i",
"++",
"{",
"dst",
"=",
"append",
"(",
"dst",
",",
"'.'",
")",
"\n",
"dst",
"=",
"AppendUint",
"(",
"dst",
",",
"int",
"(",
"ip",
"[",
"i",
"]",
")",
")",
"\n",
"}",
"\n",
"return",
"dst",
"\n",
"}"
]
|
14,605 | all-14606 | [
"/",
"*",
"PatchAppsAppRoutesRoute",
"updates",
"a",
"route"
]
| [
"func",
"(",
"a",
"*",
"Client",
")",
"PatchAppsAppRoutesRoute",
"(",
"params",
"*",
"PatchAppsAppRoutesRouteParams",
")",
"(",
"*",
"PatchAppsAppRoutesRouteOK",
",",
"error",
")",
"{",
"// TODO: Validate the params before sending",
"if",
"params",
"==",
"nil",
"{",
"params",
"=",
"NewPatchAppsAppRoutesRouteParams",
"(",
")",
"\n",
"}",
"\n\n",
"result",
",",
"err",
":=",
"a",
".",
"transport",
".",
"Submit",
"(",
"&",
"runtime",
".",
"ClientOperation",
"{",
"<mask>",
":",
"\"",
"\"",
",",
"Method",
":",
"\"",
"\"",
",",
"PathPattern",
":",
"\"",
"\"",
",",
"ProducesMediaTypes",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
"ConsumesMediaTypes",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
"Schemes",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
"}",
",",
"Params",
":",
"params",
",",
"Reader",
":",
"&",
"PatchAppsAppRoutesRouteReader",
"{",
"formats",
":",
"a",
".",
"formats",
"}",
",",
"Context",
":",
"params",
".",
"Context",
",",
"Client",
":",
"params",
".",
"HTTPClient",
",",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"result",
".",
"(",
"*",
"PatchAppsAppRoutesRouteOK",
")",
",",
"nil",
"\n\n",
"}"
]
|
14,606 | all-14607 | [
"HasShowLatency",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"t",
"*",
"TraceServiceDefinition",
")",
"HasShowLatency",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"ShowLatency",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
]
|
14,607 | all-14608 | [
"FindClientAPIVersion",
"returns",
"the",
"version",
"of",
"the",
"client",
"from",
"the",
"map"
]
| [
"func",
"(",
"f",
"*",
"factory",
")",
"FindClientAPIVersion",
"(",
"client",
"sdkclient",
".",
"<mask>",
")",
"dockerclient",
".",
"DockerVersion",
"{",
"return",
"dockerclient",
".",
"DockerVersion",
"(",
"client",
".",
"ClientVersion",
"(",
")",
")",
"\n",
"}"
]
|
14,608 | all-14609 | [
"cephRBDVolumeCopy",
"copies",
"an",
"RBD",
"storage",
"volume",
"This",
"is",
"a",
"non",
"-",
"sparse",
"copy",
"which",
"doesn",
"t",
"introduce",
"any",
"dependency",
"relationship",
"between",
"the",
"source",
"RBD",
"storage",
"volume",
"and",
"the",
"target",
"RBD",
"storage",
"volume",
".",
"The",
"operations",
"is",
"similar",
"to",
"creating",
"an",
"empty",
"RBD",
"storage",
"volume",
"and",
"rsyncing",
"the",
"contents",
"of",
"the",
"source",
"RBD",
"storage",
"volume",
"into",
"it",
"."
]
| [
"func",
"cephRBDVolumeCopy",
"(",
"clusterName",
"string",
",",
"oldVolumeName",
"string",
",",
"newVolumeName",
"string",
",",
"userName",
"string",
")",
"error",
"{",
"_",
",",
"err",
":=",
"<mask>",
".",
"RunCommand",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"userName",
",",
"\"",
"\"",
",",
"clusterName",
",",
"\"",
"\"",
",",
"oldVolumeName",
",",
"newVolumeName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
]
|
14,609 | all-14610 | [
"HasAggregator",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"q",
"*",
"QueryValueRequest",
")",
"HasAggregator",
"(",
")",
"bool",
"{",
"if",
"q",
"!=",
"nil",
"&&",
"q",
".",
"Aggregator",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
]
|
14,610 | all-14611 | [
"Parse",
"reads",
"the",
"given",
"io",
".",
"Reader",
"and",
"returns",
"a",
"parsed",
"Config",
"object",
"."
]
| [
"func",
"Parse",
"(",
"stream",
"io",
".",
"Reader",
")",
"Config",
"{",
"var",
"cfg",
"Config",
"\n",
"var",
"curSection",
"string",
"\n\n",
"scanner",
":=",
"bufio",
".",
"NewScanner",
"(",
"bufio",
".",
"NewReader",
"(",
"stream",
")",
")",
"\n",
"for",
"scanner",
".",
"Scan",
"(",
")",
"{",
"line",
":=",
"strings",
".",
"TrimSpace",
"(",
"scanner",
".",
"Text",
"(",
")",
")",
"\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"||",
"strings",
".",
"HasPrefix",
"(",
"line",
",",
"\"",
"\"",
")",
"{",
"comment",
":=",
"strings",
".",
"TrimLeft",
"(",
"line",
",",
"\"",
"\"",
")",
"\n",
"cfg",
".",
"AddComment",
"(",
"curSection",
",",
"comment",
")",
"\n",
"}",
"else",
"if",
"len",
"(",
"line",
")",
">",
"0",
"{",
"if",
"m",
":=",
"iniSectionRe",
".",
"FindStringSubmatch",
"(",
"<mask>",
")",
";",
"len",
"(",
"m",
")",
">",
"0",
"{",
"curSection",
"=",
"m",
"[",
"1",
"]",
"\n",
"}",
"else",
"if",
"m",
":=",
"iniOptionRe",
".",
"FindStringSubmatch",
"(",
"line",
")",
";",
"len",
"(",
"m",
")",
">",
"0",
"{",
"key",
":=",
"m",
"[",
"1",
"]",
"\n",
"val",
":=",
"m",
"[",
"2",
"]",
"\n",
"if",
"!",
"strings",
".",
"Contains",
"(",
"val",
",",
"\"",
"\\\"",
"\"",
")",
"{",
"// If val does not contain any quote characers, we can make it",
"// a quoted string and safely let strconv.Unquote sort out any",
"// escapes",
"val",
"=",
"\"",
"\\\"",
"\"",
"+",
"val",
"+",
"\"",
"\\\"",
"\"",
"\n",
"}",
"\n",
"if",
"val",
"[",
"0",
"]",
"==",
"'\"'",
"{",
"val",
",",
"_",
"=",
"strconv",
".",
"Unquote",
"(",
"val",
")",
"\n",
"}",
"\n\n",
"cfg",
".",
"Set",
"(",
"curSection",
",",
"key",
",",
"val",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"cfg",
"\n",
"}"
]
|
14,611 | all-14612 | [
"Display",
"is",
"the",
"human",
"-",
"friendly",
"form",
"of",
"this",
"configuration",
".",
"It",
"tries",
"to",
"describe",
"this",
"template",
"in",
"as",
"much",
"detail",
"as",
"possible",
"in",
"a",
"single",
"line",
"so",
"log",
"consumers",
"can",
"uniquely",
"identify",
"it",
"."
]
| [
"func",
"(",
"c",
"*",
"TemplateConfig",
")",
"Display",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"source",
":=",
"c",
".",
"Source",
"\n",
"if",
"StringPresent",
"(",
"c",
".",
"Contents",
")",
"{",
"source",
"=",
"String",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"StringVal",
"(",
"<mask>",
")",
",",
"StringVal",
"(",
"c",
".",
"Destination",
")",
",",
")",
"\n",
"}"
]
|
14,612 | all-14613 | [
"OutputMetricsIfRequired",
"will",
"send",
"metrics",
"to",
"Graphite",
"if",
"a",
"non",
"-",
"empty",
"graphiteTCPAddress",
"is",
"passed",
"in",
"or",
"to",
"the",
"standard",
"log",
"if",
"logMetrics",
"is",
"true",
".",
"Make",
"sure",
"a",
"sensible",
"graphitePrefix",
"that",
"will",
"uniquely",
"identify",
"your",
"service",
"is",
"passed",
"in",
"e",
".",
"g",
".",
"content",
".",
"test",
".",
"people",
".",
"rw",
".",
"neo4j",
".",
"ftaps58938",
"-",
"law1a",
"-",
"eu",
"-",
"t"
]
| [
"func",
"OutputMetricsIfRequired",
"(",
"graphiteTCPAddress",
"string",
",",
"graphitePrefix",
"string",
",",
"logMetrics",
"bool",
")",
"{",
"if",
"graphiteTCPAddress",
"!=",
"\"",
"\"",
"{",
"addr",
",",
"_",
":=",
"net",
".",
"ResolveTCPAddr",
"(",
"\"",
"\"",
",",
"graphiteTCPAddress",
")",
"\n",
"go",
"graphite",
".",
"Graphite",
"(",
"metrics",
".",
"DefaultRegistry",
",",
"5",
"*",
"time",
".",
"Second",
",",
"graphitePrefix",
",",
"addr",
")",
"\n",
"}",
"\n",
"if",
"logMetrics",
"{",
"//useful locally",
"//messy use of the 'standard' log package here as this method takes the log struct, not an interface, so can't use logrus.Logger",
"go",
"metrics",
".",
"Log",
"(",
"metrics",
".",
"DefaultRegistry",
",",
"60",
"*",
"<mask>",
".",
"Second",
",",
"standardLog",
".",
"New",
"(",
"os",
".",
"Stdout",
",",
"\"",
"\"",
",",
"standardLog",
".",
"Lmicroseconds",
")",
")",
"\n",
"}",
"\n",
"}"
]
|
14,613 | all-14614 | [
"SpanFromContext",
"returns",
"the",
"Span",
"previously",
"associated",
"with",
"ctx",
"or",
"nil",
"if",
"no",
"such",
"Span",
"could",
"be",
"found",
".",
"NOTE",
":",
"context",
".",
"Context",
"!",
"=",
"SpanContext",
":",
"the",
"former",
"is",
"Go",
"s",
"intra",
"-",
"process",
"context",
"propagation",
"mechanism",
"and",
"the",
"latter",
"houses",
"OpenTracing",
"s",
"per",
"-",
"Span",
"identity",
"and",
"baggage",
"information",
"."
]
| [
"func",
"SpanFromContext",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"Span",
"{",
"val",
":=",
"ctx",
".",
"Value",
"(",
"activeSpanKey",
")",
"\n",
"if",
"sp",
",",
"ok",
":=",
"val",
".",
"(",
"Span",
")",
";",
"ok",
"{",
"return",
"sp",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
]
|
14,614 | all-14615 | [
"Delete",
"deletes",
"a",
"vsphere_virtual_machine",
"disk",
"sub",
"-",
"resource",
"."
]
| [
"func",
"(",
"r",
"*",
"DiskSubresource",
")",
"Delete",
"(",
"l",
"object",
".",
"VirtualDeviceList",
")",
"(",
"[",
"]",
"types",
".",
"BaseVirtualDeviceConfigSpec",
",",
"error",
")",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"r",
")",
"\n",
"disk",
",",
"err",
":=",
"r",
".",
"findVirtualDisk",
"(",
"l",
",",
"false",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"deleteSpec",
",",
"err",
":=",
"<mask>",
".",
"VirtualDeviceList",
"{",
"disk",
"}",
".",
"ConfigSpec",
"(",
"types",
".",
"VirtualDeviceConfigSpecOperationRemove",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"len",
"(",
"deleteSpec",
")",
"!=",
"1",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"len",
"(",
"deleteSpec",
")",
")",
"\n",
"}",
"\n",
"if",
"r",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"bool",
")",
"||",
"r",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"bool",
")",
"{",
"// Clear file operation so that the disk is kept on remove.",
"deleteSpec",
"[",
"0",
"]",
".",
"GetVirtualDeviceConfigSpec",
"(",
")",
".",
"FileOperation",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"r",
",",
"DeviceChangeString",
"(",
"deleteSpec",
")",
")",
"\n",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"r",
")",
"\n",
"return",
"deleteSpec",
",",
"nil",
"\n",
"}"
]
|
14,615 | all-14616 | [
"LookupInGShadow",
"looks",
"up",
"a",
"shadowed",
"group",
"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",
"LookupInGShadow",
"(",
"field",
"gshadowField",
",",
"value",
"string",
",",
"n",
"int",
")",
"(",
"[",
"]",
"*",
"GShadow",
",",
"error",
")",
"{",
"checkRoot",
"(",
")",
"\n\n",
"iEntries",
",",
"err",
":=",
"lookUp",
"(",
"&",
"GShadow",
"{",
"}",
",",
"<mask>",
",",
"value",
",",
"n",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// == Convert to type GShadow",
"valueSlice",
":=",
"reflect",
".",
"ValueOf",
"(",
"iEntries",
")",
"\n",
"entries",
":=",
"make",
"(",
"[",
"]",
"*",
"GShadow",
",",
"valueSlice",
".",
"Len",
"(",
")",
")",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"valueSlice",
".",
"Len",
"(",
")",
";",
"i",
"++",
"{",
"entries",
"[",
"i",
"]",
"=",
"valueSlice",
".",
"Index",
"(",
"i",
")",
".",
"Interface",
"(",
")",
".",
"(",
"*",
"GShadow",
")",
"\n",
"}",
"\n\n",
"return",
"entries",
",",
"err",
"\n",
"}"
]
|
14,616 | all-14617 | [
"WithPath",
"cookie",
"path",
"."
]
| [
"func",
"(",
"p",
"SetCookieParams",
")",
"WithPath",
"(",
"<mask>",
"string",
")",
"*",
"SetCookieParams",
"{",
"p",
".",
"Path",
"=",
"path",
"\n",
"return",
"&",
"p",
"\n",
"}"
]
|
14,617 | all-14618 | [
"Prints",
"the",
"audit",
"entries",
"to",
"console"
]
| [
"func",
"printAudits",
"(",
"entries",
"[",
"]",
"*",
"cm15",
".",
"AuditEntry",
")",
"{",
"for",
"_",
",",
"a",
":=",
"<mask>",
"entries",
"{",
"fmt",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"a",
".",
"UpdatedAt",
",",
"a",
".",
"UserEmail",
",",
"a",
".",
"Summary",
")",
"\n",
"}",
"\n",
"}"
]
|
14,618 | all-14619 | [
"Valids",
"returns",
"the",
"list",
"of",
"valid",
"strings",
"."
]
| [
"func",
"(",
"ss",
"*",
"SelectiveStringValue",
")",
"Valids",
"(",
")",
"[",
"]",
"string",
"{",
"s",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
",",
"len",
"(",
"ss",
".",
"valids",
")",
")",
"\n",
"for",
"k",
":=",
"range",
"ss",
".",
"valids",
"{",
"s",
"=",
"<mask>",
"(",
"s",
",",
"k",
")",
"\n",
"}",
"\n",
"sort",
".",
"Strings",
"(",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
]
|
14,619 | all-14620 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
]
| [
"func",
"(",
"v",
"ScrollRect",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoLayertree3",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
]
|
14,620 | all-14621 | [
"pagedQuery",
"executes",
"the",
"query",
"using",
"bq",
"s",
"paging",
"mechanism",
"to",
"load",
"all",
"results",
"and",
"sends",
"them",
"back",
"via",
"dataChan",
"if",
"available",
"otherwise",
"it",
"returns",
"the",
"full",
"result",
"set",
"headers",
"and",
"error",
"as",
"return",
"values"
]
| [
"func",
"(",
"c",
"*",
"Client",
")",
"pagedQuery",
"(",
"pageSize",
"int",
",",
"dataset",
",",
"project",
",",
"queryStr",
"string",
",",
"dataChan",
"chan",
"Data",
")",
"(",
"[",
"]",
"[",
"]",
"interface",
"{",
"}",
",",
"[",
"]",
"string",
",",
"error",
")",
"{",
"// connect to service",
"service",
",",
"err",
":=",
"c",
".",
"connect",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"dataChan",
"!=",
"nil",
"{",
"dataChan",
"<-",
"Data",
"{",
"Err",
":",
"err",
"}",
"\n",
"}",
"\n",
"return",
"nil",
",",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"allowLargeResults",
"&&",
"len",
"(",
"c",
".",
"tempTableName",
")",
">",
"0",
"{",
"return",
"c",
".",
"largeDataPagedQuery",
"(",
"<mask>",
",",
"pageSize",
",",
"dataset",
",",
"project",
",",
"queryStr",
",",
"dataChan",
")",
"\n",
"}",
"\n\n",
"return",
"c",
".",
"stdPagedQuery",
"(",
"service",
",",
"pageSize",
",",
"dataset",
",",
"project",
",",
"queryStr",
",",
"dataChan",
")",
"\n",
"}"
]
|
14,621 | all-14622 | [
"/",
"*",
"Equivalent",
"to",
"the",
"C",
"constant",
"CV_WHOLE_SEQ"
]
| [
"func",
"WholeSeq",
"(",
")",
"Slice",
"{",
"<mask>",
":=",
"C",
".",
"cvSlice",
"(",
"C",
".",
"int",
"(",
"0",
")",
",",
"C",
".",
"CV_WHOLE_SEQ_END_INDEX",
")",
"\n",
"return",
"(",
"Slice",
")",
"(",
"slice",
")",
"\n",
"}"
]
|
14,622 | all-14623 | [
"ANY",
"accepts",
"a",
"request",
"across",
"any",
"HTTP",
"method",
"for",
"the",
"specified",
"path",
"and",
"routes",
"it",
"to",
"the",
"specified",
"Handler",
"."
]
| [
"func",
"(",
"a",
"*",
"App",
")",
"ANY",
"(",
"p",
"string",
",",
"h",
"Handler",
")",
"{",
"a",
".",
"<mask>",
"(",
"p",
",",
"h",
")",
"\n",
"a",
".",
"POST",
"(",
"p",
",",
"h",
")",
"\n",
"a",
".",
"PUT",
"(",
"p",
",",
"h",
")",
"\n",
"a",
".",
"PATCH",
"(",
"p",
",",
"h",
")",
"\n",
"a",
".",
"HEAD",
"(",
"p",
",",
"h",
")",
"\n",
"a",
".",
"OPTIONS",
"(",
"p",
",",
"h",
")",
"\n",
"a",
".",
"DELETE",
"(",
"p",
",",
"h",
")",
"\n",
"}"
]
|
14,623 | all-14624 | [
"GetBlock",
"encodes",
"a",
"hash",
"into",
"a",
"readable",
"format",
"in",
"the",
"form",
"of",
"a",
"Block",
"."
]
| [
"func",
"GetBlock",
"(",
"hash",
"hash",
".",
"Hash",
")",
"*",
"Block",
"{",
"return",
"&",
"Block",
"{",
"Hash",
":",
"base64",
".",
"URLEncoding",
".",
"EncodeToString",
"(",
"<mask>",
".",
"Sum",
"(",
"nil",
")",
")",
",",
"}",
"\n",
"}"
]
|
14,624 | all-14625 | [
"GetQuery",
"returns",
"the",
"Query",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
]
| [
"func",
"(",
"w",
"*",
"WidgetEvent",
")",
"GetQuery",
"(",
")",
"string",
"{",
"if",
"w",
"==",
"nil",
"||",
"w",
".",
"<mask>",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"w",
".",
"Query",
"\n",
"}"
]
|
14,625 | all-14626 | [
"ParseSimpleConfig",
"will",
"unmarshal",
"an",
"OWNERS",
"file",
"s",
"content",
"into",
"a",
"SimpleConfig",
"Returns",
"an",
"error",
"if",
"the",
"content",
"cannot",
"be",
"unmarshalled"
]
| [
"func",
"ParseSimpleConfig",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"SimpleConfig",
",",
"error",
")",
"{",
"simple",
":=",
"<mask>",
"(",
"SimpleConfig",
")",
"\n",
"err",
":=",
"yaml",
".",
"Unmarshal",
"(",
"b",
",",
"simple",
")",
"\n",
"return",
"*",
"simple",
",",
"err",
"\n",
"}"
]
|
14,626 | all-14627 | [
"Texture",
"returns",
"a",
"Metal",
"texture",
"object",
"representing",
"the",
"drawable",
"object",
"s",
"content",
".",
"Reference",
":",
"https",
":",
"//",
"developer",
".",
"apple",
".",
"com",
"/",
"documentation",
"/",
"quartzcore",
"/",
"cametaldrawable",
"/",
"1478159",
"-",
"texture",
"."
]
| [
"func",
"(",
"md",
"MetalDrawable",
")",
"Texture",
"(",
")",
"mtl",
".",
"Texture",
"{",
"return",
"mtl",
".",
"NewTexture",
"(",
"C",
".",
"MetalDrawable_Texture",
"(",
"<mask>",
".",
"metalDrawable",
")",
")",
"\n",
"}"
]
|
14,627 | all-14628 | [
"ValidateImageName",
"returns",
"nil",
"if",
"the",
"image",
"name",
"is",
"empty",
"or",
"matches",
"the",
"open",
"-",
"containers",
"image",
"name",
"specs",
".",
"In",
"any",
"other",
"case",
"an",
"error",
"is",
"returned",
"."
]
| [
"func",
"ValidateImageName",
"(",
"image",
"string",
")",
"error",
"{",
"if",
"len",
"(",
"<mask>",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"var",
"err",
"error",
"\n",
"if",
"!",
"refRegexp",
".",
"MatchString",
"(",
"image",
")",
"{",
"err",
"=",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"image",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
|
14,628 | all-14629 | [
"GetLogQueryOk",
"returns",
"a",
"tuple",
"with",
"the",
"LogQuery",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"q",
"*",
"QueryValueRequest",
")",
"GetLogQueryOk",
"(",
")",
"(",
"WidgetApmOrLogQuery",
",",
"bool",
")",
"{",
"if",
"q",
"==",
"nil",
"||",
"q",
".",
"LogQuery",
"==",
"nil",
"{",
"return",
"WidgetApmOrLogQuery",
"{",
"}",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"q",
".",
"LogQuery",
",",
"<mask>",
"\n",
"}"
]
|
14,629 | all-14630 | [
"GetLevel",
"returns",
"the",
"log",
"level",
"for",
"the",
"given",
"module",
"."
]
| [
"func",
"(",
"l",
"*",
"moduleLeveled",
")",
"GetLevel",
"(",
"module",
"string",
")",
"Level",
"{",
"<mask>",
",",
"exists",
":=",
"l",
".",
"levels",
"[",
"module",
"]",
"\n",
"if",
"exists",
"==",
"false",
"{",
"level",
",",
"exists",
"=",
"l",
".",
"levels",
"[",
"\"",
"\"",
"]",
"\n",
"// no configuration exists, default to debug",
"if",
"exists",
"==",
"false",
"{",
"level",
"=",
"DEBUG",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"level",
"\n",
"}"
]
|
14,630 | all-14631 | [
"GetRegion",
"returns",
"the",
"Region",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
]
| [
"func",
"(",
"s",
"*",
"SyntheticsLocation",
")",
"GetRegion",
"(",
")",
"string",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"Region",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"<mask>",
"*",
"s",
".",
"Region",
"\n",
"}"
]
|
14,631 | all-14632 | [
"parseNanoTime",
"returns",
"the",
"time",
"object",
"from",
"a",
"string",
"formatted",
"with",
"RFC3339Nano",
"layout",
"."
]
| [
"func",
"parseNanoTime",
"(",
"value",
"string",
")",
"<mask>",
".",
"Time",
"{",
"ts",
",",
"_",
":=",
"time",
".",
"Parse",
"(",
"time",
".",
"RFC3339Nano",
",",
"value",
")",
"\n",
"return",
"ts",
"\n",
"}"
]
|
14,632 | all-14633 | [
"/",
"*",
"PatchAppsApp",
"updates",
"an",
"app"
]
| [
"func",
"(",
"a",
"*",
"Client",
")",
"PatchAppsApp",
"(",
"params",
"*",
"PatchAppsAppParams",
")",
"(",
"*",
"PatchAppsAppOK",
",",
"error",
")",
"{",
"// TODO: Validate the params before sending",
"if",
"params",
"==",
"nil",
"{",
"params",
"=",
"NewPatchAppsAppParams",
"(",
")",
"\n",
"}",
"\n\n",
"<mask>",
",",
"err",
":=",
"a",
".",
"transport",
".",
"Submit",
"(",
"&",
"runtime",
".",
"ClientOperation",
"{",
"ID",
":",
"\"",
"\"",
",",
"Method",
":",
"\"",
"\"",
",",
"PathPattern",
":",
"\"",
"\"",
",",
"ProducesMediaTypes",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
"ConsumesMediaTypes",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
"Schemes",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
"}",
",",
"Params",
":",
"params",
",",
"Reader",
":",
"&",
"PatchAppsAppReader",
"{",
"formats",
":",
"a",
".",
"formats",
"}",
",",
"Context",
":",
"params",
".",
"Context",
",",
"Client",
":",
"params",
".",
"HTTPClient",
",",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"result",
".",
"(",
"*",
"PatchAppsAppOK",
")",
",",
"nil",
"\n\n",
"}"
]
|
14,633 | all-14634 | [
"Push",
"writes",
"len",
"(",
"p",
")",
"pointers",
"from",
"p",
"to",
"the",
"ring",
".",
"It",
"returns",
"the",
"number",
"of",
"elements",
"written",
"from",
"p",
"(",
"0",
"<",
"=",
"n",
"<",
"=",
"len",
"(",
"p",
"))",
"and",
"any",
"error",
"encountered",
"that",
"caused",
"the",
"write",
"to",
"stop",
"early",
".",
"Push",
"must",
"return",
"a",
"non",
"-",
"nil",
"error",
"if",
"it",
"returns",
"n",
"<",
"len",
"(",
"p",
")",
"."
]
| [
"func",
"(",
"b",
"*",
"PointerRingBuf",
")",
"Push",
"(",
"p",
"[",
"]",
"interface",
"{",
"}",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"for",
"{",
"if",
"len",
"(",
"p",
")",
"==",
"0",
"{",
"// nothing (left) to copy in; notice we shorten our",
"// local copy p (below) as we read from it.",
"return",
"\n",
"}",
"\n\n",
"writeCapacity",
":=",
"b",
".",
"N",
"-",
"b",
".",
"Readable",
"\n",
"if",
"writeCapacity",
"<=",
"0",
"{",
"// we are all full up already.",
"return",
"n",
",",
"<mask>",
".",
"ErrShortWrite",
"\n",
"}",
"\n",
"if",
"len",
"(",
"p",
")",
">",
"writeCapacity",
"{",
"err",
"=",
"io",
".",
"ErrShortWrite",
"\n",
"// leave err set and",
"// keep going, write what we can.",
"}",
"\n\n",
"writeStart",
":=",
"(",
"b",
".",
"Beg",
"+",
"b",
".",
"Readable",
")",
"%",
"b",
".",
"N",
"\n\n",
"upperLim",
":=",
"intMin",
"(",
"writeStart",
"+",
"writeCapacity",
",",
"b",
".",
"N",
")",
"\n\n",
"k",
":=",
"copy",
"(",
"b",
".",
"A",
"[",
"writeStart",
":",
"upperLim",
"]",
",",
"p",
")",
"\n\n",
"n",
"+=",
"k",
"\n",
"b",
".",
"Readable",
"+=",
"k",
"\n",
"p",
"=",
"p",
"[",
"k",
":",
"]",
"\n\n",
"// we can fill from b.A[0:something] from",
"// p's remainder, so loop",
"}",
"\n",
"}"
]
|
14,634 | all-14635 | [
"WithHeight",
"frame",
"height",
"in",
"DIP",
"(",
"headless",
"chrome",
"only",
")",
"."
]
| [
"func",
"(",
"p",
"CreateTargetParams",
")",
"WithHeight",
"(",
"height",
"int64",
")",
"*",
"CreateTargetParams",
"{",
"p",
".",
"Height",
"=",
"<mask>",
"\n",
"return",
"&",
"p",
"\n",
"}"
]
|
14,635 | all-14636 | [
"SetHost",
"sets",
"the",
"host",
"of",
"this",
"URI",
"."
]
| [
"func",
"(",
"u",
"*",
"URI",
")",
"SetHost",
"(",
"host",
"string",
")",
"error",
"{",
"m",
":=",
"hostRegexp",
".",
"FindStringSubmatch",
"(",
"<mask>",
")",
"\n",
"if",
"m",
"==",
"nil",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"u",
".",
"host",
"=",
"host",
"\n",
"return",
"nil",
"\n",
"}"
]
|
14,636 | all-14637 | [
"AddSaveable",
"mocks",
"base",
"method"
]
| [
"func",
"(",
"m",
"*",
"MockSaveableOption",
")",
"AddSaveable",
"(",
"arg0",
"string",
",",
"arg1",
"statemanager",
".",
"Saveable",
")",
"statemanager",
".",
"Option",
"{",
"<mask>",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"statemanager",
".",
"Option",
")",
"\n",
"return",
"ret0",
"\n",
"}"
]
|
14,637 | all-14638 | [
"RemoveApprover",
"removes",
"an",
"approver",
"from",
"the",
"list",
"."
]
| [
"func",
"(",
"ap",
"*",
"Approvers",
")",
"RemoveApprover",
"(",
"login",
"string",
")",
"{",
"<mask>",
"(",
"ap",
".",
"approvers",
",",
"strings",
".",
"ToLower",
"(",
"login",
")",
")",
"\n",
"}"
]
|
14,638 | all-14639 | [
"GetGroupTarget",
"is",
"a",
"wrapper",
"around",
"cairo_get_group_target",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"<mask>",
")",
"GetGroupTarget",
"(",
")",
"*",
"Surface",
"{",
"c",
":=",
"C",
".",
"cairo_get_group_target",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"s",
":=",
"wrapSurface",
"(",
"c",
")",
"\n",
"s",
".",
"reference",
"(",
")",
"\n",
"runtime",
".",
"SetFinalizer",
"(",
"s",
",",
"(",
"*",
"Surface",
")",
".",
"destroy",
")",
"\n",
"return",
"s",
"\n",
"}"
]
|
14,639 | all-14640 | [
"BackwardDisplayLineStart",
"is",
"a",
"wrapper",
"around",
"gtk_text_view_backward_display_line_start",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"TextView",
")",
"BackwardDisplayLineStart",
"(",
"iter",
"*",
"TextIter",
")",
"bool",
"{",
"<mask>",
"gobool",
"(",
"C",
".",
"gtk_text_view_backward_display_line_start",
"(",
"v",
".",
"native",
"(",
")",
",",
"iter",
".",
"native",
"(",
")",
")",
")",
"\n",
"}"
]
|
14,640 | all-14641 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
]
| [
"func",
"(",
"v",
"EventFrameStartedLoading",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage61",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
]
|
14,641 | all-14642 | [
"deduplicate",
"merges",
"objects",
"based",
"on",
"their",
"positions",
".",
"This",
"is",
"done",
"to",
"work",
"around",
"packages",
"existing",
"multiple",
"times",
"in",
"go",
"/",
"packages",
"."
]
| [
"func",
"(",
"c",
"*",
"Checker",
")",
"deduplicate",
"(",
")",
"{",
"m",
":=",
"map",
"[",
"token",
".",
"Position",
"]",
"struct",
"{",
"used",
",",
"quiet",
"bool",
"}",
"{",
"}",
"\n",
"for",
"_",
",",
"node",
":=",
"range",
"c",
".",
"graph",
".",
"nodes",
"{",
"obj",
",",
"ok",
":=",
"node",
".",
"obj",
".",
"(",
"types",
".",
"Object",
")",
"\n",
"if",
"!",
"ok",
"{",
"continue",
"\n",
"}",
"\n",
"<mask>",
":=",
"c",
".",
"prog",
".",
"Fset",
"(",
")",
".",
"Position",
"(",
"obj",
".",
"Pos",
"(",
")",
")",
"\n",
"m",
"[",
"pos",
"]",
"=",
"struct",
"{",
"used",
",",
"quiet",
"bool",
"}",
"{",
"m",
"[",
"pos",
"]",
".",
"used",
"||",
"node",
".",
"used",
",",
"m",
"[",
"pos",
"]",
".",
"quiet",
"||",
"node",
".",
"quiet",
",",
"}",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"node",
":=",
"range",
"c",
".",
"graph",
".",
"nodes",
"{",
"obj",
",",
"ok",
":=",
"node",
".",
"obj",
".",
"(",
"types",
".",
"Object",
")",
"\n",
"if",
"!",
"ok",
"{",
"continue",
"\n",
"}",
"\n",
"pos",
":=",
"c",
".",
"prog",
".",
"Fset",
"(",
")",
".",
"Position",
"(",
"obj",
".",
"Pos",
"(",
")",
")",
"\n",
"node",
".",
"used",
"=",
"m",
"[",
"pos",
"]",
".",
"used",
"\n",
"node",
".",
"quiet",
"=",
"m",
"[",
"pos",
"]",
".",
"quiet",
"\n",
"}",
"\n",
"}"
]
|
14,642 | all-14643 | [
"ProwJobs",
"returns",
"a",
"thread",
"-",
"safe",
"snapshot",
"of",
"the",
"current",
"prow",
"jobs",
"."
]
| [
"func",
"(",
"ja",
"*",
"JobAgent",
")",
"ProwJobs",
"(",
")",
"[",
"]",
"prowapi",
".",
"ProwJob",
"{",
"ja",
".",
"mut",
".",
"Lock",
"(",
")",
"\n",
"defer",
"ja",
".",
"mut",
".",
"Unlock",
"(",
")",
"\n",
"res",
":=",
"make",
"(",
"[",
"]",
"prowapi",
".",
"ProwJob",
",",
"len",
"(",
"ja",
".",
"prowJobs",
")",
")",
"\n",
"copy",
"(",
"<mask>",
",",
"ja",
".",
"prowJobs",
")",
"\n",
"return",
"res",
"\n",
"}"
]
|
14,643 | all-14644 | [
"PeerNameFromString",
"parses",
"PeerName",
"from",
"a",
"generic",
"string",
"."
]
| [
"func",
"PeerNameFromString",
"(",
"nameStr",
"string",
")",
"(",
"PeerName",
",",
"error",
")",
"{",
"var",
"a",
",",
"b",
",",
"c",
",",
"d",
",",
"e",
",",
"f",
"uint64",
"\n\n",
"match",
":=",
"func",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"bool",
"{",
"a",
",",
"b",
",",
"c",
",",
"d",
",",
"e",
",",
"f",
"=",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
"\n",
"n",
",",
"err",
":=",
"fmt",
".",
"Sscanf",
"(",
"nameStr",
"+",
"\"",
"\\000",
"\"",
",",
"format",
"+",
"\"",
"\\000",
"\"",
",",
"args",
"...",
")",
"\n",
"return",
"err",
"==",
"nil",
"&&",
"n",
"==",
"len",
"(",
"args",
")",
"\n",
"}",
"\n\n",
"switch",
"{",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"b",
",",
"&",
"c",
",",
"&",
"d",
",",
"&",
"e",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"c",
",",
"&",
"d",
",",
"&",
"e",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"d",
",",
"&",
"e",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"b",
",",
"&",
"e",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"b",
",",
"&",
"c",
",",
"&",
"f",
")",
":",
"<mask>",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"b",
",",
"&",
"c",
",",
"&",
"d",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"d",
",",
"&",
"e",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"e",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"b",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"b",
",",
"&",
"c",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"e",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
",",
"&",
"b",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"f",
")",
":",
"case",
"match",
"(",
"\"",
"\"",
",",
"&",
"a",
")",
":",
"default",
":",
"return",
"UnknownPeerName",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"nameStr",
")",
"\n",
"}",
"\n\n",
"return",
"PeerName",
"(",
"a",
"<<",
"40",
"|",
"b",
"<<",
"32",
"|",
"c",
"<<",
"24",
"|",
"d",
"<<",
"16",
"|",
"e",
"<<",
"8",
"|",
"f",
")",
",",
"nil",
"\n",
"}"
]
|
14,644 | all-14645 | [
"FormatMask",
"replaces",
"all",
"input",
"runes",
"with",
"the",
"mask",
"rune",
"."
]
| [
"func",
"(",
"c",
"*",
"Cursor",
")",
"FormatMask",
"(",
"mask",
"rune",
")",
"string",
"{",
"r",
":=",
"<mask>",
"(",
"[",
"]",
"rune",
",",
"len",
"(",
"c",
".",
"input",
")",
")",
"\n",
"for",
"i",
":=",
"range",
"r",
"{",
"r",
"[",
"i",
"]",
"=",
"mask",
"\n",
"}",
"\n",
"return",
"format",
"(",
"r",
",",
"c",
")",
"\n",
"}"
]
|
14,645 | all-14646 | [
"Size",
"returns",
"memory",
"used",
"by",
"the",
"node"
]
| [
"func",
"(",
"n",
"Node",
")",
"Size",
"(",
")",
"int",
"{",
"return",
"int",
"(",
"unsafe",
".",
"Sizeof",
"(",
"n",
")",
"+",
"uintptr",
"(",
"n",
".",
"<mask>",
"+",
"1",
")",
"*",
"(",
"unsafe",
".",
"Sizeof",
"(",
"unsafe",
".",
"Pointer",
"(",
"nil",
")",
")",
"+",
"unsafe",
".",
"Sizeof",
"(",
"NodeRef",
"{",
"}",
")",
")",
")",
"\n",
"}"
]
|
14,646 | all-14647 | [
"RadioMenuItemNew",
"is",
"a",
"wrapper",
"around",
"gtk_radio_menu_item_new",
"()",
"."
]
| [
"func",
"RadioMenuItemNew",
"(",
"<mask>",
"*",
"glib",
".",
"SList",
")",
"(",
"*",
"RadioMenuItem",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_radio_menu_item_new",
"(",
"cGSList",
"(",
"group",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"return",
"wrapRadioMenuItem",
"(",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
")",
",",
"nil",
"\n",
"}"
]
|
14,647 | all-14648 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
]
| [
"func",
"(",
"v",
"EventWorkerRegistrationUpdated",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoServiceworker11",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
]
|
14,648 | all-14649 | [
"UnmarshalBinary",
"is",
"used",
"to",
"deserialize",
"an",
"Op",
"from",
"binary",
"form",
"."
]
| [
"func",
"(",
"o",
"*",
"op",
")",
"UnmarshalBinary",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"buf",
":=",
"bytes",
".",
"NewReader",
"(",
"data",
")",
"\n\n",
"var",
"t",
"int64",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"buf",
",",
"binary",
".",
"LittleEndian",
",",
"&",
"t",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"o",
".",
"OpType",
"=",
"OpType",
"(",
"t",
")",
"\n",
"o",
".",
"OpHandler",
"=",
"optypeToHandler",
"(",
"o",
".",
"OpType",
")",
"\n\n",
"var",
"hasArg",
"int8",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"buf",
",",
"binary",
".",
"LittleEndian",
",",
"&",
"hasArg",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"hasArg",
"==",
"1",
"{",
"var",
"tArg",
"int64",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"buf",
",",
"binary",
".",
"LittleEndian",
",",
"&",
"tArg",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"switch",
"tArg",
"{",
"case",
"2",
":",
"var",
"i",
"int64",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"buf",
",",
"binary",
".",
"LittleEndian",
",",
"&",
"i",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"o",
".",
"uArg",
"=",
"i",
"\n",
"case",
"5",
":",
"var",
"l",
"int64",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"buf",
",",
"binary",
".",
"LittleEndian",
",",
"&",
"l",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"b",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"l",
")",
"\n",
"for",
"i",
":=",
"int64",
"(",
"0",
")",
";",
"i",
"<",
"l",
";",
"i",
"++",
"{",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"buf",
",",
"binary",
".",
"LittleEndian",
",",
"&",
"b",
"[",
"i",
"]",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n",
"o",
".",
"uArg",
"=",
"b",
"\n",
"default",
":",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"tArg",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"<mask>",
"hasComment",
"int8",
"\n",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"buf",
",",
"binary",
".",
"LittleEndian",
",",
"&",
"hasComment",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"hasComment",
"==",
"1",
"{",
"if",
"err",
":=",
"binary",
".",
"Read",
"(",
"buf",
",",
"binary",
".",
"LittleEndian",
",",
"&",
"o",
".",
"comment",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
]
|
14,649 | all-14650 | [
"HasStyle",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"t",
"*",
"ToplistRequest",
")",
"HasStyle",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"Style",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
]
|
14,650 | all-14651 | [
"NewHandler",
"returns",
"a",
"new",
"cached",
"handler"
]
| [
"func",
"NewHandler",
"(",
"bodyHandler",
"fasthttp",
".",
"RequestHandler",
",",
"expireDuration",
"time",
".",
"Duration",
")",
"*",
"<mask>",
"{",
"e",
":=",
"entry",
".",
"NewEntry",
"(",
"expireDuration",
")",
"\n\n",
"return",
"&",
"Handler",
"{",
"bodyHandler",
":",
"bodyHandler",
",",
"rule",
":",
"DefaultRuleSet",
",",
"entry",
":",
"e",
",",
"}",
"\n",
"}"
]
|
14,651 | all-14652 | [
"memberRemoveCommandFunc",
"executes",
"the",
"member",
"remove",
"command",
"."
]
| [
"func",
"memberRemoveCommandFunc",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
",",
"args",
"[",
"]",
"string",
")",
"{",
"if",
"len",
"(",
"args",
")",
"!=",
"1",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"<mask>",
",",
"err",
":=",
"strconv",
".",
"ParseUint",
"(",
"args",
"[",
"0",
"]",
",",
"16",
",",
"64",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
")",
"\n",
"}",
"\n\n",
"ctx",
",",
"cancel",
":=",
"commandCtx",
"(",
"cmd",
")",
"\n",
"resp",
",",
"err",
":=",
"mustClientFromCmd",
"(",
"cmd",
")",
".",
"MemberRemove",
"(",
"ctx",
",",
"id",
")",
"\n",
"cancel",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitError",
",",
"err",
")",
"\n",
"}",
"\n",
"display",
".",
"MemberRemove",
"(",
"id",
",",
"*",
"resp",
")",
"\n",
"}"
]
|
14,652 | all-14653 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
]
| [
"func",
"(",
"v",
"RequestDataParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoIndexeddb5",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
]
|
14,653 | all-14654 | [
"parseField",
"is",
"the",
"main",
"parsing",
"function",
".",
"Given",
"a",
"byte",
"slice",
"and",
"an",
"offset",
"into",
"the",
"array",
"it",
"will",
"try",
"to",
"parse",
"a",
"suitable",
"ASN",
".",
"1",
"value",
"out",
"and",
"store",
"it",
"in",
"the",
"given",
"Value",
"."
]
| [
"func",
"parseField",
"(",
"v",
"reflect",
".",
"Value",
",",
"bytes",
"[",
"]",
"byte",
",",
"initOffset",
"int",
",",
"params",
"fieldParameters",
")",
"(",
"<mask>",
"int",
",",
"err",
"error",
")",
"{",
"offset",
"=",
"initOffset",
"\n",
"fieldType",
":=",
"v",
".",
"Type",
"(",
")",
"\n\n",
"// If we have run out of data, it may be that there are optional elements at the end.",
"if",
"offset",
"==",
"len",
"(",
"bytes",
")",
"{",
"if",
"!",
"setDefaultValue",
"(",
"v",
",",
"params",
")",
"{",
"err",
"=",
"asn1",
".",
"SyntaxError",
"{",
"Msg",
":",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n\n",
"// Deal with raw values.",
"if",
"fieldType",
"==",
"rawValueType",
"{",
"var",
"t",
"tagAndLength",
"\n",
"t",
",",
"offset",
",",
"err",
"=",
"parseTagAndLength",
"(",
"bytes",
",",
"offset",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"invalidLength",
"(",
"offset",
",",
"t",
".",
"length",
",",
"len",
"(",
"bytes",
")",
")",
"{",
"err",
"=",
"asn1",
".",
"SyntaxError",
"{",
"Msg",
":",
"\"",
"\"",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"result",
":=",
"asn1",
".",
"RawValue",
"{",
"t",
".",
"class",
",",
"t",
".",
"tag",
",",
"t",
".",
"isCompound",
",",
"bytes",
"[",
"offset",
":",
"offset",
"+",
"t",
".",
"length",
"]",
",",
"bytes",
"[",
"initOffset",
":",
"offset",
"+",
"t",
".",
"length",
"]",
"}",
"\n",
"offset",
"+=",
"t",
".",
"length",
"\n",
"v",
".",
"Set",
"(",
"reflect",
".",
"ValueOf",
"(",
"result",
")",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"// Deal with the ANY type.",
"if",
"ifaceType",
":=",
"fieldType",
";",
"ifaceType",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Interface",
"&&",
"ifaceType",
".",
"NumMethod",
"(",
")",
"==",
"0",
"{",
"var",
"t",
"tagAndLength",
"\n",
"t",
",",
"offset",
",",
"err",
"=",
"parseTagAndLength",
"(",
"bytes",
",",
"offset",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"invalidLength",
"(",
"offset",
",",
"t",
".",
"length",
",",
"len",
"(",
"bytes",
")",
")",
"{",
"err",
"=",
"asn1",
".",
"SyntaxError",
"{",
"Msg",
":",
"\"",
"\"",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"var",
"result",
"interface",
"{",
"}",
"\n",
"if",
"!",
"t",
".",
"isCompound",
"&&",
"t",
".",
"class",
"==",
"classUniversal",
"{",
"innerBytes",
":=",
"bytes",
"[",
"offset",
":",
"offset",
"+",
"t",
".",
"length",
"]",
"\n",
"switch",
"t",
".",
"tag",
"{",
"case",
"tagPrintableString",
":",
"result",
",",
"err",
"=",
"parsePrintableString",
"(",
"innerBytes",
")",
"\n",
"case",
"tagIA5String",
":",
"result",
",",
"err",
"=",
"parseIA5String",
"(",
"innerBytes",
")",
"\n",
"case",
"tagT61String",
":",
"result",
",",
"err",
"=",
"parseT61String",
"(",
"innerBytes",
")",
"\n",
"case",
"tagUTF8String",
":",
"result",
",",
"err",
"=",
"parseUTF8String",
"(",
"innerBytes",
")",
"\n",
"case",
"tagInteger",
":",
"result",
",",
"err",
"=",
"parseInt64",
"(",
"innerBytes",
")",
"\n",
"case",
"tagBitString",
":",
"result",
",",
"err",
"=",
"parseBitString",
"(",
"innerBytes",
")",
"\n",
"case",
"tagOID",
":",
"result",
",",
"err",
"=",
"parseObjectIdentifier",
"(",
"innerBytes",
")",
"\n",
"case",
"tagUTCTime",
":",
"result",
",",
"err",
"=",
"parseUTCTime",
"(",
"innerBytes",
")",
"\n",
"case",
"tagGeneralizedTime",
":",
"result",
",",
"err",
"=",
"parseGeneralizedTime",
"(",
"innerBytes",
")",
"\n",
"case",
"tagOctetString",
":",
"result",
"=",
"innerBytes",
"\n",
"default",
":",
"// If we don't know how to handle the type, we just leave Value as nil.",
"}",
"\n",
"}",
"\n",
"offset",
"+=",
"t",
".",
"length",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"result",
"!=",
"nil",
"{",
"v",
".",
"Set",
"(",
"reflect",
".",
"ValueOf",
"(",
"result",
")",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"universalTag",
",",
"compoundType",
",",
"ok1",
":=",
"getUniversalType",
"(",
"fieldType",
")",
"\n",
"if",
"!",
"ok1",
"{",
"err",
"=",
"asn1",
".",
"StructuralError",
"{",
"Msg",
":",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"fieldType",
")",
"}",
"\n",
"return",
"\n",
"}",
"\n\n",
"t",
",",
"offset",
",",
"err",
":=",
"parseTagAndLength",
"(",
"bytes",
",",
"offset",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"params",
".",
"explicit",
"{",
"expectedClass",
":=",
"classContextSpecific",
"\n",
"if",
"params",
".",
"application",
"{",
"expectedClass",
"=",
"classApplication",
"\n",
"}",
"\n",
"if",
"offset",
"==",
"len",
"(",
"bytes",
")",
"{",
"err",
"=",
"asn1",
".",
"StructuralError",
"{",
"Msg",
":",
"\"",
"\"",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"if",
"t",
".",
"class",
"==",
"expectedClass",
"&&",
"t",
".",
"tag",
"==",
"*",
"params",
".",
"tag",
"&&",
"(",
"t",
".",
"length",
"==",
"0",
"||",
"t",
".",
"isCompound",
")",
"{",
"if",
"t",
".",
"length",
">",
"0",
"{",
"t",
",",
"offset",
",",
"err",
"=",
"parseTagAndLength",
"(",
"bytes",
",",
"offset",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"}",
"else",
"{",
"if",
"fieldType",
"!=",
"flagType",
"{",
"err",
"=",
"asn1",
".",
"StructuralError",
"{",
"Msg",
":",
"\"",
"\"",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"v",
".",
"SetBool",
"(",
"true",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"else",
"{",
"// The tags didn't match, it might be an optional element.",
"ok",
":=",
"setDefaultValue",
"(",
"v",
",",
"params",
")",
"\n",
"if",
"ok",
"{",
"offset",
"=",
"initOffset",
"\n",
"}",
"else",
"{",
"err",
"=",
"asn1",
".",
"StructuralError",
"{",
"Msg",
":",
"\"",
"\"",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Special case for strings: all the ASN.1 string types map to the Go",
"// type string. getUniversalType returns the tag for PrintableString",
"// when it sees a string, so if we see a different string type on the",
"// wire, we change the universal type to match.",
"if",
"universalTag",
"==",
"tagPrintableString",
"{",
"if",
"t",
".",
"class",
"==",
"classUniversal",
"{",
"switch",
"t",
".",
"tag",
"{",
"case",
"tagIA5String",
",",
"tagGeneralString",
",",
"tagT61String",
",",
"tagUTF8String",
":",
"universalTag",
"=",
"t",
".",
"tag",
"\n",
"}",
"\n",
"}",
"else",
"if",
"params",
".",
"stringType",
"!=",
"0",
"{",
"universalTag",
"=",
"params",
".",
"stringType",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Special case for time: UTCTime and GeneralizedTime both map to the",
"// Go type time.Time.",
"if",
"universalTag",
"==",
"tagUTCTime",
"&&",
"t",
".",
"tag",
"==",
"tagGeneralizedTime",
"&&",
"t",
".",
"class",
"==",
"classUniversal",
"{",
"universalTag",
"=",
"tagGeneralizedTime",
"\n",
"}",
"\n\n",
"if",
"params",
".",
"set",
"{",
"universalTag",
"=",
"tagSet",
"\n",
"}",
"\n\n",
"expectedClass",
":=",
"classUniversal",
"\n",
"expectedTag",
":=",
"universalTag",
"\n\n",
"if",
"!",
"params",
".",
"explicit",
"&&",
"params",
".",
"tag",
"!=",
"nil",
"{",
"expectedClass",
"=",
"classContextSpecific",
"\n",
"expectedTag",
"=",
"*",
"params",
".",
"tag",
"\n",
"}",
"\n\n",
"if",
"!",
"params",
".",
"explicit",
"&&",
"params",
".",
"application",
"&&",
"params",
".",
"tag",
"!=",
"nil",
"{",
"expectedClass",
"=",
"classApplication",
"\n",
"expectedTag",
"=",
"*",
"params",
".",
"tag",
"\n",
"}",
"\n\n",
"// We have unwrapped any explicit tagging at this point.",
"if",
"t",
".",
"class",
"!=",
"expectedClass",
"||",
"t",
".",
"tag",
"!=",
"expectedTag",
"||",
"t",
".",
"isCompound",
"!=",
"compoundType",
"{",
"// Tags don't match. Again, it could be an optional element.",
"ok",
":=",
"setDefaultValue",
"(",
"v",
",",
"params",
")",
"\n",
"if",
"ok",
"{",
"offset",
"=",
"initOffset",
"\n",
"}",
"else",
"{",
"err",
"=",
"asn1",
".",
"StructuralError",
"{",
"Msg",
":",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"expectedTag",
",",
"t",
",",
"params",
",",
"fieldType",
".",
"Name",
"(",
")",
",",
"offset",
")",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"if",
"invalidLength",
"(",
"offset",
",",
"t",
".",
"length",
",",
"len",
"(",
"bytes",
")",
")",
"{",
"err",
"=",
"asn1",
".",
"SyntaxError",
"{",
"Msg",
":",
"\"",
"\"",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"innerBytes",
":=",
"bytes",
"[",
"offset",
":",
"offset",
"+",
"t",
".",
"length",
"]",
"\n",
"offset",
"+=",
"t",
".",
"length",
"\n\n",
"// We deal with the structures defined in this package first.",
"switch",
"fieldType",
"{",
"case",
"objectIdentifierType",
":",
"newSlice",
",",
"err1",
":=",
"parseObjectIdentifier",
"(",
"innerBytes",
")",
"\n",
"v",
".",
"Set",
"(",
"reflect",
".",
"MakeSlice",
"(",
"v",
".",
"Type",
"(",
")",
",",
"len",
"(",
"newSlice",
")",
",",
"len",
"(",
"newSlice",
")",
")",
")",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"reflect",
".",
"Copy",
"(",
"v",
",",
"reflect",
".",
"ValueOf",
"(",
"newSlice",
")",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"return",
"\n",
"case",
"bitStringType",
":",
"bs",
",",
"err1",
":=",
"parseBitString",
"(",
"innerBytes",
")",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"v",
".",
"Set",
"(",
"reflect",
".",
"ValueOf",
"(",
"bs",
")",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"return",
"\n",
"case",
"timeType",
":",
"var",
"time",
"time",
".",
"Time",
"\n",
"var",
"err1",
"error",
"\n",
"if",
"universalTag",
"==",
"tagUTCTime",
"{",
"time",
",",
"err1",
"=",
"parseUTCTime",
"(",
"innerBytes",
")",
"\n",
"}",
"else",
"{",
"time",
",",
"err1",
"=",
"parseGeneralizedTime",
"(",
"innerBytes",
")",
"\n",
"}",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"v",
".",
"Set",
"(",
"reflect",
".",
"ValueOf",
"(",
"time",
")",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"return",
"\n",
"case",
"enumeratedType",
":",
"parsedInt",
",",
"err1",
":=",
"parseInt32",
"(",
"innerBytes",
")",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"v",
".",
"SetInt",
"(",
"int64",
"(",
"parsedInt",
")",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"return",
"\n",
"case",
"flagType",
":",
"v",
".",
"SetBool",
"(",
"true",
")",
"\n",
"return",
"\n",
"case",
"bigIntType",
":",
"parsedInt",
",",
"err1",
":=",
"parseBigInt",
"(",
"innerBytes",
")",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"v",
".",
"Set",
"(",
"reflect",
".",
"ValueOf",
"(",
"parsedInt",
")",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"return",
"\n",
"}",
"\n",
"switch",
"val",
":=",
"v",
";",
"val",
".",
"Kind",
"(",
")",
"{",
"case",
"reflect",
".",
"Bool",
":",
"parsedBool",
",",
"err1",
":=",
"parseBool",
"(",
"innerBytes",
")",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"val",
".",
"SetBool",
"(",
"parsedBool",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"return",
"\n",
"case",
"reflect",
".",
"Int",
",",
"reflect",
".",
"Int32",
",",
"reflect",
".",
"Int64",
":",
"if",
"val",
".",
"Type",
"(",
")",
".",
"Size",
"(",
")",
"==",
"4",
"{",
"parsedInt",
",",
"err1",
":=",
"parseInt32",
"(",
"innerBytes",
")",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"val",
".",
"SetInt",
"(",
"int64",
"(",
"parsedInt",
")",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"}",
"else",
"{",
"parsedInt",
",",
"err1",
":=",
"parseInt64",
"(",
"innerBytes",
")",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"val",
".",
"SetInt",
"(",
"parsedInt",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"}",
"\n",
"return",
"\n",
"// TODO(dfc) Add support for the remaining integer types",
"case",
"reflect",
".",
"Struct",
":",
"structType",
":=",
"fieldType",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"structType",
".",
"NumField",
"(",
")",
";",
"i",
"++",
"{",
"if",
"structType",
".",
"Field",
"(",
"i",
")",
".",
"PkgPath",
"!=",
"\"",
"\"",
"{",
"err",
"=",
"asn1",
".",
"StructuralError",
"{",
"Msg",
":",
"\"",
"\"",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"structType",
".",
"NumField",
"(",
")",
">",
"0",
"&&",
"structType",
".",
"Field",
"(",
"0",
")",
".",
"Type",
"==",
"rawContentsType",
"{",
"bytes",
":=",
"bytes",
"[",
"initOffset",
":",
"offset",
"]",
"\n",
"val",
".",
"Field",
"(",
"0",
")",
".",
"Set",
"(",
"reflect",
".",
"ValueOf",
"(",
"asn1",
".",
"RawContent",
"(",
"bytes",
")",
")",
")",
"\n",
"}",
"\n\n",
"innerOffset",
":=",
"0",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"structType",
".",
"NumField",
"(",
")",
";",
"i",
"++",
"{",
"field",
":=",
"structType",
".",
"Field",
"(",
"i",
")",
"\n",
"if",
"i",
"==",
"0",
"&&",
"field",
".",
"Type",
"==",
"rawContentsType",
"{",
"continue",
"\n",
"}",
"\n",
"innerOffset",
",",
"err",
"=",
"parseField",
"(",
"val",
".",
"Field",
"(",
"i",
")",
",",
"innerBytes",
",",
"innerOffset",
",",
"parseFieldParameters",
"(",
"field",
".",
"Tag",
".",
"Get",
"(",
"\"",
"\"",
")",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"// We allow extra bytes at the end of the SEQUENCE because",
"// adding elements to the end has been used in X.509 as the",
"// version numbers have increased.",
"return",
"\n",
"case",
"reflect",
".",
"Slice",
":",
"sliceType",
":=",
"fieldType",
"\n",
"if",
"sliceType",
".",
"Elem",
"(",
")",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Uint8",
"{",
"val",
".",
"Set",
"(",
"reflect",
".",
"MakeSlice",
"(",
"sliceType",
",",
"len",
"(",
"innerBytes",
")",
",",
"len",
"(",
"innerBytes",
")",
")",
")",
"\n",
"reflect",
".",
"Copy",
"(",
"val",
",",
"reflect",
".",
"ValueOf",
"(",
"innerBytes",
")",
")",
"\n",
"return",
"\n",
"}",
"\n",
"newSlice",
",",
"err1",
":=",
"parseSequenceOf",
"(",
"innerBytes",
",",
"sliceType",
",",
"sliceType",
".",
"Elem",
"(",
")",
")",
"\n",
"if",
"err1",
"==",
"nil",
"{",
"val",
".",
"Set",
"(",
"newSlice",
")",
"\n",
"}",
"\n",
"err",
"=",
"err1",
"\n",
"return",
"\n",
"case",
"reflect",
".",
"String",
":",
"var",
"v",
"string",
"\n",
"switch",
"universalTag",
"{",
"case",
"tagPrintableString",
":",
"v",
",",
"err",
"=",
"parsePrintableString",
"(",
"innerBytes",
")",
"\n",
"case",
"tagIA5String",
":",
"v",
",",
"err",
"=",
"parseIA5String",
"(",
"innerBytes",
")",
"\n",
"case",
"tagT61String",
":",
"v",
",",
"err",
"=",
"parseT61String",
"(",
"innerBytes",
")",
"\n",
"case",
"tagUTF8String",
":",
"v",
",",
"err",
"=",
"parseUTF8String",
"(",
"innerBytes",
")",
"\n",
"case",
"tagGeneralString",
":",
"// GeneralString is specified in ISO-2022/ECMA-35,",
"// A brief review suggests that it includes structures",
"// that allow the encoding to change midstring and",
"// such. We give up and pass it as an 8-bit string.",
"v",
",",
"err",
"=",
"parseT61String",
"(",
"innerBytes",
")",
"\n",
"default",
":",
"err",
"=",
"asn1",
".",
"SyntaxError",
"{",
"Msg",
":",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"universalTag",
")",
"}",
"\n",
"}",
"\n",
"if",
"err",
"==",
"nil",
"{",
"val",
".",
"SetString",
"(",
"v",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"err",
"=",
"asn1",
".",
"StructuralError",
"{",
"Msg",
":",
"\"",
"\"",
"+",
"v",
".",
"Type",
"(",
")",
".",
"String",
"(",
")",
"}",
"\n",
"return",
"\n",
"}"
]
|
14,654 | all-14655 | [
"returns",
"a",
"subset",
"of",
"a",
"buffer",
"object",
"s",
"data",
"store"
]
| [
"func",
"GetBufferSubData",
"(",
"target",
"uint32",
",",
"offset",
"int",
",",
"size",
"int",
",",
"data",
"unsafe",
".",
"Pointer",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpGetBufferSubData",
",",
"4",
",",
"uintptr",
"(",
"target",
")",
",",
"uintptr",
"(",
"offset",
")",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"data",
")",
",",
"0",
",",
"0",
")",
"\n",
"}"
]
|
14,655 | all-14656 | [
"SetPageIncrement",
"is",
"a",
"wrapper",
"around",
"gtk_adjustment_set_page_increment",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"Adjustment",
")",
"SetPageIncrement",
"(",
"<mask>",
"float64",
")",
"{",
"C",
".",
"gtk_adjustment_set_page_increment",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gdouble",
"(",
"value",
")",
")",
"\n",
"}"
]
|
14,656 | all-14657 | [
"extractClasses",
"extracts",
"and",
"returns",
"classes",
"."
]
| [
"func",
"extractClasses",
"(",
"s",
"string",
")",
"[",
"]",
"string",
"{",
"var",
"classes",
"[",
"]",
"string",
"\n\n",
"for",
"i",
",",
"token",
":=",
"range",
"strings",
".",
"Split",
"(",
"s",
",",
"dot",
")",
"{",
"if",
"i",
"==",
"0",
"{",
"continue",
"\n",
"}",
"\n\n",
"class",
":=",
"strings",
".",
"Split",
"(",
"token",
",",
"sharp",
")",
"[",
"0",
"]",
"\n\n",
"if",
"<mask>",
"==",
"\"",
"\"",
"{",
"continue",
"\n",
"}",
"\n\n",
"classes",
"=",
"append",
"(",
"classes",
",",
"class",
")",
"\n",
"}",
"\n\n",
"return",
"classes",
"\n",
"}"
]
|
14,657 | all-14658 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
]
| [
"func",
"(",
"v",
"SearchInContentParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger21",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
]
|
14,658 | all-14659 | [
"GetPSID",
"fetches",
"user",
"s",
"page",
"scoped",
"id",
"during",
"authentication",
"flow",
"one",
"must",
"supply",
"a",
"valid",
"and",
"not",
"expired",
"authentication",
"token",
"provided",
"by",
"facebook",
"https",
":",
"//",
"developers",
".",
"facebook",
".",
"com",
"/",
"docs",
"/",
"messenger",
"-",
"platform",
"/",
"account",
"-",
"linking",
"/",
"authentication"
]
| [
"func",
"(",
"m",
"*",
"Messenger",
")",
"GetPSID",
"(",
"token",
"string",
")",
"(",
"*",
"string",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"m",
".",
"doRequest",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"GraphAPI",
"+",
"\"",
"\"",
",",
"token",
")",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n",
"read",
",",
"err",
":=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"if",
"resp",
".",
"StatusCode",
"!=",
"http",
".",
"StatusOK",
"{",
"er",
":=",
"new",
"(",
"rawError",
")",
"\n",
"json",
".",
"Unmarshal",
"(",
"read",
",",
"<mask>",
")",
"\n",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
"+",
"er",
".",
"Error",
".",
"Message",
")",
"\n",
"}",
"\n",
"acc",
":=",
"new",
"(",
"accountLinking",
")",
"\n",
"return",
"&",
"acc",
".",
"Recipient",
",",
"json",
".",
"Unmarshal",
"(",
"read",
",",
"acc",
")",
"\n",
"}"
]
|
14,659 | all-14660 | [
"DeleteProject",
"unsets",
"the",
"project",
"id",
"from",
"the",
"path",
"and",
"clears",
"the",
"quota",
"for",
"the",
"project",
"id"
]
| [
"func",
"DeleteProject",
"(",
"path",
"string",
",",
"id",
"uint32",
")",
"error",
"{",
"// Unset the project from the path",
"err",
":=",
"SetProject",
"(",
"path",
",",
"0",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Unset the quota on the project",
"err",
"=",
"SetProjectQuota",
"(",
"path",
",",
"<mask>",
",",
"0",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
]
|
14,660 | all-14661 | [
"load",
"pre",
"-",
"compiled",
"shader",
"binaries"
]
| [
"func",
"ShaderBinary",
"(",
"count",
"int32",
",",
"shaders",
"*",
"uint32",
",",
"binaryformat",
"uint32",
",",
"binary",
"unsafe",
".",
"Pointer",
",",
"length",
"int32",
")",
"{",
"C",
".",
"glowShaderBinary",
"(",
"gpShaderBinary",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"count",
")",
",",
"(",
"*",
"C",
".",
"GLuint",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"shaders",
")",
")",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"binaryformat",
")",
",",
"<mask>",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"length",
")",
")",
"\n",
"}"
]
|
14,661 | all-14662 | [
"GetSize",
"returns",
"the",
"dimensions",
"of",
"the",
"given",
"terminal",
"."
]
| [
"func",
"GetSize",
"(",
"fd",
"int",
")",
"(",
"width",
",",
"height",
"int",
",",
"err",
"error",
")",
"{",
"var",
"info",
"windows",
".",
"ConsoleScreenBufferInfo",
"\n",
"if",
"err",
":=",
"windows",
".",
"GetConsoleScreenBufferInfo",
"(",
"windows",
".",
"Handle",
"(",
"fd",
")",
",",
"&",
"info",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"0",
",",
"err",
"\n",
"}",
"\n",
"return",
"int",
"(",
"info",
".",
"Size",
".",
"X",
")",
",",
"int",
"(",
"<mask>",
".",
"Size",
".",
"Y",
")",
",",
"nil",
"\n",
"}"
]
|
14,662 | all-14663 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
]
| [
"func",
"(",
"v",
"GetCertificateReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork36",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
]
|
14,663 | all-14664 | [
"Friendly",
"returns",
"a",
"friendly",
"international",
"representation",
"of",
"the",
"phone",
"number",
"for",
"example",
"+",
"14105554092",
"is",
"returned",
"as",
"+",
"1",
"410",
"-",
"555",
"-",
"4092",
".",
"If",
"the",
"phone",
"number",
"is",
"not",
"in",
"E",
".",
"164",
"format",
"we",
"try",
"to",
"parse",
"it",
"as",
"a",
"US",
"number",
".",
"If",
"we",
"cannot",
"parse",
"it",
"as",
"a",
"US",
"number",
"it",
"is",
"returned",
"as",
"is",
"."
]
| [
"func",
"(",
"pn",
"PhoneNumber",
")",
"Friendly",
"(",
")",
"string",
"{",
"num",
",",
"<mask>",
":=",
"libphonenumber",
".",
"Parse",
"(",
"string",
"(",
"pn",
")",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"string",
"(",
"pn",
")",
"\n",
"}",
"\n",
"return",
"libphonenumber",
".",
"Format",
"(",
"num",
",",
"libphonenumber",
".",
"INTERNATIONAL",
")",
"\n",
"}"
]
|
14,664 | all-14665 | [
"ImageNewFromResource",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_image_new_from_resource",
"()",
"."
]
| [
"func",
"ImageNewFromResource",
"(",
"resourcePath",
"string",
")",
"(",
"*",
"<mask>",
",",
"error",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"resourcePath",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"c",
":=",
"C",
".",
"gtk_image_new_from_resource",
"(",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"obj",
":=",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"\n",
"return",
"wrapImage",
"(",
"obj",
")",
",",
"nil",
"\n",
"}"
]
|
14,665 | all-14666 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
]
| [
"func",
"(",
"v",
"*",
"Request",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork25",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
]
|
14,666 | all-14667 | [
"Ticker",
"calls",
"the",
"given",
"ProcessFunc",
"every",
"time",
"the",
"ticker",
"fires",
".",
"This",
"is",
"sequentially",
"rate",
"limited",
"only",
"one",
"call",
"will",
"be",
"in",
"-",
"flight",
"at",
"a",
"time",
"."
]
| [
"func",
"Ticker",
"(",
"ticker",
"<-",
"chan",
"time",
".",
"Time",
",",
"procfunc",
"gp",
".",
"ProcessFunc",
")",
"gp",
".",
"<mask>",
"{",
"return",
"gp",
".",
"Go",
"(",
"callOnTicker",
"(",
"ticker",
",",
"procfunc",
")",
")",
"\n",
"}"
]
|
14,667 | all-14668 | [
"MarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Marshaler",
"."
]
| [
"func",
"(",
"t",
"KeyPathType",
")",
"MarshalEasyJSON",
"(",
"out",
"*",
"jwriter",
".",
"<mask>",
")",
"{",
"out",
".",
"String",
"(",
"string",
"(",
"t",
")",
")",
"\n",
"}"
]
|
14,668 | all-14669 | [
"true",
"if",
"the",
"element",
"is",
"inline",
"one"
]
| [
"func",
"(",
"e",
"*",
"htmlTag",
")",
"IsBlockElement",
"(",
")",
"bool",
"{",
"if",
"inline",
",",
"found",
":=",
"inlineElements",
"[",
"e",
".",
"tagName",
"]",
";",
"<mask>",
"{",
"return",
"!",
"inline",
"\n",
"}",
"else",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}"
]
|
14,669 | all-14670 | [
"User",
"returns",
"the",
"user",
"with",
"the",
"given",
"username",
".",
"Error",
"is",
"set",
"to",
"ErrMissingUser",
"if",
"user",
"is",
"not",
"found",
"."
]
| [
"func",
"(",
"m",
"MongoDb",
")",
"User",
"(",
"username",
"string",
")",
"(",
"user",
"models",
".",
"User",
",",
"e",
"error",
")",
"{",
"c",
":=",
"m",
".",
"Connect",
"(",
"models",
".",
"COLL_NAME_USER",
")",
"\n",
"defer",
"m",
".",
"Close",
"(",
"c",
")",
"\n",
"err",
":=",
"c",
".",
"Find",
"(",
"bson",
".",
"M",
"{",
"\"",
"\"",
":",
"username",
"}",
")",
".",
"One",
"(",
"&",
"user",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"user",
",",
"ErrMissingUser",
"\n",
"}",
"\n",
"return",
"<mask>",
",",
"nil",
"\n",
"}"
]
|
14,670 | all-14671 | [
"SetCookie",
"sets",
"given",
"cookie",
"value",
"to",
"response",
"header",
".",
"FIXME",
":",
"IE",
"support?",
"http",
":",
"//",
"golanghome",
".",
"com",
"/",
"post",
"/",
"620#reply2"
]
| [
"func",
"(",
"ctx",
"*",
"Context",
")",
"SetCookie",
"(",
"name",
"string",
",",
"value",
"string",
",",
"others",
"...",
"interface",
"{",
"}",
")",
"{",
"cookie",
":=",
"http",
".",
"Cookie",
"{",
"}",
"\n",
"cookie",
".",
"Name",
"=",
"name",
"\n",
"cookie",
".",
"Value",
"=",
"url",
".",
"QueryEscape",
"(",
"value",
")",
"\n\n",
"if",
"len",
"(",
"others",
")",
">",
"0",
"{",
"switch",
"v",
":=",
"others",
"[",
"0",
"]",
".",
"(",
"type",
")",
"{",
"case",
"int",
":",
"cookie",
".",
"MaxAge",
"=",
"v",
"\n",
"case",
"int64",
":",
"cookie",
".",
"MaxAge",
"=",
"int",
"(",
"v",
")",
"\n",
"case",
"int32",
":",
"cookie",
".",
"MaxAge",
"=",
"int",
"(",
"v",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"cookie",
".",
"Path",
"=",
"\"",
"\"",
"\n",
"if",
"len",
"(",
"others",
")",
">",
"1",
"{",
"if",
"v",
",",
"ok",
":=",
"others",
"[",
"1",
"]",
".",
"(",
"string",
")",
";",
"ok",
"&&",
"len",
"(",
"v",
")",
">",
"0",
"{",
"cookie",
".",
"Path",
"=",
"v",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"others",
")",
">",
"2",
"{",
"if",
"v",
",",
"ok",
":=",
"others",
"[",
"2",
"]",
".",
"(",
"string",
")",
";",
"ok",
"&&",
"len",
"(",
"v",
")",
">",
"0",
"{",
"<mask>",
".",
"Domain",
"=",
"v",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"others",
")",
">",
"3",
"{",
"switch",
"v",
":=",
"others",
"[",
"3",
"]",
".",
"(",
"type",
")",
"{",
"case",
"bool",
":",
"cookie",
".",
"Secure",
"=",
"v",
"\n",
"default",
":",
"if",
"others",
"[",
"3",
"]",
"!=",
"nil",
"{",
"cookie",
".",
"Secure",
"=",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"others",
")",
">",
"4",
"{",
"if",
"v",
",",
"ok",
":=",
"others",
"[",
"4",
"]",
".",
"(",
"bool",
")",
";",
"ok",
"&&",
"v",
"{",
"cookie",
".",
"HttpOnly",
"=",
"true",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"others",
")",
">",
"5",
"{",
"if",
"v",
",",
"ok",
":=",
"others",
"[",
"5",
"]",
".",
"(",
"time",
".",
"Time",
")",
";",
"ok",
"{",
"cookie",
".",
"Expires",
"=",
"v",
"\n",
"cookie",
".",
"RawExpires",
"=",
"v",
".",
"Format",
"(",
"time",
".",
"UnixDate",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"ctx",
".",
"Resp",
".",
"Header",
"(",
")",
".",
"Add",
"(",
"\"",
"\"",
",",
"cookie",
".",
"String",
"(",
")",
")",
"\n",
"}"
]
|
14,671 | all-14672 | [
"HasSeconds",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"p",
"*",
"Period",
")",
"HasSeconds",
"(",
")",
"bool",
"{",
"if",
"p",
"!=",
"nil",
"&&",
"p",
".",
"Seconds",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
]
|
14,672 | all-14673 | [
"RunWorkload",
"runs",
"a",
"test",
"workload",
"against",
"a",
"Pachyderm",
"cluster",
"."
]
| [
"func",
"RunWorkload",
"(",
"client",
"*",
"client",
".",
"APIClient",
",",
"rand",
"*",
"rand",
".",
"Rand",
",",
"size",
"int",
",",
")",
"error",
"{",
"worker",
":=",
"newWorker",
"(",
"rand",
")",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
"{",
"if",
"err",
":=",
"<mask>",
".",
"work",
"(",
"client",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"_",
",",
"job",
":=",
"range",
"worker",
".",
"startedJobs",
"{",
"jobInfo",
",",
"err",
":=",
"client",
".",
"InspectJob",
"(",
"job",
".",
"ID",
",",
"true",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"jobInfo",
".",
"State",
"!=",
"pps",
".",
"JobState_JOB_SUCCESS",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"job",
".",
"ID",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
]
|
14,673 | all-14674 | [
"watchDir",
"listens",
"for",
"file",
"system",
"changes",
"in",
"root",
"and",
"its",
"subdirectories",
".",
"The",
"record",
"function",
"is",
"called",
"with",
"directories",
"whose",
"contents",
"have",
"changed",
".",
"New",
"directories",
"are",
"watched",
"recursively",
".",
"The",
"returned",
"cancel",
"function",
"may",
"be",
"called",
"to",
"stop",
"watching",
"."
]
| [
"func",
"watchDir",
"(",
"root",
"string",
",",
"record",
"func",
"(",
"string",
")",
")",
"(",
"cancel",
"func",
"(",
")",
",",
"err",
"error",
")",
"{",
"w",
",",
"err",
":=",
"fsnotify",
".",
"NewWatcher",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"dirs",
",",
"errs",
":=",
"listDirs",
"(",
"root",
")",
"\n",
"for",
"_",
",",
"err",
":=",
"range",
"errs",
"{",
"log",
".",
"Print",
"(",
"err",
")",
"\n",
"}",
"\n",
"gitDir",
":=",
"filepath",
".",
"Join",
"(",
"root",
",",
"\"",
"\"",
")",
"\n",
"for",
"_",
",",
"dir",
":=",
"range",
"dirs",
"{",
"if",
"dir",
"==",
"gitDir",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"err",
":=",
"w",
".",
"Add",
"(",
"dir",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"Print",
"(",
"err",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"done",
":=",
"make",
"(",
"chan",
"struct",
"{",
"}",
")",
"\n",
"go",
"func",
"(",
")",
"{",
"for",
"{",
"select",
"{",
"case",
"ev",
":=",
"<-",
"w",
".",
"Events",
":",
"if",
"shouldIgnore",
"(",
"ev",
".",
"Name",
")",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"ev",
".",
"Op",
"==",
"fsnotify",
".",
"Create",
"{",
"if",
"st",
",",
"err",
":=",
"os",
".",
"Lstat",
"(",
"ev",
".",
"Name",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"Print",
"(",
"err",
")",
"\n",
"}",
"else",
"if",
"st",
".",
"IsDir",
"(",
")",
"{",
"dirs",
",",
"errs",
":=",
"listDirs",
"(",
"ev",
".",
"Name",
")",
"\n",
"for",
"_",
",",
"err",
":=",
"range",
"errs",
"{",
"log",
".",
"Print",
"(",
"err",
")",
"\n",
"}",
"\n",
"for",
"_",
",",
"dir",
":=",
"range",
"dirs",
"{",
"if",
"err",
":=",
"w",
".",
"Add",
"(",
"dir",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"Print",
"(",
"err",
")",
"\n",
"}",
"\n",
"recordWrite",
"(",
"dir",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"else",
"{",
"recordWrite",
"(",
"filepath",
".",
"Dir",
"(",
"ev",
".",
"Name",
")",
")",
"\n",
"}",
"\n",
"case",
"err",
":=",
"<-",
"w",
".",
"Errors",
":",
"log",
".",
"Print",
"(",
"err",
")",
"\n",
"case",
"<-",
"done",
":",
"if",
"err",
":=",
"w",
".",
"Close",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"<mask>",
".",
"Print",
"(",
"err",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n",
"return",
"func",
"(",
")",
"{",
"close",
"(",
"done",
")",
"}",
",",
"nil",
"\n",
"}"
]
|
14,674 | all-14675 | [
"Path",
"-----------------------------------------------------------------------",
"NewPath",
"returns",
"a",
"static",
"URL",
"path",
"matcher",
"."
]
| [
"func",
"NewPath",
"(",
"<mask>",
"string",
")",
"Path",
"{",
"if",
"!",
"strings",
".",
"HasPrefix",
"(",
"path",
",",
"\"",
"\"",
")",
"{",
"path",
"=",
"\"",
"\"",
"+",
"path",
"\n",
"}",
"\n",
"return",
"Path",
"(",
"path",
")",
"\n",
"}"
]
|
14,675 | all-14676 | [
"SetConfigFromFlags",
"configures",
"the",
"driver",
"with",
"the",
"object",
"that",
"was",
"returned",
"by",
"RegisterCreateFlags"
]
| [
"func",
"(",
"d",
"*",
"Driver",
")",
"SetConfigFromFlags",
"(",
"flags",
"drivers",
".",
"DriverOptions",
")",
"error",
"{",
"d",
".",
"URL",
"=",
"flags",
".",
"String",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"APIKey",
"=",
"flags",
".",
"String",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"APISecretKey",
"=",
"flags",
".",
"String",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"InstanceProfile",
"=",
"flags",
".",
"String",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"DiskSize",
"=",
"int64",
"(",
"flags",
".",
"Int",
"(",
"\"",
"\"",
")",
")",
"\n",
"d",
".",
"Image",
"=",
"flags",
".",
"String",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"SecurityGroups",
"=",
"flags",
".",
"StringSlice",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"AffinityGroups",
"=",
"flags",
".",
"StringSlice",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"AvailabilityZone",
"=",
"flags",
".",
"String",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"SSHUser",
"=",
"flags",
".",
"<mask>",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"SSHKey",
"=",
"flags",
".",
"String",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"UserDataFile",
"=",
"flags",
".",
"String",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"UserData",
"=",
"[",
"]",
"byte",
"(",
"defaultCloudInit",
")",
"\n",
"d",
".",
"SetSwarmConfigFromFlags",
"(",
"flags",
")",
"\n\n",
"if",
"d",
".",
"URL",
"==",
"\"",
"\"",
"{",
"d",
".",
"URL",
"=",
"defaultAPIEndpoint",
"\n",
"}",
"\n",
"if",
"d",
".",
"APIKey",
"==",
"\"",
"\"",
"||",
"d",
".",
"APISecretKey",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
]
|
14,676 | all-14677 | [
"ParseFile",
"parses",
"the",
"specified",
"files",
"."
]
| [
"func",
"ParseFile",
"(",
"files",
"...",
"string",
")",
"(",
"[",
"]",
"*",
"Group",
",",
"error",
")",
"{",
"var",
"groups",
"[",
"]",
"*",
"Group",
"\n",
"for",
"_",
",",
"file",
":=",
"range",
"files",
"{",
"if",
"err",
":=",
"func",
"(",
"file",
"string",
")",
"error",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"file",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defer",
"f",
".",
"Close",
"(",
")",
"\n",
"gs",
",",
"err",
":=",
"Parse",
"(",
"file",
",",
"f",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"groups",
"=",
"append",
"(",
"<mask>",
",",
"gs",
"...",
")",
"\n",
"return",
"nil",
"\n",
"}",
"(",
"file",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"groups",
",",
"nil",
"\n",
"}"
]
|
14,677 | all-14678 | [
"Wackiness",
"varies",
"Cleverbot’s",
"reply",
"from",
"sensible",
"to",
"wacky",
".",
"Accepted",
"values",
"between",
"0",
"and",
"100"
]
| [
"func",
"(",
"s",
"*",
"Session",
")",
"Wackiness",
"(",
"val",
"uint8",
")",
"{",
"if",
"val",
">",
"100",
"{",
"val",
"=",
"100",
"\n",
"}",
"\n",
"s",
".",
"Values",
".",
"<mask>",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprint",
"(",
"val",
")",
")",
"\n",
"}"
]
|
14,678 | all-14679 | [
"Do",
"executes",
"Input",
".",
"dispatchMouseEvent",
"against",
"the",
"provided",
"context",
"."
]
| [
"func",
"(",
"p",
"*",
"DispatchMouseEventParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandDispatchMouseEvent",
",",
"p",
",",
"nil",
")",
"\n",
"}"
]
|
14,679 | all-14680 | [
"NewService",
"creates",
"a",
"new",
"MockService",
"with",
"default",
"settings",
"."
]
| [
"func",
"(",
"m",
"*",
"MockService",
")",
"NewService",
"(",
"args",
"[",
"]",
"string",
")",
"Service",
"{",
"m",
".",
"Args",
"=",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"}",
"\n",
"m",
".",
"Args",
"=",
"<mask>",
"(",
"m",
".",
"Args",
",",
"args",
"...",
")",
"\n\n",
"m",
".",
"Cmd",
"=",
"getMockServiceCommandPath",
"(",
")",
"\n",
"return",
"m",
"\n",
"}"
]
|
14,680 | all-14681 | [
"resourceVSphereComputeClusterFlattenData",
"saves",
"the",
"configuration",
"attributes",
"from",
"a",
"ClusterComputeResource",
"into",
"the",
"supplied",
"ResourceData",
".",
"It",
"also",
"saves",
"the",
"root",
"resource",
"pool",
"for",
"the",
"cluster",
"in",
"resource_pool_id",
".",
"Note",
"that",
"other",
"functions",
"handle",
"other",
"non",
"-",
"configuration",
"related",
"items",
"such",
"as",
"path",
"name",
"tags",
"and",
"custom",
"attributes",
"."
]
| [
"func",
"resourceVSphereComputeClusterFlattenData",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"meta",
"<mask>",
"{",
"}",
",",
"cluster",
"*",
"object",
".",
"ClusterComputeResource",
",",
")",
"error",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"resourceVSphereComputeClusterIDString",
"(",
"d",
")",
")",
"\n",
"client",
",",
"err",
":=",
"resourceVSphereComputeClusterClient",
"(",
"meta",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Get the version of the vSphere connection to help determine what",
"// attributes we need to set",
"version",
":=",
"viapi",
".",
"ParseVersionFromClient",
"(",
"client",
")",
"\n\n",
"props",
",",
"err",
":=",
"clustercomputeresource",
".",
"Properties",
"(",
"cluster",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Save the root resource pool ID so that it can be passed on to other",
"// resources without having to resort to the data source.",
"if",
"err",
":=",
"d",
".",
"Set",
"(",
"\"",
"\"",
",",
"props",
".",
"ResourcePool",
".",
"Value",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"flattenClusterConfigSpecEx",
"(",
"d",
",",
"props",
".",
"ConfigurationEx",
".",
"(",
"*",
"types",
".",
"ClusterConfigInfoEx",
")",
",",
"version",
")",
"\n",
"}"
]
|
14,681 | all-14682 | [
"appendMarkTombstone",
"appends",
"tombstone",
"mark",
"to",
"normal",
"revision",
"bytes",
"."
]
| [
"func",
"appendMarkTombstone",
"(",
"lg",
"*",
"zap",
".",
"Logger",
",",
"b",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"if",
"len",
"(",
"b",
")",
"!=",
"revBytesLen",
"{",
"if",
"lg",
"!=",
"nil",
"{",
"lg",
".",
"Panic",
"(",
"\"",
"\"",
",",
"zap",
".",
"Int",
"(",
"\"",
"\"",
",",
"revBytesLen",
")",
",",
"zap",
".",
"Int",
"(",
"\"",
"\"",
",",
"len",
"(",
"b",
")",
")",
",",
")",
"\n",
"}",
"else",
"{",
"plog",
".",
"Panicf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"<mask>",
"(",
"b",
",",
"markTombstone",
")",
"\n",
"}"
]
|
14,682 | all-14683 | [
"GetMonitorAtWindow",
"is",
"a",
"wrapper",
"around",
"gdk_screen_get_monitor_at_window",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"Screen",
")",
"GetMonitorAtWindow",
"(",
"w",
"*",
"Window",
")",
"int",
"{",
"<mask>",
"int",
"(",
"C",
".",
"gdk_screen_get_monitor_at_window",
"(",
"v",
".",
"native",
"(",
")",
",",
"w",
".",
"native",
"(",
")",
")",
")",
"\n",
"}"
]
|
14,683 | all-14684 | [
"WithObjectGroup",
"symbolic",
"group",
"name",
"that",
"can",
"be",
"used",
"to",
"release",
"multiple",
"objects",
".",
"If",
"objectGroup",
"is",
"not",
"specified",
"and",
"objectId",
"is",
"objectGroup",
"will",
"be",
"inherited",
"from",
"object",
"."
]
| [
"func",
"(",
"p",
"CallFunctionOnParams",
")",
"WithObjectGroup",
"(",
"objectGroup",
"<mask>",
")",
"*",
"CallFunctionOnParams",
"{",
"p",
".",
"ObjectGroup",
"=",
"objectGroup",
"\n",
"return",
"&",
"p",
"\n",
"}"
]
|
14,684 | all-14685 | [
"AddActionWidget",
"is",
"a",
"wrapper",
"around",
"gtk_assistant_add_action_widget",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"Assistant",
")",
"AddActionWidget",
"(",
"<mask>",
"IWidget",
")",
"{",
"C",
".",
"gtk_assistant_add_action_widget",
"(",
"v",
".",
"native",
"(",
")",
",",
"child",
".",
"toWidget",
"(",
")",
")",
"\n",
"}"
]
|
14,685 | all-14686 | [
"HasPrecision",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"a",
"*",
"AlertValueDefinition",
")",
"HasPrecision",
"(",
")",
"bool",
"{",
"if",
"a",
"!=",
"nil",
"&&",
"a",
".",
"Precision",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
]
|
14,686 | all-14687 | [
"LeaseByTag",
"leases",
"tasks",
"from",
"a",
"queue",
"grouped",
"by",
"tag",
".",
"If",
"tag",
"is",
"empty",
"then",
"the",
"returned",
"tasks",
"are",
"grouped",
"by",
"the",
"tag",
"of",
"the",
"task",
"with",
"earliest",
"ETA",
".",
"leaseTime",
"is",
"in",
"seconds",
".",
"The",
"number",
"of",
"tasks",
"fetched",
"will",
"be",
"at",
"most",
"maxTasks",
"."
]
| [
"func",
"LeaseByTag",
"(",
"c",
"context",
".",
"Context",
",",
"maxTasks",
"int",
",",
"queueName",
"string",
",",
"leaseTime",
"int",
",",
"tag",
"string",
")",
"(",
"[",
"]",
"*",
"Task",
",",
"error",
")",
"{",
"return",
"lease",
"(",
"c",
",",
"maxTasks",
",",
"queueName",
",",
"leaseTime",
",",
"true",
",",
"[",
"]",
"byte",
"(",
"<mask>",
")",
")",
"\n",
"}"
]
|
14,687 | all-14688 | [
"TimeToLiveHTTP",
"retrieves",
"lease",
"information",
"of",
"the",
"given",
"lease",
"ID",
"."
]
| [
"func",
"TimeToLiveHTTP",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"lease",
".",
"LeaseID",
",",
"keys",
"bool",
",",
"url",
"string",
",",
"rt",
"http",
".",
"RoundTripper",
")",
"(",
"*",
"leasepb",
".",
"LeaseInternalResponse",
",",
"error",
")",
"{",
"// will post lreq protobuf to leader",
"lreq",
",",
"err",
":=",
"(",
"&",
"leasepb",
".",
"LeaseInternalRequest",
"{",
"LeaseTimeToLiveRequest",
":",
"&",
"pb",
".",
"LeaseTimeToLiveRequest",
"{",
"ID",
":",
"int64",
"(",
"id",
")",
",",
"Keys",
":",
"keys",
",",
"}",
",",
"}",
")",
".",
"Marshal",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"req",
",",
"err",
":=",
"http",
".",
"NewRequest",
"(",
"\"",
"\"",
",",
"url",
",",
"bytes",
".",
"NewReader",
"(",
"lreq",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"req",
".",
"<mask>",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n\n",
"req",
"=",
"req",
".",
"WithContext",
"(",
"ctx",
")",
"\n\n",
"cc",
":=",
"&",
"http",
".",
"Client",
"{",
"Transport",
":",
"rt",
"}",
"\n",
"var",
"b",
"[",
"]",
"byte",
"\n",
"// buffer errc channel so that errc don't block inside the go routinue",
"resp",
",",
"err",
":=",
"cc",
".",
"Do",
"(",
"req",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"b",
",",
"err",
"=",
"readResponse",
"(",
"resp",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"resp",
".",
"StatusCode",
"==",
"http",
".",
"StatusRequestTimeout",
"{",
"return",
"nil",
",",
"ErrLeaseHTTPTimeout",
"\n",
"}",
"\n",
"if",
"resp",
".",
"StatusCode",
"==",
"http",
".",
"StatusNotFound",
"{",
"return",
"nil",
",",
"lease",
".",
"ErrLeaseNotFound",
"\n",
"}",
"\n",
"if",
"resp",
".",
"StatusCode",
"!=",
"http",
".",
"StatusOK",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"string",
"(",
"b",
")",
")",
"\n",
"}",
"\n\n",
"lresp",
":=",
"&",
"leasepb",
".",
"LeaseInternalResponse",
"{",
"}",
"\n",
"if",
"err",
":=",
"lresp",
".",
"Unmarshal",
"(",
"b",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"`lease: %v. data = \"%s\"`",
",",
"err",
",",
"string",
"(",
"b",
")",
")",
"\n",
"}",
"\n",
"if",
"lresp",
".",
"LeaseTimeToLiveResponse",
".",
"ID",
"!=",
"int64",
"(",
"id",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"lresp",
",",
"nil",
"\n",
"}"
]
|
14,688 | all-14689 | [
"execute",
"implements",
"v3filter",
"type",
"for",
"VM",
"based",
"RAR",
"3",
"filters",
"."
]
| [
"func",
"(",
"f",
"*",
"vmFilter",
")",
"execute",
"(",
"r",
"map",
"[",
"int",
"]",
"uint32",
",",
"global",
",",
"buf",
"[",
"]",
"byte",
",",
"offset",
"int64",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"len",
"(",
"buf",
")",
">",
"vmGlobalAddr",
"{",
"return",
"buf",
",",
"errInvalidFilter",
"\n",
"}",
"\n",
"v",
":=",
"newVM",
"(",
"buf",
")",
"\n\n",
"// register setup",
"v",
".",
"r",
"[",
"3",
"]",
"=",
"vmGlobalAddr",
"\n",
"v",
".",
"r",
"[",
"4",
"]",
"=",
"uint32",
"(",
"len",
"(",
"buf",
")",
")",
"\n",
"v",
".",
"r",
"[",
"5",
"]",
"=",
"f",
".",
"execCount",
"\n",
"for",
"i",
",",
"n",
":=",
"<mask>",
"r",
"{",
"v",
".",
"r",
"[",
"i",
"]",
"=",
"n",
"\n",
"}",
"\n\n",
"// vm global data memory block",
"vg",
":=",
"v",
".",
"m",
"[",
"vmGlobalAddr",
":",
"vmGlobalAddr",
"+",
"vmGlobalSize",
"]",
"\n\n",
"// initialize fixed global memory",
"for",
"i",
",",
"n",
":=",
"range",
"v",
".",
"r",
"[",
":",
"vmRegs",
"-",
"1",
"]",
"{",
"binary",
".",
"LittleEndian",
".",
"PutUint32",
"(",
"vg",
"[",
"i",
"*",
"4",
":",
"]",
",",
"n",
")",
"\n",
"}",
"\n",
"binary",
".",
"LittleEndian",
".",
"PutUint32",
"(",
"vg",
"[",
"0x1c",
":",
"]",
",",
"uint32",
"(",
"len",
"(",
"buf",
")",
")",
")",
"\n",
"binary",
".",
"LittleEndian",
".",
"PutUint64",
"(",
"vg",
"[",
"0x24",
":",
"]",
",",
"uint64",
"(",
"offset",
")",
")",
"\n",
"binary",
".",
"LittleEndian",
".",
"PutUint32",
"(",
"vg",
"[",
"0x2c",
":",
"]",
",",
"f",
".",
"execCount",
")",
"\n\n",
"// registers",
"v",
".",
"r",
"[",
"6",
"]",
"=",
"uint32",
"(",
"offset",
")",
"\n\n",
"// copy program global memory",
"var",
"n",
"int",
"\n",
"if",
"len",
"(",
"f",
".",
"global",
")",
">",
"0",
"{",
"n",
"=",
"copy",
"(",
"vg",
"[",
"vmFixedGlobalSize",
":",
"]",
",",
"f",
".",
"global",
")",
"// use saved global instead",
"\n",
"}",
"else",
"{",
"n",
"=",
"copy",
"(",
"vg",
"[",
"vmFixedGlobalSize",
":",
"]",
",",
"global",
")",
"\n",
"}",
"\n",
"copy",
"(",
"vg",
"[",
"vmFixedGlobalSize",
"+",
"n",
":",
"]",
",",
"f",
".",
"static",
")",
"\n\n",
"v",
".",
"execute",
"(",
"f",
".",
"code",
")",
"\n\n",
"f",
".",
"execCount",
"++",
"\n\n",
"// keep largest global buffer",
"if",
"cap",
"(",
"global",
")",
">",
"cap",
"(",
"f",
".",
"global",
")",
"{",
"f",
".",
"global",
"=",
"global",
"[",
":",
"0",
"]",
"\n",
"}",
"else",
"if",
"len",
"(",
"f",
".",
"global",
")",
">",
"0",
"{",
"f",
".",
"global",
"=",
"f",
".",
"global",
"[",
":",
"0",
"]",
"\n",
"}",
"\n\n",
"// check for global data to be saved for next program execution",
"globalSize",
":=",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"vg",
"[",
"0x30",
":",
"]",
")",
"\n",
"if",
"globalSize",
">",
"0",
"{",
"if",
"globalSize",
">",
"vmGlobalSize",
"-",
"vmFixedGlobalSize",
"{",
"globalSize",
"=",
"vmGlobalSize",
"-",
"vmFixedGlobalSize",
"\n",
"}",
"\n",
"if",
"cap",
"(",
"f",
".",
"global",
")",
"<",
"int",
"(",
"globalSize",
")",
"{",
"f",
".",
"global",
"=",
"make",
"(",
"[",
"]",
"byte",
",",
"globalSize",
")",
"\n",
"}",
"else",
"{",
"f",
".",
"global",
"=",
"f",
".",
"global",
"[",
":",
"globalSize",
"]",
"\n",
"}",
"\n",
"copy",
"(",
"f",
".",
"global",
",",
"vg",
"[",
"vmFixedGlobalSize",
":",
"]",
")",
"\n",
"}",
"\n\n",
"// find program output",
"length",
":=",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"vg",
"[",
"0x1c",
":",
"]",
")",
"&",
"vmMask",
"\n",
"start",
":=",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"vg",
"[",
"0x20",
":",
"]",
")",
"&",
"vmMask",
"\n",
"if",
"start",
"+",
"length",
">",
"vmSize",
"{",
"// TODO: error",
"start",
"=",
"0",
"\n",
"length",
"=",
"0",
"\n",
"}",
"\n",
"if",
"start",
"!=",
"0",
"&&",
"cap",
"(",
"v",
".",
"m",
")",
">",
"cap",
"(",
"buf",
")",
"{",
"// Initial buffer was to small for vm.",
"// Copy output to beginning of vm memory so that decodeReader",
"// will re-use the newly allocated vm memory and we will not",
"// have to reallocate again next time.",
"copy",
"(",
"v",
".",
"m",
",",
"v",
".",
"m",
"[",
"start",
":",
"start",
"+",
"length",
"]",
")",
"\n",
"start",
"=",
"0",
"\n",
"}",
"\n",
"return",
"v",
".",
"m",
"[",
"start",
":",
"start",
"+",
"length",
"]",
",",
"nil",
"\n",
"}"
]
|
14,689 | all-14690 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
]
| [
"func",
"(",
"t",
"*",
"TransferMode",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"TransferMode",
"(",
"in",
".",
"String",
"(",
")",
")",
"{",
"case",
"TransferModeReportEvents",
":",
"*",
"t",
"=",
"TransferModeReportEvents",
"\n",
"case",
"TransferModeReturnAsStream",
":",
"*",
"t",
"=",
"TransferModeReturnAsStream",
"\n\n",
"default",
":",
"in",
".",
"AddError",
"(",
"<mask>",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"}"
]
|
14,690 | all-14691 | [
"MarshalJSON",
"calls",
"json",
".",
"RawMessage",
"method",
"of",
"the",
"same",
"name",
".",
"Required",
"since",
"Var1",
"is",
"of",
"type",
"json",
".",
"RawMessage",
"..."
]
| [
"func",
"(",
"this",
"*",
"Var1",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"x",
":=",
"json",
".",
"RawMessage",
"(",
"*",
"this",
")",
"\n",
"return",
"(",
"&",
"x",
")",
".",
"MarshalJSON",
"(",
")",
"\n",
"}"
]
|
14,691 | all-14692 | [
"Wrap",
"wraps",
"an",
"existing",
"logger",
"filtering",
"the",
"fields",
"as",
"it",
"goes",
"along",
"using",
"the",
"provided",
"filters"
]
| [
"func",
"Wrap",
"(",
"logger",
"log",
".",
"Interface",
",",
"filters",
"...",
"<mask>",
")",
"*",
"Filtered",
"{",
"return",
"&",
"Filtered",
"{",
"Interface",
":",
"logger",
",",
"filters",
":",
"filters",
",",
"}",
"\n",
"}"
]
|
14,692 | all-14693 | [
"AcquireByState",
"checks",
"out",
"resources",
"of",
"a",
"given",
"type",
"without",
"an",
"owner",
"that",
"matches",
"a",
"list",
"of",
"resources",
"names",
".",
"In",
":",
"state",
"-",
"current",
"state",
"of",
"the",
"requested",
"resource",
"dest",
"-",
"destination",
"state",
"of",
"the",
"requested",
"resource",
"owner",
"-",
"requester",
"of",
"the",
"resource",
"names",
"-",
"names",
"of",
"resource",
"to",
"acquire",
"Out",
":",
"A",
"valid",
"list",
"of",
"Resource",
"object",
"on",
"success",
"or",
"ResourceNotFound",
"error",
"if",
"target",
"type",
"resource",
"does",
"not",
"exist",
"in",
"target",
"state",
"."
]
| [
"func",
"(",
"r",
"*",
"Ranch",
")",
"AcquireByState",
"(",
"state",
",",
"dest",
",",
"owner",
"string",
",",
"names",
"[",
"]",
"string",
")",
"(",
"[",
"]",
"common",
".",
"Resource",
",",
"error",
")",
"{",
"r",
".",
"resourcesLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r",
".",
"resourcesLock",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"names",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"rNames",
":=",
"map",
"[",
"string",
"]",
"bool",
"{",
"}",
"\n",
"for",
"_",
",",
"t",
":=",
"range",
"names",
"{",
"rNames",
"[",
"t",
"]",
"=",
"true",
"\n",
"}",
"\n\n",
"allResources",
",",
"err",
":=",
"r",
".",
"Storage",
".",
"GetResources",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logrus",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"&",
"ResourceNotFound",
"{",
"state",
"}",
"\n",
"}",
"\n\n",
"var",
"resources",
"[",
"]",
"common",
".",
"Resource",
"\n\n",
"for",
"idx",
":=",
"range",
"allResources",
"{",
"res",
":=",
"allResources",
"[",
"idx",
"]",
"\n",
"if",
"state",
"==",
"res",
".",
"State",
"{",
"if",
"res",
".",
"Owner",
"!=",
"\"",
"\"",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"rNames",
"[",
"res",
".",
"Name",
"]",
"{",
"res",
".",
"LastUpdate",
"=",
"r",
".",
"UpdateTime",
"(",
")",
"\n",
"res",
".",
"Owner",
"=",
"owner",
"\n",
"res",
".",
"State",
"=",
"dest",
"\n",
"if",
"err",
":=",
"r",
".",
"Storage",
".",
"UpdateResource",
"(",
"res",
")",
";",
"err",
"!=",
"nil",
"{",
"logrus",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"res",
".",
"Name",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"resources",
"=",
"append",
"(",
"resources",
",",
"res",
")",
"\n",
"delete",
"(",
"rNames",
",",
"res",
".",
"Name",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"len",
"(",
"rNames",
")",
"!=",
"0",
"{",
"<mask>",
"missingResources",
"[",
"]",
"string",
"\n",
"for",
"n",
":=",
"range",
"rNames",
"{",
"missingResources",
"=",
"append",
"(",
"missingResources",
",",
"n",
")",
"\n",
"}",
"\n",
"err",
":=",
"&",
"ResourceNotFound",
"{",
"state",
"}",
"\n",
"logrus",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"missingResources",
",",
"\"",
"\"",
")",
")",
"\n",
"return",
"resources",
",",
"err",
"\n",
"}",
"\n",
"return",
"resources",
",",
"nil",
"\n",
"}"
]
|
14,693 | all-14694 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
]
| [
"func",
"(",
"v",
"*",
"KeyframesRule",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation7",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
]
|
14,694 | all-14695 | [
"GetBoolean",
"is",
"a",
"wrapper",
"around",
"g_settings_get_boolean",
"()",
"."
]
| [
"func",
"(",
"v",
"*",
"Settings",
")",
"GetBoolean",
"(",
"name",
"string",
")",
"bool",
"{",
"cstr1",
":=",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"C",
".",
"CString",
"(",
"name",
")",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr1",
")",
")",
"\n\n",
"return",
"gobool",
"(",
"C",
".",
"g_settings_get_boolean",
"(",
"v",
".",
"native",
"(",
")",
",",
"cstr1",
")",
")",
"\n",
"}"
]
|
14,695 | all-14696 | [
"HasTitleAlign",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"t",
"*",
"TraceServiceDefinition",
")",
"HasTitleAlign",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"TitleAlign",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
]
|
14,696 | all-14697 | [
"Generate",
"the",
"twilio",
"capability",
"token",
".",
"Deliver",
"this",
"token",
"to",
"your",
"JS",
"/",
"iOS",
"/",
"Android",
"Twilio",
"client",
"."
]
| [
"func",
"(",
"c",
"*",
"Capability",
")",
"GenerateToken",
"(",
"ttl",
"time",
".",
"Duration",
")",
"(",
"string",
",",
"error",
")",
"{",
"c",
".",
"doBuildIncomingScope",
"(",
")",
"\n",
"c",
".",
"doBuildOutgoingScope",
"(",
")",
"\n",
"now",
":=",
"time",
".",
"Now",
"(",
")",
".",
"UTC",
"(",
")",
"\n",
"cc",
":=",
"&",
"customClaim",
"{",
"Scope",
":",
"strings",
".",
"Join",
"(",
"c",
".",
"capabilities",
",",
"\"",
"\"",
")",
",",
"StandardClaims",
":",
"&",
"jwt",
".",
"StandardClaims",
"{",
"ExpiresAt",
":",
"now",
".",
"Add",
"(",
"ttl",
")",
".",
"Unix",
"(",
")",
",",
"Issuer",
":",
"c",
".",
"accountSid",
",",
"IssuedAt",
":",
"now",
".",
"Unix",
"(",
")",
",",
"}",
",",
"}",
"\n",
"<mask>",
":=",
"jwt",
".",
"NewWithClaims",
"(",
"jwt",
".",
"SigningMethodHS256",
",",
"cc",
")",
"\n",
"return",
"token",
".",
"SignedString",
"(",
"[",
"]",
"byte",
"(",
"c",
".",
"authToken",
")",
")",
"\n",
"}"
]
|
14,697 | all-14698 | [
"deleteDir",
"deletes",
"a",
"directory",
"and",
"all",
"the",
"children",
"under",
"it"
]
| [
"func",
"deleteDir",
"(",
"<mask>",
"*",
"bolt",
".",
"Tx",
",",
"path",
"string",
")",
"error",
"{",
"c",
":=",
"fs",
"(",
"tx",
")",
".",
"Cursor",
"(",
")",
"\n",
"prefix",
":=",
"append",
"(",
"b",
"(",
"path",
")",
",",
"nullByte",
"[",
"0",
"]",
")",
"\n",
"for",
"k",
",",
"_",
":=",
"c",
".",
"Seek",
"(",
"prefix",
")",
";",
"bytes",
".",
"HasPrefix",
"(",
"k",
",",
"prefix",
")",
";",
"k",
",",
"_",
"=",
"c",
".",
"Next",
"(",
")",
"{",
"if",
"err",
":=",
"c",
".",
"Delete",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"fs",
"(",
"tx",
")",
".",
"Delete",
"(",
"b",
"(",
"path",
")",
")",
"\n",
"}"
]
|
14,698 | all-14699 | [
"HasFillMin",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
]
| [
"func",
"(",
"h",
"*",
"HostmapStyle",
")",
"HasFillMin",
"(",
")",
"bool",
"{",
"if",
"h",
"!=",
"nil",
"&&",
"h",
".",
"FillMin",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
]
|
14,699 | all-14700 | [
"healthCheck",
"will",
"do",
"periodic",
"pings",
"on",
"the",
"connection",
"to",
"check",
"the",
"state",
"of",
"the",
"connection",
".",
"We",
"accept",
"connID",
"on",
"the",
"stack",
"so",
"can",
"more",
"easily",
"debug",
"panics",
"or",
"leaked",
"goroutines",
"."
]
| [
"func",
"(",
"c",
"*",
"Connection",
")",
"healthCheck",
"(",
"connID",
"uint32",
")",
"{",
"defer",
"close",
"(",
"c",
".",
"healthCheckDone",
")",
"\n\n",
"opts",
":=",
"c",
".",
"opts",
".",
"HealthChecks",
"\n\n",
"ticker",
":=",
"c",
".",
"timeTicker",
"(",
"opts",
".",
"Interval",
")",
"\n",
"defer",
"ticker",
".",
"Stop",
"(",
")",
"\n\n",
"consecutiveFailures",
":=",
"0",
"\n",
"for",
"{",
"select",
"{",
"case",
"<-",
"ticker",
".",
"C",
":",
"<mask>",
"<-",
"c",
".",
"healthCheckCtx",
".",
"Done",
"(",
")",
":",
"return",
"\n",
"}",
"\n\n",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"c",
".",
"healthCheckCtx",
",",
"opts",
".",
"Timeout",
")",
"\n",
"err",
":=",
"c",
".",
"ping",
"(",
"ctx",
")",
"\n",
"cancel",
"(",
")",
"\n",
"c",
".",
"healthCheckHistory",
".",
"add",
"(",
"err",
"==",
"nil",
")",
"\n",
"if",
"err",
"==",
"nil",
"{",
"if",
"c",
".",
"log",
".",
"Enabled",
"(",
"LogLevelDebug",
")",
"{",
"c",
".",
"log",
".",
"Debug",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"consecutiveFailures",
"=",
"0",
"\n",
"continue",
"\n",
"}",
"\n\n",
"// If the health check failed because the connection closed or health",
"// checks were stopped, we don't need to log or close the connection.",
"if",
"GetSystemErrorCode",
"(",
"err",
")",
"==",
"ErrCodeCancelled",
"||",
"err",
"==",
"ErrInvalidConnectionState",
"{",
"c",
".",
"log",
".",
"WithFields",
"(",
"ErrField",
"(",
"err",
")",
")",
".",
"Debug",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"consecutiveFailures",
"++",
"\n",
"c",
".",
"log",
".",
"WithFields",
"(",
"LogFields",
"{",
"{",
"\"",
"\"",
",",
"consecutiveFailures",
"}",
",",
"ErrField",
"(",
"err",
")",
",",
"{",
"\"",
"\"",
",",
"opts",
".",
"FailuresToClose",
"}",
",",
"}",
"...",
")",
".",
"Warn",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"consecutiveFailures",
">=",
"opts",
".",
"FailuresToClose",
"{",
"c",
".",
"close",
"(",
"LogFields",
"{",
"{",
"\"",
"\"",
",",
"\"",
"\"",
"}",
",",
"ErrField",
"(",
"err",
")",
",",
"}",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.