id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
1,000 | all-1001 | [
"MarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Marshaler",
"."
] | [
"func",
"(",
"t",
"OrientationType",
")",
"MarshalEasyJSON",
"(",
"out",
"*",
"jwriter",
".",
"<mask>",
")",
"{",
"out",
".",
"String",
"(",
"string",
"(",
"t",
")",
")",
"\n",
"}"
] |
1,001 | all-1002 | [
"Create",
"creates",
"a",
"new",
"cgroup",
"based",
"off",
"the",
"spec",
"post",
"validation"
] | [
"func",
"(",
"c",
"*",
"control",
")",
"Create",
"(",
"cgroupSpec",
"*",
"Spec",
")",
"(",
"cgroups",
".",
"Cgroup",
",",
"error",
")",
"{",
"// Validate incoming spec",
"err",
":=",
"validateCgroupSpec",
"(",
"cgroupSpec",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"<mask>",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// Create cgroup",
"seelog",
".",
"Infof",
"(",
"\"",
"\"",
",",
"cgroupSpec",
".",
"Root",
")",
"\n",
"controller",
",",
"err",
":=",
"c",
".",
"New",
"(",
"cgroups",
".",
"V1",
",",
"cgroups",
".",
"StaticPath",
"(",
"cgroupSpec",
".",
"Root",
")",
",",
"cgroupSpec",
".",
"Specs",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"controller",
",",
"nil",
"\n",
"}"
] |
1,002 | all-1003 | [
"copy",
"a",
"one",
"-",
"dimensional",
"texture",
"subimage"
] | [
"func",
"CopyTextureSubImage1D",
"(",
"texture",
"uint32",
",",
"level",
"int32",
",",
"xoffset",
"int32",
",",
"x",
"int32",
",",
"y",
"int32",
",",
"width",
"int32",
")",
"{",
"C",
".",
"glowCopyTextureSubImage1D",
"(",
"gpCopyTextureSubImage1D",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"texture",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"<mask>",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"xoffset",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"x",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"y",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"width",
")",
")",
"\n",
"}"
] |
1,003 | all-1004 | [
"Do",
"executes",
"DOM",
".",
"removeNode",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"RemoveNodeParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandRemoveNode",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
1,004 | all-1005 | [
"GetClusterMembers",
"returns",
"the",
"current",
"members",
"of",
"the",
"cluster"
] | [
"func",
"(",
"r",
"*",
"ProtocolLXD",
")",
"GetClusterMembers",
"(",
")",
"(",
"[",
"]",
"api",
".",
"ClusterMember",
",",
"error",
")",
"{",
"if",
"!",
"r",
".",
"HasExtension",
"(",
"\"",
"\"",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
")",
"\n",
"}",
"\n\n",
"<mask>",
":=",
"[",
"]",
"api",
".",
"ClusterMember",
"{",
"}",
"\n",
"_",
",",
"err",
":=",
"r",
".",
"queryStruct",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"\"",
"\"",
",",
"&",
"members",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"members",
",",
"nil",
"\n",
"}"
] |
1,005 | all-1006 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"StreamFormat",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"StreamFormat",
"(",
"in",
".",
"<mask>",
"(",
")",
")",
"{",
"case",
"StreamFormatJSON",
":",
"*",
"t",
"=",
"StreamFormatJSON",
"\n",
"case",
"StreamFormatProto",
":",
"*",
"t",
"=",
"StreamFormatProto",
"\n\n",
"default",
":",
"in",
".",
"AddError",
"(",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"}"
] |
1,006 | all-1007 | [
"signatureStorageURL",
"returns",
"an",
"URL",
"usable",
"for",
"acessing",
"signature",
"index",
"in",
"base",
"with",
"known",
"manifestDigest",
"or",
"nil",
"if",
"not",
"applicable",
".",
"Returns",
"nil",
"iff",
"base",
"==",
"nil",
".",
"NOTE",
":",
"Keep",
"this",
"in",
"sync",
"with",
"docs",
"/",
"signature",
"-",
"protocols",
".",
"md!"
] | [
"func",
"signatureStorageURL",
"(",
"base",
"signatureStorageBase",
",",
"manifestDigest",
"digest",
".",
"Digest",
",",
"index",
"int",
")",
"*",
"url",
".",
"URL",
"{",
"if",
"base",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"url",
":=",
"*",
"<mask>",
"\n",
"url",
".",
"Path",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"url",
".",
"Path",
",",
"manifestDigest",
".",
"Algorithm",
"(",
")",
",",
"manifestDigest",
".",
"Hex",
"(",
")",
",",
"index",
"+",
"1",
")",
"\n",
"return",
"&",
"url",
"\n",
"}"
] |
1,007 | all-1008 | [
"GetTitleOk",
"returns",
"a",
"tuple",
"with",
"the",
"Title",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TimeseriesDefinition",
")",
"GetTitleOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"t",
"==",
"nil",
"||",
"t",
".",
"Title",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"t",
".",
"Title",
",",
"true",
"\n",
"}"
] |
1,008 | all-1009 | [
"ProjectGet",
"returns",
"the",
"project",
"with",
"the",
"given",
"key",
"."
] | [
"func",
"(",
"c",
"*",
"ClusterTx",
")",
"ProjectGet",
"(",
"name",
"string",
")",
"(",
"*",
"api",
".",
"Project",
",",
"error",
")",
"{",
"filter",
":=",
"ProjectFilter",
"{",
"}",
"\n",
"filter",
".",
"Name",
"=",
"name",
"\n\n",
"objects",
",",
"err",
":=",
"c",
".",
"ProjectList",
"(",
"filter",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"switch",
"len",
"(",
"objects",
")",
"{",
"case",
"0",
":",
"return",
"nil",
",",
"ErrNoSuchObject",
"\n",
"<mask>",
"1",
":",
"return",
"&",
"objects",
"[",
"0",
"]",
",",
"nil",
"\n",
"default",
":",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}"
] |
1,009 | all-1010 | [
"GetAccount",
"returns",
"the",
"Account",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"c",
"*",
"ChannelSlackRequest",
")",
"GetAccount",
"(",
")",
"<mask>",
"{",
"if",
"c",
"==",
"nil",
"||",
"c",
".",
"Account",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"c",
".",
"Account",
"\n",
"}"
] |
1,010 | all-1011 | [
"native",
"()",
"returns",
"a",
"pointer",
"to",
"the",
"underlying",
"GSettingsBackend",
"."
] | [
"func",
"(",
"v",
"*",
"SettingsBackend",
")",
"native",
"(",
")",
"*",
"C",
".",
"GSettingsBackend",
"{",
"if",
"v",
"==",
"nil",
"||",
"v",
".",
"GObject",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"<mask>",
"C",
".",
"toGSettingsBackend",
"(",
"unsafe",
".",
"Pointer",
"(",
"v",
".",
"GObject",
")",
")",
"\n",
"}"
] |
1,011 | all-1012 | [
"getProfileContent",
"generates",
"the",
"apparmor",
"profile",
"template",
"from",
"the",
"given",
"container",
".",
"This",
"includes",
"the",
"stock",
"lxc",
"includes",
"as",
"well",
"as",
"stuff",
"from",
"raw",
".",
"apparmor",
"."
] | [
"func",
"getAAProfileContent",
"(",
"c",
"container",
")",
"string",
"{",
"profile",
":=",
"strings",
".",
"TrimLeft",
"(",
"AA_PROFILE_BASE",
",",
"\"",
"\\n",
"\"",
")",
"\n\n",
"// Apply new features",
"if",
"aaParserSupports",
"(",
"\"",
"\"",
")",
"{",
"profile",
"+=",
"`\n ### Feature: unix\n # Allow receive via unix sockets from anywhere\n unix (receive),\n\n # Allow all unix in the container\n unix peer=(label=@{profile_name}),\n`",
"\n",
"}",
"\n\n",
"// Apply cgns bits",
"if",
"shared",
".",
"PathExists",
"(",
"\"",
"\"",
")",
"{",
"<mask>",
"+=",
"\"",
"\\n",
"\\n",
"\"",
"\n",
"profile",
"+=",
"\"",
"\\n",
"\"",
"\n",
"profile",
"+=",
"\"",
"\\n",
"\"",
"\n",
"}",
"\n\n",
"state",
":=",
"c",
".",
"DaemonState",
"(",
")",
"\n",
"if",
"state",
".",
"OS",
".",
"AppArmorStacking",
"&&",
"!",
"state",
".",
"OS",
".",
"AppArmorStacked",
"{",
"profile",
"+=",
"\"",
"\\n",
"\\n",
"\"",
"\n",
"profile",
"+=",
"` ### Configuration: apparmor profile loading (in namespace)\n deny /sys/k[^e]*{,/**} wklx,\n deny /sys/ke[^r]*{,/**} wklx,\n deny /sys/ker[^n]*{,/**} wklx,\n deny /sys/kern[^e]*{,/**} wklx,\n deny /sys/kerne[^l]*{,/**} wklx,\n deny /sys/kernel/[^s]*{,/**} wklx,\n deny /sys/kernel/s[^e]*{,/**} wklx,\n deny /sys/kernel/se[^c]*{,/**} wklx,\n deny /sys/kernel/sec[^u]*{,/**} wklx,\n deny /sys/kernel/secu[^r]*{,/**} wklx,\n deny /sys/kernel/secur[^i]*{,/**} wklx,\n deny /sys/kernel/securi[^t]*{,/**} wklx,\n deny /sys/kernel/securit[^y]*{,/**} wklx,\n deny /sys/kernel/security/[^a]*{,/**} wklx,\n deny /sys/kernel/security/a[^p]*{,/**} wklx,\n deny /sys/kernel/security/ap[^p]*{,/**} wklx,\n deny /sys/kernel/security/app[^a]*{,/**} wklx,\n deny /sys/kernel/security/appa[^r]*{,/**} wklx,\n deny /sys/kernel/security/appar[^m]*{,/**} wklx,\n deny /sys/kernel/security/apparm[^o]*{,/**} wklx,\n deny /sys/kernel/security/apparmo[^r]*{,/**} wklx,\n deny /sys/kernel/security/apparmor?*{,/**} wklx,\n deny /sys/kernel/security?*{,/**} wklx,\n deny /sys/kernel?*{,/**} wklx,\n`",
"\n",
"profile",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\\n",
"\"",
",",
"AANamespace",
"(",
"c",
")",
")",
"\n",
"profile",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\\n",
"\"",
",",
"AANamespace",
"(",
"c",
")",
")",
"\n",
"}",
"else",
"{",
"profile",
"+=",
"\"",
"\\n",
"\\n",
"\"",
"\n",
"profile",
"+=",
"\"",
"\\n",
"\"",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"IsNesting",
"(",
")",
"{",
"// Apply nesting bits",
"profile",
"+=",
"\"",
"\\n",
"\\n",
"\"",
"\n",
"profile",
"+=",
"strings",
".",
"TrimLeft",
"(",
"AA_PROFILE_NESTING",
",",
"\"",
"\\n",
"\"",
")",
"\n",
"if",
"!",
"state",
".",
"OS",
".",
"AppArmorStacking",
"||",
"state",
".",
"OS",
".",
"AppArmorStacked",
"{",
"profile",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\\n",
"\"",
",",
"AAProfileFull",
"(",
"c",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"!",
"c",
".",
"IsPrivileged",
"(",
")",
"||",
"state",
".",
"OS",
".",
"RunningInUserNS",
"{",
"// Apply unprivileged bits",
"profile",
"+=",
"\"",
"\\n",
"\\n",
"\"",
"\n",
"profile",
"+=",
"strings",
".",
"TrimLeft",
"(",
"AA_PROFILE_UNPRIVILEGED",
",",
"\"",
"\\n",
"\"",
")",
"\n",
"}",
"\n\n",
"// Append raw.apparmor",
"rawApparmor",
",",
"ok",
":=",
"c",
".",
"ExpandedConfig",
"(",
")",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"ok",
"{",
"profile",
"+=",
"\"",
"\\n",
"\\n",
"\"",
"\n",
"for",
"_",
",",
"line",
":=",
"range",
"strings",
".",
"Split",
"(",
"strings",
".",
"Trim",
"(",
"rawApparmor",
",",
"\"",
"\\n",
"\"",
")",
",",
"\"",
"\\n",
"\"",
")",
"{",
"profile",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\n",
"\"",
",",
"line",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"`#include <tunables/global>\nprofile \"%s\" flags=(attach_disconnected,mediate_deleted) {\n%s\n}\n`",
",",
"AAProfileFull",
"(",
"c",
")",
",",
"strings",
".",
"Trim",
"(",
"profile",
",",
"\"",
"\\n",
"\"",
")",
")",
"\n",
"}"
] |
1,012 | all-1013 | [
"Publish",
"sends",
"a",
"mesage",
"to",
"every",
"client",
"in",
"a",
"streamID"
] | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"Publish",
"(",
"id",
"string",
",",
"event",
"*",
"Event",
")",
"{",
"s",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"s",
".",
"Streams",
"[",
"id",
"]",
"!=",
"nil",
"{",
"s",
".",
"Streams",
"[",
"id",
"]",
".",
"event",
"<-",
"s",
".",
"process",
"(",
"event",
")",
"\n",
"}",
"\n",
"}"
] |
1,013 | all-1014 | [
"Read",
"field",
"key",
"."
] | [
"func",
"decodeFieldNumberAndTyp3",
"(",
"bz",
"[",
"]",
"<mask>",
")",
"(",
"num",
"uint32",
",",
"typ",
"Typ3",
",",
"n",
"int",
",",
"err",
"error",
")",
"{",
"// Read uvarint value.",
"var",
"value64",
"=",
"uint64",
"(",
"0",
")",
"\n",
"value64",
",",
"n",
",",
"err",
"=",
"DecodeUvarint",
"(",
"bz",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"// Decode first typ3 byte.",
"typ",
"=",
"Typ3",
"(",
"value64",
"&",
"0x07",
")",
"\n\n",
"// Decode num.",
"var",
"num64",
"uint64",
"\n",
"num64",
"=",
"value64",
">>",
"3",
"\n",
"if",
"num64",
">",
"(",
"1",
"<<",
"29",
"-",
"1",
")",
"{",
"err",
"=",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"num64",
")",
"\n",
"return",
"\n",
"}",
"\n",
"num",
"=",
"uint32",
"(",
"num64",
")",
"\n",
"return",
"\n",
"}"
] |
1,014 | all-1015 | [
"doSerialize",
"handles",
"the",
"auth",
"logic",
"with",
"permissions",
"checked",
"by",
"chk",
"for",
"a",
"serialized",
"request",
"get",
".",
"Returns",
"a",
"non",
"-",
"nil",
"error",
"on",
"authentication",
"failure",
"."
] | [
"func",
"(",
"s",
"*",
"EtcdServer",
")",
"doSerialize",
"(",
"ctx",
"context",
".",
"<mask>",
",",
"chk",
"func",
"(",
"*",
"auth",
".",
"AuthInfo",
")",
"error",
",",
"get",
"func",
"(",
")",
")",
"error",
"{",
"ai",
",",
"err",
":=",
"s",
".",
"AuthInfoFromCtx",
"(",
"ctx",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"ai",
"==",
"nil",
"{",
"// chk expects non-nil AuthInfo; use empty credentials",
"ai",
"=",
"&",
"auth",
".",
"AuthInfo",
"{",
"}",
"\n",
"}",
"\n",
"if",
"err",
"=",
"chk",
"(",
"ai",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"// fetch response for serialized request",
"get",
"(",
")",
"\n",
"// check for stale token revision in case the auth store was updated while",
"// the request has been handled.",
"if",
"ai",
".",
"Revision",
"!=",
"0",
"&&",
"ai",
".",
"Revision",
"!=",
"s",
".",
"authStore",
".",
"Revision",
"(",
")",
"{",
"return",
"auth",
".",
"ErrAuthOldRevision",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
1,015 | all-1016 | [
"Encodes",
"e",
"to",
"buf",
".",
"Returns",
"number",
"of",
"bytes",
"written",
"."
] | [
"func",
"encodeEntry",
"(",
"e",
"*",
"Entry",
",",
"buf",
"*",
"bytes",
".",
"Buffer",
")",
"(",
"int",
",",
"error",
")",
"{",
"h",
":=",
"header",
"{",
"klen",
":",
"uint32",
"(",
"len",
"(",
"e",
".",
"Key",
")",
")",
",",
"vlen",
":",
"uint32",
"(",
"len",
"(",
"e",
".",
"Value",
")",
")",
",",
"expiresAt",
":",
"e",
".",
"ExpiresAt",
",",
"meta",
":",
"e",
".",
"meta",
",",
"userMeta",
":",
"e",
".",
"UserMeta",
",",
"}",
"\n\n",
"var",
"headerEnc",
"[",
"headerBufSize",
"]",
"byte",
"\n",
"h",
".",
"Encode",
"(",
"headerEnc",
"[",
":",
"]",
")",
"\n\n",
"hash",
":=",
"crc32",
".",
"New",
"(",
"y",
".",
"CastagnoliCrcTable",
")",
"\n\n",
"buf",
".",
"Write",
"(",
"headerEnc",
"[",
":",
"]",
")",
"\n",
"<mask>",
".",
"Write",
"(",
"headerEnc",
"[",
":",
"]",
")",
"\n\n",
"buf",
".",
"Write",
"(",
"e",
".",
"Key",
")",
"\n",
"hash",
".",
"Write",
"(",
"e",
".",
"Key",
")",
"\n\n",
"buf",
".",
"Write",
"(",
"e",
".",
"Value",
")",
"\n",
"hash",
".",
"Write",
"(",
"e",
".",
"Value",
")",
"\n\n",
"var",
"crcBuf",
"[",
"crc32",
".",
"Size",
"]",
"byte",
"\n",
"binary",
".",
"BigEndian",
".",
"PutUint32",
"(",
"crcBuf",
"[",
":",
"]",
",",
"hash",
".",
"Sum32",
"(",
")",
")",
"\n",
"buf",
".",
"Write",
"(",
"crcBuf",
"[",
":",
"]",
")",
"\n\n",
"return",
"len",
"(",
"headerEnc",
")",
"+",
"len",
"(",
"e",
".",
"Key",
")",
"+",
"len",
"(",
"e",
".",
"Value",
")",
"+",
"len",
"(",
"crcBuf",
")",
",",
"nil",
"\n",
"}"
] |
1,016 | all-1017 | [
"ImageNew",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_image_new",
"()",
"."
] | [
"func",
"ImageNew",
"(",
")",
"(",
"*",
"<mask>",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_image_new",
"(",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"obj",
":=",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"\n",
"return",
"wrapImage",
"(",
"obj",
")",
",",
"nil",
"\n",
"}"
] |
1,017 | all-1018 | [
"NewOCIProvider",
"initialises",
"a",
"new",
"OCI",
"DNS",
"based",
"Provider",
"."
] | [
"func",
"NewOCIProvider",
"(",
"cfg",
"OCIConfig",
",",
"domainFilter",
"DomainFilter",
",",
"zoneIDFilter",
"ZoneIDFilter",
",",
"dryRun",
"bool",
")",
"(",
"*",
"OCIProvider",
",",
"error",
")",
"{",
"var",
"<mask>",
"ociDNSClient",
"\n",
"client",
",",
"err",
":=",
"dns",
".",
"NewDnsClientWithConfigurationProvider",
"(",
"common",
".",
"NewRawConfigurationProvider",
"(",
"cfg",
".",
"Auth",
".",
"TenancyID",
",",
"cfg",
".",
"Auth",
".",
"UserID",
",",
"cfg",
".",
"Auth",
".",
"Region",
",",
"cfg",
".",
"Auth",
".",
"Fingerprint",
",",
"cfg",
".",
"Auth",
".",
"PrivateKey",
",",
"&",
"cfg",
".",
"Auth",
".",
"Passphrase",
",",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"&",
"OCIProvider",
"{",
"client",
":",
"client",
",",
"cfg",
":",
"cfg",
",",
"domainFilter",
":",
"domainFilter",
",",
"zoneIDFilter",
":",
"zoneIDFilter",
",",
"dryRun",
":",
"dryRun",
",",
"}",
",",
"nil",
"\n",
"}"
] |
1,018 | all-1019 | [
"MoveTo",
"skips",
"the",
"current",
"position",
"of",
"the",
"path",
"to",
"the",
"given",
"position",
"(",
"x",
"y",
")",
"without",
"adding",
"any",
"strokes",
"."
] | [
"func",
"(",
"p",
"*",
"Path",
")",
"MoveTo",
"(",
"x",
",",
"y",
"float32",
")",
"{",
"p",
".",
"cur",
"=",
"math",
".",
"Point",
"{",
"x",
",",
"y",
"}",
"\n",
"if",
"len",
"(",
"p",
".",
"segs",
")",
">",
"0",
"&&",
"len",
"(",
"p",
".",
"segs",
"[",
"len",
"(",
"p",
".",
"segs",
")",
"-",
"1",
"]",
")",
"==",
"0",
"{",
"return",
"\n",
"}",
"\n",
"p",
".",
"segs",
"=",
"<mask>",
"(",
"p",
".",
"segs",
",",
"[",
"]",
"math",
".",
"Segment",
"{",
"}",
")",
"\n",
"}"
] |
1,019 | all-1020 | [
"void",
"pango_font_description_set_style",
"(",
"PangoFontDescription",
"*",
"desc",
"PangoStyle",
"style",
")",
";"
] | [
"func",
"(",
"v",
"*",
"FontDescription",
")",
"SetStyle",
"(",
"style",
"Style",
")",
"{",
"C",
".",
"pango_font_description_set_style",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"C",
".",
"PangoStyle",
")",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
1,020 | all-1021 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"ContinueWithAuthParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch12",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
1,021 | all-1022 | [
"GetSharedContext",
"is",
"a",
"wrapper",
"around",
"gdk_gl_context_get_shared_context",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"GLContext",
")",
"GetSharedContext",
"(",
")",
"(",
"*",
"GLContext",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gdk_gl_context_get_shared_context",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n\n",
"return",
"&",
"GLContext",
"{",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"}",
",",
"nil",
"\n",
"}"
] |
1,022 | all-1023 | [
"vimURL",
"returns",
"a",
"URL",
"to",
"pass",
"to",
"the",
"VIM",
"SOAP",
"client",
"."
] | [
"func",
"(",
"c",
"*",
"Config",
")",
"vimURL",
"(",
")",
"(",
"*",
"url",
".",
"URL",
",",
"error",
")",
"{",
"u",
",",
"err",
":=",
"url",
".",
"Parse",
"(",
"\"",
"\"",
"+",
"c",
".",
"VSphereServer",
"+",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"u",
".",
"User",
"=",
"url",
".",
"UserPassword",
"(",
"c",
".",
"<mask>",
",",
"c",
".",
"Password",
")",
"\n\n",
"return",
"u",
",",
"nil",
"\n",
"}"
] |
1,023 | all-1024 | [
"Read",
"is",
"io",
".",
"Reader",
"s",
"Read",
".",
"Read",
"fills",
"the",
"data",
"with",
"sine",
"wave",
"samples",
"."
] | [
"func",
"(",
"s",
"*",
"stream",
")",
"Read",
"(",
"buf",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"if",
"len",
"(",
"s",
".",
"remaining",
")",
">",
"0",
"{",
"n",
":=",
"copy",
"(",
"buf",
",",
"s",
".",
"remaining",
")",
"\n",
"s",
".",
"remaining",
"=",
"s",
".",
"remaining",
"[",
"n",
":",
"]",
"\n",
"return",
"n",
",",
"nil",
"\n",
"}",
"\n\n",
"var",
"origBuf",
"[",
"]",
"byte",
"\n",
"if",
"len",
"(",
"buf",
")",
"%",
"4",
">",
"0",
"{",
"origBuf",
"=",
"buf",
"\n",
"buf",
"=",
"make",
"(",
"[",
"]",
"byte",
",",
"len",
"(",
"origBuf",
")",
"+",
"4",
"-",
"len",
"(",
"origBuf",
")",
"%",
"4",
")",
"\n",
"}",
"\n\n",
"const",
"length",
"=",
"int64",
"(",
"sampleRate",
"/",
"<mask>",
")",
"\n",
"p",
":=",
"s",
".",
"position",
"/",
"4",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"buf",
")",
"/",
"4",
";",
"i",
"++",
"{",
"const",
"max",
"=",
"32767",
"\n",
"b",
":=",
"int16",
"(",
"math",
".",
"Sin",
"(",
"2",
"*",
"math",
".",
"Pi",
"*",
"float64",
"(",
"p",
")",
"/",
"float64",
"(",
"length",
")",
")",
"*",
"max",
")",
"\n",
"buf",
"[",
"4",
"*",
"i",
"]",
"=",
"byte",
"(",
"b",
")",
"\n",
"buf",
"[",
"4",
"*",
"i",
"+",
"1",
"]",
"=",
"byte",
"(",
"b",
">>",
"8",
")",
"\n",
"buf",
"[",
"4",
"*",
"i",
"+",
"2",
"]",
"=",
"byte",
"(",
"b",
")",
"\n",
"buf",
"[",
"4",
"*",
"i",
"+",
"3",
"]",
"=",
"byte",
"(",
"b",
">>",
"8",
")",
"\n",
"p",
"++",
"\n",
"}",
"\n\n",
"s",
".",
"position",
"+=",
"int64",
"(",
"len",
"(",
"buf",
")",
")",
"\n",
"s",
".",
"position",
"%=",
"length",
"*",
"4",
"\n\n",
"if",
"origBuf",
"!=",
"nil",
"{",
"n",
":=",
"copy",
"(",
"origBuf",
",",
"buf",
")",
"\n",
"s",
".",
"remaining",
"=",
"buf",
"[",
"n",
":",
"]",
"\n",
"return",
"n",
",",
"nil",
"\n",
"}",
"\n",
"return",
"len",
"(",
"buf",
")",
",",
"nil",
"\n",
"}"
] |
1,024 | all-1025 | [
"Auto",
"figures",
"out",
"how",
"to",
"render",
"the",
"model",
"based",
"information",
"about",
"the",
"request",
"and",
"the",
"name",
"of",
"the",
"model",
".",
"Auto",
"supports",
"automatic",
"rendering",
"of",
"HTML",
"JSON",
"and",
"XML",
".",
"Any",
"status",
"code",
"give",
"to",
"Context#Render",
"between",
"300",
"-",
"400",
"will",
"be",
"respected",
"by",
"Auto",
".",
"Other",
"status",
"codes",
"are",
"not",
".",
"/",
"*",
"#",
"Rules",
"for",
"HTML",
"template",
"lookup",
":",
"GET",
"/",
"users",
"-",
"users",
"/",
"index",
".",
"html",
"GET",
"/",
"users",
"/",
"id",
"-",
"users",
"/",
"show",
".",
"html",
"GET",
"/",
"users",
"/",
"new",
"-",
"users",
"/",
"new",
".",
"html",
"GET",
"/",
"users",
"/",
"id",
"/",
"edit",
"-",
"users",
"/",
"edit",
".",
"html",
"POST",
"/",
"users",
"-",
"(",
"redirect",
"to",
"/",
"users",
"/",
"id",
"or",
"render",
"user",
"/",
"new",
".",
"html",
")",
"PUT",
"/",
"users",
"/",
"edit",
"-",
"(",
"redirect",
"to",
"/",
"users",
"/",
"id",
"or",
"render",
"user",
"/",
"edit",
".",
"html",
")",
"DELETE",
"/",
"users",
"/",
"id",
"-",
"redirect",
"to",
"/",
"users"
] | [
"func",
"(",
"e",
"*",
"Engine",
")",
"Auto",
"(",
"ctx",
"context",
".",
"Context",
",",
"i",
"interface",
"{",
"}",
")",
"Renderer",
"{",
"<mask>",
",",
"_",
":=",
"ctx",
".",
"Value",
"(",
"\"",
"\"",
")",
".",
"(",
"string",
")",
"\n",
"if",
"ct",
"==",
"\"",
"\"",
"{",
"ct",
"=",
"e",
".",
"DefaultContentType",
"\n",
"}",
"\n",
"ct",
"=",
"strings",
".",
"TrimSpace",
"(",
"strings",
".",
"ToLower",
"(",
"ct",
")",
")",
"\n\n",
"if",
"strings",
".",
"Contains",
"(",
"ct",
",",
"\"",
"\"",
")",
"{",
"return",
"e",
".",
"JSON",
"(",
"i",
")",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"Contains",
"(",
"ct",
",",
"\"",
"\"",
")",
"{",
"return",
"e",
".",
"XML",
"(",
"i",
")",
"\n",
"}",
"\n\n",
"return",
"htmlAutoRenderer",
"{",
"Engine",
":",
"e",
",",
"model",
":",
"i",
",",
"}",
"\n",
"}"
] |
1,025 | all-1026 | [
"RemoveTask",
"indicates",
"an",
"expected",
"call",
"of",
"RemoveTask"
] | [
"func",
"(",
"mr",
"*",
"MockTaskEngineStateMockRecorder",
")",
"RemoveTask",
"(",
"arg0",
"<mask>",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockTaskEngineState",
")",
"(",
"nil",
")",
".",
"RemoveTask",
")",
",",
"arg0",
")",
"\n",
"}"
] |
1,026 | all-1027 | [
"Get",
"checks",
"for",
"a",
"relay",
"item",
"by",
"ID",
"returning",
"the",
"item",
"and",
"a",
"bool",
"indicating",
"whether",
"the",
"item",
"was",
"found",
"."
] | [
"func",
"(",
"r",
"*",
"relayItems",
")",
"Get",
"(",
"id",
"uint32",
")",
"(",
"relayItem",
",",
"bool",
")",
"{",
"r",
".",
"RLock",
"(",
")",
"\n",
"item",
",",
"ok",
":=",
"r",
".",
"items",
"[",
"id",
"]",
"\n",
"r",
".",
"RUnlock",
"(",
")",
"\n\n",
"return",
"item",
",",
"<mask>",
"\n",
"}"
] |
1,027 | all-1028 | [
"canHaveDefaultValue",
"reports",
"whether",
"k",
"is",
"a",
"Kind",
"that",
"we",
"will",
"set",
"a",
"default",
"value",
"for",
".",
"(",
"A",
"signed",
"integer",
"essentially",
".",
")"
] | [
"func",
"canHaveDefaultValue",
"(",
"k",
"reflect",
".",
"Kind",
")",
"bool",
"{",
"switch",
"k",
"{",
"case",
"reflect",
".",
"Int",
",",
"reflect",
".",
"Int8",
",",
"reflect",
".",
"Int16",
",",
"reflect",
".",
"Int32",
",",
"reflect",
".",
"Int64",
":",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
1,028 | all-1029 | [
"Specify",
"the",
"value",
"of",
"a",
"uniform",
"variable",
"for",
"a",
"specified",
"program",
"object"
] | [
"func",
"ProgramUniform4f",
"(",
"program",
"uint32",
",",
"location",
"int32",
",",
"v0",
"float32",
",",
"v1",
"float32",
",",
"v2",
"float32",
",",
"v3",
"float32",
")",
"{",
"C",
".",
"glowProgramUniform4f",
"(",
"gpProgramUniform4f",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"<mask>",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"location",
")",
",",
"(",
"C",
".",
"GLfloat",
")",
"(",
"v0",
")",
",",
"(",
"C",
".",
"GLfloat",
")",
"(",
"v1",
")",
",",
"(",
"C",
".",
"GLfloat",
")",
"(",
"v2",
")",
",",
"(",
"C",
".",
"GLfloat",
")",
"(",
"v3",
")",
")",
"\n",
"}"
] |
1,029 | all-1030 | [
"set",
"the",
"value",
"of",
"a",
"sub",
"-",
"word",
"of",
"the",
"sample",
"mask"
] | [
"func",
"SampleMaski",
"(",
"maskNumber",
"uint32",
",",
"<mask>",
"uint32",
")",
"{",
"C",
".",
"glowSampleMaski",
"(",
"gpSampleMaski",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"maskNumber",
")",
",",
"(",
"C",
".",
"GLbitfield",
")",
"(",
"mask",
")",
")",
"\n",
"}"
] |
1,030 | all-1031 | [
"/",
"*",
"write",
"frame",
"to",
"video",
"file"
] | [
"func",
"(",
"<mask>",
"*",
"VideoWriter",
")",
"WriteFrame",
"(",
"image",
"*",
"IplImage",
")",
"int",
"{",
"rv",
":=",
"C",
".",
"cvWriteFrame",
"(",
"(",
"*",
"C",
".",
"CvVideoWriter",
")",
"(",
"writer",
")",
",",
"(",
"*",
"C",
".",
"IplImage",
")",
"(",
"image",
")",
")",
"\n",
"return",
"int",
"(",
"rv",
")",
"\n",
"}"
] |
1,031 | all-1032 | [
"SetHost",
"sets",
"the",
"host",
"used",
"to",
"create",
"Self",
"-",
"Service",
"session",
".",
"Pass",
"in",
"the",
"CM",
"1",
".",
"5",
"host",
"this",
"method",
"computes",
"the",
"Self",
"-",
"Service",
"host",
"from",
"it",
"."
] | [
"func",
"(",
"a",
"*",
"ssAuthenticator",
")",
"SetHost",
"(",
"host",
"string",
")",
"{",
"a",
".",
"auther",
".",
"SetHost",
"(",
"<mask>",
")",
"\n",
"urlElems",
":=",
"strings",
".",
"Split",
"(",
"host",
",",
"\"",
"\"",
")",
"\n",
"hostPrefix",
":=",
"urlElems",
"[",
"0",
"]",
"\n",
"elems",
":=",
"strings",
".",
"Split",
"(",
"hostPrefix",
",",
"\"",
"\"",
")",
"\n\n",
"if",
"len",
"(",
"elems",
")",
"==",
"1",
"&&",
"elems",
"[",
"0",
"]",
"==",
"\"",
"\"",
"{",
"// accommodates micromoo host inference, such as \"cm.rightscale.local\" => \"selfservice.rightscale.local\"",
"elems",
"[",
"0",
"]",
"=",
"\"",
"\"",
"\n",
"}",
"else",
"if",
"len",
"(",
"elems",
")",
"<",
"2",
"{",
"// don't know how to compute this ss host; use the cm host",
"a",
".",
"host",
"=",
"host",
"\n",
"return",
"\n",
"}",
"else",
"{",
"elems",
"[",
"len",
"(",
"elems",
")",
"-",
"2",
"]",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"ssLoginHostPrefix",
":=",
"strings",
".",
"Join",
"(",
"elems",
",",
"\"",
"\"",
")",
"\n",
"a",
".",
"host",
"=",
"strings",
".",
"Join",
"(",
"append",
"(",
"[",
"]",
"string",
"{",
"ssLoginHostPrefix",
"}",
",",
"urlElems",
"[",
"1",
":",
"]",
"...",
")",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
1,032 | all-1033 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetProcessInfoParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoSysteminfo2",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
1,033 | all-1034 | [
"MarshalEasyJSON",
"writes",
"the",
"CIDR",
"to",
"a",
"easyjson",
".",
"Writer"
] | [
"func",
"(",
"u",
"CIDR",
")",
"MarshalEasyJSON",
"(",
"w",
"*",
"jwriter",
".",
"Writer",
")",
"{",
"w",
".",
"<mask>",
"(",
"string",
"(",
"u",
")",
")",
"\n",
"}"
] |
1,034 | all-1035 | [
"Insert",
"or",
"updates",
"the",
"key",
"/",
"value",
"rows",
"of",
"the",
"given",
"config",
"table",
"."
] | [
"func",
"upsertConfig",
"(",
"tx",
"*",
"sql",
".",
"Tx",
",",
"table",
"string",
",",
"values",
"map",
"[",
"string",
"]",
"string",
")",
"error",
"{",
"if",
"len",
"(",
"values",
")",
"==",
"0",
"{",
"return",
"nil",
"// Nothing to update",
"\n",
"}",
"\n\n",
"query",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"table",
")",
"\n",
"exprs",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"}",
"\n",
"for",
"key",
",",
"value",
":=",
"range",
"values",
"{",
"exprs",
"=",
"<mask>",
"(",
"exprs",
",",
"\"",
"\"",
")",
"\n",
"params",
"=",
"append",
"(",
"params",
",",
"key",
")",
"\n",
"params",
"=",
"append",
"(",
"params",
",",
"value",
")",
"\n",
"}",
"\n",
"query",
"+=",
"strings",
".",
"Join",
"(",
"exprs",
",",
"\"",
"\"",
")",
"\n",
"_",
",",
"err",
":=",
"tx",
".",
"Exec",
"(",
"query",
",",
"params",
"...",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
1,035 | all-1036 | [
"Unmount",
"unmounts",
"currently",
"mounted",
"ZFS",
"file",
"systems",
"."
] | [
"func",
"(",
"d",
"*",
"Dataset",
")",
"Unmount",
"(",
"force",
"bool",
")",
"(",
"*",
"Dataset",
",",
"error",
")",
"{",
"if",
"d",
".",
"Type",
"==",
"DatasetSnapshot",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"args",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"1",
",",
"3",
")",
"\n",
"args",
"[",
"0",
"]",
"=",
"\"",
"\"",
"\n",
"if",
"<mask>",
"{",
"args",
"=",
"append",
"(",
"args",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"args",
"=",
"append",
"(",
"args",
",",
"d",
".",
"Name",
")",
"\n",
"_",
",",
"err",
":=",
"zfs",
"(",
"args",
"...",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"GetDataset",
"(",
"d",
".",
"Name",
")",
"\n",
"}"
] |
1,036 | all-1037 | [
"NewStreamReader",
"returns",
"a",
"reader",
"which",
"replays",
"all",
"the",
"data",
"generated",
"by",
"sw",
".",
"The",
"returned",
"reader",
"may",
"be",
"passed",
"to",
"Response",
".",
"SetBodyStream",
".",
"Close",
"must",
"be",
"called",
"on",
"the",
"returned",
"reader",
"after",
"all",
"the",
"required",
"data",
"has",
"been",
"read",
".",
"Otherwise",
"goroutine",
"leak",
"may",
"occur",
".",
"See",
"also",
"Response",
".",
"SetBodyStreamWriter",
"."
] | [
"func",
"NewStreamReader",
"(",
"sw",
"StreamWriter",
")",
"io",
".",
"ReadCloser",
"{",
"pc",
":=",
"fasthttputil",
".",
"NewPipeConns",
"(",
")",
"\n",
"pw",
":=",
"pc",
".",
"Conn1",
"(",
")",
"\n",
"pr",
":=",
"pc",
".",
"Conn2",
"(",
")",
"\n\n",
"<mask>",
"bw",
"*",
"bufio",
".",
"Writer",
"\n",
"v",
":=",
"streamWriterBufPool",
".",
"Get",
"(",
")",
"\n",
"if",
"v",
"==",
"nil",
"{",
"bw",
"=",
"bufio",
".",
"NewWriter",
"(",
"pw",
")",
"\n",
"}",
"else",
"{",
"bw",
"=",
"v",
".",
"(",
"*",
"bufio",
".",
"Writer",
")",
"\n",
"bw",
".",
"Reset",
"(",
"pw",
")",
"\n",
"}",
"\n\n",
"go",
"func",
"(",
")",
"{",
"sw",
"(",
"bw",
")",
"\n",
"bw",
".",
"Flush",
"(",
")",
"\n",
"pw",
".",
"Close",
"(",
")",
"\n\n",
"streamWriterBufPool",
".",
"Put",
"(",
"bw",
")",
"\n",
"}",
"(",
")",
"\n\n",
"return",
"pr",
"\n",
"}"
] |
1,037 | all-1038 | [
"ReStock",
"--",
"this",
"will",
"grab",
"a",
"requestid",
"from",
"procurementMeta",
"and",
"call",
"the",
"innkeeper",
"client",
"to",
"deprovision",
"."
] | [
"func",
"(",
"s",
"*",
"SkuM1Small",
")",
"ReStock",
"(",
")",
"(",
"tm",
"*",
"taskmanager",
".",
"Task",
")",
"{",
"tm",
"=",
"new",
"(",
"taskmanager",
".",
"Task",
")",
"\n",
"lo",
".",
"G",
".",
"Debug",
"(",
"\"",
"\"",
",",
"s",
".",
"ProcurementMeta",
")",
"\n",
"requestID",
":=",
"s",
".",
"ProcurementMeta",
"[",
"ProcurementMetaFieldRequestID",
"]",
".",
"(",
"string",
")",
"\n",
"lo",
".",
"G",
".",
"Debug",
"(",
"\"",
"\"",
",",
"requestID",
")",
"\n\n",
"if",
"clnt",
",",
"err",
":=",
"s",
".",
"GetInnkeeperClient",
"(",
")",
";",
"err",
"==",
"nil",
"{",
"var",
"err",
"error",
"\n",
"var",
"res",
"*",
"innkeeperclient",
".",
"GetStatusResponse",
"\n",
"if",
"res",
",",
"err",
"=",
"clnt",
".",
"DeProvisionHost",
"(",
"requestID",
")",
";",
"err",
"!=",
"nil",
"&&",
"res",
".",
"<mask>",
"!=",
"\"",
"\"",
"{",
"lo",
".",
"G",
".",
"Error",
"(",
"\"",
"\"",
",",
"requestID",
",",
"err",
",",
"res",
")",
"\n",
"}",
"\n",
"lo",
".",
"G",
".",
"Debug",
"(",
"\"",
"\"",
",",
"requestID",
",",
"err",
",",
"res",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
1,038 | all-1039 | [
"FullSrcLine",
"returns",
"/",
"path",
"/",
"to",
"/",
"source",
".",
"go",
":",
"line",
".",
"This",
"file",
"path",
"is",
"mutated",
"to",
"look",
"like",
"the",
"local",
"path",
"."
] | [
"func",
"(",
"c",
"*",
"Call",
")",
"FullSrcLine",
"(",
")",
"string",
"{",
"<mask>",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"c",
".",
"SrcPath",
",",
"c",
".",
"Line",
")",
"\n",
"}"
] |
1,039 | all-1040 | [
"createProgressBar",
"creates",
"a",
"mpb",
".",
"Bar",
"in",
"pool",
".",
"Note",
"that",
"if",
"the",
"copier",
"s",
"reportWriter",
"is",
"ioutil",
".",
"Discard",
"the",
"progress",
"bar",
"s",
"output",
"will",
"be",
"discarded"
] | [
"func",
"(",
"c",
"*",
"copier",
")",
"createProgressBar",
"(",
"pool",
"*",
"mpb",
".",
"Progress",
",",
"info",
"types",
".",
"BlobInfo",
",",
"<mask>",
"string",
",",
"onComplete",
"string",
")",
"*",
"mpb",
".",
"Bar",
"{",
"// shortDigestLen is the length of the digest used for blobs.",
"const",
"shortDigestLen",
"=",
"12",
"\n\n",
"prefix",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"kind",
",",
"info",
".",
"Digest",
".",
"Encoded",
"(",
")",
")",
"\n",
"// Truncate the prefix (chopping of some part of the digest) to make all progress bars aligned in a column.",
"maxPrefixLen",
":=",
"len",
"(",
"\"",
"\"",
")",
"+",
"shortDigestLen",
"\n",
"if",
"len",
"(",
"prefix",
")",
">",
"maxPrefixLen",
"{",
"prefix",
"=",
"prefix",
"[",
":",
"maxPrefixLen",
"]",
"\n",
"}",
"\n\n",
"bar",
":=",
"pool",
".",
"AddBar",
"(",
"info",
".",
"Size",
",",
"mpb",
".",
"BarClearOnComplete",
"(",
")",
",",
"mpb",
".",
"PrependDecorators",
"(",
"decor",
".",
"Name",
"(",
"prefix",
")",
",",
")",
",",
"mpb",
".",
"AppendDecorators",
"(",
"decor",
".",
"OnComplete",
"(",
"decor",
".",
"CountersKibiByte",
"(",
"\"",
"\"",
")",
",",
"\"",
"\"",
"+",
"onComplete",
")",
",",
")",
",",
")",
"\n",
"if",
"c",
".",
"progressOutput",
"==",
"ioutil",
".",
"Discard",
"{",
"c",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"kind",
",",
"info",
".",
"Digest",
")",
"\n",
"}",
"\n",
"return",
"bar",
"\n",
"}"
] |
1,040 | all-1041 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"RequestNodeReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom12",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
1,041 | all-1042 | [
"title",
":",
"set",
"unit",
"status",
"path",
":",
"/",
"apps",
"/",
"{",
"app",
"}",
"/",
"units",
"/",
"{",
"unit",
"}",
"method",
":",
"POST",
"consume",
":",
"application",
"/",
"x",
"-",
"www",
"-",
"form",
"-",
"urlencoded",
"responses",
":",
"200",
":",
"Ok",
"400",
":",
"Invalid",
"data",
"401",
":",
"Unauthorized",
"404",
":",
"App",
"or",
"unit",
"not",
"found"
] | [
"func",
"setUnitStatus",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"t",
"auth",
".",
"Token",
")",
"error",
"{",
"unitName",
":=",
"r",
".",
"URL",
".",
"<mask>",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"unitName",
"==",
"\"",
"\"",
"{",
"return",
"&",
"errors",
".",
"HTTP",
"{",
"Code",
":",
"http",
".",
"StatusBadRequest",
",",
"Message",
":",
"\"",
"\"",
",",
"}",
"\n",
"}",
"\n",
"postStatus",
":=",
"InputValue",
"(",
"r",
",",
"\"",
"\"",
")",
"\n",
"status",
",",
"err",
":=",
"provision",
".",
"ParseStatus",
"(",
"postStatus",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"&",
"errors",
".",
"HTTP",
"{",
"Code",
":",
"http",
".",
"StatusBadRequest",
",",
"Message",
":",
"err",
".",
"Error",
"(",
")",
",",
"}",
"\n",
"}",
"\n",
"appName",
":=",
"r",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"a",
",",
"err",
":=",
"app",
".",
"GetByName",
"(",
"appName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"&",
"errors",
".",
"HTTP",
"{",
"Code",
":",
"http",
".",
"StatusNotFound",
",",
"Message",
":",
"err",
".",
"Error",
"(",
")",
"}",
"\n",
"}",
"\n",
"allowed",
":=",
"permission",
".",
"Check",
"(",
"t",
",",
"permission",
".",
"PermAppUpdateUnitStatus",
",",
"contextsForApp",
"(",
"a",
")",
"...",
",",
")",
"\n",
"if",
"!",
"allowed",
"{",
"return",
"permission",
".",
"ErrUnauthorized",
"\n",
"}",
"\n",
"err",
"=",
"a",
".",
"SetUnitStatus",
"(",
"unitName",
",",
"status",
")",
"\n",
"if",
"_",
",",
"ok",
":=",
"err",
".",
"(",
"*",
"provision",
".",
"UnitNotFoundError",
")",
";",
"ok",
"{",
"return",
"&",
"errors",
".",
"HTTP",
"{",
"Code",
":",
"http",
".",
"StatusNotFound",
",",
"Message",
":",
"err",
".",
"Error",
"(",
")",
"}",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
] |
1,042 | all-1043 | [
"Records",
"returns",
"all",
"DNS",
"records",
"controlled",
"by",
"the",
"configured",
"PDNS",
"server",
"(",
"for",
"all",
"zones",
")"
] | [
"func",
"(",
"p",
"*",
"PDNSProvider",
")",
"Records",
"(",
")",
"(",
"endpoints",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
",",
"_",
"error",
")",
"{",
"zones",
",",
"_",
",",
"err",
":=",
"p",
".",
"client",
".",
"ListZones",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"filteredZones",
",",
"_",
":=",
"p",
".",
"client",
".",
"PartitionZones",
"(",
"zones",
")",
"\n\n",
"for",
"_",
",",
"zone",
":=",
"range",
"filteredZones",
"{",
"z",
",",
"_",
",",
"err",
":=",
"p",
".",
"<mask>",
".",
"ListZone",
"(",
"zone",
".",
"Id",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"log",
".",
"Warnf",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"rr",
":=",
"range",
"z",
".",
"Rrsets",
"{",
"e",
",",
"err",
":=",
"p",
".",
"convertRRSetToEndpoints",
"(",
"rr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"e",
"...",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"log",
".",
"Debugf",
"(",
"\"",
"\\n",
"\"",
",",
"endpoints",
")",
"\n",
"return",
"endpoints",
",",
"nil",
"\n",
"}"
] |
1,043 | all-1044 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"StopCastingParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoCast",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
1,044 | all-1045 | [
"GetDeviceOffset",
"is",
"a",
"wrapper",
"around",
"cairo_surface_get_device_offset",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Surface",
")",
"GetDeviceOffset",
"(",
")",
"(",
"x",
",",
"y",
"float64",
")",
"{",
"<mask>",
"xOffset",
",",
"yOffset",
"C",
".",
"double",
"\n",
"C",
".",
"cairo_surface_get_device_offset",
"(",
"v",
".",
"native",
"(",
")",
",",
"&",
"xOffset",
",",
"&",
"yOffset",
")",
"\n",
"return",
"float64",
"(",
"xOffset",
")",
",",
"float64",
"(",
"yOffset",
")",
"\n",
"}"
] |
1,045 | all-1046 | [
"MenuItemNewSection",
"is",
"a",
"wrapper",
"around",
"g_menu_item_new_section",
"()",
"."
] | [
"func",
"MenuItemNewSection",
"(",
"label",
"string",
",",
"<mask>",
"*",
"MenuModel",
")",
"*",
"MenuItem",
"{",
"cstr1",
":=",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"C",
".",
"CString",
"(",
"label",
")",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr1",
")",
")",
"\n\n",
"c",
":=",
"C",
".",
"g_menu_item_new_section",
"(",
"cstr1",
",",
"section",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"wrapMenuItem",
"(",
"wrapObject",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
")",
"\n",
"}"
] |
1,046 | all-1047 | [
"Fetches",
"a",
"symbol",
"specified",
"in",
"op",
"arg",
"from",
"template",
"variables",
".",
"XXX",
"need",
"to",
"handle",
"local",
"vars?"
] | [
"func",
"txFetchSymbol",
"(",
"st",
"*",
"State",
")",
"{",
"// Need to handle local vars?",
"key",
":=",
"st",
".",
"CurrentOp",
"(",
")",
".",
"Arg",
"(",
")",
"\n",
"vars",
":=",
"st",
".",
"Vars",
"(",
")",
"\n",
"if",
"v",
",",
"ok",
":=",
"vars",
".",
"Get",
"(",
"<mask>",
")",
";",
"ok",
"{",
"st",
".",
"sa",
"=",
"v",
"\n",
"}",
"else",
"{",
"st",
".",
"sa",
"=",
"nil",
"\n",
"}",
"\n",
"st",
".",
"Advance",
"(",
")",
"\n",
"}"
] |
1,047 | all-1048 | [
"FullyQualifiedAppID",
"returns",
"the",
"fully",
"-",
"qualified",
"application",
"ID",
".",
"This",
"may",
"contain",
"a",
"partition",
"prefix",
"(",
"e",
".",
"g",
".",
"s~",
"for",
"High",
"Replication",
"apps",
")",
"or",
"a",
"domain",
"prefix",
"(",
"e",
".",
"g",
".",
"example",
".",
"com",
":",
")",
"."
] | [
"func",
"FullyQualifiedAppID",
"(",
"ctx",
"netcontext",
".",
"Context",
")",
"string",
"{",
"if",
"id",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"&",
"appIDOverrideKey",
")",
".",
"(",
"string",
")",
";",
"ok",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"return",
"fullyQualifiedAppID",
"(",
"ctx",
")",
"\n",
"}"
] |
1,048 | all-1049 | [
"AddBytesKV",
"adds",
"the",
"given",
"key",
":",
"value",
"header",
".",
"Multiple",
"headers",
"with",
"the",
"same",
"key",
"may",
"be",
"added",
"with",
"this",
"function",
".",
"Use",
"SetBytesKV",
"for",
"setting",
"a",
"single",
"header",
"for",
"the",
"given",
"key",
"."
] | [
"func",
"(",
"h",
"*",
"RequestHeader",
")",
"AddBytesKV",
"(",
"<mask>",
",",
"value",
"[",
"]",
"byte",
")",
"{",
"h",
".",
"Add",
"(",
"b2s",
"(",
"key",
")",
",",
"b2s",
"(",
"value",
")",
")",
"\n",
"}"
] |
1,049 | all-1050 | [
"NewBase64Cleaner",
"returns",
"a",
"Base64Cleaner",
"object",
"for",
"the",
"specified",
"reader",
".",
"Base64Cleaner",
"implements",
"the",
"io",
".",
"Reader",
"interface",
"."
] | [
"func",
"NewBase64Cleaner",
"(",
"r",
"io",
".",
"Reader",
")",
"*",
"Base64Cleaner",
"{",
"return",
"&",
"Base64Cleaner",
"{",
"Errors",
":",
"<mask>",
"(",
"[",
"]",
"error",
",",
"0",
")",
",",
"r",
":",
"r",
",",
"}",
"\n",
"}"
] |
1,050 | all-1051 | [
"NewColumnIterator",
"creates",
"a",
"new",
"iterator",
"for",
"column",
"data",
"."
] | [
"func",
"NewColumnIterator",
"(",
"<mask>",
"Format",
",",
"reader",
"io",
".",
"Reader",
")",
"*",
"Iterator",
"{",
"return",
"NewIterator",
"(",
"reader",
",",
"ColumnUnmarshaller",
"(",
"format",
")",
")",
"\n",
"}"
] |
1,051 | all-1052 | [
"HasPalette",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"WidgetConditionalFormat",
")",
"HasPalette",
"(",
")",
"bool",
"{",
"if",
"w",
"!=",
"nil",
"&&",
"w",
".",
"Palette",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
1,052 | all-1053 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SetRequestInterceptionParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork10",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
1,053 | all-1054 | [
"NextIP",
"returns",
"the",
"next",
"sequential",
"ip",
"."
] | [
"func",
"NextIP",
"(",
"ip",
"<mask>",
".",
"IP",
")",
"net",
".",
"IP",
"{",
"return",
"NewNetworkNumber",
"(",
"ip",
")",
".",
"Next",
"(",
")",
".",
"ToIP",
"(",
")",
"\n",
"}"
] |
1,054 | all-1055 | [
"InsertSubmenu",
"is",
"a",
"wrapper",
"around",
"g_menu_insert_submenu",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Menu",
")",
"InsertSubmenu",
"(",
"position",
"int",
",",
"label",
"string",
",",
"submenu",
"*",
"MenuModel",
")",
"{",
"cstr1",
":=",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"C",
".",
"CString",
"(",
"<mask>",
")",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr1",
")",
")",
"\n\n",
"C",
".",
"g_menu_insert_submenu",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"position",
")",
",",
"cstr1",
",",
"submenu",
".",
"native",
"(",
")",
")",
"\n",
"}"
] |
1,055 | all-1056 | [
"Create",
"a",
"new",
"net",
".",
"Listener",
"bound",
"to",
"the",
"tcp",
"socket",
"of",
"the",
"network",
"endpoint",
"."
] | [
"func",
"networkCreateListener",
"(",
"address",
"string",
",",
"cert",
"*",
"shared",
".",
"CertInfo",
")",
"<mask>",
".",
"Listener",
"{",
"listener",
",",
"err",
":=",
"net",
".",
"Listen",
"(",
"\"",
"\"",
",",
"util",
".",
"CanonicalNetworkAddress",
"(",
"address",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logger",
".",
"Error",
"(",
"\"",
"\"",
",",
"log",
".",
"Ctx",
"{",
"\"",
"\"",
":",
"err",
"}",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"networkTLSListener",
"(",
"listener",
",",
"cert",
")",
"\n",
"}"
] |
1,056 | all-1057 | [
"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",
".",
"[",
"Limits",
":",
"0",
"<",
"=",
"value",
"<",
"=",
"1",
".",
"0",
"]"
] | [
"func",
"(",
"v",
"Vec3",
")",
"Lerp",
"(",
"v1",
"Vec3",
",",
"t",
"float32",
")",
"Vec3",
"{",
"<mask>",
"Vec3",
"{",
"v",
"[",
"0",
"]",
"+",
"(",
"v1",
"[",
"0",
"]",
"-",
"v",
"[",
"0",
"]",
")",
"*",
"t",
",",
"v",
"[",
"1",
"]",
"+",
"(",
"v1",
"[",
"1",
"]",
"-",
"v",
"[",
"1",
"]",
")",
"*",
"t",
",",
"v",
"[",
"2",
"]",
"+",
"(",
"v1",
"[",
"2",
"]",
"-",
"v",
"[",
"2",
"]",
")",
"*",
"t",
",",
"}",
"\n",
"}"
] |
1,057 | all-1058 | [
"runCmdOutput",
"is",
"a",
"helper",
"function",
"to",
"run",
"commands",
"and",
"return",
"output",
".",
"It",
"runs",
"command",
"with",
"args",
"from",
"directory",
"at",
"dir",
".",
"If",
"successful",
"returns",
"output",
"and",
"nil",
"error"
] | [
"func",
"runCmdOutput",
"(",
"command",
"string",
",",
"args",
"[",
"]",
"string",
",",
"dir",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"cmd",
":=",
"gos",
".",
"Command",
"(",
"command",
",",
"args",
"...",
")",
"\n",
"cmd",
".",
"Dir",
"(",
"dir",
")",
"\n",
"var",
"err",
"error",
"\n",
"if",
"output",
",",
"err",
":=",
"cmd",
".",
"Output",
"(",
")",
";",
"err",
"==",
"nil",
"{",
"return",
"string",
"(",
"bytes",
".",
"TrimSpace",
"(",
"<mask>",
")",
")",
",",
"nil",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}"
] |
1,058 | all-1059 | [
"FindOneTo",
"calls",
"db",
".",
"FindOneTo",
"()",
"returning",
"more",
"descriptive",
"error",
"."
] | [
"func",
"FindOneTo",
"(",
"db",
"*",
"reform",
".",
"Querier",
",",
"str",
"reform",
".",
"Struct",
",",
"<mask>",
"string",
",",
"arg",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"err",
":=",
"db",
".",
"FindOneTo",
"(",
"str",
",",
"column",
",",
"arg",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"str",
",",
"column",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
1,059 | all-1060 | [
"WithFormat",
"image",
"compression",
"format",
"."
] | [
"func",
"(",
"p",
"StartScreencastParams",
")",
"WithFormat",
"(",
"format",
"ScreencastFormat",
")",
"*",
"StartScreencastParams",
"{",
"p",
".",
"Format",
"=",
"<mask>",
"\n",
"return",
"&",
"p",
"\n",
"}"
] |
1,060 | all-1061 | [
"SetFocusHAdjustment",
"is",
"a",
"wrapper",
"around",
"gtk_container_set_focus_hadjustment",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"SetFocusHAdjustment",
"(",
"adjustment",
"*",
"Adjustment",
")",
"{",
"C",
".",
"gtk_container_set_focus_hadjustment",
"(",
"v",
".",
"native",
"(",
")",
",",
"adjustment",
".",
"native",
"(",
")",
")",
"\n",
"}"
] |
1,061 | all-1062 | [
"rewind",
"resets",
"this",
"fileBuffer",
"to",
"read",
"from",
"the",
"beginning"
] | [
"func",
"(",
"r",
"*",
"fileBuffer",
")",
"rewind",
"(",
")",
"{",
"r",
".",
"Reader",
"=",
"io",
".",
"MultiReader",
"(",
"r",
".",
"cache",
",",
"r",
".",
"<mask>",
".",
"Reader",
")",
"\n",
"}"
] |
1,062 | all-1063 | [
"PathToTree",
"computes",
"the",
"hashtree",
"shard",
"for",
"a",
"path",
"."
] | [
"func",
"PathToTree",
"(",
"path",
"string",
",",
"numTrees",
"int64",
")",
"uint64",
"{",
"path",
"=",
"<mask>",
"(",
"path",
")",
"\n",
"return",
"pathToTree",
"(",
"b",
"(",
"path",
")",
",",
"numTrees",
")",
"\n",
"}"
] |
1,063 | all-1064 | [
"LaunchBuild",
"launches",
"a",
"regular",
"or",
"parameterized",
"Jenkins",
"build",
"depending",
"on",
"whether",
"or",
"not",
"we",
"have",
"params",
"to",
"POST"
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"LaunchBuild",
"(",
"spec",
"*",
"prowapi",
".",
"ProwJobSpec",
",",
"params",
"url",
".",
"Values",
")",
"error",
"{",
"var",
"path",
"string",
"\n\n",
"if",
"params",
"!=",
"nil",
"{",
"path",
"=",
"getBuildWithParametersPath",
"(",
"spec",
")",
"\n",
"}",
"else",
"{",
"path",
"=",
"getBuildPath",
"(",
"spec",
")",
"\n",
"}",
"\n\n",
"c",
".",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"path",
")",
"\n\n",
"resp",
",",
"err",
":=",
"c",
".",
"request",
"(",
"http",
".",
"MethodPost",
",",
"path",
",",
"params",
",",
"true",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n\n",
"if",
"resp",
".",
"StatusCode",
"!=",
"201",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"resp",
".",
"Status",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
1,064 | all-1065 | [
"seenMessage",
"returns",
"whether",
"we",
"already",
"saw",
"this",
"message",
"before"
] | [
"func",
"(",
"p",
"*",
"PubSub",
")",
"seenMessage",
"(",
"id",
"string",
")",
"bool",
"{",
"return",
"p",
".",
"seenMessages",
".",
"Has",
"(",
"<mask>",
")",
"\n",
"}"
] |
1,065 | all-1066 | [
"GetPeriodOk",
"returns",
"a",
"tuple",
"with",
"the",
"Period",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"ThresholdCount",
")",
"GetPeriodOk",
"(",
")",
"(",
"Period",
",",
"bool",
")",
"{",
"if",
"t",
"==",
"nil",
"||",
"t",
".",
"Period",
"==",
"nil",
"{",
"return",
"Period",
"{",
"}",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"t",
".",
"Period",
",",
"true",
"\n",
"}"
] |
1,066 | all-1067 | [
"<template",
"-",
"arg",
">",
"::",
"=",
"<type",
">",
"::",
"=",
"X",
"<expression",
">",
"E",
"::",
"=",
"<expr",
"-",
"primary",
">"
] | [
"func",
"(",
"st",
"*",
"state",
")",
"templateArg",
"(",
")",
"AST",
"{",
"if",
"len",
"(",
"st",
".",
"str",
")",
"==",
"0",
"{",
"st",
".",
"fail",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"switch",
"st",
".",
"str",
"[",
"0",
"]",
"{",
"case",
"'X'",
":",
"st",
".",
"advance",
"(",
"1",
")",
"\n",
"expr",
":=",
"st",
".",
"expression",
"(",
")",
"\n",
"if",
"len",
"(",
"st",
".",
"str",
")",
"==",
"0",
"||",
"st",
".",
"str",
"[",
"0",
"]",
"!=",
"'E'",
"{",
"st",
".",
"fail",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"st",
".",
"advance",
"(",
"1",
")",
"\n",
"return",
"expr",
"\n\n",
"<mask>",
"'L'",
":",
"return",
"st",
".",
"exprPrimary",
"(",
")",
"\n\n",
"case",
"'I'",
",",
"'J'",
":",
"args",
":=",
"st",
".",
"templateArgs",
"(",
")",
"\n",
"return",
"&",
"ArgumentPack",
"{",
"Args",
":",
"args",
"}",
"\n\n",
"default",
":",
"return",
"st",
".",
"demangleType",
"(",
"false",
")",
"\n",
"}",
"\n",
"}"
] |
1,067 | all-1068 | [
"resolveStale",
"resolves",
"the",
"image",
"s",
"stale",
"state",
"."
] | [
"func",
"(",
"i",
"*",
"<mask>",
")",
"resolveStale",
"(",
")",
"{",
"if",
"!",
"IsRestoringEnabled",
"(",
")",
"{",
"return",
"\n",
"}",
"\n\n",
"if",
"i",
".",
"volatile",
"{",
"return",
"\n",
"}",
"\n",
"if",
"i",
".",
"screen",
"{",
"return",
"\n",
"}",
"\n",
"if",
"!",
"i",
".",
"stale",
"{",
"return",
"\n",
"}",
"\n",
"i",
".",
"readPixelsFromGPU",
"(",
")",
"\n",
"}"
] |
1,068 | all-1069 | [
"alertmanagersFromGroup",
"extracts",
"a",
"list",
"of",
"alertmanagers",
"from",
"a",
"target",
"group",
"and",
"an",
"associated",
"AlertmanagerConfig",
"."
] | [
"func",
"alertmanagerFromGroup",
"(",
"tg",
"*",
"targetgroup",
".",
"Group",
",",
"cfg",
"*",
"config",
".",
"AlertmanagerConfig",
")",
"(",
"[",
"]",
"alertmanager",
",",
"[",
"]",
"alertmanager",
",",
"error",
")",
"{",
"var",
"<mask>",
"[",
"]",
"alertmanager",
"\n",
"var",
"droppedAlertManagers",
"[",
"]",
"alertmanager",
"\n\n",
"for",
"_",
",",
"tlset",
":=",
"range",
"tg",
".",
"Targets",
"{",
"lbls",
":=",
"make",
"(",
"[",
"]",
"labels",
".",
"Label",
",",
"0",
",",
"len",
"(",
"tlset",
")",
"+",
"2",
"+",
"len",
"(",
"tg",
".",
"Labels",
")",
")",
"\n\n",
"for",
"ln",
",",
"lv",
":=",
"range",
"tlset",
"{",
"lbls",
"=",
"append",
"(",
"lbls",
",",
"labels",
".",
"Label",
"{",
"Name",
":",
"string",
"(",
"ln",
")",
",",
"Value",
":",
"string",
"(",
"lv",
")",
"}",
")",
"\n",
"}",
"\n",
"// Set configured scheme as the initial scheme label for overwrite.",
"lbls",
"=",
"append",
"(",
"lbls",
",",
"labels",
".",
"Label",
"{",
"Name",
":",
"model",
".",
"SchemeLabel",
",",
"Value",
":",
"cfg",
".",
"Scheme",
"}",
")",
"\n",
"lbls",
"=",
"append",
"(",
"lbls",
",",
"labels",
".",
"Label",
"{",
"Name",
":",
"pathLabel",
",",
"Value",
":",
"postPath",
"(",
"cfg",
".",
"PathPrefix",
")",
"}",
")",
"\n\n",
"// Combine target labels with target group labels.",
"for",
"ln",
",",
"lv",
":=",
"range",
"tg",
".",
"Labels",
"{",
"if",
"_",
",",
"ok",
":=",
"tlset",
"[",
"ln",
"]",
";",
"!",
"ok",
"{",
"lbls",
"=",
"append",
"(",
"lbls",
",",
"labels",
".",
"Label",
"{",
"Name",
":",
"string",
"(",
"ln",
")",
",",
"Value",
":",
"string",
"(",
"lv",
")",
"}",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"lset",
":=",
"relabel",
".",
"Process",
"(",
"labels",
".",
"New",
"(",
"lbls",
"...",
")",
",",
"cfg",
".",
"RelabelConfigs",
"...",
")",
"\n",
"if",
"lset",
"==",
"nil",
"{",
"droppedAlertManagers",
"=",
"append",
"(",
"droppedAlertManagers",
",",
"alertmanagerLabels",
"{",
"lbls",
"}",
")",
"\n",
"continue",
"\n",
"}",
"\n\n",
"lb",
":=",
"labels",
".",
"NewBuilder",
"(",
"lset",
")",
"\n\n",
"// addPort checks whether we should add a default port to the address.",
"// If the address is not valid, we don't append a port either.",
"addPort",
":=",
"func",
"(",
"s",
"string",
")",
"bool",
"{",
"// If we can split, a port exists and we don't have to add one.",
"if",
"_",
",",
"_",
",",
"err",
":=",
"net",
".",
"SplitHostPort",
"(",
"s",
")",
";",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"// If adding a port makes it valid, the previous error",
"// was not due to an invalid address and we can append a port.",
"_",
",",
"_",
",",
"err",
":=",
"net",
".",
"SplitHostPort",
"(",
"s",
"+",
"\"",
"\"",
")",
"\n",
"return",
"err",
"==",
"nil",
"\n",
"}",
"\n",
"addr",
":=",
"lset",
".",
"Get",
"(",
"model",
".",
"AddressLabel",
")",
"\n",
"// If it's an address with no trailing port, infer it based on the used scheme.",
"if",
"addPort",
"(",
"addr",
")",
"{",
"// Addresses reaching this point are already wrapped in [] if necessary.",
"switch",
"lset",
".",
"Get",
"(",
"model",
".",
"SchemeLabel",
")",
"{",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"addr",
"=",
"addr",
"+",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
":",
"addr",
"=",
"addr",
"+",
"\"",
"\"",
"\n",
"default",
":",
"return",
"nil",
",",
"nil",
",",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"cfg",
".",
"Scheme",
")",
"\n",
"}",
"\n",
"lb",
".",
"Set",
"(",
"model",
".",
"AddressLabel",
",",
"addr",
")",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"config",
".",
"CheckTargetAddress",
"(",
"model",
".",
"LabelValue",
"(",
"addr",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Meta labels are deleted after relabelling. Other internal labels propagate to",
"// the target which decides whether they will be part of their label set.",
"for",
"_",
",",
"l",
":=",
"range",
"lset",
"{",
"if",
"strings",
".",
"HasPrefix",
"(",
"l",
".",
"Name",
",",
"model",
".",
"MetaLabelPrefix",
")",
"{",
"lb",
".",
"Del",
"(",
"l",
".",
"Name",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"res",
"=",
"append",
"(",
"res",
",",
"alertmanagerLabels",
"{",
"lset",
"}",
")",
"\n",
"}",
"\n",
"return",
"res",
",",
"droppedAlertManagers",
",",
"nil",
"\n",
"}"
] |
1,069 | all-1070 | [
"WriteB",
"writes",
"a",
"byte",
"."
] | [
"func",
"(",
"w",
"*",
"Writer",
")",
"WriteB",
"(",
"b",
"<mask>",
")",
"{",
"// WriteB as sig differs from WriteByte (vet issues)",
"if",
"w",
".",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"w",
".",
"wr",
".",
"WriteByte",
"(",
"b",
")",
"\n",
"}"
] |
1,070 | all-1071 | [
"endpointsFromService",
"extracts",
"the",
"endpoints",
"from",
"a",
"service",
"object"
] | [
"func",
"(",
"sc",
"*",
"serviceSource",
")",
"endpoints",
"(",
"svc",
"*",
"v1",
".",
"<mask>",
",",
"nodeTargets",
"endpoint",
".",
"Targets",
")",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
"{",
"var",
"endpoints",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
"\n",
"// Skip endpoints if we do not want entries from annotations",
"if",
"!",
"sc",
".",
"ignoreHostnameAnnotation",
"{",
"providerSpecific",
":=",
"getProviderSpecificAnnotations",
"(",
"svc",
".",
"Annotations",
")",
"\n",
"hostnameList",
":=",
"getHostnamesFromAnnotations",
"(",
"svc",
".",
"Annotations",
")",
"\n",
"for",
"_",
",",
"hostname",
":=",
"range",
"hostnameList",
"{",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"sc",
".",
"generateEndpoints",
"(",
"svc",
",",
"hostname",
",",
"nodeTargets",
",",
"providerSpecific",
")",
"...",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"endpoints",
"\n",
"}"
] |
1,071 | all-1072 | [
"bind",
"a",
"renderbuffer",
"to",
"a",
"renderbuffer",
"target"
] | [
"func",
"BindRenderbuffer",
"(",
"<mask>",
"uint32",
",",
"renderbuffer",
"uint32",
")",
"{",
"C",
".",
"glowBindRenderbuffer",
"(",
"gpBindRenderbuffer",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"target",
")",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"renderbuffer",
")",
")",
"\n",
"}"
] |
1,072 | all-1073 | [
"GetMonitorIdOk",
"returns",
"a",
"tuple",
"with",
"the",
"MonitorId",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"d",
"*",
"Downtime",
")",
"GetMonitorIdOk",
"(",
")",
"(",
"int",
",",
"bool",
")",
"{",
"if",
"d",
"==",
"nil",
"||",
"d",
".",
"MonitorId",
"==",
"nil",
"{",
"return",
"0",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"d",
".",
"MonitorId",
",",
"true",
"\n",
"}"
] |
1,073 | all-1074 | [
"GetContainerLog",
"returns",
"the",
"log",
"of",
"a",
"container",
"in",
"the",
"specified",
"pod",
"in",
"the",
"client",
"s",
"specified",
"namespace",
".",
"Analogous",
"to",
"kubectl",
"logs",
"pod",
"-",
"c",
"container",
"--",
"namespace",
"=",
"client",
".",
"namespace"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetContainerLog",
"(",
"pod",
",",
"container",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"pod",
")",
"\n",
"return",
"c",
".",
"requestRetry",
"(",
"&",
"request",
"{",
"<mask>",
":",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"c",
".",
"namespace",
",",
"pod",
")",
",",
"query",
":",
"map",
"[",
"string",
"]",
"string",
"{",
"\"",
"\"",
":",
"container",
"}",
",",
"}",
")",
"\n",
"}"
] |
1,074 | all-1075 | [
"Writes",
"the",
"golang",
"text",
"template",
"at",
"templatePath",
"to",
"outputPath",
"using",
"the",
"given",
"data"
] | [
"func",
"writeTemplate",
"(",
"templatePath",
"string",
",",
"outputPath",
"string",
",",
"<mask>",
"interface",
"{",
"}",
")",
"error",
"{",
"// set up template",
"funcMap",
":=",
"template",
".",
"FuncMap",
"{",
"\"",
"\"",
":",
"func",
"(",
"input",
"string",
")",
"string",
"{",
"return",
"strings",
".",
"Replace",
"(",
"input",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
"\n",
"}",
",",
"}",
"\n",
"t",
",",
"err",
":=",
"template",
".",
"New",
"(",
"filepath",
".",
"Base",
"(",
"templatePath",
")",
")",
".",
"Funcs",
"(",
"funcMap",
")",
".",
"ParseFiles",
"(",
"templatePath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// ensure output path exists",
"if",
"!",
"pathExists",
"(",
"outputPath",
")",
"{",
"_",
",",
"err",
"=",
"os",
".",
"Create",
"(",
"outputPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"// open file at output path and truncate",
"f",
",",
"err",
":=",
"os",
".",
"OpenFile",
"(",
"outputPath",
",",
"os",
".",
"O_RDWR",
",",
"0644",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defer",
"f",
".",
"Close",
"(",
")",
"\n",
"f",
".",
"Truncate",
"(",
"0",
")",
"\n\n",
"// render template to output path",
"err",
"=",
"t",
".",
"Execute",
"(",
"f",
",",
"data",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
1,075 | all-1076 | [
"SetAuthRequest",
"sets",
"the",
"AuthRequest",
"function",
"for",
"the",
"underlying",
"trace",
"HTTP",
"listener",
"which",
"determines",
"whether",
"a",
"specific",
"request",
"is",
"permitted",
"to",
"load",
"the",
"/",
"debug",
"/",
"requests",
"or",
"/",
"debug",
"/",
"events",
"pages",
"."
] | [
"func",
"SetAuthRequest",
"(",
"f",
"func",
"(",
"req",
"*",
"http",
".",
"<mask>",
")",
"(",
"any",
",",
"sensitive",
"bool",
")",
")",
"{",
"xtr",
".",
"AuthRequest",
"=",
"f",
"\n",
"}"
] |
1,076 | all-1077 | [
"OffscreenWindowNew",
"is",
"a",
"wrapper",
"around",
"gtk_offscreen_window_new",
"()",
"."
] | [
"func",
"OffscreenWindowNew",
"(",
")",
"(",
"*",
"OffscreenWindow",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gtk_offscreen_window_new",
"(",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"return",
"wrapOffscreenWindow",
"(",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
")",
",",
"nil",
"\n",
"}"
] |
1,077 | all-1078 | [
"UpdateStatus",
"updates",
"a",
"task",
"s",
"known",
"and",
"desired",
"statuses",
"to",
"be",
"compatible",
"with",
"all",
"of",
"its",
"containers",
"It",
"will",
"return",
"a",
"bool",
"indicating",
"if",
"there",
"was",
"a",
"change"
] | [
"func",
"(",
"task",
"*",
"Task",
")",
"UpdateStatus",
"(",
")",
"bool",
"{",
"<mask>",
":=",
"task",
".",
"updateTaskKnownStatus",
"(",
")",
"\n",
"// DesiredStatus can change based on a new known status",
"task",
".",
"UpdateDesiredStatus",
"(",
")",
"\n",
"return",
"change",
"!=",
"apitaskstatus",
".",
"TaskStatusNone",
"\n",
"}"
] |
1,078 | all-1079 | [
"SetAutoStartupNotification",
"is",
"a",
"wrapper",
"around",
"gtk_window_set_auto_startup_notification",
"()",
".",
"This",
"doesn",
"t",
"seem",
"write",
".",
"Might",
"need",
"to",
"rethink?",
"/",
"*",
"func",
"(",
"v",
"*",
"Window",
")",
"SetAutoStartupNotification",
"(",
"setting",
"bool",
")",
"{",
"C",
".",
"gtk_window_set_auto_startup_notification",
"(",
"gbool",
"(",
"setting",
"))",
"}",
"GetMnemonicsVisible",
"is",
"a",
"wrapper",
"around",
"gtk_window_get_mnemonics_visible",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Window",
")",
"GetMnemonicsVisible",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_window_get_mnemonics_visible",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
1,079 | all-1080 | [
"Count",
"creates",
"a",
"Count",
"query",
".",
"Returns",
"the",
"number",
"of",
"set",
"columns",
"in",
"the",
"ROW_CALL",
"passed",
"in",
"."
] | [
"func",
"(",
"idx",
"*",
"Index",
")",
"Count",
"(",
"row",
"*",
"PQLRowQuery",
")",
"*",
"PQLBaseQuery",
"{",
"serializedQuery",
":=",
"row",
".",
"serialize",
"(",
")",
"\n",
"q",
":=",
"NewPQLBaseQuery",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"serializedQuery",
".",
"<mask>",
"(",
")",
")",
",",
"idx",
",",
"nil",
")",
"\n",
"q",
".",
"hasKeys",
"=",
"q",
".",
"hasKeys",
"||",
"serializedQuery",
".",
"HasWriteKeys",
"(",
")",
"\n",
"return",
"q",
"\n",
"}"
] |
1,080 | all-1081 | [
"UnmarshalJSON",
"sets",
"the",
"Duration",
"from",
"JSON"
] | [
"func",
"(",
"d",
"*",
"Duration",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"l",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"d",
".",
"UnmarshalEasyJSON",
"(",
"&",
"l",
")",
"\n",
"return",
"l",
".",
"Error",
"(",
")",
"\n",
"}"
] |
1,081 | all-1082 | [
"check",
"the",
"completeness",
"status",
"of",
"a",
"framebuffer"
] | [
"func",
"CheckFramebufferStatus",
"(",
"target",
"uint32",
")",
"uint32",
"{",
"ret",
":=",
"C",
".",
"glowCheckFramebufferStatus",
"(",
"gpCheckFramebufferStatus",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"<mask>",
")",
")",
"\n",
"return",
"(",
"uint32",
")",
"(",
"ret",
")",
"\n",
"}"
] |
1,082 | all-1083 | [
"Rollback",
"rolls",
"back",
"the",
"receiving",
"ZFS",
"dataset",
"to",
"a",
"previous",
"snapshot",
".",
"Optionally",
"intermediate",
"snapshots",
"can",
"be",
"destroyed",
".",
"A",
"ZFS",
"snapshot",
"rollback",
"cannot",
"be",
"completed",
"without",
"this",
"option",
"if",
"more",
"recent",
"snapshots",
"exist",
".",
"An",
"error",
"will",
"be",
"returned",
"if",
"the",
"input",
"dataset",
"is",
"not",
"of",
"snapshot",
"type",
"."
] | [
"func",
"(",
"d",
"*",
"Dataset",
")",
"Rollback",
"(",
"destroyMoreRecent",
"bool",
")",
"error",
"{",
"if",
"d",
".",
"Type",
"!=",
"DatasetSnapshot",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"args",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"1",
",",
"3",
")",
"\n",
"args",
"[",
"0",
"]",
"=",
"\"",
"\"",
"\n",
"if",
"destroyMoreRecent",
"{",
"args",
"=",
"append",
"(",
"args",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"args",
"=",
"append",
"(",
"args",
",",
"d",
".",
"<mask>",
")",
"\n\n",
"_",
",",
"err",
":=",
"zfs",
"(",
"args",
"...",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
1,083 | all-1084 | [
"GetPageIterator",
"returns",
"an",
"iterator",
"which",
"can",
"be",
"used",
"to",
"retrieve",
"pages",
"."
] | [
"func",
"(",
"c",
"*",
"CallService",
")",
"GetPageIterator",
"(",
"<mask>",
"url",
".",
"Values",
")",
"CallPageIterator",
"{",
"iter",
":=",
"NewPageIterator",
"(",
"c",
".",
"client",
",",
"data",
",",
"callsPathPart",
")",
"\n",
"return",
"&",
"callPageIterator",
"{",
"p",
":",
"iter",
",",
"}",
"\n",
"}"
] |
1,084 | all-1085 | [
"Add",
"writes",
"the",
"given",
"item",
"if",
"no",
"value",
"already",
"exists",
"for",
"its",
"key",
".",
"ErrNotStored",
"is",
"returned",
"if",
"that",
"condition",
"is",
"not",
"met",
"."
] | [
"func",
"(",
"cd",
"Codec",
")",
"Add",
"(",
"c",
"context",
".",
"Context",
",",
"item",
"*",
"Item",
")",
"error",
"{",
"return",
"singleError",
"(",
"<mask>",
".",
"set",
"(",
"c",
",",
"[",
"]",
"*",
"Item",
"{",
"item",
"}",
",",
"pb",
".",
"MemcacheSetRequest_ADD",
")",
")",
"\n",
"}"
] |
1,085 | all-1086 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"RequestEntriesReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
1,086 | all-1087 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetDocumentContentParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage12",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
1,087 | all-1088 | [
"Start",
"starts",
"the",
"stat",
"process",
"that",
"will",
"log",
"relevant",
"memory",
"-",
"related",
"stats",
"to",
"ctx",
"at",
"an",
"interval",
"determined",
"by",
"interval",
"."
] | [
"func",
"Start",
"(",
"ctx",
"log",
".",
"Interface",
",",
"interval",
"time",
".",
"Duration",
")",
"{",
"ctx",
".",
"WithField",
"(",
"\"",
"\"",
",",
"interval",
")",
".",
"Debug",
"(",
"\"",
"\"",
")",
"\n",
"go",
"func",
"(",
")",
"{",
"memstats",
":=",
"new",
"(",
"runtime",
".",
"MemStats",
")",
"\n",
"for",
"range",
"time",
".",
"Tick",
"(",
"interval",
")",
"{",
"runtime",
".",
"ReadMemStats",
"(",
"memstats",
")",
"\n",
"ctx",
".",
"WithFields",
"(",
"<mask>",
".",
"Fields",
"{",
"\"",
"\"",
":",
"runtime",
".",
"NumGoroutine",
"(",
")",
",",
"\"",
"\"",
":",
"float64",
"(",
"memstats",
".",
"Alloc",
")",
"/",
"megaByte",
",",
"// MegaBytes allocated and not yet freed",
"}",
")",
".",
"Debugf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n",
"}"
] |
1,088 | all-1089 | [
"secret",
"must",
"be",
"32",
"bytes",
"long",
".",
"Use",
"something",
"like",
"Sha256",
"(",
"Bcrypt",
"(",
"passphrase",
"))",
"The",
"ciphertext",
"is",
"(",
"secretbox",
".",
"Overhead",
"+",
"24",
")",
"bytes",
"longer",
"than",
"the",
"plaintext",
".",
"NOTE",
":",
"call",
"crypto",
".",
"MixEntropy",
"()",
"first",
"."
] | [
"func",
"EncryptSymmetric",
"(",
"plaintext",
"[",
"]",
"byte",
",",
"secret",
"[",
"]",
"byte",
")",
"(",
"ciphertext",
"[",
"]",
"byte",
")",
"{",
"if",
"len",
"(",
"secret",
")",
"!=",
"secretLen",
"{",
"PanicSanity",
"(",
"Fmt",
"(",
"\"",
"\"",
",",
"len",
"(",
"secret",
")",
")",
")",
"\n",
"}",
"\n",
"nonce",
":=",
"CRandBytes",
"(",
"nonceLen",
")",
"\n",
"nonceArr",
":=",
"[",
"nonceLen",
"]",
"byte",
"{",
"}",
"\n",
"copy",
"(",
"nonceArr",
"[",
":",
"]",
",",
"nonce",
")",
"\n",
"secretArr",
":=",
"[",
"secretLen",
"]",
"byte",
"{",
"}",
"\n",
"copy",
"(",
"secretArr",
"[",
":",
"]",
",",
"secret",
")",
"\n",
"ciphertext",
"=",
"make",
"(",
"[",
"]",
"byte",
",",
"nonceLen",
"+",
"secretbox",
".",
"Overhead",
"+",
"len",
"(",
"plaintext",
")",
")",
"\n",
"<mask>",
"(",
"ciphertext",
",",
"nonce",
")",
"\n",
"secretbox",
".",
"Seal",
"(",
"ciphertext",
"[",
"nonceLen",
":",
"nonceLen",
"]",
",",
"plaintext",
",",
"&",
"nonceArr",
",",
"&",
"secretArr",
")",
"\n",
"return",
"ciphertext",
"\n",
"}"
] |
1,089 | all-1090 | [
"Records",
"returns",
"the",
"list",
"of",
"records",
"in",
"a",
"given",
"zone",
"."
] | [
"func",
"(",
"p",
"*",
"DigitalOceanProvider",
")",
"Records",
"(",
")",
"(",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
",",
"error",
")",
"{",
"zones",
",",
"err",
":=",
"p",
".",
"Zones",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"endpoints",
":=",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
"{",
"}",
"\n",
"for",
"_",
",",
"zone",
":=",
"range",
"zones",
"{",
"records",
",",
"err",
":=",
"p",
".",
"fetchRecords",
"(",
"zone",
".",
"Name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"r",
":=",
"range",
"records",
"{",
"if",
"supportedRecordType",
"(",
"r",
".",
"Type",
")",
"{",
"name",
":=",
"r",
".",
"<mask>",
"+",
"\"",
"\"",
"+",
"zone",
".",
"Name",
"\n\n",
"// root name is identified by @ and should be",
"// translated to zone name for the endpoint entry.",
"if",
"r",
".",
"Name",
"==",
"\"",
"\"",
"{",
"name",
"=",
"zone",
".",
"Name",
"\n",
"}",
"\n\n",
"endpoints",
"=",
"append",
"(",
"endpoints",
",",
"endpoint",
".",
"NewEndpoint",
"(",
"name",
",",
"r",
".",
"Type",
",",
"r",
".",
"Data",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"endpoints",
",",
"nil",
"\n",
"}"
] |
1,090 | all-1091 | [
"GdkCairoSetSourcePixBuf",
"()",
"is",
"a",
"wrapper",
"around",
"gdk_cairo_set_source_pixbuf",
"()",
"."
] | [
"func",
"GdkCairoSetSourcePixBuf",
"(",
"cr",
"*",
"cairo",
".",
"Context",
",",
"pixbuf",
"*",
"gdk",
".",
"Pixbuf",
",",
"pixbufX",
",",
"pixbufY",
"float64",
")",
"{",
"context",
":=",
"(",
"*",
"C",
".",
"cairo_t",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"cr",
".",
"Native",
"(",
")",
")",
")",
"\n",
"ptr",
":=",
"(",
"*",
"C",
".",
"GdkPixbuf",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"pixbuf",
".",
"Native",
"(",
")",
")",
")",
"\n",
"C",
".",
"gdk_cairo_set_source_pixbuf",
"(",
"<mask>",
",",
"ptr",
",",
"C",
".",
"gdouble",
"(",
"pixbufX",
")",
",",
"C",
".",
"gdouble",
"(",
"pixbufY",
")",
")",
"\n",
"}"
] |
1,091 | all-1092 | [
"FetchDashboard",
"retrieves",
"dashboard",
"with",
"passed",
"cid",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"FetchDashboard",
"(",
"cid",
"CIDType",
")",
"(",
"*",
"Dashboard",
",",
"error",
")",
"{",
"if",
"cid",
"==",
"nil",
"||",
"*",
"cid",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"dashboardCID",
":=",
"string",
"(",
"*",
"cid",
")",
"\n\n",
"matched",
",",
"err",
":=",
"regexp",
".",
"MatchString",
"(",
"config",
".",
"DashboardCIDRegex",
",",
"dashboardCID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"!",
"matched",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"dashboardCID",
")",
"\n",
"}",
"\n\n",
"result",
",",
"err",
":=",
"a",
".",
"Get",
"(",
"string",
"(",
"*",
"cid",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"a",
".",
"Debug",
"{",
"a",
".",
"<mask>",
".",
"Printf",
"(",
"\"",
"\"",
",",
"string",
"(",
"result",
")",
")",
"\n",
"}",
"\n\n",
"dashboard",
":=",
"new",
"(",
"Dashboard",
")",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"result",
",",
"dashboard",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"dashboard",
",",
"nil",
"\n",
"}"
] |
1,092 | all-1093 | [
"Returns",
"associated",
"issue",
"or",
"0",
"if",
"it",
"can",
"t",
"find",
"any",
".",
"This",
"is",
"really",
"simple",
"and",
"could",
"be",
"improved",
"later",
"."
] | [
"func",
"findAssociatedIssue",
"(",
"<mask>",
",",
"org",
"string",
")",
"(",
"int",
",",
"error",
")",
"{",
"associatedIssueRegex",
",",
"err",
":=",
"regexp",
".",
"Compile",
"(",
"fmt",
".",
"Sprintf",
"(",
"associatedIssueRegexFormat",
",",
"org",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
"\n",
"match",
":=",
"associatedIssueRegex",
".",
"FindStringSubmatch",
"(",
"body",
")",
"\n",
"if",
"len",
"(",
"match",
")",
"==",
"0",
"{",
"return",
"0",
",",
"nil",
"\n",
"}",
"\n",
"v",
",",
"err",
":=",
"strconv",
".",
"Atoi",
"(",
"match",
"[",
"1",
"]",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
"\n",
"return",
"v",
",",
"nil",
"\n",
"}"
] |
1,093 | all-1094 | [
"MarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Marshaler",
"."
] | [
"func",
"(",
"t",
"GestureType",
")",
"MarshalEasyJSON",
"(",
"out",
"*",
"jwriter",
".",
"Writer",
")",
"{",
"<mask>",
".",
"String",
"(",
"string",
"(",
"t",
")",
")",
"\n",
"}"
] |
1,094 | all-1095 | [
"GetApmQueryOk",
"returns",
"a",
"tuple",
"with",
"the",
"ApmQuery",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"h",
"*",
"HostmapRequest",
")",
"GetApmQueryOk",
"(",
")",
"(",
"WidgetApmOrLogQuery",
",",
"bool",
")",
"{",
"if",
"h",
"==",
"nil",
"||",
"h",
".",
"ApmQuery",
"==",
"nil",
"{",
"return",
"WidgetApmOrLogQuery",
"{",
"}",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"h",
".",
"ApmQuery",
",",
"<mask>",
"\n",
"}"
] |
1,095 | all-1096 | [
"Validate",
"validates",
"all",
"rules",
"in",
"the",
"rule",
"groups",
"."
] | [
"func",
"(",
"g",
"*",
"RuleGroups",
")",
"Validate",
"(",
")",
"(",
"errs",
"[",
"]",
"error",
")",
"{",
"set",
":=",
"map",
"[",
"string",
"]",
"struct",
"{",
"}",
"{",
"}",
"\n\n",
"for",
"_",
",",
"g",
":=",
"range",
"g",
".",
"Groups",
"{",
"if",
"g",
".",
"Name",
"==",
"\"",
"\"",
"{",
"errs",
"=",
"append",
"(",
"errs",
",",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"if",
"_",
",",
"ok",
":=",
"set",
"[",
"g",
".",
"Name",
"]",
";",
"ok",
"{",
"errs",
"=",
"append",
"(",
"errs",
",",
"errors",
".",
"Errorf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
",",
"g",
".",
"Name",
")",
",",
")",
"\n",
"}",
"\n\n",
"set",
"[",
"g",
".",
"Name",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n\n",
"for",
"i",
",",
"r",
":=",
"range",
"g",
".",
"Rules",
"{",
"for",
"_",
",",
"err",
":=",
"range",
"r",
".",
"Validate",
"(",
")",
"{",
"var",
"ruleName",
"string",
"\n",
"if",
"r",
".",
"Alert",
"!=",
"\"",
"\"",
"{",
"ruleName",
"=",
"r",
".",
"Alert",
"\n",
"}",
"else",
"{",
"ruleName",
"=",
"r",
".",
"Record",
"\n",
"}",
"\n",
"errs",
"=",
"<mask>",
"(",
"errs",
",",
"&",
"Error",
"{",
"Group",
":",
"g",
".",
"Name",
",",
"Rule",
":",
"i",
",",
"RuleName",
":",
"ruleName",
",",
"Err",
":",
"err",
",",
"}",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"errs",
"\n",
"}"
] |
1,096 | all-1097 | [
"reads",
"specified",
"JSON",
"file",
"in",
"to",
"data"
] | [
"func",
"readJSON",
"(",
"bucket",
"storageBucket",
",",
"key",
"string",
",",
"data",
"<mask>",
"{",
"}",
")",
"error",
"{",
"rawData",
",",
"err",
":=",
"bucket",
".",
"readObject",
"(",
"key",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"key",
",",
"err",
")",
"\n",
"}",
"\n",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"rawData",
",",
"&",
"data",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"key",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
1,097 | all-1098 | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"."
] | [
"func",
"(",
"tg",
"*",
"Group",
")",
"UnmarshalJSON",
"(",
"b",
"[",
"]",
"byte",
")",
"error",
"{",
"g",
":=",
"struct",
"{",
"Targets",
"[",
"]",
"string",
"`json:\"targets\"`",
"\n",
"Labels",
"model",
".",
"LabelSet",
"`json:\"labels\"`",
"\n",
"}",
"{",
"}",
"\n\n",
"dec",
":=",
"json",
".",
"NewDecoder",
"(",
"bytes",
".",
"NewReader",
"(",
"b",
")",
")",
"\n",
"dec",
".",
"DisallowUnknownFields",
"(",
")",
"\n",
"if",
"err",
":=",
"dec",
".",
"Decode",
"(",
"&",
"g",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"tg",
".",
"Targets",
"=",
"make",
"(",
"[",
"]",
"model",
".",
"LabelSet",
",",
"0",
",",
"len",
"(",
"g",
".",
"Targets",
")",
")",
"\n",
"for",
"_",
",",
"t",
":=",
"range",
"g",
".",
"Targets",
"{",
"tg",
".",
"Targets",
"=",
"append",
"(",
"tg",
".",
"Targets",
",",
"<mask>",
".",
"LabelSet",
"{",
"model",
".",
"AddressLabel",
":",
"model",
".",
"LabelValue",
"(",
"t",
")",
",",
"}",
")",
"\n",
"}",
"\n",
"tg",
".",
"Labels",
"=",
"g",
".",
"Labels",
"\n",
"return",
"nil",
"\n",
"}"
] |
1,098 | all-1099 | [
"GetPixbuf",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_image_get_pixbuf",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Image",
")",
"GetPixbuf",
"(",
")",
"*",
"gdk",
".",
"Pixbuf",
"{",
"c",
":=",
"C",
".",
"gtk_image_get_pixbuf",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"<mask>",
":=",
"&",
"gdk",
".",
"Pixbuf",
"{",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"}",
"\n",
"return",
"pb",
"\n",
"}"
] |
1,099 | all-1100 | [
"HasVizType",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"HasVizType",
"(",
")",
"bool",
"{",
"if",
"w",
"!=",
"nil",
"&&",
"w",
".",
"VizType",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
Subsets and Splits