id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
listlengths 1
418
| pl_tokens
listlengths 22
4.98k
|
---|---|---|---|
15,800 | all-15801 | [
"ListPluginsWithFilters",
"takes",
"in",
"filter",
"arguments",
"and",
"returns",
"the",
"string",
"of",
"filtered",
"Plugin",
"names"
] | [
"func",
"(",
"dg",
"*",
"dockerGoClient",
")",
"ListPluginsWithFilters",
"(",
"ctx",
"context",
".",
"Context",
",",
"enabled",
"bool",
",",
"capabilities",
"[",
"]",
"string",
",",
"timeout",
"time",
".",
"Duration",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"// Create filter list",
"filterList",
":=",
"filters",
".",
"NewArgs",
"(",
"filters",
".",
"Arg",
"(",
"\"",
"\"",
",",
"strconv",
".",
"FormatBool",
"(",
"enabled",
")",
")",
")",
"\n",
"for",
"_",
",",
"capability",
":=",
"range",
"capabilities",
"{",
"filterList",
".",
"Add",
"(",
"\"",
"\"",
",",
"capability",
")",
"\n",
"}",
"\n\n",
"var",
"filteredPluginNames",
"[",
"]",
"string",
"\n",
"response",
":=",
"dg",
".",
"ListPlugins",
"(",
"ctx",
",",
"timeout",
",",
"filterList",
")",
"\n\n",
"if",
"response",
".",
"Error",
"!=",
"nil",
"{",
"return",
"nil",
",",
"response",
".",
"Error",
"\n",
"}",
"\n",
"// Create a list of the filtered plugin names",
"for",
"_",
",",
"plugin",
":=",
"range",
"response",
".",
"Plugins",
"{",
"filteredPluginNames",
"=",
"append",
"(",
"filteredPluginNames",
",",
"plugin",
".",
"<mask>",
")",
"\n",
"}",
"\n",
"return",
"filteredPluginNames",
",",
"nil",
"\n",
"}"
] |
15,801 | all-15802 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetObjectByHeapObjectIDParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler12",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
15,802 | all-15803 | [
"/",
"*",
"KeysForSection",
"returns",
"all",
"of",
"the",
"keys",
"found",
"in",
"the",
"section",
"named",
"sectionName",
"."
] | [
"func",
"(",
"config",
"*",
"Config",
")",
"KeysForSection",
"(",
"sectionName",
"string",
")",
"[",
"]",
"string",
"{",
"section",
":=",
"config",
".",
"sectionForName",
"(",
"sectionName",
")",
"\n\n",
"if",
"section",
"!=",
"nil",
"{",
"keys",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
",",
"len",
"(",
"section",
".",
"values",
")",
")",
"\n",
"for",
"key",
":=",
"range",
"section",
".",
"<mask>",
"{",
"keys",
"=",
"append",
"(",
"keys",
",",
"key",
")",
"\n",
"}",
"\n",
"sort",
".",
"Strings",
"(",
"keys",
")",
"\n",
"return",
"keys",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
15,803 | all-15804 | [
"FindSequencesOnDisk",
"searches",
"a",
"given",
"directory",
"path",
"and",
"sorts",
"all",
"valid",
"sequence",
"-",
"compatible",
"files",
"into",
"a",
"list",
"of",
"FileSequences",
"By",
"default",
"only",
"non",
"-",
"hidden",
"sequences",
"of",
"files",
"will",
"be",
"returned",
".",
"Extra",
"FileOption",
"values",
"may",
"be",
"given",
"to",
"control",
"whether",
"things",
"like",
"hidden",
"files",
"or",
"single",
"(",
"non",
"-",
"sequence",
")",
"files",
"should",
"be",
"included",
"in",
"the",
"search",
"results",
".",
"If",
"there",
"are",
"any",
"errors",
"reading",
"the",
"directory",
"or",
"the",
"files",
"a",
"non",
"-",
"nil",
"error",
"will",
"be",
"returned",
"."
] | [
"func",
"FindSequencesOnDisk",
"(",
"path",
"string",
",",
"opts",
"...",
"FileOption",
")",
"(",
"FileSequences",
",",
"error",
")",
"{",
"return",
"findSequencesOnDisk",
"(",
"<mask>",
",",
"opts",
"...",
")",
"\n",
"}"
] |
15,804 | all-15805 | [
"invalidate",
"the",
"content",
"of",
"a",
"region",
"of",
"some",
"or",
"all",
"of",
"a",
"framebuffer",
"s",
"attachments"
] | [
"func",
"InvalidateNamedFramebufferSubData",
"(",
"framebuffer",
"uint32",
",",
"numAttachments",
"int32",
",",
"attachments",
"*",
"uint32",
",",
"x",
"int32",
",",
"y",
"int32",
",",
"width",
"int32",
",",
"height",
"int32",
")",
"{",
"syscall",
".",
"Syscall9",
"(",
"gpInvalidateNamedFramebufferSubData",
",",
"7",
",",
"uintptr",
"(",
"framebuffer",
")",
",",
"uintptr",
"(",
"numAttachments",
")",
",",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"attachments",
")",
")",
",",
"uintptr",
"(",
"x",
")",
",",
"uintptr",
"(",
"y",
")",
",",
"uintptr",
"(",
"<mask>",
")",
",",
"uintptr",
"(",
"height",
")",
",",
"0",
",",
"0",
")",
"\n",
"}"
] |
15,805 | all-15806 | [
"NewCORSHandler",
"creates",
"a",
"new",
"CORSHandler",
"with",
"default",
"values",
"."
] | [
"func",
"NewCORSHandler",
"(",
")",
"*",
"CORSHandler",
"{",
"return",
"&",
"CORSHandler",
"{",
"PredicateOrigin",
":",
"raiqub",
".",
"TrueForAll",
",",
"Headers",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"}",
",",
"ExposedHeaders",
":",
"<mask>",
"(",
"[",
"]",
"string",
",",
"0",
")",
",",
"}",
"\n",
"}"
] |
15,806 | all-15807 | [
"MapToTags",
"converts",
"a",
"map",
"to",
"a",
"slice",
"of",
"tags",
"."
] | [
"func",
"MapToTags",
"(",
"tagsMap",
"map",
"[",
"string",
"]",
"string",
")",
"[",
"]",
"*",
"ecs",
".",
"Tag",
"{",
"tags",
":=",
"make",
"(",
"[",
"]",
"*",
"ecs",
".",
"Tag",
",",
"0",
")",
"\n",
"if",
"tagsMap",
"==",
"nil",
"{",
"return",
"tags",
"\n",
"}",
"\n\n",
"for",
"key",
",",
"value",
":=",
"range",
"tagsMap",
"{",
"<mask>",
"=",
"append",
"(",
"tags",
",",
"&",
"ecs",
".",
"Tag",
"{",
"Key",
":",
"aws",
".",
"String",
"(",
"key",
")",
",",
"Value",
":",
"aws",
".",
"String",
"(",
"value",
")",
",",
"}",
")",
"\n",
"}",
"\n\n",
"return",
"tags",
"\n",
"}"
] |
15,807 | all-15808 | [
"----------------------------------------",
"cdc",
".",
"encodeReflectBinary",
"This",
"is",
"the",
"main",
"entrypoint",
"for",
"encoding",
"all",
"types",
"in",
"binary",
"form",
".",
"This",
"function",
"calls",
"encodeReflectBinary",
"*",
"and",
"generally",
"those",
"functions",
"should",
"only",
"call",
"this",
"one",
"for",
"the",
"prefix",
"bytes",
"are",
"only",
"written",
"here",
".",
"The",
"value",
"may",
"be",
"a",
"nil",
"interface",
"but",
"not",
"a",
"nil",
"pointer",
".",
"The",
"following",
"contracts",
"apply",
"to",
"all",
"similar",
"encode",
"methods",
".",
"CONTRACT",
":",
"rv",
"is",
"not",
"a",
"pointer",
"CONTRACT",
":",
"rv",
"is",
"valid",
"."
] | [
"func",
"(",
"cdc",
"*",
"Codec",
")",
"encodeReflectBinary",
"(",
"w",
"io",
".",
"Writer",
",",
"info",
"*",
"TypeInfo",
",",
"rv",
"reflect",
".",
"Value",
",",
"fopts",
"FieldOptions",
",",
"bare",
"bool",
")",
"(",
"err",
"error",
")",
"{",
"if",
"rv",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Ptr",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"!",
"rv",
".",
"IsValid",
"(",
")",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"printLog",
"{",
"spew",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"info",
",",
"rv",
".",
"Interface",
"(",
")",
",",
"rv",
".",
"Type",
"(",
")",
",",
"fopts",
")",
"\n",
"defer",
"func",
"(",
")",
"{",
"fmt",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"err",
")",
"\n",
"}",
"(",
")",
"\n",
"}",
"\n\n",
"// Handle override if rv implements json.Marshaler.",
"if",
"info",
".",
"IsAminoMarshaler",
"{",
"// First, encode rv into repr instance.",
"var",
"rrv",
",",
"rinfo",
"=",
"reflect",
".",
"Value",
"{",
"}",
",",
"(",
"*",
"TypeInfo",
")",
"(",
"nil",
")",
"\n",
"rrv",
",",
"err",
"=",
"toReprObject",
"(",
"rv",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"rinfo",
",",
"err",
"=",
"cdc",
".",
"getTypeInfo_wlock",
"(",
"<mask>",
".",
"AminoMarshalReprType",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"// Then, encode the repr instance.",
"err",
"=",
"cdc",
".",
"encodeReflectBinary",
"(",
"w",
",",
"rinfo",
",",
"rrv",
",",
"fopts",
",",
"bare",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"switch",
"info",
".",
"Type",
".",
"Kind",
"(",
")",
"{",
"//----------------------------------------",
"// Complex",
"case",
"reflect",
".",
"Interface",
":",
"err",
"=",
"cdc",
".",
"encodeReflectBinaryInterface",
"(",
"w",
",",
"info",
",",
"rv",
",",
"fopts",
",",
"bare",
")",
"\n\n",
"case",
"reflect",
".",
"Array",
":",
"if",
"info",
".",
"Type",
".",
"Elem",
"(",
")",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Uint8",
"{",
"err",
"=",
"cdc",
".",
"encodeReflectBinaryByteArray",
"(",
"w",
",",
"info",
",",
"rv",
",",
"fopts",
")",
"\n",
"}",
"else",
"{",
"err",
"=",
"cdc",
".",
"encodeReflectBinaryList",
"(",
"w",
",",
"info",
",",
"rv",
",",
"fopts",
",",
"bare",
")",
"\n",
"}",
"\n\n",
"case",
"reflect",
".",
"Slice",
":",
"if",
"info",
".",
"Type",
".",
"Elem",
"(",
")",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Uint8",
"{",
"err",
"=",
"cdc",
".",
"encodeReflectBinaryByteSlice",
"(",
"w",
",",
"info",
",",
"rv",
",",
"fopts",
")",
"\n",
"}",
"else",
"{",
"err",
"=",
"cdc",
".",
"encodeReflectBinaryList",
"(",
"w",
",",
"info",
",",
"rv",
",",
"fopts",
",",
"bare",
")",
"\n",
"}",
"\n\n",
"case",
"reflect",
".",
"Struct",
":",
"err",
"=",
"cdc",
".",
"encodeReflectBinaryStruct",
"(",
"w",
",",
"info",
",",
"rv",
",",
"fopts",
",",
"bare",
")",
"\n\n",
"//----------------------------------------",
"// Signed",
"case",
"reflect",
".",
"Int64",
":",
"if",
"fopts",
".",
"BinFixed64",
"{",
"err",
"=",
"EncodeInt64",
"(",
"w",
",",
"rv",
".",
"Int",
"(",
")",
")",
"\n",
"}",
"else",
"{",
"err",
"=",
"EncodeUvarint",
"(",
"w",
",",
"uint64",
"(",
"rv",
".",
"Int",
"(",
")",
")",
")",
"\n",
"}",
"\n\n",
"case",
"reflect",
".",
"Int32",
":",
"if",
"fopts",
".",
"BinFixed32",
"{",
"err",
"=",
"EncodeInt32",
"(",
"w",
",",
"int32",
"(",
"rv",
".",
"Int",
"(",
")",
")",
")",
"\n",
"}",
"else",
"{",
"err",
"=",
"EncodeUvarint",
"(",
"w",
",",
"uint64",
"(",
"rv",
".",
"Int",
"(",
")",
")",
")",
"\n",
"}",
"\n\n",
"case",
"reflect",
".",
"Int16",
":",
"err",
"=",
"EncodeInt16",
"(",
"w",
",",
"int16",
"(",
"rv",
".",
"Int",
"(",
")",
")",
")",
"\n\n",
"case",
"reflect",
".",
"Int8",
":",
"err",
"=",
"EncodeInt8",
"(",
"w",
",",
"int8",
"(",
"rv",
".",
"Int",
"(",
")",
")",
")",
"\n\n",
"case",
"reflect",
".",
"Int",
":",
"err",
"=",
"EncodeUvarint",
"(",
"w",
",",
"uint64",
"(",
"rv",
".",
"Int",
"(",
")",
")",
")",
"\n\n",
"//----------------------------------------",
"// Unsigned",
"case",
"reflect",
".",
"Uint64",
":",
"if",
"fopts",
".",
"BinFixed64",
"{",
"err",
"=",
"EncodeUint64",
"(",
"w",
",",
"rv",
".",
"Uint",
"(",
")",
")",
"\n",
"}",
"else",
"{",
"err",
"=",
"EncodeUvarint",
"(",
"w",
",",
"rv",
".",
"Uint",
"(",
")",
")",
"\n",
"}",
"\n\n",
"case",
"reflect",
".",
"Uint32",
":",
"if",
"fopts",
".",
"BinFixed32",
"{",
"err",
"=",
"EncodeUint32",
"(",
"w",
",",
"uint32",
"(",
"rv",
".",
"Uint",
"(",
")",
")",
")",
"\n",
"}",
"else",
"{",
"err",
"=",
"EncodeUvarint",
"(",
"w",
",",
"rv",
".",
"Uint",
"(",
")",
")",
"\n",
"}",
"\n\n",
"case",
"reflect",
".",
"Uint16",
":",
"err",
"=",
"EncodeUint16",
"(",
"w",
",",
"uint16",
"(",
"rv",
".",
"Uint",
"(",
")",
")",
")",
"\n\n",
"case",
"reflect",
".",
"Uint8",
":",
"err",
"=",
"EncodeUint8",
"(",
"w",
",",
"uint8",
"(",
"rv",
".",
"Uint",
"(",
")",
")",
")",
"\n\n",
"case",
"reflect",
".",
"Uint",
":",
"err",
"=",
"EncodeUvarint",
"(",
"w",
",",
"rv",
".",
"Uint",
"(",
")",
")",
"\n\n",
"//----------------------------------------",
"// Misc",
"case",
"reflect",
".",
"Bool",
":",
"err",
"=",
"EncodeBool",
"(",
"w",
",",
"rv",
".",
"Bool",
"(",
")",
")",
"\n\n",
"case",
"reflect",
".",
"Float64",
":",
"if",
"!",
"fopts",
".",
"Unsafe",
"{",
"err",
"=",
"errors",
".",
"New",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
"err",
"=",
"EncodeFloat64",
"(",
"w",
",",
"rv",
".",
"Float",
"(",
")",
")",
"\n\n",
"case",
"reflect",
".",
"Float32",
":",
"if",
"!",
"fopts",
".",
"Unsafe",
"{",
"err",
"=",
"errors",
".",
"New",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
"err",
"=",
"EncodeFloat32",
"(",
"w",
",",
"float32",
"(",
"rv",
".",
"Float",
"(",
")",
")",
")",
"\n\n",
"case",
"reflect",
".",
"String",
":",
"err",
"=",
"EncodeString",
"(",
"w",
",",
"rv",
".",
"String",
"(",
")",
")",
"\n\n",
"//----------------------------------------",
"// Default",
"default",
":",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"info",
".",
"Type",
".",
"Kind",
"(",
")",
")",
")",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
] |
15,808 | all-15809 | [
"GetQueryOk",
"returns",
"a",
"tuple",
"with",
"the",
"Query",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"g",
"*",
"GraphEvent",
")",
"GetQueryOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"g",
"==",
"nil",
"||",
"g",
".",
"Query",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"g",
".",
"<mask>",
",",
"true",
"\n",
"}"
] |
15,809 | all-15810 | [
"CopyPixels",
"is",
"basically",
"same",
"as",
"Pixels",
"and",
"ReplacePixels",
"but",
"reading",
"pixels",
"from",
"GPU",
"is",
"done",
"lazily",
"."
] | [
"func",
"(",
"i",
"*",
"Image",
")",
"CopyPixels",
"(",
"src",
"*",
"Image",
")",
"{",
"if",
"i",
".",
"lastCommand",
"==",
"lastCommandDrawTriangles",
"{",
"if",
"i",
".",
"width",
"!=",
"src",
".",
"width",
"||",
"i",
".",
"height",
"!=",
"src",
".",
"<mask>",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"c",
":=",
"&",
"copyPixelsCommand",
"{",
"dst",
":",
"i",
",",
"src",
":",
"src",
",",
"}",
"\n",
"theCommandQueue",
".",
"Enqueue",
"(",
"c",
")",
"\n\n",
"// The execution is basically same as replacing pixels.",
"i",
".",
"lastCommand",
"=",
"lastCommandReplacePixels",
"\n",
"}"
] |
15,810 | all-15811 | [
"Client",
"returns",
"a",
"Kubernetes",
"client",
"."
] | [
"func",
"(",
"o",
"*",
"KubernetesOptions",
")",
"Client",
"(",
"namespace",
"string",
",",
"dryRun",
"bool",
")",
"(",
"*",
"kube",
".",
"<mask>",
",",
"error",
")",
"{",
"if",
"dryRun",
"{",
"return",
"kube",
".",
"NewFakeClient",
"(",
"o",
".",
"DeckURI",
")",
",",
"nil",
"\n",
"}",
"\n\n",
"if",
"o",
".",
"cluster",
"==",
"\"",
"\"",
"{",
"return",
"kube",
".",
"NewClientInCluster",
"(",
"namespace",
")",
"\n",
"}",
"\n\n",
"return",
"kube",
".",
"NewClientFromFile",
"(",
"o",
".",
"cluster",
",",
"namespace",
")",
"\n",
"}"
] |
15,811 | all-15812 | [
"GetItemAtPos",
"is",
"a",
"wrapper",
"around",
"gtk_icon_view_get_item_at_pos",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"IconView",
")",
"GetItemAtPos",
"(",
"x",
",",
"y",
"int",
")",
"(",
"*",
"TreePath",
",",
"*",
"CellRenderer",
")",
"{",
"var",
"(",
"cpath",
"*",
"C",
".",
"GtkTreePath",
"\n",
"ccell",
"*",
"C",
".",
"GtkCellRenderer",
"\n",
"path",
"*",
"TreePath",
"\n",
"<mask>",
"*",
"CellRenderer",
"\n",
")",
"\n\n",
"C",
".",
"gtk_icon_view_get_item_at_pos",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"x",
")",
",",
"C",
".",
"gint",
"(",
"y",
")",
",",
"&",
"cpath",
",",
"&",
"ccell",
")",
"\n\n",
"if",
"cpath",
"!=",
"nil",
"{",
"path",
"=",
"&",
"TreePath",
"{",
"cpath",
"}",
"\n",
"runtime",
".",
"SetFinalizer",
"(",
"path",
",",
"(",
"*",
"TreePath",
")",
".",
"free",
")",
"\n",
"}",
"\n\n",
"if",
"ccell",
"!=",
"nil",
"{",
"cell",
"=",
"wrapCellRenderer",
"(",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"ccell",
")",
")",
")",
"\n",
"}",
"\n\n",
"return",
"path",
",",
"cell",
"\n",
"}"
] |
15,812 | all-15813 | [
"get",
"gets",
"the",
"modified",
"created",
"revision",
"and",
"version",
"of",
"the",
"key",
"that",
"satisfies",
"the",
"given",
"atRev",
".",
"Rev",
"must",
"be",
"higher",
"than",
"or",
"equal",
"to",
"the",
"given",
"atRev",
"."
] | [
"func",
"(",
"ki",
"*",
"keyIndex",
")",
"get",
"(",
"lg",
"*",
"zap",
".",
"Logger",
",",
"atRev",
"int64",
")",
"(",
"modified",
",",
"created",
"revision",
",",
"ver",
"int64",
",",
"err",
"error",
")",
"{",
"if",
"ki",
".",
"isEmpty",
"(",
")",
"{",
"if",
"lg",
"!=",
"nil",
"{",
"lg",
".",
"Panic",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"string",
"(",
"ki",
".",
"key",
")",
")",
",",
")",
"\n",
"}",
"else",
"{",
"plog",
".",
"Panicf",
"(",
"\"",
"\"",
",",
"string",
"(",
"ki",
".",
"key",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"g",
":=",
"ki",
".",
"findGeneration",
"(",
"atRev",
")",
"\n",
"if",
"g",
".",
"isEmpty",
"(",
")",
"{",
"return",
"revision",
"{",
"}",
",",
"revision",
"{",
"}",
",",
"0",
",",
"ErrRevisionNotFound",
"\n",
"}",
"\n\n",
"n",
":=",
"g",
".",
"walk",
"(",
"func",
"(",
"rev",
"revision",
")",
"bool",
"{",
"return",
"<mask>",
".",
"main",
">",
"atRev",
"}",
")",
"\n",
"if",
"n",
"!=",
"-",
"1",
"{",
"return",
"g",
".",
"revs",
"[",
"n",
"]",
",",
"g",
".",
"created",
",",
"g",
".",
"ver",
"-",
"int64",
"(",
"len",
"(",
"g",
".",
"revs",
")",
"-",
"n",
"-",
"1",
")",
",",
"nil",
"\n",
"}",
"\n\n",
"return",
"revision",
"{",
"}",
",",
"revision",
"{",
"}",
",",
"0",
",",
"ErrRevisionNotFound",
"\n",
"}"
] |
15,813 | all-15814 | [
"SaveSnapshot",
"downloads",
"a",
"snapshot",
"file",
"from",
"this",
"member",
"locally",
".",
"It",
"s",
"meant",
"to",
"requested",
"remotely",
"so",
"that",
"local",
"member",
"can",
"store",
"snapshot",
"file",
"on",
"local",
"disk",
"."
] | [
"func",
"(",
"m",
"*",
"Member",
")",
"SaveSnapshot",
"(",
"lg",
"*",
"zap",
".",
"Logger",
")",
"(",
"err",
"error",
")",
"{",
"// remove existing snapshot first",
"if",
"err",
"=",
"os",
".",
"RemoveAll",
"(",
"m",
".",
"SnapshotPath",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"var",
"ccfg",
"*",
"clientv3",
".",
"Config",
"\n",
"ccfg",
",",
"err",
"=",
"m",
".",
"CreateEtcdClientConfig",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
",",
"m",
".",
"EtcdClientEndpoint",
")",
"\n",
"}",
"\n\n",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"Etcd",
".",
"Name",
")",
",",
"zap",
".",
"Strings",
"(",
"\"",
"\"",
",",
"m",
".",
"Etcd",
".",
"AdvertiseClientURLs",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotPath",
")",
",",
")",
"\n",
"now",
":=",
"time",
".",
"Now",
"(",
")",
"\n",
"mgr",
":=",
"snapshot",
".",
"NewV3",
"(",
"lg",
")",
"\n",
"if",
"err",
"=",
"mgr",
".",
"Save",
"(",
"context",
".",
"Background",
"(",
")",
",",
"*",
"ccfg",
",",
"m",
".",
"SnapshotPath",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"took",
":=",
"<mask>",
".",
"Since",
"(",
"now",
")",
"\n\n",
"var",
"fi",
"os",
".",
"FileInfo",
"\n",
"fi",
",",
"err",
"=",
"os",
".",
"Stat",
"(",
"m",
".",
"SnapshotPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"var",
"st",
"snapshot",
".",
"Status",
"\n",
"st",
",",
"err",
"=",
"mgr",
".",
"Status",
"(",
"m",
".",
"SnapshotPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"m",
".",
"SnapshotInfo",
"=",
"&",
"SnapshotInfo",
"{",
"MemberName",
":",
"m",
".",
"Etcd",
".",
"Name",
",",
"MemberClientURLs",
":",
"m",
".",
"Etcd",
".",
"AdvertiseClientURLs",
",",
"SnapshotPath",
":",
"m",
".",
"SnapshotPath",
",",
"SnapshotFileSize",
":",
"humanize",
".",
"Bytes",
"(",
"uint64",
"(",
"fi",
".",
"Size",
"(",
")",
")",
")",
",",
"SnapshotTotalSize",
":",
"humanize",
".",
"Bytes",
"(",
"uint64",
"(",
"st",
".",
"TotalSize",
")",
")",
",",
"SnapshotTotalKey",
":",
"int64",
"(",
"st",
".",
"TotalKey",
")",
",",
"SnapshotHash",
":",
"int64",
"(",
"st",
".",
"Hash",
")",
",",
"SnapshotRevision",
":",
"st",
".",
"Revision",
",",
"Took",
":",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"took",
")",
",",
"}",
"\n",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotInfo",
".",
"MemberName",
")",
",",
"zap",
".",
"Strings",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotInfo",
".",
"MemberClientURLs",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotPath",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotInfo",
".",
"SnapshotFileSize",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotInfo",
".",
"SnapshotTotalSize",
")",
",",
"zap",
".",
"Int64",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotInfo",
".",
"SnapshotTotalKey",
")",
",",
"zap",
".",
"Int64",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotInfo",
".",
"SnapshotHash",
")",
",",
"zap",
".",
"Int64",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotInfo",
".",
"SnapshotRevision",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"m",
".",
"SnapshotInfo",
".",
"Took",
")",
",",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
15,814 | all-15815 | [
"Properties",
"is",
"a",
"convenience",
"method",
"that",
"wraps",
"fetching",
"the",
"StoragePod",
"MO",
"from",
"its",
"higher",
"-",
"level",
"object",
"."
] | [
"func",
"Properties",
"(",
"pod",
"*",
"object",
".",
"StoragePod",
")",
"(",
"*",
"mo",
".",
"StoragePod",
",",
"error",
")",
"{",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"<mask>",
".",
"Background",
"(",
")",
",",
"provider",
".",
"DefaultAPITimeout",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n",
"var",
"props",
"mo",
".",
"StoragePod",
"\n",
"if",
"err",
":=",
"pod",
".",
"Properties",
"(",
"ctx",
",",
"pod",
".",
"Reference",
"(",
")",
",",
"nil",
",",
"&",
"props",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"&",
"props",
",",
"nil",
"\n",
"}"
] |
15,815 | all-15816 | [
"Use",
"SOAP",
"to",
"fetch",
"all",
"records",
"with",
"a",
"single",
"call"
] | [
"func",
"(",
"d",
"*",
"dynProviderState",
")",
"fetchAllRecordsInZone",
"(",
"zone",
"string",
")",
"(",
"*",
"dynectsoap",
".",
"GetAllRecordsResponseType",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"client",
":=",
"dynectsoap",
".",
"NewClient",
"(",
"\"",
"\"",
")",
"\n",
"service",
":=",
"dynectsoap",
".",
"NewDynect",
"(",
"client",
")",
"\n\n",
"sessionRequest",
":=",
"dynectsoap",
".",
"SessionLoginRequestType",
"{",
"Customer_name",
":",
"d",
".",
"CustomerName",
",",
"User_name",
":",
"d",
".",
"Username",
",",
"Password",
":",
"d",
".",
"Password",
",",
"Fault_incompat",
":",
"0",
",",
"}",
"\n",
"resp",
":=",
"dynectsoap",
".",
"SessionLoginResponseType",
"{",
"}",
"\n",
"err",
"=",
"apiRetryLoop",
"(",
"func",
"(",
")",
"error",
"{",
"return",
"service",
".",
"Do",
"(",
"&",
"sessionRequest",
",",
"&",
"resp",
")",
"\n",
"}",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"token",
":=",
"resp",
".",
"Data",
".",
"Token",
"\n\n",
"logoutRequest",
":=",
"dynectsoap",
".",
"SessionLogoutRequestType",
"{",
"Token",
":",
"token",
",",
"Fault_incompat",
":",
"0",
",",
"}",
"\n",
"logoutResponse",
":=",
"dynectsoap",
".",
"SessionLogoutResponseType",
"{",
"}",
"\n",
"defer",
"service",
".",
"Do",
"(",
"&",
"logoutRequest",
",",
"&",
"logoutResponse",
")",
"\n\n",
"req",
":=",
"dynectsoap",
".",
"GetAllRecordsRequestType",
"{",
"Token",
":",
"<mask>",
",",
"Zone",
":",
"zone",
",",
"Fault_incompat",
":",
"0",
",",
"}",
"\n",
"records",
":=",
"dynectsoap",
".",
"GetAllRecordsResponseType",
"{",
"}",
"\n",
"err",
"=",
"apiRetryLoop",
"(",
"func",
"(",
")",
"error",
"{",
"return",
"service",
".",
"Do",
"(",
"&",
"req",
",",
"&",
"records",
")",
"\n",
"}",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"log",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"records",
".",
"Status",
")",
"\n\n",
"if",
"strings",
".",
"ToLower",
"(",
"records",
".",
"Status",
")",
"==",
"\"",
"\"",
"{",
"jobRequest",
":=",
"dynectsoap",
".",
"GetJobRequestType",
"{",
"Token",
":",
"token",
",",
"Job_id",
":",
"records",
".",
"Job_id",
",",
"Fault_incompat",
":",
"0",
",",
"}",
"\n\n",
"jobResults",
":=",
"dynectsoap",
".",
"GetJobResponseType",
"{",
"}",
"\n",
"err",
"=",
"apiRetryLoop",
"(",
"func",
"(",
")",
"error",
"{",
"return",
"service",
".",
"GetJobRetry",
"(",
"&",
"jobRequest",
",",
"&",
"jobResults",
")",
"\n",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"jobResults",
".",
"Data",
".",
"(",
"*",
"dynectsoap",
".",
"GetAllRecordsResponseType",
")",
",",
"nil",
"\n",
"}",
"\n\n",
"return",
"&",
"records",
",",
"nil",
"\n\n",
"}"
] |
15,816 | all-15817 | [
"handleReset",
":",
"Handler",
"for",
"/",
"reset",
"Method",
":",
"POST",
"URL",
"Params",
":",
"Required",
":",
"type",
"=",
"[",
"string",
"]",
":",
"type",
"of",
"resource",
"in",
"interest",
"Required",
":",
"state",
"=",
"[",
"string",
"]",
":",
"original",
"state",
"Required",
":",
"dest",
"=",
"[",
"string",
"]",
":",
"dest",
"state",
"for",
"expired",
"resource",
"Required",
":",
"expire",
"=",
"[",
"durationStr",
"*",
"]",
"resource",
"has",
"not",
"been",
"updated",
"since",
"before",
"{",
"expire",
"}",
"."
] | [
"func",
"handleReset",
"(",
"r",
"*",
"ranch",
".",
"Ranch",
")",
"http",
".",
"HandlerFunc",
"{",
"return",
"func",
"(",
"res",
"http",
".",
"ResponseWriter",
",",
"req",
"*",
"http",
".",
"Request",
")",
"{",
"logrus",
".",
"WithField",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
".",
"Infof",
"(",
"\"",
"\"",
",",
"req",
".",
"RemoteAddr",
")",
"\n\n",
"if",
"req",
".",
"Method",
"!=",
"http",
".",
"MethodPost",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"req",
".",
"Method",
")",
"\n",
"logrus",
".",
"Warning",
"(",
"msg",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"msg",
",",
"<mask>",
".",
"StatusMethodNotAllowed",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"rtype",
":=",
"req",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"state",
":=",
"req",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"expireStr",
":=",
"req",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"dest",
":=",
"req",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n\n",
"logrus",
".",
"Infof",
"(",
"\"",
"\"",
",",
"rtype",
",",
"state",
",",
"expireStr",
",",
"dest",
")",
"\n\n",
"if",
"rtype",
"==",
"\"",
"\"",
"||",
"state",
"==",
"\"",
"\"",
"||",
"expireStr",
"==",
"\"",
"\"",
"||",
"dest",
"==",
"\"",
"\"",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"rtype",
",",
"state",
",",
"expireStr",
",",
"dest",
")",
"\n",
"logrus",
".",
"Warning",
"(",
"msg",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"msg",
",",
"http",
".",
"StatusBadRequest",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"expire",
",",
"err",
":=",
"time",
".",
"ParseDuration",
"(",
"expireStr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logrus",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"expireStr",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"err",
".",
"Error",
"(",
")",
",",
"http",
".",
"StatusBadRequest",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"rmap",
",",
"err",
":=",
"r",
".",
"Reset",
"(",
"rtype",
",",
"state",
",",
"expire",
",",
"dest",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logrus",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"err",
".",
"Error",
"(",
")",
",",
"http",
".",
"StatusBadRequest",
")",
"\n",
"return",
"\n",
"}",
"\n",
"resJSON",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"rmap",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"logrus",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"rmap",
")",
"\n",
"http",
".",
"Error",
"(",
"res",
",",
"err",
".",
"Error",
"(",
")",
",",
"ErrorToStatus",
"(",
"err",
")",
")",
"\n",
"return",
"\n",
"}",
"\n",
"logrus",
".",
"Infof",
"(",
"\"",
"\"",
",",
"rtype",
",",
"len",
"(",
"rmap",
")",
",",
"dest",
")",
"\n",
"fmt",
".",
"Fprint",
"(",
"res",
",",
"string",
"(",
"resJSON",
")",
")",
"\n",
"}",
"\n",
"}"
] |
15,817 | all-15818 | [
"expandClusterFailoverHostAdmissionControlPolicy",
"reads",
"certain",
"ResourceData",
"keys",
"and",
"returns",
"a",
"ClusterFailoverHostAdmissionControlPolicy",
"."
] | [
"func",
"expandClusterFailoverHostAdmissionControlPolicy",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"version",
"viapi",
".",
"VSphereVersion",
",",
")",
"*",
"<mask>",
".",
"ClusterFailoverHostAdmissionControlPolicy",
"{",
"obj",
":=",
"&",
"types",
".",
"ClusterFailoverHostAdmissionControlPolicy",
"{",
"FailoverHosts",
":",
"structure",
".",
"SliceInterfacesToManagedObjectReferences",
"(",
"d",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"*",
"schema",
".",
"Set",
")",
".",
"List",
"(",
")",
",",
"\"",
"\"",
",",
")",
",",
"}",
"\n\n",
"if",
"version",
".",
"Newer",
"(",
"viapi",
".",
"VSphereVersion",
"{",
"Product",
":",
"version",
".",
"Product",
",",
"Major",
":",
"6",
",",
"Minor",
":",
"5",
"}",
")",
"{",
"obj",
".",
"FailoverLevel",
"=",
"int32",
"(",
"d",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"int",
")",
")",
"\n",
"}",
"\n\n",
"return",
"obj",
"\n",
"}"
] |
15,818 | all-15819 | [
"New",
"returns",
"a",
"new",
"parser",
"of",
"the",
"byte",
"slice",
"."
] | [
"func",
"NewPromParser",
"(",
"b",
"[",
"]",
"byte",
")",
"<mask>",
"{",
"return",
"&",
"PromParser",
"{",
"l",
":",
"&",
"promlexer",
"{",
"b",
":",
"append",
"(",
"b",
",",
"'\\n'",
")",
"}",
"}",
"\n",
"}"
] |
15,819 | all-15820 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"ExposeDevToolsProtocolParams",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget12",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
15,820 | all-15821 | [
"Step",
"1",
"is",
"the",
"removal",
"of",
"standard",
"suffixes"
] | [
"func",
"step1",
"(",
"word",
"*",
"snowballword",
".",
"SnowballWord",
")",
"bool",
"{",
"suffix",
",",
"suffixRunes",
":=",
"word",
".",
"FirstSuffix",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
",",
" ",
"i",
",",
" ",
"i",
",",
" ",
"i",
",",
" ",
"e",
",",
" ",
"e",
",",
" ",
"e",
",",
" ",
"a",
",",
"",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
",",
" ",
"e",
",",
" ",
"a",
",",
" ",
"i",
",",
" ",
"i",
",",
" ",
"i",
",",
"",
")",
"\n\n",
"if",
"suffix",
"==",
"\"",
"\"",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"isInR1",
":=",
"(",
"word",
".",
"R1start",
"<=",
"len",
"(",
"word",
".",
"RS",
")",
"-",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"isInR2",
":=",
"(",
"<mask>",
".",
"R2start",
"<=",
"len",
"(",
"word",
".",
"RS",
")",
"-",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"isInRV",
":=",
"(",
"word",
".",
"RVstart",
"<=",
"len",
"(",
"word",
".",
"RS",
")",
"-",
"len",
"(",
"suffixRunes",
")",
")",
"\n\n",
"// Handle simple replacements & deletions in R2 first",
"if",
"isInR2",
"{",
"// Handle simple replacements in R2",
"repl",
":=",
"\"",
"\"",
"\n",
"switch",
"suffix",
"{",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"repl",
"=",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"repl",
"=",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"repl",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"if",
"repl",
"!=",
"\"",
"\"",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"suffixRunes",
",",
"[",
"]",
"rune",
"(",
"repl",
")",
",",
"true",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"// Handle simple deletions in R2",
"switch",
"suffix",
"{",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Handle simple replacements in RV",
"if",
"isInRV",
"{",
"// NOTE: these are \"special\" suffixes in that",
"// we must still do steps 2a and 2b of the",
"// French stemmer even when these suffixes are",
"// found in step1. Therefore, we are returning",
"// `false` here.",
"repl",
":=",
"\"",
"\"",
"\n",
"switch",
"suffix",
"{",
"case",
"\"",
"\"",
":",
"repl",
"=",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
":",
"repl",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"if",
"repl",
"!=",
"\"",
"\"",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"suffixRunes",
",",
"[",
"]",
"rune",
"(",
"repl",
")",
",",
"true",
")",
"\n",
"return",
"false",
"\n",
"}",
"\n\n",
"// Delete if preceded by a vowel that is also in RV",
"if",
"suffix",
"==",
"\"",
"\"",
"||",
"suffix",
"==",
"\"",
"\"",
"{",
"idx",
":=",
"len",
"(",
"word",
".",
"RS",
")",
"-",
"len",
"(",
"suffixRunes",
")",
"-",
"1",
"\n",
"if",
"idx",
">=",
"word",
".",
"RVstart",
"&&",
"isLowerVowel",
"(",
"word",
".",
"RS",
"[",
"idx",
"]",
")",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"return",
"false",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Handle all the other \"special\" cases. All of these",
"// return true immediately after changing the word.",
"//",
"switch",
"suffix",
"{",
"case",
"\"",
"\"",
":",
"// Replace with eau",
"word",
".",
"ReplaceSuffixRunes",
"(",
"suffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"return",
"true",
"\n\n",
"case",
"\"",
"\"",
":",
"// Replace with al if in R1",
"if",
"isInR1",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"suffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"// Delete if in R2, else replace by eux if in R1",
"if",
"isInR2",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"return",
"true",
"\n",
"}",
"else",
"if",
"isInR1",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"suffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"// Delete if in R1 and preceded by a non-vowel",
"if",
"isInR1",
"{",
"idx",
":=",
"len",
"(",
"word",
".",
"RS",
")",
"-",
"len",
"(",
"suffixRunes",
")",
"-",
"1",
"\n",
"if",
"idx",
">=",
"0",
"&&",
"isLowerVowel",
"(",
"word",
".",
"RS",
"[",
"idx",
"]",
")",
"==",
"false",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"false",
"\n\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"// Delete if in R2",
"if",
"isInR2",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n\n",
"// If preceded by \"ic\", delete if in R2, else replace by \"iqU\".",
"newSuffix",
",",
"newSuffixRunes",
":=",
"word",
".",
"FirstSuffix",
"(",
"\"",
"\"",
")",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"if",
"word",
".",
"FitsInR2",
"(",
"len",
"(",
"newSuffixRunes",
")",
")",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"newSuffixRunes",
")",
")",
"\n",
"}",
"else",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"newSuffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"if",
"isInRV",
"{",
"// Delete if in RV",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n\n",
"// If preceded by \"iv\", delete if in R2",
"// (and if further preceded by \"at\", delete if in R2)",
"newSuffix",
",",
"newSuffixRunes",
":=",
"word",
".",
"RemoveFirstSuffixIfIn",
"(",
"word",
".",
"R2start",
",",
"\"",
"\"",
")",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"word",
".",
"RemoveFirstSuffixIfIn",
"(",
"word",
".",
"R2start",
",",
"\"",
"\"",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"// If preceded by \"eus\", delete if in R2, else replace by \"eux\" if in R1",
"newSuffix",
",",
"newSuffixRunes",
"=",
"word",
".",
"FirstSuffix",
"(",
"\"",
"\"",
")",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"newSuffixLen",
":=",
"len",
"(",
"newSuffixRunes",
")",
"\n",
"if",
"word",
".",
"FitsInR2",
"(",
"newSuffixLen",
")",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"newSuffixLen",
")",
"\n",
"}",
"else",
"if",
"word",
".",
"FitsInR1",
"(",
"newSuffixLen",
")",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"newSuffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"// If preceded by abl or iqU, delete if in R2, otherwise,",
"newSuffix",
",",
"newSuffixRunes",
"=",
"word",
".",
"FirstSuffix",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"newSuffixLen",
":=",
"len",
"(",
"newSuffixRunes",
")",
"\n",
"if",
"word",
".",
"FitsInR2",
"(",
"newSuffixLen",
")",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"newSuffixLen",
")",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"// If preceded by ièr or Ièr, replace by i if in RV",
"newSuffix",
",",
"newSuffixRunes",
"=",
"word",
".",
"FirstSuffix",
"(",
"\"",
",",
" ",
"I",
"",
"",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"if",
"word",
".",
"FitsInRV",
"(",
"len",
"(",
"newSuffixRunes",
")",
")",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"newSuffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}",
"\n\n",
"case",
"\"",
",",
" ",
"i",
"",
"",
"if",
"isInR2",
"{",
"// Delete if in R2",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n\n",
"// If preceded by \"abil\", delete if in R2, else replace by \"abl\"",
"newSuffix",
",",
"newSuffixRunes",
":=",
"word",
".",
"FirstSuffix",
"(",
"\"",
"\"",
")",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"newSuffixLen",
":=",
"len",
"(",
"newSuffixRunes",
")",
"\n",
"if",
"word",
".",
"FitsInR2",
"(",
"newSuffixLen",
")",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"newSuffixLen",
")",
"\n",
"}",
"else",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"newSuffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"// If preceded by \"ic\", delete if in R2, else replace by \"iqU\"",
"newSuffix",
",",
"newSuffixRunes",
"=",
"word",
".",
"FirstSuffix",
"(",
"\"",
"\"",
")",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"newSuffixLen",
":=",
"len",
"(",
"newSuffixRunes",
")",
"\n",
"if",
"word",
".",
"FitsInR2",
"(",
"newSuffixLen",
")",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"newSuffixLen",
")",
"\n",
"}",
"else",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"newSuffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}",
"\n\n",
"// If preceded by \"iv\", delete if in R2",
"newSuffix",
",",
"newSuffixRunes",
"=",
"word",
".",
"RemoveFirstSuffixIfIn",
"(",
"word",
".",
"R2start",
",",
"\"",
"\"",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"if",
"isInR2",
"{",
"// Delete if in R2",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n\n",
"// If preceded by at, delete if in R2",
"newSuffix",
",",
"newSuffixRunes",
":=",
"word",
".",
"RemoveFirstSuffixIfIn",
"(",
"word",
".",
"R2start",
",",
"\"",
"\"",
")",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"// And if further preceded by ic, delete if in R2, else replace by iqU",
"newSuffix",
",",
"newSuffixRunes",
"=",
"word",
".",
"FirstSuffix",
"(",
"\"",
"\"",
")",
"\n",
"if",
"newSuffix",
"!=",
"\"",
"\"",
"{",
"newSuffixLen",
":=",
"len",
"(",
"newSuffixRunes",
")",
"\n",
"if",
"word",
".",
"FitsInR2",
"(",
"newSuffixLen",
")",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"newSuffixLen",
")",
"\n",
"}",
"else",
"{",
"word",
".",
"ReplaceSuffixRunes",
"(",
"newSuffixRunes",
",",
"[",
"]",
"rune",
"(",
"\"",
"\"",
")",
",",
"true",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"true",
"\n\n",
"}",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
] |
15,821 | all-15822 | [
"SetImplicitWait",
"sets",
"the",
"implicit",
"wait",
"timeout",
"(",
"in",
"ms",
")"
] | [
"func",
"(",
"p",
"*",
"Page",
")",
"SetImplicitWait",
"(",
"timeout",
"int",
")",
"error",
"{",
"return",
"p",
".",
"<mask>",
".",
"SetImplicitWait",
"(",
"timeout",
")",
"\n",
"}"
] |
15,822 | all-15823 | [
"String",
"returns",
"level",
"String"
] | [
"func",
"(",
"l",
"Level",
")",
"<mask>",
"(",
")",
"string",
"{",
"switch",
"l",
"{",
"case",
"LevelTrace",
":",
"return",
"\"",
"\"",
"\n",
"case",
"LevelDebug",
":",
"return",
"\"",
"\"",
"\n",
"case",
"LevelInfo",
":",
"return",
"\"",
"\"",
"\n",
"case",
"LevelWarn",
":",
"return",
"\"",
"\"",
"\n",
"case",
"LevelError",
":",
"return",
"\"",
"\"",
"\n",
"case",
"LevelFatal",
":",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"// return default info",
"return",
"\"",
"\"",
"\n",
"}"
] |
15,823 | all-15824 | [
"Merge",
"the",
"set",
"into",
"our",
"state",
"abiding",
"increment",
"-",
"only",
"semantics",
".",
"Return",
"any",
"key",
"/",
"values",
"that",
"have",
"been",
"mutated",
"or",
"nil",
"if",
"nothing",
"changed",
"."
] | [
"func",
"(",
"st",
"*",
"state",
")",
"mergeDelta",
"(",
"set",
"map",
"[",
"mesh",
".",
"PeerName",
"]",
"int",
")",
"(",
"delta",
"mesh",
".",
"GossipData",
")",
"{",
"st",
".",
"mtx",
".",
"Lock",
"(",
")",
"\n",
"defer",
"st",
".",
"mtx",
".",
"Unlock",
"(",
")",
"\n\n",
"for",
"peer",
",",
"v",
":=",
"range",
"set",
"{",
"if",
"v",
"<=",
"st",
".",
"set",
"[",
"peer",
"]",
"{",
"delete",
"(",
"set",
",",
"<mask>",
")",
"// requirement: it's not part of a delta",
"\n",
"continue",
"\n",
"}",
"\n",
"st",
".",
"set",
"[",
"peer",
"]",
"=",
"v",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"set",
")",
"<=",
"0",
"{",
"return",
"nil",
"// per OnGossip requirements",
"\n",
"}",
"\n",
"return",
"&",
"state",
"{",
"set",
":",
"set",
",",
"// all remaining elements were novel to us",
"}",
"\n",
"}"
] |
15,824 | all-15825 | [
"StoragePoolNodeVolumesGet",
"returns",
"all",
"storage",
"volumes",
"attached",
"to",
"a",
"given",
"storage",
"pool",
"on",
"the",
"current",
"node",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"StoragePoolNodeVolumesGet",
"(",
"poolID",
"int64",
",",
"volumeTypes",
"[",
"]",
"int",
")",
"(",
"[",
"]",
"*",
"api",
".",
"StorageVolume",
",",
"<mask>",
")",
"{",
"return",
"c",
".",
"storagePoolVolumesGet",
"(",
"\"",
"\"",
",",
"poolID",
",",
"c",
".",
"nodeID",
",",
"volumeTypes",
")",
"\n",
"}"
] |
15,825 | all-15826 | [
"deletePid",
"is",
"used",
"to",
"remove",
"the",
"PID",
"on",
"exit",
"."
] | [
"func",
"(",
"r",
"*",
"<mask>",
")",
"deletePid",
"(",
")",
"error",
"{",
"path",
":=",
"config",
".",
"StringVal",
"(",
"r",
".",
"config",
".",
"PidFile",
")",
"\n",
"if",
"path",
"==",
"\"",
"\"",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"path",
")",
"\n\n",
"stat",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"stat",
".",
"IsDir",
"(",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"err",
"=",
"os",
".",
"Remove",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
15,826 | all-15827 | [
"Create",
"a",
"new",
"net",
".",
"Listener",
"bound",
"to",
"the",
"unix",
"socket",
"of",
"the",
"local",
"endpoint",
"."
] | [
"func",
"localCreateListener",
"(",
"path",
"string",
",",
"<mask>",
"string",
")",
"(",
"net",
".",
"Listener",
",",
"error",
")",
"{",
"err",
":=",
"CheckAlreadyRunning",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"err",
"=",
"socketUnixRemoveStale",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"listener",
",",
"err",
":=",
"socketUnixListen",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"err",
"=",
"localSetAccess",
"(",
"path",
",",
"group",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"listener",
".",
"Close",
"(",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"listener",
",",
"nil",
"\n",
"}"
] |
15,827 | all-15828 | [
"Index",
"returns",
"the",
"index",
"of",
"the",
"item",
"currently",
"selected",
"inside",
"the",
"searched",
"list",
".",
"If",
"no",
"item",
"is",
"selected",
"the",
"NotFound",
"(",
"-",
"1",
")",
"index",
"is",
"returned",
"."
] | [
"func",
"(",
"l",
"*",
"List",
")",
"Index",
"(",
")",
"int",
"{",
"selected",
":=",
"l",
".",
"scope",
"[",
"l",
".",
"cursor",
"]",
"\n\n",
"for",
"i",
",",
"item",
":=",
"<mask>",
"l",
".",
"items",
"{",
"if",
"item",
"==",
"selected",
"{",
"return",
"i",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"NotFound",
"\n",
"}"
] |
15,828 | all-15829 | [
"genericCommentAction",
"normalizes",
"the",
"action",
"string",
"to",
"a",
"GenericCommentEventAction",
"or",
"returns",
"if",
"the",
"action",
"is",
"unrelated",
"to",
"the",
"comment",
"text",
".",
"(",
"For",
"example",
"a",
"PR",
"label",
"action",
".",
")"
] | [
"func",
"genericCommentAction",
"(",
"action",
"string",
")",
"github",
".",
"GenericCommentEventAction",
"{",
"switch",
"<mask>",
"{",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"return",
"github",
".",
"GenericCommentActionCreated",
"\n",
"case",
"\"",
"\"",
":",
"return",
"github",
".",
"GenericCommentActionEdited",
"\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
":",
"return",
"github",
".",
"GenericCommentActionDeleted",
"\n",
"}",
"\n",
"// The action is not related to the text body.",
"return",
"\"",
"\"",
"\n",
"}"
] |
15,829 | all-15830 | [
"GetUnitOk",
"returns",
"a",
"tuple",
"with",
"the",
"Unit",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"m",
"*",
"MetricMetadata",
")",
"GetUnitOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"m",
"==",
"nil",
"||",
"m",
".",
"Unit",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"m",
".",
"Unit",
",",
"<mask>",
"\n",
"}"
] |
15,830 | all-15831 | [
"RawInformationQuery",
"sends",
"an",
"information",
"query",
"request",
"to",
"the",
"server",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"RawInformationQuery",
"(",
"from",
",",
"to",
",",
"id",
",",
"iqType",
",",
"requestNamespace",
",",
"body",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"const",
"xmlIQ",
"=",
"\"",
"\"",
"\n",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprintf",
"(",
"c",
".",
"conn",
",",
"xmlIQ",
",",
"xmlEscape",
"(",
"from",
")",
",",
"xmlEscape",
"(",
"to",
")",
",",
"<mask>",
",",
"iqType",
",",
"requestNamespace",
",",
"body",
")",
"\n",
"return",
"id",
",",
"err",
"\n",
"}"
] |
15,831 | all-15832 | [
"Provider",
"returns",
"a",
"terraform",
".",
"ResourceProvider",
"."
] | [
"func",
"Provider",
"(",
")",
"terraform",
".",
"ResourceProvider",
"{",
"return",
"&",
"schema",
".",
"Provider",
"{",
"Schema",
":",
"map",
"[",
"string",
"]",
"*",
"schema",
".",
"Schema",
"{",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Required",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"nil",
")",
",",
"<mask>",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Required",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"nil",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"nil",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeBool",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"false",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"nil",
")",
",",
"Deprecated",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeBool",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"false",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeBool",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"false",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"filepath",
".",
"Join",
"(",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Optional",
":",
"true",
",",
"DefaultFunc",
":",
"schema",
".",
"EnvDefaultFunc",
"(",
"\"",
"\"",
",",
"filepath",
".",
"Join",
"(",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
")",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"}",
",",
"ResourcesMap",
":",
"map",
"[",
"string",
"]",
"*",
"schema",
".",
"Resource",
"{",
"\"",
"\"",
":",
"resourceVSphereComputeCluster",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereComputeClusterHostGroup",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereComputeClusterVMAffinityRule",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereComputeClusterVMAntiAffinityRule",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereComputeClusterVMDependencyRule",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereComputeClusterVMGroup",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereComputeClusterVMHostRule",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereCustomAttribute",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereDatacenter",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereDatastoreCluster",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereDatastoreClusterVMAntiAffinityRule",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereDistributedPortGroup",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereDistributedVirtualSwitch",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereDRSVMOverride",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereDPMHostOverride",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereFile",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereFolder",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereHAVMOverride",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereHostPortGroup",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereHostVirtualSwitch",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereLicense",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereResourcePool",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereTag",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereTagCategory",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereVirtualDisk",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereVirtualMachine",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereNasDatastore",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereStorageDrsVMOverride",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereVAppContainer",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereVAppEntity",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereVmfsDatastore",
"(",
")",
",",
"\"",
"\"",
":",
"resourceVSphereVirtualMachineSnapshot",
"(",
")",
",",
"}",
",",
"DataSourcesMap",
":",
"map",
"[",
"string",
"]",
"*",
"schema",
".",
"Resource",
"{",
"\"",
"\"",
":",
"dataSourceVSphereComputeCluster",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereCustomAttribute",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereDatacenter",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereDatastore",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereDatastoreCluster",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereDistributedVirtualSwitch",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereFolder",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereHost",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereNetwork",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereResourcePool",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereTag",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereTagCategory",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereVAppContainer",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereVirtualMachine",
"(",
")",
",",
"\"",
"\"",
":",
"dataSourceVSphereVmfsDisks",
"(",
")",
",",
"}",
",",
"ConfigureFunc",
":",
"providerConfigure",
",",
"}",
"\n",
"}"
] |
15,832 | all-15833 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SetPausedInDebuggerMessageParams",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoOverlay7",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
15,833 | all-15834 | [
"reducedDuplexRow1",
"Performs",
"a",
"reduced",
"duplex",
"operation",
"for",
"a",
"single",
"row",
"from",
"the",
"highest",
"to",
"the",
"lowest",
"index",
"using",
"the",
"reduced",
"-",
"round",
"Blake2b",
"s",
"G",
"function",
"as",
"the",
"internal",
"permutation"
] | [
"func",
"reducedDuplexRow1",
"(",
"state",
"[",
"]",
"uint64",
",",
"rowIn",
"[",
"]",
"uint64",
",",
"rowOut",
"[",
"]",
"uint64",
",",
"nCols",
"int",
")",
"{",
"ptrIn",
":=",
"0",
"\n",
"ptrOut",
":=",
"(",
"nCols",
"-",
"1",
")",
"*",
"blockLenInt64",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"nCols",
";",
"i",
"++",
"{",
"ptrWordIn",
":=",
"rowIn",
"[",
"ptrIn",
":",
"]",
"//In Lyra2: pointer to prev",
"\n",
"ptrWordOut",
":=",
"rowOut",
"[",
"ptrOut",
":",
"]",
"//In Lyra2: pointer to row",
"\n",
"//Absorbing \"M[prev][col]\"",
"state",
"[",
"0",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"0",
"]",
")",
"\n",
"state",
"[",
"1",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"1",
"]",
")",
"\n",
"state",
"[",
"2",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"2",
"]",
")",
"\n",
"state",
"[",
"3",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"3",
"]",
")",
"\n",
"state",
"[",
"4",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"4",
"]",
")",
"\n",
"state",
"[",
"5",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"5",
"]",
")",
"\n",
"state",
"[",
"6",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"6",
"]",
")",
"\n",
"state",
"[",
"7",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"7",
"]",
")",
"\n",
"state",
"[",
"8",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"8",
"]",
")",
"\n",
"state",
"[",
"9",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"9",
"]",
")",
"\n",
"state",
"[",
"10",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"10",
"]",
")",
"\n",
"<mask>",
"[",
"11",
"]",
"^=",
"(",
"ptrWordIn",
"[",
"11",
"]",
")",
"\n\n",
"//Applies the reduced-round transformation f to the sponge's state",
"reducedBlake2bLyra",
"(",
"state",
")",
"\n\n",
"//M[row][C-1-col] = M[prev][col] XOR rand",
"ptrWordOut",
"[",
"0",
"]",
"=",
"ptrWordIn",
"[",
"0",
"]",
"^",
"state",
"[",
"0",
"]",
"\n",
"ptrWordOut",
"[",
"1",
"]",
"=",
"ptrWordIn",
"[",
"1",
"]",
"^",
"state",
"[",
"1",
"]",
"\n",
"ptrWordOut",
"[",
"2",
"]",
"=",
"ptrWordIn",
"[",
"2",
"]",
"^",
"state",
"[",
"2",
"]",
"\n",
"ptrWordOut",
"[",
"3",
"]",
"=",
"ptrWordIn",
"[",
"3",
"]",
"^",
"state",
"[",
"3",
"]",
"\n",
"ptrWordOut",
"[",
"4",
"]",
"=",
"ptrWordIn",
"[",
"4",
"]",
"^",
"state",
"[",
"4",
"]",
"\n",
"ptrWordOut",
"[",
"5",
"]",
"=",
"ptrWordIn",
"[",
"5",
"]",
"^",
"state",
"[",
"5",
"]",
"\n",
"ptrWordOut",
"[",
"6",
"]",
"=",
"ptrWordIn",
"[",
"6",
"]",
"^",
"state",
"[",
"6",
"]",
"\n",
"ptrWordOut",
"[",
"7",
"]",
"=",
"ptrWordIn",
"[",
"7",
"]",
"^",
"state",
"[",
"7",
"]",
"\n",
"ptrWordOut",
"[",
"8",
"]",
"=",
"ptrWordIn",
"[",
"8",
"]",
"^",
"state",
"[",
"8",
"]",
"\n",
"ptrWordOut",
"[",
"9",
"]",
"=",
"ptrWordIn",
"[",
"9",
"]",
"^",
"state",
"[",
"9",
"]",
"\n",
"ptrWordOut",
"[",
"10",
"]",
"=",
"ptrWordIn",
"[",
"10",
"]",
"^",
"state",
"[",
"10",
"]",
"\n",
"ptrWordOut",
"[",
"11",
"]",
"=",
"ptrWordIn",
"[",
"11",
"]",
"^",
"state",
"[",
"11",
"]",
"\n\n",
"//Input: next column (i.e., next block in sequence)",
"ptrIn",
"+=",
"blockLenInt64",
"\n",
"//Output: goes to previous column",
"ptrOut",
"-=",
"blockLenInt64",
"\n",
"}",
"\n",
"}"
] |
15,834 | all-15835 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventCacheStorageContentUpdated",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage10",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
15,835 | all-15836 | [
"runFollower",
"runs",
"the",
"FSM",
"for",
"a",
"follower",
"."
] | [
"func",
"(",
"r",
"*",
"Raft",
")",
"runFollower",
"(",
")",
"{",
"didWarn",
":=",
"false",
"\n",
"r",
".",
"logger",
".",
"Info",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"r",
",",
"r",
".",
"Leader",
"(",
")",
")",
")",
"\n",
"metrics",
".",
"IncrCounter",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
"}",
",",
"1",
")",
"\n",
"heartbeatTimer",
":=",
"randomTimeout",
"(",
"r",
".",
"conf",
".",
"HeartbeatTimeout",
")",
"\n",
"for",
"{",
"select",
"{",
"case",
"rpc",
":=",
"<-",
"r",
".",
"rpcCh",
":",
"r",
".",
"processRPC",
"(",
"rpc",
")",
"\n\n",
"case",
"c",
":=",
"<-",
"r",
".",
"configurationChangeCh",
":",
"// Reject any operations since we are not the leader",
"c",
".",
"respond",
"(",
"ErrNotLeader",
")",
"\n\n",
"case",
"a",
":=",
"<-",
"r",
".",
"applyCh",
":",
"// Reject any operations since we are not the leader",
"a",
".",
"respond",
"(",
"ErrNotLeader",
")",
"\n\n",
"case",
"v",
":=",
"<-",
"r",
".",
"verifyCh",
":",
"// Reject any operations since we are not the leader",
"v",
".",
"respond",
"(",
"ErrNotLeader",
")",
"\n\n",
"case",
"r",
":=",
"<-",
"r",
".",
"userRestoreCh",
":",
"// Reject any restores since we are not the leader",
"r",
".",
"respond",
"(",
"ErrNotLeader",
")",
"\n\n",
"<mask>",
"c",
":=",
"<-",
"r",
".",
"configurationsCh",
":",
"c",
".",
"configurations",
"=",
"r",
".",
"configurations",
".",
"Clone",
"(",
")",
"\n",
"c",
".",
"respond",
"(",
"nil",
")",
"\n\n",
"case",
"b",
":=",
"<-",
"r",
".",
"bootstrapCh",
":",
"b",
".",
"respond",
"(",
"r",
".",
"liveBootstrap",
"(",
"b",
".",
"configuration",
")",
")",
"\n\n",
"case",
"<-",
"heartbeatTimer",
":",
"// Restart the heartbeat timer",
"heartbeatTimer",
"=",
"randomTimeout",
"(",
"r",
".",
"conf",
".",
"HeartbeatTimeout",
")",
"\n\n",
"// Check if we have had a successful contact",
"lastContact",
":=",
"r",
".",
"LastContact",
"(",
")",
"\n",
"if",
"time",
".",
"Now",
"(",
")",
".",
"Sub",
"(",
"lastContact",
")",
"<",
"r",
".",
"conf",
".",
"HeartbeatTimeout",
"{",
"continue",
"\n",
"}",
"\n\n",
"// Heartbeat failed! Transition to the candidate state",
"lastLeader",
":=",
"r",
".",
"Leader",
"(",
")",
"\n",
"r",
".",
"setLeader",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"r",
".",
"configurations",
".",
"latestIndex",
"==",
"0",
"{",
"if",
"!",
"didWarn",
"{",
"r",
".",
"logger",
".",
"Warn",
"(",
"\"",
"\"",
")",
"\n",
"didWarn",
"=",
"true",
"\n",
"}",
"\n",
"}",
"else",
"if",
"r",
".",
"configurations",
".",
"latestIndex",
"==",
"r",
".",
"configurations",
".",
"committedIndex",
"&&",
"!",
"hasVote",
"(",
"r",
".",
"configurations",
".",
"latest",
",",
"r",
".",
"localID",
")",
"{",
"if",
"!",
"didWarn",
"{",
"r",
".",
"logger",
".",
"Warn",
"(",
"\"",
"\"",
")",
"\n",
"didWarn",
"=",
"true",
"\n",
"}",
"\n",
"}",
"else",
"{",
"r",
".",
"logger",
".",
"Warn",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"lastLeader",
")",
")",
"\n",
"metrics",
".",
"IncrCounter",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
"}",
",",
"1",
")",
"\n",
"r",
".",
"setState",
"(",
"Candidate",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"case",
"<-",
"r",
".",
"shutdownCh",
":",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
15,836 | all-15837 | [
"NewNetAddressString",
"returns",
"a",
"new",
"NetAddress",
"using",
"the",
"provided",
"address",
"in",
"the",
"form",
"of",
"IP",
":",
"Port",
".",
"Also",
"resolves",
"the",
"host",
"if",
"host",
"is",
"not",
"an",
"IP",
"."
] | [
"func",
"NewNetAddressString",
"(",
"addr",
"string",
")",
"(",
"*",
"NetAddress",
",",
"error",
")",
"{",
"host",
",",
"portStr",
",",
"err",
":=",
"net",
".",
"SplitHostPort",
"(",
"addr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"ip",
":=",
"net",
".",
"ParseIP",
"(",
"host",
")",
"\n",
"if",
"ip",
"==",
"nil",
"{",
"if",
"len",
"(",
"host",
")",
">",
"0",
"{",
"ips",
",",
"err",
":=",
"net",
".",
"LookupIP",
"(",
"host",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"ip",
"=",
"ips",
"[",
"0",
"]",
"\n",
"}",
"\n",
"}",
"\n\n",
"port",
",",
"err",
":=",
"strconv",
".",
"ParseUint",
"(",
"portStr",
",",
"10",
",",
"16",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"na",
":=",
"NewNetAddressIPPort",
"(",
"ip",
",",
"uint16",
"(",
"<mask>",
")",
")",
"\n",
"return",
"na",
",",
"nil",
"\n",
"}"
] |
15,837 | all-15838 | [
"Decode",
"decodes",
"a",
"serialized",
"token",
"verifying",
"the",
"signature",
"storing",
"the",
"decoded",
"data",
"from",
"the",
"token",
"in",
"obj",
"."
] | [
"func",
"(",
"hs",
"*",
"HmacSigner",
")",
"Decode",
"(",
"buf",
"[",
"]",
"byte",
",",
"obj",
"<mask>",
"{",
"}",
")",
"error",
"{",
"return",
"hs",
".",
"alg",
".",
"Decode",
"(",
"hs",
",",
"buf",
",",
"obj",
")",
"\n",
"}"
] |
15,838 | all-15839 | [
"UnmarshalYAML",
"implements",
"the",
"yaml",
".",
"Unmarshaler",
"interface",
"."
] | [
"func",
"(",
"c",
"*",
"SDConfig",
")",
"UnmarshalYAML",
"(",
"unmarshal",
"func",
"(",
"interface",
"{",
"}",
")",
"error",
")",
"error",
"{",
"*",
"c",
"=",
"DefaultSDConfig",
"\n",
"<mask>",
"plain",
"SDConfig",
"\n",
"err",
":=",
"unmarshal",
"(",
"(",
"*",
"plain",
")",
"(",
"c",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"c",
".",
"Account",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"c",
".",
"DNSSuffix",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"c",
".",
"Endpoint",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"c",
".",
"RefreshInterval",
"<=",
"0",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
15,839 | all-15840 | [
"HasImageName",
"returns",
"true",
"if",
"image",
"state",
"contains",
"the",
"containerImageName"
] | [
"func",
"(",
"imageState",
"*",
"ImageState",
")",
"HasImageName",
"(",
"containerImageName",
"string",
")",
"bool",
"{",
"for",
"_",
",",
"imageName",
":=",
"range",
"imageState",
".",
"Image",
".",
"Names",
"{",
"if",
"imageName",
"==",
"containerImageName",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"<mask>",
"\n",
"}"
] |
15,840 | all-15841 | [
"SetStepIncrement",
"is",
"a",
"wrapper",
"around",
"gtk_adjustment_set_step_increment",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Adjustment",
")",
"SetStepIncrement",
"(",
"<mask>",
"float64",
")",
"{",
"C",
".",
"gtk_adjustment_set_step_increment",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gdouble",
"(",
"value",
")",
")",
"\n",
"}"
] |
15,841 | all-15842 | [
"Used",
"after",
"to",
"create",
"the",
"appropriate",
"mounts",
"point",
"after",
"a",
"container",
"has",
"been",
"moved",
"."
] | [
"func",
"containerPostCreateContainerMountPoint",
"(",
"d",
"*",
"Daemon",
",",
"project",
",",
"containerName",
"string",
")",
"error",
"{",
"c",
",",
"err",
":=",
"containerLoadByProjectAndName",
"(",
"d",
".",
"State",
"(",
")",
",",
"project",
",",
"containerName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"poolName",
",",
"err",
":=",
"c",
".",
"StoragePool",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"snapshotNames",
",",
"err",
":=",
"d",
".",
"cluster",
".",
"ContainerGetSnapshots",
"(",
"project",
",",
"containerName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"containerMntPoint",
":=",
"getContainerMountPoint",
"(",
"c",
".",
"Project",
"(",
")",
",",
"poolName",
",",
"containerName",
")",
"\n",
"err",
"=",
"createContainerMountpoint",
"(",
"containerMntPoint",
",",
"c",
".",
"Path",
"(",
")",
",",
"c",
".",
"IsPrivileged",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"snapshotName",
":=",
"range",
"snapshotNames",
"{",
"mntPoint",
":=",
"getSnapshotMountPoint",
"(",
"project",
",",
"poolName",
",",
"snapshotName",
")",
"\n",
"snapshotsSymlinkTarget",
":=",
"shared",
".",
"VarPath",
"(",
"\"",
"\"",
",",
"poolName",
",",
"\"",
"\"",
",",
"containerName",
")",
"\n",
"snapshotMntPointSymlink",
":=",
"<mask>",
".",
"VarPath",
"(",
"\"",
"\"",
",",
"containerName",
")",
"\n",
"err",
":=",
"createSnapshotMountpoint",
"(",
"mntPoint",
",",
"snapshotsSymlinkTarget",
",",
"snapshotMntPointSymlink",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
15,842 | all-15843 | [
"NewCarbonlinkListener",
"create",
"new",
"instance",
"of",
"CarbonlinkListener"
] | [
"func",
"NewCarbonlinkListener",
"(",
"<mask>",
"*",
"Cache",
")",
"*",
"CarbonlinkListener",
"{",
"return",
"&",
"CarbonlinkListener",
"{",
"cache",
":",
"cache",
",",
"readTimeout",
":",
"30",
"*",
"time",
".",
"Second",
",",
"}",
"\n",
"}"
] |
15,843 | all-15844 | [
"GetHasFrame",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_entry_get_has_frame",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"GetHasFrame",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_entry_get_has_frame",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"return",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
15,844 | all-15845 | [
"SetExportFilename",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_operation_set_export_filename",
"()",
"."
] | [
"func",
"(",
"po",
"*",
"PrintOperation",
")",
"SetExportFilename",
"(",
"name",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"name",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_print_operation_set_export_filename",
"(",
"<mask>",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
15,845 | all-15846 | [
"getReleaseURL",
"gets",
"the",
"latest",
"release",
"URL",
"of",
"Boot2Docker",
"."
] | [
"func",
"(",
"b",
"*",
"b2dReleaseGetter",
")",
"getReleaseURL",
"(",
"apiURL",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"apiURL",
"==",
"\"",
"\"",
"{",
"apiURL",
"=",
"defaultURL",
"\n",
"}",
"\n\n",
"// match github (enterprise) release urls:",
"// https://api.github.com/repos/../../releases or",
"// https://some.github.enterprise/api/v3/repos/../../releases",
"re",
":=",
"regexp",
".",
"MustCompile",
"(",
"\"",
"\"",
")",
"\n",
"matches",
":=",
"re",
".",
"FindStringSubmatch",
"(",
"apiURL",
")",
"\n",
"if",
"len",
"(",
"matches",
")",
"!=",
"6",
"{",
"// does not match a github releases api URL",
"return",
"apiURL",
",",
"nil",
"\n",
"}",
"\n\n",
"scheme",
",",
"host",
",",
"org",
",",
"repo",
":=",
"matches",
"[",
"1",
"]",
",",
"matches",
"[",
"2",
"]",
",",
"matches",
"[",
"4",
"]",
",",
"matches",
"[",
"5",
"]",
"\n",
"if",
"host",
"==",
"\"",
"\"",
"{",
"host",
"=",
"\"",
"\"",
"\n",
"}",
"\n\n",
"tag",
",",
"err",
":=",
"b",
".",
"getReleaseTag",
"(",
"apiURL",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"<mask>",
".",
"Infof",
"(",
"\"",
"\"",
",",
"host",
",",
"org",
",",
"repo",
",",
"tag",
")",
"\n",
"bugURL",
",",
"ok",
":=",
"AUFSBugB2DVersions",
"[",
"tag",
"]",
"\n",
"if",
"ok",
"{",
"log",
".",
"Warnf",
"(",
"`\nBoot2Docker %s has a known issue with AUFS.\nSee here for more details: %s\nConsider specifying another storage driver (e.g. 'overlay') using '--engine-storage-driver' instead.\n`",
",",
"tag",
",",
"bugURL",
")",
"\n",
"}",
"\n",
"url",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"scheme",
",",
"host",
",",
"org",
",",
"repo",
",",
"tag",
",",
"b",
".",
"isoFilename",
")",
"\n",
"return",
"url",
",",
"nil",
"\n",
"}"
] |
15,846 | all-15847 | [
"startAsyncRoutines",
"starts",
"all",
"of",
"the",
"background",
"methods"
] | [
"func",
"(",
"agent",
"*",
"ecsAgent",
")",
"startAsyncRoutines",
"(",
"containerChangeEventStream",
"*",
"eventstream",
".",
"EventStream",
",",
"credentialsManager",
"credentials",
".",
"Manager",
",",
"imageManager",
"engine",
".",
"ImageManager",
",",
"taskEngine",
"engine",
".",
"TaskEngine",
",",
"stateManager",
"statemanager",
".",
"StateManager",
",",
"deregisterInstanceEventStream",
"*",
"eventstream",
".",
"EventStream",
",",
"client",
"api",
".",
"ECSClient",
",",
"taskHandler",
"*",
"eventhandler",
".",
"TaskHandler",
",",
"state",
"dockerstate",
".",
"TaskEngineState",
")",
"{",
"// Start of the periodic image cleanup process",
"if",
"!",
"agent",
".",
"cfg",
".",
"ImageCleanupDisabled",
"{",
"go",
"imageManager",
".",
"StartImageCleanupProcess",
"(",
"agent",
".",
"ctx",
")",
"\n",
"}",
"\n\n",
"go",
"agent",
".",
"terminationHandler",
"(",
"stateManager",
",",
"taskEngine",
")",
"\n\n",
"// Agent introspection api",
"go",
"handlers",
".",
"ServeIntrospectionHTTPEndpoint",
"(",
"&",
"agent",
".",
"containerInstanceARN",
",",
"taskEngine",
",",
"agent",
".",
"cfg",
")",
"\n\n",
"statsEngine",
":=",
"stats",
".",
"NewDockerStatsEngine",
"(",
"agent",
".",
"cfg",
",",
"agent",
".",
"dockerClient",
",",
"containerChangeEventStream",
")",
"\n\n",
"// Start serving the endpoint to fetch IAM Role credentials and other task metadata",
"if",
"agent",
".",
"cfg",
".",
"TaskMetadataAZDisabled",
"{",
"// send empty availability zone",
"go",
"handlers",
".",
"ServeTaskHTTPEndpoint",
"(",
"credentialsManager",
",",
"state",
",",
"client",
",",
"agent",
".",
"containerInstanceARN",
",",
"agent",
".",
"cfg",
",",
"statsEngine",
",",
"\"",
"\"",
")",
"\n",
"}",
"else",
"{",
"go",
"handlers",
".",
"ServeTaskHTTPEndpoint",
"(",
"credentialsManager",
",",
"state",
",",
"client",
",",
"agent",
".",
"containerInstanceARN",
",",
"agent",
".",
"cfg",
",",
"statsEngine",
",",
"agent",
".",
"availabilityZone",
")",
"\n",
"}",
"\n\n",
"// Start sending events to the backend",
"<mask>",
"eventhandler",
".",
"HandleEngineEvents",
"(",
"taskEngine",
",",
"client",
",",
"taskHandler",
")",
"\n\n",
"telemetrySessionParams",
":=",
"tcshandler",
".",
"TelemetrySessionParams",
"{",
"Ctx",
":",
"agent",
".",
"ctx",
",",
"CredentialProvider",
":",
"agent",
".",
"credentialProvider",
",",
"Cfg",
":",
"agent",
".",
"cfg",
",",
"ContainerInstanceArn",
":",
"agent",
".",
"containerInstanceARN",
",",
"DeregisterInstanceEventStream",
":",
"deregisterInstanceEventStream",
",",
"ECSClient",
":",
"client",
",",
"TaskEngine",
":",
"taskEngine",
",",
"StatsEngine",
":",
"statsEngine",
",",
"}",
"\n\n",
"// Start metrics session in a go routine",
"go",
"tcshandler",
".",
"StartMetricsSession",
"(",
"&",
"telemetrySessionParams",
")",
"\n",
"}"
] |
15,847 | all-15848 | [
"SetInactivityTimeout",
"is",
"a",
"wrapper",
"around",
"g_application_set_inactivity_timeout",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"SetInactivityTimeout",
"(",
"timeout",
"uint",
")",
"{",
"C",
".",
"g_application_set_inactivity_timeout",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"guint",
"(",
"timeout",
")",
")",
"\n",
"}"
] |
15,848 | all-15849 | [
"Version",
"indicates",
"an",
"expected",
"call",
"of",
"Version"
] | [
"func",
"(",
"mr",
"*",
"MockTaskEngineMockRecorder",
")",
"Version",
"(",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockTaskEngine",
")",
"(",
"nil",
")",
".",
"<mask>",
")",
")",
"\n",
"}"
] |
15,849 | all-15850 | [
"/",
"*",
"GtkMessageDialog",
"GetImage",
"is",
"a",
"wrapper",
"around",
"gtk_message_dialog_get_image",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"MessageDialog",
")",
"GetImage",
"(",
")",
"(",
"*",
"Widget",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gtk_message_dialog_get_image",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"return",
"wrapWidget",
"(",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
")",
",",
"nil",
"\n",
"}"
] |
15,850 | all-15851 | [
"GetToken",
"-"
] | [
"func",
"GetToken",
"(",
"uaaURL",
",",
"opsManagerUsername",
",",
"opsManagerPassword",
",",
"clientID",
",",
"clientSecret",
",",
"grantType",
"string",
")",
"(",
"token",
"string",
",",
"err",
"error",
")",
"{",
"var",
"res",
"*",
"http",
".",
"Response",
"\n",
"params",
":=",
"url",
".",
"Values",
"{",
"\"",
"\"",
":",
"{",
"grantType",
"}",
",",
"\"",
"\"",
":",
"{",
"\"",
"\"",
"}",
",",
"\"",
"\"",
":",
"{",
"opsManagerUsername",
"}",
",",
"\"",
"\"",
":",
"{",
"opsManagerPassword",
"}",
",",
"\"",
"\"",
":",
"{",
"clientID",
"}",
",",
"\"",
"\"",
":",
"{",
"clientSecret",
"}",
",",
"}",
"\n",
"tokenURL",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"uaaURL",
")",
"\n",
"tr",
":=",
"&",
"http",
".",
"Transport",
"{",
"TLSClientConfig",
":",
"&",
"tls",
".",
"Config",
"{",
"InsecureSkipVerify",
":",
"true",
"}",
",",
"}",
"\n",
"client",
":=",
"&",
"http",
".",
"Client",
"{",
"Transport",
":",
"tr",
"}",
"\n\n",
"if",
"res",
",",
"err",
"=",
"client",
".",
"PostForm",
"(",
"tokenURL",
",",
"params",
")",
";",
"err",
"==",
"nil",
"&&",
"res",
".",
"StatusCode",
"==",
"http",
".",
"StatusOK",
"{",
"var",
"body",
"[",
"]",
"byte",
"\n\n",
"if",
"body",
",",
"err",
"=",
"ioutil",
".",
"ReadAll",
"(",
"res",
".",
"Body",
")",
";",
"err",
"==",
"nil",
"{",
"t",
":=",
"new",
"(",
"Token",
")",
"\n\n",
"if",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"body",
",",
"&",
"t",
")",
";",
"err",
"==",
"nil",
"{",
"token",
"=",
"t",
".",
"AccessToken",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"else",
"if",
"res",
"!=",
"nil",
"&&",
"res",
".",
"StatusCode",
"!=",
"http",
".",
"StatusOK",
"{",
"body",
",",
"_",
":=",
"ioutil",
".",
"ReadAll",
"(",
"<mask>",
".",
"Body",
")",
"\n",
"err",
"=",
"errors",
".",
"New",
"(",
"string",
"(",
"body",
")",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
15,851 | all-15852 | [
"Levels",
"is",
"an",
"option",
"that",
"sets",
"the",
"logrus",
"levels",
"that",
"the",
"StackdriverHook",
"will",
"create",
"log",
"entries",
"for",
"."
] | [
"func",
"Levels",
"(",
"levels",
"...",
"logrus",
".",
"Level",
")",
"Option",
"{",
"return",
"func",
"(",
"sh",
"*",
"StackdriverHook",
")",
"<mask>",
"{",
"sh",
".",
"levels",
"=",
"levels",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] |
15,852 | all-15853 | [
"GetRepos",
"returns",
"all",
"repos",
"in",
"an",
"org",
".",
"This",
"call",
"uses",
"multiple",
"API",
"tokens",
"when",
"results",
"are",
"paginated",
".",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"repos",
"/",
"#list",
"-",
"organization",
"-",
"repositories"
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"GetRepos",
"(",
"org",
"string",
",",
"isUser",
"bool",
")",
"(",
"[",
"]",
"Repo",
",",
"error",
")",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"org",
",",
"isUser",
")",
"\n",
"var",
"(",
"repos",
"[",
"]",
"Repo",
"\n",
"nextURL",
"string",
"\n",
")",
"\n",
"if",
"c",
".",
"fake",
"{",
"return",
"repos",
",",
"nil",
"\n",
"}",
"\n",
"if",
"isUser",
"{",
"nextURL",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"org",
")",
"\n",
"}",
"else",
"{",
"nextURL",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"org",
")",
"\n",
"}",
"\n",
"err",
":=",
"c",
".",
"readPaginatedResults",
"(",
"nextURL",
",",
"// path",
"acceptNone",
",",
"// accept",
"func",
"(",
")",
"interface",
"{",
"}",
"{",
"// newObj",
"return",
"&",
"[",
"]",
"Repo",
"{",
"}",
"\n",
"}",
",",
"func",
"(",
"obj",
"interface",
"{",
"}",
")",
"{",
"// accumulate",
"repos",
"=",
"append",
"(",
"repos",
",",
"*",
"(",
"obj",
".",
"(",
"*",
"[",
"]",
"Repo",
")",
")",
"...",
")",
"\n",
"}",
",",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"repos",
",",
"nil",
"\n",
"}"
] |
15,853 | all-15854 | [
"removeEmptyDirs",
"removes",
"all",
"directories",
"in",
"rootDir",
"(",
"including",
"the",
"root",
"directory",
"itself",
")",
"that",
"are",
"empty",
"or",
"contain",
"only",
"empty",
"directories",
"."
] | [
"func",
"removeEmptyDirs",
"(",
"rootDir",
"string",
")",
"(",
"removed",
"bool",
",",
"rErr",
"error",
")",
"{",
"dirContent",
",",
"err",
":=",
"ioutil",
".",
"ReadDir",
"(",
"rootDir",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
",",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"removeCurrentDir",
":=",
"true",
"\n",
"for",
"_",
",",
"fi",
":=",
"<mask>",
"dirContent",
"{",
"if",
"!",
"fi",
".",
"IsDir",
"(",
")",
"{",
"// if directory contains non-directory, it will not be removed",
"removeCurrentDir",
"=",
"false",
"\n",
"continue",
"\n",
"}",
"\n",
"currChildRemoved",
",",
"err",
":=",
"removeEmptyDirs",
"(",
"path",
".",
"Join",
"(",
"rootDir",
",",
"fi",
".",
"Name",
"(",
")",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
",",
"err",
"\n",
"}",
"\n",
"if",
"!",
"currChildRemoved",
"{",
"// if a child directory was not removed, it means it was non-empty, so this directory is non-empty",
"removeCurrentDir",
"=",
"false",
"\n",
"continue",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"!",
"removeCurrentDir",
"{",
"return",
"false",
",",
"nil",
"\n",
"}",
"\n",
"if",
"err",
":=",
"os",
".",
"Remove",
"(",
"rootDir",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"false",
",",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"true",
",",
"nil",
"\n",
"}"
] |
15,854 | all-15855 | [
"Do",
"executes",
"Emulation",
".",
"setEmulatedMedia",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetEmulatedMediaParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetEmulatedMedia",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
15,855 | all-15856 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"Property",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss27",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
15,856 | all-15857 | [
"processCall",
"walks",
"the",
"function",
"and",
"populate",
"call",
"accordingly",
"."
] | [
"func",
"processCall",
"(",
"call",
"*",
"Call",
",",
"f",
"*",
"ast",
".",
"FuncDecl",
")",
"{",
"values",
":=",
"make",
"(",
"[",
"]",
"uint64",
",",
"len",
"(",
"call",
".",
"Args",
".",
"Values",
")",
")",
"\n",
"for",
"i",
":=",
"range",
"call",
".",
"Args",
".",
"Values",
"{",
"values",
"[",
"i",
"]",
"=",
"call",
".",
"Args",
".",
"Values",
"[",
"i",
"]",
".",
"Value",
"\n",
"}",
"\n",
"index",
":=",
"0",
"\n",
"pop",
":=",
"func",
"(",
")",
"uint64",
"{",
"if",
"len",
"(",
"values",
")",
"!=",
"0",
"{",
"x",
":=",
"values",
"[",
"0",
"]",
"\n",
"values",
"=",
"values",
"[",
"1",
":",
"]",
"\n",
"index",
"++",
"\n",
"return",
"x",
"\n",
"}",
"\n",
"return",
"0",
"\n",
"}",
"\n",
"popName",
":=",
"func",
"(",
")",
"string",
"{",
"n",
":=",
"call",
".",
"Args",
".",
"Values",
"[",
"index",
"]",
".",
"Name",
"\n",
"v",
":=",
"pop",
"(",
")",
"\n",
"if",
"len",
"(",
"n",
")",
"==",
"0",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
")",
"\n",
"}",
"\n",
"return",
"n",
"\n",
"}",
"\n\n",
"types",
",",
"extra",
":=",
"extractArgumentsType",
"(",
"f",
")",
"\n",
"for",
"i",
":=",
"0",
";",
"len",
"(",
"values",
")",
"!=",
"0",
";",
"i",
"++",
"{",
"var",
"t",
"string",
"\n",
"if",
"i",
">=",
"len",
"(",
"types",
")",
"{",
"if",
"!",
"extra",
"{",
"// These are unexpected value! Print them as hex.",
"call",
".",
"Args",
".",
"Processed",
"=",
"append",
"(",
"call",
".",
"Args",
".",
"Processed",
",",
"popName",
"(",
")",
")",
"\n",
"continue",
"\n",
"}",
"\n",
"t",
"=",
"types",
"[",
"len",
"(",
"types",
")",
"-",
"1",
"]",
"\n",
"}",
"else",
"{",
"t",
"=",
"types",
"[",
"i",
"]",
"\n",
"}",
"\n",
"switch",
"t",
"{",
"case",
"\"",
"\"",
":",
"call",
".",
"Args",
".",
"Processed",
"=",
"append",
"(",
"call",
".",
"Args",
".",
"Processed",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"math",
".",
"Float32frombits",
"(",
"uint32",
"(",
"pop",
"(",
")",
")",
")",
")",
")",
"\n",
"case",
"\"",
"\"",
":",
"call",
".",
"Args",
".",
"Processed",
"=",
"<mask>",
"(",
"call",
".",
"Args",
".",
"Processed",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"math",
".",
"Float64frombits",
"(",
"pop",
"(",
")",
")",
")",
")",
"\n",
"case",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
":",
"call",
".",
"Args",
".",
"Processed",
"=",
"append",
"(",
"call",
".",
"Args",
".",
"Processed",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"pop",
"(",
")",
")",
")",
"\n",
"case",
"\"",
"\"",
":",
"call",
".",
"Args",
".",
"Processed",
"=",
"append",
"(",
"call",
".",
"Args",
".",
"Processed",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"t",
",",
"popName",
"(",
")",
",",
"pop",
"(",
")",
")",
")",
"\n",
"default",
":",
"if",
"strings",
".",
"HasPrefix",
"(",
"t",
",",
"\"",
"\"",
")",
"{",
"call",
".",
"Args",
".",
"Processed",
"=",
"append",
"(",
"call",
".",
"Args",
".",
"Processed",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"t",
",",
"popName",
"(",
")",
")",
")",
"\n",
"}",
"else",
"if",
"strings",
".",
"HasPrefix",
"(",
"t",
",",
"\"",
"\"",
")",
"{",
"call",
".",
"Args",
".",
"Processed",
"=",
"append",
"(",
"call",
".",
"Args",
".",
"Processed",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"t",
",",
"popName",
"(",
")",
",",
"pop",
"(",
")",
",",
"pop",
"(",
")",
")",
")",
"\n",
"}",
"else",
"{",
"// Assumes it's an interface. For now, discard the object value, which",
"// is probably not a good idea.",
"call",
".",
"Args",
".",
"Processed",
"=",
"append",
"(",
"call",
".",
"Args",
".",
"Processed",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"t",
",",
"popName",
"(",
")",
")",
")",
"\n",
"pop",
"(",
")",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"len",
"(",
"values",
")",
"==",
"0",
"&&",
"call",
".",
"Args",
".",
"Elided",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
15,857 | all-15858 | [
"GetServiceName",
"returns",
"the",
"ServiceName",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"s",
"*",
"servicePD",
")",
"GetServiceName",
"(",
")",
"<mask>",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"ServiceName",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"s",
".",
"ServiceName",
"\n",
"}"
] |
15,858 | all-15859 | [
"SetSubtitle",
"is",
"a",
"wrapper",
"around",
"gtk_header_bar_set_subtitle",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"HeaderBar",
")",
"SetSubtitle",
"(",
"subtitle",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"subtitle",
")",
"\n",
"defer",
"C",
".",
"<mask>",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_header_bar_set_subtitle",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
15,859 | all-15860 | [
"Stability",
":",
"***",
"DEPRECATED",
"***",
"Return",
"an",
"expanded",
"copy",
"of",
"the",
"given",
"scopeset",
"with",
"scopes",
"implied",
"by",
"any",
"roles",
"included",
".",
"This",
"call",
"uses",
"the",
"GET",
"method",
"with",
"an",
"HTTP",
"body",
".",
"It",
"remains",
"only",
"for",
"backward",
"compatibility",
".",
"See",
"#expandScopesGet"
] | [
"func",
"(",
"auth",
"*",
"Auth",
")",
"ExpandScopesGet",
"(",
"payload",
"*",
"SetOfScopes",
")",
"(",
"*",
"SetOfScopes",
",",
"error",
")",
"{",
"cd",
":=",
"tcclient",
".",
"Client",
"(",
"*",
"auth",
")",
"\n",
"responseObject",
",",
"_",
",",
"err",
":=",
"(",
"&",
"<mask>",
")",
".",
"APICall",
"(",
"payload",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"new",
"(",
"SetOfScopes",
")",
",",
"nil",
")",
"\n",
"return",
"responseObject",
".",
"(",
"*",
"SetOfScopes",
")",
",",
"err",
"\n",
"}"
] |
15,860 | all-15861 | [
"MarshalJSON",
"marshals",
"VolumeResource",
"object",
"using",
"duplicate",
"struct",
"VolumeResourceJSON"
] | [
"func",
"(",
"vol",
"*",
"VolumeResource",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"if",
"vol",
"==",
"nil",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n",
"return",
"json",
".",
"Marshal",
"(",
"volumeResourceJSON",
"{",
"vol",
".",
"Name",
",",
"vol",
".",
"VolumeConfig",
",",
"vol",
".",
"GetCreatedAt",
"(",
")",
",",
"func",
"(",
")",
"*",
"VolumeStatus",
"{",
"desiredState",
":=",
"VolumeStatus",
"(",
"vol",
".",
"GetDesiredStatus",
"(",
")",
")",
";",
"return",
"&",
"desiredState",
"}",
"(",
")",
",",
"func",
"(",
")",
"*",
"VolumeStatus",
"{",
"knownState",
":=",
"VolumeStatus",
"(",
"vol",
".",
"GetKnownStatus",
"(",
")",
")",
";",
"return",
"&",
"knownState",
"}",
"(",
")",
",",
"}",
")",
"\n",
"}"
] |
15,861 | all-15862 | [
"Addr",
"implements",
"the",
"net",
".",
"Listener",
"interface",
"."
] | [
"func",
"(",
"t",
"*",
"TCPStreamLayer",
")",
"Addr",
"(",
")",
"<mask>",
".",
"Addr",
"{",
"// Use an advertise addr if provided",
"if",
"t",
".",
"advertise",
"!=",
"nil",
"{",
"return",
"t",
".",
"advertise",
"\n",
"}",
"\n",
"return",
"t",
".",
"listener",
".",
"Addr",
"(",
")",
"\n",
"}"
] |
15,862 | all-15863 | [
"exit",
"is",
"called",
"if",
"there",
"is",
"trouble",
"creating",
"or",
"writing",
"log",
"files",
".",
"It",
"flushes",
"the",
"logs",
"and",
"exits",
"the",
"program",
";",
"there",
"s",
"no",
"point",
"in",
"hanging",
"around",
".",
"l",
".",
"mu",
"is",
"held",
"."
] | [
"func",
"(",
"l",
"*",
"Log",
")",
"<mask>",
"(",
"err",
"error",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"os",
".",
"Stderr",
",",
"\"",
"\\n",
"\"",
",",
"err",
")",
"\n",
"// If logExitFunc is set, we do that instead of exiting.",
"if",
"logExitFunc",
"!=",
"nil",
"{",
"logExitFunc",
"(",
"err",
")",
"\n",
"return",
"\n",
"}",
"\n",
"l",
".",
"flushAll",
"(",
")",
"\n",
"os",
".",
"Exit",
"(",
"2",
")",
"\n",
"}"
] |
15,863 | all-15864 | [
"Set",
"hashes",
"the",
"key",
"and",
"value",
"and",
"appends",
"it",
"to",
"the",
"kv",
"pairs",
"."
] | [
"func",
"(",
"sm",
"*",
"simpleMap",
")",
"Set",
"(",
"key",
"string",
",",
"value",
"Hasher",
")",
"{",
"sm",
".",
"sorted",
"=",
"false",
"\n\n",
"// The value is hashed, so you can",
"// check for equality with a cached value (say)",
"// and make a determination to fetch or not.",
"vhash",
":=",
"value",
".",
"Hash",
"(",
")",
"\n\n",
"sm",
".",
"kvs",
"=",
"append",
"(",
"sm",
".",
"kvs",
",",
"cmn",
".",
"KVPair",
"{",
"<mask>",
":",
"[",
"]",
"byte",
"(",
"key",
")",
",",
"Value",
":",
"vhash",
",",
"}",
")",
"\n",
"}"
] |
15,864 | all-15865 | [
"This",
"sets",
"the",
"value",
"in",
"a",
"struct",
"of",
"an",
"indeterminate",
"type",
"to",
"the",
"matching",
"value",
"from",
"the",
"request",
"(",
"via",
"Form",
"middleware",
")",
"in",
"the",
"same",
"type",
"so",
"that",
"not",
"all",
"deserialized",
"values",
"have",
"to",
"be",
"strings",
".",
"Supported",
"types",
"are",
"string",
"int",
"float",
"and",
"bool",
"."
] | [
"func",
"setWithProperType",
"(",
"valueKind",
"reflect",
".",
"Kind",
",",
"val",
"string",
",",
"structField",
"reflect",
".",
"Value",
",",
"nameInTag",
"string",
",",
"errors",
"*",
"Errors",
")",
"{",
"<mask>",
"valueKind",
"{",
"case",
"reflect",
".",
"Int",
",",
"reflect",
".",
"Int8",
",",
"reflect",
".",
"Int16",
",",
"reflect",
".",
"Int32",
",",
"reflect",
".",
"Int64",
":",
"if",
"val",
"==",
"\"",
"\"",
"{",
"val",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"intVal",
",",
"err",
":=",
"strconv",
".",
"Atoi",
"(",
"val",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"errors",
".",
"Fields",
"[",
"nameInTag",
"]",
"=",
"IntegerTypeError",
"\n",
"}",
"else",
"{",
"structField",
".",
"SetInt",
"(",
"int64",
"(",
"intVal",
")",
")",
"\n",
"}",
"\n",
"case",
"reflect",
".",
"Bool",
":",
"if",
"val",
"==",
"\"",
"\"",
"{",
"val",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"boolVal",
",",
"err",
":=",
"strconv",
".",
"ParseBool",
"(",
"val",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"errors",
".",
"Fields",
"[",
"nameInTag",
"]",
"=",
"BooleanTypeError",
"\n",
"}",
"else",
"{",
"structField",
".",
"SetBool",
"(",
"boolVal",
")",
"\n",
"}",
"\n",
"case",
"reflect",
".",
"Float32",
":",
"if",
"val",
"==",
"\"",
"\"",
"{",
"val",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"floatVal",
",",
"err",
":=",
"strconv",
".",
"ParseFloat",
"(",
"val",
",",
"32",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"errors",
".",
"Fields",
"[",
"nameInTag",
"]",
"=",
"FloatTypeError",
"\n",
"}",
"else",
"{",
"structField",
".",
"SetFloat",
"(",
"floatVal",
")",
"\n",
"}",
"\n",
"case",
"reflect",
".",
"Float64",
":",
"if",
"val",
"==",
"\"",
"\"",
"{",
"val",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"floatVal",
",",
"err",
":=",
"strconv",
".",
"ParseFloat",
"(",
"val",
",",
"64",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"errors",
".",
"Fields",
"[",
"nameInTag",
"]",
"=",
"FloatTypeError",
"\n",
"}",
"else",
"{",
"structField",
".",
"SetFloat",
"(",
"floatVal",
")",
"\n",
"}",
"\n",
"case",
"reflect",
".",
"String",
":",
"structField",
".",
"SetString",
"(",
"val",
")",
"\n",
"}",
"\n",
"}"
] |
15,865 | all-15866 | [
"Intersect",
"will",
"return",
"the",
"intersection",
"of",
"both",
"lists",
"."
] | [
"func",
"Intersect",
"(",
"listA",
",",
"listB",
"[",
"]",
"string",
")",
"[",
"]",
"string",
"{",
"// prepare new list",
"list",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
",",
"len",
"(",
"listA",
")",
")",
"\n\n",
"// add items that are part of both lists",
"for",
"_",
",",
"<mask>",
":=",
"range",
"listA",
"{",
"if",
"Contains",
"(",
"listB",
",",
"item",
")",
"{",
"list",
"=",
"append",
"(",
"list",
",",
"item",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"list",
"\n",
"}"
] |
15,866 | all-15867 | [
"ApplyDRSConfiguration",
"takes",
"a",
"types",
".",
"StorageDrsConfigSpec",
"and",
"applies",
"it",
"against",
"the",
"specified",
"StoragePod",
"."
] | [
"func",
"ApplyDRSConfiguration",
"(",
"client",
"*",
"govmomi",
".",
"<mask>",
",",
"pod",
"*",
"object",
".",
"StoragePod",
",",
"spec",
"types",
".",
"StorageDrsConfigSpec",
")",
"error",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"pod",
".",
"InventoryPath",
")",
"\n",
"mgr",
":=",
"object",
".",
"NewStorageResourceManager",
"(",
"client",
".",
"Client",
")",
"\n",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"provider",
".",
"DefaultAPITimeout",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n",
"task",
",",
"err",
":=",
"mgr",
".",
"ConfigureStorageDrsForPod",
"(",
"ctx",
",",
"pod",
",",
"spec",
",",
"true",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"task",
".",
"Wait",
"(",
"ctx",
")",
"\n",
"}"
] |
15,867 | all-15868 | [
"Request",
"makes",
"a",
"performs",
"a",
"new",
"GDPR",
"request",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"Request",
"(",
"req",
"*",
"Request",
")",
"(",
"*",
"Response",
",",
"error",
")",
"{",
"buf",
":=",
"<mask>",
".",
"NewBuffer",
"(",
"nil",
")",
"\n",
"err",
":=",
"json",
".",
"NewEncoder",
"(",
"buf",
")",
".",
"Encode",
"(",
"req",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"reqResp",
":=",
"&",
"Response",
"{",
"}",
"\n",
"resp",
",",
"err",
":=",
"c",
".",
"caller",
".",
"Call",
"(",
"\"",
"\"",
",",
"c",
".",
"endpoint",
"+",
"\"",
"\"",
",",
"buf",
")",
"\n",
"return",
"reqResp",
",",
"c",
".",
"json",
"(",
"resp",
",",
"err",
",",
"true",
",",
"reqResp",
")",
"\n",
"}"
] |
15,868 | all-15869 | [
"Register",
"registers",
"pprof",
"endpoints",
"on",
"the",
"given",
"registrar",
"under",
"_pprof",
".",
"The",
"_pprof",
"endpoint",
"uses",
"as",
"-",
"http",
"and",
"is",
"a",
"tunnel",
"to",
"the",
"default",
"serve",
"mux",
"."
] | [
"func",
"Register",
"(",
"registrar",
"tchannel",
".",
"Registrar",
")",
"{",
"handler",
":=",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"call",
"*",
"tchannel",
".",
"InboundCall",
")",
"{",
"req",
",",
"err",
":=",
"thttp",
".",
"ReadRequest",
"(",
"call",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"registrar",
".",
"Logger",
"(",
")",
".",
"WithFields",
"(",
"tchannel",
".",
"LogField",
"{",
"<mask>",
":",
"\"",
"\"",
",",
"Value",
":",
"err",
".",
"Error",
"(",
")",
"}",
",",
")",
".",
"Warn",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"serveHTTP",
"(",
"req",
",",
"call",
".",
"Response",
"(",
")",
")",
"\n",
"}",
"\n",
"registrar",
".",
"Register",
"(",
"tchannel",
".",
"HandlerFunc",
"(",
"handler",
")",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
15,869 | all-15870 | [
"FromCommandLine",
"builds",
"a",
"client",
"from",
"the",
"command",
"line",
"."
] | [
"func",
"FromCommandLine",
"(",
"cmdLine",
"*",
"cmd",
".",
"CommandLine",
")",
"(",
"*",
"API",
",",
"error",
")",
"{",
"<mask>",
",",
"err",
":=",
"rsapi",
".",
"FromCommandLine",
"(",
"cmdLine",
")",
"\n",
"cmdLine",
".",
"Host",
"=",
"HostFromLogin",
"(",
"cmdLine",
".",
"Host",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"fromAPI",
"(",
"raw",
")",
",",
"nil",
"\n",
"}"
] |
15,870 | all-15871 | [
"SetServer",
"sets",
"Server",
"header",
"value",
"."
] | [
"func",
"(",
"h",
"*",
"ResponseHeader",
")",
"SetServer",
"(",
"<mask>",
"string",
")",
"{",
"h",
".",
"server",
"=",
"append",
"(",
"h",
".",
"server",
"[",
":",
"0",
"]",
",",
"server",
"...",
")",
"\n",
"}"
] |
15,871 | all-15872 | [
"CommandContext",
"is",
"like",
"Command",
"but",
"includes",
"a",
"context",
".",
"The",
"provided",
"context",
"is",
"used",
"to",
"kill",
"the",
"process",
"(",
"by",
"calling",
"os",
".",
"Process",
".",
"Kill",
")",
"if",
"the",
"context",
"becomes",
"done",
"before",
"the",
"command",
"completes",
"on",
"its",
"own",
"."
] | [
"func",
"CommandContext",
"(",
"ctx",
"context",
".",
"<mask>",
",",
"name",
"string",
",",
"arg",
"...",
"string",
")",
"*",
"Cmd",
"{",
"if",
"ctx",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"cmd",
":=",
"Command",
"(",
"name",
",",
"arg",
"...",
")",
"\n",
"cmd",
".",
"ctx",
"=",
"ctx",
"\n",
"return",
"cmd",
"\n",
"}"
] |
15,872 | all-15873 | [
"Do",
"executes",
"Debugger",
".",
"getScriptSource",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"scriptSource",
"-",
"Script",
"source",
"."
] | [
"func",
"(",
"p",
"*",
"GetScriptSourceParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"scriptSource",
"string",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"GetScriptSourceReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandGetScriptSource",
",",
"p",
",",
"&",
"res",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"<mask>",
".",
"ScriptSource",
",",
"nil",
"\n",
"}"
] |
15,873 | all-15874 | [
"SetInferenceDevices",
"sets",
"the",
"InferenceDevices",
"field",
"s",
"value",
"."
] | [
"func",
"(",
"s",
"*",
"ContainerDefinition",
")",
"SetInferenceDevices",
"(",
"v",
"[",
"]",
"*",
"<mask>",
")",
"*",
"ContainerDefinition",
"{",
"s",
".",
"InferenceDevices",
"=",
"v",
"\n",
"return",
"s",
"\n",
"}"
] |
15,874 | all-15875 | [
"specify",
"a",
"three",
"-",
"dimensional",
"texture",
"image"
] | [
"func",
"TexImage3D",
"(",
"target",
"uint32",
",",
"level",
"int32",
",",
"internalformat",
"int32",
",",
"width",
"int32",
",",
"height",
"int32",
",",
"depth",
"int32",
",",
"border",
"int32",
",",
"format",
"uint32",
",",
"xtype",
"uint32",
",",
"pixels",
"unsafe",
".",
"Pointer",
")",
"{",
"C",
".",
"glowTexImage3D",
"(",
"gpTexImage3D",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"target",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"level",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"internalformat",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"width",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"height",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"<mask>",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"border",
")",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"format",
")",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"xtype",
")",
",",
"pixels",
")",
"\n",
"}"
] |
15,875 | all-15876 | [
"newBuildConfig",
"returns",
"a",
"client",
"and",
"informer",
"capable",
"of",
"mutating",
"and",
"monitoring",
"the",
"specified",
"config",
"."
] | [
"func",
"newBuildConfig",
"(",
"cfg",
"rest",
".",
"Config",
",",
"stop",
"chan",
"struct",
"{",
"}",
")",
"(",
"*",
"buildConfig",
",",
"error",
")",
"{",
"bc",
",",
"err",
":=",
"buildset",
".",
"NewForConfig",
"(",
"&",
"cfg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Ensure the knative-build CRD is deployed",
"// TODO(fejta): probably a better way to do this",
"_",
",",
"err",
"=",
"bc",
".",
"BuildV1alpha1",
"(",
")",
".",
"Builds",
"(",
"\"",
"\"",
")",
".",
"List",
"(",
"metav1",
".",
"ListOptions",
"{",
"Limit",
":",
"1",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"// Assume watches receive updates, but resync every 30m in case something wonky happens",
"bif",
":=",
"buildinfo",
".",
"NewSharedInformerFactory",
"(",
"bc",
",",
"30",
"*",
"time",
".",
"Minute",
")",
"\n",
"bif",
".",
"Build",
"(",
")",
".",
"V1alpha1",
"(",
")",
".",
"Builds",
"(",
")",
".",
"Lister",
"(",
")",
"\n",
"<mask>",
"bif",
".",
"Start",
"(",
"stop",
")",
"\n",
"return",
"&",
"buildConfig",
"{",
"client",
":",
"bc",
",",
"informer",
":",
"bif",
".",
"Build",
"(",
")",
".",
"V1alpha1",
"(",
")",
".",
"Builds",
"(",
")",
",",
"}",
",",
"nil",
"\n",
"}"
] |
15,876 | all-15877 | [
"GetNewIdOk",
"returns",
"a",
"tuple",
"with",
"the",
"NewId",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"Screenboard",
")",
"GetNewIdOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"NewId",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"s",
".",
"NewId",
",",
"true",
"\n",
"}"
] |
15,877 | all-15878 | [
"Format",
"formats",
"the",
"values",
"into",
"the",
"provided",
"string"
] | [
"func",
"Format",
"(",
"format",
"string",
",",
"values",
"Attributes",
")",
"string",
"{",
"formatter",
",",
"err",
":=",
"messageformat",
".",
"New",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"format",
"\n",
"}",
"\n\n",
"fm",
",",
"err",
":=",
"formatter",
".",
"Parse",
"(",
"format",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"format",
"\n",
"}",
"\n\n",
"fixed",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"len",
"(",
"values",
")",
")",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"<mask>",
"{",
"fixed",
"[",
"k",
"]",
"=",
"fix",
"(",
"v",
")",
"\n",
"}",
"\n\n",
"// todo format unsupported types",
"res",
",",
"err",
":=",
"fm",
".",
"FormatMap",
"(",
"fixed",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"fmt",
".",
"Println",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"return",
"format",
"\n",
"}",
"\n\n",
"return",
"res",
"\n",
"}"
] |
15,878 | all-15879 | [
"GetDockerAuthFromASM",
"makes",
"the",
"api",
"call",
"to",
"the",
"AWS",
"Secrets",
"Manager",
"service",
"to",
"retrieve",
"the",
"docker",
"auth",
"data"
] | [
"func",
"GetDockerAuthFromASM",
"(",
"secretID",
"string",
",",
"client",
"secretsmanageriface",
".",
"SecretsManagerAPI",
")",
"(",
"types",
".",
"AuthConfig",
",",
"error",
")",
"{",
"in",
":=",
"&",
"secretsmanager",
".",
"GetSecretValueInput",
"{",
"SecretId",
":",
"aws",
".",
"String",
"(",
"secretID",
")",
",",
"}",
"\n\n",
"out",
",",
"err",
":=",
"client",
".",
"GetSecretValue",
"(",
"in",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"types",
".",
"AuthConfig",
"{",
"}",
",",
"<mask>",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
",",
"secretID",
")",
"\n",
"}",
"\n\n",
"return",
"extractASMValue",
"(",
"out",
")",
"\n",
"}"
] |
15,879 | all-15880 | [
"StringWithinTransport",
"returns",
"a",
"string",
"representation",
"of",
"the",
"reference",
"which",
"MUST",
"be",
"such",
"that",
"reference",
".",
"Transport",
"()",
".",
"ParseReference",
"(",
"reference",
".",
"StringWithinTransport",
"()",
")",
"returns",
"an",
"equivalent",
"reference",
".",
"NOTE",
":",
"The",
"returned",
"string",
"is",
"not",
"promised",
"to",
"be",
"equal",
"to",
"the",
"original",
"input",
"to",
"ParseReference",
";",
"e",
".",
"g",
".",
"default",
"attribute",
"values",
"omitted",
"by",
"the",
"user",
"may",
"be",
"filled",
"in",
"in",
"the",
"return",
"value",
"or",
"vice",
"versa",
".",
"WARNING",
":",
"Do",
"not",
"use",
"the",
"return",
"value",
"in",
"the",
"UI",
"to",
"describe",
"an",
"image",
"it",
"does",
"not",
"contain",
"the",
"Transport",
"()",
".",
"Name",
"()",
"prefix",
"."
] | [
"func",
"(",
"ref",
"ostreeReference",
")",
"StringWithinTransport",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"<mask>",
".",
"image",
",",
"ref",
".",
"repo",
")",
"\n",
"}"
] |
15,880 | all-15881 | [
"DeepCopy",
"copies",
"the",
"receiver",
"into",
"a",
"new",
"Date",
"."
] | [
"func",
"(",
"d",
"*",
"Date",
")",
"DeepCopy",
"(",
")",
"*",
"Date",
"{",
"if",
"d",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"<mask>",
"(",
"Date",
")",
"\n",
"d",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
"return",
"out",
"\n",
"}"
] |
15,881 | all-15882 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetBlockedURLSParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork18",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
15,882 | all-15883 | [
"AppendCert",
"appends",
"certificate",
"and",
"keyfile",
"to",
"TLS",
"Configuration",
".",
"This",
"function",
"allows",
"programmer",
"to",
"handle",
"multiple",
"domains",
"in",
"one",
"server",
"structure",
".",
"See",
"examples",
"/",
"multidomain"
] | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"AppendCert",
"(",
"certFile",
",",
"keyFile",
"string",
")",
"error",
"{",
"if",
"len",
"(",
"certFile",
")",
"==",
"0",
"&&",
"len",
"(",
"keyFile",
")",
"==",
"0",
"{",
"return",
"errNoCertOrKeyProvided",
"\n",
"}",
"\n\n",
"cert",
",",
"err",
":=",
"tls",
".",
"LoadX509KeyPair",
"(",
"certFile",
",",
"keyFile",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"certFile",
",",
"keyFile",
",",
"err",
")",
"\n",
"}",
"\n\n",
"s",
".",
"configTLS",
"(",
")",
"\n\n",
"s",
".",
"tlsConfig",
".",
"Certificates",
"=",
"append",
"(",
"s",
".",
"tlsConfig",
".",
"Certificates",
",",
"cert",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
15,883 | all-15884 | [
"Grep",
"emits",
"every",
"input",
"x",
"that",
"matches",
"the",
"regular",
"expression",
"r",
"."
] | [
"func",
"Grep",
"(",
"r",
"string",
")",
"Filter",
"{",
"<mask>",
",",
"err",
":=",
"regexp",
".",
"Compile",
"(",
"r",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"FilterFunc",
"(",
"func",
"(",
"Arg",
")",
"error",
"{",
"return",
"err",
"}",
")",
"\n",
"}",
"\n",
"return",
"If",
"(",
"re",
".",
"MatchString",
")",
"\n",
"}"
] |
15,884 | all-15885 | [
"ClippedParent",
"finds",
"the",
"first",
"c",
"parent",
"with",
"clipped",
"flag"
] | [
"func",
"ClippedParent",
"(",
"c",
"Control",
")",
"Control",
"{",
"<mask>",
"clipped",
"Control",
"\n\n",
"ctrl",
":=",
"c",
".",
"Parent",
"(",
")",
"\n",
"clipped",
"=",
"c",
"\n\n",
"for",
"ctrl",
"!=",
"nil",
"{",
"if",
"ctrl",
".",
"Clipped",
"(",
")",
"{",
"clipped",
"=",
"ctrl",
"\n",
"break",
"\n",
"}",
"\n\n",
"ctrl",
"=",
"ctrl",
".",
"Parent",
"(",
")",
"\n",
"}",
"\n\n",
"return",
"clipped",
"\n",
"}"
] |
15,885 | all-15886 | [
"GetHasSubtitle",
"is",
"a",
"wrapper",
"around",
"gtk_header_bar_get_has_subtitle",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"HeaderBar",
")",
"GetHasSubtitle",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_header_bar_get_has_subtitle",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
15,886 | all-15887 | [
"ListNoIssueApprovals",
"returns",
"the",
"list",
"of",
"no",
"-",
"issue",
"approvals"
] | [
"func",
"(",
"ap",
"Approvers",
")",
"ListNoIssueApprovals",
"(",
")",
"[",
"]",
"Approval",
"{",
"approvals",
":=",
"[",
"]",
"Approval",
"{",
"}",
"\n\n",
"for",
"_",
",",
"approver",
":=",
"<mask>",
"ap",
".",
"GetNoIssueApproversSet",
"(",
")",
".",
"List",
"(",
")",
"{",
"approvals",
"=",
"append",
"(",
"approvals",
",",
"ap",
".",
"approvers",
"[",
"approver",
"]",
")",
"\n",
"}",
"\n\n",
"return",
"approvals",
"\n",
"}"
] |
15,887 | all-15888 | [
"CanSend",
"returns",
"true",
"if",
"you",
"can",
"send",
"more",
"data",
"onto",
"the",
"chID",
"false",
"otherwise",
".",
"Use",
"only",
"as",
"a",
"heuristic",
"."
] | [
"func",
"(",
"c",
"*",
"MConnection",
")",
"CanSend",
"(",
"chID",
"byte",
")",
"bool",
"{",
"if",
"!",
"c",
".",
"IsRunning",
"(",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"<mask>",
",",
"ok",
":=",
"c",
".",
"channelsIdx",
"[",
"chID",
"]",
"\n",
"if",
"!",
"ok",
"{",
"log",
".",
"Error",
"(",
"cmn",
".",
"Fmt",
"(",
"\"",
"\"",
",",
"chID",
")",
")",
"\n",
"return",
"false",
"\n",
"}",
"\n",
"return",
"channel",
".",
"canSend",
"(",
")",
"\n",
"}"
] |
15,888 | all-15889 | [
"ReceiveIssue",
"calls",
"plugin",
".",
"ReceiveIssue",
"()",
"for",
"all",
"plugins"
] | [
"func",
"(",
"m",
"*",
"MultiplexerPluginWrapper",
")",
"ReceiveIssue",
"(",
"issue",
"sql",
".",
"Issue",
")",
"[",
"]",
"Point",
"{",
"points",
":=",
"[",
"]",
"Point",
"{",
"}",
"\n\n",
"for",
"_",
",",
"plugin",
":=",
"range",
"m",
".",
"plugins",
"{",
"points",
"=",
"append",
"(",
"<mask>",
",",
"plugin",
".",
"ReceiveIssue",
"(",
"issue",
")",
"...",
")",
"\n",
"}",
"\n\n",
"return",
"points",
"\n",
"}"
] |
15,889 | all-15890 | [
"PutInt64",
"sets",
"a",
"64",
"-",
"bit",
"signed",
"integer",
"for",
"the",
"given",
"field",
"name",
".",
"The",
"field",
"name",
"must",
"be",
"a",
"Int64Field",
".",
"Otherwise",
"an",
"error",
"will",
"be",
"returned",
".",
"If",
"the",
"type",
"buffer",
"no",
"longer",
"has",
"enough",
"space",
"to",
"write",
"the",
"value",
"an",
"xbinary",
".",
"ErrOutOfRange",
"error",
"will",
"be",
"returned",
".",
"Upon",
"success",
"the",
"number",
"of",
"bytes",
"written",
"as",
"well",
"as",
"a",
"nil",
"error",
"will",
"be",
"returned",
".",
"The",
"type",
"code",
"will",
"be",
"written",
"first",
".",
"If",
"the",
"absolute",
"value",
"is",
"<",
"math",
".",
"MaxUint8",
"only",
"1",
"byte",
"will",
"be",
"written",
".",
"If",
"the",
"absolute",
"value",
"is",
"<",
"math",
".",
"MaxUint16",
"only",
"2",
"bytes",
"will",
"be",
"written",
".",
"If",
"the",
"absolute",
"value",
"is",
"<",
"math",
".",
"MaxUint32",
"only",
"4",
"bytes",
"will",
"be",
"written",
".",
"Otherwise",
"the",
"entire",
"64",
"-",
"bit",
"value",
"will",
"be",
"written",
"."
] | [
"func",
"(",
"b",
"*",
"TupleBuilder",
")",
"PutInt64",
"(",
"field",
"string",
",",
"value",
"int64",
")",
"(",
"wrote",
"uint64",
",",
"err",
"error",
")",
"{",
"// field type should be",
"if",
"err",
"=",
"b",
".",
"typeCheck",
"(",
"field",
",",
"Int64Field",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
"\n\n",
"unsigned",
":=",
"uint64",
"(",
"value",
")",
"\n",
"if",
"unsigned",
"<",
"math",
".",
"MaxUint8",
"{",
"// minimum bytes is 2 (type code + value)",
"if",
"b",
".",
"available",
"(",
")",
"<",
"2",
"{",
"return",
"0",
",",
"xbinary",
".",
"ErrOutOfRange",
"\n",
"}",
"\n\n",
"// write type code",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"]",
"=",
"<mask>",
"(",
"Long8Code",
".",
"OpCode",
")",
"\n\n",
"// write value",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"+",
"1",
"]",
"=",
"byte",
"(",
"value",
")",
"\n\n",
"// set field offset",
"b",
".",
"offsets",
"[",
"field",
"]",
"=",
"b",
".",
"pos",
"\n\n",
"// incr pos",
"b",
".",
"pos",
"+=",
"2",
"\n\n",
"return",
"2",
",",
"nil",
"\n",
"}",
"else",
"if",
"unsigned",
"<",
"math",
".",
"MaxUint16",
"{",
"// write value",
"// length check performed by xbinary",
"wrote",
",",
"err",
"=",
"xbinary",
".",
"LittleEndian",
".",
"PutInt16",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"1",
",",
"int16",
"(",
"value",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
"\n\n",
"// write type code",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"]",
"=",
"byte",
"(",
"Long16Code",
".",
"OpCode",
")",
"\n\n",
"// set field offset",
"b",
".",
"offsets",
"[",
"field",
"]",
"=",
"b",
".",
"pos",
"\n\n",
"// incr pos",
"b",
".",
"pos",
"+=",
"3",
"\n\n",
"// wrote 3 bytes",
"return",
"3",
",",
"nil",
"\n",
"}",
"else",
"if",
"unsigned",
"<",
"math",
".",
"MaxUint32",
"{",
"// write value",
"// length check performed by xbinary",
"wrote",
",",
"err",
"=",
"xbinary",
".",
"LittleEndian",
".",
"PutInt32",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"1",
",",
"int32",
"(",
"value",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
"\n\n",
"// write type code",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"]",
"=",
"byte",
"(",
"Long32Code",
".",
"OpCode",
")",
"\n\n",
"// set field offset",
"b",
".",
"offsets",
"[",
"field",
"]",
"=",
"b",
".",
"pos",
"\n\n",
"// incr pos",
"b",
".",
"pos",
"+=",
"5",
"\n\n",
"// wrote 5 bytes",
"return",
"5",
",",
"nil",
"\n",
"}",
"\n\n",
"// write value",
"// length check performed by xbinary",
"wrote",
",",
"err",
"=",
"xbinary",
".",
"LittleEndian",
".",
"PutInt64",
"(",
"b",
".",
"buffer",
",",
"b",
".",
"pos",
"+",
"1",
",",
"value",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
"\n\n",
"// write type code",
"b",
".",
"buffer",
"[",
"b",
".",
"pos",
"]",
"=",
"byte",
"(",
"Long64Code",
".",
"OpCode",
")",
"\n\n",
"// set field offset",
"b",
".",
"offsets",
"[",
"field",
"]",
"=",
"b",
".",
"pos",
"\n\n",
"// incr pos",
"b",
".",
"pos",
"+=",
"9",
"\n\n",
"// wrote 9 bytes",
"return",
"9",
",",
"nil",
"\n",
"}"
] |
15,890 | all-15891 | [
"CreateFilesystem",
"creates",
"a",
"new",
"ZFS",
"filesystem",
"with",
"the",
"specified",
"name",
"and",
"properties",
".",
"A",
"full",
"list",
"of",
"available",
"ZFS",
"properties",
"may",
"be",
"found",
"here",
":",
"https",
":",
"//",
"www",
".",
"freebsd",
".",
"org",
"/",
"cgi",
"/",
"man",
".",
"cgi?zfs",
"(",
"8",
")",
"."
] | [
"func",
"CreateFilesystem",
"(",
"name",
"string",
",",
"properties",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"*",
"Dataset",
",",
"error",
")",
"{",
"args",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"1",
",",
"4",
")",
"\n",
"args",
"[",
"0",
"]",
"=",
"\"",
"\"",
"\n\n",
"if",
"properties",
"!=",
"nil",
"{",
"args",
"=",
"append",
"(",
"args",
",",
"propsSlice",
"(",
"<mask>",
")",
"...",
")",
"\n",
"}",
"\n\n",
"args",
"=",
"append",
"(",
"args",
",",
"name",
")",
"\n",
"_",
",",
"err",
":=",
"zfs",
"(",
"args",
"...",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"GetDataset",
"(",
"name",
")",
"\n",
"}"
] |
15,891 | all-15892 | [
"SaveSnap",
"saves",
"the",
"snapshot",
"to",
"disk",
"and",
"release",
"the",
"locked",
"wal",
"files",
"since",
"they",
"will",
"not",
"be",
"used",
"."
] | [
"func",
"(",
"st",
"*",
"storage",
")",
"SaveSnap",
"(",
"snap",
"raftpb",
".",
"Snapshot",
")",
"error",
"{",
"walsnap",
":=",
"walpb",
".",
"Snapshot",
"{",
"Index",
":",
"snap",
".",
"Metadata",
".",
"<mask>",
",",
"Term",
":",
"snap",
".",
"Metadata",
".",
"Term",
",",
"}",
"\n",
"err",
":=",
"st",
".",
"WAL",
".",
"SaveSnapshot",
"(",
"walsnap",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"err",
"=",
"st",
".",
"Snapshotter",
".",
"SaveSnap",
"(",
"snap",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"st",
".",
"WAL",
".",
"ReleaseLockTo",
"(",
"snap",
".",
"Metadata",
".",
"Index",
")",
"\n",
"}"
] |
15,892 | all-15893 | [
"GetUnit",
"returns",
"the",
"Unit",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"a",
"*",
"AlertValueDefinition",
")",
"GetUnit",
"(",
")",
"string",
"{",
"if",
"a",
"==",
"nil",
"||",
"a",
".",
"Unit",
"==",
"nil",
"{",
"<mask>",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"a",
".",
"Unit",
"\n",
"}"
] |
15,893 | all-15894 | [
"BodyWriter",
"returns",
"writer",
"for",
"populating",
"request",
"body",
"."
] | [
"func",
"(",
"req",
"*",
"<mask>",
")",
"BodyWriter",
"(",
")",
"io",
".",
"Writer",
"{",
"req",
".",
"w",
".",
"r",
"=",
"req",
"\n",
"return",
"&",
"req",
".",
"w",
"\n",
"}"
] |
15,894 | all-15895 | [
"GetNCopies",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_get_n_copies",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PrintSettings",
")",
"GetNCopies",
"(",
")",
"int",
"{",
"c",
":=",
"C",
".",
"gtk_print_settings_get_n_copies",
"(",
"<mask>",
".",
"native",
"(",
")",
")",
"\n",
"return",
"int",
"(",
"c",
")",
"\n",
"}"
] |
15,895 | all-15896 | [
"LoadTOMLBytes",
"loads",
"TOML",
"bytes"
] | [
"func",
"LoadTOMLBytes",
"(",
"conf",
"<mask>",
"{",
"}",
",",
"src",
"[",
"]",
"byte",
")",
"error",
"{",
"return",
"loadConfigBytes",
"(",
"conf",
",",
"src",
",",
"nil",
",",
"toml",
".",
"Unmarshal",
")",
"\n",
"}"
] |
15,896 | all-15897 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"CollectClassNamesReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss61",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
15,897 | all-15898 | [
"ActivateFocus",
"is",
"a",
"wrapper",
"around",
"gtk_window_activate_focus",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Window",
")",
"ActivateFocus",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_window_activate_focus",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
15,898 | all-15899 | [
"Sets",
"the",
"executable",
"path",
"for",
"the",
"tracer",
"."
] | [
"func",
"(",
"t",
"*",
"BTTracer",
")",
"SetTracerPath",
"(",
"path",
"string",
")",
"{",
"t",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"defer",
"t",
".",
"m",
".",
"Unlock",
"(",
")",
"\n\n",
"t",
".",
"cmd",
"=",
"<mask>",
"\n",
"}"
] |
15,899 | all-15900 | [
"SetSession",
"set",
"session"
] | [
"func",
"(",
"ctx",
"*",
"Context",
")",
"SetSession",
"(",
"key",
"string",
",",
"values",
"map",
"[",
"string",
"]",
"string",
")",
"error",
"{",
"sid",
":=",
"ctx",
".",
"genSid",
"(",
"key",
")",
"\n",
"values",
"[",
"\"",
"\"",
"]",
"=",
"sid",
"\n",
"timestamp",
":=",
"strconv",
".",
"FormatInt",
"(",
"time",
".",
"Now",
"(",
")",
".",
"Unix",
"(",
")",
",",
"10",
")",
"\n",
"token",
":=",
"ctx",
".",
"genSid",
"(",
"key",
"+",
"timestamp",
")",
"\n",
"values",
"[",
"\"",
"\"",
"]",
"=",
"token",
"\n",
"store",
",",
"err",
":=",
"provider",
".",
"Set",
"(",
"sid",
",",
"values",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"<mask>",
":=",
"httpCookie",
"\n",
"cookie",
".",
"Value",
"=",
"sid",
"\n",
"ctx",
".",
"Data",
"[",
"\"",
"\"",
"]",
"=",
"store",
"\n\n",
"respCookie",
":=",
"ctx",
".",
"ResponseWriter",
".",
"Header",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"respCookie",
",",
"cookie",
".",
"Name",
")",
"{",
"ctx",
".",
"ResponseWriter",
".",
"Header",
"(",
")",
".",
"Del",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"http",
".",
"SetCookie",
"(",
"ctx",
".",
"ResponseWriter",
",",
"&",
"cookie",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.