id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
20,700 | all-20701 | [
"cvDrawContours",
"(",
"CvArr",
"*",
"img",
"CvSeq",
"*",
"contour",
"CvScalar",
"externalColor",
"CvScalar",
"holeColor",
"int",
"maxLevel",
"int",
"thickness",
"=",
"1",
"int",
"lineType",
"=",
"8"
] | [
"func",
"DrawContours",
"(",
"image",
"*",
"IplImage",
",",
"contours",
"*",
"Seq",
",",
"externalColor",
",",
"holeColor",
"Scalar",
",",
"maxLevel",
",",
"thickness",
",",
"lineType",
"int",
",",
"offset",
"<mask>",
")",
"{",
"C",
".",
"cvDrawContours",
... |
20,701 | all-20702 | [
"String",
"implements",
"the",
"Stringer",
"interface",
"."
] | [
"func",
"(",
"f",
"*",
"ParameterFieldSet",
")",
"String",
"(",
")",
"string",
"{",
"a",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"f",
".",
"fields",
")",
")",
"\n",
"for",
"i",
",",
"f",
":=",
"range",
"f",
".",
"fields",
"{",
... |
20,702 | all-20703 | [
"NewKVListQuery",
"parses",
"a",
"string",
"into",
"a",
"dependency",
"."
] | [
"func",
"NewKVListQuery",
"(",
"s",
"string",
")",
"(",
"*",
"KVListQuery",
",",
"error",
")",
"{",
"if",
"s",
"!=",
"\"",
"\"",
"&&",
"!",
"KVListQueryRe",
".",
"MatchString",
"(",
"s",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\... |
20,703 | all-20704 | [
"Perform",
"a",
"single",
"heartbeat",
"request",
"against",
"the",
"node",
"with",
"the",
"given",
"address",
"."
] | [
"func",
"heartbeatNode",
"(",
"taskCtx",
"context",
".",
"Context",
",",
"address",
"string",
",",
"cert",
"*",
"shared",
".",
"CertInfo",
",",
"raftNodes",
"[",
"]",
"db",
".",
"RaftNode",
")",
"error",
"{",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
"... |
20,704 | all-20705 | [
"AddDialer",
"adds",
"a",
"sub",
"-",
"dialer",
"usable",
"by",
"this",
"dialer",
".",
"Dialers",
"added",
"first",
"will",
"be",
"selected",
"first",
"based",
"on",
"the",
"address",
"."
] | [
"func",
"(",
"d",
"*",
"Dialer",
")",
"AddDialer",
"(",
"pd",
"transport",
".",
"Dialer",
")",
"{",
"d",
".",
"Dialers",
"=",
"<mask>",
"(",
"d",
".",
"Dialers",
",",
"pd",
")",
"\n",
"}"
] |
20,705 | all-20706 | [
"UnmarshalJSON",
"overrides",
"the",
"logic",
"for",
"parsing",
"the",
"JSON",
"-",
"encoded",
"ResourceStatus",
"data"
] | [
"func",
"(",
"vs",
"*",
"VolumeStatus",
")",
"UnmarshalJSON",
"(",
"b",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"strings",
".",
"ToLower",
"(",
"string",
"(",
"b",
")",
")",
"==",
"\"",
"\"",
"{",
"*",
"vs",
"=",
"VolumeStatusNone",
"\n",
"retur... |
20,706 | all-20707 | [
"List",
"returns",
"the",
"insertion",
"-",
"ordered",
"list",
"of",
"dependencies",
"."
] | [
"func",
"(",
"s",
"*",
"Set",
")",
"List",
"(",
")",
"[",
"]",
"Dependency",
"{",
"s",
".",
"RLock",
"(",
")",
"\n",
"defer",
"s",
".",
"RUnlock",
"(",
")",
"\n",
"r",
":=",
"make",
"(",
"[",
"]",
"Dependency",
",",
"len",
"(",
"s",
".",
"l... |
20,707 | all-20708 | [
"duplicate",
"of",
"dockerCPUShares",
"in",
"task_linux",
".",
"go"
] | [
"func",
"(",
"task",
"*",
"<mask>",
")",
"dockerCPUShares",
"(",
"containerCPU",
"uint",
")",
"int64",
"{",
"if",
"containerCPU",
"<=",
"1",
"{",
"seelog",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"task",
".",
"Arn",
",",
"containerCPU",
")",
"\n",
"return... |
20,708 | all-20709 | [
"GetTitle",
"returns",
"the",
"Title",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"d",
"*",
"DashboardLite",
")",
"GetTitle",
"(",
")",
"<mask>",
"{",
"if",
"d",
"==",
"nil",
"||",
"d",
".",
"Title",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"d",
".",
"Title",
"\n",
"}"
] |
20,709 | all-20710 | [
"SetInferenceAccelerators",
"sets",
"the",
"InferenceAccelerators",
"field",
"s",
"value",
"."
] | [
"func",
"(",
"s",
"*",
"RegisterTaskDefinitionInput",
")",
"SetInferenceAccelerators",
"(",
"v",
"[",
"]",
"*",
"InferenceAccelerator",
")",
"*",
"RegisterTaskDefinitionInput",
"{",
"s",
".",
"InferenceAccelerators",
"=",
"v",
"\n",
"<mask>",
"s",
"\n",
"}"
] |
20,710 | all-20711 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetPlatformFontsForNodeParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss38",
"(",
"&",
"w",
",",
"v... |
20,711 | all-20712 | [
"ErrorReportingService",
"is",
"an",
"option",
"that",
"defines",
"the",
"name",
"of",
"the",
"service",
"being",
"tracked",
"for",
"Stackdriver",
"error",
"reporting",
".",
"See",
":",
"https",
":",
"//",
"cloud",
".",
"google",
".",
"com",
"/",
"error",
... | [
"func",
"ErrorReportingService",
"(",
"service",
"string",
")",
"Option",
"{",
"return",
"func",
"(",
"sh",
"*",
"StackdriverHook",
")",
"error",
"{",
"sh",
".",
"errorReportingServiceName",
"=",
"<mask>",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] |
20,712 | all-20713 | [
"AppendBytes",
"appends",
"response",
"header",
"representation",
"to",
"dst",
"and",
"returns",
"the",
"extended",
"dst",
"."
] | [
"func",
"(",
"h",
"*",
"ResponseHeader",
")",
"AppendBytes",
"(",
"dst",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"statusCode",
":=",
"h",
".",
"StatusCode",
"(",
")",
"\n",
"if",
"statusCode",
"<",
"0",
"{",
"statusCode",
"=",
"StatusOK",
"\n",... |
20,713 | all-20714 | [
"TypeURIs",
"-",
"Builds",
"up",
"the",
"type",
"URI",
"based",
"on",
"type",
"e",
".",
"g",
"http",
":",
"//",
"www",
".",
"ft",
".",
"com",
"/",
"ontology",
"/",
"Person"
] | [
"func",
"TypeURIs",
"(",
"labels",
"[",
"]",
"string",
")",
"[",
"]",
"string",
"{",
"var",
"<mask>",
"[",
"]",
"string",
"\n",
"sorted",
",",
"err",
":=",
"SortTypes",
"(",
"labels",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"log",
".",
"Printf",
... |
20,714 | all-20715 | [
"ImageLoad",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockClient",
")",
"ImageLoad",
"(",
"arg0",
"context",
".",
"Context",
",",
"arg1",
"io",
".",
"Reader",
",",
"arg2",
"bool",
")",
"(",
"types",
".",
"ImageLoadResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
... |
20,715 | all-20716 | [
"RemoteURL",
"returns",
"the",
"URL",
"of",
"a",
"remote",
"by",
"its",
"name",
".",
"Or",
"an",
"error",
"if",
"the",
"remote",
"is",
"not",
"declared",
"."
] | [
"func",
"(",
"r",
"*",
"Repository",
")",
"RemoteURL",
"(",
"name",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"config",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"filepath",
".",
"Join",
"(",
"r",
".",
"path",
",",
"\"",
"\"",
")",
... |
20,716 | all-20717 | [
"RemoveImageState",
"removes",
"an",
"image",
".",
"ImageState"
] | [
"func",
"(",
"state",
"*",
"DockerTaskEngineState",
")",
"RemoveImageState",
"(",
"imageState",
"*",
"<mask>",
".",
"ImageState",
")",
"{",
"if",
"imageState",
"==",
"nil",
"{",
"log",
".",
"Debug",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
... |
20,717 | all-20718 | [
"LoadRulesFromFile",
"loads",
"rules",
"from",
"all",
"YAML",
"files",
"inside",
"different",
"directories",
"separated",
"by",
":",
"."
] | [
"func",
"(",
"s",
"*",
"Seekret",
")",
"LoadRulesFromPath",
"(",
"path",
"string",
",",
"defaulEnabled",
"bool",
")",
"error",
"{",
"if",
"path",
"==",
"\"",
"\"",
"{",
"<mask>",
"=",
"DefaultRulesPath",
"(",
")",
"\n",
"}",
"\n",
"dirList",
":=",
"str... |
20,718 | all-20719 | [
"map",
"all",
"or",
"part",
"of",
"a",
"buffer",
"object",
"s",
"data",
"store",
"into",
"the",
"client",
"s",
"address",
"space"
] | [
"func",
"MapBufferRange",
"(",
"target",
"uint32",
",",
"offset",
"int",
",",
"<mask>",
"int",
",",
"access",
"uint32",
")",
"unsafe",
".",
"Pointer",
"{",
"ret",
":=",
"C",
".",
"glowMapBufferRange",
"(",
"gpMapBufferRange",
",",
"(",
"C",
".",
"GLenum",
... |
20,719 | all-20720 | [
"NewReadWriter",
"returns",
"a",
"new",
"ReadWriter",
"with",
"rw",
"as",
"both",
"its",
"source",
"and",
"its",
"sink",
"."
] | [
"func",
"NewReadWriter",
"(",
"rw",
"<mask>",
".",
"ReadWriter",
")",
"ReadWriter",
"{",
"return",
"&",
"readWriter",
"{",
"r",
":",
"rw",
",",
"w",
":",
"rw",
"}",
"\n",
"}"
] |
20,720 | all-20721 | [
"DeleteUser",
"deletes",
"the",
"specified",
"user"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteUser",
"(",
"userid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"umUsersPath",
"(",
"userid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",... |
20,721 | all-20722 | [
"resourceVSphereComputeClusterApplyCustomAttributes",
"processes",
"the",
"custom",
"attributes",
"step",
"for",
"both",
"create",
"and",
"update",
"for",
"vsphere_compute_cluster",
"."
] | [
"func",
"resourceVSphereComputeClusterApplyCustomAttributes",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"meta",
"interface",
"{",
"}",
",",
"cluster",
"*",
"object",
".",
"ClusterComputeResource",
",",
")",
"error",
"{",
"client",
":=",
"meta",
".",
"("... |
20,722 | all-20723 | [
"return",
"parameters",
"of",
"a",
"query",
"object",
"target"
] | [
"func",
"GetQueryiv",
"(",
"target",
"uint32",
",",
"pname",
"uint32",
",",
"params",
"*",
"int32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpGetQueryiv",
",",
"3",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"pname",
")",
",",
"uintptr... |
20,723 | all-20724 | [
"ServerInfo",
"returns",
"details",
"for",
"the",
"server",
"at",
"the",
"time",
"the",
"socket",
"was",
"initially",
"acquired",
"."
] | [
"func",
"(",
"socket",
"*",
"mongoSocket",
")",
"ServerInfo",
"(",
")",
"*",
"mongoServerInfo",
"{",
"<mask>",
".",
"Lock",
"(",
")",
"\n",
"serverInfo",
":=",
"socket",
".",
"serverInfo",
"\n",
"socket",
".",
"Unlock",
"(",
")",
"\n",
"return",
"serverI... |
20,724 | all-20725 | [
"updatePeer",
"updates",
"the",
"score",
"of",
"the",
"peer",
"and",
"update",
"it",
"s",
"position",
"in",
"heap",
"as",
"well",
"."
] | [
"func",
"(",
"ch",
"*",
"<mask>",
")",
"updatePeer",
"(",
"p",
"*",
"Peer",
")",
"{",
"ch",
".",
"peers",
".",
"onPeerChange",
"(",
"p",
")",
"\n",
"ch",
".",
"subChannels",
".",
"updatePeer",
"(",
"p",
")",
"\n",
"p",
".",
"callOnUpdateComplete",
... |
20,725 | all-20726 | [
"AppendPage",
"is",
"a",
"wrapper",
"around",
"gtk_assistant_append_page",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Assistant",
")",
"AppendPage",
"(",
"page",
"IWidget",
")",
"int",
"{",
"c",
":=",
"C",
".",
"gtk_assistant_append_page",
"(",
"v",
".",
"native",
"(",
")",
",",
"<mask>",
".",
"toWidget",
"(",
")",
")",
"\n",
"return",
"int",... |
20,726 | all-20727 | [
"connect",
"appends",
"any",
"necessary",
"Identity",
"Modified",
"UniqueX",
"or",
"UniqueY",
"types",
"to",
"the",
"edit",
"-",
"script",
"to",
"connect",
"p",
".",
"point",
"to",
"dst",
"."
] | [
"func",
"(",
"p",
"*",
"path",
")",
"connect",
"(",
"dst",
"point",
",",
"f",
"EqualFunc",
")",
"{",
"if",
"p",
".",
"dir",
">",
"0",
"{",
"// Connect in forward direction.",
"for",
"dst",
".",
"X",
">",
"p",
".",
"X",
"&&",
"dst",
".",
"Y",
">",... |
20,727 | all-20728 | [
"attach",
"a",
"range",
"of",
"a",
"buffer",
"object",
"s",
"data",
"store",
"to",
"a",
"buffer",
"texture",
"object"
] | [
"func",
"TextureBufferRange",
"(",
"texture",
"uint32",
",",
"internalformat",
"uint32",
",",
"buffer",
"uint32",
",",
"offset",
"int",
",",
"size",
"int",
")",
"{",
"C",
".",
"glowTextureBufferRange",
"(",
"gpTextureBufferRange",
",",
"(",
"C",
".",
"GLuint",... |
20,728 | all-20729 | [
"NewStreamingBytesReader",
"returns",
"an",
"io",
".",
"Reader",
"for",
"a",
"StreamingBytesClient",
"."
] | [
"func",
"NewStreamingBytesReader",
"(",
"streamingBytesClient",
"StreamingBytesClient",
",",
"cancel",
"<mask>",
".",
"CancelFunc",
")",
"io",
".",
"ReadCloser",
"{",
"return",
"&",
"streamingBytesReader",
"{",
"streamingBytesClient",
":",
"streamingBytesClient",
",",
"... |
20,729 | all-20730 | [
"HasLogQuery",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TimeseriesRequest",
")",
"HasLogQuery",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"LogQuery",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
20,730 | all-20731 | [
"Prepend",
"is",
"a",
"wrapper",
"around",
"gtk_menu_shell_prepend",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"MenuShell",
")",
"Prepend",
"(",
"<mask>",
"IMenuItem",
")",
"{",
"C",
".",
"gtk_menu_shell_prepend",
"(",
"v",
".",
"native",
"(",
")",
",",
"child",
".",
"toWidget",
"(",
")",
")",
"\n",
"}"
] |
20,731 | all-20732 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventReceivedMessageFromTarget",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget17",
"(",
"&",
"w",
",",
... |
20,732 | all-20733 | [
"ToMorseCode",
"will",
"format",
"the",
"provided",
"string",
"in",
"Morse",
"Code",
"."
] | [
"func",
"ToMorseCode",
"(",
"theString",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"f",
":=",
"New",
"(",
"theString",
")",
"\n\n",
"if",
"f",
".",
"length",
"<",
"1",
"{",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"lengthEr... |
20,733 | all-20734 | [
"flattenHostNicOrderPolicy",
"reads",
"various",
"fields",
"from",
"a",
"HostNicOrderPolicy",
"into",
"the",
"passed",
"in",
"ResourceData",
"."
] | [
"func",
"flattenHostNicOrderPolicy",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"obj",
"*",
"types",
".",
"HostNicOrderPolicy",
")",
"error",
"{",
"if",
"obj",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"err",
":=",
"d",
".",
"<m... |
20,734 | all-20735 | [
"GetDashboardLists",
"returns",
"a",
"list",
"of",
"all",
"dashboard",
"lists",
"created",
"on",
"this",
"account",
"."
] | [
"func",
"(",
"client",
"*",
"Client",
")",
"GetDashboardLists",
"(",
")",
"(",
"[",
"]",
"DashboardList",
",",
"error",
")",
"{",
"var",
"out",
"reqGetDashboardLists",
"\n",
"if",
"err",
":=",
"<mask>",
".",
"doJsonRequest",
"(",
"\"",
"\"",
",",
"\"",
... |
20,735 | all-20736 | [
"UncompressedDigest",
"returns",
"an",
"uncompressed",
"digest",
"corresponding",
"to",
"anyDigest",
".",
"May",
"return",
"anyDigest",
"if",
"it",
"is",
"known",
"to",
"be",
"uncompressed",
".",
"Returns",
"if",
"nothing",
"is",
"known",
"about",
"the",
"digest... | [
"func",
"(",
"mem",
"*",
"<mask>",
")",
"UncompressedDigest",
"(",
"anyDigest",
"digest",
".",
"Digest",
")",
"digest",
".",
"Digest",
"{",
"mem",
".",
"mutex",
".",
"Lock",
"(",
")",
"\n",
"defer",
"mem",
".",
"mutex",
".",
"Unlock",
"(",
")",
"\n",... |
20,736 | all-20737 | [
"ErrorToStatus",
"translates",
"error",
"into",
"http",
"code"
] | [
"func",
"ErrorToStatus",
"(",
"err",
"error",
")",
"int",
"{",
"switch",
"err",
".",
"(",
"type",
")",
"{",
"default",
":",
"return",
"http",
".",
"StatusInternalServerError",
"\n",
"<mask>",
"*",
"ranch",
".",
"OwnerNotMatch",
":",
"return",
"http",
".",
... |
20,737 | all-20738 | [
"square",
"fills",
"out",
"with",
"square",
"wave",
"values",
"with",
"the",
"specified",
"volume",
"frequency",
"and",
"sequence",
"."
] | [
"func",
"square",
"(",
"out",
"[",
"]",
"int16",
",",
"volume",
"float64",
",",
"freq",
"float64",
",",
"sequence",
"float64",
")",
"{",
"if",
"freq",
"==",
"0",
"{",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"out",
")",
";",
"i",
"++",... |
20,738 | all-20739 | [
"BlobKeyForFile",
"returns",
"a",
"BlobKey",
"for",
"a",
"Google",
"Storage",
"file",
".",
"The",
"filename",
"should",
"be",
"of",
"the",
"form",
"/",
"gs",
"/",
"bucket_name",
"/",
"object_name",
"."
] | [
"func",
"BlobKeyForFile",
"(",
"c",
"context",
".",
"Context",
",",
"filename",
"string",
")",
"(",
"appengine",
".",
"BlobKey",
",",
"error",
")",
"{",
"req",
":=",
"&",
"blobpb",
".",
"CreateEncodedGoogleStorageKeyRequest",
"{",
"Filename",
":",
"&",
"<mas... |
20,739 | all-20740 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetResourceTreeParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage31",
"(",
"&",
"w",
",",
"v",
")... |
20,740 | all-20741 | [
"Publish",
"executes",
"callback",
"defined",
"for",
"a",
"topic",
".",
"Any",
"additional",
"argument",
"will",
"be",
"transferred",
"to",
"the",
"callback",
"."
] | [
"func",
"(",
"bus",
"*",
"EventBus",
")",
"Publish",
"(",
"topic",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"bus",
".",
"lock",
".",
"Lock",
"(",
")",
"// will unlock if handler is not found or always after setUpPublish",
"\n",
"defer",
"... |
20,741 | all-20742 | [
"Pid",
"returns",
"the",
"pid",
"of",
"the",
"child",
"process",
".",
"If",
"no",
"child",
"process",
"exists",
"0",
"is",
"returned",
"."
] | [
"func",
"(",
"c",
"*",
"Child",
")",
"Pid",
"(",
")",
"int",
"{",
"c",
".",
"RLock",
"(",
")",
"\n",
"defer",
"c",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"c",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
20,742 | all-20743 | [
"SetEvaluationDuration",
"updates",
"evaluationDuration",
"to",
"the",
"time",
"in",
"seconds",
"it",
"took",
"to",
"evaluate",
"the",
"rule",
"on",
"its",
"last",
"evaluation",
"."
] | [
"func",
"(",
"rule",
"*",
"RecordingRule",
")",
"SetEvaluationDuration",
"(",
"dur",
"<mask>",
".",
"Duration",
")",
"{",
"rule",
".",
"mtx",
".",
"Lock",
"(",
")",
"\n",
"defer",
"rule",
".",
"mtx",
".",
"Unlock",
"(",
")",
"\n",
"rule",
".",
"evalu... |
20,743 | all-20744 | [
"/",
"*",
"get",
"a",
"uid",
"or",
"gid",
"mapping",
"from",
"/",
"etc",
"/",
"subxid"
] | [
"func",
"getFromShadow",
"(",
"fname",
"string",
",",
"username",
"string",
")",
"(",
"[",
"]",
"[",
"]",
"int64",
",",
"error",
")",
"{",
"entries",
":=",
"[",
"]",
"[",
"]",
"int64",
"{",
"}",
"\n\n",
"f",
",",
"err",
":=",
"os",
".",
"Open",
... |
20,744 | all-20745 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"StartScreencastParams",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage5",
"(",
"&",
... |
20,745 | all-20746 | [
"Scan",
"implements",
"the",
"Scanner",
"interface",
"."
] | [
"func",
"(",
"t",
"*",
"Time",
")",
"Scan",
"(",
"<mask>",
"interface",
"{",
"}",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"switch",
"x",
":=",
"value",
".",
"(",
"type",
")",
"{",
"case",
"time",
".",
"Time",
":",
"t",
".",
"Time",
"=",... |
20,746 | all-20747 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"Value",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility1",
"(",
"&",
"w",
",",
"v",
")",
"\n... |
20,747 | all-20748 | [
"ImageGet",
"gets",
"an",
"Image",
"object",
"from",
"the",
"database",
".",
"If",
"strictMatching",
"is",
"false",
"The",
"fingerprint",
"argument",
"will",
"be",
"queried",
"with",
"a",
"LIKE",
"query",
"means",
"you",
"can",
"pass",
"a",
"shortform",
"and... | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"ImageGet",
"(",
"project",
",",
"fingerprint",
"string",
",",
"public",
"bool",
",",
"strictMatching",
"bool",
")",
"(",
"int",
",",
"*",
"api",
".",
"Image",
",",
"error",
")",
"{",
"err",
":=",
"c",
".",
"T... |
20,748 | all-20749 | [
"vectorSelectorSingle",
"evaluates",
"a",
"instant",
"vector",
"for",
"the",
"iterator",
"of",
"one",
"time",
"series",
"."
] | [
"func",
"(",
"ev",
"*",
"evaluator",
")",
"vectorSelectorSingle",
"(",
"it",
"*",
"storage",
".",
"BufferedSeriesIterator",
",",
"node",
"*",
"VectorSelector",
",",
"ts",
"int64",
")",
"(",
"int64",
",",
"float64",
",",
"bool",
")",
"{",
"refTime",
":=",
... |
20,749 | all-20750 | [
"canonicalizeSubjects",
"applies",
"canonicalizeSubject",
"to",
"a",
"list"
] | [
"func",
"(",
"a",
"*",
"apiServer",
")",
"canonicalizeSubjects",
"(",
"ctx",
"context",
".",
"Context",
",",
"subjects",
"[",
"]",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"if",
"subjects",
"==",
"nil",
"{",
"return",
"[",
"]",... |
20,750 | all-20751 | [
"indent",
"returns",
"the",
"line",
"s",
"indent",
"."
] | [
"func",
"indent",
"(",
"str",
"string",
")",
"int",
"{",
"var",
"i",
"int",
"\n\n",
"for",
"_",
",",
"b",
":=",
"<mask>",
"str",
"{",
"if",
"b",
"!=",
"unicodeSpace",
"{",
"break",
"\n",
"}",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"i",
"... |
20,751 | all-20752 | [
"GetEnableLogsSample",
"returns",
"the",
"EnableLogsSample",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"o",
"*",
"<mask>",
")",
"GetEnableLogsSample",
"(",
")",
"bool",
"{",
"if",
"o",
"==",
"nil",
"||",
"o",
".",
"EnableLogsSample",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"*",
"o",
".",
"EnableLogsSample",
"\n",
"... |
20,752 | all-20753 | [
"Validate",
"validates",
"this",
"error"
] | [
"func",
"(",
"m",
"*",
"Error",
")",
"Validate",
"(",
"formats",
"strfmt",
".",
"Registry",
")",
"error",
"{",
"<mask>",
"res",
"[",
"]",
"error",
"\n\n",
"if",
"err",
":=",
"m",
".",
"validateType",
"(",
"formats",
")",
";",
"err",
"!=",
"nil",
"{... |
20,753 | all-20754 | [
"EnsureRowVisible",
"scrolls",
"the",
"table",
"vertically",
"to",
"make",
"the",
"currently",
"selected",
"row",
"visible"
] | [
"func",
"(",
"l",
"*",
"TableView",
")",
"EnsureRowVisible",
"(",
")",
"{",
"length",
":=",
"l",
".",
"rowCount",
"\n\n",
"hgt",
":=",
"l",
".",
"height",
"-",
"3",
"\n\n",
"if",
"length",
"<=",
"hgt",
"||",
"l",
".",
"selectedRow",
"==",
"-",
"1",... |
20,754 | all-20755 | [
"Returns",
"raw",
"paste",
"text"
] | [
"func",
"(",
"api",
"*",
"API",
")",
"GetPasteTextById",
"(",
"paste_id",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"<mask>",
",",
"err",
":=",
"http",
".",
"Get",
"(",
"\"",
"\"",
"+",
"paste_id",
")",
"\n",
"defer",
"response",
".",
"... |
20,755 | all-20756 | [
"stringFormat",
"given",
"a",
"set",
"of",
"column",
"widths",
"and",
"the",
"number",
"of",
"columns",
"in",
"the",
"current",
"line",
"returns",
"a",
"sprintf",
"-",
"style",
"format",
"string",
"which",
"can",
"be",
"used",
"to",
"print",
"output",
"ali... | [
"func",
"stringFormat",
"(",
"c",
"*",
"Config",
",",
"widths",
"[",
"]",
"int",
",",
"columns",
"int",
")",
"string",
"{",
"// Create the buffer with an estimate of the length",
"buf",
":=",
"bytes",
".",
"NewBuffer",
"(",
"<mask>",
"(",
"[",
"]",
"byte",
"... |
20,756 | all-20757 | [
"GetUpdated",
"retrieves",
"the",
"Updated",
"value",
"from",
"the",
"union",
"returning",
"ok",
"if",
"the",
"union",
"s",
"switch",
"indicated",
"the",
"value",
"is",
"valid",
"."
] | [
"func",
"(",
"u",
"LedgerEntryChange",
")",
"GetUpdated",
"(",
")",
"(",
"result",
"LedgerEntry",
",",
"ok",
"bool",
")",
"{",
"armName",
",",
"_",
":=",
"u",
".",
"ArmForSwitch",
"(",
"int32",
"(",
"u",
".",
"<mask>",
")",
")",
"\n\n",
"if",
"armNam... |
20,757 | all-20758 | [
"KubeClient",
"generates",
"a",
"kube",
"client",
"if",
"it",
"was",
"not",
"created",
"before"
] | [
"func",
"(",
"p",
"*",
"SingletonClientGenerator",
")",
"KubeClient",
"(",
")",
"(",
"kubernetes",
".",
"Interface",
",",
"error",
")",
"{",
"<mask>",
"err",
"error",
"\n",
"p",
".",
"kubeOnce",
".",
"Do",
"(",
"func",
"(",
")",
"{",
"p",
".",
"kubeC... |
20,758 | all-20759 | [
"GetShowCloseButton",
"is",
"a",
"wrapper",
"arounb",
"gtk_search_bar_get_show_close_button",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"SearchBar",
")",
"GetShowCloseButton",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_search_bar_get_show_close_button",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
20,759 | all-20760 | [
"containsNode",
"returns",
"true",
"if",
"the",
"slice",
"nodes",
"contains",
"n"
] | [
"func",
"containsNode",
"(",
"nodes",
"[",
"]",
"*",
"raftNode",
",",
"n",
"*",
"raftNode",
")",
"bool",
"{",
"for",
"_",
",",
"rn",
":=",
"range",
"nodes",
"{",
"if",
"rn",
"==",
"n",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"}",
"\n",
"return"... |
20,760 | all-20761 | [
"Stability",
":",
"***",
"EXPERIMENTAL",
"***",
"TODO",
"See",
"#getCredentials"
] | [
"func",
"(",
"gceProvider",
"*",
"GceProvider",
")",
"GetCredentials",
"(",
")",
"error",
"{",
"cd",
":=",
"tcclient",
".",
"Client",
"(",
"*",
"gceProvider",
")",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"(",
"&",
"<mask>",
")",
".",
"APICall",
"(",
... |
20,761 | all-20762 | [
"Term",
"implements",
"the",
"Storage",
"interface",
"."
] | [
"func",
"(",
"ms",
"*",
"MemoryStorage",
")",
"Term",
"(",
"i",
"uint64",
")",
"(",
"uint64",
",",
"error",
")",
"{",
"ms",
".",
"Lock",
"(",
")",
"\n",
"defer",
"ms",
".",
"Unlock",
"(",
")",
"\n",
"offset",
":=",
"ms",
".",
"ents",
"[",
"0",
... |
20,762 | all-20763 | [
"Debugm",
"executes",
"the",
"same",
"function",
"on",
"the",
"default",
"Base",
"instance"
] | [
"func",
"Debugm",
"(",
"m",
"*",
"Attrs",
",",
"<mask>",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"curDefault",
".",
"Debugm",
"(",
"m",
",",
"msg",
",",
"a",
"...",
")",
"\n",
"}"
] |
20,763 | all-20764 | [
"ACTOR",
"methods",
"NB",
":",
"The",
"conn",
".",
"*",
"fields",
"are",
"only",
"written",
"by",
"the",
"connection",
"actor",
"process",
"which",
"is",
"the",
"caller",
"of",
"the",
"ConnectionAction",
"funs",
".",
"Hence",
"we",
"do",
"not",
"need",
"... | [
"func",
"(",
"conn",
"*",
"LocalConnection",
")",
"shutdown",
"(",
"err",
"error",
")",
"{",
"// err should always be a real error, even if only io.EOF",
"if",
"err",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"select",
"{",
"<mask>",
... |
20,764 | all-20765 | [
"PutManifest",
"writes",
"manifest",
"to",
"the",
"destination",
".",
"FIXME?",
"This",
"should",
"also",
"receive",
"a",
"MIME",
"type",
"if",
"known",
"to",
"differentiate",
"between",
"schema",
"versions",
".",
"If",
"the",
"destination",
"is",
"in",
"princ... | [
"func",
"(",
"d",
"*",
"dockerImageDestination",
")",
"PutManifest",
"(",
"ctx",
"context",
".",
"Context",
",",
"m",
"[",
"]",
"byte",
")",
"error",
"{",
"digest",
",",
"err",
":=",
"manifest",
".",
"Digest",
"(",
"m",
")",
"\n",
"if",
"err",
"!=",
... |
20,765 | all-20766 | [
"SetBatch",
"takes",
"a",
"map",
"of",
"values",
"and",
"sets",
"the",
"appropriate",
"top",
"-",
"level",
"attributes",
"for",
"each",
"item",
".",
"attrs",
"is",
"a",
"map",
"[",
"string",
"]",
"interface",
"{}",
"that",
"follows",
"a",
"pattern",
"in"... | [
"func",
"SetBatch",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"attrs",
"<mask>",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"error",
"{",
"for",
"k",
",",
"v",
":=",
"range",
"attrs",
"{",
"if",
"err",
":=",
"d",
".",
"Set",
"(",
"k... |
20,766 | all-20767 | [
"coalesceBuckets",
"merges",
"buckets",
"with",
"the",
"same",
"upper",
"bound",
".",
"The",
"input",
"buckets",
"must",
"be",
"sorted",
"."
] | [
"func",
"coalesceBuckets",
"(",
"buckets",
"buckets",
")",
"buckets",
"{",
"last",
":=",
"buckets",
"[",
"0",
"]",
"\n",
"i",
":=",
"0",
"\n",
"for",
"_",
",",
"b",
":=",
"range",
"buckets",
"[",
"1",
":",
"]",
"{",
"if",
"b",
".",
"upperBound",
... |
20,767 | all-20768 | [
"Shutdown",
"will",
"close",
"all",
"connections",
"to",
"backend",
"stores",
"and",
"shutdown",
"any",
"running",
"ring",
"service",
"connector",
".",
"Note",
"that",
"the",
"ReplValueStore",
"can",
"still",
"be",
"used",
"after",
"Shutdown",
"it",
"will",
"j... | [
"func",
"(",
"<mask>",
"*",
"ReplValueStore",
")",
"Shutdown",
"(",
"ctx",
"context",
".",
"Context",
")",
"error",
"{",
"rs",
".",
"ringLock",
".",
"Lock",
"(",
")",
"\n",
"if",
"rs",
".",
"ringServerExitChan",
"!=",
"nil",
"{",
"close",
"(",
"rs",
... |
20,768 | all-20769 | [
"PageDown",
"moves",
"the",
"visible",
"list",
"forward",
"by",
"x",
"items",
".",
"Where",
"x",
"is",
"the",
"size",
"of",
"the",
"visible",
"items",
"on",
"the",
"list",
".",
"The",
"selected",
"item",
"becomes",
"the",
"first",
"visible",
"item",
"."
... | [
"func",
"(",
"l",
"*",
"List",
")",
"PageDown",
"(",
")",
"{",
"start",
":=",
"l",
".",
"start",
"+",
"l",
".",
"size",
"\n",
"<mask>",
":=",
"len",
"(",
"l",
".",
"scope",
")",
"-",
"l",
".",
"size",
"\n\n",
"switch",
"{",
"case",
"len",
"("... |
20,769 | all-20770 | [
"AcceleratorValid",
"is",
"a",
"wrapper",
"around",
"gtk_accelerator_valid",
"()",
"."
] | [
"func",
"AcceleratorValid",
"(",
"key",
"uint",
",",
"mods",
"gdk",
".",
"ModifierType",
")",
"bool",
"{",
"return",
"gobool",
"(",
"C",
".",
"gtk_accelerator_valid",
"(",
"C",
".",
"guint",
"(",
"<mask>",
")",
",",
"C",
".",
"GdkModifierType",
"(",
"mod... |
20,770 | all-20771 | [
"BoxNew",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_box_new",
"()",
"."
] | [
"func",
"BoxNew",
"(",
"orientation",
"Orientation",
",",
"spacing",
"int",
")",
"(",
"*",
"Box",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gtk_box_new",
"(",
"C",
".",
"GtkOrientation",
"(",
"orientation",
")",
",",
"C",
".",
"gint",
"(",
"spac... |
20,771 | all-20772 | [
"Returns",
"an",
"slice",
"of",
"strings",
"or",
"the",
"specified",
"slice",
"if",
"the",
"key",
"doesn",
"t",
"exist",
"or",
"isn",
"t",
"a",
"valid",
"[]",
"string"
] | [
"func",
"(",
"t",
"Typed",
")",
"StringsOr",
"(",
"key",
"string",
",",
"d",
"[",
"]",
"string",
")",
"[",
"]",
"string",
"{",
"n",
",",
"ok",
":=",
"t",
".",
"StringsIf",
"(",
"key",
")",
"\n",
"if",
"<mask>",
"{",
"return",
"n",
"\n",
"}",
... |
20,772 | all-20773 | [
"Bool",
"defines",
"a",
"bool",
"flag",
"with",
"specified",
"name",
"default",
"value",
"and",
"usage",
"string",
".",
"The",
"return",
"value",
"is",
"the",
"address",
"of",
"a",
"bool",
"variable",
"that",
"stores",
"the",
"value",
"of",
"the",
"flag",
... | [
"func",
"Bool",
"(",
"name",
"string",
",",
"value",
"bool",
",",
"usage",
"string",
")",
"*",
"bool",
"{",
"return",
"EnvironmentFlags",
".",
"Bool",
"(",
"name",
",",
"<mask>",
",",
"usage",
")",
"\n",
"}"
] |
20,773 | all-20774 | [
"Exists",
"check",
"whether",
"current",
"Docker",
"image",
"is",
"available",
"."
] | [
"func",
"(",
"s",
"*",
"Image",
")",
"Exists",
"(",
")",
"bool",
"{",
"out",
",",
"err",
":=",
"s",
".",
"docker",
".",
"Run",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
... |
20,774 | all-20775 | [
"ForModule",
"returns",
"an",
"OldLogger",
"instance",
".",
"OldLogger",
"is",
"deprecated",
"and",
"kept",
"for",
"compatibility",
"reasons",
".",
"Prefer",
"using",
"Seelog",
"directly",
"."
] | [
"func",
"ForModule",
"(",
"module",
"string",
")",
"OldLogger",
"{",
"<mask>",
".",
"Do",
"(",
"initLogger",
")",
"\n",
"return",
"logger",
".",
"New",
"(",
"\"",
"\"",
",",
"module",
")",
"\n",
"}"
] |
20,775 | all-20776 | [
"LoadFile",
"loads",
"a",
"build",
"file",
"from",
"disk",
"parses",
"it",
"and",
"scans",
"for",
"rules",
"and",
"load",
"statements",
".",
"The",
"syntax",
"tree",
"within",
"the",
"returned",
"File",
"will",
"be",
"modified",
"by",
"editing",
"methods",
... | [
"func",
"LoadFile",
"(",
"path",
",",
"pkg",
"string",
")",
"(",
"*",
"File",
",",
"error",
")",
"{",
"data",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",... |
20,776 | all-20777 | [
"NewRouteMap",
"initializes",
"and",
"returns",
"a",
"new",
"routeMap",
"."
] | [
"func",
"NewRouteMap",
"(",
")",
"*",
"routeMap",
"{",
"rm",
":=",
"&",
"routeMap",
"{",
"routes",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"<mask>",
"[",
"string",
"]",
"*",
"Leaf",
")",
",",
"}",
"\n",
"for",
"m",
":=",
"range",
"_HTTP_METHOD... |
20,777 | all-20778 | [
"NewDomainFilter",
"returns",
"a",
"new",
"DomainFilter",
"given",
"a",
"comma",
"separated",
"list",
"of",
"domains"
] | [
"func",
"NewDomainFilter",
"(",
"domainFilters",
"[",
"]",
"string",
")",
"DomainFilter",
"{",
"filters",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"domainFilters",
")",
")",
"\n\n",
"// user can define filter domains either with trailing dot or without,... |
20,778 | all-20779 | [
"NewECSClient",
"creates",
"a",
"new",
"ECSClient",
"interface",
"object"
] | [
"func",
"NewECSClient",
"(",
"credentialProvider",
"*",
"credentials",
".",
"Credentials",
",",
"config",
"*",
"config",
".",
"Config",
",",
"ec2MetadataClient",
"ec2",
".",
"EC2MetadataClient",
")",
"api",
".",
"ECSClient",
"{",
"var",
"ecsConfig",
"aws",
".",
... |
20,779 | all-20780 | [
"MakeRaw",
"put",
"the",
"terminal",
"connected",
"to",
"the",
"given",
"file",
"descriptor",
"into",
"raw",
"mode",
"and",
"returns",
"the",
"previous",
"state",
"of",
"the",
"terminal",
"so",
"that",
"it",
"can",
"be",
"restored",
"."
] | [
"func",
"MakeRaw",
"(",
"fd",
"int",
")",
"(",
"*",
"State",
",",
"error",
")",
"{",
"<mask>",
"err",
"error",
"\n",
"var",
"oldState",
",",
"newState",
"*",
"State",
"\n\n",
"oldState",
",",
"err",
"=",
"GetState",
"(",
"fd",
")",
"\n",
"if",
"err... |
20,780 | all-20781 | [
"SignHTTPRequest",
"signs",
"an",
"http",
".",
"Request",
"struct",
"with",
"authv4",
"using",
"the",
"given",
"region",
"service",
"and",
"credentials",
"."
] | [
"func",
"SignHTTPRequest",
"(",
"req",
"*",
"http",
".",
"Request",
",",
"region",
",",
"service",
"string",
",",
"creds",
"*",
"credentials",
".",
"Credentials",
",",
"body",
"io",
".",
"ReadSeeker",
")",
"error",
"{",
"signer",
":=",
"v4",
".",
"NewSig... |
20,781 | all-20782 | [
"Parse",
"processes",
"the",
"given",
"command",
"line",
"option",
"storing",
"the",
"results",
"in",
"the",
"field",
"of",
"the",
"structs",
"from",
"which",
"NewParser",
"was",
"constructed"
] | [
"func",
"(",
"p",
"*",
"<mask>",
")",
"Parse",
"(",
"args",
"[",
"]",
"string",
")",
"error",
"{",
"// If -h or --help were specified then print usage",
"for",
"_",
",",
"arg",
":=",
"range",
"args",
"{",
"if",
"arg",
"==",
"\"",
"\"",
"||",
"arg",
"==",... |
20,782 | all-20783 | [
"ContainsFunc",
"iterates",
"all",
"the",
"items",
"in",
"the",
"set",
"and",
"passes",
"each",
"to",
"f",
".",
"It",
"returns",
"true",
"the",
"first",
"time",
"a",
"call",
"to",
"f",
"returns",
"true",
"and",
"false",
"if",
"no",
"call",
"to",
"f",
... | [
"func",
"(",
"s",
"*",
"Set",
")",
"ContainsFunc",
"(",
"f",
"func",
"(",
"<mask>",
"{",
"}",
")",
"bool",
")",
"bool",
"{",
"s",
".",
"RLock",
"(",
")",
"\n",
"defer",
"s",
".",
"RUnlock",
"(",
")",
"\n",
"for",
"k",
":=",
"range",
"s",
".",... |
20,783 | all-20784 | [
"FindChild",
"returns",
"control",
"if",
"it",
"is",
"a",
"child",
"of",
"the",
"parent",
"and",
"nil",
"otherwise"
] | [
"func",
"FindChild",
"(",
"parent",
",",
"control",
"Control",
")",
"Control",
"{",
"var",
"res",
"Control",
"\n\n",
"if",
"parent",
"==",
"control",
"{",
"return",
"parent",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"ctrl",
":=",
"range",
"parent",
".",
"Ch... |
20,784 | all-20785 | [
"GetMetricQuery",
"returns",
"the",
"MetricQuery",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"q",
"*",
"QueryValueRequest",
")",
"GetMetricQuery",
"(",
")",
"<mask>",
"{",
"if",
"q",
"==",
"nil",
"||",
"q",
".",
"MetricQuery",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"q",
".",
"MetricQuery",
"\n",
... |
20,785 | all-20786 | [
"ParseDuration",
"parses",
"a",
"duration",
"from",
"a",
"string",
"compatible",
"with",
"scala",
"duration",
"syntax"
] | [
"func",
"ParseDuration",
"(",
"cand",
"string",
")",
"(",
"time",
".",
"Duration",
",",
"error",
")",
"{",
"if",
"dur",
",",
"err",
":=",
"time",
".",
"ParseDuration",
"(",
"cand",
")",
";",
"err",
"==",
"nil",
"{",
"return",
"dur",
",",
"nil",
"\n... |
20,786 | all-20787 | [
"GetAttr",
"gets",
"the",
"value",
"of",
"the",
"attribute",
"with",
"the",
"provided",
"name",
".",
"If",
"the",
"attribute",
"does",
"not",
"exist",
"nil",
"will",
"be",
"returned"
] | [
"func",
"(",
"a",
"*",
"Attrs",
")",
"GetAttr",
"(",
"<mask>",
"string",
")",
"interface",
"{",
"}",
"{",
"a",
".",
"attrsLock",
".",
"RLock",
"(",
")",
"\n",
"defer",
"a",
".",
"attrsLock",
".",
"RUnlock",
"(",
")",
"\n\n",
"return",
"a",
".",
"... |
20,787 | all-20788 | [
"ForwardedResponseIfVolumeIsRemote",
"redirects",
"a",
"request",
"to",
"the",
"node",
"hosting",
"the",
"volume",
"with",
"the",
"given",
"pool",
"ID",
"name",
"and",
"type",
".",
"If",
"the",
"container",
"is",
"local",
"nothing",
"gets",
"done",
"and",
"nil... | [
"func",
"ForwardedResponseIfVolumeIsRemote",
"(",
"d",
"*",
"Daemon",
",",
"r",
"*",
"<mask>",
".",
"Request",
",",
"poolID",
"int64",
",",
"volumeName",
"string",
",",
"volumeType",
"int",
")",
"Response",
"{",
"if",
"queryParam",
"(",
"r",
",",
"\"",
"\"... |
20,788 | all-20789 | [
"SetTransitionDuration",
"is",
"a",
"wrapper",
"around",
"gtk_revealer_set_transition_duration",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Revealer",
")",
"SetTransitionDuration",
"(",
"duration",
"uint",
")",
"{",
"C",
".",
"gtk_revealer_set_transition_duration",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"guint",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
20,789 | all-20790 | [
"title",
":",
"token",
"info",
"path",
":",
"/",
"tokens",
"/",
"{",
"token_id",
"}",
"method",
":",
"GET",
"produce",
":",
"application",
"/",
"json",
"responses",
":",
"200",
":",
"Get",
"token",
"401",
":",
"Unauthorized"
] | [
"func",
"tokenInfo",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"t",
"auth",
".",
"Token",
")",
"error",
"{",
"tokenID",
":=",
"r",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
... |
20,790 | all-20791 | [
"MatchHref",
"returns",
"true",
"if",
"the",
"given",
"href",
"matches",
"one",
"of",
"the",
"action",
"s",
"href",
"patterns",
"exactly"
] | [
"func",
"(",
"a",
"*",
"Action",
")",
"MatchHref",
"(",
"href",
"string",
")",
"bool",
"{",
"hrefs",
":=",
"[",
"]",
"string",
"{",
"href",
",",
"href",
"+",
"\"",
"\"",
"}",
"\n",
"for",
"_",
",",
"pattern",
":=",
"range",
"a",
".",
"PathPattern... |
20,791 | all-20792 | [
"Set",
"is",
"required",
"for",
"kingpin",
"interfaces",
"to",
"allow",
"command",
"line",
"params",
"to",
"be",
"set",
"to",
"our",
"map",
"datatype"
] | [
"func",
"(",
"o",
"*",
"ListInt8Option",
")",
"Set",
"(",
"value",
"string",
")",
"error",
"{",
"val",
":=",
"Int8Option",
"{",
"}",
"\n",
"val",
".",
"<mask>",
"(",
"value",
")",
"\n",
"*",
"o",
"=",
"append",
"(",
"*",
"o",
",",
"val",
")",
"... |
20,792 | all-20793 | [
"ValidateJSON",
"validates",
"a",
"given",
"JSON",
"against",
"a",
"given",
"schema",
"."
] | [
"func",
"ValidateJSON",
"(",
"schema",
",",
"data",
"[",
"]",
"byte",
")",
"bool",
"{",
"sloader",
":=",
"gojsonschema",
".",
"NewBytesLoader",
"(",
"schema",
")",
"\n",
"dloader",
":=",
"gojsonschema",
".",
"NewBytesLoader",
"(",
"data",
")",
"\n",
"<mask... |
20,793 | all-20794 | [
"saveDB",
"copies",
"the",
"v3",
"backend",
"and",
"strips",
"cluster",
"information",
"."
] | [
"func",
"saveDB",
"(",
"destDB",
",",
"srcDB",
"string",
",",
"idx",
"uint64",
",",
"v3",
"bool",
")",
"{",
"// open src db to safely copy db state",
"if",
"v3",
"{",
"var",
"src",
"*",
"bolt",
".",
"DB",
"\n",
"ch",
":=",
"make",
"(",
"chan",
"*",
"bo... |
20,794 | all-20795 | [
"DesiredTerminal",
"returns",
"true",
"if",
"the",
"cgroup",
"s",
"desired",
"status",
"is",
"REMOVED"
] | [
"func",
"(",
"cgroup",
"*",
"CgroupResource",
")",
"DesiredTerminal",
"(",
")",
"bool",
"{",
"cgroup",
".",
"<mask>",
".",
"RLock",
"(",
")",
"\n",
"defer",
"cgroup",
".",
"lock",
".",
"RUnlock",
"(",
")",
"\n\n",
"return",
"cgroup",
".",
"desiredStatusU... |
20,795 | all-20796 | [
"SaveDBFrom",
"saves",
"snapshot",
"of",
"the",
"database",
"from",
"the",
"given",
"reader",
".",
"It",
"guarantees",
"the",
"save",
"operation",
"is",
"atomic",
"."
] | [
"func",
"(",
"s",
"*",
"Snapshotter",
")",
"SaveDBFrom",
"(",
"r",
"io",
".",
"Reader",
",",
"id",
"uint64",
")",
"(",
"int64",
",",
"error",
")",
"{",
"start",
":=",
"time",
".",
"Now",
"(",
")",
"\n\n",
"f",
",",
"err",
":=",
"ioutil",
".",
"... |
20,796 | all-20797 | [
"Split",
"a",
"non",
"-",
"contiguous",
"(",
"i",
".",
"e",
".",
"comma",
"-",
"separated",
")",
"sequence",
"into",
"a",
"list",
"of",
"sequences",
"that",
"each",
"use",
"consistent",
"stepping"
] | [
"func",
"(",
"s",
"*",
"FileSequence",
")",
"Split",
"(",
")",
"FileSequences",
"{",
"if",
"s",
".",
"frameSet",
"==",
"nil",
"{",
"// Return a copy",
"return",
"FileSequences",
"{",
"s",
".",
"Copy",
"(",
")",
"}",
"\n",
"}",
"\n\n",
"franges",
":=",
... |
20,797 | all-20798 | [
"RunGitHookServer",
"starts",
"the",
"webhook",
"server"
] | [
"func",
"RunGitHookServer",
"(",
"address",
"string",
",",
"etcdAddress",
"string",
",",
"etcdPrefix",
"string",
")",
"error",
"{",
"c",
",",
"err",
":=",
"client",
".",
"NewFromAddress",
"(",
"address",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... |
20,798 | all-20799 | [
"ActivateChannel",
"tries",
"to",
"activate",
"a",
"given",
"channel",
"."
] | [
"func",
"(",
"p",
"*",
"Processor",
")",
"ActivateChannel",
"(",
"<mask>",
",",
"jobCreator",
"string",
",",
"agent",
"bool",
")",
"(",
"string",
",",
"error",
")",
"{",
"var",
"jobType",
"string",
"\n",
"if",
"agent",
"{",
"jobType",
"=",
"data",
".",... |
20,799 | all-20800 | [
"compressGoroutine",
"reads",
"all",
"input",
"from",
"src",
"and",
"writes",
"its",
"compressed",
"equivalent",
"to",
"dest",
"."
] | [
"func",
"compressGoroutine",
"(",
"dest",
"*",
"io",
".",
"PipeWriter",
",",
"src",
"io",
".",
"Reader",
")",
"{",
"err",
":=",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"defer",
"func",
"(",
")",
"{",
"// Note that this is not the same as {defer d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.