id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
20,300 | all-20301 | [
"Star",
"draws",
"many",
"lines",
"from",
"a",
"center",
"."
] | [
"func",
"Star",
"(",
"gc",
"draw2d",
".",
"GraphicContext",
",",
"x",
",",
"y",
",",
"width",
",",
"height",
"float64",
")",
"{",
"gc",
".",
"Save",
"(",
")",
"\n",
"gc",
".",
"Translate",
"(",
"x",
"+",
"width",
"/",
"2",
",",
"y",
"+",
"heigh... |
20,301 | all-20302 | [
"getLastIndex",
"returns",
"the",
"last",
"index",
"in",
"stable",
"storage",
".",
"Either",
"from",
"the",
"last",
"log",
"or",
"from",
"the",
"last",
"snapshot",
"."
] | [
"func",
"(",
"r",
"*",
"raftState",
")",
"getLastIndex",
"(",
")",
"uint64",
"{",
"r",
".",
"lastLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r",
".",
"lastLock",
".",
"Unlock",
"(",
")",
"\n",
"return",
"<mask>",
"(",
"r",
".",
"lastLogIndex",
",... |
20,302 | all-20303 | [
"WithoutHeaders",
"hides",
"any",
"TChannel",
"headers",
"from",
"the",
"given",
"context",
"."
] | [
"func",
"WithoutHeaders",
"(",
"ctx",
"context",
".",
"Context",
")",
"context",
".",
"Context",
"{",
"return",
"<mask>",
".",
"WithValue",
"(",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"contextKeyTChannel",
",",
"nil",
")",
",",
"contextKeyHeaders",
",... |
20,303 | all-20304 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"NavigationEntry",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage24",
"(",
"&",
"w",
",",
"v",
")",
"... |
20,304 | all-20305 | [
"next",
"advances",
"the",
"generators",
"internal",
"state",
"to",
"the",
"next",
"value",
"and",
"returns",
"this",
"value",
"as",
"an",
"uint64",
"."
] | [
"func",
"(",
"s",
"*",
"Xor64Source",
")",
"<mask>",
"(",
")",
"uint64",
"{",
"x",
":=",
"xor64",
"(",
"uint64",
"(",
"*",
"s",
")",
")",
"\n",
"*",
"s",
"=",
"Xor64Source",
"(",
"x",
")",
"\n",
"return",
"x",
"\n",
"}"
] |
20,305 | all-20306 | [
"getOneSignature",
"downloads",
"one",
"signature",
"from",
"url",
".",
"If",
"it",
"successfully",
"determines",
"that",
"the",
"signature",
"does",
"not",
"exist",
"returns",
"with",
"missing",
"set",
"to",
"true",
"and",
"error",
"set",
"to",
"nil",
".",
... | [
"func",
"(",
"s",
"*",
"dockerImageSource",
")",
"getOneSignature",
"(",
"ctx",
"context",
".",
"Context",
",",
"url",
"*",
"url",
".",
"URL",
")",
"(",
"signature",
"[",
"]",
"byte",
",",
"missing",
"bool",
",",
"err",
"error",
")",
"{",
"switch",
"... |
20,306 | all-20307 | [
"GetFileSize",
"-",
"gets",
"the",
"filesize",
"of",
"a",
"given",
"path"
] | [
"func",
"GetFileSize",
"(",
"<mask>",
"string",
")",
"(",
"fileSize",
"int64",
")",
"{",
"var",
"(",
"fileInfo",
"os",
".",
"FileInfo",
"\n",
"err",
"error",
"\n",
"file",
"*",
"os",
".",
"File",
"\n",
")",
"\n\n",
"if",
"file",
",",
"err",
"=",
"o... |
20,307 | all-20308 | [
"GetStartOk",
"returns",
"a",
"tuple",
"with",
"the",
"Start",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"d",
"*",
"Downtime",
")",
"GetStartOk",
"(",
")",
"(",
"int",
",",
"bool",
")",
"{",
"if",
"d",
"==",
"nil",
"||",
"d",
".",
"Start",
"==",
"nil",
"{",
"return",
"0",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"d",
".",
"Star... |
20,308 | all-20309 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"CreateIsolatedWorldParams",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage73",
"(",
"... |
20,309 | all-20310 | [
"authenticate",
"in",
"OpenStack",
"and",
"obtain",
"Designate",
"service",
"endpoint"
] | [
"func",
"createDesignateServiceClient",
"(",
")",
"(",
"*",
"gophercloud",
".",
"ServiceClient",
",",
"error",
")",
"{",
"opts",
",",
"err",
":=",
"getAuthSettings",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
... |
20,310 | all-20311 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"WebSocketFrame",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork2",
"(",
"&",
"r",
... |
20,311 | all-20312 | [
"String",
"representation",
"."
] | [
"func",
"(",
"na",
"*",
"NetAddress",
")",
"<mask>",
"(",
")",
"string",
"{",
"if",
"na",
".",
"str",
"==",
"\"",
"\"",
"{",
"na",
".",
"str",
"=",
"net",
".",
"JoinHostPort",
"(",
"na",
".",
"IP",
".",
"String",
"(",
")",
",",
"strconv",
".",
... |
20,312 | all-20313 | [
"AddRequestHandler",
"adds",
"a",
"request",
"handler",
"to",
"this",
"client",
".",
"A",
"request",
"handler",
"*",
"must",
"*",
"be",
"a",
"function",
"taking",
"a",
"single",
"argument",
"and",
"that",
"argument",
"*",
"must",
"*",
"be",
"a",
"pointer",... | [
"func",
"(",
"cs",
"*",
"ClientServerImpl",
")",
"AddRequestHandler",
"(",
"f",
"RequestHandler",
")",
"{",
"firstArg",
":=",
"reflect",
".",
"TypeOf",
"(",
"f",
")",
".",
"In",
"(",
"0",
")",
"\n",
"firstArgTypeStr",
":=",
"firstArg",
".",
"Elem",
"(",
... |
20,313 | all-20314 | [
"NewFileSnapshotStore",
"creates",
"a",
"new",
"FileSnapshotStore",
"based",
"on",
"a",
"base",
"directory",
".",
"The",
"retain",
"parameter",
"controls",
"how",
"many",
"snapshots",
"are",
"retained",
".",
"Must",
"be",
"at",
"least",
"1",
"."
] | [
"func",
"NewFileSnapshotStore",
"(",
"base",
"string",
",",
"retain",
"int",
",",
"logOutput",
"io",
".",
"Writer",
")",
"(",
"*",
"FileSnapshotStore",
",",
"error",
")",
"{",
"if",
"logOutput",
"==",
"nil",
"{",
"logOutput",
"=",
"<mask>",
".",
"Stderr",
... |
20,314 | all-20315 | [
"This",
"method",
"is",
"DEPRICATED",
"and",
"subject",
"to",
"be",
"removed",
"in",
"next",
"version",
".",
"Use",
"Encrypt",
"(",
"..",
")",
"with",
"Zip",
"option",
"instead",
".",
"Compress",
"produces",
"encrypted",
"&",
"comressed",
"JWT",
"token",
"... | [
"func",
"Compress",
"(",
"payload",
"string",
",",
"alg",
"string",
",",
"enc",
"string",
",",
"zip",
"string",
",",
"<mask>",
"interface",
"{",
"}",
")",
"(",
"token",
"string",
",",
"err",
"error",
")",
"{",
"if",
"zipAlg",
",",
"ok",
":=",
"jwcCom... |
20,315 | all-20316 | [
"GetCustomBgColorOk",
"returns",
"a",
"tuple",
"with",
"the",
"CustomBgColor",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"d",
"*",
"DashboardConditionalFormat",
")",
"GetCustomBgColorOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"d",
"==",
"nil",
"||",
"d",
".",
"CustomBgColor",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
... |
20,316 | all-20317 | [
"EnableColor",
"enables",
"color",
"output"
] | [
"func",
"(",
"g",
"*",
"Glg",
")",
"EnableColor",
"(",
")",
"*",
"Glg",
"{",
"g",
".",
"logger",
".",
"Range",
"(",
"func",
"(",
"key",
",",
"val",
"interface",
"{",
"}",
")",
"bool",
"{",
"l",
":=",
"val",
".",
"(",
"*",
"logger",
")",
"\n",... |
20,317 | all-20318 | [
"CreateContainer",
"requests",
"that",
"LXD",
"creates",
"a",
"new",
"container"
] | [
"func",
"(",
"r",
"*",
"ProtocolLXD",
")",
"CreateContainer",
"(",
"container",
"api",
".",
"ContainersPost",
")",
"(",
"Operation",
",",
"error",
")",
"{",
"if",
"<mask>",
".",
"Source",
".",
"ContainerOnly",
"{",
"if",
"!",
"r",
".",
"HasExtension",
"(... |
20,318 | all-20319 | [
"WriteUint32",
"writes",
"an",
"uint32",
"."
] | [
"func",
"(",
"w",
"*",
"Writer",
")",
"WriteUint32",
"(",
"i",
"uint32",
")",
"{",
"if",
"w",
".",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"<mask>",
".",
"LittleEndian",
".",
"PutUint32",
"(",
"w",
".",
"b",
"[",
":",
"4",
"]",
",",... |
20,319 | all-20320 | [
"zfsIsEnabled",
"returns",
"whether",
"zfs",
"backend",
"is",
"supported",
"."
] | [
"func",
"zfsIsEnabled",
"(",
")",
"bool",
"{",
"out",
",",
"err",
":=",
"exec",
".",
"LookPath",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"||",
"len",
"(",
"out",
")",
"==",
"0",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
... |
20,320 | all-20321 | [
"FlushPeriod",
"sets",
"how",
"often",
"the",
"Client",
"s",
"buffer",
"is",
"flushed",
".",
"If",
"p",
"is",
"0",
"the",
"goroutine",
"that",
"periodically",
"flush",
"the",
"buffer",
"is",
"not",
"lauched",
"and",
"the",
"buffer",
"is",
"only",
"flushed"... | [
"func",
"FlushPeriod",
"(",
"p",
"<mask>",
".",
"Duration",
")",
"Option",
"{",
"return",
"Option",
"(",
"func",
"(",
"c",
"*",
"config",
")",
"{",
"c",
".",
"Conn",
".",
"FlushPeriod",
"=",
"p",
"\n",
"}",
")",
"\n",
"}"
] |
20,321 | all-20322 | [
"CreateResourceGroup",
"creates",
"a",
"Resource",
"Group",
"if",
"not",
"exists"
] | [
"func",
"(",
"a",
"AzureClient",
")",
"CreateResourceGroup",
"(",
"name",
",",
"location",
"string",
")",
"error",
"{",
"if",
"ok",
",",
"err",
":=",
"a",
".",
"resourceGroupExists",
"(",
"name",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n"... |
20,322 | all-20323 | [
"Stop",
"Mason"
] | [
"func",
"(",
"m",
"*",
"Mason",
")",
"Stop",
"(",
")",
"{",
"logrus",
".",
"Info",
"(",
"\"",
"\"",
")",
"\n",
"m",
".",
"cancel",
"(",
")",
"\n",
"m",
".",
"wg",
".",
"Wait",
"(",
")",
"\n",
"close",
"(",
"m",
".",
"pending",
")",
"\n",
... |
20,323 | all-20324 | [
"Failed",
"checks",
"if",
"the",
"task",
"has",
"failed"
] | [
"func",
"(",
"t",
"*",
"T",
")",
"Failed",
"(",
")",
"bool",
"{",
"t",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"t",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"t",
".",
"<mask>",
"\n",
"}"
] |
20,324 | all-20325 | [
"SetPath",
"sets",
"cookie",
"path",
"."
] | [
"func",
"(",
"c",
"*",
"Cookie",
")",
"SetPath",
"(",
"path",
"string",
")",
"{",
"c",
".",
"buf",
"=",
"append",
"(",
"c",
".",
"buf",
"[",
":",
"0",
"]",
",",
"path",
"...",
")",
"\n",
"c",
".",
"<mask>",
"=",
"normalizePath",
"(",
"c",
"."... |
20,325 | all-20326 | [
"ListenAndServe",
"starts",
"the",
"Neptulon",
"server",
".",
"This",
"function",
"blocks",
"until",
"server",
"is",
"closed",
"."
] | [
"func",
"(",
"s",
"*",
"Server",
")",
"ListenAndServe",
"(",
")",
"error",
"{",
"mux",
":=",
"http",
".",
"NewServeMux",
"(",
")",
"\n",
"mux",
".",
"Handle",
"(",
"\"",
"\"",
",",
"websocket",
".",
"Server",
"{",
"Config",
":",
"s",
".",
"wsConfig... |
20,326 | all-20327 | [
"Seek",
"is",
"implementation",
"of",
"ReadSeekCloser",
"s",
"Seek",
"."
] | [
"func",
"(",
"i",
"*",
"InfiniteLoop",
")",
"Seek",
"(",
"<mask>",
"int64",
",",
"whence",
"int",
")",
"(",
"int64",
",",
"error",
")",
"{",
"if",
"err",
":=",
"i",
".",
"ensurePos",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"... |
20,327 | all-20328 | [
"handleAddSubscription",
"adds",
"a",
"Subscription",
"for",
"a",
"particular",
"topic",
".",
"If",
"it",
"is",
"the",
"first",
"Subscription",
"for",
"the",
"topic",
"it",
"will",
"announce",
"that",
"this",
"node",
"subscribes",
"to",
"the",
"topic",
".",
... | [
"func",
"(",
"p",
"*",
"PubSub",
")",
"handleAddSubscription",
"(",
"req",
"*",
"addSubReq",
")",
"{",
"sub",
":=",
"req",
".",
"sub",
"\n",
"subs",
":=",
"p",
".",
"myTopics",
"[",
"sub",
".",
"topic",
"]",
"\n\n",
"// announce we want this topic",
"if"... |
20,328 | all-20329 | [
"NewSession",
"creates",
"a",
"new",
"Session",
"object"
] | [
"func",
"NewSession",
"(",
"ctx",
"context",
".",
"<mask>",
",",
"config",
"*",
"config",
".",
"Config",
",",
"deregisterInstanceEventStream",
"*",
"eventstream",
".",
"EventStream",
",",
"containerInstanceArn",
"string",
",",
"credentialsProvider",
"*",
"credential... |
20,329 | all-20330 | [
"DeepCopyInto",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"writing",
"into",
"out",
".",
"in",
"must",
"be",
"non",
"-",
"nil",
"."
] | [
"func",
"(",
"in",
"*",
"DNSEndpoint",
")",
"DeepCopyInto",
"(",
"out",
"*",
"DNSEndpoint",
")",
"{",
"*",
"out",
"=",
"*",
"in",
"\n",
"<mask>",
".",
"TypeMeta",
"=",
"in",
".",
"TypeMeta",
"\n",
"in",
".",
"ObjectMeta",
".",
"DeepCopyInto",
"(",
"&... |
20,330 | all-20331 | [
"Generic",
"function",
"for",
"snapshots",
"use",
"map",
"[",
"string",
"]",
"string",
"to",
"create",
"url",
".",
"Values",
"()",
"instead",
"of",
"pre",
"-",
"defined",
"params"
] | [
"func",
"(",
"<mask>",
"*",
"Client",
")",
"SnapshotGeneric",
"(",
"options",
"map",
"[",
"string",
"]",
"string",
",",
"start",
",",
"end",
"time",
".",
"Time",
")",
"(",
"string",
",",
"error",
")",
"{",
"v",
":=",
"url",
".",
"Values",
"{",
"}",... |
20,331 | all-20332 | [
"UpdateOffer",
"updates",
"an",
"existing",
"offer"
] | [
"func",
"UpdateOffer",
"(",
"rate",
"Rate",
",",
"amount",
"Amount",
",",
"offerID",
"OfferID",
")",
"(",
"result",
"ManageOfferBuilder",
")",
"{",
"return",
"ManageOffer",
"(",
"<mask>",
",",
"rate",
",",
"amount",
",",
"offerID",
")",
"\n",
"}"
] |
20,332 | all-20333 | [
"DelaySvcNotification",
"creates",
"a",
"new",
"DELAY_SVC_NOTIFICATION",
"Nagios",
"command",
".",
"Delays",
"the",
"next",
"notification",
"for",
"a",
"parciular",
"service",
"until",
"notification_time",
".",
"The",
"notification_time",
"argument",
"is",
"specified",
... | [
"func",
"DelaySvcNotification",
"(",
"host_name",
"string",
",",
"service_description",
"string",
",",
"notification_time",
"<mask>",
".",
"Time",
",",
")",
"*",
"livestatus",
".",
"Command",
"{",
"return",
"livestatus",
".",
"NewCommand",
"(",
"\"",
"\"",
",",
... |
20,333 | all-20334 | [
"checkError",
"is",
"called",
"before",
"waiting",
"on",
"the",
"mex",
"channels",
".",
"It",
"returns",
"any",
"existing",
"errors",
"(",
"timeout",
"cancellation",
"connection",
"errors",
")",
"."
] | [
"func",
"(",
"mex",
"*",
"messageExchange",
")",
"checkError",
"(",
")",
"error",
"{",
"if",
"err",
":=",
"mex",
".",
"ctx",
".",
"Err",
"(",
")",
";",
"<mask>",
"!=",
"nil",
"{",
"return",
"GetContextError",
"(",
"err",
")",
"\n",
"}",
"\n\n",
"re... |
20,334 | all-20335 | [
"GenerateReceiveAddress",
"generates",
"and",
"returns",
"a",
"new",
"bitcoin",
"receive",
"address"
] | [
"func",
"(",
"c",
"Client",
")",
"GenerateReceiveAddress",
"(",
"params",
"*",
"AddressParams",
")",
"(",
"string",
",",
"error",
")",
"{",
"holder",
":=",
"map",
"[",
"string",
"]",
"<mask>",
"{",
"}",
"{",
"}",
"\n",
"if",
"err",
":=",
"c",
".",
... |
20,335 | all-20336 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetPlaybackRateReturns",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation9",
"(",
... |
20,336 | all-20337 | [
"Errorf",
"is",
"a",
"sentinel",
"option",
"to",
"set",
"a",
"error",
"logger",
"."
] | [
"func",
"Errorf",
"(",
"f",
"func",
"(",
"string",
",",
"...",
"<mask>",
"{",
"}",
")",
")",
"Option",
"{",
"return",
"func",
"(",
"s",
"*",
"Sentinel",
")",
"error",
"{",
"s",
".",
"errf",
"=",
"f",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
... |
20,337 | all-20338 | [
"/",
"*",
"get",
"a",
"uid",
"or",
"gid",
"mapping",
"from",
"/",
"proc",
"/",
"self",
"/",
"{",
"g",
"u",
"}",
"id_map"
] | [
"func",
"getFromProc",
"(",
"fname",
"string",
")",
"(",
"[",
"]",
"[",
"]",
"int64",
",",
"error",
")",
"{",
"entries",
":=",
"[",
"]",
"[",
"]",
"int64",
"{",
"}",
"\n\n",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"fname",
")",
"\n",
"... |
20,338 | all-20339 | [
"Update",
"updates",
"the",
"uint32",
"in",
"the",
"buffer"
] | [
"func",
"(",
"<mask>",
"Uint32Ref",
")",
"Update",
"(",
"n",
"uint32",
")",
"{",
"if",
"ref",
"!=",
"nil",
"{",
"binary",
".",
"BigEndian",
".",
"PutUint32",
"(",
"ref",
",",
"n",
")",
"\n",
"}",
"\n",
"}"
] |
20,339 | all-20340 | [
"Sync",
"upgrades",
"a",
"given",
"HTTP",
"connection",
"into",
"a",
"velox",
"connection",
"and",
"synchronises",
"the",
"provided",
"struct",
"with",
"the",
"client",
".",
"velox",
"takes",
"responsibility",
"for",
"writing",
"the",
"response",
"in",
"the",
... | [
"func",
"Sync",
"(",
"gostruct",
"interface",
"{",
"}",
",",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"(",
"Conn",
",",
"error",
")",
"{",
"//access gostruct.State via interfaces:",
"gosyncable",
",",
"ok",
":=",
"gos... |
20,340 | all-20341 | [
"matchPrefix",
"reports",
"whether",
"any",
"selector",
"in",
"the",
"fieldTree",
"matches",
"the",
"start",
"of",
"path",
"p",
"."
] | [
"func",
"(",
"ft",
"fieldTree",
")",
"matchPrefix",
"(",
"p",
"cmp",
".",
"Path",
")",
"bool",
"{",
"for",
"_",
",",
"ps",
":=",
"range",
"p",
"{",
"switch",
"ps",
":=",
"ps",
".",
"(",
"type",
")",
"{",
"case",
"cmp",
".",
"StructField",
":",
... |
20,341 | all-20342 | [
"Now",
"indicates",
"an",
"expected",
"call",
"of",
"Now"
] | [
"func",
"(",
"mr",
"*",
"MockTimeMockRecorder",
")",
"Now",
"(",
")",
"*",
"gomock",
".",
"Call",
"{",
"<mask>",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
... |
20,342 | all-20343 | [
"Msg",
"sends",
"a",
"message",
"to",
"who",
"(",
"user",
"or",
"channel",
")"
] | [
"func",
"(",
"bot",
"*",
"Bot",
")",
"Msg",
"(",
"who",
",",
"text",
"string",
")",
"{",
"for",
"len",
"(",
"text",
")",
">",
"400",
"{",
"bot",
".",
"Send",
"(",
"\"",
"\"",
"+",
"who",
"+",
"\"",
"\"",
"+",
"<mask>",
"[",
":",
"400",
"]",... |
20,343 | all-20344 | [
"GetContainerSnapshotNames",
"returns",
"a",
"list",
"of",
"snapshot",
"names",
"for",
"the",
"container"
] | [
"func",
"(",
"r",
"*",
"ProtocolLXD",
")",
"GetContainerSnapshotNames",
"(",
"containerName",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"urls",
":=",
"[",
"]",
"string",
"{",
"}",
"\n\n",
"// Fetch the raw value",
"_",
",",
"err",
"... |
20,344 | all-20345 | [
"NewStreamEncoder",
"returns",
"a",
"new",
"stream",
"encoder",
"that",
"outputs",
"to",
"e",
".",
"The",
"function",
"panics",
"if",
"e",
"is",
"nil",
"."
] | [
"func",
"NewStreamEncoder",
"(",
"e",
"Emitter",
")",
"*",
"StreamEncoder",
"{",
"if",
"e",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"<mask>",
"&",
"StreamEncoder",
"{",
"Emitter",
":",
"e",
"}",
"\n",
"}"
] |
20,345 | all-20346 | [
"Creates",
"an",
"LRUCache",
"with",
"maximum",
"size",
"ttl",
"for",
"items",
"."
] | [
"func",
"NewLRUCache",
"(",
"size",
"int",
",",
"ttl",
"time",
".",
"Duration",
")",
"Cache",
"{",
"lru",
":=",
"&",
"lruCache",
"{",
"<mask>",
":",
"size",
",",
"ttl",
":",
"ttl",
",",
"cache",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"... |
20,346 | all-20347 | [
"GetIconTooltipText",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_entry_get_icon_tooltip_text",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"GetIconTooltipText",
"(",
"iconPos",
"EntryIconPosition",
")",
"(",
"string",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_entry_get_icon_tooltip_text",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkEnt... |
20,347 | all-20348 | [
"startEtcd",
"runs",
"StartEtcd",
"in",
"addition",
"to",
"hooks",
"needed",
"for",
"standalone",
"etcd",
"."
] | [
"func",
"startEtcd",
"(",
"cfg",
"*",
"embed",
".",
"Config",
")",
"(",
"<-",
"chan",
"struct",
"{",
"}",
",",
"<-",
"chan",
"error",
",",
"error",
")",
"{",
"e",
",",
"err",
":=",
"embed",
".",
"StartEtcd",
"(",
"cfg",
")",
"\n",
"if",
"err",
... |
20,348 | all-20349 | [
"LogoutAll",
"removes",
"all",
"established",
"authentication",
"credentials",
"for",
"the",
"session",
"."
] | [
"func",
"(",
"s",
"*",
"Session",
")",
"LogoutAll",
"(",
")",
"{",
"s",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"for",
"_",
",",
"cred",
":=",
"range",
"s",
".",
"creds",
"{",
"if",
"s",
".",
"masterSocket",
"!=",
"nil",
"{",
"s",
".",
"master... |
20,349 | all-20350 | [
"ContainerUpdate",
"updates",
"the",
"description",
"architecture",
"and",
"ephemeral",
"flag",
"of",
"the",
"container",
"with",
"the",
"given",
"ID",
"."
] | [
"func",
"ContainerUpdate",
"(",
"tx",
"*",
"sql",
".",
"Tx",
",",
"id",
"int",
",",
"description",
"string",
",",
"architecture",
"int",
",",
"ephemeral",
"bool",
",",
"expiryDate",
"time",
".",
"Time",
")",
"error",
"{",
"str",
":=",
"fmt",
".",
"Spri... |
20,350 | all-20351 | [
"Cookie",
"returns",
"cookie",
"representation",
".",
"The",
"returned",
"value",
"is",
"valid",
"until",
"the",
"next",
"call",
"to",
"Cookie",
"methods",
"."
] | [
"func",
"(",
"c",
"*",
"Cookie",
")",
"Cookie",
"(",
")",
"[",
"]",
"<mask>",
"{",
"c",
".",
"buf",
"=",
"c",
".",
"AppendBytes",
"(",
"c",
".",
"buf",
"[",
":",
"0",
"]",
")",
"\n",
"return",
"c",
".",
"buf",
"\n",
"}"
] |
20,351 | all-20352 | [
"FromFile",
"reads",
"the",
"configuration",
"file",
"at",
"the",
"given",
"path",
"and",
"returns",
"a",
"new",
"Config",
"struct",
"with",
"the",
"data",
"populated",
"."
] | [
"func",
"FromFile",
"(",
"path",
"string",
")",
"(",
"*",
"Config",
",",
"error",
")",
"{",
"c",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrap",
"(",... |
20,352 | all-20353 | [
"failRelayItem",
"tombs",
"the",
"relay",
"item",
"so",
"that",
"future",
"frames",
"for",
"this",
"call",
"are",
"not",
"forwarded",
".",
"We",
"keep",
"the",
"relay",
"item",
"tombed",
"rather",
"than",
"delete",
"it",
"to",
"ensure",
"that",
"future",
"... | [
"func",
"(",
"r",
"*",
"Relayer",
")",
"failRelayItem",
"(",
"items",
"*",
"relayItems",
",",
"id",
"uint32",
",",
"failure",
"string",
")",
"{",
"item",
",",
"ok",
":=",
"items",
".",
"Get",
"(",
"id",
")",
"\n",
"if",
"!",
"ok",
"{",
"items",
"... |
20,353 | all-20354 | [
"NewLogEntry",
"creates",
"a",
"new",
"LogEntry",
"for",
"the",
"request",
"."
] | [
"func",
"(",
"l",
"*",
"DefaultLogFormatter",
")",
"NewLogEntry",
"(",
"r",
"*",
"http",
".",
"Request",
")",
"LogEntry",
"{",
"useColor",
":=",
"!",
"l",
".",
"NoColor",
"\n",
"entry",
":=",
"&",
"defaultLogEntry",
"{",
"DefaultLogFormatter",
":",
"l",
... |
20,354 | all-20355 | [
"/",
"*",
"GetApps",
"gets",
"all",
"app",
"names"
] | [
"func",
"(",
"a",
"*",
"Client",
")",
"GetApps",
"(",
"params",
"*",
"GetAppsParams",
")",
"(",
"*",
"GetAppsOK",
",",
"error",
")",
"{",
"// TODO: Validate the params before sending",
"if",
"params",
"==",
"nil",
"{",
"params",
"=",
"NewGetAppsParams",
"(",
... |
20,355 | all-20356 | [
"If",
"the",
"connection",
"is",
"successful",
"it",
"will",
"end",
"up",
"in",
"the",
"local",
"peer",
"s",
"connections",
"map",
"."
] | [
"func",
"startLocalConnection",
"(",
"connRemote",
"*",
"remoteConnection",
",",
"tcpConn",
"*",
"net",
".",
"TCPConn",
",",
"router",
"*",
"Router",
",",
"acceptNewPeer",
"bool",
",",
"logger",
"Logger",
")",
"{",
"if",
"connRemote",
".",
"local",
"!=",
"ro... |
20,356 | all-20357 | [
"ValidEnum",
"validates",
"a",
"proposed",
"value",
"for",
"this",
"enum",
".",
"Implements",
"the",
"Enum",
"interface",
"for",
"CreateAccountResultCode"
] | [
"func",
"(",
"e",
"CreateAccountResultCode",
")",
"ValidEnum",
"(",
"v",
"int32",
")",
"bool",
"{",
"_",
",",
"<mask>",
":=",
"createAccountResultCodeMap",
"[",
"v",
"]",
"\n",
"return",
"ok",
"\n",
"}"
] |
20,357 | all-20358 | [
"NewJournalWriter",
"wraps",
"io",
".",
"Writer",
"to",
"redirect",
"log",
"output",
"to",
"the",
"local",
"systemd",
"journal",
".",
"If",
"journald",
"send",
"fails",
"it",
"fails",
"back",
"to",
"writing",
"to",
"the",
"original",
"writer",
".",
"The",
... | [
"func",
"NewJournalWriter",
"(",
"wr",
"<mask>",
".",
"Writer",
")",
"(",
"io",
".",
"Writer",
",",
"error",
")",
"{",
"return",
"&",
"journalWriter",
"{",
"Writer",
":",
"wr",
"}",
",",
"systemd",
".",
"DialJournal",
"(",
")",
"\n",
"}"
] |
20,358 | all-20359 | [
"GetFile",
"returns",
"the",
"contents",
"of",
"a",
"file",
"at",
"a",
"specific",
"Commit",
".",
"offset",
"specifies",
"a",
"number",
"of",
"bytes",
"that",
"should",
"be",
"skipped",
"in",
"the",
"beginning",
"of",
"the",
"file",
".",
"size",
"limits",
... | [
"func",
"(",
"c",
"APIClient",
")",
"GetFile",
"(",
"repoName",
"string",
",",
"commitID",
"string",
",",
"path",
"string",
",",
"offset",
"int64",
",",
"size",
"int64",
",",
"writer",
"io",
".",
"Writer",
")",
"error",
"{",
"if",
"c",
".",
"limiter",
... |
20,359 | all-20360 | [
"RetryAuthClient",
"implements",
"a",
"AuthClient",
"."
] | [
"func",
"RetryAuthClient",
"(",
"c",
"*",
"Client",
")",
"pb",
".",
"AuthClient",
"{",
"return",
"&",
"retryAuthClient",
"{",
"ac",
":",
"pb",
".",
"NewAuthClient",
"(",
"c",
".",
"<mask>",
")",
",",
"}",
"\n",
"}"
] |
20,360 | all-20361 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"ContinueToLocationParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger47",
"(",
"&",
"w",
",",
... |
20,361 | all-20362 | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"."
] | [
"func",
"(",
"pr",
"*",
"prSignedBy",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"*",
"pr",
"=",
"prSignedBy",
"{",
"}",
"\n",
"var",
"tmp",
"prSignedBy",
"\n",
"var",
"gotKeyPath",
",",
"gotKeyData",
"=",
"false",
",",
"... |
20,362 | all-20363 | [
"NewPatternRadial",
"is",
"a",
"wrapper",
"around",
"cairo_pattern_create_radial",
"()",
"."
] | [
"func",
"NewPatternRadial",
"(",
"x0",
",",
"y0",
",",
"r0",
",",
"x1",
",",
"y1",
",",
"r1",
"float64",
")",
"(",
"*",
"<mask>",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"cairo_pattern_create_radial",
"(",
"C",
".",
"double",
"(",
"x0",
")",
... |
20,363 | all-20364 | [
"Add",
"indicates",
"an",
"expected",
"call",
"of",
"Add"
] | [
"func",
"(",
"mr",
"*",
"MockCgroupMockRecorder",
")",
"Add",
"(",
"arg0",
"<mask>",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
"... |
20,364 | all-20365 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetResponseBodyForInterceptionParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork31",
"(",
"&",
"w",
... |
20,365 | all-20366 | [
"SendPayload",
"发送消息"
] | [
"func",
"(",
"w",
"*",
"Webhook",
")",
"SendPayload",
"(",
"payload",
"*",
"Payload",
")",
"error",
"{",
"bs",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"payload",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
... |
20,366 | all-20367 | [
"WaitStartup",
"blocks",
"current",
"thread",
"until",
"current",
"container",
"begins",
"to",
"listen",
"exposed",
"port",
"."
] | [
"func",
"(",
"s",
"*",
"Container",
")",
"WaitStartup",
"(",
"timeout",
"time",
".",
"Duration",
")",
"error",
"{",
"nodes",
",",
"err",
":=",
"s",
".",
"NetworkNodes",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
... |
20,367 | all-20368 | [
"Do",
"performs",
"the",
"given",
"http",
"request",
"and",
"sets",
"the",
"corresponding",
"response",
".",
"Request",
"must",
"contain",
"at",
"least",
"non",
"-",
"zero",
"RequestURI",
"with",
"full",
"url",
"(",
"including",
"scheme",
"and",
"host",
")",... | [
"func",
"(",
"c",
"*",
"PipelineClient",
")",
"Do",
"(",
"req",
"*",
"Request",
",",
"resp",
"*",
"<mask>",
")",
"error",
"{",
"return",
"c",
".",
"getConnClient",
"(",
")",
".",
"Do",
"(",
"req",
",",
"resp",
")",
"\n",
"}"
] |
20,368 | all-20369 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"FrameResource",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage47",
"(",
"&",
"r",
... |
20,369 | all-20370 | [
"HasResource",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"ScreenboardLite",
")",
"HasResource",
"(",
")",
"bool",
"{",
"if",
"s",
"!=",
"nil",
"&&",
"s",
".",
"Resource",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
20,370 | all-20371 | [
"PeerNameFromUserInput",
"parses",
"PeerName",
"from",
"a",
"user",
"-",
"provided",
"string",
"."
] | [
"func",
"PeerNameFromUserInput",
"(",
"userInput",
"string",
")",
"(",
"PeerName",
",",
"error",
")",
"{",
"// fixed-length identity",
"nameByteAry",
":=",
"sha256",
".",
"Sum256",
"(",
"[",
"]",
"<mask>",
"(",
"userInput",
")",
")",
"\n",
"return",
"PeerNameF... |
20,371 | all-20372 | [
"GetStatsdIntervalOk",
"returns",
"a",
"tuple",
"with",
"the",
"StatsdInterval",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"m",
"*",
"MetricMetadata",
")",
"GetStatsdIntervalOk",
"(",
")",
"(",
"int",
",",
"bool",
")",
"{",
"if",
"m",
"==",
"nil",
"||",
"m",
".",
"StatsdInterval",
"==",
"nil",
"{",
"return",
"0",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"... |
20,372 | all-20373 | [
"return",
"a",
"compressed",
"texture",
"image"
] | [
"func",
"GetCompressedTexImage",
"(",
"target",
"uint32",
",",
"<mask>",
"int32",
",",
"img",
"unsafe",
".",
"Pointer",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpGetCompressedTexImage",
",",
"3",
",",
"uintptr",
"(",
"target",
")",
",",
"uintptr",
"(",
... |
20,373 | all-20374 | [
"PutFileHeaderFooter",
"implements",
"the",
"HashTree",
"PutFileHeaderFooter",
"method"
] | [
"func",
"(",
"h",
"*",
"dbHashTree",
")",
"PutFileHeaderFooter",
"(",
"path",
"string",
",",
"objects",
"[",
"]",
"*",
"pfs",
".",
"Object",
",",
"<mask>",
"int64",
")",
"error",
"{",
"return",
"h",
".",
"putFile",
"(",
"path",
",",
"objects",
",",
"... |
20,374 | all-20375 | [
"bind",
"a",
"framebuffer",
"to",
"a",
"framebuffer",
"target"
] | [
"func",
"BindFramebuffer",
"(",
"target",
"uint32",
",",
"framebuffer",
"uint32",
")",
"{",
"C",
".",
"glowBindFramebuffer",
"(",
"gpBindFramebuffer",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"<mask>",
")",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"framebu... |
20,375 | all-20376 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"CaptureSnapshotFormat",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"CaptureSnapshotFormat",
"(",
"in",
".",
"String",
"(",
")",
")",
"{",
"<mask>",
"CaptureSnapshotFormatMhtml",
":",
"*",
"t"... |
20,376 | all-20377 | [
"Call",
"the",
"parent",
"CloseNotify",
".",
"Provided",
"in",
"order",
"to",
"implement",
"the",
"http",
".",
"CloseNotifier",
"interface",
"."
] | [
"func",
"(",
"w",
"*",
"recorderResponseWriter",
")",
"CloseNotify",
"(",
")",
"<-",
"chan",
"bool",
"{",
"notifier",
":=",
"w",
".",
"ResponseWriter",
".",
"(",
"<mask>",
".",
"CloseNotifier",
")",
"\n",
"return",
"notifier",
".",
"CloseNotify",
"(",
")",... |
20,377 | all-20378 | [
"Records",
"returns",
"the",
"current",
"records",
"from",
"the",
"registry",
"excluding",
"TXT",
"Records",
"If",
"TXT",
"records",
"was",
"created",
"previously",
"to",
"indicate",
"ownership",
"its",
"corresponding",
"value",
"will",
"be",
"added",
"to",
"the... | [
"func",
"(",
"im",
"*",
"TXTRegistry",
")",
"Records",
"(",
")",
"(",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
",",
"error",
")",
"{",
"// If we have the zones cached AND we have refreshed the cache since the",
"// last given interval, then just use the cached results.",... |
20,378 | all-20379 | [
"ChangeSvcCheckCommand",
"creates",
"a",
"new",
"CHANGE_SVC_CHECK_COMMAND",
"Nagios",
"command",
".",
"Changes",
"the",
"check",
"command",
"for",
"a",
"particular",
"service",
"to",
"be",
"that",
"specified",
"by",
"the",
"check_command",
"option",
".",
"The",
"c... | [
"func",
"ChangeSvcCheckCommand",
"(",
"host_name",
"<mask>",
",",
"service_description",
"string",
",",
"check_command",
"string",
",",
")",
"*",
"livestatus",
".",
"Command",
"{",
"return",
"livestatus",
".",
"NewCommand",
"(",
"\"",
"\"",
",",
"stringifyArg",
... |
20,379 | all-20380 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"HAR",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoHar9",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"retu... |
20,380 | all-20381 | [
"GetInstanceMetrics",
"gets",
"all",
"task",
"metrics",
"and",
"instance",
"metadata",
"from",
"stats",
"engine",
"."
] | [
"func",
"(",
"engine",
"*",
"DockerStatsEngine",
")",
"GetInstanceMetrics",
"(",
")",
"(",
"*",
"ecstcs",
".",
"MetricsMetadata",
",",
"[",
"]",
"*",
"ecstcs",
".",
"TaskMetric",
",",
"error",
")",
"{",
"var",
"taskMetrics",
"[",
"]",
"*",
"ecstcs",
".",... |
20,381 | all-20382 | [
"remove",
"removes",
"img",
"from",
"the",
"images",
"."
] | [
"func",
"(",
"i",
"*",
"<mask>",
")",
"remove",
"(",
"img",
"*",
"Image",
")",
"{",
"i",
".",
"makeStaleIfDependingOnImpl",
"(",
"img",
")",
"\n",
"delete",
"(",
"i",
".",
"images",
",",
"img",
")",
"\n",
"}"
] |
20,382 | all-20383 | [
"Brace",
"matches",
"path",
"with",
"REST",
"-",
"full",
"resources",
"URI",
"in",
"brace",
"form",
".",
"e",
".",
"g",
".",
"/",
"foo",
"/",
"v1",
"/",
"bar",
"/",
"v2",
"will",
"map",
"to",
"/",
"{",
"foo",
"}",
"/",
"{",
"bar",
"}",
"form",
... | [
"func",
"Brace",
"(",
"<mask>",
"string",
")",
"*",
"brace",
"{",
"matches",
":=",
"strings",
".",
"Split",
"(",
"path",
",",
"\"",
"\"",
")",
"\n",
"return",
"&",
"brace",
"{",
"matches",
":",
"matches",
",",
"}",
"\n",
"}"
] |
20,383 | all-20384 | [
"Keys",
"returns",
"a",
"sorted",
"list",
"of",
"the",
"keys",
"in",
"the",
"dictionary",
"v",
".",
"If",
"v",
"is",
"a",
"stream",
"Keys",
"applies",
"to",
"the",
"stream",
"s",
"header",
"dictionary",
".",
"If",
"v",
".",
"Kind",
"()",
"!",
"=",
... | [
"func",
"(",
"v",
"<mask>",
")",
"Keys",
"(",
")",
"[",
"]",
"string",
"{",
"x",
",",
"ok",
":=",
"v",
".",
"data",
".",
"(",
"dict",
")",
"\n",
"if",
"!",
"ok",
"{",
"strm",
",",
"ok",
":=",
"v",
".",
"data",
".",
"(",
"stream",
")",
"\n... |
20,384 | all-20385 | [
"String",
"renderer",
"that",
"will",
"run",
"the",
"string",
"through",
"the",
"github",
".",
"com",
"/",
"gobuffalo",
"/",
"plush",
"package",
"and",
"return",
"text",
"/",
"plain",
"as",
"the",
"content",
"type",
"."
] | [
"func",
"String",
"(",
"s",
"string",
",",
"args",
"...",
"<mask>",
"{",
"}",
")",
"Renderer",
"{",
"e",
":=",
"New",
"(",
"Options",
"{",
"}",
")",
"\n",
"return",
"e",
".",
"String",
"(",
"s",
",",
"args",
"...",
")",
"\n",
"}"
] |
20,385 | all-20386 | [
"Encode",
"returns",
"a",
"packed",
"slice",
"of",
"the",
"values",
"from",
"src",
".",
"If",
"a",
"value",
"is",
"over",
"1",
"<<",
"60",
"an",
"error",
"is",
"returned",
".",
"The",
"input",
"src",
"is",
"modified",
"to",
"avoid",
"extra",
"allocatio... | [
"func",
"EncodeAll",
"(",
"src",
"[",
"]",
"uint64",
")",
"(",
"[",
"]",
"uint64",
",",
"error",
")",
"{",
"i",
":=",
"0",
"\n\n",
"// Re-use the input slice and write encoded values back in place",
"dst",
":=",
"src",
"\n",
"j",
":=",
"0",
"\n\n",
"for",
... |
20,386 | all-20387 | [
"/",
"*",
"Allocates",
"and",
"initializes",
"CvMatND",
"header",
"and",
"allocates",
"data"
] | [
"func",
"CreateMatND",
"(",
"sizes",
"[",
"]",
"int",
",",
"type_",
"int",
")",
"*",
"MatND",
"{",
"dims",
":=",
"C",
".",
"int",
"(",
"len",
"(",
"sizes",
")",
")",
"\n",
"sizes_c",
":=",
"<mask>",
"(",
"[",
"]",
"C",
".",
"int",
",",
"len",
... |
20,387 | all-20388 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetNodeNameParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom5",
"(",
"&",
"w",
",",
"v",
")",
"... |
20,388 | all-20389 | [
"GetAuthURIOk",
"returns",
"a",
"tuple",
"with",
"the",
"AuthURI",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"i",
"*",
"IntegrationGCPCreateRequest",
")",
"GetAuthURIOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"i",
"==",
"nil",
"||",
"i",
".",
"AuthURI",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"<mask>",
"\n",
"}",
"\n",
"r... |
20,389 | all-20390 | [
"Pins",
"returns",
"a",
"map",
"of",
"the",
"pin",
"hashes",
"to",
"their",
"info",
"(",
"currently",
"just",
"the",
"pin",
"type",
"one",
"of",
"DirectPin",
"RecursivePin",
"or",
"IndirectPin",
".",
"A",
"map",
"is",
"returned",
"instead",
"of",
"a",
"s... | [
"func",
"(",
"s",
"*",
"Shell",
")",
"Pins",
"(",
")",
"(",
"map",
"[",
"string",
"]",
"PinInfo",
",",
"error",
")",
"{",
"var",
"raw",
"struct",
"{",
"Keys",
"map",
"[",
"string",
"]",
"PinInfo",
"}",
"\n",
"return",
"<mask>",
".",
"Keys",
",",
... |
20,390 | all-20391 | [
"ChangeStaticPath",
"changes",
"static",
"path",
"from",
"old",
"to",
"new",
"one",
"."
] | [
"func",
"(",
"ctx",
"*",
"Context",
")",
"ChangeStaticPath",
"(",
"oldPath",
",",
"newPath",
"string",
")",
"{",
"if",
"!",
"filepath",
".",
"IsAbs",
"(",
"oldPath",
")",
"{",
"oldPath",
"=",
"filepath",
".",
"Join",
"(",
"Root",
",",
"oldPath",
")",
... |
20,391 | all-20392 | [
"SetAnnotation",
"sets",
"annotations",
"for",
"the",
"virtual",
"machine",
"."
] | [
"func",
"(",
"v",
"*",
"VM",
")",
"SetAnnotation",
"(",
"text",
"string",
")",
"error",
"{",
"return",
"v",
".",
"updateVMX",
"(",
"func",
"(",
"<mask>",
"*",
"vmx",
".",
"VirtualMachine",
")",
"error",
"{",
"model",
".",
"Annotation",
"=",
"text",
"... |
20,392 | all-20393 | [
"Flatten",
"can",
"be",
"used",
"to",
"force",
"compactions",
"on",
"the",
"LSM",
"tree",
"so",
"all",
"the",
"tables",
"fall",
"on",
"the",
"same",
"level",
".",
"This",
"ensures",
"that",
"all",
"the",
"versions",
"of",
"keys",
"are",
"colocated",
"and... | [
"func",
"(",
"db",
"*",
"DB",
")",
"Flatten",
"(",
"workers",
"int",
")",
"error",
"{",
"db",
".",
"stopCompactions",
"(",
")",
"\n",
"defer",
"db",
".",
"startCompactions",
"(",
")",
"\n\n",
"compactAway",
":=",
"func",
"(",
"cp",
"compactionPriority",
... |
20,393 | all-20394 | [
"DistSqr",
"returns",
"the",
"square",
"of",
"the",
"distance",
"between",
"two",
"points",
"."
] | [
"func",
"(",
"v",
"Vec3",
")",
"DistSqr",
"(",
"v1",
"Vec3",
")",
"float32",
"{",
"dx",
":=",
"v1",
"[",
"0",
"]",
"-",
"v",
"[",
"0",
"]",
"\n",
"dy",
":=",
"v1",
"[",
"1",
"]",
"-",
"v",
"[",
"1",
"]",
"\n",
"dz",
":=",
"v1",
"[",
"2"... |
20,394 | all-20395 | [
"GetTypeOk",
"returns",
"a",
"tuple",
"with",
"the",
"Type",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"l",
"*",
"LogStreamDefinition",
")",
"GetTypeOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"l",
"==",
"nil",
"||",
"l",
".",
"<mask>",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return",
"*"... |
20,395 | all-20396 | [
"copy",
"returns",
"a",
"copy",
"of",
"the",
"current",
"state",
"."
] | [
"func",
"(",
"st",
"*",
"state",
")",
"copy",
"(",
")",
"*",
"state",
"{",
"n",
":=",
"<mask>",
"(",
"state",
")",
"\n",
"*",
"n",
"=",
"*",
"st",
"\n",
"return",
"n",
"\n",
"}"
] |
20,396 | all-20397 | [
"Format",
"proxies",
"the",
"closure",
"in",
"order",
"to",
"satisfy",
"logrus",
".",
"Formatter",
"s",
"interface",
"."
] | [
"func",
"(",
"f",
"FormatterFunc",
")",
"Format",
"(",
"entry",
"*",
"logrus",
".",
"Entry",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"return",
"f",
"(",
"<mask>",
")",
"\n",
"}"
] |
20,397 | all-20398 | [
"Delete",
"deletes",
"the",
"file",
"at",
"key"
] | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Delete",
"(",
"key",
"string",
")",
"error",
"{",
"return",
"os",
".",
"Remove",
"(",
"c",
".",
"KeyToPath",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
20,398 | all-20399 | [
"HasCustomBgColor",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"WidgetConditionalFormat",
")",
"HasCustomBgColor",
"(",
")",
"bool",
"{",
"if",
"w",
"!=",
"nil",
"&&",
"w",
".",
"CustomBgColor",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
20,399 | all-20400 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"Cache",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage11",
"(",
"&",
"r",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.