id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
1,600 | all-1601 | [
"KeyFromIncomingContext",
"gets",
"the",
"key",
"from",
"the",
"incoming",
"context",
"or",
"returns",
"ErrNoKey"
] | [
"func",
"KeyFromIncomingContext",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"string",
",",
"error",
")",
"{",
"md",
":=",
"MetadataFromIncomingContext",
"(",
"ctx",
")",
"\n",
"return",
"KeyFromMetadata",
"(",
"md",
")",
"\n",
"}"
] |
1,601 | all-1602 | [
"flattenHostNetworkSecurityPolicy",
"reads",
"various",
"fields",
"from",
"a",
"HostNetworkSecurityPolicy",
"into",
"the",
"passed",
"in",
"ResourceData",
"."
] | [
"func",
"flattenHostNetworkSecurityPolicy",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"obj",
"*",
"types",
".",
"HostNetworkSecurityPolicy",
")",
"error",
"{",
"if",
"obj",
".",
"AllowPromiscuous",
"!=",
"nil",
"{",
"d",
".",
"<mask>",
"(",
"\"",
"\... |
1,602 | all-1603 | [
"UnmarshalJSON",
"satisfies",
"json",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"SetEmitTouchEventsForMouseConfiguration",
")",
"UnmarshalJSON",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"error",
"{",
"return",
"easyjson",
".",
"Unmarshal",
"(",
"buf",
",",
"t",
")",
"\n",
"}"
] |
1,603 | all-1604 | [
"parseMatcher",
"returns",
"matcher",
"and",
"name",
"from",
"the",
"given",
"pattern",
"string",
"."
] | [
"func",
"parseMatcher",
"(",
"pat",
"string",
")",
"(",
"matcher",
"Matcher",
",",
"<mask>",
"string",
")",
"{",
"if",
"!",
"isMatchPattern",
"(",
"pat",
")",
"{",
"panic",
"(",
"\"",
"\\\"",
"\"",
"+",
"pat",
"+",
"\"",
"\\\"",
"\"",
")",
"\n",
"}... |
1,604 | all-1605 | [
"Pop",
"implements",
"heap",
"Pop",
"interface"
] | [
"func",
"(",
"ph",
"*",
"peerHeap",
")",
"Pop",
"(",
")",
"interface",
"{",
"}",
"{",
"old",
":=",
"*",
"ph",
"\n",
"n",
":=",
"len",
"(",
"old",
".",
"peerScores",
")",
"\n",
"item",
":=",
"<mask>",
".",
"peerScores",
"[",
"n",
"-",
"1",
"]",
... |
1,605 | all-1606 | [
"secret",
"must",
"be",
"32",
"bytes",
"long",
".",
"Use",
"something",
"like",
"Sha256",
"(",
"Bcrypt",
"(",
"passphrase",
"))",
"The",
"ciphertext",
"is",
"(",
"secretbox",
".",
"Overhead",
"+",
"24",
")",
"bytes",
"longer",
"than",
"the",
"plaintext",
... | [
"func",
"DecryptSymmetric",
"(",
"ciphertext",
"[",
"]",
"byte",
",",
"secret",
"[",
"]",
"byte",
")",
"(",
"plaintext",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"if",
"len",
"(",
"secret",
")",
"!=",
"secretLen",
"{",
"PanicSanity",
"(",
"Fm... |
1,606 | all-1607 | [
"GetClusterFromRemotePeers",
"takes",
"a",
"set",
"of",
"URLs",
"representing",
"etcd",
"peers",
"and",
"attempts",
"to",
"construct",
"a",
"Cluster",
"by",
"accessing",
"the",
"members",
"endpoint",
"on",
"one",
"of",
"these",
"URLs",
".",
"The",
"first",
"UR... | [
"func",
"GetClusterFromRemotePeers",
"(",
"lg",
"*",
"zap",
".",
"Logger",
",",
"urls",
"[",
"]",
"string",
",",
"rt",
"<mask>",
".",
"RoundTripper",
")",
"(",
"*",
"membership",
".",
"RaftCluster",
",",
"error",
")",
"{",
"return",
"getClusterFromRemotePeer... |
1,607 | all-1608 | [
"Sets",
"the",
"given",
"value",
"under",
"the",
"specified",
"key",
"."
] | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Add",
"(",
"p",
"*",
"points",
".",
"Points",
")",
"{",
"s",
":=",
"c",
".",
"settings",
".",
"Load",
"(",
")",
".",
"(",
"*",
"cacheSettings",
")",
"\n\n",
"if",
"s",
".",
"xlog",
"!=",
"nil",
"{",
"p",
... |
1,608 | all-1609 | [
"String",
"returns",
"a",
"human",
"readable",
"string",
"representation",
"of",
"this",
"object"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"String",
"(",
")",
"string",
"{",
"<mask>",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"task",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n",
"return",
"task",
".",
"stringUnsafe",
"(",
")",
"\n",
"}"
... |
1,609 | all-1610 | [
"Apply",
"updates",
"the",
"report",
"with",
"provided",
"paritial",
"stats"
] | [
"func",
"(",
"report",
"*",
"StatsReport",
")",
"Apply",
"(",
"s",
"*",
"Stats",
")",
"{",
"var",
"totalNextPtrs",
"int",
"\n",
"var",
"totalNodes",
"int",
"\n\n",
"report",
".",
"ReadConflicts",
"+=",
"s",
".",
"readConflicts",
"\n",
"report",
".",
"Ins... |
1,610 | all-1611 | [
"Execute",
"-",
"adds",
"a",
"named",
"asg",
"to",
"the",
"configuration"
] | [
"func",
"(",
"c",
"*",
"AddASGToConfigurationCommand",
")",
"Execute",
"(",
"[",
"]",
"string",
")",
"error",
"{",
"c",
".",
"initConfig",
"(",
")",
"\n\n",
"errorString",
":=",
"\"",
"\"",
"\n\n",
"if",
"errorString",
"!=",
"\"",
"\"",
"{",
"return",
... |
1,611 | all-1612 | [
"BTCAddrFromPubKeyBytes",
"returns",
"a",
"B58",
"encoded",
"Bitcoin",
"mainnet",
"address",
"."
] | [
"func",
"BTCAddrFromPubKeyBytes",
"(",
"pubKeyBytes",
"[",
"]",
"<mask>",
")",
"string",
"{",
"versionPrefix",
":=",
"btcPrefixPubKeyHash",
"// TODO Make const or configurable",
"\n",
"h160",
":=",
"CalcHash160",
"(",
"pubKeyBytes",
")",
"\n",
"h160",
"=",
"append",
... |
1,612 | all-1613 | [
"TokenSource",
"returns",
"a",
"oauth2",
".",
"TokenSource",
"for",
"the",
"Google",
"Service",
"Account",
"using",
"the",
"provided",
"context",
"and",
"scopes",
".",
"The",
"resulting",
"token",
"source",
"should",
"be",
"wrapped",
"with",
"oauth2",
".",
"Re... | [
"func",
"(",
"gsa",
"*",
"GServiceAccount",
")",
"TokenSource",
"(",
"ctxt",
"context",
".",
"<mask>",
",",
"scopes",
"...",
"string",
")",
"(",
"*",
"bearer",
".",
"Bearer",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n\n",
"// simple check that requ... |
1,613 | all-1614 | [
"check",
"returns",
"true",
"if",
"all",
"of",
"the",
"tags",
"are",
"true",
".",
"Tags",
"that",
"start",
"with",
"!",
"are",
"negated",
"(",
"but",
"!!",
")",
"is",
"not",
"allowed",
".",
"Go",
"release",
"tags",
"(",
"e",
".",
"g",
".",
"go1",
... | [
"func",
"(",
"g",
"tagGroup",
")",
"check",
"(",
"c",
"*",
"config",
".",
"Config",
",",
"os",
",",
"arch",
"string",
")",
"bool",
"{",
"goConf",
":=",
"getGoConfig",
"(",
"c",
")",
"\n",
"for",
"_",
",",
"t",
":=",
"range",
"g",
"{",
"if",
"st... |
1,614 | all-1615 | [
"DeleteConfig",
"deletes",
"an",
"existing",
"config",
"if",
"it",
"exists",
"or",
"fail",
"otherwise"
] | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"DeleteConfig",
"(",
"name",
"string",
")",
"error",
"{",
"return",
"s",
".",
"configs",
".",
"Delete",
"(",
"name",
")",
"\n",
"}"
] |
1,615 | all-1616 | [
"ForwardWordEnds",
"is",
"a",
"wrapper",
"around",
"gtk_text_iter_forward_word_ends",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TextIter",
")",
"ForwardWordEnds",
"(",
"v1",
"int",
")",
"bool",
"{",
"<mask>",
"gobool",
"(",
"C",
".",
"gtk_text_iter_forward_word_ends",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"v1",
")",
")",
")",
... |
1,616 | all-1617 | [
"Do",
"the",
"same",
"thing",
"as",
"fmt",
".",
"Sprintf",
"except",
"it",
"uses",
"the",
"optimal",
"precition",
"for",
"floats",
":",
"(",
"0",
"-",
"3",
")",
"for",
"f",
"and",
"(",
"0",
"-",
"6",
")",
"for",
"F",
"eg",
".",
":",
"optiSprintf"... | [
"func",
"optiSprintf",
"(",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"string",
"{",
"chunks",
":=",
"strings",
".",
"Split",
"(",
"format",
",",
"\"",
"\"",
")",
"\n",
"newChunks",
":=",
"make",
"(",
"[",
"]",
"string",
",",
... |
1,617 | all-1618 | [
"Using",
"the",
"classic",
"API",
"posts",
"a",
"count",
"of",
"1",
"to",
"a",
"stat",
"."
] | [
"func",
"(",
"r",
"*",
"BasicReporter",
")",
"PostCountOne",
"(",
"statKey",
",",
"userKey",
"<mask>",
")",
"error",
"{",
"return",
"r",
".",
"PostCount",
"(",
"statKey",
",",
"userKey",
",",
"1",
")",
"\n",
"}"
] |
1,618 | all-1619 | [
"GetEventSize",
"returns",
"the",
"EventSize",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"GetEventSize",
"(",
")",
"<mask>",
"{",
"if",
"w",
"==",
"nil",
"||",
"w",
".",
"EventSize",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"w",
".",
"EventSize",
"\n",
"}"
] |
1,619 | all-1620 | [
"CreateFromType",
"creates",
"an",
"instance",
"of",
"the",
"given",
"type"
] | [
"func",
"(",
"di",
"*",
"dependencyInjector",
")",
"CreateFromType",
"(",
"atype",
"reflect",
".",
"<mask>",
")",
"reflect",
".",
"Value",
"{",
"if",
"di",
".",
"caching",
"{",
"return",
"di",
".",
"cachedCreateFromType",
"(",
"atype",
")",
"\n",
"}",
"e... |
1,620 | all-1621 | [
"HasMetricQuery",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"ToplistRequest",
")",
"HasMetricQuery",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"MetricQuery",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
1,621 | all-1622 | [
"HasTitleAlign",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"h",
"*",
"HeatmapDefinition",
")",
"HasTitleAlign",
"(",
")",
"bool",
"{",
"if",
"h",
"!=",
"nil",
"&&",
"h",
".",
"TitleAlign",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
1,622 | all-1623 | [
"Get",
"the",
"storage",
"."
] | [
"func",
"(",
"s",
"*",
"ReadyStorage",
")",
"Get",
"(",
")",
"*",
"tsdb",
".",
"<mask>",
"{",
"if",
"x",
":=",
"s",
".",
"get",
"(",
")",
";",
"x",
"!=",
"nil",
"{",
"return",
"x",
".",
"db",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
1,623 | all-1624 | [
"Next",
"would",
"return",
"the",
"next",
"integer",
"in",
"the",
"sequence",
"updating",
"the",
"lease",
"by",
"running",
"a",
"transaction",
"if",
"needed",
"."
] | [
"func",
"(",
"seq",
"*",
"Sequence",
")",
"Next",
"(",
")",
"(",
"uint64",
",",
"error",
")",
"{",
"seq",
".",
"Lock",
"(",
")",
"\n",
"defer",
"seq",
".",
"Unlock",
"(",
")",
"\n",
"if",
"seq",
".",
"next",
">=",
"seq",
".",
"leased",
"{",
"... |
1,624 | all-1625 | [
"Set",
"sets",
"the",
"specified",
"key",
"/",
"value",
"pair",
"in",
"the",
"subresource",
"."
] | [
"func",
"(",
"r",
"*",
"Subresource",
")",
"Set",
"(",
"key",
"string",
",",
"value",
"interface",
"{",
"}",
")",
"{",
"if",
"v",
":=",
"structure",
".",
"NormalizeValue",
"(",
"value",
")",
";",
"v",
"!=",
"nil",
"{",
"r",
".",
"data",
"[",
"<ma... |
1,625 | all-1626 | [
"Attaches",
"a",
"shader",
"object",
"to",
"a",
"program",
"object"
] | [
"func",
"AttachShader",
"(",
"program",
"uint32",
",",
"shader",
"uint32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpAttachShader",
",",
"2",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"shader",
")",
",",
"0",
")",
"\n",
"}"
] |
1,626 | all-1627 | [
"Reset",
"reinitializes",
"canvas",
":",
"set",
"clipping",
"rectangle",
"to",
"the",
"whole",
"terminal",
"window",
"clears",
"clip",
"and",
"color",
"saved",
"data",
"sets",
"colors",
"to",
"default",
"ones"
] | [
"func",
"Reset",
"(",
")",
"{",
"canvas",
".",
"<mask>",
",",
"canvas",
".",
"height",
"=",
"term",
".",
"Size",
"(",
")",
"\n",
"canvas",
".",
"clipX",
",",
"canvas",
".",
"clipY",
"=",
"0",
",",
"0",
"\n",
"canvas",
".",
"clipW",
",",
"canvas",... |
1,627 | all-1628 | [
"UnmarshalJSON",
"satisfies",
"json",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"VersionRunningStatus",
")",
"UnmarshalJSON",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"error",
"{",
"return",
"easyjson",
".",
"Unmarshal",
"(",
"buf",
",",
"t",
")",
"\n",
"}"
] |
1,628 | all-1629 | [
"Loads",
"the",
"registry",
"configuration",
"file",
"from",
"the",
"filesystem",
"and",
"then",
"unmarshals",
"it",
".",
"Returns",
"the",
"unmarshalled",
"object",
"."
] | [
"func",
"loadRegistryConf",
"(",
"configPath",
"string",
")",
"(",
"*",
"tomlConfig",
",",
"error",
")",
"{",
"config",
":=",
"&",
"tomlConfig",
"{",
"}",
"\n\n",
"configBytes",
",",
"err",
":=",
"readConf",
"(",
"configPath",
")",
"\n",
"if",
"err",
"!=... |
1,629 | all-1630 | [
"Asset",
"get",
"content",
"with",
"name",
"from",
"assetfs"
] | [
"func",
"(",
"<mask>",
"*",
"AssetFileSystem",
")",
"Asset",
"(",
"name",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"for",
"_",
",",
"pth",
":=",
"range",
"fs",
".",
"paths",
"{",
"if",
"_",
",",
"err",
":=",
"os",
".",
"Sta... |
1,630 | all-1631 | [
"goPackageName",
"guesses",
"the",
"identifier",
"in",
"package",
"declarations",
"at",
"the",
"top",
"of",
"the",
".",
"pb",
".",
"go",
"files",
"that",
"will",
"be",
"generated",
"for",
"this",
"package",
".",
"is",
"returned",
"if",
"the",
"package",
"n... | [
"func",
"goPackageName",
"(",
"pkg",
"*",
"Package",
")",
"string",
"{",
"if",
"opt",
",",
"<mask>",
":=",
"pkg",
".",
"Options",
"[",
"\"",
"\"",
"]",
";",
"ok",
"{",
"if",
"i",
":=",
"strings",
".",
"IndexByte",
"(",
"opt",
",",
"';'",
")",
";"... |
1,631 | all-1632 | [
"L",
"accumulates",
"a",
"single",
"line",
"of",
"source",
"code",
"."
] | [
"func",
"(",
"b",
"*",
"Buffer",
")",
"L",
"(",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"b",
".",
"buf",
",",
"<mask>",
",",
"a",
"...",
")",
"\n",
"b",
".",
"N",
"(",
")",
"\n",
"}"... |
1,632 | all-1633 | [
"Callers",
"returns",
"a",
"Trace",
"for",
"the",
"current",
"goroutine",
"with",
"element",
"0",
"identifying",
"the",
"calling",
"function",
"."
] | [
"func",
"Callers",
"(",
")",
"Trace",
"{",
"pcs",
":=",
"poolBuf",
"(",
")",
"\n",
"pcs",
"=",
"pcs",
"[",
":",
"cap",
"(",
"pcs",
")",
"]",
"\n",
"n",
":=",
"runtime",
".",
"Callers",
"(",
"2",
",",
"pcs",
")",
"\n",
"cs",
":=",
"make",
"(",... |
1,633 | all-1634 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventCacheStorageListUpdated",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage9",
"(",
"&",
"w",
",",
... |
1,634 | all-1635 | [
"ParseRetentionDefs",
"parses",
"retention",
"definitions",
"into",
"a",
"Retentions",
"structure"
] | [
"func",
"ParseRetentionDefs",
"(",
"retentionDefs",
"string",
")",
"(",
"whisper",
".",
"Retentions",
",",
"error",
")",
"{",
"retentions",
":=",
"make",
"(",
"whisper",
".",
"Retentions",
",",
"0",
")",
"\n",
"for",
"_",
",",
"retentionDef",
":=",
"range"... |
1,635 | all-1636 | [
"HasWidth",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"WidgetLayout",
")",
"HasWidth",
"(",
")",
"bool",
"{",
"if",
"w",
"!=",
"nil",
"&&",
"w",
".",
"Width",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
1,636 | all-1637 | [
"VisitAll",
"calls",
"f",
"for",
"each",
"header",
".",
"f",
"must",
"not",
"retain",
"references",
"to",
"key",
"and",
"/",
"or",
"value",
"after",
"returning",
".",
"Copy",
"key",
"and",
"/",
"or",
"value",
"contents",
"before",
"returning",
"if",
"you... | [
"func",
"(",
"h",
"*",
"ResponseHeader",
")",
"VisitAll",
"(",
"f",
"func",
"(",
"key",
",",
"value",
"[",
"]",
"byte",
")",
")",
"{",
"if",
"len",
"(",
"h",
".",
"contentLengthBytes",
")",
">",
"0",
"{",
"f",
"(",
"strContentLength",
",",
"h",
"... |
1,637 | all-1638 | [
"Write",
"sends",
"n",
"bytes",
"from",
"p",
"to",
"the",
"server",
".",
"Note",
"that",
"Write",
"can",
"only",
"be",
"used",
"for",
"sending",
"TELNET",
"(",
"and",
"TELNETS",
")",
"data",
"to",
"the",
"server",
".",
"TELNET",
"(",
"and",
"TELNETS",
... | [
"func",
"(",
"clientConn",
"*",
"Conn",
")",
"Write",
"(",
"p",
"[",
"]",
"<mask>",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"return",
"clientConn",
".",
"dataWriter",
".",
"Write",
"(",
"p",
")",
"\n",
"}"
] |
1,638 | all-1639 | [
"Execute",
"takes",
"a",
"TemplateMsg",
"and",
"applies",
"it",
"to",
"the",
"Go",
"template",
".",
"If",
"colorize",
"is",
"true",
"the",
"template",
"will",
"insert",
"ANSI",
"color",
"codes",
"within",
"the",
"resulting",
"string",
"."
] | [
"func",
"(",
"t",
"*",
"Template",
")",
"Execute",
"(",
"<mask>",
"*",
"TemplateMsg",
",",
"colorize",
"bool",
")",
"(",
"string",
",",
"error",
")",
"{",
"tplLevel",
":=",
"msg",
".",
"Level",
"\n",
"if",
"!",
"colorize",
"{",
"tplLevel",
"=",
"Leve... |
1,639 | all-1640 | [
"Ensure",
"that",
"the",
"container",
"s",
"policy",
"namespace",
"is",
"unloaded",
"to",
"free",
"kernel",
"memory",
".",
"This",
"does",
"not",
"delete",
"the",
"policy",
"from",
"disk",
"or",
"cache",
"."
] | [
"func",
"AADestroy",
"(",
"c",
"container",
")",
"error",
"{",
"state",
":=",
"c",
".",
"DaemonState",
"(",
")",
"\n",
"if",
"!",
"state",
".",
"OS",
".",
"AppArmorAdmin",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"if",
"state",
".",
"OS",
".",
"App... |
1,640 | all-1641 | [
"ListTeams",
"gets",
"a",
"list",
"of",
"teams",
"for",
"the",
"given",
"org",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"teams",
"/",
"#list",
"-",
"teams"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListTeams",
"(",
"org",
"string",
")",
"(",
"[",
"]",
"Team",
",",
"error",
")",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"org",
")",
"\n",
"if",
"c",
".",
"fake",
"{",
"return",
"nil",
",",
"nil",
... |
1,641 | all-1642 | [
"Get",
"the",
"string",
"representation",
"of",
"the",
"wrapper",
"error",
"or",
"an",
"empty",
"string",
"if",
"wrappedErr",
"is",
"nil"
] | [
"func",
"(",
"e",
"*",
"err",
")",
"wrappedErrStr",
"(",
")",
"string",
"{",
"if",
"e",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"if",
"e",
".",
"wrappedErr",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"e... |
1,642 | all-1643 | [
"checkpointScheduledLeases",
"finds",
"all",
"scheduled",
"lease",
"checkpoints",
"that",
"are",
"due",
"and",
"submits",
"them",
"to",
"the",
"checkpointer",
"to",
"persist",
"them",
"to",
"the",
"consensus",
"log",
"."
] | [
"func",
"(",
"le",
"*",
"lessor",
")",
"checkpointScheduledLeases",
"(",
")",
"{",
"<mask>",
"cps",
"[",
"]",
"*",
"pb",
".",
"LeaseCheckpoint",
"\n\n",
"// rate limit",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"leaseCheckpointRate",
"/",
"2",
";",
"i",
"... |
1,643 | all-1644 | [
"CallErr",
"queues",
"function",
"f",
"on",
"the",
"main",
"thread",
"and",
"returns",
"an",
"error",
"returned",
"by",
"f",
"."
] | [
"func",
"CallErr",
"(",
"f",
"func",
"(",
")",
"error",
")",
"error",
"{",
"checkRun",
"(",
")",
"\n",
"errChan",
":=",
"<mask>",
"(",
"chan",
"error",
")",
"\n",
"callQueue",
"<-",
"func",
"(",
")",
"{",
"errChan",
"<-",
"f",
"(",
")",
"\n",
"}"... |
1,644 | all-1645 | [
"skipRequested",
"posts",
"skipped",
"statuses",
"for",
"the",
"config",
".",
"Presubmits",
"that",
"are",
"requested"
] | [
"func",
"skipRequested",
"(",
"c",
"Client",
",",
"pr",
"*",
"github",
".",
"PullRequest",
",",
"skippedJobs",
"[",
"]",
"config",
".",
"Presubmit",
")",
"error",
"{",
"var",
"errors",
"[",
"]",
"error",
"\n",
"for",
"_",
",",
"job",
":=",
"range",
"... |
1,645 | all-1646 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"LayoutViewport",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage28",
"(",
"&",
"r",
... |
1,646 | all-1647 | [
"helper",
"to",
"update",
"disk",
"metrics"
] | [
"func",
"updateMetrics",
"(",
"interval",
"time",
".",
"Duration",
",",
"diskRoot",
"string",
")",
"{",
"logger",
":=",
"logrus",
".",
"WithField",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"ticker",
":=",
"time",
".",
"NewTicker",
"(",
"interval",
... |
1,647 | all-1648 | [
"batchSetAsync",
"is",
"the",
"asynchronous",
"version",
"of",
"batchSet",
".",
"It",
"accepts",
"a",
"callback",
"function",
"which",
"is",
"called",
"when",
"all",
"the",
"sets",
"are",
"complete",
".",
"If",
"a",
"request",
"level",
"error",
"occurs",
"it... | [
"func",
"(",
"db",
"*",
"<mask>",
")",
"batchSetAsync",
"(",
"entries",
"[",
"]",
"*",
"Entry",
",",
"f",
"func",
"(",
"error",
")",
")",
"error",
"{",
"req",
",",
"err",
":=",
"db",
".",
"sendToWriteCh",
"(",
"entries",
")",
"\n",
"if",
"err",
"... |
1,648 | all-1649 | [
"WithContext",
"adds",
"the",
"context",
"to",
"the",
"find",
"vms",
"by",
"filters",
"params"
] | [
"func",
"(",
"o",
"*",
"FindVmsByFiltersParams",
")",
"WithContext",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"*",
"FindVmsByFiltersParams",
"{",
"o",
".",
"SetContext",
"(",
"ctx",
")",
"\n",
"return",
"o",
"\n",
"}"
] |
1,649 | all-1650 | [
"Update",
"the",
"call",
"with",
"the",
"given",
"data",
".",
"Valid",
"parameters",
"may",
"be",
"found",
"here",
":",
"https",
":",
"//",
"www",
".",
"twilio",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"rest",
"/",
"change",
"-",
"call",
"-",
"st... | [
"func",
"(",
"c",
"*",
"CallService",
")",
"Update",
"(",
"ctx",
"context",
".",
"Context",
",",
"sid",
"string",
",",
"data",
"url",
".",
"Values",
")",
"(",
"*",
"Call",
",",
"error",
")",
"{",
"call",
":=",
"new",
"(",
"Call",
")",
"\n",
"err"... |
1,650 | all-1651 | [
"AllowProjectPermission",
"is",
"a",
"wrapper",
"to",
"check",
"access",
"against",
"the",
"project",
"its",
"features",
"and",
"RBAC",
"permission"
] | [
"func",
"AllowProjectPermission",
"(",
"feature",
"string",
",",
"permission",
"string",
")",
"func",
"(",
"d",
"*",
"Daemon",
",",
"r",
"*",
"http",
".",
"Request",
")",
"<mask>",
"{",
"return",
"func",
"(",
"d",
"*",
"Daemon",
",",
"r",
"*",
"http",
... |
1,651 | all-1652 | [
"IsSlug",
"returns",
"True",
"if",
"provided",
"text",
"does",
"not",
"contain",
"white",
"characters",
"punctuation",
"all",
"letters",
"are",
"lower",
"case",
"and",
"only",
"from",
"ASCII",
"range",
".",
"It",
"could",
"contain",
"-",
"and",
"_",
"but",
... | [
"func",
"IsSlug",
"(",
"text",
"string",
")",
"bool",
"{",
"if",
"text",
"==",
"\"",
"\"",
"||",
"(",
"MaxLength",
">",
"0",
"&&",
"len",
"(",
"text",
")",
">",
"MaxLength",
")",
"||",
"<mask>",
"[",
"0",
"]",
"==",
"'-'",
"||",
"text",
"[",
"0... |
1,652 | all-1653 | [
"NewMongo",
"creates",
"a",
"newinstance",
"of",
"Mongo"
] | [
"func",
"NewMongo",
"(",
"filename",
"string",
",",
"environment",
"string",
")",
"(",
"*",
"Mongo",
",",
"error",
")",
"{",
"ctx",
":=",
"context",
".",
"Background",
"(",
")",
"\n",
"cnf",
",",
"err",
":=",
"GetMongo",
"(",
"filename",
",",
"environm... |
1,653 | all-1654 | [
"deleteOneSignature",
"deletes",
"a",
"signature",
"from",
"url",
"if",
"it",
"exists",
".",
"If",
"it",
"successfully",
"determines",
"that",
"the",
"signature",
"does",
"not",
"exist",
"returns",
"(",
"true",
"nil",
")",
"NOTE",
":",
"Keep",
"this",
"in",
... | [
"func",
"(",
"c",
"*",
"dockerClient",
")",
"deleteOneSignature",
"(",
"url",
"*",
"url",
".",
"URL",
")",
"(",
"missing",
"bool",
",",
"err",
"error",
")",
"{",
"switch",
"url",
".",
"Scheme",
"{",
"case",
"\"",
"\"",
":",
"logrus",
".",
"Debugf",
... |
1,654 | all-1655 | [
"NewMockNetLink",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockNetLink",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockNetLink",
"{",
"mock",
":=",
"&",
"MockNetLink",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockNetLinkMockRecorder",
"{",
"mock",
"}",
"\n"... |
1,655 | all-1656 | [
"Write",
"writes",
"len",
"(",
"p",
")",
"float64",
"values",
"from",
"p",
"to",
"the",
"underlying",
"data",
"stream",
".",
"It",
"returns",
"the",
"number",
"of",
"bytes",
"written",
"from",
"p",
"(",
"0",
"<",
"=",
"n",
"<",
"=",
"len",
"(",
"p"... | [
"func",
"(",
"b",
"*",
"Float64RingBuf",
")",
"Write",
"(",
"p",
"[",
"]",
"float64",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"for",
"{",
"if",
"len",
"(",
"p",
")",
"==",
"0",
"{",
"// nothing (left) to copy in; notice we shorten our",
"/... |
1,656 | all-1657 | [
"HexToHash",
"returns",
"the",
"ethereum",
"s",
"hash",
"represented",
"by",
"the",
"hex",
"of",
"string",
"s",
"."
] | [
"func",
"HexToHash",
"(",
"h",
"HexString",
")",
"(",
"<mask>",
".",
"Hash",
",",
"error",
")",
"{",
"hashBytes",
",",
"err",
":=",
"HexToBytes",
"(",
"h",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"err",
"=",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"... |
1,657 | all-1658 | [
"expandCustomizationGuiRunOnce",
"reads",
"certain",
"ResourceData",
"keys",
"and",
"returns",
"a",
"CustomizationGuiRunOnce",
"."
] | [
"func",
"expandCustomizationGuiRunOnce",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
")",
"*",
"types",
".",
"CustomizationGuiRunOnce",
"{",
"obj",
":=",
"&",
"types",
".",
"CustomizationGuiRunOnce",
"{",
"CommandList",
":",
"structure",
".",
"SliceInterfacesToStr... |
1,658 | all-1659 | [
"GetTopMargin",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_page_setup_get_top_margin",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PageSetup",
")",
"GetTopMargin",
"(",
"<mask>",
"Unit",
")",
"float64",
"{",
"c",
":=",
"C",
".",
"gtk_page_setup_get_top_margin",
"(",
"ps",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkUnit",
"(",
"unit",
")",
")",
"\n",
"re... |
1,659 | all-1660 | [
"HasTitle",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"q",
"*",
"QueryValueDefinition",
")",
"HasTitle",
"(",
")",
"bool",
"{",
"if",
"q",
"!=",
"nil",
"&&",
"q",
".",
"Title",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
1,660 | all-1661 | [
"Sets",
"the",
"output",
"path",
"for",
"generated",
"snapshots",
"."
] | [
"func",
"(",
"t",
"*",
"BTTracer",
")",
"SetOutputPath",
"(",
"path",
"string",
",",
"perm",
"<mask>",
".",
"FileMode",
")",
"error",
"{",
"return",
"nil",
"\n",
"}"
] |
1,661 | all-1662 | [
"Name",
"returns",
"v",
"s",
"name",
"value",
".",
"If",
"v",
".",
"Kind",
"()",
"!",
"=",
"Name",
"Name",
"returns",
"the",
"empty",
"string",
".",
"The",
"returned",
"name",
"does",
"not",
"include",
"the",
"leading",
"slash",
":",
"if",
"v",
"corr... | [
"func",
"(",
"v",
"Value",
")",
"Name",
"(",
")",
"string",
"{",
"x",
",",
"ok",
":=",
"v",
".",
"data",
".",
"(",
"<mask>",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"string",
"(",
"x",
")",
"\n",
"}... |
1,662 | all-1663 | [
"GetLocked",
"returns",
"the",
"Locked",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"o",
"*",
"Options",
")",
"GetLocked",
"(",
")",
"bool",
"{",
"if",
"o",
"==",
"nil",
"||",
"o",
".",
"Locked",
"==",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"o",
".",
"Locked",
"\n",
"}"
] |
1,663 | all-1664 | [
"goValue",
"converts",
"a",
"*",
"Object",
"to",
"a",
"Go",
"type",
"(",
"e",
".",
"g",
".",
"*",
"Object",
"=",
">",
"*",
"gtk",
".",
"Entry",
")",
".",
"It",
"is",
"used",
"in",
"goMarshal",
"to",
"convert",
"generic",
"GObject",
"parameters",
"t... | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"goValue",
"(",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"objType",
":=",
"Type",
"(",
"C",
".",
"_g_type_from_instance",
"(",
"C",
".",
"gpointer",
"(",
"v",
".",
"native",
"(",
")",
")",
")"... |
1,664 | all-1665 | [
"SendMarkdownMsg",
"发送markdown消息,仅支持以下格式",
"/",
"*",
"标题",
"#",
"一级标题",
"##",
"二级标题",
"###",
"三级标题",
"####",
"四级标题",
"#####",
"五级标题",
"######",
"六级标题"
] | [
"func",
"(",
"w",
"*",
"Webhook",
")",
"SendMarkdownMsg",
"(",
"title",
",",
"content",
"string",
",",
"isAtAll",
"bool",
",",
"mobiles",
"...",
"string",
")",
"error",
"{",
"return",
"w",
".",
"SendPayload",
"(",
"&",
"Payload",
"{",
"MsgType",
":",
"... |
1,665 | all-1666 | [
"recvMsg",
"receives",
"a",
"message",
"(",
"possibly",
"dropping",
"a",
"message",
"on",
"full",
"buffers",
")"
] | [
"func",
"(",
"s",
"*",
"Stream",
")",
"recvMsg",
"(",
"msg",
"<mask>",
"{",
"}",
")",
"{",
"s",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"if",
"s",
".",
"recvBuffer",
"==",
"nil",
"{",
"s",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"return",... |
1,666 | all-1667 | [
"Methods",
"returns",
"the",
"methods",
"on",
"this",
"service",
"not",
"including",
"methods",
"from",
"inherited",
"services",
"."
] | [
"func",
"(",
"s",
"*",
"Service",
")",
"Methods",
"(",
")",
"[",
"]",
"*",
"Method",
"{",
"if",
"s",
".",
"methods",
"!=",
"nil",
"{",
"return",
"s",
".",
"methods",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"m",
":=",
"<mask>",
"s",
".",
"Service",
... |
1,667 | all-1668 | [
"initializeSSMSecretResource",
"builds",
"the",
"resource",
"dependency",
"map",
"for",
"the",
"SSM",
"ssmsecret",
"resource"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"initializeSSMSecretResource",
"(",
"credentialsManager",
"credentials",
".",
"<mask>",
",",
"resourceFields",
"*",
"taskresource",
".",
"ResourceFields",
")",
"{",
"ssmSecretResource",
":=",
"ssmsecret",
".",
"NewSSMSecretResour... |
1,668 | all-1669 | [
"NewGoogleClient",
"creates",
"a",
"google",
"client",
"with",
"the",
"given",
"bucket",
"name",
"."
] | [
"func",
"NewGoogleClient",
"(",
"bucket",
"string",
",",
"opts",
"[",
"]",
"option",
".",
"ClientOption",
")",
"(",
"<mask>",
",",
"error",
")",
"{",
"return",
"newGoogleClient",
"(",
"bucket",
",",
"opts",
")",
"\n",
"}"
] |
1,669 | all-1670 | [
"startStream",
"will",
"start",
"a",
"new",
"XML",
"decoder",
"for",
"the",
"connection",
"signal",
"the",
"start",
"of",
"a",
"stream",
"to",
"the",
"server",
"and",
"verify",
"that",
"the",
"server",
"has",
"also",
"started",
"the",
"stream",
";",
"if",
... | [
"func",
"(",
"c",
"*",
"Client",
")",
"startStream",
"(",
"o",
"*",
"Options",
",",
"domain",
"string",
")",
"(",
"*",
"streamFeatures",
",",
"error",
")",
"{",
"if",
"o",
".",
"Debug",
"{",
"c",
".",
"p",
"=",
"xml",
".",
"NewDecoder",
"(",
"tee... |
1,670 | all-1671 | [
"EnsureIndex",
"creates",
"an",
"index",
"on",
"the",
"server",
"if",
"it",
"does",
"not",
"exist",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"EnsureIndex",
"(",
"<mask>",
"*",
"Index",
")",
"error",
"{",
"err",
":=",
"c",
".",
"CreateIndex",
"(",
"index",
")",
"\n",
"if",
"err",
"==",
"ErrIndexExists",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
... |
1,671 | all-1672 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"ResolveNodeParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom11",
"(",
"&",
"r"... |
1,672 | all-1673 | [
"diff",
"is",
"what",
"diffOldNew",
"and",
"diffNewOld",
"hand",
"off",
"to",
"."
] | [
"func",
"(",
"p",
"*",
"tagDiffProcessor",
")",
"diff",
"(",
"a",
",",
"b",
"[",
"]",
"string",
")",
"[",
"]",
"string",
"{",
"var",
"<mask>",
"bool",
"\n",
"c",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
")",
"\n",
"for",
"_",
",",
"v1... |
1,673 | all-1674 | [
"Body",
"creates",
"a",
"view",
"for",
"prow",
"job",
"metadata",
"."
] | [
"func",
"(",
"lens",
"Lens",
")",
"Body",
"(",
"artifacts",
"[",
"]",
"lenses",
".",
"Artifact",
",",
"resourceDir",
"string",
",",
"data",
"string",
")",
"string",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"type",
"MetadataViewData",
"struct",
"{... |
1,674 | all-1675 | [
"expandVMwareUplinkPortOrderPolicy",
"reads",
"certain",
"ResourceData",
"keys",
"and",
"returns",
"a",
"VMwareUplinkPortOrderPolicy",
"."
] | [
"func",
"expandVMwareUplinkPortOrderPolicy",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
")",
"*",
"types",
".",
"VMwareUplinkPortOrderPolicy",
"{",
"obj",
":=",
"&",
"types",
".",
"VMwareUplinkPortOrderPolicy",
"{",
"ActiveUplinkPort",
":",
"structure",
".",
"Sli... |
1,675 | all-1676 | [
"Dereference",
"pointer",
"recursively",
"or",
"return",
"zero",
"value",
".",
"drv",
":",
"the",
"final",
"non",
"-",
"pointer",
"value",
"(",
"which",
"is",
"never",
"invalid",
")",
".",
"isPtr",
":",
"whether",
"rv",
".",
"Kind",
"()",
"==",
"reflect"... | [
"func",
"derefPointersZero",
"(",
"rv",
"reflect",
".",
"<mask>",
")",
"(",
"drv",
"reflect",
".",
"Value",
",",
"isPtr",
"bool",
",",
"isNilPtr",
"bool",
")",
"{",
"for",
"rv",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Ptr",
"{",
"isPtr",
"=",
... |
1,676 | all-1677 | [
"SaveJPEG",
"is",
"a",
"wrapper",
"around",
"gdk_pixbuf_save",
"()",
".",
"Quality",
"is",
"a",
"number",
"between",
"0",
"...",
"100"
] | [
"func",
"(",
"v",
"*",
"Pixbuf",
")",
"SaveJPEG",
"(",
"path",
"string",
",",
"quality",
"int",
")",
"error",
"{",
"cpath",
":=",
"C",
".",
"CString",
"(",
"path",
")",
"\n",
"cquality",
":=",
"C",
".",
"CString",
"(",
"strconv",
".",
"Itoa",
"(",
... |
1,677 | all-1678 | [
"sync",
"function",
"syncs",
"content",
"of",
"latest",
"value",
"log",
"file",
"to",
"disk",
".",
"Syncing",
"of",
"value",
"log",
"directory",
"is",
"not",
"required",
"here",
"as",
"it",
"happens",
"every",
"time",
"a",
"value",
"log",
"file",
"rotation... | [
"func",
"(",
"vlog",
"*",
"valueLog",
")",
"sync",
"(",
"fid",
"uint32",
")",
"error",
"{",
"if",
"vlog",
".",
"<mask>",
".",
"SyncWrites",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"vlog",
".",
"filesLock",
".",
"RLock",
"(",
")",
"\n",
"maxFid",
"... |
1,678 | all-1679 | [
"ToError",
"converts",
"error",
"into",
"Error",
"pointer",
"."
] | [
"func",
"ToError",
"(",
"err",
"error",
")",
"*",
"Error",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"if",
"err",
",",
"ok",
":=",
"err",
".",
"(",
"rpc",
".",
"Error",
")",
";",
"<mask>",
"{",
"return",
"&",
"Erro... |
1,679 | all-1680 | [
"Unregister",
"unregisters",
"a",
"Scheme",
"and",
"all",
"associated",
"aliases",
"."
] | [
"func",
"Unregister",
"(",
"<mask>",
"string",
")",
"*",
"Scheme",
"{",
"scheme",
",",
"ok",
":=",
"schemeMap",
"[",
"name",
"]",
"\n",
"if",
"ok",
"{",
"for",
"_",
",",
"alias",
":=",
"range",
"scheme",
".",
"Aliases",
"{",
"delete",
"(",
"schemeMap... |
1,680 | all-1681 | [
"BytesFilter",
"filters",
"out",
"all",
"bytes",
"where",
"the",
"function",
"does",
"not",
"return",
"true",
"."
] | [
"func",
"BytesFilter",
"(",
"f",
"func",
"(",
"byte",
")",
"bool",
",",
"data",
"[",
"]",
"<mask>",
")",
"[",
"]",
"byte",
"{",
"result",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"0",
",",
"0",
")",
"\n",
"for",
"_",
",",
"element",
":=",
"r... |
1,681 | all-1682 | [
"UUIDsForManagedObjectReferences",
"returns",
"a",
"MOIDForUUIDResults",
"for",
"a",
"list",
"of",
"ManagedObjectReferences",
".",
"If",
"one",
"cannot",
"be",
"found",
"an",
"error",
"is",
"returned",
".",
"There",
"are",
"no",
"partial",
"results",
"returned",
"... | [
"func",
"UUIDsForManagedObjectReferences",
"(",
"client",
"*",
"govmomi",
".",
"Client",
",",
"refs",
"[",
"]",
"types",
".",
"ManagedObjectReference",
")",
"(",
"MOIDForUUIDResults",
",",
"error",
")",
"{",
"var",
"moids",
"[",
"]",
"string",
"\n",
"for",
"... |
1,682 | all-1683 | [
"DeepCopy",
"copies",
"the",
"receiver",
"into",
"a",
"new",
"DateTime",
"."
] | [
"func",
"(",
"t",
"*",
"DateTime",
")",
"DeepCopy",
"(",
")",
"*",
"DateTime",
"{",
"if",
"t",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"<mask>",
"(",
"DateTime",
")",
"\n",
"t",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",... |
1,683 | all-1684 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"StopPreciseCoverageParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoProfiler8",
"(",
"&",
"w",
",",
... |
1,684 | all-1685 | [
"Kebab",
"returns",
"a",
"kebab",
"-",
"cased",
"string",
"with",
"all",
"lowercase",
"letters",
"."
] | [
"func",
"(",
"k",
"*",
"Kace",
")",
"Kebab",
"(",
"s",
"string",
")",
"string",
"{",
"return",
"delimitedCase",
"(",
"s",
",",
"kebabDelim",
",",
"<mask>",
")",
"\n",
"}"
] |
1,685 | all-1686 | [
"New",
"creates",
"a",
"new",
"Args",
"object",
"from",
"the",
"argument",
"list"
] | [
"func",
"New",
"(",
"arguments",
"[",
"]",
"string",
")",
"(",
"*",
"Args",
",",
"error",
")",
"{",
"flagset",
":=",
"<mask>",
".",
"NewFlagSet",
"(",
"\"",
"\"",
",",
"flag",
".",
"ContinueOnError",
")",
"\n\n",
"args",
":=",
"&",
"Args",
"{",
"Ve... |
1,686 | all-1687 | [
"Rebalance",
"the",
"raft",
"cluster",
"trying",
"to",
"see",
"if",
"we",
"have",
"a",
"spare",
"online",
"node",
"that",
"we",
"can",
"promote",
"to",
"database",
"node",
"if",
"we",
"are",
"below",
"membershipMaxRaftNodes",
".",
"If",
"there",
"s",
"such... | [
"func",
"Rebalance",
"(",
"state",
"*",
"state",
".",
"State",
",",
"gateway",
"*",
"Gateway",
")",
"(",
"string",
",",
"[",
"]",
"db",
".",
"RaftNode",
",",
"error",
")",
"{",
"// First get the current raft members, since this method should be",
"// called after ... |
1,687 | all-1688 | [
"EqualsElement",
"returns",
"whether",
"or",
"not",
"two",
"selections",
"of",
"exactly",
"one",
"element",
"refer",
"to",
"the",
"same",
"element",
"."
] | [
"func",
"(",
"s",
"*",
"Selection",
")",
"EqualsElement",
"(",
"other",
"interface",
"{",
"}",
")",
"(",
"bool",
",",
"error",
")",
"{",
"otherSelection",
",",
"ok",
":=",
"other",
".",
"(",
"*",
"Selection",
")",
"\n",
"if",
"!",
"ok",
"{",
"multi... |
1,688 | all-1689 | [
"CreateAuthorizeUrl",
"create",
"the",
"Authorize",
"Url",
"used",
"to",
"redirect",
"users",
"for",
"coinbase",
"app",
"authorization",
".",
"The",
"scope",
"parameter",
"includes",
"the",
"specific",
"permissions",
"one",
"wants",
"to",
"ask",
"from",
"the",
"... | [
"func",
"(",
"o",
"OAuth",
")",
"CreateAuthorizeUrl",
"(",
"scope",
"[",
"]",
"string",
")",
"string",
"{",
"Url",
",",
"_",
":=",
"url",
".",
"Parse",
"(",
"\"",
"\"",
")",
"\n",
"Url",
".",
"Path",
"+=",
"\"",
"\"",
"\n\n",
"parameters",
":=",
... |
1,689 | all-1690 | [
"WriteTimeout",
"sets",
"the",
"connection",
"timeout",
"for",
"write",
"operations",
".",
"A",
"value",
"of",
"0",
"disables",
"the",
"timeout",
"."
] | [
"func",
"(",
"q",
"*",
"<mask>",
")",
"WriteTimeout",
"(",
"timeout",
"time",
".",
"Duration",
")",
"*",
"Query",
"{",
"q",
".",
"writeTimeout",
"=",
"timeout",
"\n",
"return",
"q",
"\n",
"}"
] |
1,690 | all-1691 | [
"CommonLogHandler",
"returns",
"a",
"handler",
"that",
"serves",
"HTTP",
"requests",
"If",
"a",
"logger",
"is",
"not",
"provided",
"stdout",
"will",
"be",
"used"
] | [
"func",
"CommonLogHandler",
"(",
"logger",
"*",
"log",
".",
"Logger",
",",
"templ",
"string",
",",
"h",
"http",
".",
"Handler",
")",
"http",
".",
"<mask>",
"{",
"if",
"logger",
"==",
"nil",
"{",
"logger",
"=",
"log",
".",
"New",
"(",
"os",
".",
"St... |
1,691 | all-1692 | [
"stringUnsafe",
"returns",
"a",
"human",
"readable",
"string",
"representation",
"of",
"this",
"object"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"stringUnsafe",
"(",
")",
"string",
"{",
"res",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"task",
".",
"Family",
",",
"task",
".",
"<mask>",
",",
"task",
".",
"Arn",
",",
"task",
".",
"KnownStatusUnsa... |
1,692 | all-1693 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"StopRuleUsageTrackingReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss6",
"(",
... |
1,693 | all-1694 | [
"NewDataWriter",
"returns",
"a",
"new",
"callback",
"based",
"data",
"buffer"
] | [
"func",
"NewDataWriter",
"(",
"w",
"io",
".",
"<mask>",
")",
"(",
"*",
"Data",
",",
"error",
")",
"{",
"d",
":=",
"newData",
"(",
")",
"\n",
"d",
".",
"w",
"=",
"w",
"\n",
"d",
".",
"cbs",
".",
"write",
"=",
"C",
".",
"gpgme_data_write_cb_t",
"... |
1,694 | all-1695 | [
"FlattenExpr",
"takes",
"an",
"expression",
"that",
"may",
"have",
"been",
"generated",
"from",
"PlatformStrings",
"and",
"returns",
"its",
"values",
"in",
"a",
"flat",
"sorted",
"de",
"-",
"duplicated",
"list",
".",
"Comments",
"are",
"accumulated",
"and",
"d... | [
"func",
"FlattenExpr",
"(",
"e",
"bzl",
".",
"Expr",
")",
"bzl",
".",
"Expr",
"{",
"ps",
",",
"err",
":=",
"extractPlatformStringsExprs",
"(",
"e",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"e",
"\n",
"}",
"\n\n",
"ls",
":=",
"makeListSquas... |
1,695 | all-1696 | [
"Locator",
"returns",
"a",
"locator",
"for",
"the",
"given",
"resource"
] | [
"func",
"(",
"r",
"*",
"<mask>",
")",
"Locator",
"(",
"api",
"*",
"API",
")",
"*",
"SessionLocator",
"{",
"for",
"_",
",",
"l",
":=",
"range",
"r",
".",
"Links",
"{",
"if",
"l",
"[",
"\"",
"\"",
"]",
"==",
"\"",
"\"",
"{",
"return",
"api",
".... |
1,696 | all-1697 | [
"SetCurrentFolder",
"is",
"a",
"wrapper",
"around",
"gtk_file_chooser_set_current_folder",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"FileChooser",
")",
"SetCurrentFolder",
"(",
"folder",
"string",
")",
"bool",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"folder",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
... |
1,697 | all-1698 | [
"FileExists",
"takes",
"a",
"path",
"in",
"the",
"datastore",
"and",
"checks",
"to",
"see",
"if",
"it",
"exists",
".",
"The",
"path",
"should",
"be",
"a",
"bare",
"path",
"not",
"a",
"datastore",
"path",
".",
"Globs",
"are",
"not",
"allowed",
"."
] | [
"func",
"FileExists",
"(",
"ds",
"*",
"object",
".",
"Datastore",
",",
"name",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"files",
",",
"err",
":=",
"SearchDatastore",
"(",
"ds",
",",
"name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"retu... |
1,698 | all-1699 | [
"NewPathSlashesStripper",
"returns",
"path",
"rewriter",
"which",
"strips",
"slashesCount",
"leading",
"slashes",
"from",
"the",
"path",
".",
"Examples",
":",
"*",
"slashesCount",
"=",
"0",
"original",
"path",
":",
"/",
"foo",
"/",
"bar",
"result",
":",
"/",
... | [
"func",
"NewPathSlashesStripper",
"(",
"slashesCount",
"int",
")",
"PathRewriteFunc",
"{",
"return",
"func",
"(",
"ctx",
"*",
"RequestCtx",
")",
"[",
"]",
"byte",
"{",
"return",
"stripLeadingSlashes",
"(",
"ctx",
".",
"<mask>",
"(",
")",
",",
"slashesCount",
... |
1,699 | all-1700 | [
"Timing",
"sends",
"a",
"timing",
"value",
"to",
"a",
"bucket",
"."
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"Timing",
"(",
"bucket",
"string",
",",
"value",
"interface",
"{",
"}",
")",
"{",
"if",
"c",
".",
"skip",
"(",
")",
"{",
"return",
"\n",
"}",
"\n",
"c",
".",
"conn",
".",
"metric",
"(",
"c",
".",
"prefix",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.