id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
3,900 | all-3901 | [
"withStateRLock",
"performs",
"an",
"action",
"with",
"the",
"connection",
"state",
"mutex",
"rlocked",
"."
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"withStateRLock",
"(",
"f",
"func",
"(",
")",
"error",
")",
"error",
"{",
"c",
".",
"stateMut",
".",
"RLock",
"(",
")",
"\n",
"err",
":=",
"f",
"(",
")",
"\n",
"c",
".",
"stateMut",
".",
"RUnlock",
"(",
")"... |
3,901 | all-3902 | [
"NewView",
"constructs",
"a",
"new",
"view",
"with",
"the",
"given",
"inputs",
"."
] | [
"func",
"NewView",
"(",
"i",
"*",
"NewViewInput",
")",
"(",
"*",
"<mask>",
",",
"error",
")",
"{",
"return",
"&",
"View",
"{",
"dependency",
":",
"i",
".",
"Dependency",
",",
"clients",
":",
"i",
".",
"Clients",
",",
"maxStale",
":",
"i",
".",
"Max... |
3,902 | all-3903 | [
"peek",
"returns",
"but",
"does",
"not",
"consume",
"the",
"next",
"token",
"."
] | [
"func",
"(",
"p",
"*",
"<mask>",
")",
"peek",
"(",
")",
"item",
"{",
"if",
"p",
".",
"peekCount",
">",
"0",
"{",
"return",
"p",
".",
"token",
"[",
"p",
".",
"peekCount",
"-",
"1",
"]",
"\n",
"}",
"\n",
"p",
".",
"peekCount",
"=",
"1",
"\n\n",... |
3,903 | all-3904 | [
"Respond",
"is",
"used",
"to",
"respond",
"with",
"a",
"response",
"error",
"or",
"both"
] | [
"func",
"(",
"r",
"*",
"RPC",
")",
"Respond",
"(",
"resp",
"<mask>",
"{",
"}",
",",
"err",
"error",
")",
"{",
"r",
".",
"RespChan",
"<-",
"RPCResponse",
"{",
"resp",
",",
"err",
"}",
"\n",
"}"
] |
3,904 | all-3905 | [
"/",
"*",
"Deterministically",
"generates",
"new",
"priv",
"-",
"key",
"bytes",
"from",
"key",
".",
"func",
"(",
"key",
"PrivKeySecp256k1",
")",
"Generate",
"(",
"index",
"int",
")",
"PrivKeySecp256k1",
"{",
"newBytes",
":",
"=",
"cdc",
".",
"BinarySha256",
... | [
"func",
"GenPrivKeySecp256k1",
"(",
")",
"PrivKeySecp256k1",
"{",
"privKeyBytes",
":=",
"[",
"32",
"]",
"<mask>",
"{",
"}",
"\n",
"copy",
"(",
"privKeyBytes",
"[",
":",
"]",
",",
"CRandBytes",
"(",
"32",
")",
")",
"\n",
"priv",
",",
"_",
":=",
"secp256... |
3,905 | all-3906 | [
"SetValue",
"implements",
"storage",
"interface",
"."
] | [
"func",
"(",
"s",
"*",
"Storage",
")",
"SetValue",
"(",
"ctx",
"context",
".",
"Context",
",",
"accessToken",
"string",
",",
"key",
",",
"value",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"string",
",",
"error",
")",
"{",
"span",
",",
"ctx",
"... |
3,906 | all-3907 | [
"GetClient",
"will",
"replace",
"some",
"versions",
"of",
"Docker",
"on",
"Windows",
".",
"We",
"need",
"this",
"because",
"agent",
"assumes",
"that",
"it",
"can",
"always",
"call",
"older",
"versions",
"of",
"the",
"docker",
"API",
"."
] | [
"func",
"(",
"f",
"*",
"factory",
")",
"GetClient",
"(",
"version",
"dockerclient",
".",
"DockerVersion",
")",
"(",
"sdkclient",
".",
"Client",
",",
"error",
")",
"{",
"for",
"_",
",",
"v",
":=",
"range",
"getWindowsReplaceableVersions",
"(",
")",
"{",
"... |
3,907 | all-3908 | [
"MetadataFromFileName",
"guesses",
"file",
"metadata",
"from",
"the",
"filename",
"and",
"a",
"simplifed",
"filename",
".",
"For",
"example",
"build",
"-",
"log",
".",
"txt",
".",
"gz",
"would",
"be",
":",
"Content",
"-",
"Type",
":",
"text",
"/",
"plain",... | [
"func",
"MetadataFromFileName",
"(",
"filename",
"string",
")",
"(",
"string",
",",
"map",
"[",
"string",
"]",
"string",
")",
"{",
"metadata",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"segments",
":=",
"strings",
".",
"Split",
... |
3,908 | all-3909 | [
"Save",
"calls",
"db",
".",
"Save",
"()",
"returning",
"more",
"descriptive",
"error",
"."
] | [
"func",
"Save",
"(",
"<mask>",
"*",
"reform",
".",
"Querier",
",",
"rec",
"reform",
".",
"Record",
")",
"error",
"{",
"if",
"err",
":=",
"db",
".",
"Save",
"(",
"rec",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
... |
3,909 | all-3910 | [
"ApplicationNew",
"is",
"a",
"wrapper",
"around",
"g_application_new",
"()",
"."
] | [
"func",
"ApplicationNew",
"(",
"appID",
"string",
",",
"flags",
"ApplicationFlags",
")",
"*",
"Application",
"{",
"cstr1",
":=",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"C",
".",
"CString",
"(",
"appID",
")",
")",
"\n",
"defer",
"C",
".",
"free",
"(",... |
3,910 | all-3911 | [
"SetRequiredVersion",
"is",
"a",
"wrapper",
"around",
"gdk_gl_context_set_required_version",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"GLContext",
")",
"SetRequiredVersion",
"(",
"<mask>",
",",
"minor",
"int",
")",
"{",
"C",
".",
"gdk_gl_context_set_required_version",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"C",
".",
"int",
")",
"(",
"major",
")",
",",
"... |
3,911 | all-3912 | [
"Do",
"executes",
"Runtime",
".",
"getIsolateId",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"id",
"-",
"The",
"isolate",
"id",
"."
] | [
"func",
"(",
"p",
"*",
"GetIsolateIDParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"id",
"string",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"GetIsolateIDReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx... |
3,912 | all-3913 | [
"The",
"9",
"pass",
"functions",
"below",
"takes",
"the",
"raftpb",
".",
"Entry",
"and",
"return",
"if",
"the",
"entry",
"should",
"be",
"printed",
"and",
"the",
"type",
"of",
"entry",
"the",
"type",
"of",
"the",
"entry",
"will",
"used",
"in",
"the",
"... | [
"func",
"passConfChange",
"(",
"<mask>",
"raftpb",
".",
"Entry",
")",
"(",
"bool",
",",
"string",
")",
"{",
"return",
"entry",
".",
"Type",
"==",
"raftpb",
".",
"EntryConfChange",
",",
"\"",
"\"",
"\n",
"}"
] |
3,913 | all-3914 | [
"EndpointMessage",
"returns",
"the",
"endpoint",
"message",
"object",
"."
] | [
"func",
"(",
"s",
"*",
"Service",
")",
"EndpointMessage",
"(",
"channelID",
"string",
")",
"(",
"*",
"Message",
",",
"error",
")",
"{",
"c",
":=",
"make",
"(",
"chan",
"*",
"result",
")",
"\n",
"done",
":=",
"make",
"(",
"chan",
"bool",
")",
"\n\n"... |
3,914 | all-3915 | [
"WaitForUnprocessedRecords",
"block",
"execution",
"until",
"all",
"unprocessed",
"log",
"records",
"for",
"this",
"logger",
"are",
"processed",
".",
"In",
"order",
"to",
"wait",
"for",
"processing",
"in",
"all",
"loggers",
"logging",
".",
"WaitForAllUnprocessedReco... | [
"func",
"(",
"logger",
"*",
"Logger",
")",
"WaitForUnprocessedRecords",
"(",
")",
"{",
"runtime",
".",
"Gosched",
"(",
")",
"\n",
"<mask>",
"(",
"diff",
"uint64",
"\n",
"diffPrev",
"uint64",
"\n",
"i",
"uint8",
"\n",
")",
"\n",
"for",
"{",
"diff",
"=",... |
3,915 | all-3916 | [
"GetId",
"returns",
"the",
"Id",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"s",
"*",
"SyntheticsUser",
")",
"GetId",
"(",
")",
"int",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"<mask>",
"==",
"nil",
"{",
"return",
"0",
"\n",
"}",
"\n",
"return",
"*",
"s",
".",
"Id",
"\n",
"}"
] |
3,916 | all-3917 | [
"StartExternal",
"starts",
"an",
"external",
"segment",
"."
] | [
"func",
"(",
"t",
"*",
"<mask>",
")",
"StartExternal",
"(",
"host",
",",
"name",
"string",
")",
"error",
"{",
"t",
".",
"mtx",
".",
"Lock",
"(",
")",
"\n",
"defer",
"t",
".",
"mtx",
".",
"Unlock",
"(",
")",
"\n\n",
"id",
",",
"err",
":=",
"t",
... |
3,917 | all-3918 | [
"Returns",
"a",
"time",
"at",
"the",
"key",
"or",
"the",
"specified",
"value",
"if",
"it",
"doesn",
"t",
"exist",
"or",
"isn",
"t",
"a",
"time"
] | [
"func",
"(",
"t",
"Typed",
")",
"TimeOr",
"(",
"<mask>",
"string",
",",
"d",
"time",
".",
"Time",
")",
"time",
".",
"Time",
"{",
"if",
"value",
",",
"exists",
":=",
"t",
".",
"TimeIf",
"(",
"key",
")",
";",
"exists",
"{",
"return",
"value",
"\n",... |
3,918 | all-3919 | [
"ProfilesGet",
"returns",
"the",
"profiles",
"with",
"the",
"given",
"names",
"in",
"the",
"given",
"project",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"ProfilesGet",
"(",
"project",
"string",
",",
"names",
"[",
"]",
"string",
")",
"(",
"[",
"]",
"api",
".",
"Profile",
",",
"error",
")",
"{",
"profiles",
":=",
"make",
"(",
"[",
"]",
"api",
".",
"Profile",
"... |
3,919 | all-3920 | [
"DescribeTags",
"indicates",
"an",
"expected",
"call",
"of",
"DescribeTags"
] | [
"func",
"(",
"mr",
"*",
"MockClientSDKMockRecorder",
")",
"DescribeTags",
"(",
"arg0",
"<mask>",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",... |
3,920 | all-3921 | [
"MutateSetOptions",
"for",
"ClearFlag",
"sets",
"the",
"SetOptionsOp",
"s",
"ClearFlags",
"field"
] | [
"func",
"(",
"m",
"ClearFlag",
")",
"MutateSetOptions",
"(",
"o",
"*",
"xdr",
".",
"SetOptionsOp",
")",
"(",
"err",
"error",
")",
"{",
"if",
"!",
"isFlagValid",
"(",
"xdr",
".",
"AccountFlags",
"(",
"m",
")",
")",
"{",
"return",
"<mask>",
".",
"New",... |
3,921 | all-3922 | [
"GetDisplayTypeOk",
"returns",
"a",
"tuple",
"with",
"the",
"DisplayType",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TimeseriesRequest",
")",
"GetDisplayTypeOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"t",
"==",
"nil",
"||",
"t",
".",
"DisplayType",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"retu... |
3,922 | all-3923 | [
"virtualMachineIPsForTag",
"is",
"a",
"higher",
"-",
"level",
"wrapper",
"that",
"calls",
"out",
"to",
"functions",
"to",
"fetch",
"all",
"of",
"the",
"virtual",
"machines",
"matching",
"a",
"certain",
"tag",
"ID",
"and",
"then",
"gets",
"all",
"of",
"the",
... | [
"func",
"virtualMachineIPsForTag",
"(",
"ctx",
"context",
".",
"Context",
",",
"client",
"*",
"vSphereClient",
",",
"id",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"vms",
",",
"err",
":=",
"virtualMachinesForTag",
"(",
"ctx",
",",
"... |
3,923 | all-3924 | [
"title",
":",
"app",
"sleep",
"path",
":",
"/",
"apps",
"/",
"{",
"app",
"}",
"/",
"sleep",
"method",
":",
"POST",
"consume",
":",
"application",
"/",
"x",
"-",
"www",
"-",
"form",
"-",
"urlencoded",
"produce",
":",
"application",
"/",
"x",
"-",
"j... | [
"func",
"sleep",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"t",
"auth",
".",
"Token",
")",
"(",
"err",
"error",
")",
"{",
"process",
":=",
"InputValue",
"(",
"r",
",",
"\"",
"\"",
")",
"\n",
"appName",
"... |
3,924 | all-3925 | [
"NewDiffCmd",
"creates",
"a",
"new",
"DiffCmd",
"instance",
"."
] | [
"func",
"NewDiffCmd",
"(",
"releaseRepo",
"<mask>",
".",
"Release",
",",
"release1",
",",
"release2",
"string",
")",
"*",
"DiffCmd",
"{",
"return",
"&",
"DiffCmd",
"{",
"releaseRepo",
":",
"releaseRepo",
",",
"release1",
":",
"release1",
",",
"release2",
":"... |
3,925 | all-3926 | [
"GetType",
"returns",
"the",
"Type",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"c",
"*",
"CheckStatusDefinition",
")",
"GetType",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"||",
"c",
".",
"<mask>",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"c",
".",
"Type",
"\n",
"}"
] |
3,926 | all-3927 | [
"MutatePayment",
"for",
"NativeAmount",
"sets",
"the",
"PaymentOp",
"s",
"currency",
"field",
"to",
"native",
"and",
"sets",
"its",
"amount",
"to",
"the",
"provided",
"integer"
] | [
"func",
"(",
"m",
"NativeAmount",
")",
"MutatePayment",
"(",
"o",
"interface",
"{",
"}",
")",
"(",
"err",
"error",
")",
"{",
"switch",
"o",
":=",
"o",
".",
"(",
"type",
")",
"{",
"default",
":",
"err",
"=",
"errors",
".",
"New",
"(",
"\"",
"\"",
... |
3,927 | all-3928 | [
"GetOrderByOk",
"returns",
"a",
"tuple",
"with",
"the",
"OrderBy",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"g",
"*",
"GraphDefinitionRequest",
")",
"GetOrderByOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"g",
"==",
"nil",
"||",
"g",
".",
"OrderBy",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"<mask>",
"\n",
"}",
"\n",
"return... |
3,928 | all-3929 | [
"Foreach",
"acts",
"the",
"same",
"as",
"g_slist_foreach",
"()",
".",
"No",
"user_data",
"argument",
"is",
"implemented",
"because",
"of",
"Go",
"clojure",
"capabilities",
"."
] | [
"func",
"(",
"v",
"*",
"SList",
")",
"Foreach",
"(",
"fn",
"func",
"(",
"ptr",
"unsafe",
".",
"Pointer",
")",
")",
"{",
"for",
"l",
":=",
"v",
";",
"l",
"!=",
"nil",
";",
"l",
"=",
"l",
".",
"Next",
"(",
")",
"{",
"fn",
"(",
"unsafe",
".",
... |
3,929 | all-3930 | [
"Get",
"obtains",
"a",
"key",
"from",
"the",
"cache",
"and",
"checks",
"if",
"the",
"key",
"is",
"expired"
] | [
"func",
"(",
"mkc",
"*",
"memoryKeyCacher",
")",
"Get",
"(",
"keyID",
"string",
")",
"(",
"*",
"jose",
".",
"JSONWebKey",
",",
"error",
")",
"{",
"searchKey",
",",
"ok",
":=",
"mkc",
".",
"entries",
"[",
"keyID",
"]",
"\n",
"if",
"<mask>",
"{",
"if... |
3,930 | all-3931 | [
"NewBackend",
"creates",
"a",
"logger",
"backend",
"from",
"a",
"Writer",
"."
] | [
"func",
"NewBackend",
"(",
"w",
"<mask>",
".",
"Writer",
",",
"opts",
"...",
"BackendOption",
")",
"*",
"Backend",
"{",
"b",
":=",
"&",
"Backend",
"{",
"w",
":",
"w",
",",
"flag",
":",
"defaultFlags",
"}",
"\n",
"for",
"_",
",",
"o",
":=",
"range",... |
3,931 | all-3932 | [
"SetContentTypeBytes",
"sets",
"response",
"Content",
"-",
"Type",
".",
"It",
"is",
"safe",
"modifying",
"contentType",
"buffer",
"after",
"function",
"return",
"."
] | [
"func",
"(",
"ctx",
"*",
"RequestCtx",
")",
"SetContentTypeBytes",
"(",
"contentType",
"[",
"]",
"byte",
")",
"{",
"ctx",
".",
"<mask>",
".",
"Header",
".",
"SetContentTypeBytes",
"(",
"contentType",
")",
"\n",
"}"
] |
3,932 | all-3933 | [
"WithSignals",
"returns",
"a",
"Process",
"that",
"will",
"Close",
"()",
"when",
"any",
"given",
"signal",
"fires",
".",
"This",
"is",
"useful",
"to",
"bind",
"Process",
"trees",
"to",
"syscall",
".",
"SIGTERM",
"SIGKILL",
"etc",
"."
] | [
"func",
"WithSignals",
"(",
"sig",
"...",
"os",
".",
"Signal",
")",
"Process",
"{",
"p",
":=",
"WithParent",
"(",
"Background",
"(",
")",
")",
"\n",
"c",
":=",
"make",
"(",
"chan",
"<mask>",
".",
"Signal",
")",
"\n",
"signal",
".",
"Notify",
"(",
"... |
3,933 | all-3934 | [
"TSDBSnapshot",
"implements",
"pb",
".",
"AdminServer",
"."
] | [
"func",
"(",
"s",
"*",
"AdminDisabled",
")",
"TSDBSnapshot",
"(",
"_",
"<mask>",
".",
"Context",
",",
"_",
"*",
"pb",
".",
"TSDBSnapshotRequest",
")",
"(",
"*",
"pb",
".",
"TSDBSnapshotResponse",
",",
"error",
")",
"{",
"return",
"nil",
",",
"errAdminDis... |
3,934 | all-3935 | [
"NewWriter",
"creates",
"an",
"io",
".",
"WriteCloser",
"for",
"a",
"stream",
"of",
"bytes",
"to",
"be",
"chunked",
".",
"Chunks",
"are",
"created",
"based",
"on",
"the",
"content",
"then",
"hashed",
"and",
"deduplicated",
"/",
"uploaded",
"to",
"object",
... | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"NewWriter",
"(",
"ctx",
"context",
".",
"Context",
")",
"*",
"Writer",
"{",
"return",
"newWriter",
"(",
"ctx",
",",
"s",
".",
"objC",
",",
"s",
".",
"prefix",
")",
"\n",
"}"
] |
3,935 | all-3936 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"Version",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoServiceworker",
"(",
"&",
"w",
",",
"v",
")",
... |
3,936 | all-3937 | [
"NewDefaultUAAManager",
"-"
] | [
"func",
"NewDefaultUAAManager",
"(",
"sysDomain",
",",
"clientID",
",",
"clientSecret",
",",
"userAgent",
"string",
",",
"peek",
"bool",
")",
"(",
"Manager",
",",
"error",
")",
"{",
"target",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"sysDomain",
... |
3,937 | all-3938 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetFlattenedDocumentParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom43",
"(",
"... |
3,938 | all-3939 | [
"UnmarshalEd25519PublicKey",
"returns",
"a",
"public",
"key",
"from",
"input",
"bytes",
"."
] | [
"func",
"UnmarshalEd25519PublicKey",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"(",
"PubKey",
",",
"error",
")",
"{",
"if",
"len",
"(",
"data",
")",
"!=",
"32",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
... |
3,939 | all-3940 | [
"advance",
"advances",
"the",
"current",
"string",
"offset",
"."
] | [
"func",
"(",
"st",
"*",
"state",
")",
"advance",
"(",
"<mask>",
"int",
")",
"{",
"if",
"len",
"(",
"st",
".",
"str",
")",
"<",
"add",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"st",
".",
"str",
"=",
"st",
".",
"str",
"[",
"add",
... |
3,940 | all-3941 | [
"handleInvalidParamException",
"removes",
"the",
"event",
"from",
"event",
"queue",
"when",
"its",
"parameters",
"are",
"invalid",
"to",
"reduce",
"redundant",
"API",
"call"
] | [
"func",
"handleInvalidParamException",
"(",
"err",
"error",
",",
"events",
"*",
"list",
".",
"List",
",",
"eventToSubmit",
"*",
"list",
".",
"Element",
")",
"{",
"if",
"utils",
".",
"IsAWSErrorCodeEqual",
"(",
"err",
",",
"ecs",
".",
"ErrCodeInvalidParameterEx... |
3,941 | all-3942 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"Initiator",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork27",
"(",
"&",
"r",
... |
3,942 | all-3943 | [
"NewDriver",
"creates",
"and",
"returns",
"a",
"new",
"instance",
"of",
"the",
"driver"
] | [
"func",
"NewDriver",
"(",
"hostName",
",",
"storePath",
"string",
")",
"drivers",
".",
"Driver",
"{",
"return",
"&",
"Driver",
"{",
"EnginePort",
":",
"<mask>",
".",
"DefaultPort",
",",
"BaseDriver",
":",
"&",
"drivers",
".",
"BaseDriver",
"{",
"MachineName"... |
3,943 | all-3944 | [
"GoString",
"defines",
"the",
"printable",
"version",
"of",
"this",
"struct",
"."
] | [
"func",
"(",
"c",
"*",
"SSLConfig",
")",
"GoString",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
"+",
"\"",
... |
3,944 | all-3945 | [
"GetFile",
"returns",
"a",
"FileResponse",
"containing",
"a",
"Path",
"string",
"needed",
"to",
"download",
"a",
"file",
".",
"You",
"will",
"have",
"to",
"construct",
"the",
"download",
"link",
"manually",
"like",
"https",
":",
"//",
"api",
".",
"telegram",... | [
"func",
"(",
"api",
"*",
"TelegramBotAPI",
")",
"GetFile",
"(",
"fileID",
"string",
")",
"(",
"*",
"FileResponse",
",",
"error",
")",
"{",
"resp",
":=",
"&",
"FileResponse",
"{",
"}",
"\n",
"_",
",",
"err",
":=",
"api",
".",
"c",
".",
"getQuerystring... |
3,945 | all-3946 | [
"Value",
"converts",
"a",
"value",
"to",
"a",
"database",
"driver",
"value"
] | [
"func",
"(",
"u",
"ISBN13",
")",
"Value",
"(",
")",
"(",
"<mask>",
".",
"Value",
",",
"error",
")",
"{",
"return",
"driver",
".",
"Value",
"(",
"string",
"(",
"u",
")",
")",
",",
"nil",
"\n",
"}"
] |
3,946 | all-3947 | [
"Parallel",
"walk",
"the",
"root",
"paths",
"and",
"populate",
"the",
"path",
"channel",
"for",
"the",
"worker",
"routines",
"to",
"consume",
"."
] | [
"func",
"(",
"w",
"*",
"workManager",
")",
"loadRecursive",
"(",
"paths",
"[",
"]",
"string",
")",
"{",
"walkFn",
":=",
"func",
"(",
"path",
"string",
",",
"info",
"os",
".",
"FileInfo",
",",
"err",
"error",
")",
"error",
"{",
"if",
"err",
"!=",
"n... |
3,947 | all-3948 | [
"appendReplacementCandiates",
"creates",
"prioritize",
".",
"CandidateWithTime",
"values",
"for",
"(",
"transport",
"scope",
"digest",
")",
"and",
"returns",
"the",
"result",
"of",
"appending",
"them",
"to",
"candidates",
"."
] | [
"func",
"(",
"mem",
"*",
"cache",
")",
"appendReplacementCandidates",
"(",
"candidates",
"[",
"]",
"prioritize",
".",
"CandidateWithTime",
",",
"transport",
"types",
".",
"ImageTransport",
",",
"scope",
"types",
".",
"BICTransportScope",
",",
"digest",
"digest",
... |
3,948 | all-3949 | [
"NewMethod",
"return",
"a",
"new",
"method",
"code",
"snippet",
"for",
"executing",
"a",
"certain",
"mapping",
"."
] | [
"func",
"NewMethod",
"(",
"database",
",",
"pkg",
",",
"entity",
",",
"kind",
"string",
",",
"config",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"*",
"Method",
",",
"error",
")",
"{",
"packages",
",",
"err",
":=",
"Packages",
"(",
")",
"\n",
"... |
3,949 | all-3950 | [
"GetState",
"returns",
"a",
"github",
".",
"com",
"/",
"machine",
"/",
"libmachine",
"/",
"state",
".",
"State",
"representing",
"the",
"state",
"of",
"the",
"host",
"(",
"running",
"stopped",
"etc",
".",
")"
] | [
"func",
"(",
"d",
"*",
"Driver",
")",
"GetState",
"(",
")",
"(",
"state",
".",
"State",
",",
"error",
")",
"{",
"vm",
",",
"err",
":=",
"d",
".",
"virtualMachine",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"state",
".",
"Error",
... |
3,950 | all-3951 | [
"Execute",
"implements",
"https",
":",
"//",
"godoc",
".",
"org",
"/",
"golang",
".",
"org",
"/",
"x",
"/",
"sys",
"/",
"windows",
"/",
"svc#Handler",
"The",
"basic",
"way",
"that",
"this",
"implementation",
"works",
"is",
"through",
"two",
"channels",
"... | [
"func",
"(",
"h",
"*",
"<mask>",
")",
"Execute",
"(",
"args",
"[",
"]",
"string",
",",
"requests",
"<-",
"chan",
"svc",
".",
"ChangeRequest",
",",
"responses",
"chan",
"<-",
"svc",
".",
"Status",
")",
"(",
"bool",
",",
"uint32",
")",
"{",
"defer",
... |
3,951 | all-3952 | [
"returns",
"ZoneID",
"-",
">",
"ZoneName",
"mapping",
"for",
"zones",
"that",
"are",
"managed",
"by",
"the",
"Designate",
"and",
"match",
"domain",
"filter"
] | [
"func",
"(",
"p",
"designateProvider",
")",
"getZones",
"(",
")",
"(",
"map",
"[",
"string",
"]",
"string",
",",
"error",
")",
"{",
"result",
":=",
"map",
"[",
"string",
"]",
"string",
"{",
"}",
"\n\n",
"err",
":=",
"p",
".",
"client",
".",
"ForEac... |
3,952 | all-3953 | [
"SelectMonth",
"is",
"a",
"wrapper",
"around",
"gtk_calendar_select_month",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Calendar",
")",
"SelectMonth",
"(",
"month",
",",
"year",
"uint",
")",
"{",
"C",
".",
"gtk_calendar_select_month",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"guint",
"(",
"month",
")",
",",
"C",
".",
"guint",
"(",
... |
3,953 | all-3954 | [
"NewObserver",
"creates",
"a",
"new",
"observer",
"that",
"can",
"be",
"registered",
"to",
"make",
"observations",
"on",
"a",
"Raft",
"instance",
".",
"Observations",
"will",
"be",
"sent",
"on",
"the",
"given",
"channel",
"if",
"they",
"satisfy",
"the",
"giv... | [
"func",
"NewObserver",
"(",
"channel",
"chan",
"Observation",
",",
"blocking",
"bool",
",",
"<mask>",
"FilterFn",
")",
"*",
"Observer",
"{",
"return",
"&",
"Observer",
"{",
"channel",
":",
"channel",
",",
"blocking",
":",
"blocking",
",",
"filter",
":",
"f... |
3,954 | all-3955 | [
"Setup",
"provides",
"a",
"mock",
"function",
"with",
"given",
"fields",
":"
] | [
"func",
"(",
"_m",
"*",
"Storage",
")",
"Setup",
"(",
")",
"error",
"{",
"ret",
":=",
"_m",
".",
"Called",
"(",
")",
"\n\n",
"var",
"r0",
"error",
"\n",
"if",
"rf",
",",
"ok",
":=",
"ret",
".",
"Get",
"(",
"0",
")",
".",
"(",
"func",
"(",
"... |
3,955 | all-3956 | [
"schemaVirtualMachineGuestInfo",
"returns",
"schema",
"items",
"for",
"the",
"relevant",
"parts",
"of",
"GuestInfo",
"that",
"vsphere_virtual_machine",
"tracks",
"(",
"mostly",
"guest",
"information",
")",
"."
] | [
"func",
"schemaVirtualMachineGuestInfo",
"(",
")",
"map",
"[",
"string",
"]",
"*",
"schema",
".",
"Schema",
"{",
"return",
"map",
"[",
"string",
"]",
"*",
"schema",
".",
"Schema",
"{",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
","... |
3,956 | all-3957 | [
"Do",
"executes",
"Debugger",
".",
"setBlackboxedRanges",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetBlackboxedRangesParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetBlackboxedRanges",
",",
"p",
",",
"nil",
")",
"\n",
"}... |
3,957 | all-3958 | [
"With",
"returns",
"a",
"context",
".",
"Context",
"with",
"the",
"keyvals",
"attached",
"."
] | [
"func",
"(",
"c",
"*",
"contextT",
")",
"With",
"(",
"keyvals",
"...",
"interface",
"{",
"}",
")",
"context",
".",
"<mask>",
"{",
"return",
"&",
"contextT",
"{",
"ctx",
":",
"newContext",
"(",
"c",
".",
"ctx",
",",
"keyvals",
")",
"}",
"\n",
"}"
] |
3,958 | all-3959 | [
"Do",
"executes",
"Network",
".",
"getResponseBody",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"body",
"-",
"Response",
"body",
"."
] | [
"func",
"(",
"p",
"*",
"GetResponseBodyParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"body",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"GetResponseBodyReturns",
"\n",
"err",
"=",
"cdp",
".",
"Ex... |
3,959 | all-3960 | [
"FetchWorksheets",
"retrieves",
"all",
"worksheets",
"available",
"to",
"API",
"Token",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"FetchWorksheets",
"(",
")",
"(",
"*",
"[",
"]",
"Worksheet",
",",
"error",
")",
"{",
"result",
",",
"err",
":=",
"a",
".",
"Get",
"(",
"config",
".",
"WorksheetPrefix",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",... |
3,960 | all-3961 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetTargetInfoParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget9",
"(",
"&",
"w",
",",
"v",
")"... |
3,961 | all-3962 | [
"EmitLazyLogger",
"belongs",
"to",
"the",
"log",
".",
"Encoder",
"interface"
] | [
"func",
"(",
"m",
"*",
"MockKeyValue",
")",
"EmitLazyLogger",
"(",
"value",
"log",
".",
"LazyLogger",
")",
"{",
"var",
"meta",
"MockKeyValue",
"\n",
"value",
"(",
"&",
"meta",
")",
"\n",
"m",
".",
"Key",
"=",
"meta",
".",
"<mask>",
"\n",
"m",
".",
... |
3,962 | all-3963 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventConsoleAPICalled",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime35",
"(",
"&",
"w",
",",
"v",
... |
3,963 | all-3964 | [
"RegisterCustomDecoder",
"allows",
"to",
"define",
"custom",
"type",
"decoders",
"."
] | [
"func",
"RegisterCustomDecoder",
"(",
"fn",
"CustomTypeDecoder",
",",
"types",
"[",
"]",
"interface",
"{",
"}",
",",
"fields",
"[",
"]",
"interface",
"{",
"}",
")",
"{",
"rawFunc",
":=",
"(",
"func",
"(",
"[",
"]",
"string",
")",
"(",
"interface",
"{",... |
3,964 | all-3965 | [
"resolveStaleImages",
"resolves",
"stale",
"images",
"."
] | [
"func",
"(",
"i",
"*",
"<mask>",
")",
"resolveStaleImages",
"(",
")",
"{",
"i",
".",
"lastTarget",
"=",
"nil",
"\n",
"for",
"img",
":=",
"range",
"i",
".",
"images",
"{",
"img",
".",
"resolveStale",
"(",
")",
"\n",
"}",
"\n",
"}"
] |
3,965 | all-3966 | [
"NewPgRemoteDump",
"-",
"a",
"pgdump",
"initialized",
"for",
"remote",
"fs"
] | [
"func",
"NewPgRemoteDump",
"(",
"port",
"int",
",",
"database",
",",
"username",
",",
"password",
"string",
",",
"sshCfg",
"<mask>",
".",
"SshConfig",
")",
"(",
"*",
"PgDump",
",",
"error",
")",
"{",
"return",
"NewPgRemoteDumpWithPath",
"(",
"port",
",",
"... |
3,966 | all-3967 | [
"Fatal",
"outputs",
"Failed",
"log",
"and",
"exit",
"program"
] | [
"func",
"(",
"g",
"*",
"Glg",
")",
"Fatal",
"(",
"val",
"...",
"interface",
"{",
"}",
")",
"{",
"err",
":=",
"g",
".",
"out",
"(",
"FATAL",
",",
"blankFormat",
"(",
"len",
"(",
"val",
")",
")",
",",
"val",
"...",
")",
"\n",
"if",
"err",
"!=",... |
3,967 | all-3968 | [
"GroupObjectsByPrimaryKeyHash",
"returns",
"a",
"map",
"with",
"all",
"objects",
"grouped",
"by",
"the",
"primary",
"key",
"hash",
"that",
"is",
"calculated",
"from",
"all",
"metadata",
"keys",
"with",
"the",
"primary",
"attribute",
".",
"All",
"returned",
"obje... | [
"func",
"(",
"s",
"*",
"Seekret",
")",
"GroupObjectsByPrimaryKeyHash",
"(",
")",
"map",
"[",
"string",
"]",
"[",
"]",
"<mask>",
".",
"Object",
"{",
"return",
"models",
".",
"GroupObjectsByPrimaryKeyHash",
"(",
"s",
".",
"objectList",
")",
"\n",
"}"
] |
3,968 | all-3969 | [
"SetPosition",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_paned_set_position",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Paned",
")",
"SetPosition",
"(",
"position",
"int",
")",
"{",
"C",
".",
"gtk_paned_set_position",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
3,969 | all-3970 | [
"NewPEXReactor",
"creates",
"new",
"PEX",
"reactor",
"."
] | [
"func",
"NewPEXReactor",
"(",
"b",
"*",
"AddrBook",
")",
"*",
"PEXReactor",
"{",
"r",
":=",
"&",
"PEXReactor",
"{",
"<mask>",
":",
"b",
",",
"ensurePeersPeriod",
":",
"defaultEnsurePeersPeriod",
",",
"msgCountByPeer",
":",
"cmn",
".",
"NewCMap",
"(",
")",
... |
3,970 | all-3971 | [
"Nil",
"checks",
"a",
"value",
"is",
"nil",
"."
] | [
"func",
"Nil",
"(",
"tb",
"testing",
".",
"TB",
",",
"object",
"interface",
"{",
"}",
",",
"msgAndArgs",
"...",
"interface",
"{",
"}",
")",
"{",
"tb",
".",
"Helper",
"(",
")",
"\n",
"if",
"object",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"<m... |
3,971 | all-3972 | [
"resourceVSphereDPMHostOverrideFindEntry",
"attempts",
"to",
"locate",
"an",
"existing",
"DRS",
"VM",
"config",
"in",
"a",
"cluster",
"s",
"configuration",
".",
"It",
"s",
"used",
"by",
"the",
"resource",
"s",
"read",
"functionality",
"and",
"tests",
".",
"nil",... | [
"func",
"resourceVSphereDPMHostOverrideFindEntry",
"(",
"cluster",
"*",
"<mask>",
".",
"ClusterComputeResource",
",",
"host",
"*",
"object",
".",
"HostSystem",
",",
")",
"(",
"*",
"types",
".",
"ClusterDpmHostConfigInfo",
",",
"error",
")",
"{",
"props",
",",
"e... |
3,972 | all-3973 | [
"AddChildAtAnchor",
"is",
"a",
"wrapper",
"around",
"gtk_text_view_add_child_at_anchor",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TextView",
")",
"AddChildAtAnchor",
"(",
"<mask>",
"IWidget",
",",
"anchor",
"*",
"TextChildAnchor",
")",
"{",
"C",
".",
"gtk_text_view_add_child_at_anchor",
"(",
"v",
".",
"native",
"(",
")",
",",
"child",
".",
"toWidget",
"(",
")"... |
3,973 | all-3974 | [
"HasModified",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"d",
"*",
"DashboardLite",
")",
"HasModified",
"(",
")",
"bool",
"{",
"if",
"d",
"!=",
"nil",
"&&",
"d",
".",
"Modified",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
3,974 | all-3975 | [
"CreateRelatedComment",
"adds",
"a",
"new",
"comment",
"but",
"lets",
"you",
"specify",
"the",
"related",
"identifier",
"for",
"the",
"comment",
"."
] | [
"func",
"(",
"client",
"*",
"Client",
")",
"CreateRelatedComment",
"(",
"handle",
",",
"message",
"string",
",",
"relid",
"int",
")",
"(",
"*",
"Comment",
",",
"error",
")",
"{",
"var",
"out",
"reqComment",
"\n",
"comment",
":=",
"Comment",
"{",
"Message... |
3,975 | all-3976 | [
"GetColorOk",
"returns",
"a",
"tuple",
"with",
"the",
"Color",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"GetColorOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"w",
"==",
"nil",
"||",
"w",
".",
"Color",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"w",
".... |
3,976 | all-3977 | [
"SetMaxIdleConnsPerAddr",
"changes",
"the",
"maximum",
"number",
"of",
"idle",
"connections",
"kept",
"per",
"server",
".",
"If",
"maxIdle",
"<",
"0",
"no",
"idle",
"connections",
"are",
"kept",
".",
"If",
"maxIdle",
"==",
"0",
"the",
"default",
"number",
"(... | [
"func",
"(",
"c",
"*",
"Client",
")",
"SetMaxIdleConnsPerAddr",
"(",
"maxIdle",
"int",
")",
"{",
"if",
"maxIdle",
"==",
"0",
"{",
"maxIdle",
"=",
"maxIdleConnsPerAddr",
"\n",
"}",
"\n",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
... |
3,977 | all-3978 | [
"dropPrefix",
"runs",
"a",
"L0",
"-",
">",
"L1",
"compaction",
"and",
"then",
"runs",
"same",
"level",
"compaction",
"on",
"the",
"rest",
"of",
"the",
"levels",
".",
"For",
"L0",
"-",
">",
"L1",
"compaction",
"it",
"runs",
"compactions",
"normally",
"but... | [
"func",
"(",
"s",
"*",
"levelsController",
")",
"dropPrefix",
"(",
"prefix",
"[",
"]",
"byte",
")",
"error",
"{",
"opt",
":=",
"s",
".",
"kv",
".",
"opt",
"\n",
"for",
"_",
",",
"l",
":=",
"range",
"s",
".",
"levels",
"{",
"l",
".",
"RLock",
"(... |
3,978 | all-3979 | [
"String",
"prints",
"out",
"the",
"device",
"sub",
"-",
"resource",
"s",
"information",
"including",
"the",
"ID",
"at",
"time",
"of",
"instantiation",
"the",
"short",
"name",
"of",
"the",
"disk",
"and",
"the",
"current",
"device",
"key",
"and",
"address",
... | [
"func",
"(",
"r",
"*",
"Subresource",
")",
"<mask>",
"(",
")",
"string",
"{",
"devaddr",
":=",
"r",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"string",
")",
"\n",
"if",
"devaddr",
"==",
"\"",
"\"",
"{",
"devaddr",
"=",
"\"",
"\"",
"\n",
"}",
... |
3,979 | all-3980 | [
"Next",
"returns",
"the",
"next",
"page",
"of",
"resources",
".",
"If",
"there",
"are",
"no",
"more",
"resources",
"NoMoreResults",
"is",
"returned",
"."
] | [
"func",
"(",
"c",
"*",
"ApplicationPageIterator",
")",
"Next",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"*",
"ApplicationPage",
",",
"error",
")",
"{",
"ap",
":=",
"new",
"(",
"ApplicationPage",
")",
"\n",
"err",
":=",
"c",
".",
"p",
".",
"Nex... |
3,980 | all-3981 | [
"Write",
"behaves",
"like",
"io",
".",
"Writer",
".",
"Write",
"but",
"will",
"retry",
"on",
"EAGAIN"
] | [
"func",
"(",
"ew",
"Writer",
")",
"Write",
"(",
"p",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"again",
":",
"n",
",",
"err",
":=",
"ew",
".",
"Writer",
".",
"Write",
"(",
"p",
")",
"\n",
"if",
"err",
"==",
"nil",
"{",
"ret... |
3,981 | all-3982 | [
"NewSessionCache",
"creates",
"a",
"new",
"instance",
"of",
"SessionCache",
"and",
"defines",
"a",
"lifetime",
"for",
"sessions",
"and",
"a",
"initial",
"salt",
"for",
"random",
"input",
"."
] | [
"func",
"NewSessionCache",
"(",
"d",
"time",
".",
"Duration",
",",
"salt",
"string",
")",
"*",
"SessionCache",
"{",
"return",
"&",
"SessionCache",
"{",
"<mask>",
":",
"data",
".",
"NewCache",
"(",
"d",
")",
",",
"salter",
":",
"crypt",
".",
"NewSalter",
... |
3,982 | all-3983 | [
"Reverse",
"a",
"string"
] | [
"func",
"Reverse",
"(",
"s",
"string",
")",
"string",
"{",
"cs",
":=",
"<mask>",
"(",
"[",
"]",
"rune",
",",
"utf8",
".",
"RuneCountInString",
"(",
"s",
")",
")",
"\n",
"i",
":=",
"len",
"(",
"cs",
")",
"\n",
"for",
"_",
",",
"c",
":=",
"range"... |
3,983 | all-3984 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"NameValuePair",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoHar7",
"(",
"&",
"w",
",",
"v",
")",
"\n",... |
3,984 | all-3985 | [
"CutPeer",
"drops",
"messages",
"to",
"the",
"specified",
"peer",
"."
] | [
"func",
"(",
"s",
"*",
"EtcdServer",
")",
"CutPeer",
"(",
"id",
"<mask>",
".",
"ID",
")",
"{",
"tr",
",",
"ok",
":=",
"s",
".",
"r",
".",
"transport",
".",
"(",
"*",
"rafthttp",
".",
"Transport",
")",
"\n",
"if",
"ok",
"{",
"tr",
".",
"CutPeer"... |
3,985 | all-3986 | [
"Return",
"a",
"bool",
"if",
"ip",
"/",
"host",
"combo",
"in",
"hosts",
"file",
"."
] | [
"func",
"(",
"h",
"Hosts",
")",
"Has",
"(",
"ip",
"string",
",",
"host",
"string",
")",
"bool",
"{",
"<mask>",
":=",
"h",
".",
"getHostPosition",
"(",
"ip",
",",
"host",
")",
"\n\n",
"return",
"pos",
"!=",
"-",
"1",
"\n",
"}"
] |
3,986 | all-3987 | [
"GitHubTokenToUsername",
"takes",
"a",
"OAuth",
"access",
"token",
"issued",
"by",
"GitHub",
"and",
"uses",
"it",
"discover",
"the",
"username",
"of",
"the",
"user",
"who",
"obtained",
"the",
"code",
"(",
"or",
"verify",
"that",
"the",
"code",
"belongs",
"to... | [
"func",
"GitHubTokenToUsername",
"(",
"ctx",
"context",
".",
"Context",
",",
"oauthToken",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"!",
"githubTokenRegex",
".",
"MatchString",
"(",
"oauthToken",
")",
"&&",
"<mask>",
".",
"Getenv",
"(",
... |
3,987 | all-3988 | [
"Get",
"size",
"of",
"segment",
"."
] | [
"func",
"getSegmentSize",
"(",
"dir",
"string",
",",
"index",
"int",
")",
"(",
"int64",
",",
"error",
")",
"{",
"i",
":=",
"int64",
"(",
"-",
"1",
")",
"\n",
"fi",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"wal",
".",
"SegmentName",
"(",
"dir",
... |
3,988 | all-3989 | [
"NewTransactionMeta",
"creates",
"a",
"new",
"TransactionMeta",
"."
] | [
"func",
"NewTransactionMeta",
"(",
"v",
"int32",
",",
"value",
"interface",
"{",
"}",
")",
"(",
"result",
"TransactionMeta",
",",
"err",
"error",
")",
"{",
"result",
".",
"V",
"=",
"v",
"\n",
"switch",
"int32",
"(",
"v",
")",
"{",
"<mask>",
"0",
":",... |
3,989 | all-3990 | [
"countToBoolean",
"converts",
"a",
"profile",
"containing",
"hit",
"counts",
"to",
"instead",
"contain",
"only",
"1s",
"or",
"0s",
"."
] | [
"func",
"countToBoolean",
"(",
"profile",
"[",
"]",
"*",
"cover",
".",
"Profile",
")",
"[",
"]",
"*",
"cover",
".",
"Profile",
"{",
"setProfile",
":=",
"make",
"(",
"[",
"]",
"*",
"cover",
".",
"Profile",
",",
"0",
",",
"len",
"(",
"profile",
")",
... |
3,990 | all-3991 | [
"UnmarshalJSON",
"sets",
"the",
"DateTime",
"from",
"JSON"
] | [
"func",
"(",
"t",
"*",
"DateTime",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"string",
"(",
"data",
")",
"==",
"jsonNull",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"l",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
... |
3,991 | all-3992 | [
"Register",
"registers",
"the",
"specified",
"methods",
"specified",
"as",
"a",
"map",
"from",
"method",
"name",
"to",
"the",
"JSON",
"handler",
"function",
".",
"The",
"handler",
"functions",
"should",
"have",
"the",
"following",
"signature",
":",
"func",
"("... | [
"func",
"Register",
"(",
"registrar",
"tchannel",
".",
"Registrar",
",",
"funcs",
"Handlers",
",",
"onError",
"func",
"(",
"context",
".",
"Context",
",",
"error",
")",
")",
"error",
"{",
"handlers",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"... |
3,992 | all-3993 | [
"HandlerBuilder",
"can",
"be",
"used",
"to",
"create",
"a",
"scaffold",
".",
"Handler",
"based",
"on",
"a",
"Handler"
] | [
"func",
"HandlerBuilder",
"(",
"i",
"interface",
"{",
"}",
")",
"(",
"scaffold",
".",
"<mask>",
",",
"error",
")",
"{",
"switch",
"i",
".",
"(",
"type",
")",
"{",
"case",
"Handler",
":",
"return",
"build",
"(",
"i",
".",
"(",
"Handler",
")",
")",
... |
3,993 | all-3994 | [
"Lerp",
"returns",
"the",
"result",
"vector",
"of",
"a",
"linear",
"interpolation",
"between",
"two",
"vectors",
".",
"v",
"toward",
"v1",
".",
"The",
"interpolation",
"factor",
"t",
"should",
"be",
"comprised",
"betwenn",
"0",
"and",
"1",
".",
"0",
".",
... | [
"func",
"(",
"v",
"Vec2",
")",
"Lerp",
"(",
"<mask>",
",",
"v1",
"Vec2",
",",
"t",
"float32",
")",
"Vec2",
"{",
"return",
"Vec2",
"{",
"v",
"[",
"0",
"]",
"+",
"(",
"v1",
"[",
"0",
"]",
"-",
"v",
"[",
"0",
"]",
")",
"*",
"t",
",",
"v",
... |
3,994 | all-3995 | [
"SetUInt",
"is",
"a",
"wrapper",
"around",
"g_value_set_uint",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"SetUInt",
"(",
"val",
"uint",
")",
"{",
"C",
".",
"g_value_set_uint",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"guint",
"(",
"val",
")",
")",
"\n",
"}"
] |
3,995 | all-3996 | [
"ApplyExecutionRoleLogsAuth",
"will",
"check",
"whether",
"the",
"task",
"has",
"execution",
"role",
"credentials",
"and",
"add",
"the",
"genereated",
"credentials",
"endpoint",
"to",
"the",
"associated",
"HostConfig"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"ApplyExecutionRoleLogsAuth",
"(",
"hostConfig",
"*",
"dockercontainer",
".",
"HostConfig",
",",
"credentialsManager",
"credentials",
".",
"Manager",
")",
"*",
"apierrors",
".",
"HostConfigError",
"{",
"id",
":=",
"<mask>",
... |
3,996 | all-3997 | [
"MarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Marshaler",
"."
] | [
"func",
"(",
"t",
"ResourceType",
")",
"MarshalEasyJSON",
"(",
"out",
"*",
"jwriter",
".",
"Writer",
")",
"{",
"<mask>",
".",
"String",
"(",
"string",
"(",
"t",
")",
")",
"\n",
"}"
] |
3,997 | all-3998 | [
"/",
"*",
"FileChooserNative"
] | [
"func",
"OpenFileChooserNative",
"(",
"title",
"string",
",",
"parent_window",
"*",
"Window",
")",
"*",
"string",
"{",
"c_title",
":=",
"C",
".",
"CString",
"(",
"title",
")",
"\n\n",
"var",
"native",
"*",
"C",
".",
"GtkFileChooserNative",
"\n\n",
"native",
... |
3,998 | all-3999 | [
"DeepCopyInto",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"writing",
"into",
"out",
".",
"in",
"must",
"be",
"non",
"-",
"nil",
"."
] | [
"func",
"(",
"in",
"Targets",
")",
"DeepCopyInto",
"(",
"out",
"*",
"Targets",
")",
"{",
"{",
"in",
":=",
"&",
"in",
"\n",
"*",
"out",
"=",
"make",
"(",
"Targets",
",",
"len",
"(",
"*",
"in",
")",
")",
"\n",
"<mask>",
"(",
"*",
"out",
",",
"*... |
3,999 | all-4000 | [
"TODO",
"(",
"prashantv",
")",
":",
"Clean",
"up",
"json",
".",
"Call",
"*",
"interfaces",
"."
] | [
"func",
"wrapCall",
"(",
"ctx",
"Context",
",",
"call",
"*",
"tchannel",
".",
"OutboundCall",
",",
"method",
"string",
",",
"arg",
",",
"resp",
"<mask>",
"{",
"}",
")",
"error",
"{",
"var",
"respHeaders",
"map",
"[",
"string",
"]",
"string",
"\n",
"var... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.