id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
listlengths 1
418
| pl_tokens
listlengths 22
4.98k
|
---|---|---|---|
14,900 | all-14901 | [
"Close",
"will",
"shutdown",
"outgoing",
"connectivity",
"and",
"stop",
"all",
"background",
"goroutines",
";",
"note",
"that",
"the",
"valueStore",
"is",
"no",
"longer",
"usable",
"after",
"a",
"call",
"to",
"Close",
"including",
"using",
"Startup",
"."
] | [
"func",
"(",
"stor",
"*",
"valueStore",
")",
"Close",
"(",
")",
"{",
"stor",
".",
"<mask>",
".",
"Lock",
"(",
")",
"\n",
"stor",
".",
"shutdown",
"(",
")",
"\n",
"close",
"(",
"stor",
".",
"handlersDoneChan",
")",
"\n",
"stor",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n",
"}"
] |
14,901 | all-14902 | [
"Use",
"appends",
"a",
"middleware",
"handler",
"to",
"the",
"Mux",
"middleware",
"stack",
".",
"The",
"middleware",
"stack",
"for",
"any",
"Mux",
"will",
"execute",
"before",
"searching",
"for",
"a",
"matching",
"route",
"to",
"a",
"specific",
"handler",
"which",
"provides",
"opportunity",
"to",
"respond",
"early",
"change",
"the",
"course",
"of",
"the",
"request",
"execution",
"or",
"set",
"request",
"-",
"scoped",
"values",
"for",
"the",
"next",
"http",
".",
"Handler",
"."
] | [
"func",
"(",
"mx",
"*",
"Mux",
")",
"Use",
"(",
"middlewares",
"...",
"func",
"(",
"http",
".",
"<mask>",
")",
"http",
".",
"Handler",
")",
"{",
"if",
"mx",
".",
"handler",
"!=",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"mx",
".",
"middlewares",
"=",
"append",
"(",
"mx",
".",
"middlewares",
",",
"middlewares",
"...",
")",
"\n",
"}"
] |
14,902 | all-14903 | [
"get",
"returns",
"value",
"for",
"a",
"given",
"key",
"or",
"the",
"key",
"after",
"that",
".",
"If",
"not",
"found",
"return",
"nil",
"."
] | [
"func",
"(",
"s",
"*",
"levelHandler",
")",
"get",
"(",
"key",
"[",
"]",
"byte",
")",
"(",
"y",
".",
"ValueStruct",
",",
"error",
")",
"{",
"tables",
",",
"decr",
":=",
"s",
".",
"getTableForKey",
"(",
"key",
")",
"\n",
"keyNoTs",
":=",
"y",
".",
"ParseKey",
"(",
"key",
")",
"\n\n",
"var",
"maxVs",
"y",
".",
"ValueStruct",
"\n",
"for",
"_",
",",
"th",
":=",
"range",
"tables",
"{",
"if",
"th",
".",
"DoesNotHave",
"(",
"keyNoTs",
")",
"{",
"y",
".",
"NumLSMBloomHits",
".",
"Add",
"(",
"s",
".",
"strLevel",
",",
"1",
")",
"\n",
"continue",
"\n",
"}",
"\n\n",
"it",
":=",
"th",
".",
"NewIterator",
"(",
"<mask>",
")",
"\n",
"defer",
"it",
".",
"Close",
"(",
")",
"\n\n",
"y",
".",
"NumLSMGets",
".",
"Add",
"(",
"s",
".",
"strLevel",
",",
"1",
")",
"\n",
"it",
".",
"Seek",
"(",
"key",
")",
"\n",
"if",
"!",
"it",
".",
"Valid",
"(",
")",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"y",
".",
"SameKey",
"(",
"key",
",",
"it",
".",
"Key",
"(",
")",
")",
"{",
"if",
"version",
":=",
"y",
".",
"ParseTs",
"(",
"it",
".",
"Key",
"(",
")",
")",
";",
"maxVs",
".",
"Version",
"<",
"version",
"{",
"maxVs",
"=",
"it",
".",
"Value",
"(",
")",
"\n",
"maxVs",
".",
"Version",
"=",
"version",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"maxVs",
",",
"decr",
"(",
")",
"\n",
"}"
] |
14,903 | all-14904 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"EventLoadingFailed",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork54",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
14,904 | all-14905 | [
"Creates",
"a",
"program",
"object"
] | [
"func",
"CreateProgram",
"(",
")",
"uint32",
"{",
"ret",
",",
"_",
",",
"_",
":=",
"syscall",
".",
"Syscall",
"(",
"gpCreateProgram",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
")",
"\n",
"return",
"(",
"uint32",
")",
"(",
"<mask>",
")",
"\n",
"}"
] |
14,905 | all-14906 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SetBreakpointByURLReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDebugger14",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
14,906 | all-14907 | [
"Delete",
"provides",
"a",
"mock",
"function",
"with",
"given",
"fields",
":",
"_a0",
"_a1",
"_a2",
"_a3",
"_a4",
"_a5"
] | [
"func",
"(",
"_m",
"*",
"Storage",
")",
"Delete",
"(",
"_a0",
"context",
".",
"Context",
",",
"_a1",
"string",
",",
"_a2",
"string",
",",
"_a3",
"string",
",",
"_a4",
"*",
"time",
".",
"Time",
",",
"_a5",
"*",
"time",
".",
"Time",
")",
"(",
"int64",
",",
"error",
")",
"{",
"ret",
":=",
"_m",
".",
"Called",
"(",
"_a0",
",",
"_a1",
",",
"_a2",
",",
"_a3",
",",
"_a4",
",",
"_a5",
")",
"\n\n",
"var",
"r0",
"int64",
"\n",
"if",
"rf",
",",
"ok",
":=",
"ret",
".",
"Get",
"(",
"0",
")",
".",
"(",
"func",
"(",
"<mask>",
".",
"Context",
",",
"string",
",",
"string",
",",
"string",
",",
"*",
"time",
".",
"Time",
",",
"*",
"time",
".",
"Time",
")",
"int64",
")",
";",
"ok",
"{",
"r0",
"=",
"rf",
"(",
"_a0",
",",
"_a1",
",",
"_a2",
",",
"_a3",
",",
"_a4",
",",
"_a5",
")",
"\n",
"}",
"else",
"{",
"r0",
"=",
"ret",
".",
"Get",
"(",
"0",
")",
".",
"(",
"int64",
")",
"\n",
"}",
"\n\n",
"var",
"r1",
"error",
"\n",
"if",
"rf",
",",
"ok",
":=",
"ret",
".",
"Get",
"(",
"1",
")",
".",
"(",
"func",
"(",
"context",
".",
"Context",
",",
"string",
",",
"string",
",",
"string",
",",
"*",
"time",
".",
"Time",
",",
"*",
"time",
".",
"Time",
")",
"error",
")",
";",
"ok",
"{",
"r1",
"=",
"rf",
"(",
"_a0",
",",
"_a1",
",",
"_a2",
",",
"_a3",
",",
"_a4",
",",
"_a5",
")",
"\n",
"}",
"else",
"{",
"r1",
"=",
"ret",
".",
"Error",
"(",
"1",
")",
"\n",
"}",
"\n\n",
"return",
"r0",
",",
"r1",
"\n",
"}"
] |
14,907 | all-14908 | [
"set",
"the",
"viewport"
] | [
"func",
"Viewport",
"(",
"x",
"int32",
",",
"y",
"int32",
",",
"<mask>",
"int32",
",",
"height",
"int32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpViewport",
",",
"4",
",",
"uintptr",
"(",
"x",
")",
",",
"uintptr",
"(",
"y",
")",
",",
"uintptr",
"(",
"width",
")",
",",
"uintptr",
"(",
"height",
")",
",",
"0",
",",
"0",
")",
"\n",
"}"
] |
14,908 | all-14909 | [
"PutFloat32Array",
"writes",
"a",
"float",
"array",
"for",
"the",
"given",
"field",
".",
"The",
"field",
"type",
"must",
"be",
"a",
"Float32ArrayField",
"otherwise",
"as",
"error",
"will",
"be",
"returned",
".",
"The",
"type",
"code",
"is",
"written",
"first",
"followed",
"by",
"the",
"array",
"size",
"in",
"bytes",
".",
"If",
"the",
"size",
"of",
"the",
"array",
"is",
"less",
"than",
"math",
".",
"MaxUint8",
"a",
"byte",
"will",
"be",
"used",
"to",
"represent",
"the",
"length",
".",
"If",
"the",
"size",
"of",
"the",
"array",
"is",
"less",
"than",
"math",
".",
"MaxUint16",
"a",
"16",
"-",
"bit",
"unsigned",
"integer",
"will",
"be",
"used",
"to",
"represent",
"the",
"length",
"and",
"so",
"on",
".",
"If",
"the",
"buffer",
"is",
"too",
"small",
"to",
"store",
"the",
"entire",
"array",
"an",
"xbinary",
".",
"ErrOutOfRange",
"error",
"will",
"be",
"returned",
".",
"If",
"the",
"write",
"is",
"successful",
"the",
"total",
"number",
"of",
"bytes",
"will",
"be",
"returned",
"as",
"well",
"as",
"a",
"nil",
"error",
"."
] | [
"func",
"(",
"b",
"*",
"TupleBuilder",
")",
"PutFloat32Array",
"(",
"field",
"string",
",",
"value",
"[",
"]",
"float32",
")",
"(",
"wrote",
"int",
",",
"err",
"error",
")",
"{",
"// field type should be",
"if",
"err",
"=",
"b",
".",
"typeCheck",
"(",
"field",
",",
"Float32ArrayField",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
"\n\n",
"size",
":=",
"len",
"(",
"value",
")",
"\n",
"if",
"size",
"<",
"math",
".",
"MaxUint8",
"{",
"if",
"b",
".",
"available",
"(",
")",
"<",
"<mask>",
"*",
"4",
"+",
"2",
"{",
"return",
"0",
",",
"xbinary",
".",
"ErrOutOfRange",
"\n",
"}",
"\n\n",
"// write length",
"xbinary",
".",
"LittleEndian",
".",
"PutFloat32Array",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"2",
",",
"value",
")",
"\n\n",
"// write type code",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"]",
"=",
"byte",
"(",
"FloatArray8Code",
".",
"OpCode",
")",
"\n\n",
"// write length",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"+",
"1",
"]",
"=",
"byte",
"(",
"size",
")",
"\n\n",
"wrote",
"+=",
"size",
"+",
"2",
"\n",
"}",
"else",
"if",
"size",
"<",
"math",
".",
"MaxUint16",
"{",
"if",
"b",
".",
"available",
"(",
")",
"<",
"size",
"*",
"4",
"+",
"3",
"{",
"return",
"0",
",",
"xbinary",
".",
"ErrOutOfRange",
"\n",
"}",
"\n\n",
"// write length",
"xbinary",
".",
"LittleEndian",
".",
"PutUint16",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"1",
",",
"uint16",
"(",
"size",
")",
")",
"\n\n",
"// write value",
"xbinary",
".",
"LittleEndian",
".",
"PutFloat32Array",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"3",
",",
"value",
")",
"\n\n",
"// write type code",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"]",
"=",
"byte",
"(",
"FloatArray16Code",
".",
"OpCode",
")",
"\n\n",
"wrote",
"+=",
"3",
"+",
"size",
"\n",
"}",
"else",
"if",
"size",
"<",
"math",
".",
"MaxUint32",
"{",
"if",
"b",
".",
"available",
"(",
")",
"<",
"size",
"*",
"4",
"+",
"5",
"{",
"return",
"0",
",",
"xbinary",
".",
"ErrOutOfRange",
"\n",
"}",
"\n\n",
"// write length",
"xbinary",
".",
"LittleEndian",
".",
"PutUint32",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"1",
",",
"uint32",
"(",
"size",
")",
")",
"\n\n",
"// write value",
"xbinary",
".",
"LittleEndian",
".",
"PutFloat32Array",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"5",
",",
"value",
")",
"\n\n",
"// write type code",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"]",
"=",
"byte",
"(",
"FloatArray32Code",
".",
"OpCode",
")",
"\n\n",
"wrote",
"+=",
"5",
"+",
"size",
"\n",
"}",
"else",
"{",
"if",
"b",
".",
"available",
"(",
")",
"<",
"size",
"*",
"4",
"+",
"9",
"{",
"return",
"0",
",",
"xbinary",
".",
"ErrOutOfRange",
"\n",
"}",
"\n\n",
"// write length",
"xbinary",
".",
"LittleEndian",
".",
"PutUint64",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"1",
",",
"uint64",
"(",
"size",
")",
")",
"\n\n",
"// write value",
"xbinary",
".",
"LittleEndian",
".",
"PutFloat32Array",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"9",
",",
"value",
")",
"\n\n",
"// write type code",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"]",
"=",
"byte",
"(",
"FloatArray64Code",
".",
"OpCode",
")",
"\n\n",
"wrote",
"+=",
"9",
"+",
"size",
"\n",
"}",
"\n\n",
"b",
".",
"offsets",
"[",
"field",
"]",
"=",
"b",
".",
"pos",
"\n",
"b",
".",
"pos",
"+=",
"wrote",
"\n",
"return",
"\n",
"}"
] |
14,909 | all-14910 | [
"Do",
"executes",
"DOMStorage",
".",
"getDOMStorageItems",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"entries"
] | [
"func",
"(",
"p",
"*",
"GetDOMStorageItemsParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"entries",
"[",
"]",
"Item",
",",
"err",
"error",
")",
"{",
"// execute",
"<mask>",
"res",
"GetDOMStorageItemsReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandGetDOMStorageItems",
",",
"p",
",",
"&",
"res",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"res",
".",
"Entries",
",",
"nil",
"\n",
"}"
] |
14,910 | all-14911 | [
"GetColumnType",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_tree_model_get_column_type",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TreeModel",
")",
"GetColumnType",
"(",
"index",
"int",
")",
"glib",
".",
"<mask>",
"{",
"c",
":=",
"C",
".",
"gtk_tree_model_get_column_type",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"index",
")",
")",
"\n",
"return",
"glib",
".",
"Type",
"(",
"c",
")",
"\n",
"}"
] |
14,911 | all-14912 | [
"Records",
"gets",
"the",
"current",
"records",
"."
] | [
"func",
"(",
"p",
"*",
"InfobloxProvider",
")",
"Records",
"(",
")",
"(",
"endpoints",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
",",
"err",
"error",
")",
"{",
"zones",
",",
"err",
":=",
"p",
".",
"zones",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"zone",
":=",
"range",
"zones",
"{",
"logrus",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"zone",
".",
"Fqdn",
")",
"\n",
"var",
"resA",
"[",
"]",
"ibclient",
".",
"RecordA",
"\n",
"objA",
":=",
"ibclient",
".",
"NewRecordA",
"(",
"ibclient",
".",
"RecordA",
"{",
"Zone",
":",
"zone",
".",
"Fqdn",
",",
"View",
":",
"p",
".",
"view",
",",
"}",
",",
")",
"\n",
"err",
"=",
"p",
".",
"client",
".",
"GetObject",
"(",
"objA",
",",
"\"",
"\"",
",",
"&",
"resA",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"zone",
".",
"Fqdn",
",",
"err",
")",
"\n",
"}",
"\n",
"for",
"_",
",",
"res",
":=",
"range",
"resA",
"{",
"endpoints",
"=",
"<mask>",
"(",
"endpoints",
",",
"endpoint",
".",
"NewEndpoint",
"(",
"res",
".",
"Name",
",",
"endpoint",
".",
"RecordTypeA",
",",
"res",
".",
"Ipv4Addr",
")",
")",
"\n",
"}",
"\n\n",
"// Include Host records since they should be treated synonymously with A records",
"var",
"resH",
"[",
"]",
"ibclient",
".",
"HostRecord",
"\n",
"objH",
":=",
"ibclient",
".",
"NewHostRecord",
"(",
"ibclient",
".",
"HostRecord",
"{",
"Zone",
":",
"zone",
".",
"Fqdn",
",",
"View",
":",
"p",
".",
"view",
",",
"}",
",",
")",
"\n",
"err",
"=",
"p",
".",
"client",
".",
"GetObject",
"(",
"objH",
",",
"\"",
"\"",
",",
"&",
"resH",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"zone",
".",
"Fqdn",
",",
"err",
")",
"\n",
"}",
"\n",
"for",
"_",
",",
"res",
":=",
"range",
"resH",
"{",
"for",
"_",
",",
"ip",
":=",
"range",
"res",
".",
"Ipv4Addrs",
"{",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"endpoint",
".",
"NewEndpoint",
"(",
"res",
".",
"Name",
",",
"endpoint",
".",
"RecordTypeA",
",",
"ip",
".",
"Ipv4Addr",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"var",
"resC",
"[",
"]",
"ibclient",
".",
"RecordCNAME",
"\n",
"objC",
":=",
"ibclient",
".",
"NewRecordCNAME",
"(",
"ibclient",
".",
"RecordCNAME",
"{",
"Zone",
":",
"zone",
".",
"Fqdn",
",",
"View",
":",
"p",
".",
"view",
",",
"}",
",",
")",
"\n",
"err",
"=",
"p",
".",
"client",
".",
"GetObject",
"(",
"objC",
",",
"\"",
"\"",
",",
"&",
"resC",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"zone",
".",
"Fqdn",
",",
"err",
")",
"\n",
"}",
"\n",
"for",
"_",
",",
"res",
":=",
"range",
"resC",
"{",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"endpoint",
".",
"NewEndpoint",
"(",
"res",
".",
"Name",
",",
"endpoint",
".",
"RecordTypeCNAME",
",",
"res",
".",
"Canonical",
")",
")",
"\n",
"}",
"\n\n",
"var",
"resT",
"[",
"]",
"ibclient",
".",
"RecordTXT",
"\n",
"objT",
":=",
"ibclient",
".",
"NewRecordTXT",
"(",
"ibclient",
".",
"RecordTXT",
"{",
"Zone",
":",
"zone",
".",
"Fqdn",
",",
"View",
":",
"p",
".",
"view",
",",
"}",
",",
")",
"\n",
"err",
"=",
"p",
".",
"client",
".",
"GetObject",
"(",
"objT",
",",
"\"",
"\"",
",",
"&",
"resT",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"zone",
".",
"Fqdn",
",",
"err",
")",
"\n",
"}",
"\n",
"for",
"_",
",",
"res",
":=",
"range",
"resT",
"{",
"// The Infoblox API strips enclosing double quotes from TXT records lacking whitespace.",
"// Unhandled, the missing double quotes would break the extractOwnerID method of the registry package.",
"if",
"_",
",",
"err",
":=",
"strconv",
".",
"Unquote",
"(",
"res",
".",
"Text",
")",
";",
"err",
"!=",
"nil",
"{",
"res",
".",
"Text",
"=",
"strconv",
".",
"Quote",
"(",
"res",
".",
"Text",
")",
"\n",
"}",
"\n",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"endpoint",
".",
"NewEndpoint",
"(",
"res",
".",
"Name",
",",
"endpoint",
".",
"RecordTypeTXT",
",",
"res",
".",
"Text",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"logrus",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"len",
"(",
"endpoints",
")",
")",
"\n",
"return",
"endpoints",
",",
"nil",
"\n",
"}"
] |
14,912 | all-14913 | [
"GtkWidget",
"*",
"gtk_tree_view_column_get_button",
"()",
"void",
"gtk_tree_view_column_set_alignment",
"()",
"gfloat",
"gtk_tree_view_column_get_alignment",
"()",
"void",
"gtk_tree_view_column_set_sort_order",
"()"
] | [
"func",
"(",
"v",
"*",
"TreeViewColumn",
")",
"SetSortOrder",
"(",
"order",
"SortType",
")",
"{",
"C",
".",
"gtk_tree_view_column_set_sort_order",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkSortType",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
14,913 | all-14914 | [
"Less",
"will",
"return",
"true",
"if",
"the",
"ID",
"of",
"element",
"at",
"i",
"is",
"less",
"than",
"j",
";",
"part",
"of",
"the",
"sort",
".",
"Interface"
] | [
"func",
"(",
"is",
"IdentifierSlice",
")",
"Less",
"(",
"i",
",",
"j",
"int",
")",
"bool",
"{",
"return",
"is",
"[",
"i",
"]",
".",
"<mask>",
"(",
")",
"<",
"is",
"[",
"j",
"]",
".",
"ID",
"(",
")",
"\n",
"}"
] |
14,914 | all-14915 | [
"New",
"DBError",
".",
"New"
] | [
"func",
"(",
"e",
"*",
"DBError",
")",
"New",
"(",
"dbName",
"string",
",",
"message",
"string",
")",
"*",
"DBError",
"{",
"e",
".",
"HTTPCode",
"=",
"http",
".",
"StatusInternalServerError",
"\n",
"e",
".",
"Errno",
"=",
"0",
"\n",
"e",
".",
"Message",
"=",
"<mask>",
"\n",
"e",
".",
"DBName",
"=",
"dbName",
"\n",
"return",
"e",
"\n",
"}"
] |
14,915 | all-14916 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"CreateBrowserContextParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget25",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
14,916 | all-14917 | [
"----------------------------------------",
"encode",
":",
"see",
"binary",
"-",
"encode",
".",
"go",
"and",
"json",
"-",
"encode",
".",
"go",
"decode",
":",
"see",
"binary",
"-",
"decode",
".",
"go",
"and",
"json",
"-",
"decode",
".",
"go",
"----------------------------------------",
"Misc",
"."
] | [
"func",
"getTypeFromPointer",
"(",
"ptr",
"<mask>",
"{",
"}",
")",
"reflect",
".",
"Type",
"{",
"rt",
":=",
"reflect",
".",
"TypeOf",
"(",
"ptr",
")",
"\n",
"if",
"rt",
".",
"Kind",
"(",
")",
"!=",
"reflect",
".",
"Ptr",
"{",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"rt",
")",
")",
"\n",
"}",
"\n",
"return",
"rt",
".",
"Elem",
"(",
")",
"\n",
"}"
] |
14,917 | all-14918 | [
"CreateRepoHook",
"creates",
"a",
"new",
"hook",
"for",
"the",
"repo",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"repos",
"/",
"hooks",
"/",
"#create",
"-",
"a",
"-",
"hook"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateRepoHook",
"(",
"org",
",",
"repo",
"string",
",",
"req",
"HookRequest",
")",
"(",
"int",
",",
"error",
")",
"{",
"c",
".",
"<mask>",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
")",
"\n",
"return",
"c",
".",
"createHook",
"(",
"org",
",",
"&",
"repo",
",",
"req",
")",
"\n",
"}"
] |
14,918 | all-14919 | [
"Start",
"the",
"server"
] | [
"func",
"(",
"s",
"*",
"Simple",
")",
"Start",
"(",
"c",
"context",
".",
"Context",
",",
"h",
"http",
".",
"<mask>",
")",
"error",
"{",
"s",
".",
"Handler",
"=",
"h",
"\n",
"return",
"s",
".",
"ListenAndServe",
"(",
")",
"\n",
"}"
] |
14,919 | all-14920 | [
"Issuer",
"sets",
"the",
"issuer",
"in",
"the",
"standart",
"claims",
"object",
"."
] | [
"func",
"Issuer",
"(",
"issuer",
"string",
")",
"TokenOpt",
"{",
"return",
"TokenOpt",
"{",
"func",
"(",
"o",
"*",
"<mask>",
")",
"{",
"o",
".",
"issuer",
"=",
"issuer",
"\n",
"}",
"}",
"\n",
"}"
] |
14,920 | all-14921 | [
"GetDuplex",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_get_duplex",
"()",
"."
] | [
"func",
"(",
"<mask>",
"*",
"PrintSettings",
")",
"GetDuplex",
"(",
")",
"PrintDuplex",
"{",
"c",
":=",
"C",
".",
"gtk_print_settings_get_duplex",
"(",
"ps",
".",
"native",
"(",
")",
")",
"\n",
"return",
"PrintDuplex",
"(",
"c",
")",
"\n",
"}"
] |
14,921 | all-14922 | [
"set",
"front",
"and",
"back",
"function",
"and",
"reference",
"value",
"for",
"stencil",
"testing"
] | [
"func",
"StencilFunc",
"(",
"xfunc",
"uint32",
",",
"ref",
"int32",
",",
"<mask>",
"uint32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpStencilFunc",
",",
"3",
",",
"uintptr",
"(",
"xfunc",
")",
",",
"uintptr",
"(",
"ref",
")",
",",
"uintptr",
"(",
"mask",
")",
")",
"\n",
"}"
] |
14,922 | all-14923 | [
"ParseReference",
"takes",
"a",
"name",
"and",
"a",
"tag",
"or",
"digest",
"and",
"/",
"or",
"ID",
"(",
"_name_",
"/"
] | [
"func",
"(",
"s",
"*",
"storageTransport",
")",
"ParseReference",
"(",
"reference",
"string",
")",
"(",
"types",
".",
"ImageReference",
",",
"error",
")",
"{",
"var",
"store",
"storage",
".",
"Store",
"\n",
"// Check if there's a store location prefix. If there is, then it",
"// needs to match a store that was previously initialized using",
"// storage.GetStore(), or be enough to let the storage library fill out",
"// the rest using knowledge that it has from elsewhere.",
"if",
"reference",
"[",
"0",
"]",
"==",
"'['",
"{",
"closeIndex",
":=",
"strings",
".",
"IndexRune",
"(",
"reference",
",",
"']'",
")",
"\n",
"if",
"closeIndex",
"<",
"1",
"{",
"return",
"nil",
",",
"ErrInvalidReference",
"\n",
"}",
"\n",
"storeSpec",
":=",
"reference",
"[",
"1",
":",
"closeIndex",
"]",
"\n",
"reference",
"=",
"reference",
"[",
"closeIndex",
"+",
"1",
":",
"]",
"\n",
"// Peel off a \"driver@\" from the start.",
"driverInfo",
":=",
"\"",
"\"",
"\n",
"driverSplit",
":=",
"strings",
".",
"SplitN",
"(",
"storeSpec",
",",
"\"",
"\"",
",",
"2",
")",
"\n",
"if",
"len",
"(",
"driverSplit",
")",
"!=",
"2",
"{",
"if",
"storeSpec",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"ErrInvalidReference",
"\n",
"}",
"\n",
"}",
"else",
"{",
"driverInfo",
"=",
"driverSplit",
"[",
"0",
"]",
"\n",
"if",
"driverInfo",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"ErrInvalidReference",
"\n",
"}",
"\n",
"storeSpec",
"=",
"driverSplit",
"[",
"1",
"]",
"\n",
"if",
"storeSpec",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"ErrInvalidReference",
"\n",
"}",
"\n",
"}",
"\n",
"// Peel off a \":options\" from the end.",
"var",
"<mask>",
"[",
"]",
"string",
"\n",
"optionsSplit",
":=",
"strings",
".",
"SplitN",
"(",
"storeSpec",
",",
"\"",
"\"",
",",
"2",
")",
"\n",
"if",
"len",
"(",
"optionsSplit",
")",
"==",
"2",
"{",
"options",
"=",
"strings",
".",
"Split",
"(",
"optionsSplit",
"[",
"1",
"]",
",",
"\"",
"\"",
")",
"\n",
"storeSpec",
"=",
"optionsSplit",
"[",
"0",
"]",
"\n",
"}",
"\n",
"// Peel off a \"+runroot\" from the new end.",
"runRootInfo",
":=",
"\"",
"\"",
"\n",
"runRootSplit",
":=",
"strings",
".",
"SplitN",
"(",
"storeSpec",
",",
"\"",
"\"",
",",
"2",
")",
"\n",
"if",
"len",
"(",
"runRootSplit",
")",
"==",
"2",
"{",
"runRootInfo",
"=",
"runRootSplit",
"[",
"1",
"]",
"\n",
"storeSpec",
"=",
"runRootSplit",
"[",
"0",
"]",
"\n",
"}",
"\n",
"// The rest is our graph root.",
"rootInfo",
":=",
"storeSpec",
"\n",
"// Check that any paths are absolute paths.",
"if",
"rootInfo",
"!=",
"\"",
"\"",
"&&",
"!",
"filepath",
".",
"IsAbs",
"(",
"rootInfo",
")",
"{",
"return",
"nil",
",",
"ErrPathNotAbsolute",
"\n",
"}",
"\n",
"if",
"runRootInfo",
"!=",
"\"",
"\"",
"&&",
"!",
"filepath",
".",
"IsAbs",
"(",
"runRootInfo",
")",
"{",
"return",
"nil",
",",
"ErrPathNotAbsolute",
"\n",
"}",
"\n",
"store2",
",",
"err",
":=",
"storage",
".",
"GetStore",
"(",
"storage",
".",
"StoreOptions",
"{",
"GraphDriverName",
":",
"driverInfo",
",",
"GraphRoot",
":",
"rootInfo",
",",
"RunRoot",
":",
"runRootInfo",
",",
"GraphDriverOptions",
":",
"options",
",",
"UIDMap",
":",
"s",
".",
"defaultUIDMap",
",",
"GIDMap",
":",
"s",
".",
"defaultGIDMap",
",",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"store",
"=",
"store2",
"\n",
"}",
"else",
"{",
"// We didn't have a store spec, so use the default.",
"store2",
",",
"err",
":=",
"s",
".",
"GetStore",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"store",
"=",
"store2",
"\n",
"}",
"\n",
"return",
"s",
".",
"ParseStoreReference",
"(",
"store",
",",
"reference",
")",
"\n",
"}"
] |
14,923 | all-14924 | [
"SetValue",
"is",
"a",
"wrapper",
"around",
"gtk_range_set_value",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Range",
")",
"SetValue",
"(",
"value",
"float64",
")",
"{",
"C",
".",
"gtk_range_set_value",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gdouble",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
14,924 | all-14925 | [
"GetPageIterator",
"returns",
"an",
"iterator",
"which",
"can",
"be",
"used",
"to",
"retrieve",
"pages",
"."
] | [
"func",
"(",
"cvps",
"*",
"CountryVoicePriceService",
")",
"GetPageIterator",
"(",
"<mask>",
"url",
".",
"Values",
")",
"*",
"CountryPricePageIterator",
"{",
"iter",
":=",
"NewPageIterator",
"(",
"cvps",
".",
"client",
",",
"data",
",",
"voicePathPart",
"+",
"\"",
"\"",
")",
"\n",
"return",
"&",
"CountryPricePageIterator",
"{",
"p",
":",
"iter",
",",
"}",
"\n",
"}"
] |
14,925 | all-14926 | [
"Read",
"returns",
"a",
"buffer",
"containing",
"the",
"content",
"up",
"until",
"boundary"
] | [
"func",
"(",
"b",
"*",
"boundaryReader",
")",
"Read",
"(",
"dest",
"[",
"]",
"byte",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"if",
"b",
".",
"buffer",
".",
"Len",
"(",
")",
">=",
"len",
"(",
"dest",
")",
"{",
"// This read request can be satisfied entirely by the buffer",
"return",
"b",
".",
"buffer",
".",
"Read",
"(",
"dest",
")",
"\n",
"}",
"\n\n",
"peek",
",",
"err",
":=",
"b",
".",
"r",
".",
"Peek",
"(",
"peekBufferSize",
")",
"\n",
"peekEOF",
":=",
"(",
"err",
"==",
"<mask>",
".",
"EOF",
")",
"\n",
"if",
"err",
"!=",
"nil",
"&&",
"!",
"peekEOF",
"&&",
"err",
"!=",
"bufio",
".",
"ErrBufferFull",
"{",
"// Unexpected error",
"return",
"0",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"var",
"nCopy",
"int",
"\n",
"idx",
",",
"complete",
":=",
"locateBoundary",
"(",
"peek",
",",
"b",
".",
"nlPrefix",
")",
"\n",
"if",
"idx",
"!=",
"-",
"1",
"{",
"// Peeked boundary prefix, read until that point",
"nCopy",
"=",
"idx",
"\n",
"if",
"!",
"complete",
"&&",
"nCopy",
"==",
"0",
"{",
"// Incomplete boundary, move past it",
"nCopy",
"=",
"1",
"\n",
"}",
"\n",
"}",
"else",
"{",
"// No boundary found, move forward a safe distance",
"if",
"nCopy",
"=",
"len",
"(",
"peek",
")",
"-",
"len",
"(",
"b",
".",
"nlPrefix",
")",
"-",
"1",
";",
"nCopy",
"<=",
"0",
"{",
"nCopy",
"=",
"0",
"\n",
"if",
"peekEOF",
"{",
"// No more peek space remaining and no boundary found",
"return",
"0",
",",
"errors",
".",
"WithStack",
"(",
"io",
".",
"ErrUnexpectedEOF",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"nCopy",
">",
"0",
"{",
"if",
"_",
",",
"err",
"=",
"io",
".",
"CopyN",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"r",
",",
"int64",
"(",
"nCopy",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"n",
",",
"err",
"=",
"b",
".",
"buffer",
".",
"Read",
"(",
"dest",
")",
"\n",
"if",
"err",
"==",
"io",
".",
"EOF",
"&&",
"!",
"complete",
"{",
"// Only the buffer is empty, not the boundaryReader",
"return",
"n",
",",
"nil",
"\n",
"}",
"\n",
"return",
"n",
",",
"err",
"\n",
"}"
] |
14,926 | all-14927 | [
"SetMetadata",
"sets",
"a",
"metadata",
"value",
"for",
"the",
"object",
"."
] | [
"func",
"(",
"o",
"*",
"<mask>",
")",
"SetMetadata",
"(",
"key",
"string",
",",
"value",
"string",
",",
"attr",
"MetadataAttributes",
")",
"error",
"{",
"o",
".",
"Metadata",
"[",
"key",
"]",
"=",
"MetadataData",
"{",
"value",
":",
"value",
",",
"attr",
":",
"attr",
",",
"}",
"\n\n",
"if",
"attr",
".",
"PrimaryKey",
"{",
"o",
".",
"updatePrimaryKeyHash",
"(",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
14,927 | all-14928 | [
"Getopts",
"reads",
"from",
"user",
"input",
"then",
"environment",
"variable",
"and",
"finally",
"a",
"sane",
"default",
"."
] | [
"func",
"Getopts",
"(",
"userInput",
",",
"envVar",
",",
"dfault",
"string",
")",
"string",
"{",
"if",
"len",
"(",
"strings",
".",
"TrimSpace",
"(",
"userInput",
")",
")",
">",
"0",
"{",
"return",
"userInput",
"\n",
"}",
"\n",
"value",
":=",
"os",
".",
"Getenv",
"(",
"envVar",
")",
"\n",
"if",
"<mask>",
"==",
"\"",
"\"",
"{",
"value",
"=",
"dfault",
"\n",
"}",
"\n",
"return",
"value",
"\n",
"}"
] |
14,928 | all-14929 | [
"fileNameInfo",
"returns",
"information",
"that",
"can",
"be",
"inferred",
"from",
"the",
"name",
"of",
"a",
"file",
".",
"It",
"does",
"not",
"read",
"data",
"from",
"the",
"file",
"."
] | [
"func",
"fileNameInfo",
"(",
"path_",
"string",
")",
"fileInfo",
"{",
"name",
":=",
"filepath",
".",
"Base",
"(",
"path_",
")",
"\n",
"var",
"ext",
"ext",
"\n",
"switch",
"path",
".",
"Ext",
"(",
"name",
")",
"{",
"case",
"\"",
"\"",
":",
"ext",
"=",
"goExt",
"\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"ext",
"=",
"cExt",
"\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"ext",
"=",
"hExt",
"\n",
"case",
"\"",
"\"",
":",
"ext",
"=",
"sExt",
"\n",
"case",
"\"",
"\"",
":",
"ext",
"=",
"csExt",
"\n",
"case",
"\"",
"\"",
":",
"ext",
"=",
"protoExt",
"\n",
"default",
":",
"ext",
"=",
"unknownExt",
"\n",
"}",
"\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"name",
",",
"\"",
"\"",
")",
"||",
"strings",
".",
"HasPrefix",
"(",
"name",
",",
"\"",
"\"",
")",
"{",
"ext",
"=",
"unknownExt",
"\n",
"}",
"\n\n",
"// Determine test, goos, and goarch. This is intended to match the logic",
"// in goodOSArchFile in go/build.",
"var",
"isTest",
"bool",
"\n",
"var",
"goos",
",",
"goarch",
"string",
"\n",
"l",
":=",
"strings",
".",
"Split",
"(",
"name",
"[",
":",
"len",
"(",
"name",
")",
"-",
"len",
"(",
"path",
".",
"Ext",
"(",
"name",
")",
")",
"]",
",",
"\"",
"\"",
")",
"\n",
"if",
"len",
"(",
"l",
")",
">=",
"2",
"&&",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"1",
"]",
"==",
"\"",
"\"",
"{",
"isTest",
"=",
"ext",
"==",
"goExt",
"\n",
"l",
"=",
"l",
"[",
":",
"len",
"(",
"l",
")",
"-",
"1",
"]",
"\n",
"}",
"\n",
"switch",
"{",
"case",
"len",
"(",
"l",
")",
">=",
"3",
"&&",
"rule",
".",
"KnownOSSet",
"[",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"2",
"]",
"]",
"&&",
"rule",
".",
"KnownArchSet",
"[",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"1",
"]",
"]",
":",
"goos",
"=",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"2",
"]",
"\n",
"goarch",
"=",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"1",
"]",
"\n",
"case",
"len",
"(",
"l",
")",
">=",
"2",
"&&",
"<mask>",
".",
"KnownOSSet",
"[",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"1",
"]",
"]",
":",
"goos",
"=",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"1",
"]",
"\n",
"case",
"len",
"(",
"l",
")",
">=",
"2",
"&&",
"rule",
".",
"KnownArchSet",
"[",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"1",
"]",
"]",
":",
"goarch",
"=",
"l",
"[",
"len",
"(",
"l",
")",
"-",
"1",
"]",
"\n",
"}",
"\n\n",
"return",
"fileInfo",
"{",
"path",
":",
"path_",
",",
"name",
":",
"name",
",",
"ext",
":",
"ext",
",",
"isTest",
":",
"isTest",
",",
"goos",
":",
"goos",
",",
"goarch",
":",
"goarch",
",",
"}",
"\n",
"}"
] |
14,929 | all-14930 | [
"handleMetric",
":",
"Handler",
"for",
"/",
"Method",
":",
"GET"
] | [
"func",
"handleMetric",
"(",
"boskos",
"*",
"client",
".",
"Client",
")",
"http",
".",
"HandlerFunc",
"{",
"return",
"func",
"(",
"res",
"http",
".",
"ResponseWriter",
",",
"req",
"*",
"http",
".",
"Request",
")",
"{",
"log",
":=",
"logrus",
".",
"WithField",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"req",
".",
"RemoteAddr",
")",
"\n\n",
"if",
"req",
".",
"Method",
"!=",
"\"",
"\"",
"{",
"log",
".",
"Warningf",
"(",
"\"",
"\"",
",",
"req",
".",
"Method",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"\"",
"\"",
",",
"http",
".",
"StatusMethodNotAllowed",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"rtype",
":=",
"req",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"rtype",
"==",
"\"",
"\"",
"{",
"msg",
":=",
"\"",
"\"",
"\n",
"log",
".",
"Warning",
"(",
"msg",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"msg",
",",
"<mask>",
".",
"StatusBadRequest",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"rtype",
")",
"\n\n",
"metric",
",",
"err",
":=",
"boskos",
".",
"Metric",
"(",
"rtype",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"log",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"rtype",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"err",
".",
"Error",
"(",
")",
",",
"http",
".",
"StatusNotFound",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"metricJSON",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"metric",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"log",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"metricJSON",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"err",
".",
"Error",
"(",
")",
",",
"http",
".",
"StatusInternalServerError",
")",
"\n",
"return",
"\n",
"}",
"\n",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"rtype",
",",
"string",
"(",
"metricJSON",
")",
")",
"\n",
"fmt",
".",
"Fprint",
"(",
"res",
",",
"string",
"(",
"metricJSON",
")",
")",
"\n",
"}",
"\n",
"}"
] |
14,930 | all-14931 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventNavigatedWithinDocument",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage53",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
14,931 | all-14932 | [
"StringSHA1Base64",
"returns",
"the",
"base64",
"encoded",
"SHA1",
"hash",
"of",
"data"
] | [
"func",
"StringSHA1Base64",
"(",
"data",
"string",
")",
"string",
"{",
"hash",
":=",
"sha1",
".",
"Sum",
"(",
"[",
"]",
"byte",
"(",
"data",
")",
")",
"\n",
"return",
"base64",
".",
"StdEncoding",
".",
"EncodeToString",
"(",
"<mask>",
"[",
":",
"]",
")",
"\n",
"}"
] |
14,932 | all-14933 | [
"Sign",
"produces",
"signed",
"JWT",
"token",
"given",
"arbitrary",
"binary",
"payload",
"signature",
"algorithm",
"to",
"use",
"(",
"see",
"constants",
"for",
"list",
"of",
"supported",
"algs",
")",
"signing",
"key",
"and",
"extra",
"options",
"(",
"see",
"option",
"functions",
")",
"Signing",
"key",
"is",
"of",
"different",
"type",
"for",
"different",
"signing",
"alg",
"see",
"specific",
"signing",
"alg",
"implementation",
"documentation",
".",
"It",
"returns",
"3",
"parts",
"signed",
"JWT",
"token",
"as",
"string",
"and",
"not",
"nil",
"error",
"if",
"something",
"went",
"wrong",
"."
] | [
"func",
"SignBytes",
"(",
"payload",
"[",
"]",
"byte",
",",
"signingAlg",
"string",
",",
"key",
"interface",
"{",
"}",
",",
"options",
"...",
"func",
"(",
"*",
"JoseConfig",
")",
")",
"(",
"token",
"string",
",",
"err",
"error",
")",
"{",
"if",
"signer",
",",
"ok",
":=",
"jwsHashers",
"[",
"signingAlg",
"]",
";",
"ok",
"{",
"cfg",
":=",
"&",
"JoseConfig",
"{",
"CompressionAlg",
":",
"\"",
"\"",
",",
"Headers",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"<mask>",
"{",
"}",
")",
"}",
"\n\n",
"//apply extra options",
"for",
"_",
",",
"option",
":=",
"range",
"options",
"{",
"option",
"(",
"cfg",
")",
"\n",
"}",
"\n\n",
"//make sure defaults and requires are managed by us",
"cfg",
".",
"Headers",
"[",
"\"",
"\"",
"]",
"=",
"signingAlg",
"\n\n",
"paloadBytes",
":=",
"payload",
"\n",
"var",
"header",
"[",
"]",
"byte",
"\n",
"var",
"signature",
"[",
"]",
"byte",
"\n\n",
"if",
"header",
",",
"err",
"=",
"json",
".",
"Marshal",
"(",
"cfg",
".",
"Headers",
")",
";",
"err",
"==",
"nil",
"{",
"securedInput",
":=",
"[",
"]",
"byte",
"(",
"compact",
".",
"Serialize",
"(",
"header",
",",
"paloadBytes",
")",
")",
"\n\n",
"if",
"signature",
",",
"err",
"=",
"signer",
".",
"Sign",
"(",
"securedInput",
",",
"key",
")",
";",
"err",
"==",
"nil",
"{",
"return",
"compact",
".",
"Serialize",
"(",
"header",
",",
"paloadBytes",
",",
"signature",
")",
",",
"nil",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"signingAlg",
")",
")",
"\n",
"}"
] |
14,933 | all-14934 | [
"List",
"returns",
"the",
"list",
"of",
"apps",
"filtered",
"through",
"the",
"filter",
"parameter",
"."
] | [
"func",
"List",
"(",
"filter",
"*",
"Filter",
")",
"(",
"[",
"]",
"App",
",",
"error",
")",
"{",
"apps",
":=",
"[",
"]",
"App",
"{",
"}",
"\n",
"query",
":=",
"filter",
".",
"Query",
"(",
")",
"\n",
"conn",
",",
"err",
":=",
"db",
".",
"Conn",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"err",
"=",
"conn",
".",
"Apps",
"(",
")",
".",
"Find",
"(",
"query",
")",
".",
"All",
"(",
"&",
"apps",
")",
"\n",
"conn",
".",
"Close",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"filter",
"!=",
"nil",
"&&",
"len",
"(",
"filter",
".",
"Statuses",
")",
">",
"0",
"{",
"appsProvisionerMap",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"provision",
".",
"App",
")",
"\n",
"var",
"prov",
"provision",
".",
"Provisioner",
"\n",
"for",
"i",
":=",
"range",
"apps",
"{",
"a",
":=",
"&",
"apps",
"[",
"i",
"]",
"\n",
"prov",
",",
"err",
"=",
"a",
".",
"getProvisioner",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"appsProvisionerMap",
"[",
"prov",
".",
"GetName",
"(",
")",
"]",
"=",
"append",
"(",
"appsProvisionerMap",
"[",
"prov",
".",
"GetName",
"(",
")",
"]",
",",
"a",
")",
"\n",
"}",
"\n",
"var",
"provisionApps",
"[",
"]",
"provision",
".",
"App",
"\n",
"for",
"provName",
",",
"apps",
":=",
"range",
"appsProvisionerMap",
"{",
"prov",
",",
"err",
"=",
"provision",
".",
"Get",
"(",
"provName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"filterProv",
",",
"ok",
":=",
"prov",
".",
"(",
"provision",
".",
"AppFilterProvisioner",
")",
";",
"ok",
"{",
"apps",
",",
"err",
"=",
"filterProv",
".",
"FilterAppsByUnitStatus",
"(",
"apps",
",",
"<mask>",
".",
"Statuses",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"provisionApps",
"=",
"append",
"(",
"provisionApps",
",",
"apps",
"...",
")",
"\n",
"}",
"\n",
"for",
"i",
":=",
"range",
"provisionApps",
"{",
"apps",
"[",
"i",
"]",
"=",
"*",
"(",
"provisionApps",
"[",
"i",
"]",
".",
"(",
"*",
"App",
")",
")",
"\n",
"}",
"\n",
"apps",
"=",
"apps",
"[",
":",
"len",
"(",
"provisionApps",
")",
"]",
"\n",
"}",
"\n",
"err",
"=",
"loadCachedAddrsInApps",
"(",
"apps",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"apps",
",",
"nil",
"\n",
"}"
] |
14,934 | all-14935 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetRelayoutBoundaryReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom34",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
14,935 | all-14936 | [
"DeleteSession",
"delete",
"session"
] | [
"func",
"(",
"ctx",
"*",
"Context",
")",
"DeleteSession",
"(",
")",
"error",
"{",
"sid",
":=",
"ctx",
".",
"Data",
"[",
"\"",
"\"",
"]",
".",
"(",
"string",
")",
"\n",
"ctx",
".",
"Data",
"[",
"\"",
"\"",
"]",
"=",
"nil",
"\n",
"provider",
".",
"Destroy",
"(",
"sid",
")",
"\n",
"cookie",
":=",
"httpCookie",
"\n",
"cookie",
".",
"MaxAge",
"=",
"-",
"1",
"\n",
"<mask>",
".",
"SetCookie",
"(",
"ctx",
".",
"ResponseWriter",
",",
"&",
"cookie",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,936 | all-14937 | [
"ApplyDefault",
"applies",
"the",
"defaults",
"for",
"GCSConfiguration",
"decorations",
".",
"If",
"a",
"field",
"has",
"a",
"zero",
"value",
"it",
"replaces",
"that",
"with",
"the",
"value",
"set",
"in",
"def",
"."
] | [
"func",
"(",
"g",
"*",
"GCSConfiguration",
")",
"ApplyDefault",
"(",
"def",
"*",
"GCSConfiguration",
")",
"*",
"GCSConfiguration",
"{",
"if",
"g",
"==",
"nil",
"&&",
"def",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"<mask>",
"merged",
"GCSConfiguration",
"\n",
"if",
"g",
"!=",
"nil",
"{",
"merged",
"=",
"*",
"g",
"\n",
"}",
"else",
"{",
"merged",
"=",
"*",
"def",
"\n",
"}",
"\n",
"if",
"g",
"==",
"nil",
"||",
"def",
"==",
"nil",
"{",
"return",
"&",
"merged",
"\n",
"}",
"\n\n",
"if",
"merged",
".",
"Bucket",
"==",
"\"",
"\"",
"{",
"merged",
".",
"Bucket",
"=",
"def",
".",
"Bucket",
"\n",
"}",
"\n",
"if",
"merged",
".",
"PathPrefix",
"==",
"\"",
"\"",
"{",
"merged",
".",
"PathPrefix",
"=",
"def",
".",
"PathPrefix",
"\n",
"}",
"\n",
"if",
"merged",
".",
"PathStrategy",
"==",
"\"",
"\"",
"{",
"merged",
".",
"PathStrategy",
"=",
"def",
".",
"PathStrategy",
"\n",
"}",
"\n",
"if",
"merged",
".",
"DefaultOrg",
"==",
"\"",
"\"",
"{",
"merged",
".",
"DefaultOrg",
"=",
"def",
".",
"DefaultOrg",
"\n",
"}",
"\n",
"if",
"merged",
".",
"DefaultRepo",
"==",
"\"",
"\"",
"{",
"merged",
".",
"DefaultRepo",
"=",
"def",
".",
"DefaultRepo",
"\n",
"}",
"\n",
"return",
"&",
"merged",
"\n",
"}"
] |
14,937 | all-14938 | [
"DerivePublicKey",
"derives",
"the",
"public",
"key",
"with",
"index",
"and",
"chainCode",
".",
"It",
"returns",
"the",
"new",
"public",
"key",
"and",
"new",
"chain",
"code",
"."
] | [
"func",
"DerivePublicKey",
"(",
"pubKeyBytes",
"[",
"]",
"byte",
",",
"chainCode",
"[",
"]",
"byte",
",",
"index",
"uint32",
")",
"(",
"[",
"]",
"byte",
",",
"[",
"]",
"byte",
")",
"{",
"data",
":=",
"[",
"]",
"byte",
"{",
"}",
"\n",
"data",
"=",
"append",
"(",
"data",
",",
"pubKeyBytes",
"...",
")",
"\n",
"data",
"=",
"append",
"(",
"data",
",",
"uint32ToBytes",
"(",
"index",
")",
"...",
")",
"\n",
"data2",
",",
"chainCode2",
":=",
"I64",
"(",
"chainCode",
",",
"data",
")",
"\n",
"data2p",
":=",
"PubKeyBytesFromPrivKeyBytes",
"(",
"data2",
",",
"<mask>",
")",
"\n",
"return",
"addPoints",
"(",
"pubKeyBytes",
",",
"data2p",
")",
",",
"chainCode2",
"\n",
"}"
] |
14,938 | all-14939 | [
"/",
"*",
"BufferWithBytes",
"returns",
"a",
"new",
"gbytes",
".",
"Buffer",
"seeded",
"with",
"the",
"passed",
"in",
"bytes"
] | [
"func",
"BufferWithBytes",
"(",
"bytes",
"[",
"]",
"byte",
")",
"*",
"Buffer",
"{",
"return",
"&",
"Buffer",
"{",
"lock",
":",
"&",
"sync",
".",
"Mutex",
"{",
"}",
",",
"contents",
":",
"<mask>",
",",
"}",
"\n",
"}"
] |
14,939 | all-14940 | [
"canExecuteConcurrently",
"checks",
"whether",
"the",
"provided",
"ProwJob",
"can",
"be",
"executed",
"concurrently",
"."
] | [
"func",
"(",
"c",
"*",
"Controller",
")",
"canExecuteConcurrently",
"(",
"pj",
"*",
"prowapi",
".",
"ProwJob",
")",
"bool",
"{",
"c",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"max",
":=",
"c",
".",
"config",
"(",
")",
".",
"MaxConcurrency",
";",
"max",
">",
"0",
"{",
"<mask>",
"running",
"int",
"\n",
"for",
"_",
",",
"num",
":=",
"range",
"c",
".",
"pendingJobs",
"{",
"running",
"+=",
"num",
"\n",
"}",
"\n",
"if",
"running",
">=",
"max",
"{",
"c",
".",
"log",
".",
"WithFields",
"(",
"pjutil",
".",
"ProwJobFields",
"(",
"pj",
")",
")",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"running",
")",
"\n",
"return",
"false",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"pj",
".",
"Spec",
".",
"MaxConcurrency",
"==",
"0",
"{",
"c",
".",
"pendingJobs",
"[",
"pj",
".",
"Spec",
".",
"Job",
"]",
"++",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"numPending",
":=",
"c",
".",
"pendingJobs",
"[",
"pj",
".",
"Spec",
".",
"Job",
"]",
"\n",
"if",
"numPending",
">=",
"pj",
".",
"Spec",
".",
"MaxConcurrency",
"{",
"c",
".",
"log",
".",
"WithFields",
"(",
"pjutil",
".",
"ProwJobFields",
"(",
"pj",
")",
")",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"pj",
".",
"Spec",
".",
"Job",
",",
"numPending",
")",
"\n",
"return",
"false",
"\n",
"}",
"\n",
"c",
".",
"pendingJobs",
"[",
"pj",
".",
"Spec",
".",
"Job",
"]",
"++",
"\n",
"return",
"true",
"\n",
"}"
] |
14,940 | all-14941 | [
"Set",
"is",
"required",
"for",
"kingpin",
"interfaces",
"to",
"allow",
"command",
"line",
"params",
"to",
"be",
"set",
"to",
"our",
"map",
"datatype"
] | [
"func",
"(",
"o",
"*",
"ListUint64Option",
")",
"Set",
"(",
"value",
"string",
")",
"error",
"{",
"val",
":=",
"Uint64Option",
"{",
"}",
"\n",
"val",
".",
"<mask>",
"(",
"value",
")",
"\n",
"*",
"o",
"=",
"append",
"(",
"*",
"o",
",",
"val",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,941 | all-14942 | [
"Set",
"is",
"required",
"for",
"kingpin",
"interfaces",
"to",
"allow",
"command",
"line",
"params",
"to",
"be",
"set",
"to",
"our",
"map",
"datatype"
] | [
"func",
"(",
"o",
"*",
"MapInt64Option",
")",
"Set",
"(",
"value",
"string",
")",
"error",
"{",
"parts",
":=",
"stringMapRegex",
".",
"Split",
"(",
"value",
",",
"2",
")",
"\n",
"if",
"len",
"(",
"parts",
")",
"!=",
"2",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"value",
")",
"\n",
"}",
"\n",
"val",
":=",
"Int64Option",
"{",
"}",
"\n",
"val",
".",
"Set",
"(",
"<mask>",
"[",
"1",
"]",
")",
"\n",
"(",
"*",
"o",
")",
"[",
"parts",
"[",
"0",
"]",
"]",
"=",
"val",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,942 | all-14943 | [
"Decode",
"reads",
"the",
"next",
"YAML",
"-",
"encoded",
"value",
"from",
"its",
"input",
"and",
"stores",
"it",
"in",
"the",
"value",
"pointed",
"to",
"by",
"v",
".",
"See",
"the",
"documentation",
"for",
"Unmarshal",
"for",
"details",
"about",
"the",
"conversion",
"of",
"YAML",
"into",
"a",
"Go",
"value",
"."
] | [
"func",
"(",
"dec",
"*",
"Decoder",
")",
"Decode",
"(",
"v",
"<mask>",
"{",
"}",
")",
"(",
"err",
"error",
")",
"{",
"d",
":=",
"newDecoder",
"(",
"dec",
".",
"strict",
")",
"\n",
"defer",
"handleErr",
"(",
"&",
"err",
")",
"\n",
"node",
":=",
"dec",
".",
"parser",
".",
"parse",
"(",
")",
"\n",
"if",
"node",
"==",
"nil",
"{",
"return",
"io",
".",
"EOF",
"\n",
"}",
"\n",
"out",
":=",
"reflect",
".",
"ValueOf",
"(",
"v",
")",
"\n",
"if",
"out",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Ptr",
"&&",
"!",
"out",
".",
"IsNil",
"(",
")",
"{",
"out",
"=",
"out",
".",
"Elem",
"(",
")",
"\n",
"}",
"\n",
"d",
".",
"unmarshal",
"(",
"node",
",",
"out",
")",
"\n",
"if",
"len",
"(",
"d",
".",
"terrors",
")",
">",
"0",
"{",
"return",
"&",
"TypeError",
"{",
"d",
".",
"terrors",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,943 | all-14944 | [
"filterTasksToStartUnsafe",
"filters",
"only",
"the",
"tasks",
"that",
"need",
"to",
"be",
"started",
"after",
"the",
"agent",
"has",
"been",
"restarted",
".",
"It",
"also",
"synchronizes",
"states",
"of",
"all",
"of",
"the",
"containers",
"in",
"tasks",
"that",
"need",
"to",
"be",
"started",
"."
] | [
"func",
"(",
"engine",
"*",
"DockerTaskEngine",
")",
"filterTasksToStartUnsafe",
"(",
"tasks",
"[",
"]",
"*",
"apitask",
".",
"Task",
")",
"[",
"]",
"*",
"apitask",
".",
"Task",
"{",
"var",
"tasksToStart",
"[",
"]",
"*",
"apitask",
".",
"Task",
"\n",
"for",
"_",
",",
"task",
":=",
"range",
"tasks",
"{",
"conts",
",",
"ok",
":=",
"engine",
".",
"state",
".",
"ContainerMapByArn",
"(",
"task",
".",
"Arn",
")",
"\n",
"if",
"!",
"ok",
"{",
"// task hasn't started processing, no need to check container status",
"tasksToStart",
"=",
"append",
"(",
"tasksToStart",
",",
"task",
")",
"\n",
"continue",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"cont",
":=",
"range",
"conts",
"{",
"engine",
".",
"synchronizeContainerStatus",
"(",
"cont",
",",
"task",
")",
"\n",
"}",
"\n\n",
"tasksToStart",
"=",
"append",
"(",
"tasksToStart",
",",
"<mask>",
")",
"\n\n",
"// Put tasks that are stopped by acs but hasn't been stopped in wait group",
"if",
"task",
".",
"GetDesiredStatus",
"(",
")",
".",
"Terminal",
"(",
")",
"&&",
"task",
".",
"GetStopSequenceNumber",
"(",
")",
"!=",
"0",
"{",
"engine",
".",
"taskStopGroup",
".",
"Add",
"(",
"task",
".",
"GetStopSequenceNumber",
"(",
")",
",",
"1",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"tasksToStart",
"\n",
"}"
] |
14,944 | all-14945 | [
"GetUrl",
"returns",
"the",
"Url",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"s",
"*",
"ServiceHookSlackRequest",
")",
"GetUrl",
"(",
")",
"string",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"Url",
"==",
"nil",
"{",
"<mask>",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"s",
".",
"Url",
"\n",
"}"
] |
14,945 | all-14946 | [
"ReceiveIssueEvent",
"is",
"a",
"wrapper",
"on",
"plugin",
".",
"ReceiveIssueEvent",
"()",
"logging",
"the",
"author"
] | [
"func",
"(",
"a",
"*",
"AuthorLoggerPluginWrapper",
")",
"ReceiveIssueEvent",
"(",
"event",
"sql",
".",
"IssueEvent",
")",
"[",
"]",
"<mask>",
"{",
"points",
":=",
"a",
".",
"plugin",
".",
"ReceiveIssueEvent",
"(",
"event",
")",
"\n\n",
"if",
"a",
".",
"enabled",
"{",
"for",
"i",
":=",
"range",
"points",
"{",
"if",
"points",
"[",
"i",
"]",
".",
"Values",
"==",
"nil",
"{",
"points",
"[",
"i",
"]",
".",
"Values",
"=",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"}",
"\n",
"}",
"\n",
"if",
"event",
".",
"Actor",
"!=",
"nil",
"{",
"points",
"[",
"i",
"]",
".",
"Values",
"[",
"\"",
"\"",
"]",
"=",
"*",
"event",
".",
"Actor",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"points",
"\n",
"}"
] |
14,946 | all-14947 | [
"filterByServiceType",
"filters",
"services",
"according",
"their",
"types"
] | [
"func",
"(",
"sc",
"*",
"serviceSource",
")",
"filterByServiceType",
"(",
"services",
"[",
"]",
"*",
"v1",
".",
"Service",
")",
"[",
"]",
"*",
"v1",
".",
"Service",
"{",
"filteredList",
":=",
"[",
"]",
"*",
"v1",
".",
"Service",
"{",
"}",
"\n",
"for",
"_",
",",
"service",
":=",
"range",
"services",
"{",
"// Check if the service is of the given type or not",
"if",
"_",
",",
"ok",
":=",
"sc",
".",
"serviceTypeFilter",
"[",
"string",
"(",
"<mask>",
".",
"Spec",
".",
"Type",
")",
"]",
";",
"ok",
"{",
"filteredList",
"=",
"append",
"(",
"filteredList",
",",
"service",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"filteredList",
"\n",
"}"
] |
14,947 | all-14948 | [
"GetChildByName",
"is",
"a",
"wrapper",
"around",
"gtk_stack_get_child_by_name",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Stack",
")",
"GetChildByName",
"(",
"name",
"string",
")",
"*",
"Widget",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"name",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"c",
":=",
"C",
".",
"gtk_stack_get_child_by_name",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"wrapWidget",
"(",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
")",
"\n",
"}"
] |
14,948 | all-14949 | [
"SetBatch",
"sets",
"the",
"default",
"batch",
"size",
"used",
"when",
"fetching",
"documents",
"from",
"the",
"database",
".",
"It",
"s",
"possible",
"to",
"change",
"this",
"setting",
"on",
"a",
"per",
"-",
"query",
"basis",
"as",
"well",
"using",
"the",
"Query",
".",
"Batch",
"method",
".",
"The",
"default",
"batch",
"size",
"is",
"defined",
"by",
"the",
"database",
"itself",
".",
"As",
"of",
"this",
"writing",
"MongoDB",
"will",
"use",
"an",
"initial",
"size",
"of",
"min",
"(",
"100",
"docs",
"4MB",
")",
"on",
"the",
"first",
"batch",
"and",
"4MB",
"on",
"remaining",
"ones",
"."
] | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"SetBatch",
"(",
"n",
"int",
")",
"{",
"if",
"n",
"==",
"1",
"{",
"// Server interprets 1 as -1 and closes the cursor (!?)",
"n",
"=",
"2",
"\n",
"}",
"\n",
"s",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"s",
".",
"queryConfig",
".",
"op",
".",
"limit",
"=",
"int32",
"(",
"n",
")",
"\n",
"s",
".",
"m",
".",
"Unlock",
"(",
")",
"\n",
"}"
] |
14,949 | all-14950 | [
"This",
"will",
"retrieve",
"all",
"new",
"rows",
"that",
"were",
"created",
"since",
"the",
"row",
"with",
"id",
"was",
"created",
"[",
"1",
"2",
"3",
"4",
"]",
"since",
"2",
"will",
"return",
"[",
"1",
"]"
] | [
"func",
"(",
"s",
"RethinkStore",
")",
"Since",
"(",
"id",
"string",
",",
"count",
",",
"skip",
"int",
",",
"store",
"string",
")",
"(",
"rrows",
"ObjectRows",
",",
"err",
"error",
")",
"{",
"result",
",",
"err",
":=",
"r",
".",
"<mask>",
"(",
"s",
".",
"Database",
")",
".",
"Table",
"(",
"store",
")",
".",
"Filter",
"(",
"r",
".",
"Row",
".",
"Field",
"(",
"\"",
"\"",
")",
".",
"Gt",
"(",
"id",
")",
")",
".",
"Limit",
"(",
"count",
")",
".",
"Skip",
"(",
"skip",
")",
".",
"Run",
"(",
"s",
".",
"Session",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"//\tresult.All(dst)",
"rrows",
"=",
"RethinkRows",
"{",
"result",
"}",
"\n",
"return",
"\n",
"}"
] |
14,950 | all-14951 | [
"adjustErr",
"adjusts",
"the",
"position",
"of",
"err",
"if",
"it",
"is",
"a",
"demangleErr",
"and",
"returns",
"err",
"."
] | [
"func",
"adjustErr",
"(",
"err",
"error",
",",
"adj",
"int",
")",
"error",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"de",
",",
"<mask>",
":=",
"err",
".",
"(",
"demangleErr",
")",
";",
"ok",
"{",
"de",
".",
"off",
"+=",
"adj",
"\n",
"return",
"de",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
] |
14,951 | all-14952 | [
"/",
"*",
"Allocates",
"and",
"initializes",
"CvSparseMat",
"header",
"and",
"allocates",
"data"
] | [
"func",
"CreateSparseMat",
"(",
"sizes",
"[",
"]",
"int",
",",
"type_",
"int",
")",
"*",
"SparseMat",
"{",
"dims",
":=",
"C",
".",
"int",
"(",
"len",
"(",
"sizes",
")",
")",
"\n",
"sizes_c",
":=",
"<mask>",
"(",
"[",
"]",
"C",
".",
"int",
",",
"len",
"(",
"sizes",
")",
")",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"sizes",
")",
";",
"i",
"++",
"{",
"sizes_c",
"[",
"i",
"]",
"=",
"C",
".",
"int",
"(",
"sizes",
"[",
"i",
"]",
")",
"\n",
"}",
"\n\n",
"mat",
":=",
"C",
".",
"cvCreateSparseMat",
"(",
"dims",
",",
"(",
"*",
"C",
".",
"int",
")",
"(",
"&",
"sizes_c",
"[",
"0",
"]",
")",
",",
"C",
".",
"int",
"(",
"type_",
")",
",",
")",
"\n",
"return",
"(",
"*",
"SparseMat",
")",
"(",
"mat",
")",
"\n",
"}"
] |
14,952 | all-14953 | [
"BuildMacKeypad",
"builds",
"the",
"Mac",
"Keypad",
"Graph"
] | [
"func",
"BuildMacKeypad",
"(",
")",
"Graph",
"{",
"data",
",",
"err",
":=",
"<mask>",
".",
"Asset",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"getAdjancencyGraphFromFile",
"(",
"data",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
14,953 | all-14954 | [
"DeepCopy",
"copies",
"the",
"receiver",
"into",
"a",
"new",
"RGBColor",
"."
] | [
"func",
"(",
"r",
"*",
"RGBColor",
")",
"DeepCopy",
"(",
")",
"*",
"RGBColor",
"{",
"if",
"r",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"RGBColor",
")",
"\n",
"r",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
"return",
"<mask>",
"\n",
"}"
] |
14,954 | all-14955 | [
"Debug",
"formats",
"a",
"given",
"message",
"according",
"to",
"given",
"params",
"to",
"log",
"with",
"level",
"Debug",
"."
] | [
"func",
"(",
"dl",
"*",
"DefaultLogger",
")",
"Debug",
"(",
"<mask>",
"string",
",",
"params",
"...",
"interface",
"{",
"}",
")",
"{",
"dl",
".",
"logger",
".",
"Debugf",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"caller",
"(",
")",
",",
"message",
")",
",",
"params",
"...",
")",
"\n",
"}"
] |
14,955 | all-14956 | [
"GetIncludeUngroupedHosts",
"returns",
"the",
"IncludeUngroupedHosts",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"g",
"*",
"GraphDefinition",
")",
"GetIncludeUngroupedHosts",
"(",
")",
"bool",
"{",
"if",
"g",
"==",
"nil",
"||",
"g",
".",
"IncludeUngroupedHosts",
"==",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"g",
".",
"IncludeUngroupedHosts",
"\n",
"}"
] |
14,956 | all-14957 | [
"Stability",
":",
"***",
"EXPERIMENTAL",
"***",
"Connect",
"to",
"receive",
"messages",
"See",
"#connect"
] | [
"func",
"(",
"events",
"*",
"Events",
")",
"Connect",
"(",
"bindings",
"string",
")",
"error",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"if",
"bindings",
"!=",
"\"",
"\"",
"{",
"v",
".",
"Add",
"(",
"\"",
"\"",
",",
"bindings",
")",
"\n",
"}",
"\n",
"cd",
":=",
"tcclient",
".",
"Client",
"(",
"*",
"<mask>",
")",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"(",
"&",
"cd",
")",
".",
"APICall",
"(",
"nil",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"v",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
14,957 | all-14958 | [
"Stops",
"the",
"server",
"network",
"activity",
".",
"This",
"is",
"all",
"that",
"s",
"required",
"to",
"clean",
"-",
"up",
"a",
"Server",
"."
] | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"Close",
"(",
")",
"{",
"s",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"s",
".",
"closed",
".",
"Set",
"(",
")",
"\n",
"s",
".",
"socket",
".",
"Close",
"(",
")",
"\n",
"}"
] |
14,958 | all-14959 | [
"RunFilter",
"yields",
"contents",
"of",
"a",
"filesystem",
"tree",
".",
"It",
"implements",
"the",
"Filter",
"interface",
"."
] | [
"func",
"(",
"f",
"*",
"FindFilter",
")",
"RunFilter",
"(",
"arg",
"Arg",
")",
"error",
"{",
"return",
"filepath",
".",
"Walk",
"(",
"f",
".",
"dir",
",",
"func",
"(",
"n",
"string",
",",
"s",
"<mask>",
".",
"FileInfo",
",",
"e",
"error",
")",
"error",
"{",
"if",
"e",
"!=",
"nil",
"{",
"return",
"e",
"\n",
"}",
"\n",
"if",
"s",
".",
"Mode",
"(",
")",
".",
"IsDir",
"(",
")",
"&&",
"f",
".",
"skipdirif",
"(",
"n",
")",
"{",
"return",
"filepath",
".",
"SkipDir",
"\n",
"}",
"\n",
"if",
"f",
".",
"ifmode",
"(",
"s",
".",
"Mode",
"(",
")",
")",
"{",
"arg",
".",
"Out",
"<-",
"n",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
")",
"\n",
"}"
] |
14,959 | all-14960 | [
"RegisterIssueCommentHandler",
"registers",
"a",
"plugin",
"s",
"github",
".",
"IssueCommentEvent",
"handler",
"."
] | [
"func",
"RegisterIssueCommentHandler",
"(",
"name",
"string",
",",
"fn",
"IssueCommentHandler",
",",
"help",
"HelpProvider",
")",
"{",
"pluginHelp",
"[",
"name",
"]",
"=",
"<mask>",
"\n",
"issueCommentHandlers",
"[",
"name",
"]",
"=",
"fn",
"\n",
"}"
] |
14,960 | all-14961 | [
"resourceVSphereHAVMOverrideFlattenID",
"makes",
"an",
"ID",
"for",
"the",
"vsphere_ha_vm_override",
"resource",
"."
] | [
"func",
"resourceVSphereHAVMOverrideFlattenID",
"(",
"cluster",
"*",
"<mask>",
".",
"ClusterComputeResource",
",",
"vm",
"*",
"object",
".",
"VirtualMachine",
")",
"(",
"string",
",",
"error",
")",
"{",
"clusterID",
":=",
"cluster",
".",
"Reference",
"(",
")",
".",
"Value",
"\n",
"props",
",",
"err",
":=",
"virtualmachine",
".",
"Properties",
"(",
"vm",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"vmID",
":=",
"props",
".",
"Config",
".",
"Uuid",
"\n",
"return",
"strings",
".",
"Join",
"(",
"[",
"]",
"string",
"{",
"clusterID",
",",
"vmID",
"}",
",",
"\"",
"\"",
")",
",",
"nil",
"\n",
"}"
] |
14,961 | all-14962 | [
"GetTextAlignOk",
"returns",
"a",
"tuple",
"with",
"the",
"TextAlign",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"a",
"*",
"AlertValueDefinition",
")",
"GetTextAlignOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"a",
"==",
"nil",
"||",
"a",
".",
"TextAlign",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"a",
".",
"TextAlign",
",",
"true",
"\n",
"}"
] |
14,962 | all-14963 | [
"Click",
"performs",
"the",
"provided",
"Click",
"event",
"using",
"the",
"provided",
"Button",
"at",
"the",
"current",
"mouse",
"position",
"."
] | [
"func",
"(",
"p",
"*",
"Page",
")",
"Click",
"(",
"<mask>",
"Click",
",",
"button",
"Button",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"switch",
"event",
"{",
"case",
"SingleClick",
":",
"err",
"=",
"p",
".",
"session",
".",
"Click",
"(",
"api",
".",
"Button",
"(",
"button",
")",
")",
"\n",
"case",
"HoldClick",
":",
"err",
"=",
"p",
".",
"session",
".",
"ButtonDown",
"(",
"api",
".",
"Button",
"(",
"button",
")",
")",
"\n",
"case",
"ReleaseClick",
":",
"err",
"=",
"p",
".",
"session",
".",
"ButtonUp",
"(",
"api",
".",
"Button",
"(",
"button",
")",
")",
"\n",
"default",
":",
"err",
"=",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"event",
",",
"button",
",",
"err",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
14,963 | all-14964 | [
"Do",
"executes",
"Overlay",
".",
"setShowViewportSizeOnResize",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetShowViewportSizeOnResizeParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetShowViewportSizeOnResize",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
14,964 | all-14965 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetResourceContentReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage32",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
14,965 | all-14966 | [
"PrefixPredict",
"returns",
"a",
"list",
"of",
"at",
"most",
"num",
"nodes",
"which",
"has",
"the",
"key",
"as",
"their",
"prefix",
".",
"These",
"nodes",
"are",
"ordered",
"by",
"their",
"keys",
".",
"If",
"num",
"is",
"0",
"it",
"returns",
"all",
"matches",
".",
"For",
"example",
"if",
"the",
"following",
"keys",
"were",
"inserted",
":",
"id",
"key",
"19",
"abc",
"23",
"ab",
"37",
"abcd",
"then",
"PrefixPredict",
"(",
"[]",
"byte",
"(",
"ab",
")",
"2",
")",
"=",
"[",
"23",
"19",
"]",
"//",
"predict",
"[",
"ab",
"abc",
"]",
"PrefixPredict",
"(",
"[]",
"byte",
"(",
"ab",
")",
"0",
")",
"=",
"[",
"23",
"19",
"37",
"]",
"//",
"predict",
"[",
"ab",
"abc",
"abcd",
"]"
] | [
"func",
"(",
"da",
"*",
"Cedar",
")",
"PrefixPredict",
"(",
"key",
"[",
"]",
"byte",
",",
"num",
"int",
")",
"(",
"ids",
"[",
"]",
"int",
")",
"{",
"root",
",",
"err",
":=",
"da",
".",
"Jump",
"(",
"<mask>",
",",
"0",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"for",
"from",
",",
"err",
":=",
"da",
".",
"begin",
"(",
"root",
")",
";",
"err",
"==",
"nil",
";",
"from",
",",
"err",
"=",
"da",
".",
"next",
"(",
"from",
",",
"root",
")",
"{",
"ids",
"=",
"append",
"(",
"ids",
",",
"from",
")",
"\n",
"num",
"--",
"\n",
"if",
"num",
"==",
"0",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
14,966 | all-14967 | [
"tlsCacheGet",
"is",
"a",
"modified",
"copy",
"of",
"k8s",
".",
"io",
"/",
"kubernetes",
"/",
"pkg",
"/",
"client",
"/",
"transport",
".",
"tlsTransportCache",
".",
"get",
"."
] | [
"func",
"tlsCacheGet",
"(",
"config",
"*",
"restConfig",
")",
"(",
"http",
".",
"RoundTripper",
",",
"error",
")",
"{",
"// REMOVED: any actual caching",
"// Get the TLS options for this client config",
"tlsConfig",
",",
"err",
":=",
"tlsConfigFor",
"(",
"config",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"// The options didn't require a custom TLS config",
"if",
"tlsConfig",
"==",
"nil",
"{",
"return",
"http",
".",
"DefaultTransport",
",",
"nil",
"\n",
"}",
"\n\n",
"// REMOVED: Call to k8s.io/apimachinery/pkg/util/net.SetTransportDefaults; instead of the generic machinery and conditionals, hard-coded the result here.",
"t",
":=",
"&",
"http",
".",
"Transport",
"{",
"// http.ProxyFromEnvironment doesn't respect CIDRs and that makes it impossible to exclude things like pod and service IPs from proxy settings",
"// ProxierWithNoProxyCIDR allows CIDR rules in NO_PROXY",
"Proxy",
":",
"newProxierWithNoProxyCIDR",
"(",
"http",
".",
"ProxyFromEnvironment",
")",
",",
"TLSHandshakeTimeout",
":",
"10",
"*",
"time",
".",
"Second",
",",
"TLSClientConfig",
":",
"tlsConfig",
",",
"Dial",
":",
"(",
"&",
"<mask>",
".",
"Dialer",
"{",
"Timeout",
":",
"30",
"*",
"time",
".",
"Second",
",",
"KeepAlive",
":",
"30",
"*",
"time",
".",
"Second",
",",
"}",
")",
".",
"Dial",
",",
"}",
"\n",
"// Allow clients to disable http2 if needed.",
"if",
"s",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
";",
"len",
"(",
"s",
")",
"==",
"0",
"{",
"_",
"=",
"http2",
".",
"ConfigureTransport",
"(",
"t",
")",
"\n",
"}",
"\n",
"return",
"t",
",",
"nil",
"\n",
"}"
] |
14,967 | all-14968 | [
"NewAPIServer",
"creates",
"a",
"new",
"APIServer",
"for",
"the",
"given",
"Version",
"."
] | [
"func",
"NewAPIServer",
"(",
"<mask>",
"*",
"pb",
".",
"Version",
",",
"options",
"APIServerOptions",
")",
"pb",
".",
"APIServer",
"{",
"return",
"newAPIServer",
"(",
"version",
",",
"options",
")",
"\n",
"}"
] |
14,968 | all-14969 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"a",
"specified",
"program",
"object"
] | [
"func",
"ProgramUniform3ui",
"(",
"program",
"uint32",
",",
"<mask>",
"int32",
",",
"v0",
"uint32",
",",
"v1",
"uint32",
",",
"v2",
"uint32",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpProgramUniform3ui",
",",
"5",
",",
"uintptr",
"(",
"program",
")",
",",
"uintptr",
"(",
"location",
")",
",",
"uintptr",
"(",
"v0",
")",
",",
"uintptr",
"(",
"v1",
")",
",",
"uintptr",
"(",
"v2",
")",
",",
"0",
")",
"\n",
"}"
] |
14,969 | all-14970 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"StopSamplingParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoMemory",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
14,970 | all-14971 | [
"Respond",
"without",
"doing",
"anything",
".",
"This",
"endpoint",
"is",
"used",
"to",
"check",
"that",
"the",
"service",
"is",
"up",
".",
"See",
"#ping"
] | [
"func",
"(",
"secrets",
"*",
"Secrets",
")",
"Ping",
"(",
")",
"error",
"{",
"cd",
":=",
"tcclient",
".",
"<mask>",
"(",
"*",
"secrets",
")",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"(",
"&",
"cd",
")",
".",
"APICall",
"(",
"nil",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"nil",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
14,971 | all-14972 | [
"SetLifetime",
"modifies",
"the",
"lifetime",
"of",
"specified",
"key",
":",
"value",
".",
"Errors",
":",
"InvalidKeyError",
"when",
"requested",
"key",
"could",
"not",
"be",
"found",
"."
] | [
"func",
"(",
"s",
"*",
"Cache",
")",
"SetLifetime",
"(",
"key",
"string",
",",
"d",
"time",
".",
"Duration",
")",
"error",
"{",
"if",
"s",
".",
"removeExpired",
"(",
")",
"==",
"raiqub",
".",
"WriteLocked",
"{",
"s",
".",
"Unlock",
"(",
")",
"\n",
"s",
".",
"RLock",
"(",
")",
"\n",
"}",
"\n",
"defer",
"s",
".",
"RUnlock",
"(",
")",
"\n\n",
"v",
",",
"err",
":=",
"s",
".",
"unsafeGet",
"(",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"v",
".",
"lifetime",
"=",
"d",
"\n",
"v",
".",
"Postpone",
"(",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,972 | all-14973 | [
"AsError",
"returns",
"r",
"as",
"error",
"converting",
"it",
"when",
"necessary"
] | [
"func",
"AsError",
"(",
"r",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"r",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"err",
",",
"ok",
":=",
"r",
".",
"(",
"error",
")",
";",
"<mask>",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"r",
")",
"\n",
"}"
] |
14,973 | all-14974 | [
"EventMotionNewFromEvent",
"returns",
"an",
"EventMotion",
"from",
"an",
"Event",
".",
"Using",
"widget",
".",
"Connect",
"()",
"for",
"a",
"key",
"related",
"signal",
"such",
"as",
"button",
"-",
"press",
"-",
"event",
"results",
"in",
"a",
"*",
"Event",
"being",
"passed",
"as",
"the",
"callback",
"s",
"second",
"argument",
".",
"The",
"argument",
"is",
"actually",
"a",
"*",
"EventMotion",
".",
"EventMotionNewFromEvent",
"provides",
"a",
"means",
"of",
"creating",
"an",
"EventKey",
"from",
"the",
"Event",
"."
] | [
"func",
"EventMotionNewFromEvent",
"(",
"event",
"*",
"Event",
")",
"*",
"EventMotion",
"{",
"ee",
":=",
"(",
"*",
"C",
".",
"GdkEvent",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"<mask>",
".",
"native",
"(",
")",
")",
")",
"\n",
"ev",
":=",
"Event",
"{",
"ee",
"}",
"\n",
"return",
"&",
"EventMotion",
"{",
"&",
"ev",
"}",
"\n",
"}"
] |
14,974 | all-14975 | [
"RenderPage",
"()",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_operation_preview_render_page",
"()",
"."
] | [
"func",
"(",
"pop",
"*",
"PrintOperationPreview",
")",
"RenderPage",
"(",
"page",
"int",
")",
"{",
"C",
".",
"gtk_print_operation_preview_render_page",
"(",
"<mask>",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"page",
")",
")",
"\n",
"}"
] |
14,975 | all-14976 | [
"GetObject",
"finds",
"object",
"in",
"a",
"database",
"by",
"id",
"then",
"returns",
"an",
"object",
"on",
"raw",
"JSON",
"format",
"."
] | [
"func",
"(",
"h",
"*",
"Handler",
")",
"GetObject",
"(",
"tkn",
",",
"objectType",
",",
"id",
"string",
")",
"(",
"json",
".",
"RawMessage",
",",
"error",
")",
"{",
"logger",
":=",
"h",
".",
"logger",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"objectType",
",",
"\"",
"\"",
",",
"id",
")",
"\n\n",
"if",
"!",
"h",
".",
"<mask>",
".",
"Check",
"(",
"tkn",
")",
"{",
"logger",
".",
"Warn",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"ErrAccessDenied",
"\n",
"}",
"\n\n",
"table",
",",
"ok",
":=",
"objectTypes",
"[",
"objectType",
"]",
"\n",
"if",
"!",
"ok",
"{",
"logger",
".",
"Warn",
"(",
"ErrBadObjectType",
".",
"Error",
"(",
")",
")",
"\n",
"return",
"nil",
",",
"ErrBadObjectType",
"\n",
"}",
"\n\n",
"obj",
",",
"err",
":=",
"h",
".",
"db",
".",
"FindByPrimaryKeyFrom",
"(",
"table",
",",
"id",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logger",
".",
"Error",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"return",
"nil",
",",
"ErrObjectNotFound",
"\n",
"}",
"\n\n",
"raw",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"obj",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logger",
".",
"Error",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"return",
"nil",
",",
"ErrInternal",
"\n",
"}",
"\n\n",
"return",
"raw",
",",
"nil",
"\n",
"}"
] |
14,976 | all-14977 | [
"Wraps",
"the",
"contents",
"of",
"register",
"sa",
"with",
"a",
"raw",
"string",
"mark",
"Note",
"that",
"this",
"effectively",
"stringifies",
"the",
"contents",
"of",
"register",
"sa"
] | [
"func",
"txMarkRaw",
"(",
"st",
"*",
"State",
")",
"{",
"if",
"reflect",
".",
"ValueOf",
"(",
"st",
".",
"sa",
")",
".",
"<mask>",
"(",
")",
"!=",
"rawStringType",
"{",
"st",
".",
"sa",
"=",
"rawString",
"(",
"interfaceToString",
"(",
"st",
".",
"sa",
")",
")",
"\n",
"}",
"\n",
"st",
".",
"Advance",
"(",
")",
"\n",
"}"
] |
14,977 | all-14978 | [
"bind",
"a",
"range",
"within",
"a",
"buffer",
"object",
"to",
"an",
"indexed",
"buffer",
"target"
] | [
"func",
"BindBufferRange",
"(",
"target",
"uint32",
",",
"<mask>",
"uint32",
",",
"buffer",
"uint32",
",",
"offset",
"int",
",",
"size",
"int",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpBindBufferRange",
",",
"5",
",",
"uintptr",
"(",
"target",
")",
",",
"uintptr",
"(",
"index",
")",
",",
"uintptr",
"(",
"buffer",
")",
",",
"uintptr",
"(",
"offset",
")",
",",
"uintptr",
"(",
"size",
")",
",",
"0",
")",
"\n",
"}"
] |
14,978 | all-14979 | [
"routeSplitFunc",
"is",
"the",
"SplitFunc",
"to",
"scan",
"url",
"pattern",
"."
] | [
"func",
"routeSplitFunc",
"(",
"data",
"[",
"]",
"byte",
",",
"atEOF",
"bool",
")",
"(",
"int",
",",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"atEOF",
"||",
"data",
"==",
"nil",
"{",
"return",
"0",
",",
"nil",
",",
"io",
".",
"EOF",
"\n",
"}",
"\n\n",
"r",
",",
"_",
":=",
"utf8",
".",
"DecodeRune",
"(",
"data",
")",
"\n\n",
"// matcher",
"if",
"r",
"==",
"'<'",
"{",
"i",
":=",
"bytes",
".",
"IndexRune",
"(",
"data",
",",
"'>'",
")",
"\n",
"if",
"i",
"==",
"-",
"1",
"{",
"return",
"0",
",",
"nil",
",",
"NoClosingBracket",
"\n",
"}",
"\n",
"return",
"(",
"i",
"+",
"1",
")",
",",
"data",
"[",
":",
"(",
"i",
"+",
"1",
")",
"]",
",",
"nil",
"\n",
"}",
"\n\n",
"// one char",
"if",
"len",
"(",
"data",
")",
"==",
"1",
"{",
"return",
"1",
",",
"data",
",",
"nil",
"\n",
"}",
"\n\n",
"// should ignore first '/'",
"slashIndex",
":=",
"bytes",
".",
"IndexRune",
"(",
"data",
"[",
"1",
":",
"]",
",",
"'/'",
")",
"\n",
"if",
"slashIndex",
"!=",
"-",
"1",
"{",
"slashIndex",
"++",
"\n",
"}",
"\n\n",
"matchIndex",
":=",
"<mask>",
".",
"IndexRune",
"(",
"data",
",",
"'<'",
")",
"\n\n",
"// remaining string would be a static entry",
"if",
"slashIndex",
"==",
"-",
"1",
"&&",
"matchIndex",
"==",
"-",
"1",
"{",
"return",
"len",
"(",
"data",
")",
",",
"data",
",",
"nil",
"\n",
"}",
"\n\n",
"// split by '<'",
"// return data before '<'",
"if",
"matchIndex",
"!=",
"-",
"1",
"&&",
"(",
"slashIndex",
"==",
"-",
"1",
"||",
"slashIndex",
">",
"matchIndex",
")",
"{",
"return",
"matchIndex",
",",
"data",
"[",
":",
"matchIndex",
"]",
",",
"nil",
"\n",
"}",
"\n\n",
"// split by '/'",
"// return data before '/' including '/'",
"return",
"slashIndex",
"+",
"1",
",",
"data",
"[",
":",
"(",
"slashIndex",
"+",
"1",
")",
"]",
",",
"nil",
"\n",
"}"
] |
14,979 | all-14980 | [
"SetFromStock",
"is",
"a",
"wrapper",
"around",
"gtk_status_icon_set_from_stock",
"()",
"Deprecated",
"since",
"3",
".",
"10",
"use",
"SetFromIconName",
"(",
"gtk_status_icon_set_from_icon_name",
")",
"instead",
"."
] | [
"func",
"(",
"v",
"*",
"StatusIcon",
")",
"SetFromStock",
"(",
"stockID",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"stockID",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_status_icon_set_from_stock",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
14,980 | all-14981 | [
"Empty",
"reports",
"whether",
"the",
"rectangle",
"contains",
"no",
"points",
"."
] | [
"func",
"(",
"r",
"Rectangle",
")",
"Empty",
"(",
")",
"bool",
"{",
"<mask>",
"r",
".",
"Min",
"[",
"0",
"]",
">=",
"r",
".",
"Max",
"[",
"0",
"]",
"||",
"r",
".",
"Min",
"[",
"1",
"]",
">=",
"r",
".",
"Max",
"[",
"1",
"]",
"\n",
"}"
] |
14,981 | all-14982 | [
"stopper",
"returns",
"a",
"channel",
"that",
"remains",
"open",
"until",
"an",
"interrupt",
"is",
"received",
"."
] | [
"func",
"stopper",
"(",
")",
"chan",
"struct",
"{",
"}",
"{",
"stop",
":=",
"make",
"(",
"chan",
"struct",
"{",
"}",
")",
"\n",
"c",
":=",
"make",
"(",
"chan",
"os",
".",
"Signal",
",",
"2",
")",
"\n",
"signal",
".",
"Notify",
"(",
"c",
",",
"<mask>",
".",
"Interrupt",
",",
"syscall",
".",
"SIGTERM",
")",
"\n",
"go",
"func",
"(",
")",
"{",
"<-",
"c",
"\n",
"logrus",
".",
"Warn",
"(",
"\"",
"\"",
")",
"\n",
"close",
"(",
"stop",
")",
"\n",
"<-",
"c",
"\n",
"logrus",
".",
"Error",
"(",
"\"",
"\"",
")",
"\n",
"os",
".",
"Exit",
"(",
"1",
")",
"\n",
"}",
"(",
")",
"\n",
"return",
"stop",
"\n",
"}"
] |
14,982 | all-14983 | [
"RefreshTokens",
"refreshes",
"a",
"users",
"existing",
"OAuth",
"tokens"
] | [
"func",
"(",
"o",
"OAuth",
")",
"RefreshTokens",
"(",
"oldTokens",
"<mask>",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"(",
"*",
"oauthTokens",
",",
"error",
")",
"{",
"refresh_token",
":=",
"oldTokens",
"[",
"\"",
"\"",
"]",
".",
"(",
"string",
")",
"\n",
"return",
"o",
".",
"GetTokens",
"(",
"refresh_token",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
14,983 | all-14984 | [
"Procurement",
"--",
"use",
"agent",
"to",
"run",
"async",
"task"
] | [
"func",
"(",
"s",
"*",
"SkuM1Small",
")",
"Procurement",
"(",
")",
"*",
"taskmanager",
".",
"Task",
"{",
"agent",
":=",
"taskmanager",
".",
"NewAgent",
"(",
"s",
".",
"TaskManager",
",",
"SkuName",
")",
"\n",
"task",
":=",
"agent",
".",
"GetTask",
"(",
")",
"\n\n",
"agent",
".",
"Run",
"(",
"func",
"(",
"ag",
"*",
"taskmanager",
".",
"Agent",
")",
"(",
"err",
"error",
")",
"{",
"if",
"clnt",
",",
"err",
":=",
"s",
".",
"GetInnkeeperClient",
"(",
")",
";",
"err",
"==",
"nil",
"{",
"if",
"phinfo",
",",
"err",
":=",
"clnt",
".",
"ProvisionHost",
"(",
"ClientSkuName",
",",
"s",
".",
"UserIdentifier",
")",
";",
"err",
"==",
"nil",
"{",
"lo",
".",
"G",
".",
"Debug",
"(",
"\"",
"\"",
",",
"phinfo",
")",
"\n\n",
"ag",
".",
"GetTask",
"(",
")",
".",
"Update",
"(",
"func",
"(",
"t",
"*",
"taskmanager",
".",
"Task",
")",
"interface",
"{",
"}",
"{",
"t",
".",
"Status",
"=",
"taskmanager",
".",
"AgentTaskStatusComplete",
"\n",
"t",
".",
"SetPublicMeta",
"(",
"ProvisionHostInfoMetaName",
",",
"phinfo",
")",
"\n",
"return",
"t",
"\n",
"}",
")",
"\n",
"go",
"s",
".",
"StartPoller",
"(",
"phinfo",
".",
"Data",
"[",
"0",
"]",
".",
"RequestID",
",",
"task",
")",
"\n",
"}",
"else",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}",
")",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
14,984 | all-14985 | [
"MAASController",
"the",
"configured",
"MAAS",
"url",
"and",
"key",
"if",
"any",
"."
] | [
"func",
"(",
"c",
"*",
"Config",
")",
"MAASController",
"(",
")",
"(",
"string",
",",
"string",
")",
"{",
"<mask>",
":=",
"c",
".",
"m",
".",
"GetString",
"(",
"\"",
"\"",
")",
"\n",
"key",
":=",
"c",
".",
"m",
".",
"GetString",
"(",
"\"",
"\"",
")",
"\n",
"return",
"url",
",",
"key",
"\n",
"}"
] |
14,985 | all-14986 | [
"Create",
"a",
"new",
"emitter",
"object",
"."
] | [
"func",
"yaml_emitter_initialize",
"(",
"emitter",
"*",
"yaml_emitter_t",
")",
"{",
"*",
"emitter",
"=",
"yaml_emitter_t",
"{",
"buffer",
":",
"make",
"(",
"[",
"]",
"byte",
",",
"output_buffer_size",
")",
",",
"raw_buffer",
":",
"make",
"(",
"[",
"]",
"byte",
",",
"0",
",",
"output_raw_buffer_size",
")",
",",
"states",
":",
"make",
"(",
"[",
"]",
"yaml_emitter_state_t",
",",
"0",
",",
"initial_stack_size",
")",
",",
"<mask>",
":",
"make",
"(",
"[",
"]",
"yaml_event_t",
",",
"0",
",",
"initial_queue_size",
")",
",",
"}",
"\n",
"}"
] |
14,986 | all-14987 | [
"GetDefaultTopMargin",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_paper_size_get_default_top_margin",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PaperSize",
")",
"GetDefaultTopMargin",
"(",
"<mask>",
"Unit",
")",
"float64",
"{",
"c",
":=",
"C",
".",
"gtk_paper_size_get_default_top_margin",
"(",
"ps",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkUnit",
"(",
"unit",
")",
")",
"\n",
"return",
"float64",
"(",
"c",
")",
"\n",
"}"
] |
14,987 | all-14988 | [
"HasValue",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"p",
"*",
"Period",
")",
"HasValue",
"(",
")",
"bool",
"{",
"if",
"p",
"!=",
"nil",
"&&",
"p",
".",
"<mask>",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
14,988 | all-14989 | [
"LoadWithEnvTOMLBytes",
"loads",
"TOML",
"bytes",
"with",
"Env"
] | [
"func",
"LoadWithEnvTOMLBytes",
"(",
"conf",
"<mask>",
"{",
"}",
",",
"src",
"[",
"]",
"byte",
")",
"error",
"{",
"return",
"loadConfigBytes",
"(",
"conf",
",",
"src",
",",
"envReplacer",
",",
"toml",
".",
"Unmarshal",
")",
"\n",
"}"
] |
14,989 | all-14990 | [
"NewMonitor",
"creates",
"new",
"blockchain",
"monitor",
"."
] | [
"func",
"NewMonitor",
"(",
"conf",
"*",
"Config",
",",
"c",
"Client",
",",
"db",
"*",
"reform",
".",
"DB",
",",
"l",
"log",
".",
"Logger",
",",
"psc",
",",
"ptc",
"common",
".",
"Address",
",",
"role",
"string",
",",
"q",
"Queue",
")",
"(",
"*",
"Monitor",
",",
"error",
")",
"{",
"abiJSON",
":=",
"contract",
".",
"PrivatixServiceContractABI",
"\n",
"pscABI",
",",
"err",
":=",
"abi",
".",
"JSON",
"(",
"strings",
".",
"NewReader",
"(",
"abiJSON",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"l",
".",
"<mask>",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"return",
"nil",
",",
"ErrFailedToParseABI",
"\n",
"}",
"\n",
"abiJSON2",
":=",
"contract",
".",
"PrivatixTokenContractABI",
"\n",
"ptcABI",
",",
"err",
":=",
"abi",
".",
"JSON",
"(",
"strings",
".",
"NewReader",
"(",
"abiJSON2",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"l",
".",
"Error",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"return",
"nil",
",",
"ErrFailedToParseABI",
"\n",
"}",
"\n",
"ethCallTimeout",
":=",
"time",
".",
"Duration",
"(",
"conf",
".",
"EthCallTimeout",
")",
"*",
"time",
".",
"Millisecond",
"\n",
"queryPause",
":=",
"time",
".",
"Duration",
"(",
"conf",
".",
"QueryPause",
")",
"*",
"time",
".",
"Millisecond",
"\n",
"m",
":=",
"&",
"Monitor",
"{",
"db",
":",
"db",
",",
"eth",
":",
"c",
",",
"logger",
":",
"l",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
",",
"queue",
":",
"q",
",",
"ethCallTimeout",
":",
"ethCallTimeout",
",",
"pscABI",
":",
"pscABI",
",",
"ptcABI",
":",
"ptcABI",
",",
"pscAddr",
":",
"psc",
",",
"queryPause",
":",
"queryPause",
",",
"}",
"\n\n",
"m",
".",
"initLastProcessedBlock",
"(",
"role",
",",
"conf",
".",
"InitialBlocks",
")",
"\n\n",
"f",
":=",
"m",
".",
"clientQueries",
"\n",
"m",
".",
"jobsProducers",
"=",
"m",
".",
"clientJobsProducers",
"(",
")",
"\n",
"if",
"role",
"==",
"data",
".",
"RoleAgent",
"{",
"f",
"=",
"m",
".",
"agentQueries",
"\n",
"m",
".",
"jobsProducers",
"=",
"m",
".",
"agentJobsProducers",
"(",
")",
"\n",
"}",
"\n",
"m",
".",
"getFilterLogQueries",
"=",
"func",
"(",
"from",
",",
"to",
"uint64",
")",
"(",
"[",
"]",
"ethereum",
".",
"FilterQuery",
",",
"error",
")",
"{",
"return",
"f",
"(",
"from",
",",
"to",
",",
"psc",
",",
"ptc",
")",
"\n",
"}",
"\n\n",
"return",
"m",
",",
"nil",
"\n",
"}"
] |
14,990 | all-14991 | [
"get",
"returns",
"the",
"found",
"value",
"if",
"any",
".",
"If",
"not",
"found",
"we",
"return",
"nil",
"."
] | [
"func",
"(",
"s",
"*",
"levelsController",
")",
"get",
"(",
"key",
"[",
"]",
"byte",
",",
"maxVs",
"*",
"y",
".",
"ValueStruct",
")",
"(",
"y",
".",
"ValueStruct",
",",
"error",
")",
"{",
"// It's important that we iterate the levels from 0 on upward. The reason is, if we iterated",
"// in opposite order, or in parallel (naively calling all the h.RLock() in some order) we could",
"// read level L's tables post-compaction and level L+1's tables pre-compaction. (If we do",
"// parallelize this, we will need to call the h.RLock() function by increasing order of level",
"// number.)",
"version",
":=",
"y",
".",
"ParseTs",
"(",
"key",
")",
"\n",
"for",
"_",
",",
"h",
":=",
"range",
"s",
".",
"levels",
"{",
"vs",
",",
"err",
":=",
"h",
".",
"get",
"(",
"key",
")",
"// Calls h.RLock() and h.RUnlock().",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"y",
".",
"ValueStruct",
"{",
"}",
",",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
",",
"key",
")",
"\n",
"}",
"\n",
"if",
"vs",
".",
"Value",
"==",
"nil",
"&&",
"vs",
".",
"Meta",
"==",
"0",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"maxVs",
"==",
"nil",
"||",
"vs",
".",
"Version",
"==",
"version",
"{",
"return",
"vs",
",",
"nil",
"\n",
"}",
"\n",
"if",
"maxVs",
".",
"Version",
"<",
"<mask>",
".",
"Version",
"{",
"*",
"maxVs",
"=",
"vs",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"maxVs",
"!=",
"nil",
"{",
"return",
"*",
"maxVs",
",",
"nil",
"\n",
"}",
"\n",
"return",
"y",
".",
"ValueStruct",
"{",
"}",
",",
"nil",
"\n",
"}"
] |
14,991 | all-14992 | [
"SetVisible",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_tree_view_column_set_visible",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TreeViewColumn",
")",
"SetVisible",
"(",
"visible",
"bool",
")",
"{",
"C",
".",
"gtk_tree_view_column_set_visible",
"(",
"v",
".",
"native",
"(",
")",
",",
"gbool",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
14,992 | all-14993 | [
"copy",
"all",
"or",
"part",
"of",
"the",
"data",
"store",
"of",
"a",
"buffer",
"object",
"to",
"the",
"data",
"store",
"of",
"another",
"buffer",
"object"
] | [
"func",
"CopyBufferSubData",
"(",
"readTarget",
"uint32",
",",
"writeTarget",
"uint32",
",",
"readOffset",
"int",
",",
"writeOffset",
"int",
",",
"<mask>",
"int",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpCopyBufferSubData",
",",
"5",
",",
"uintptr",
"(",
"readTarget",
")",
",",
"uintptr",
"(",
"writeTarget",
")",
",",
"uintptr",
"(",
"readOffset",
")",
",",
"uintptr",
"(",
"writeOffset",
")",
",",
"uintptr",
"(",
"size",
")",
",",
"0",
")",
"\n",
"}"
] |
14,993 | all-14994 | [
"OptClientTLSConfig",
"contains",
"the",
"TLS",
"configuration",
"."
] | [
"func",
"OptClientTLSConfig",
"(",
"config",
"*",
"tls",
".",
"Config",
")",
"ClientOption",
"{",
"return",
"func",
"(",
"options",
"*",
"ClientOptions",
")",
"error",
"{",
"<mask>",
".",
"TLSConfig",
"=",
"config",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] |
14,994 | all-14995 | [
"InlineEdit",
"using",
"to",
"make",
"inline",
"edit",
"resource",
"shown",
"as",
"slideout"
] | [
"func",
"(",
"controller",
")",
"InlineEdit",
"(",
"context",
"*",
"admin",
".",
"<mask>",
")",
"{",
"context",
".",
"Writer",
".",
"Write",
"(",
"[",
"]",
"byte",
"(",
"context",
".",
"Render",
"(",
"\"",
"\"",
")",
")",
")",
"\n",
"}"
] |
14,995 | all-14996 | [
"/",
"*",
"Returns",
"a",
"structuring",
"element",
"of",
"the",
"specified",
"size",
"and",
"shape",
"for",
"morphological",
"operations",
"."
] | [
"func",
"CreateStructuringElement",
"(",
"cols",
",",
"rows",
",",
"anchor_x",
",",
"anchor_y",
",",
"shape",
"int",
")",
"*",
"IplConvKernel",
"{",
"return",
"(",
"*",
"IplConvKernel",
")",
"(",
"C",
".",
"cvCreateStructuringElementEx",
"(",
"C",
".",
"int",
"(",
"cols",
")",
",",
"C",
".",
"int",
"(",
"rows",
")",
",",
"C",
".",
"int",
"(",
"anchor_x",
")",
",",
"C",
".",
"int",
"(",
"anchor_y",
")",
",",
"C",
".",
"int",
"(",
"<mask>",
")",
",",
"nil",
",",
"// TODO: currently we don't support a fully custom kernel",
")",
")",
"\n",
"}"
] |
14,996 | all-14997 | [
"updateResourceDesiredStatusUnsafe",
"sets",
"all",
"resources",
"desired",
"status",
"depending",
"on",
"the",
"task",
"s",
"desired",
"status",
"TODO",
":",
"Create",
"a",
"mapping",
"of",
"resource",
"status",
"to",
"the",
"corresponding",
"task",
"status",
"and",
"use",
"it",
"here"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"updateResourceDesiredStatusUnsafe",
"(",
"taskDesiredStatus",
"apitaskstatus",
".",
"TaskStatus",
")",
"{",
"<mask>",
":=",
"task",
".",
"getResourcesUnsafe",
"(",
")",
"\n",
"for",
"_",
",",
"r",
":=",
"range",
"resources",
"{",
"if",
"taskDesiredStatus",
"==",
"apitaskstatus",
".",
"TaskRunning",
"{",
"if",
"r",
".",
"GetDesiredStatus",
"(",
")",
"<",
"r",
".",
"SteadyState",
"(",
")",
"{",
"r",
".",
"SetDesiredStatus",
"(",
"r",
".",
"SteadyState",
"(",
")",
")",
"\n",
"}",
"\n",
"}",
"else",
"{",
"if",
"r",
".",
"GetDesiredStatus",
"(",
")",
"<",
"r",
".",
"TerminalStatus",
"(",
")",
"{",
"r",
".",
"SetDesiredStatus",
"(",
"r",
".",
"TerminalStatus",
"(",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
14,997 | all-14998 | [
"ProfileCreate",
"adds",
"a",
"new",
"profile",
"to",
"the",
"database",
"."
] | [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"ProfileCreate",
"(",
"object",
"Profile",
")",
"(",
"int64",
",",
"error",
")",
"{",
"// Check if a profile with the same key exists.",
"exists",
",",
"err",
":=",
"c",
".",
"ProfileExists",
"(",
"object",
".",
"Project",
",",
"object",
".",
"Name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"exists",
"{",
"return",
"-",
"1",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"args",
":=",
"make",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"3",
")",
"\n\n",
"// Populate the statement arguments.",
"args",
"[",
"0",
"]",
"=",
"object",
".",
"Project",
"\n",
"args",
"[",
"1",
"]",
"=",
"object",
".",
"Name",
"\n",
"args",
"[",
"2",
"]",
"=",
"object",
".",
"Description",
"\n\n",
"// Prepared statement to use.",
"stmt",
":=",
"c",
".",
"stmt",
"(",
"profileCreate",
")",
"\n\n",
"// Execute the statement.",
"result",
",",
"err",
":=",
"stmt",
".",
"Exec",
"(",
"args",
"...",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"id",
",",
"err",
":=",
"result",
".",
"LastInsertId",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// Insert config reference.",
"stmt",
"=",
"c",
".",
"stmt",
"(",
"profileCreateConfigRef",
")",
"\n",
"for",
"key",
",",
"value",
":=",
"range",
"object",
".",
"Config",
"{",
"_",
",",
"err",
":=",
"stmt",
".",
"Exec",
"(",
"id",
",",
"key",
",",
"value",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Insert devices reference.",
"for",
"name",
",",
"config",
":=",
"range",
"object",
".",
"Devices",
"{",
"typ",
",",
"ok",
":=",
"config",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"!",
"ok",
"{",
"return",
"-",
"1",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"name",
")",
"\n",
"}",
"\n",
"typCode",
",",
"err",
":=",
"dbDeviceTypeToInt",
"(",
"typ",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
",",
"typ",
")",
"\n",
"}",
"\n",
"stmt",
"=",
"c",
".",
"stmt",
"(",
"profileCreateDevicesRef",
")",
"\n",
"result",
",",
"err",
":=",
"stmt",
".",
"Exec",
"(",
"id",
",",
"<mask>",
",",
"typCode",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
",",
"name",
")",
"\n",
"}",
"\n",
"deviceID",
",",
"err",
":=",
"result",
".",
"LastInsertId",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"stmt",
"=",
"c",
".",
"stmt",
"(",
"profileCreateDevicesConfigRef",
")",
"\n",
"for",
"key",
",",
"value",
":=",
"range",
"config",
"{",
"_",
",",
"err",
":=",
"stmt",
".",
"Exec",
"(",
"deviceID",
",",
"key",
",",
"value",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"-",
"1",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"id",
",",
"nil",
"\n",
"}"
] |
14,998 | all-14999 | [
"validateComponentConfig",
"validates",
"the",
"infrastructure",
"component",
"configuration"
] | [
"func",
"(",
"c",
"*",
"Config",
")",
"validateComponentConfig",
"(",
")",
"error",
"{",
"if",
"c",
".",
"Plank",
".",
"JobURLPrefix",
"!=",
"\"",
"\"",
"&&",
"c",
".",
"Plank",
".",
"JobURLPrefixConfig",
"[",
"\"",
"\"",
"]",
"!=",
"\"",
"\"",
"{",
"return",
"<mask>",
".",
"New",
"(",
"`Planks job_url_prefix must be unset when job_url_prefix_config[\"*\"] is set. The former is deprecated, use the latter`",
")",
"\n",
"}",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"c",
".",
"Plank",
".",
"JobURLPrefixConfig",
"{",
"if",
"_",
",",
"err",
":=",
"url",
".",
"Parse",
"(",
"v",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"`Invalid value for Planks job_url_prefix_config[\"%s\"]: %v`",
",",
"k",
",",
"err",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"SlackReporter",
"!=",
"nil",
"{",
"if",
"err",
":=",
"c",
".",
"SlackReporter",
".",
"DefaultAndValidate",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
14,999 | all-15000 | [
"Prow",
"retrieves",
"the",
"ProwV1Client"
] | [
"func",
"(",
"c",
"*",
"Clientset",
")",
"Prow",
"(",
")",
"prowv1",
".",
"ProwV1Interface",
"{",
"<mask>",
"&",
"fakeprowv1",
".",
"FakeProwV1",
"{",
"Fake",
":",
"&",
"c",
".",
"Fake",
"}",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.