id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
listlengths 1
418
| pl_tokens
listlengths 22
4.98k
|
---|---|---|---|
22,000 | all-22001 | [
"TraceDatastore",
"adds",
"a",
"datastore",
"segment",
"to",
"the",
"newrelic",
"transaction",
"if",
"one",
"exists",
"in",
"the",
"context",
"."
] | [
"func",
"TraceDatastore",
"(",
"ctx",
"context",
".",
"Context",
",",
"table",
",",
"<mask>",
",",
"sql",
",",
"rollupName",
"string",
")",
"*",
"Trace",
"{",
"return",
"trace",
"(",
"ctx",
",",
"rollupName",
",",
"func",
"(",
"tx",
"Tx",
")",
"error",
"{",
"return",
"tx",
".",
"StartDatastore",
"(",
"table",
",",
"operation",
",",
"sql",
",",
"rollupName",
")",
"\n",
"}",
")",
"\n",
"}"
] |
22,001 | all-22002 | [
"ListRecentBuilds",
"fetches",
"the",
"list",
"of",
"recent",
"builds",
"for",
"all",
"repositories",
"the",
"user",
"is",
"watching",
"If",
"limit",
"is",
"-",
"1",
"fetches",
"all",
"builds"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListRecentBuilds",
"(",
"limit",
",",
"offset",
"int",
")",
"(",
"[",
"]",
"*",
"Build",
",",
"error",
")",
"{",
"return",
"c",
".",
"recentBuilds",
"(",
"\"",
"\"",
",",
"nil",
",",
"limit",
",",
"<mask>",
")",
"\n",
"}"
] |
22,002 | all-22003 | [
"ReorderOverlay",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_overlay_reorder_overlay",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Overlay",
")",
"ReorderOverlay",
"(",
"child",
"IWidget",
",",
"position",
"int",
")",
"{",
"C",
".",
"gtk_overlay_reorder_overlay",
"(",
"v",
".",
"native",
"(",
")",
",",
"<mask>",
".",
"toWidget",
"(",
")",
",",
"C",
".",
"gint",
"(",
"position",
")",
")",
"\n",
"}"
] |
22,003 | all-22004 | [
"Copy",
"returns",
"a",
"deep",
"copy",
"of",
"this",
"configuration",
"."
] | [
"func",
"(",
"c",
"*",
"EnvConfig",
")",
"Copy",
"(",
")",
"*",
"EnvConfig",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"var",
"o",
"EnvConfig",
"\n\n",
"if",
"c",
".",
"Blacklist",
"!=",
"nil",
"{",
"o",
".",
"Blacklist",
"=",
"append",
"(",
"[",
"]",
"string",
"{",
"}",
",",
"c",
".",
"Blacklist",
"...",
")",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"Custom",
"!=",
"nil",
"{",
"o",
".",
"Custom",
"=",
"<mask>",
"(",
"[",
"]",
"string",
"{",
"}",
",",
"c",
".",
"Custom",
"...",
")",
"\n",
"}",
"\n\n",
"o",
".",
"Pristine",
"=",
"c",
".",
"Pristine",
"\n\n",
"if",
"c",
".",
"Whitelist",
"!=",
"nil",
"{",
"o",
".",
"Whitelist",
"=",
"append",
"(",
"[",
"]",
"string",
"{",
"}",
",",
"c",
".",
"Whitelist",
"...",
")",
"\n",
"}",
"\n\n",
"return",
"&",
"o",
"\n",
"}"
] |
22,004 | all-22005 | [
"GetAccountID",
"returns",
"the",
"AccountID",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"i",
"*",
"IntegrationAWSAccount",
")",
"GetAccountID",
"(",
")",
"<mask>",
"{",
"if",
"i",
"==",
"nil",
"||",
"i",
".",
"AccountID",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"i",
".",
"AccountID",
"\n",
"}"
] |
22,005 | all-22006 | [
"Offering",
"returns",
"offerings",
"raw",
"msg",
"with",
"given",
"hash",
"."
] | [
"func",
"(",
"h",
"*",
"Handler",
")",
"Offering",
"(",
"hash",
"data",
".",
"HexString",
")",
"(",
"*",
"data",
".",
"Base64String",
",",
"error",
")",
"{",
"logger",
":=",
"h",
".",
"logger",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n\n",
"offering",
",",
"err",
":=",
"h",
".",
"offeringByHash",
"(",
"logger",
",",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"err",
"==",
"ErrOfferingNotFound",
"{",
"logger",
".",
"Warn",
"(",
"\"",
"\"",
"+",
"string",
"(",
"hash",
")",
")",
"\n",
"}",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"offering",
".",
"RawMsg",
",",
"nil",
"\n",
"}"
] |
22,006 | all-22007 | [
"HasHeight",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"WidgetLayout",
")",
"HasHeight",
"(",
")",
"bool",
"{",
"if",
"w",
"!=",
"nil",
"&&",
"w",
".",
"Height",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
22,007 | all-22008 | [
"WriteIndentedN",
"indents",
"all",
"lines",
"n",
"spaces",
"."
] | [
"func",
"WriteIndentedN",
"(",
"w",
"io",
".",
"<mask>",
",",
"b",
"[",
"]",
"byte",
",",
"n",
"int",
")",
"error",
"{",
"s",
":=",
"bufio",
".",
"NewScanner",
"(",
"bytes",
".",
"NewReader",
"(",
"b",
")",
")",
"\n",
"if",
"!",
"s",
".",
"Scan",
"(",
")",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"l",
":=",
"s",
".",
"Text",
"(",
")",
"\n",
"for",
"{",
"for",
"x",
":=",
"0",
";",
"x",
"<",
"n",
";",
"x",
"++",
"{",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"l",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"!",
"s",
".",
"Scan",
"(",
")",
"{",
"break",
"\n",
"}",
"\n",
"l",
"=",
"s",
".",
"Text",
"(",
")",
"\n",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprint",
"(",
"w",
",",
"\"",
"\\n",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
22,008 | all-22009 | [
"Pipelines",
"returns",
"a",
"Collection",
"of",
"pipelines"
] | [
"func",
"Pipelines",
"(",
"etcdClient",
"*",
"etcd",
".",
"Client",
",",
"etcdPrefix",
"string",
")",
"col",
".",
"<mask>",
"{",
"return",
"col",
".",
"NewCollection",
"(",
"etcdClient",
",",
"path",
".",
"Join",
"(",
"etcdPrefix",
",",
"pipelinesPrefix",
")",
",",
"nil",
",",
"&",
"pps",
".",
"EtcdPipelineInfo",
"{",
"}",
",",
"nil",
",",
"nil",
",",
")",
"\n",
"}"
] |
22,009 | all-22010 | [
"InitializeCommentPruner",
"attaches",
"a",
"commentpruner",
".",
"EventClient",
"to",
"the",
"agent",
"to",
"handle",
"pruning",
"comments",
"."
] | [
"func",
"(",
"a",
"*",
"<mask>",
")",
"InitializeCommentPruner",
"(",
"org",
",",
"repo",
"string",
",",
"pr",
"int",
")",
"{",
"a",
".",
"commentPruner",
"=",
"commentpruner",
".",
"NewEventClient",
"(",
"a",
".",
"GitHubClient",
",",
"a",
".",
"Logger",
".",
"WithField",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
",",
"org",
",",
"repo",
",",
"pr",
",",
")",
"\n",
"}"
] |
22,010 | all-22011 | [
"SeekForPrev",
"searches",
"for",
"the",
"record",
"with",
"the",
"given",
"key",
".",
"If",
"it",
"is",
"present",
"in",
"the",
"skiplist",
"then",
"SeekForPrev",
"positions",
"the",
"iterator",
"on",
"that",
"record",
"and",
"returns",
"true",
".",
"If",
"the",
"record",
"is",
"not",
"present",
"then",
"SeekForPrev",
"positions",
"the",
"iterator",
"on",
"the",
"preceding",
"node",
"(",
"if",
"it",
"exists",
")",
"and",
"returns",
"false",
"."
] | [
"func",
"(",
"it",
"*",
"Iterator",
")",
"SeekForPrev",
"(",
"key",
"[",
"]",
"byte",
")",
"(",
"<mask>",
"bool",
")",
"{",
"var",
"prev",
",",
"next",
"*",
"node",
"\n",
"prev",
",",
"next",
",",
"found",
"=",
"it",
".",
"seekForBaseSplice",
"(",
"key",
")",
"\n\n",
"var",
"present",
"bool",
"\n",
"if",
"found",
"{",
"present",
"=",
"it",
".",
"setNode",
"(",
"next",
",",
"true",
")",
"\n",
"}",
"else",
"{",
"present",
"=",
"it",
".",
"setNode",
"(",
"prev",
",",
"true",
")",
"\n",
"}",
"\n\n",
"return",
"found",
"&&",
"present",
"\n",
"}"
] |
22,011 | all-22012 | [
"SetupNS",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockCNIClient",
")",
"SetupNS",
"(",
"arg0",
"context",
".",
"Context",
",",
"arg1",
"*",
"ecscni",
".",
"Config",
",",
"arg2",
"time",
".",
"Duration",
")",
"(",
"*",
"current",
".",
"Result",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
",",
"arg2",
")",
"\n",
"ret0",
",",
"_",
":=",
"<mask>",
"[",
"0",
"]",
".",
"(",
"*",
"current",
".",
"Result",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] |
22,012 | all-22013 | [
"FillStroke",
"first",
"fills",
"the",
"paths",
"and",
"than",
"strokes",
"them"
] | [
"func",
"(",
"gc",
"*",
"GraphicContext",
")",
"FillStroke",
"(",
"paths",
"...",
"*",
"draw2d",
".",
"Path",
")",
"{",
"var",
"rule",
"string",
"\n",
"if",
"gc",
".",
"Current",
".",
"FillRule",
"!=",
"draw2d",
".",
"FillRuleWinding",
"{",
"rule",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"_",
",",
"_",
",",
"_",
",",
"alphaS",
":=",
"gc",
".",
"Current",
".",
"StrokeColor",
".",
"RGBA",
"(",
")",
"\n",
"_",
",",
"_",
",",
"_",
",",
"alphaF",
":=",
"gc",
".",
"Current",
".",
"FillColor",
".",
"RGBA",
"(",
")",
"\n",
"if",
"alphaS",
"==",
"alphaF",
"{",
"gc",
".",
"<mask>",
"(",
"\"",
"\"",
"+",
"rule",
",",
"alphaF",
",",
"paths",
"...",
")",
"\n",
"}",
"else",
"{",
"gc",
".",
"draw",
"(",
"\"",
"\"",
"+",
"rule",
",",
"alphaF",
",",
"paths",
"...",
")",
"\n",
"gc",
".",
"draw",
"(",
"\"",
"\"",
",",
"alphaS",
",",
"paths",
"...",
")",
"\n",
"}",
"\n",
"gc",
".",
"Current",
".",
"Path",
".",
"Clear",
"(",
")",
"\n",
"}"
] |
22,013 | all-22014 | [
"aggregation",
"evaluates",
"an",
"aggregation",
"operation",
"on",
"a",
"Vector",
"."
] | [
"func",
"(",
"ev",
"*",
"evaluator",
")",
"aggregation",
"(",
"op",
"ItemType",
",",
"grouping",
"[",
"]",
"string",
",",
"without",
"bool",
",",
"param",
"interface",
"{",
"}",
",",
"vec",
"Vector",
",",
"enh",
"*",
"EvalNodeHelper",
")",
"Vector",
"{",
"result",
":=",
"map",
"[",
"uint64",
"]",
"*",
"groupedAggregation",
"{",
"}",
"\n",
"var",
"k",
"int64",
"\n",
"if",
"op",
"==",
"ItemTopK",
"||",
"op",
"==",
"ItemBottomK",
"{",
"f",
":=",
"param",
".",
"(",
"float64",
")",
"\n",
"if",
"!",
"convertibleToInt64",
"(",
"f",
")",
"{",
"ev",
".",
"errorf",
"(",
"\"",
"\"",
",",
"f",
")",
"\n",
"}",
"\n",
"k",
"=",
"int64",
"(",
"f",
")",
"\n",
"if",
"k",
"<",
"1",
"{",
"return",
"Vector",
"{",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"var",
"q",
"float64",
"\n",
"if",
"op",
"==",
"ItemQuantile",
"{",
"q",
"=",
"param",
".",
"(",
"float64",
")",
"\n",
"}",
"\n",
"<mask>",
"valueLabel",
"string",
"\n",
"if",
"op",
"==",
"ItemCountValues",
"{",
"valueLabel",
"=",
"param",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"model",
".",
"LabelName",
"(",
"valueLabel",
")",
".",
"IsValid",
"(",
")",
"{",
"ev",
".",
"errorf",
"(",
"\"",
"\"",
",",
"valueLabel",
")",
"\n",
"}",
"\n",
"if",
"!",
"without",
"{",
"grouping",
"=",
"append",
"(",
"grouping",
",",
"valueLabel",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"s",
":=",
"range",
"vec",
"{",
"metric",
":=",
"s",
".",
"Metric",
"\n\n",
"if",
"op",
"==",
"ItemCountValues",
"{",
"lb",
":=",
"labels",
".",
"NewBuilder",
"(",
"metric",
")",
"\n",
"lb",
".",
"Set",
"(",
"valueLabel",
",",
"strconv",
".",
"FormatFloat",
"(",
"s",
".",
"V",
",",
"'f'",
",",
"-",
"1",
",",
"64",
")",
")",
"\n",
"metric",
"=",
"lb",
".",
"Labels",
"(",
")",
"\n",
"}",
"\n\n",
"var",
"(",
"groupingKey",
"uint64",
"\n",
")",
"\n",
"if",
"without",
"{",
"groupingKey",
"=",
"metric",
".",
"HashWithoutLabels",
"(",
"grouping",
"...",
")",
"\n",
"}",
"else",
"{",
"groupingKey",
"=",
"metric",
".",
"HashForLabels",
"(",
"grouping",
"...",
")",
"\n",
"}",
"\n\n",
"group",
",",
"ok",
":=",
"result",
"[",
"groupingKey",
"]",
"\n",
"// Add a new group if it doesn't exist.",
"if",
"!",
"ok",
"{",
"var",
"m",
"labels",
".",
"Labels",
"\n\n",
"if",
"without",
"{",
"lb",
":=",
"labels",
".",
"NewBuilder",
"(",
"metric",
")",
"\n",
"lb",
".",
"Del",
"(",
"grouping",
"...",
")",
"\n",
"lb",
".",
"Del",
"(",
"labels",
".",
"MetricName",
")",
"\n",
"m",
"=",
"lb",
".",
"Labels",
"(",
")",
"\n",
"}",
"else",
"{",
"m",
"=",
"make",
"(",
"labels",
".",
"Labels",
",",
"0",
",",
"len",
"(",
"grouping",
")",
")",
"\n",
"for",
"_",
",",
"l",
":=",
"range",
"metric",
"{",
"for",
"_",
",",
"n",
":=",
"range",
"grouping",
"{",
"if",
"l",
".",
"Name",
"==",
"n",
"{",
"m",
"=",
"append",
"(",
"m",
",",
"l",
")",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"sort",
".",
"Sort",
"(",
"m",
")",
"\n",
"}",
"\n",
"result",
"[",
"groupingKey",
"]",
"=",
"&",
"groupedAggregation",
"{",
"labels",
":",
"m",
",",
"value",
":",
"s",
".",
"V",
",",
"mean",
":",
"s",
".",
"V",
",",
"groupCount",
":",
"1",
",",
"}",
"\n",
"inputVecLen",
":=",
"int64",
"(",
"len",
"(",
"vec",
")",
")",
"\n",
"resultSize",
":=",
"k",
"\n",
"if",
"k",
">",
"inputVecLen",
"{",
"resultSize",
"=",
"inputVecLen",
"\n",
"}",
"\n",
"if",
"op",
"==",
"ItemStdvar",
"||",
"op",
"==",
"ItemStddev",
"{",
"result",
"[",
"groupingKey",
"]",
".",
"value",
"=",
"0.0",
"\n",
"}",
"else",
"if",
"op",
"==",
"ItemTopK",
"||",
"op",
"==",
"ItemQuantile",
"{",
"result",
"[",
"groupingKey",
"]",
".",
"heap",
"=",
"make",
"(",
"vectorByValueHeap",
",",
"0",
",",
"resultSize",
")",
"\n",
"heap",
".",
"Push",
"(",
"&",
"result",
"[",
"groupingKey",
"]",
".",
"heap",
",",
"&",
"Sample",
"{",
"Point",
":",
"Point",
"{",
"V",
":",
"s",
".",
"V",
"}",
",",
"Metric",
":",
"s",
".",
"Metric",
",",
"}",
")",
"\n",
"}",
"else",
"if",
"op",
"==",
"ItemBottomK",
"{",
"result",
"[",
"groupingKey",
"]",
".",
"reverseHeap",
"=",
"make",
"(",
"vectorByReverseValueHeap",
",",
"0",
",",
"resultSize",
")",
"\n",
"heap",
".",
"Push",
"(",
"&",
"result",
"[",
"groupingKey",
"]",
".",
"reverseHeap",
",",
"&",
"Sample",
"{",
"Point",
":",
"Point",
"{",
"V",
":",
"s",
".",
"V",
"}",
",",
"Metric",
":",
"s",
".",
"Metric",
",",
"}",
")",
"\n",
"}",
"\n",
"continue",
"\n",
"}",
"\n\n",
"switch",
"op",
"{",
"case",
"ItemSum",
":",
"group",
".",
"value",
"+=",
"s",
".",
"V",
"\n\n",
"case",
"ItemAvg",
":",
"group",
".",
"groupCount",
"++",
"\n",
"group",
".",
"mean",
"+=",
"(",
"s",
".",
"V",
"-",
"group",
".",
"mean",
")",
"/",
"float64",
"(",
"group",
".",
"groupCount",
")",
"\n\n",
"case",
"ItemMax",
":",
"if",
"group",
".",
"value",
"<",
"s",
".",
"V",
"||",
"math",
".",
"IsNaN",
"(",
"group",
".",
"value",
")",
"{",
"group",
".",
"value",
"=",
"s",
".",
"V",
"\n",
"}",
"\n\n",
"case",
"ItemMin",
":",
"if",
"group",
".",
"value",
">",
"s",
".",
"V",
"||",
"math",
".",
"IsNaN",
"(",
"group",
".",
"value",
")",
"{",
"group",
".",
"value",
"=",
"s",
".",
"V",
"\n",
"}",
"\n\n",
"case",
"ItemCount",
",",
"ItemCountValues",
":",
"group",
".",
"groupCount",
"++",
"\n\n",
"case",
"ItemStdvar",
",",
"ItemStddev",
":",
"group",
".",
"groupCount",
"++",
"\n",
"delta",
":=",
"s",
".",
"V",
"-",
"group",
".",
"mean",
"\n",
"group",
".",
"mean",
"+=",
"delta",
"/",
"float64",
"(",
"group",
".",
"groupCount",
")",
"\n",
"group",
".",
"value",
"+=",
"delta",
"*",
"(",
"s",
".",
"V",
"-",
"group",
".",
"mean",
")",
"\n\n",
"case",
"ItemTopK",
":",
"if",
"int64",
"(",
"len",
"(",
"group",
".",
"heap",
")",
")",
"<",
"k",
"||",
"group",
".",
"heap",
"[",
"0",
"]",
".",
"V",
"<",
"s",
".",
"V",
"||",
"math",
".",
"IsNaN",
"(",
"group",
".",
"heap",
"[",
"0",
"]",
".",
"V",
")",
"{",
"if",
"int64",
"(",
"len",
"(",
"group",
".",
"heap",
")",
")",
"==",
"k",
"{",
"heap",
".",
"Pop",
"(",
"&",
"group",
".",
"heap",
")",
"\n",
"}",
"\n",
"heap",
".",
"Push",
"(",
"&",
"group",
".",
"heap",
",",
"&",
"Sample",
"{",
"Point",
":",
"Point",
"{",
"V",
":",
"s",
".",
"V",
"}",
",",
"Metric",
":",
"s",
".",
"Metric",
",",
"}",
")",
"\n",
"}",
"\n\n",
"case",
"ItemBottomK",
":",
"if",
"int64",
"(",
"len",
"(",
"group",
".",
"reverseHeap",
")",
")",
"<",
"k",
"||",
"group",
".",
"reverseHeap",
"[",
"0",
"]",
".",
"V",
">",
"s",
".",
"V",
"||",
"math",
".",
"IsNaN",
"(",
"group",
".",
"reverseHeap",
"[",
"0",
"]",
".",
"V",
")",
"{",
"if",
"int64",
"(",
"len",
"(",
"group",
".",
"reverseHeap",
")",
")",
"==",
"k",
"{",
"heap",
".",
"Pop",
"(",
"&",
"group",
".",
"reverseHeap",
")",
"\n",
"}",
"\n",
"heap",
".",
"Push",
"(",
"&",
"group",
".",
"reverseHeap",
",",
"&",
"Sample",
"{",
"Point",
":",
"Point",
"{",
"V",
":",
"s",
".",
"V",
"}",
",",
"Metric",
":",
"s",
".",
"Metric",
",",
"}",
")",
"\n",
"}",
"\n\n",
"case",
"ItemQuantile",
":",
"group",
".",
"heap",
"=",
"append",
"(",
"group",
".",
"heap",
",",
"s",
")",
"\n\n",
"default",
":",
"panic",
"(",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"op",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Construct the result Vector from the aggregated groups.",
"for",
"_",
",",
"aggr",
":=",
"range",
"result",
"{",
"switch",
"op",
"{",
"case",
"ItemAvg",
":",
"aggr",
".",
"value",
"=",
"aggr",
".",
"mean",
"\n\n",
"case",
"ItemCount",
",",
"ItemCountValues",
":",
"aggr",
".",
"value",
"=",
"float64",
"(",
"aggr",
".",
"groupCount",
")",
"\n\n",
"case",
"ItemStdvar",
":",
"aggr",
".",
"value",
"=",
"aggr",
".",
"value",
"/",
"float64",
"(",
"aggr",
".",
"groupCount",
")",
"\n\n",
"case",
"ItemStddev",
":",
"aggr",
".",
"value",
"=",
"math",
".",
"Sqrt",
"(",
"aggr",
".",
"value",
"/",
"float64",
"(",
"aggr",
".",
"groupCount",
")",
")",
"\n\n",
"case",
"ItemTopK",
":",
"// The heap keeps the lowest value on top, so reverse it.",
"sort",
".",
"Sort",
"(",
"sort",
".",
"Reverse",
"(",
"aggr",
".",
"heap",
")",
")",
"\n",
"for",
"_",
",",
"v",
":=",
"range",
"aggr",
".",
"heap",
"{",
"enh",
".",
"out",
"=",
"append",
"(",
"enh",
".",
"out",
",",
"Sample",
"{",
"Metric",
":",
"v",
".",
"Metric",
",",
"Point",
":",
"Point",
"{",
"V",
":",
"v",
".",
"V",
"}",
",",
"}",
")",
"\n",
"}",
"\n",
"continue",
"// Bypass default append.",
"\n\n",
"case",
"ItemBottomK",
":",
"// The heap keeps the lowest value on top, so reverse it.",
"sort",
".",
"Sort",
"(",
"sort",
".",
"Reverse",
"(",
"aggr",
".",
"reverseHeap",
")",
")",
"\n",
"for",
"_",
",",
"v",
":=",
"range",
"aggr",
".",
"reverseHeap",
"{",
"enh",
".",
"out",
"=",
"append",
"(",
"enh",
".",
"out",
",",
"Sample",
"{",
"Metric",
":",
"v",
".",
"Metric",
",",
"Point",
":",
"Point",
"{",
"V",
":",
"v",
".",
"V",
"}",
",",
"}",
")",
"\n",
"}",
"\n",
"continue",
"// Bypass default append.",
"\n\n",
"case",
"ItemQuantile",
":",
"aggr",
".",
"value",
"=",
"quantile",
"(",
"q",
",",
"aggr",
".",
"heap",
")",
"\n\n",
"default",
":",
"// For other aggregations, we already have the right value.",
"}",
"\n\n",
"enh",
".",
"out",
"=",
"append",
"(",
"enh",
".",
"out",
",",
"Sample",
"{",
"Metric",
":",
"aggr",
".",
"labels",
",",
"Point",
":",
"Point",
"{",
"V",
":",
"aggr",
".",
"value",
"}",
",",
"}",
")",
"\n",
"}",
"\n",
"return",
"enh",
".",
"out",
"\n",
"}"
] |
22,014 | all-22015 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"AddCompilationCacheParams",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage85",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
22,015 | all-22016 | [
"HasRelatedId",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"HasRelatedId",
"(",
")",
"bool",
"{",
"if",
"c",
"!=",
"nil",
"&&",
"c",
".",
"RelatedId",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
22,016 | all-22017 | [
"IssuedAt",
"is",
"an",
"option",
"that",
"toggles",
"whether",
"or",
"not",
"the",
"Issued",
"At",
"(",
"iat",
")",
"field",
"is",
"generated",
"for",
"the",
"token",
"."
] | [
"func",
"IssuedAt",
"(",
"enable",
"bool",
")",
"Option",
"{",
"return",
"func",
"(",
"tok",
"*",
"Bearer",
")",
"error",
"{",
"tok",
".",
"addIssuedAt",
"=",
"<mask>",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] |
22,017 | all-22018 | [
"RunInTransaction",
"runs",
"f",
"in",
"a",
"transaction",
".",
"It",
"calls",
"f",
"with",
"a",
"transaction",
"context",
"tc",
"that",
"f",
"should",
"use",
"for",
"all",
"App",
"Engine",
"operations",
".",
"If",
"f",
"returns",
"nil",
"RunInTransaction",
"attempts",
"to",
"commit",
"the",
"transaction",
"returning",
"nil",
"if",
"it",
"succeeds",
".",
"If",
"the",
"commit",
"fails",
"due",
"to",
"a",
"conflicting",
"transaction",
"RunInTransaction",
"retries",
"f",
"each",
"time",
"with",
"a",
"new",
"transaction",
"context",
".",
"It",
"gives",
"up",
"and",
"returns",
"ErrConcurrentTransaction",
"after",
"three",
"failed",
"attempts",
".",
"The",
"number",
"of",
"attempts",
"can",
"be",
"configured",
"by",
"specifying",
"TransactionOptions",
".",
"Attempts",
".",
"If",
"f",
"returns",
"non",
"-",
"nil",
"then",
"any",
"datastore",
"changes",
"will",
"not",
"be",
"applied",
"and",
"RunInTransaction",
"returns",
"that",
"same",
"error",
".",
"The",
"function",
"f",
"is",
"not",
"retried",
".",
"Note",
"that",
"when",
"f",
"returns",
"the",
"transaction",
"is",
"not",
"yet",
"committed",
".",
"Calling",
"code",
"must",
"be",
"careful",
"not",
"to",
"assume",
"that",
"any",
"of",
"f",
"s",
"changes",
"have",
"been",
"committed",
"until",
"RunInTransaction",
"returns",
"nil",
".",
"Since",
"f",
"may",
"be",
"called",
"multiple",
"times",
"f",
"should",
"usually",
"be",
"idempotent",
".",
"datastore",
".",
"Get",
"is",
"not",
"idempotent",
"when",
"unmarshaling",
"slice",
"fields",
".",
"Nested",
"transactions",
"are",
"not",
"supported",
";",
"c",
"may",
"not",
"be",
"a",
"transaction",
"context",
"."
] | [
"func",
"RunInTransaction",
"(",
"c",
"context",
".",
"Context",
",",
"f",
"func",
"(",
"tc",
"context",
".",
"Context",
")",
"error",
",",
"opts",
"*",
"TransactionOptions",
")",
"error",
"{",
"xg",
":=",
"false",
"\n",
"if",
"opts",
"!=",
"nil",
"{",
"xg",
"=",
"opts",
".",
"XG",
"\n",
"}",
"\n",
"readOnly",
":=",
"false",
"\n",
"if",
"opts",
"!=",
"nil",
"{",
"readOnly",
"=",
"opts",
".",
"ReadOnly",
"\n",
"}",
"\n",
"attempts",
":=",
"3",
"\n",
"if",
"opts",
"!=",
"nil",
"&&",
"opts",
".",
"Attempts",
">",
"0",
"{",
"attempts",
"=",
"opts",
".",
"Attempts",
"\n",
"}",
"\n",
"var",
"t",
"*",
"pb",
".",
"<mask>",
"\n",
"var",
"err",
"error",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"attempts",
";",
"i",
"++",
"{",
"if",
"t",
",",
"err",
"=",
"internal",
".",
"RunTransactionOnce",
"(",
"c",
",",
"f",
",",
"xg",
",",
"readOnly",
",",
"t",
")",
";",
"err",
"!=",
"internal",
".",
"ErrConcurrentTransaction",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"ErrConcurrentTransaction",
"\n",
"}"
] |
22,018 | all-22019 | [
"ReceiveIssueEvent",
"calls",
"plugin",
".",
"ReceiveIssueEvent",
"()",
"if",
"issues",
"are",
"not",
"ignored"
] | [
"func",
"(",
"t",
"*",
"TypeFilterWrapperPlugin",
")",
"ReceiveIssueEvent",
"(",
"event",
"sql",
".",
"IssueEvent",
")",
"[",
"]",
"Point",
"{",
"if",
"!",
"t",
".",
"pass",
"[",
"event",
".",
"IssueID",
"]",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"t",
".",
"plugin",
".",
"ReceiveIssueEvent",
"(",
"<mask>",
")",
"\n",
"}"
] |
22,019 | all-22020 | [
"loadClusterConfig",
"loads",
"connection",
"configuration",
"for",
"the",
"cluster",
"we",
"re",
"deploying",
"to",
".",
"We",
"prefer",
"to",
"use",
"in",
"-",
"cluster",
"configuration",
"if",
"possible",
"but",
"will",
"fall",
"back",
"to",
"using",
"default",
"rules",
"otherwise",
"."
] | [
"func",
"loadClusterConfig",
"(",
"masterURL",
",",
"kubeConfig",
"string",
")",
"(",
"*",
"<mask>",
".",
"Config",
",",
"error",
")",
"{",
"clusterConfig",
",",
"err",
":=",
"clientcmd",
".",
"BuildConfigFromFlags",
"(",
"masterURL",
",",
"kubeConfig",
")",
"\n",
"if",
"err",
"==",
"nil",
"{",
"return",
"clusterConfig",
",",
"nil",
"\n",
"}",
"\n\n",
"credentials",
",",
"err",
":=",
"clientcmd",
".",
"NewDefaultClientConfigLoadingRules",
"(",
")",
".",
"Load",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"clusterConfig",
",",
"err",
"=",
"clientcmd",
".",
"NewDefaultClientConfig",
"(",
"*",
"credentials",
",",
"&",
"clientcmd",
".",
"ConfigOverrides",
"{",
"}",
")",
".",
"ClientConfig",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"clusterConfig",
",",
"nil",
"\n",
"}"
] |
22,020 | all-22021 | [
"HasPaletteFlip",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"Style",
")",
"HasPaletteFlip",
"(",
")",
"bool",
"{",
"if",
"s",
"!=",
"nil",
"&&",
"s",
".",
"PaletteFlip",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
22,021 | all-22022 | [
"CreateButton",
"gets",
"a",
"new",
"payment",
"button",
"including",
"EmbedHtml",
"as",
"a",
"field",
"on",
"button",
"struct"
] | [
"func",
"(",
"c",
"Client",
")",
"CreateButton",
"(",
"params",
"*",
"Button",
")",
"(",
"*",
"Button",
",",
"error",
")",
"{",
"finalParams",
":=",
"&",
"struct",
"{",
"Button",
"*",
"Button",
"`json:\"button\"`",
"\n",
"}",
"{",
"Button",
":",
"params",
",",
"}",
"\n",
"holder",
":=",
"buttonHolder",
"{",
"}",
"\n",
"if",
"err",
":=",
"c",
".",
"Post",
"(",
"\"",
"\"",
",",
"finalParams",
",",
"&",
"holder",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"err",
":=",
"checkApiErrors",
"(",
"holder",
".",
"<mask>",
",",
"\"",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"button",
":=",
"holder",
".",
"Button",
"\n",
"button",
".",
"EmbedHtml",
"=",
"\"",
"\\\"",
"\\\"",
"\\\"",
"\"",
"+",
"button",
".",
"Code",
"+",
"\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\\\"",
"\"",
"\n",
"return",
"&",
"button",
",",
"nil",
"\n",
"}"
] |
22,022 | all-22023 | [
"leaseGrantCommandFunc",
"executes",
"the",
"lease",
"grant",
"command",
"."
] | [
"func",
"leaseGrantCommandFunc",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
",",
"args",
"[",
"]",
"string",
")",
"{",
"if",
"len",
"(",
"args",
")",
"!=",
"1",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"ttl",
",",
"err",
":=",
"strconv",
".",
"ParseInt",
"(",
"args",
"[",
"0",
"]",
",",
"10",
",",
"64",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitBadArgs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
")",
"\n",
"}",
"\n\n",
"ctx",
",",
"cancel",
":=",
"commandCtx",
"(",
"cmd",
")",
"\n",
"resp",
",",
"err",
":=",
"mustClientFromCmd",
"(",
"cmd",
")",
".",
"Grant",
"(",
"ctx",
",",
"ttl",
")",
"\n",
"cancel",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ExitWithError",
"(",
"ExitError",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
")",
"\n",
"}",
"\n",
"<mask>",
".",
"Grant",
"(",
"*",
"resp",
")",
"\n",
"}"
] |
22,023 | all-22024 | [
"GetUserCacheDir",
"is",
"a",
"wrapper",
"around",
"g_get_user_cache_dir",
"()",
"."
] | [
"func",
"GetUserCacheDir",
"(",
")",
"string",
"{",
"c",
":=",
"C",
".",
"g_get_user_cache_dir",
"(",
")",
"\n",
"return",
"C",
".",
"GoString",
"(",
"(",
"*",
"C",
".",
"<mask>",
")",
"(",
"c",
")",
")",
"\n",
"}"
] |
22,024 | all-22025 | [
"Detect",
"CGroup",
"support",
"."
] | [
"func",
"(",
"s",
"*",
"OS",
")",
"initCGroup",
"(",
")",
"{",
"flags",
":=",
"[",
"]",
"*",
"bool",
"{",
"&",
"s",
".",
"CGroupBlkioController",
",",
"&",
"s",
".",
"CGroupCPUController",
",",
"&",
"s",
".",
"CGroupCPUacctController",
",",
"&",
"s",
".",
"CGroupCPUsetController",
",",
"&",
"s",
".",
"CGroupDevicesController",
",",
"&",
"s",
".",
"CGroupFreezerController",
",",
"&",
"s",
".",
"CGroupMemoryController",
",",
"&",
"s",
".",
"CGroupNetPrioController",
",",
"&",
"s",
".",
"CGroupPidsController",
",",
"&",
"s",
".",
"CGroupSwapAccounting",
",",
"}",
"\n",
"for",
"i",
",",
"flag",
":=",
"range",
"flags",
"{",
"*",
"flag",
"=",
"shared",
".",
"PathExists",
"(",
"\"",
"\"",
"+",
"cGroups",
"[",
"i",
"]",
".",
"<mask>",
")",
"\n",
"if",
"!",
"*",
"flag",
"{",
"logger",
".",
"Warnf",
"(",
"cGroups",
"[",
"i",
"]",
".",
"warn",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
22,025 | all-22026 | [
"Expiration",
"is",
"a",
"GServiceAccount",
"option",
"to",
"set",
"a",
"expiration",
"limit",
"for",
"tokens",
"generated",
"from",
"the",
"token",
"source",
"."
] | [
"func",
"Expiration",
"(",
"expiration",
"<mask>",
".",
"Duration",
")",
"Option",
"{",
"return",
"func",
"(",
"gsa",
"*",
"GServiceAccount",
")",
"error",
"{",
"gsa",
".",
"expiration",
"=",
"expiration",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] |
22,026 | all-22027 | [
"ListJobF",
"returns",
"info",
"about",
"all",
"jobs",
"calling",
"f",
"with",
"each",
"JobInfo",
".",
"If",
"f",
"returns",
"an",
"error",
"iteration",
"of",
"jobs",
"will",
"stop",
"and",
"ListJobF",
"will",
"return",
"that",
"error",
"unless",
"the",
"error",
"is",
"errutil",
".",
"ErrBreak",
"in",
"which",
"case",
"it",
"will",
"return",
"nil",
".",
"If",
"pipelineName",
"is",
"non",
"empty",
"then",
"only",
"jobs",
"that",
"were",
"started",
"by",
"the",
"named",
"pipeline",
"will",
"be",
"returned",
"If",
"inputCommit",
"is",
"non",
"-",
"nil",
"then",
"only",
"jobs",
"which",
"took",
"the",
"specific",
"commits",
"as",
"inputs",
"will",
"be",
"returned",
".",
"The",
"order",
"of",
"the",
"inputCommits",
"doesn",
"t",
"matter",
".",
"If",
"outputCommit",
"is",
"non",
"-",
"nil",
"then",
"only",
"the",
"job",
"which",
"created",
"that",
"commit",
"as",
"output",
"will",
"be",
"returned",
"."
] | [
"func",
"(",
"c",
"APIClient",
")",
"ListJobF",
"(",
"pipelineName",
"string",
",",
"inputCommit",
"[",
"]",
"*",
"pfs",
".",
"Commit",
",",
"outputCommit",
"*",
"pfs",
".",
"Commit",
",",
"f",
"func",
"(",
"*",
"pps",
".",
"JobInfo",
")",
"error",
")",
"error",
"{",
"var",
"pipeline",
"*",
"pps",
".",
"Pipeline",
"\n",
"if",
"pipelineName",
"!=",
"\"",
"\"",
"{",
"pipeline",
"=",
"NewPipeline",
"(",
"pipelineName",
")",
"\n",
"}",
"\n",
"<mask>",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"ListJobStream",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pps",
".",
"ListJobRequest",
"{",
"Pipeline",
":",
"pipeline",
",",
"InputCommit",
":",
"inputCommit",
",",
"OutputCommit",
":",
"outputCommit",
",",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"grpcutil",
".",
"ScrubGRPC",
"(",
"err",
")",
"\n",
"}",
"\n",
"for",
"{",
"ji",
",",
"err",
":=",
"client",
".",
"Recv",
"(",
")",
"\n",
"if",
"err",
"==",
"io",
".",
"EOF",
"{",
"return",
"nil",
"\n",
"}",
"else",
"if",
"err",
"!=",
"nil",
"{",
"return",
"grpcutil",
".",
"ScrubGRPC",
"(",
"err",
")",
"\n",
"}",
"\n",
"if",
"err",
":=",
"f",
"(",
"ji",
")",
";",
"err",
"!=",
"nil",
"{",
"if",
"err",
"==",
"errutil",
".",
"ErrBreak",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
22,027 | all-22028 | [
"ParseVerb",
"parses",
"the",
"verb",
"at",
"the",
"beginning",
"of",
"f",
".",
"It",
"returns",
"the",
"verb",
"how",
"much",
"of",
"the",
"input",
"was",
"consumed",
"and",
"an",
"error",
"if",
"any",
"."
] | [
"func",
"ParseVerb",
"(",
"f",
"string",
")",
"(",
"Verb",
",",
"int",
",",
"error",
")",
"{",
"if",
"len",
"(",
"f",
")",
"<",
"2",
"{",
"return",
"Verb",
"{",
"}",
",",
"0",
",",
"ErrInvalid",
"\n",
"}",
"\n",
"const",
"(",
"flags",
"=",
"1",
"\n\n",
"<mask>",
"=",
"2",
"\n",
"widthStar",
"=",
"3",
"\n",
"widthIndex",
"=",
"5",
"\n\n",
"dot",
"=",
"6",
"\n",
"prec",
"=",
"7",
"\n",
"precStar",
"=",
"8",
"\n",
"precIndex",
"=",
"10",
"\n\n",
"verbIndex",
"=",
"11",
"\n",
"verb",
"=",
"12",
"\n",
")",
"\n\n",
"m",
":=",
"re",
".",
"FindStringSubmatch",
"(",
"f",
")",
"\n",
"if",
"m",
"==",
"nil",
"{",
"return",
"Verb",
"{",
"}",
",",
"0",
",",
"ErrInvalid",
"\n",
"}",
"\n\n",
"v",
":=",
"Verb",
"{",
"Letter",
":",
"[",
"]",
"rune",
"(",
"m",
"[",
"verb",
"]",
")",
"[",
"0",
"]",
",",
"Flags",
":",
"m",
"[",
"flags",
"]",
",",
"Raw",
":",
"m",
"[",
"0",
"]",
",",
"}",
"\n\n",
"if",
"m",
"[",
"width",
"]",
"!=",
"\"",
"\"",
"{",
"// Literal width",
"v",
".",
"Width",
"=",
"Literal",
"(",
"atoi",
"(",
"m",
"[",
"width",
"]",
")",
")",
"\n",
"}",
"else",
"if",
"m",
"[",
"widthStar",
"]",
"!=",
"\"",
"\"",
"{",
"// Star width",
"if",
"m",
"[",
"widthIndex",
"]",
"!=",
"\"",
"\"",
"{",
"v",
".",
"Width",
"=",
"Star",
"{",
"atoi",
"(",
"m",
"[",
"widthIndex",
"]",
")",
"}",
"\n",
"}",
"else",
"{",
"v",
".",
"Width",
"=",
"Star",
"{",
"-",
"1",
"}",
"\n",
"}",
"\n",
"}",
"else",
"{",
"// Default width",
"v",
".",
"Width",
"=",
"Default",
"{",
"}",
"\n",
"}",
"\n\n",
"if",
"m",
"[",
"dot",
"]",
"==",
"\"",
"\"",
"{",
"// default precision",
"v",
".",
"Precision",
"=",
"Default",
"{",
"}",
"\n",
"}",
"else",
"{",
"if",
"m",
"[",
"prec",
"]",
"!=",
"\"",
"\"",
"{",
"// Literal precision",
"v",
".",
"Precision",
"=",
"Literal",
"(",
"atoi",
"(",
"m",
"[",
"prec",
"]",
")",
")",
"\n",
"}",
"else",
"if",
"m",
"[",
"precStar",
"]",
"!=",
"\"",
"\"",
"{",
"// Star precision",
"if",
"m",
"[",
"precIndex",
"]",
"!=",
"\"",
"\"",
"{",
"v",
".",
"Precision",
"=",
"Star",
"{",
"atoi",
"(",
"m",
"[",
"precIndex",
"]",
")",
"}",
"\n",
"}",
"else",
"{",
"v",
".",
"Precision",
"=",
"Star",
"{",
"-",
"1",
"}",
"\n",
"}",
"\n",
"}",
"else",
"{",
"// Zero precision",
"v",
".",
"Precision",
"=",
"Zero",
"{",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"m",
"[",
"verb",
"]",
"==",
"\"",
"\"",
"{",
"v",
".",
"Value",
"=",
"0",
"\n",
"}",
"else",
"if",
"m",
"[",
"verbIndex",
"]",
"!=",
"\"",
"\"",
"{",
"v",
".",
"Value",
"=",
"atoi",
"(",
"m",
"[",
"verbIndex",
"]",
")",
"\n",
"}",
"else",
"{",
"v",
".",
"Value",
"=",
"-",
"1",
"\n",
"}",
"\n\n",
"return",
"v",
",",
"len",
"(",
"m",
"[",
"0",
"]",
")",
",",
"nil",
"\n",
"}"
] |
22,028 | all-22029 | [
"compress",
"is",
"COMPRESS",
"from",
"the",
"papers",
"."
] | [
"func",
"(",
"d",
"*",
"ltDom",
")",
"compress",
"(",
"v",
"vName",
")",
"{",
"var",
"stackBuf",
"[",
"20",
"]",
"vName",
"\n",
"stack",
":=",
"stackBuf",
"[",
":",
"0",
"]",
"\n",
"for",
"d",
".",
"ancestor",
"[",
"d",
".",
"ancestor",
"[",
"v",
"]",
"]",
"!=",
"-",
"1",
"{",
"stack",
"=",
"append",
"(",
"stack",
",",
"v",
")",
"\n",
"v",
"=",
"d",
".",
"ancestor",
"[",
"v",
"]",
"\n",
"}",
"\n\n",
"for",
"len",
"(",
"stack",
")",
"!=",
"0",
"{",
"v",
":=",
"<mask>",
"[",
"len",
"(",
"stack",
")",
"-",
"1",
"]",
"\n",
"stack",
"=",
"stack",
"[",
":",
"len",
"(",
"stack",
")",
"-",
"1",
"]",
"\n\n",
"if",
"d",
".",
"semis",
"[",
"d",
".",
"labels",
"[",
"d",
".",
"ancestor",
"[",
"v",
"]",
"]",
"]",
"<",
"d",
".",
"semis",
"[",
"d",
".",
"labels",
"[",
"v",
"]",
"]",
"{",
"d",
".",
"labels",
"[",
"v",
"]",
"=",
"d",
".",
"labels",
"[",
"d",
".",
"ancestor",
"[",
"v",
"]",
"]",
"\n",
"}",
"\n",
"d",
".",
"ancestor",
"[",
"v",
"]",
"=",
"d",
".",
"ancestor",
"[",
"d",
".",
"ancestor",
"[",
"v",
"]",
"]",
"\n",
"}",
"\n",
"}"
] |
22,029 | all-22030 | [
"MarshalJSON",
"overrides",
"the",
"logic",
"for",
"JSON",
"-",
"encoding",
"the",
"ResourceStatus",
"type"
] | [
"func",
"(",
"cs",
"*",
"CgroupStatus",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"cs",
"==",
"nil",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n",
"return",
"[",
"]",
"byte",
"(",
"`\"`",
"+",
"cs",
".",
"<mask>",
"(",
")",
"+",
"`\"`",
")",
",",
"nil",
"\n",
"}"
] |
22,030 | all-22031 | [
"listDirs",
"returns",
"a",
"slice",
"containing",
"all",
"the",
"subdirectories",
"under",
"dir",
"including",
"dir",
"itself",
"."
] | [
"func",
"listDirs",
"(",
"dir",
"string",
")",
"(",
"[",
"]",
"string",
",",
"[",
"]",
"error",
")",
"{",
"var",
"dirs",
"[",
"]",
"string",
"\n",
"var",
"errs",
"[",
"]",
"error",
"\n",
"err",
":=",
"filepath",
".",
"Walk",
"(",
"dir",
",",
"func",
"(",
"path",
"string",
",",
"info",
"os",
".",
"FileInfo",
",",
"err",
"error",
")",
"error",
"{",
"if",
"err",
"!=",
"nil",
"{",
"errs",
"=",
"append",
"(",
"errs",
",",
"err",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"info",
".",
"IsDir",
"(",
")",
"{",
"dirs",
"=",
"<mask>",
"(",
"dirs",
",",
"path",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"errs",
"=",
"append",
"(",
"errs",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"dirs",
",",
"errs",
"\n",
"}"
] |
22,031 | all-22032 | [
"CreateRequestMessage",
"creates",
"the",
"request",
"json",
"message",
"using",
"the",
"given",
"input",
".",
"Note",
"the",
"input",
"*",
"MUST",
"*",
"be",
"a",
"pointer",
"to",
"a",
"valid",
"backend",
"type",
"that",
"this",
"client",
"recognises",
"."
] | [
"func",
"(",
"cs",
"*",
"ClientServerImpl",
")",
"CreateRequestMessage",
"(",
"input",
"interface",
"{",
"}",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"msg",
":=",
"&",
"RequestMessage",
"{",
"}",
"\n\n",
"recognizedTypes",
":=",
"cs",
".",
"GetRecognizedTypes",
"(",
")",
"\n",
"for",
"typeStr",
",",
"typeVal",
":=",
"range",
"recognizedTypes",
"{",
"if",
"reflect",
".",
"TypeOf",
"(",
"input",
")",
"==",
"reflect",
".",
"PtrTo",
"(",
"typeVal",
")",
"{",
"msg",
".",
"Type",
"=",
"typeStr",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"msg",
".",
"Type",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"&",
"UnrecognizedWSRequestType",
"{",
"reflect",
".",
"TypeOf",
"(",
"input",
")",
".",
"String",
"(",
")",
"}",
"\n",
"}",
"\n",
"messageData",
",",
"err",
":=",
"jsonutil",
".",
"BuildJSON",
"(",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"&",
"NotMarshallableWSRequest",
"{",
"msg",
".",
"Type",
",",
"err",
"}",
"\n",
"}",
"\n",
"msg",
".",
"Message",
"=",
"json",
".",
"RawMessage",
"(",
"messageData",
")",
"\n\n",
"send",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"msg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"&",
"NotMarshallableWSRequest",
"{",
"msg",
".",
"Type",
",",
"err",
"}",
"\n",
"}",
"\n",
"return",
"send",
",",
"nil",
"\n",
"}"
] |
22,032 | all-22033 | [
"printArgs",
"prints",
"the",
"arguments",
"of",
"a",
"function",
"type",
".",
"It",
"looks",
"at",
"the",
"inner",
"types",
"for",
"spacing",
"."
] | [
"func",
"(",
"ft",
"*",
"FunctionType",
")",
"printArgs",
"(",
"ps",
"*",
"printState",
")",
"{",
"paren",
":=",
"false",
"\n",
"space",
":=",
"false",
"\n",
"for",
"i",
":=",
"len",
"(",
"ps",
".",
"inner",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
"{",
"switch",
"ps",
".",
"inner",
"[",
"i",
"]",
".",
"(",
"type",
")",
"{",
"case",
"*",
"PointerType",
",",
"*",
"ReferenceType",
",",
"*",
"RvalueReferenceType",
":",
"paren",
"=",
"true",
"\n",
"case",
"*",
"TypeWithQualifiers",
",",
"*",
"ComplexType",
",",
"*",
"ImaginaryType",
",",
"*",
"PtrMem",
":",
"space",
"=",
"true",
"\n",
"paren",
"=",
"true",
"\n",
"}",
"\n",
"if",
"paren",
"{",
"break",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"paren",
"{",
"if",
"!",
"space",
"&&",
"(",
"ps",
".",
"last",
"!=",
"'('",
"&&",
"ps",
".",
"last",
"!=",
"'*'",
")",
"{",
"space",
"=",
"true",
"\n",
"}",
"\n",
"if",
"space",
"&&",
"ps",
".",
"last",
"!=",
"' '",
"{",
"ps",
".",
"writeByte",
"(",
"' '",
")",
"\n",
"}",
"\n",
"ps",
".",
"writeByte",
"(",
"'('",
")",
"\n",
"}",
"\n\n",
"save",
":=",
"ps",
".",
"printInner",
"(",
"true",
")",
"\n\n",
"if",
"paren",
"{",
"ps",
".",
"writeByte",
"(",
"')'",
")",
"\n",
"}",
"\n\n",
"ps",
".",
"writeByte",
"(",
"'('",
")",
"\n",
"first",
":=",
"true",
"\n",
"for",
"_",
",",
"a",
":=",
"range",
"ft",
".",
"Args",
"{",
"if",
"ps",
".",
"isEmpty",
"(",
"a",
")",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"!",
"first",
"{",
"ps",
".",
"writeString",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"ps",
".",
"print",
"(",
"a",
")",
"\n",
"first",
"=",
"false",
"\n",
"}",
"\n",
"ps",
".",
"writeByte",
"(",
"')'",
")",
"\n\n",
"ps",
".",
"inner",
"=",
"save",
"\n",
"<mask>",
".",
"printInner",
"(",
"false",
")",
"\n",
"}"
] |
22,033 | all-22034 | [
"validateToken",
"makes",
"a",
"call",
"to",
"Azure",
"SDK",
"with",
"given",
"token",
"essentially",
"making",
"sure",
"if",
"the",
"access_token",
"valid",
"if",
"not",
"it",
"uses",
"SDK’s",
"functionality",
"to",
"automatically",
"refresh",
"the",
"token",
"using",
"refresh_token",
"(",
"which",
"might",
"have",
"expired",
")",
".",
"This",
"check",
"is",
"essentially",
"to",
"make",
"sure",
"refresh_token",
"is",
"good",
"."
] | [
"func",
"validateToken",
"(",
"env",
"azure",
".",
"Environment",
",",
"<mask>",
"*",
"azure",
".",
"ServicePrincipalToken",
")",
"error",
"{",
"c",
":=",
"subscriptionsClient",
"(",
"env",
".",
"ResourceManagerEndpoint",
")",
"\n",
"c",
".",
"Authorizer",
"=",
"token",
"\n",
"_",
",",
"err",
":=",
"c",
".",
"List",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
22,034 | all-22035 | [
"GetenvDefault",
"retrieves",
"the",
"value",
"of",
"the",
"environment",
"variable",
"named",
"by",
"the",
"key",
".",
"It",
"returns",
"the",
"given",
"defaultValue",
"if",
"the",
"variable",
"is",
"not",
"present",
"."
] | [
"func",
"GetenvDefault",
"(",
"key",
",",
"defaultValue",
"string",
")",
"string",
"{",
"ret",
":=",
"os",
".",
"Getenv",
"(",
"key",
")",
"\n",
"if",
"<mask>",
"==",
"\"",
"\"",
"{",
"return",
"defaultValue",
"\n",
"}",
"\n\n",
"return",
"ret",
"\n",
"}"
] |
22,035 | all-22036 | [
"SetTransport",
"changes",
"the",
"transport",
"on",
"the",
"client",
"and",
"all",
"its",
"subresources"
] | [
"func",
"(",
"c",
"*",
"Functions",
")",
"SetTransport",
"(",
"transport",
"runtime",
".",
"ClientTransport",
")",
"{",
"c",
".",
"Transport",
"=",
"transport",
"\n\n",
"c",
".",
"Apps",
".",
"SetTransport",
"(",
"transport",
")",
"\n\n",
"c",
".",
"Routes",
".",
"SetTransport",
"(",
"transport",
")",
"\n\n",
"c",
".",
"Tasks",
".",
"SetTransport",
"(",
"transport",
")",
"\n\n",
"c",
".",
"<mask>",
".",
"SetTransport",
"(",
"transport",
")",
"\n\n",
"}"
] |
22,036 | all-22037 | [
"unionStrings",
"merges",
"the",
"parent",
"and",
"child",
"items",
"together"
] | [
"func",
"unionStrings",
"(",
"parent",
",",
"child",
"[",
"]",
"string",
")",
"[",
"]",
"string",
"{",
"if",
"child",
"==",
"nil",
"{",
"return",
"parent",
"\n",
"}",
"\n",
"if",
"<mask>",
"==",
"nil",
"{",
"return",
"child",
"\n",
"}",
"\n",
"s",
":=",
"sets",
".",
"NewString",
"(",
"parent",
"...",
")",
"\n",
"s",
".",
"Insert",
"(",
"child",
"...",
")",
"\n",
"return",
"s",
".",
"List",
"(",
")",
"\n",
"}"
] |
22,037 | all-22038 | [
"set",
"front",
"and",
"back",
"stencil",
"test",
"actions"
] | [
"func",
"StencilOp",
"(",
"<mask>",
"uint32",
",",
"zfail",
"uint32",
",",
"zpass",
"uint32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpStencilOp",
",",
"3",
",",
"uintptr",
"(",
"fail",
")",
",",
"uintptr",
"(",
"zfail",
")",
",",
"uintptr",
"(",
"zpass",
")",
")",
"\n",
"}"
] |
22,038 | all-22039 | [
"GetConferencesInRange",
"gets",
"an",
"Iterator",
"containing",
"conferences",
"in",
"the",
"range",
"[",
"start",
"end",
")",
"optionally",
"further",
"filtered",
"by",
"data",
".",
"GetConferencesInRange",
"panics",
"if",
"start",
"is",
"not",
"before",
"end",
".",
"Any",
"date",
"filters",
"provided",
"in",
"data",
"will",
"be",
"ignored",
".",
"If",
"you",
"have",
"an",
"end",
"but",
"don",
"t",
"want",
"to",
"specify",
"a",
"start",
"use",
"twilio",
".",
"Epoch",
"for",
"start",
".",
"If",
"you",
"have",
"a",
"start",
"but",
"don",
"t",
"want",
"to",
"specify",
"an",
"end",
"use",
"twilio",
".",
"HeatDeath",
"for",
"end",
".",
"Assumes",
"that",
"Twilio",
"returns",
"resources",
"in",
"chronological",
"order",
"latest",
"first",
".",
"If",
"this",
"assumption",
"is",
"incorrect",
"your",
"results",
"will",
"not",
"be",
"correct",
".",
"Returned",
"ConferencePages",
"will",
"have",
"at",
"most",
"PageSize",
"results",
"but",
"may",
"have",
"fewer",
"based",
"on",
"filtering",
"."
] | [
"func",
"(",
"c",
"*",
"ConferenceService",
")",
"GetConferencesInRange",
"(",
"<mask>",
"time",
".",
"Time",
",",
"end",
"time",
".",
"Time",
",",
"data",
"url",
".",
"Values",
")",
"ConferencePageIterator",
"{",
"if",
"start",
".",
"After",
"(",
"end",
")",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"d",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"if",
"data",
"!=",
"nil",
"{",
"for",
"k",
",",
"v",
":=",
"range",
"data",
"{",
"d",
"[",
"k",
"]",
"=",
"v",
"\n",
"}",
"\n",
"}",
"\n",
"d",
".",
"Del",
"(",
"\"",
"\"",
")",
"\n",
"d",
".",
"Del",
"(",
"\"",
"\"",
")",
"// just in case",
"\n",
"if",
"start",
"!=",
"Epoch",
"{",
"startFormat",
":=",
"start",
".",
"UTC",
"(",
")",
".",
"Format",
"(",
"APISearchLayout",
")",
"\n",
"d",
".",
"Set",
"(",
"\"",
"\"",
",",
"startFormat",
")",
"\n",
"}",
"\n",
"if",
"end",
"!=",
"HeatDeath",
"{",
"// If you specify \"StartTime<=YYYY-MM-DD\", the *latest* result returned",
"// will be midnight (the earliest possible second) on DD. We want all",
"// of the results for DD so we need to specify DD+1 in the API.",
"//",
"// TODO validate midnight-instant math more closely, since I don't think",
"// Twilio returns the correct results for that instant.",
"endFormat",
":=",
"end",
".",
"UTC",
"(",
")",
".",
"Add",
"(",
"24",
"*",
"time",
".",
"Hour",
")",
".",
"Format",
"(",
"APISearchLayout",
")",
"\n",
"d",
".",
"Set",
"(",
"\"",
"\"",
",",
"endFormat",
")",
"\n",
"}",
"\n",
"iter",
":=",
"NewPageIterator",
"(",
"c",
".",
"client",
",",
"d",
",",
"conferencePathPart",
")",
"\n",
"return",
"&",
"conferenceDateIterator",
"{",
"start",
":",
"start",
",",
"end",
":",
"end",
",",
"p",
":",
"iter",
",",
"}",
"\n",
"}"
] |
22,039 | all-22040 | [
"ReadEvent",
"scans",
"the",
"EventStream",
"for",
"events",
"."
] | [
"func",
"(",
"e",
"*",
"EventStreamReader",
")",
"ReadEvent",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"e",
".",
"scanner",
".",
"Scan",
"(",
")",
"{",
"<mask>",
":=",
"e",
".",
"scanner",
".",
"Bytes",
"(",
")",
"\n",
"return",
"event",
",",
"nil",
"\n",
"}",
"\n",
"if",
"err",
":=",
"e",
".",
"scanner",
".",
"Err",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"nil",
",",
"io",
".",
"EOF",
"\n",
"}"
] |
22,040 | all-22041 | [
"NewReference",
"returns",
"a",
"docker",
"-",
"daemon",
"reference",
"for",
"either",
"the",
"supplied",
"image",
"ID",
"(",
"config",
"digest",
")",
"or",
"the",
"supplied",
"reference",
"(",
"which",
"must",
"satisfy",
"!reference",
".",
"IsNameOnly",
")"
] | [
"func",
"NewReference",
"(",
"id",
"digest",
".",
"Digest",
",",
"ref",
"<mask>",
".",
"Named",
")",
"(",
"types",
".",
"ImageReference",
",",
"error",
")",
"{",
"if",
"id",
"!=",
"\"",
"\"",
"&&",
"ref",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"ref",
"!=",
"nil",
"{",
"if",
"reference",
".",
"IsNameOnly",
"(",
"ref",
")",
"{",
"return",
"nil",
",",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"reference",
".",
"FamiliarString",
"(",
"ref",
")",
")",
"\n",
"}",
"\n",
"// A github.com/distribution/reference value can have a tag and a digest at the same time!",
"// Most versions of docker/reference do not handle that (ignoring the tag), so reject such input.",
"// This MAY be accepted in the future.",
"// (Even if it were supported, the semantics of policy namespaces are unclear - should we drop",
"// the tag or the digest first?)",
"_",
",",
"isTagged",
":=",
"ref",
".",
"(",
"reference",
".",
"NamedTagged",
")",
"\n",
"_",
",",
"isDigested",
":=",
"ref",
".",
"(",
"reference",
".",
"Canonical",
")",
"\n",
"if",
"isTagged",
"&&",
"isDigested",
"{",
"return",
"nil",
",",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"daemonReference",
"{",
"id",
":",
"id",
",",
"ref",
":",
"ref",
",",
"}",
",",
"nil",
"\n",
"}"
] |
22,041 | all-22042 | [
"FetchGraphs",
"retrieves",
"all",
"graphs",
"available",
"to",
"the",
"API",
"Token",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"FetchGraphs",
"(",
")",
"(",
"*",
"[",
"]",
"Graph",
",",
"error",
")",
"{",
"<mask>",
",",
"err",
":=",
"a",
".",
"Get",
"(",
"config",
".",
"GraphPrefix",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"graphs",
"[",
"]",
"Graph",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"result",
",",
"&",
"graphs",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"graphs",
",",
"nil",
"\n",
"}"
] |
22,042 | all-22043 | [
"GoString",
"defines",
"the",
"printable",
"version",
"of",
"this",
"struct",
"."
] | [
"func",
"(",
"c",
"*",
"SyslogConfig",
")",
"GoString",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"<mask>",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
",",
"BoolGoString",
"(",
"c",
".",
"Enabled",
")",
",",
"StringGoString",
"(",
"c",
".",
"Facility",
")",
",",
")",
"\n",
"}"
] |
22,043 | all-22044 | [
"And",
"combines",
"the",
"n",
"last",
"filters",
"into",
"a",
"new",
"filter",
"using",
"a",
"And",
"operation",
"."
] | [
"func",
"(",
"q",
"*",
"Query",
")",
"And",
"(",
"n",
"int",
")",
"*",
"Query",
"{",
"q",
".",
"<mask>",
"=",
"append",
"(",
"q",
".",
"headers",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"n",
")",
")",
"\n",
"return",
"q",
"\n",
"}"
] |
22,044 | all-22045 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"ClearDeviceOrientationOverrideParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceorientation1",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
22,045 | all-22046 | [
"StatusString",
"returns",
"the",
"string",
"of",
"the",
"cgroup",
"resource",
"status"
] | [
"func",
"(",
"auth",
"*",
"ASMAuthResource",
")",
"StatusString",
"(",
"<mask>",
"resourcestatus",
".",
"ResourceStatus",
")",
"string",
"{",
"return",
"ASMAuthStatus",
"(",
"status",
")",
".",
"String",
"(",
")",
"\n",
"}"
] |
22,046 | all-22047 | [
"totalBytes",
"returns",
"the",
"size",
"in",
"bytes",
"for",
"one",
"element",
"of",
"the",
"array",
"buffer",
"."
] | [
"func",
"(",
"a",
"*",
"arrayBufferLayout",
")",
"totalBytes",
"(",
")",
"int",
"{",
"if",
"a",
".",
"total",
"!=",
"0",
"{",
"return",
"a",
".",
"total",
"\n",
"}",
"\n",
"t",
":=",
"0",
"\n",
"for",
"_",
",",
"p",
":=",
"range",
"a",
".",
"parts",
"{",
"t",
"+=",
"float",
".",
"SizeInBytes",
"(",
")",
"*",
"p",
".",
"num",
"\n",
"}",
"\n",
"a",
".",
"total",
"=",
"t",
"\n",
"return",
"a",
".",
"<mask>",
"\n",
"}"
] |
22,047 | all-22048 | [
"Write",
"serializes",
"the",
"command",
"to",
"the",
"given",
"buffered",
"output",
"satisfies",
"the",
"Command",
"interface",
"."
] | [
"func",
"(",
"c",
"Req",
")",
"Write",
"(",
"w",
"*",
"bufio",
".",
"Writer",
")",
"(",
"err",
"error",
")",
"{",
"if",
"_",
",",
"err",
"=",
"w",
".",
"WriteString",
"(",
"\"",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"err",
"=",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"if",
"_",
",",
"err",
"=",
"c",
".",
"MessageID",
".",
"WriteTo",
"(",
"w",
")",
";",
"err",
"!=",
"nil",
"{",
"err",
"=",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"if",
"err",
"=",
"w",
".",
"WriteByte",
"(",
"' '",
")",
";",
"err",
"!=",
"nil",
"{",
"err",
"=",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"if",
"_",
",",
"err",
"=",
"w",
".",
"WriteString",
"(",
"strconv",
".",
"FormatUint",
"(",
"uint64",
"(",
"c",
".",
"Timeout",
"/",
"time",
".",
"Millisecond",
")",
",",
"10",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"err",
"=",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"if",
"err",
"=",
"w",
".",
"WriteByte",
"(",
"'\\n'",
")",
";",
"err",
"!=",
"nil",
"{",
"err",
"=",
"<mask>",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
] |
22,048 | all-22049 | [
"GetMulti",
"is",
"a",
"batch",
"version",
"of",
"Get",
".",
"The",
"returned",
"map",
"from",
"keys",
"to",
"items",
"may",
"have",
"fewer",
"elements",
"than",
"the",
"input",
"slice",
"due",
"to",
"memcache",
"cache",
"misses",
".",
"Each",
"key",
"must",
"be",
"at",
"most",
"250",
"bytes",
"in",
"length",
".",
"If",
"no",
"error",
"is",
"returned",
"the",
"returned",
"map",
"will",
"also",
"be",
"non",
"-",
"nil",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetMulti",
"(",
"keys",
"[",
"]",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"*",
"Item",
",",
"error",
")",
"{",
"keyMap",
":=",
"make",
"(",
"map",
"[",
"*",
"Addr",
"]",
"[",
"]",
"string",
")",
"\n",
"for",
"_",
",",
"key",
":=",
"range",
"keys",
"{",
"addr",
",",
"err",
":=",
"c",
".",
"servers",
".",
"PickServer",
"(",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"keyMap",
"[",
"addr",
"]",
"=",
"append",
"(",
"keyMap",
"[",
"addr",
"]",
",",
"key",
")",
"\n",
"}",
"\n\n",
"var",
"chs",
"[",
"]",
"chan",
"*",
"Item",
"\n",
"for",
"addr",
",",
"keys",
":=",
"range",
"keyMap",
"{",
"ch",
":=",
"make",
"(",
"chan",
"*",
"Item",
")",
"\n",
"chs",
"=",
"append",
"(",
"chs",
",",
"ch",
")",
"\n",
"go",
"func",
"(",
"addr",
"*",
"Addr",
",",
"keys",
"[",
"]",
"string",
",",
"ch",
"chan",
"*",
"Item",
")",
"{",
"defer",
"close",
"(",
"ch",
")",
"\n",
"cn",
",",
"err",
":=",
"c",
".",
"getConn",
"(",
"addr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"defer",
"c",
".",
"condRelease",
"(",
"cn",
",",
"&",
"err",
")",
"\n",
"for",
"_",
",",
"k",
":=",
"range",
"keys",
"{",
"if",
"err",
"=",
"c",
".",
"sendConnCommand",
"(",
"cn",
",",
"k",
",",
"cmdGetKQ",
",",
"nil",
",",
"0",
",",
"nil",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"err",
"=",
"c",
".",
"sendConnCommand",
"(",
"cn",
",",
"\"",
"\"",
",",
"cmdNoop",
",",
"nil",
",",
"0",
",",
"nil",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"var",
"item",
"*",
"Item",
"\n",
"for",
"{",
"item",
",",
"err",
"=",
"c",
".",
"parseItemResponse",
"(",
"\"",
"\"",
",",
"cn",
",",
"false",
")",
"\n",
"if",
"item",
"==",
"nil",
"||",
"item",
".",
"Key",
"==",
"\"",
"\"",
"{",
"// Noop response",
"break",
"\n",
"}",
"\n",
"ch",
"<-",
"item",
"\n",
"}",
"\n",
"}",
"(",
"addr",
",",
"keys",
",",
"ch",
")",
"\n",
"}",
"\n\n",
"m",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"Item",
")",
"\n",
"for",
"_",
",",
"ch",
":=",
"range",
"chs",
"{",
"for",
"item",
":=",
"range",
"ch",
"{",
"m",
"[",
"item",
".",
"Key",
"]",
"=",
"item",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"m",
",",
"nil",
"\n",
"}"
] |
22,049 | all-22050 | [
"Also",
"accept",
"policy",
"that",
"s",
"tied",
"to",
"the",
"combination",
"of",
"the",
"graph",
"root",
"and",
"driver",
"name",
"to",
"apply",
"to",
"all",
"images",
"stored",
"in",
"the",
"Store",
"and",
"to",
"just",
"the",
"graph",
"root",
"in",
"case",
"we",
"re",
"using",
"multiple",
"drivers",
"in",
"the",
"same",
"directory",
"for",
"some",
"reason",
"."
] | [
"func",
"(",
"s",
"storageReference",
")",
"PolicyConfigurationNamespaces",
"(",
")",
"[",
"]",
"string",
"{",
"storeSpec",
":=",
"\"",
"\"",
"+",
"s",
".",
"transport",
".",
"store",
".",
"GraphDriverName",
"(",
")",
"+",
"\"",
"\"",
"+",
"s",
".",
"transport",
".",
"store",
".",
"GraphRoot",
"(",
")",
"+",
"\"",
"\"",
"\n",
"driverlessStoreSpec",
":=",
"\"",
"\"",
"+",
"s",
".",
"transport",
".",
"store",
".",
"GraphRoot",
"(",
")",
"+",
"\"",
"\"",
"\n",
"namespaces",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"if",
"s",
".",
"named",
"!=",
"nil",
"{",
"if",
"s",
".",
"id",
"!=",
"\"",
"\"",
"{",
"// The reference without the ID is also a valid namespace.",
"namespaces",
"=",
"append",
"(",
"namespaces",
",",
"storeSpec",
"+",
"s",
".",
"named",
".",
"String",
"(",
")",
")",
"\n",
"}",
"\n",
"tagged",
",",
"isTagged",
":=",
"s",
".",
"named",
".",
"(",
"reference",
".",
"Tagged",
")",
"\n",
"_",
",",
"isDigested",
":=",
"s",
".",
"named",
".",
"(",
"reference",
".",
"Digested",
")",
"\n",
"if",
"isTagged",
"&&",
"isDigested",
"{",
"// s.named is \"name:tag@digest\"; add a \"name:tag\" parent namespace.",
"namespaces",
"=",
"append",
"(",
"namespaces",
",",
"storeSpec",
"+",
"s",
".",
"named",
".",
"Name",
"(",
")",
"+",
"\"",
"\"",
"+",
"tagged",
".",
"Tag",
"(",
")",
")",
"\n",
"}",
"\n",
"components",
":=",
"strings",
".",
"Split",
"(",
"s",
".",
"named",
".",
"<mask>",
"(",
")",
",",
"\"",
"\"",
")",
"\n",
"for",
"len",
"(",
"components",
")",
">",
"0",
"{",
"namespaces",
"=",
"append",
"(",
"namespaces",
",",
"storeSpec",
"+",
"strings",
".",
"Join",
"(",
"components",
",",
"\"",
"\"",
")",
")",
"\n",
"components",
"=",
"components",
"[",
":",
"len",
"(",
"components",
")",
"-",
"1",
"]",
"\n",
"}",
"\n",
"}",
"\n",
"namespaces",
"=",
"append",
"(",
"namespaces",
",",
"storeSpec",
")",
"\n",
"namespaces",
"=",
"append",
"(",
"namespaces",
",",
"driverlessStoreSpec",
")",
"\n",
"return",
"namespaces",
"\n",
"}"
] |
22,050 | all-22051 | [
"Fatalf",
"is",
"equivalent",
"to",
"l",
".",
"Critical",
"followed",
"by",
"a",
"call",
"to",
"os",
".",
"Exit",
"(",
"1",
")",
"."
] | [
"func",
"(",
"l",
"*",
"Logger",
")",
"Fatalf",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"l",
".",
"log",
"(",
"CRITICAL",
",",
"&",
"<mask>",
",",
"args",
"...",
")",
"\n",
"os",
".",
"Exit",
"(",
"1",
")",
"\n",
"}"
] |
22,051 | all-22052 | [
"ValidDependencies",
"takes",
"a",
"task",
"and",
"verifies",
"that",
"it",
"is",
"possible",
"to",
"allow",
"all",
"containers",
"within",
"it",
"to",
"reach",
"the",
"desired",
"status",
"by",
"proceeding",
"in",
"some",
"order",
"."
] | [
"func",
"ValidDependencies",
"(",
"task",
"*",
"apitask",
".",
"Task",
")",
"bool",
"{",
"unresolved",
":=",
"make",
"(",
"[",
"]",
"*",
"apicontainer",
".",
"Container",
",",
"len",
"(",
"task",
".",
"Containers",
")",
")",
"\n",
"resolved",
":=",
"make",
"(",
"[",
"]",
"*",
"apicontainer",
".",
"Container",
",",
"0",
",",
"len",
"(",
"task",
".",
"Containers",
")",
")",
"\n\n",
"<mask>",
"(",
"unresolved",
",",
"task",
".",
"Containers",
")",
"\n\n",
"OuterLoop",
":",
"for",
"len",
"(",
"unresolved",
")",
">",
"0",
"{",
"for",
"i",
",",
"tryResolve",
":=",
"range",
"unresolved",
"{",
"if",
"dependenciesCanBeResolved",
"(",
"tryResolve",
",",
"resolved",
")",
"{",
"resolved",
"=",
"append",
"(",
"resolved",
",",
"tryResolve",
")",
"\n",
"unresolved",
"=",
"append",
"(",
"unresolved",
"[",
":",
"i",
"]",
",",
"unresolved",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"// Break out of the inner loop now that we modified the slice",
"// we're looping over",
"continue",
"OuterLoop",
"\n",
"}",
"\n",
"}",
"\n",
"log",
".",
"Warnf",
"(",
"\"",
"\"",
",",
"unresolved",
",",
"task",
")",
"\n",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
] |
22,052 | all-22053 | [
"AlertLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] | [
"func",
"(",
"api",
"*",
"API",
")",
"AlertLocator",
"(",
"href",
"string",
")",
"*",
"AlertLocator",
"{",
"<mask>",
"&",
"AlertLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
22,053 | all-22054 | [
"eventHandler",
"is",
"used",
"to",
"manage",
"udev",
"net",
"subsystem",
"events",
"to",
"add",
"/",
"remove",
"interfaces"
] | [
"func",
"(",
"udevWatcher",
"*",
"UdevWatcher",
")",
"eventHandler",
"(",
")",
"{",
"// The shutdown channel will be used to terminate the watch for udev events",
"shutdown",
":=",
"udevWatcher",
".",
"udevMonitor",
".",
"Monitor",
"(",
"udevWatcher",
".",
"events",
")",
"\n",
"for",
"{",
"select",
"{",
"case",
"event",
":=",
"<-",
"udevWatcher",
".",
"events",
":",
"subsystem",
",",
"ok",
":=",
"event",
".",
"Env",
"[",
"udevSubsystem",
"]",
"\n",
"if",
"!",
"ok",
"||",
"subsystem",
"!=",
"udevNetSubsystem",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"event",
".",
"Env",
"[",
"udevEventAction",
"]",
"!=",
"udevAddEvent",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"!",
"networkutils",
".",
"IsValidNetworkDevice",
"(",
"event",
".",
"Env",
"[",
"udevDevPath",
"]",
")",
"{",
"log",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"event",
".",
"String",
"(",
")",
")",
"\n",
"continue",
"\n",
"}",
"\n",
"netInterface",
":=",
"event",
".",
"Env",
"[",
"udevInterface",
"]",
"\n",
"// GetMACAddres and sendENIStateChangeWithRetries can block the execution",
"// of this method for a few seconds in the worst-case scenario.",
"// Execute these within a go-routine",
"go",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"dev",
"string",
",",
"timeout",
"<mask>",
".",
"Duration",
")",
"{",
"log",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"dev",
")",
"\n",
"macAddress",
",",
"err",
":=",
"networkutils",
".",
"GetMACAddress",
"(",
"udevWatcher",
".",
"ctx",
",",
"macAddressRetryTimeout",
",",
"dev",
",",
"udevWatcher",
".",
"netlinkClient",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"log",
".",
"Warnf",
"(",
"\"",
"\"",
",",
"dev",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"udevWatcher",
".",
"sendENIStateChangeWithRetries",
"(",
"ctx",
",",
"macAddress",
",",
"timeout",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"Warnf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"}",
"(",
"udevWatcher",
".",
"ctx",
",",
"netInterface",
",",
"sendENIStateChangeRetryTimeout",
")",
"\n",
"case",
"<-",
"udevWatcher",
".",
"ctx",
".",
"Done",
"(",
")",
":",
"log",
".",
"Info",
"(",
"\"",
"\"",
")",
"\n",
"// Send the shutdown signal and close the connection",
"shutdown",
"<-",
"true",
"\n",
"if",
"err",
":=",
"udevWatcher",
".",
"udevMonitor",
".",
"Close",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"Warnf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
22,054 | all-22055 | [
"CheckoutNewBranch",
"creates",
"a",
"new",
"branch",
"and",
"checks",
"it",
"out",
"."
] | [
"func",
"(",
"r",
"*",
"Repo",
")",
"CheckoutNewBranch",
"(",
"branch",
"<mask>",
")",
"error",
"{",
"r",
".",
"logger",
".",
"Infof",
"(",
"\"",
"\"",
",",
"branch",
")",
"\n",
"co",
":=",
"r",
".",
"gitCommand",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"branch",
")",
"\n",
"if",
"b",
",",
"err",
":=",
"co",
".",
"CombinedOutput",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"branch",
",",
"err",
",",
"string",
"(",
"b",
")",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
22,055 | all-22056 | [
"DrawRect",
"draws",
"a",
"rectangle",
"on",
"the",
"given",
"destination",
"dst",
".",
"DrawRect",
"is",
"intended",
"to",
"be",
"used",
"mainly",
"for",
"debugging",
"or",
"prototyping",
"purpose",
"."
] | [
"func",
"DrawRect",
"(",
"dst",
"*",
"ebiten",
".",
"Image",
",",
"x",
",",
"y",
",",
"<mask>",
",",
"height",
"float64",
",",
"clr",
"color",
".",
"Color",
")",
"{",
"ew",
",",
"eh",
":=",
"emptyImage",
".",
"Size",
"(",
")",
"\n\n",
"op",
":=",
"&",
"ebiten",
".",
"DrawImageOptions",
"{",
"}",
"\n",
"op",
".",
"GeoM",
".",
"Scale",
"(",
"width",
"/",
"float64",
"(",
"ew",
")",
",",
"height",
"/",
"float64",
"(",
"eh",
")",
")",
"\n",
"op",
".",
"GeoM",
".",
"Translate",
"(",
"x",
",",
"y",
")",
"\n",
"op",
".",
"ColorM",
".",
"Scale",
"(",
"colorScale",
"(",
"clr",
")",
")",
"\n",
"// Filter must be 'nearest' filter (default).",
"// Linear filtering would make edges blurred.",
"_",
"=",
"dst",
".",
"DrawImage",
"(",
"emptyImage",
",",
"op",
")",
"\n",
"}"
] |
22,056 | all-22057 | [
"FindVirtualDeviceByAddr",
"locates",
"the",
"subresource",
"s",
"virtual",
"device",
"in",
"the",
"supplied",
"VirtualDeviceList",
"by",
"its",
"device",
"address",
"."
] | [
"func",
"(",
"r",
"*",
"Subresource",
")",
"FindVirtualDeviceByAddr",
"(",
"l",
"object",
".",
"VirtualDeviceList",
")",
"(",
"types",
".",
"BaseVirtualDevice",
",",
"error",
")",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"r",
".",
"DevAddr",
"(",
")",
")",
"\n",
"ct",
",",
"cb",
",",
"du",
",",
"err",
":=",
"splitDevAddr",
"(",
"r",
".",
"DevAddr",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// find the controller",
"csf",
":=",
"findVirtualDeviceInListControllerSelectFunc",
"(",
"ct",
",",
"cb",
")",
"\n",
"ctlrs",
":=",
"l",
".",
"Select",
"(",
"csf",
")",
"\n",
"if",
"len",
"(",
"ctlrs",
")",
"!=",
"1",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"len",
"(",
"ctlrs",
")",
",",
"ct",
",",
"cb",
")",
"\n",
"}",
"\n",
"ctlr",
":=",
"ctlrs",
"[",
"0",
"]",
"\n\n",
"// find the device",
"ckey",
":=",
"ctlr",
".",
"GetVirtualDevice",
"(",
")",
".",
"Key",
"\n",
"dsf",
":=",
"findVirtualDeviceInListDeviceSelectFunc",
"(",
"ckey",
",",
"du",
")",
"\n",
"devices",
":=",
"l",
".",
"Select",
"(",
"dsf",
")",
"\n",
"if",
"len",
"(",
"<mask>",
")",
"!=",
"1",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"len",
"(",
"devices",
")",
",",
"ckey",
",",
"du",
")",
"\n",
"}",
"\n",
"device",
":=",
"devices",
"[",
"0",
"]",
"\n",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"l",
".",
"Name",
"(",
"device",
")",
")",
"\n",
"return",
"device",
",",
"nil",
"\n",
"}"
] |
22,057 | all-22058 | [
"ListServers",
"returns",
"a",
"server",
"struct",
"collection"
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"ListServers",
"(",
"dcid",
"string",
")",
"(",
"*",
"Servers",
",",
"error",
")",
"{",
"url",
":=",
"serverColPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
"+",
"strconv",
".",
"FormatBool",
"(",
"c",
".",
"client",
".",
"pretty",
")",
"\n",
"ret",
":=",
"&",
"Servers",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"client",
".",
"Get",
"(",
"url",
",",
"ret",
",",
"http",
".",
"StatusOK",
")",
"\n",
"return",
"ret",
",",
"err",
"\n",
"}"
] |
22,058 | all-22059 | [
"LoadResponse",
"deserializes",
"the",
"JSON",
"response",
"into",
"a",
"generic",
"object",
".",
"If",
"the",
"response",
"has",
"a",
"Location",
"header",
"then",
"the",
"returned",
"object",
"is",
"a",
"map",
"with",
"one",
"key",
"Location",
"containing",
"the",
"value",
"of",
"the",
"header",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"LoadResponse",
"(",
"resp",
"*",
"http",
".",
"Response",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n",
"var",
"respBody",
"interface",
"{",
"}",
"\n",
"jsonResp",
",",
"err",
":=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"len",
"(",
"jsonResp",
")",
">",
"0",
"{",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"jsonResp",
",",
"&",
"respBody",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"}",
"\n",
"// Special case for \"Location\" header, assume that if there is a location there is no body",
"loc",
":=",
"resp",
".",
"Header",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"len",
"(",
"loc",
")",
">",
"0",
"{",
"<mask>",
"bodyMap",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"bodyMap",
"[",
"\"",
"\"",
"]",
"=",
"loc",
"\n",
"respBody",
"=",
"interface",
"{",
"}",
"(",
"bodyMap",
")",
"\n",
"}",
"\n",
"return",
"respBody",
",",
"err",
"\n",
"}"
] |
22,059 | all-22060 | [
"Create",
"a",
"database",
"connection",
"and",
"perform",
"any",
"updates",
"needed",
"."
] | [
"func",
"initializeDbObject",
"(",
"d",
"*",
"Daemon",
")",
"(",
"*",
"db",
".",
"Dump",
",",
"error",
")",
"{",
"logger",
".",
"Info",
"(",
"\"",
"\"",
")",
"\n",
"// Rename the old database name if needed.",
"if",
"shared",
".",
"PathExists",
"(",
"d",
".",
"os",
".",
"LegacyLocalDatabasePath",
"(",
")",
")",
"{",
"if",
"shared",
".",
"PathExists",
"(",
"d",
".",
"os",
".",
"LocalDatabasePath",
"(",
")",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"logger",
".",
"Info",
"(",
"\"",
"\"",
")",
"\n",
"err",
":=",
"os",
".",
"Rename",
"(",
"d",
".",
"os",
".",
"LegacyLocalDatabasePath",
"(",
")",
",",
"d",
".",
"os",
".",
"LocalDatabasePath",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"// NOTE: we use the legacyPatches parameter to run a few",
"// legacy non-db updates that were in place before the",
"// patches mechanism was introduced in lxd/patches.go. The",
"// rest of non-db patches will be applied separately via",
"// patchesApplyAll. See PR #3322 for more details.",
"legacy",
":=",
"map",
"[",
"int",
"]",
"*",
"<mask>",
".",
"LegacyPatch",
"{",
"}",
"\n",
"for",
"i",
",",
"patch",
":=",
"range",
"legacyPatches",
"{",
"legacy",
"[",
"i",
"]",
"=",
"&",
"db",
".",
"LegacyPatch",
"{",
"Hook",
":",
"func",
"(",
"node",
"*",
"sql",
".",
"DB",
")",
"error",
"{",
"// FIXME: Use the low-level *node* SQL db as backend for both the",
"// db.Node and db.Cluster objects, since at this point we",
"// haven't migrated the data to the cluster database yet.",
"cluster",
":=",
"d",
".",
"cluster",
"\n",
"defer",
"func",
"(",
")",
"{",
"d",
".",
"cluster",
"=",
"cluster",
"\n",
"}",
"(",
")",
"\n",
"d",
".",
"db",
"=",
"db",
".",
"ForLegacyPatches",
"(",
"node",
")",
"\n",
"d",
".",
"cluster",
"=",
"db",
".",
"ForLocalInspection",
"(",
"node",
")",
"\n",
"return",
"patch",
"(",
"d",
")",
"\n",
"}",
",",
"}",
"\n",
"}",
"\n",
"for",
"_",
",",
"i",
":=",
"range",
"legacyPatchesNeedingDB",
"{",
"legacy",
"[",
"i",
"]",
".",
"NeedsDB",
"=",
"true",
"\n",
"}",
"\n\n",
"// Hook to run when the local database is created from scratch. It will",
"// create the default profile and mark all patches as applied.",
"freshHook",
":=",
"func",
"(",
"db",
"*",
"db",
".",
"Node",
")",
"error",
"{",
"for",
"_",
",",
"patchName",
":=",
"range",
"patchesGetNames",
"(",
")",
"{",
"err",
":=",
"db",
".",
"PatchesMarkApplied",
"(",
"patchName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"var",
"err",
"error",
"\n",
"var",
"dump",
"*",
"db",
".",
"Dump",
"\n",
"d",
".",
"db",
",",
"dump",
",",
"err",
"=",
"db",
".",
"OpenNode",
"(",
"filepath",
".",
"Join",
"(",
"d",
".",
"os",
".",
"VarDir",
",",
"\"",
"\"",
")",
",",
"freshHook",
",",
"legacy",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"return",
"dump",
",",
"nil",
"\n",
"}"
] |
22,060 | all-22061 | [
"Run",
"starts",
"a",
"query",
"for",
"log",
"records",
"which",
"contain",
"request",
"and",
"application",
"level",
"log",
"information",
"."
] | [
"func",
"(",
"params",
"*",
"<mask>",
")",
"Run",
"(",
"c",
"context",
".",
"Context",
")",
"*",
"Result",
"{",
"req",
",",
"err",
":=",
"makeRequest",
"(",
"params",
",",
"internal",
".",
"FullyQualifiedAppID",
"(",
"c",
")",
",",
"appengine",
".",
"VersionID",
"(",
"c",
")",
")",
"\n",
"return",
"&",
"Result",
"{",
"context",
":",
"c",
",",
"request",
":",
"req",
",",
"err",
":",
"err",
",",
"}",
"\n",
"}"
] |
22,061 | all-22062 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetProduceCompilationCacheParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage7",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
22,062 | all-22063 | [
"AcquireByState",
"asks",
"boskos",
"for",
"a",
"resources",
"of",
"certain",
"type",
"and",
"set",
"the",
"resource",
"to",
"dest",
"state",
".",
"Returns",
"a",
"list",
"of",
"resources",
"on",
"success",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"AcquireByState",
"(",
"state",
",",
"dest",
"string",
",",
"names",
"[",
"]",
"string",
")",
"(",
"[",
"]",
"common",
".",
"Resource",
",",
"error",
")",
"{",
"resources",
",",
"err",
":=",
"c",
".",
"acquireByState",
"(",
"state",
",",
"dest",
",",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"c",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n",
"for",
"_",
",",
"r",
":=",
"range",
"resources",
"{",
"c",
".",
"storage",
".",
"Add",
"(",
"r",
")",
"\n",
"}",
"\n",
"return",
"resources",
",",
"nil",
"\n",
"}"
] |
22,063 | all-22064 | [
"ChecksumZero",
"returns",
"the",
"32bits",
"Hash",
"value",
"."
] | [
"func",
"ChecksumZero",
"(",
"input",
"[",
"]",
"byte",
")",
"uint32",
"{",
"n",
":=",
"len",
"(",
"input",
")",
"\n",
"h32",
":=",
"uint32",
"(",
"n",
")",
"\n\n",
"if",
"n",
"<",
"16",
"{",
"h32",
"+=",
"prime32_5",
"\n",
"}",
"else",
"{",
"v1",
":=",
"prime32_1plus2",
"\n",
"v2",
":=",
"prime32_2",
"\n",
"v3",
":=",
"uint32",
"(",
"0",
")",
"\n",
"v4",
":=",
"prime32_minus1",
"\n",
"p",
":=",
"0",
"\n",
"for",
"n",
":=",
"n",
"-",
"16",
";",
"p",
"<=",
"n",
";",
"p",
"+=",
"16",
"{",
"sub",
":=",
"input",
"[",
"p",
":",
"]",
"[",
":",
"16",
"]",
"//BCE hint for compiler",
"\n",
"v1",
"=",
"rol13",
"(",
"v1",
"+",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"sub",
"[",
":",
"]",
")",
"*",
"prime32_2",
")",
"*",
"prime32_1",
"\n",
"v2",
"=",
"rol13",
"(",
"v2",
"+",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"sub",
"[",
"4",
":",
"]",
")",
"*",
"prime32_2",
")",
"*",
"prime32_1",
"\n",
"v3",
"=",
"rol13",
"(",
"v3",
"+",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"sub",
"[",
"8",
":",
"]",
")",
"*",
"prime32_2",
")",
"*",
"prime32_1",
"\n",
"v4",
"=",
"rol13",
"(",
"v4",
"+",
"<mask>",
".",
"LittleEndian",
".",
"Uint32",
"(",
"sub",
"[",
"12",
":",
"]",
")",
"*",
"prime32_2",
")",
"*",
"prime32_1",
"\n",
"}",
"\n",
"input",
"=",
"input",
"[",
"p",
":",
"]",
"\n",
"n",
"-=",
"p",
"\n",
"h32",
"+=",
"rol1",
"(",
"v1",
")",
"+",
"rol7",
"(",
"v2",
")",
"+",
"rol12",
"(",
"v3",
")",
"+",
"rol18",
"(",
"v4",
")",
"\n",
"}",
"\n\n",
"p",
":=",
"0",
"\n",
"for",
"n",
":=",
"n",
"-",
"4",
";",
"p",
"<=",
"n",
";",
"p",
"+=",
"4",
"{",
"h32",
"+=",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"input",
"[",
"p",
":",
"p",
"+",
"4",
"]",
")",
"*",
"prime32_3",
"\n",
"h32",
"=",
"rol17",
"(",
"h32",
")",
"*",
"prime32_4",
"\n",
"}",
"\n",
"for",
"p",
"<",
"n",
"{",
"h32",
"+=",
"uint32",
"(",
"input",
"[",
"p",
"]",
")",
"*",
"prime32_5",
"\n",
"h32",
"=",
"rol11",
"(",
"h32",
")",
"*",
"prime32_1",
"\n",
"p",
"++",
"\n",
"}",
"\n\n",
"h32",
"^=",
"h32",
">>",
"15",
"\n",
"h32",
"*=",
"prime32_2",
"\n",
"h32",
"^=",
"h32",
">>",
"13",
"\n",
"h32",
"*=",
"prime32_3",
"\n",
"h32",
"^=",
"h32",
">>",
"16",
"\n\n",
"return",
"h32",
"\n",
"}"
] |
22,064 | all-22065 | [
"Exists",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockControl",
")",
"Exists",
"(",
"arg0",
"string",
")",
"bool",
"{",
"<mask>",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"bool",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] |
22,065 | all-22066 | [
"PrependSubmenu",
"is",
"a",
"wrapper",
"around",
"g_menu_prepend_submenu",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Menu",
")",
"PrependSubmenu",
"(",
"label",
"string",
",",
"submenu",
"*",
"MenuModel",
")",
"{",
"cstr1",
":=",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"C",
".",
"CString",
"(",
"<mask>",
")",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr1",
")",
")",
"\n\n",
"C",
".",
"g_menu_prepend_submenu",
"(",
"v",
".",
"native",
"(",
")",
",",
"cstr1",
",",
"submenu",
".",
"native",
"(",
")",
")",
"\n",
"}"
] |
22,066 | all-22067 | [
"RenderEvents",
"returns",
"the",
"render",
"events",
"for",
"each",
"template",
"was",
"rendered",
".",
"The",
"map",
"is",
"keyed",
"by",
"template",
"ID",
"."
] | [
"func",
"(",
"r",
"*",
"Runner",
")",
"RenderEvents",
"(",
")",
"map",
"[",
"string",
"]",
"*",
"RenderEvent",
"{",
"r",
".",
"renderEventsLock",
".",
"RLock",
"(",
")",
"\n",
"defer",
"r",
".",
"renderEventsLock",
".",
"RUnlock",
"(",
")",
"\n\n",
"times",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"RenderEvent",
",",
"len",
"(",
"r",
".",
"renderEvents",
")",
")",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"r",
".",
"renderEvents",
"{",
"<mask>",
"[",
"k",
"]",
"=",
"v",
"\n",
"}",
"\n",
"return",
"times",
"\n",
"}"
] |
22,067 | all-22068 | [
"NewMockCgroup",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockCgroup",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockCgroup",
"{",
"mock",
":=",
"&",
"MockCgroup",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockCgroupMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] |
22,068 | all-22069 | [
"SubmitTaskStateChange",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockECSClient",
")",
"SubmitTaskStateChange",
"(",
"arg0",
"api",
".",
"TaskStateChange",
")",
"error",
"{",
"<mask>",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] |
22,069 | all-22070 | [
"SetContentRange",
"sets",
"Content",
"-",
"Range",
":",
"bytes",
"startPos",
"-",
"endPos",
"/",
"contentLength",
"header",
"."
] | [
"func",
"(",
"h",
"*",
"ResponseHeader",
")",
"SetContentRange",
"(",
"startPos",
",",
"endPos",
",",
"contentLength",
"int",
")",
"{",
"b",
":=",
"h",
".",
"bufKV",
".",
"<mask>",
"[",
":",
"0",
"]",
"\n",
"b",
"=",
"append",
"(",
"b",
",",
"strBytes",
"...",
")",
"\n",
"b",
"=",
"append",
"(",
"b",
",",
"' '",
")",
"\n",
"b",
"=",
"AppendUint",
"(",
"b",
",",
"startPos",
")",
"\n",
"b",
"=",
"append",
"(",
"b",
",",
"'-'",
")",
"\n",
"b",
"=",
"AppendUint",
"(",
"b",
",",
"endPos",
")",
"\n",
"b",
"=",
"append",
"(",
"b",
",",
"'/'",
")",
"\n",
"b",
"=",
"AppendUint",
"(",
"b",
",",
"contentLength",
")",
"\n",
"h",
".",
"bufKV",
".",
"value",
"=",
"b",
"\n\n",
"h",
".",
"SetCanonical",
"(",
"strContentRange",
",",
"h",
".",
"bufKV",
".",
"value",
")",
"\n",
"}"
] |
22,070 | all-22071 | [
"InstanceMetricLocator",
"builds",
"a",
"locator",
"from",
"the",
"given",
"href",
"."
] | [
"func",
"(",
"api",
"*",
"API",
")",
"InstanceMetricLocator",
"(",
"href",
"<mask>",
")",
"*",
"InstanceMetricLocator",
"{",
"return",
"&",
"InstanceMetricLocator",
"{",
"Href",
"(",
"href",
")",
",",
"api",
"}",
"\n",
"}"
] |
22,071 | all-22072 | [
"ImageTooBig",
"checks",
"if",
"image",
"is",
"bigger",
"than",
"github",
"limits"
] | [
"func",
"ImageTooBig",
"(",
"url",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"// limit is 10MB",
"limit",
":=",
"10000000",
"\n",
"// try to get the image size from Content-Length header",
"resp",
",",
"err",
":=",
"http",
".",
"Head",
"(",
"url",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"true",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"sc",
":=",
"resp",
".",
"StatusCode",
";",
"sc",
"!=",
"http",
".",
"StatusOK",
"{",
"return",
"true",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"sc",
")",
"\n",
"}",
"\n",
"<mask>",
",",
"_",
":=",
"strconv",
".",
"Atoi",
"(",
"resp",
".",
"Header",
".",
"Get",
"(",
"\"",
"\"",
")",
")",
"\n",
"if",
"size",
">",
"limit",
"{",
"return",
"true",
",",
"nil",
"\n",
"}",
"\n",
"return",
"false",
",",
"nil",
"\n",
"}"
] |
22,072 | all-22073 | [
"NewMockDockerStateResolver",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockDockerStateResolver",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockDockerStateResolver",
"{",
"mock",
":=",
"&",
"MockDockerStateResolver",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockDockerStateResolverMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] |
22,073 | all-22074 | [
"StorageRootFromEnv",
"gets",
"the",
"storage",
"root",
"based",
"on",
"environment",
"variables",
"."
] | [
"func",
"StorageRootFromEnv",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"storageRoot",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"PachRootEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"PachRootEnvVar",
")",
"\n",
"}",
"\n",
"storageBackend",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"StorageBackendEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"StorageBackendEnvVar",
")",
"\n",
"}",
"\n",
"// These storage backends do not like leading slashes",
"switch",
"storageBackend",
"{",
"case",
"Amazon",
":",
"fallthrough",
"\n",
"<mask>",
"Minio",
":",
"if",
"len",
"(",
"storageRoot",
")",
">",
"0",
"&&",
"storageRoot",
"[",
"0",
"]",
"==",
"'/'",
"{",
"storageRoot",
"=",
"storageRoot",
"[",
"1",
":",
"]",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"storageRoot",
",",
"nil",
"\n",
"}"
] |
22,074 | all-22075 | [
"NewS64",
"creates",
"a",
"new",
"hash",
".",
"Hash64",
"computing",
"the",
"64bit",
"xxHash",
"checksum",
"starting",
"with",
"the",
"specific",
"seed",
"."
] | [
"func",
"NewS64",
"(",
"seed",
"uint64",
")",
"(",
"xx",
"*",
"XXHash64",
")",
"{",
"<mask>",
"=",
"&",
"XXHash64",
"{",
"seed",
":",
"seed",
",",
"}",
"\n",
"xx",
".",
"Reset",
"(",
")",
"\n",
"return",
"\n",
"}"
] |
22,075 | all-22076 | [
"querystring",
"implements",
"querystringer",
"to",
"represent",
"the",
"outgoing",
"certificate",
"file",
"."
] | [
"func",
"(",
"ow",
"*",
"outgoingSetWebhook",
")",
"querystring",
"(",
")",
"querystring",
"{",
"toReturn",
":=",
"make",
"(",
"<mask>",
"[",
"string",
"]",
"string",
")",
"\n\n",
"if",
"ow",
".",
"URL",
"!=",
"\"",
"\"",
"{",
"toReturn",
"[",
"\"",
"\"",
"]",
"=",
"ow",
".",
"URL",
"\n",
"}",
"\n\n",
"return",
"querystring",
"(",
"toReturn",
")",
"\n",
"}"
] |
22,076 | all-22077 | [
"GetStatus",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_operation_get_status",
"()",
"."
] | [
"func",
"(",
"<mask>",
"*",
"PrintOperation",
")",
"GetStatus",
"(",
")",
"PrintStatus",
"{",
"c",
":=",
"C",
".",
"gtk_print_operation_get_status",
"(",
"po",
".",
"native",
"(",
")",
")",
"\n",
"return",
"PrintStatus",
"(",
"c",
")",
"\n",
"}"
] |
22,077 | all-22078 | [
"Set",
"store",
"a",
"value",
"to",
"specified",
"token",
"."
] | [
"func",
"(",
"s",
"*",
"SessionCache",
")",
"Set",
"(",
"<mask>",
"string",
",",
"value",
"interface",
"{",
"}",
")",
"error",
"{",
"err",
":=",
"s",
".",
"cache",
".",
"Set",
"(",
"token",
",",
"value",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"s",
".",
"getInvalidTokenError",
"(",
"token",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
22,078 | all-22079 | [
"CleanupNS",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockCNIClient",
")",
"CleanupNS",
"(",
"arg0",
"context",
".",
"Context",
",",
"arg1",
"*",
"ecscni",
".",
"Config",
",",
"arg2",
"time",
".",
"Duration",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
",",
"arg2",
")",
"\n",
"ret0",
",",
"_",
":=",
"<mask>",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] |
22,079 | all-22080 | [
"virtualMachineFromSearchIndex",
"gets",
"the",
"virtual",
"machine",
"reference",
"via",
"the",
"SearchIndex",
"MO",
"and",
"is",
"the",
"method",
"used",
"to",
"fetch",
"UUIDs",
"on",
"newer",
"versions",
"of",
"vSphere",
"."
] | [
"func",
"virtualMachineFromSearchIndex",
"(",
"ctx",
"context",
".",
"Context",
",",
"client",
"*",
"govmomi",
".",
"Client",
",",
"uuid",
"string",
")",
"(",
"object",
".",
"Reference",
",",
"error",
")",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"uuid",
")",
"\n",
"search",
":=",
"object",
".",
"NewSearchIndex",
"(",
"client",
".",
"<mask>",
")",
"\n",
"result",
",",
"err",
":=",
"search",
".",
"FindByUuid",
"(",
"ctx",
",",
"nil",
",",
"uuid",
",",
"true",
",",
"structure",
".",
"BoolPtr",
"(",
"false",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"result",
"==",
"nil",
"{",
"return",
"nil",
",",
"newUUIDNotFoundError",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"uuid",
")",
")",
"\n",
"}",
"\n\n",
"return",
"result",
",",
"nil",
"\n",
"}"
] |
22,080 | all-22081 | [
"String",
"prints",
"upto",
"the",
"first",
"fifteen",
"elements",
"of",
"the",
"list",
"in",
"string",
"format",
"."
] | [
"func",
"(",
"list",
"*",
"LinkedList",
")",
"String",
"(",
")",
"string",
"{",
"list",
".",
"key",
".",
"RLock",
"(",
")",
"\n",
"defer",
"list",
".",
"key",
".",
"RUnlock",
"(",
")",
"\n\n",
"builder",
":=",
"bytes",
".",
"NewBufferString",
"(",
"\"",
"\"",
")",
"\n",
"current",
":=",
"list",
".",
"first",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"15",
"&&",
"current",
"!=",
"nil",
";",
"i",
"++",
"{",
"builder",
".",
"WriteString",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"current",
".",
"payload",
")",
")",
"\n",
"current",
"=",
"current",
".",
"next",
"\n",
"}",
"\n",
"if",
"current",
"==",
"nil",
"||",
"current",
".",
"next",
"==",
"nil",
"{",
"builder",
".",
"Truncate",
"(",
"builder",
".",
"Len",
"(",
")",
"-",
"1",
")",
"\n",
"}",
"else",
"{",
"builder",
".",
"WriteString",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"<mask>",
".",
"WriteRune",
"(",
"']'",
")",
"\n",
"return",
"builder",
".",
"String",
"(",
")",
"\n",
"}"
] |
22,081 | all-22082 | [
"Length",
"returns",
"the",
"number",
"of",
"items",
"in",
"the",
"Queue",
"."
] | [
"func",
"(",
"q",
"*",
"Queue",
")",
"Length",
"(",
")",
"uint",
"{",
"q",
".",
"key",
".",
"RLock",
"(",
")",
"\n",
"defer",
"q",
".",
"key",
".",
"RUnlock",
"(",
")",
"\n",
"if",
"nil",
"==",
"q",
".",
"underlyer",
"{",
"return",
"0",
"\n",
"}",
"\n",
"return",
"q",
".",
"underlyer",
".",
"<mask>",
"\n",
"}"
] |
22,082 | all-22083 | [
"RemoveTag",
"removes",
"the",
"tag",
"with",
"the",
"specified",
"key",
"."
] | [
"func",
"(",
"s",
"*",
"DeploymentManifest",
")",
"RemoveTag",
"(",
"key",
"string",
")",
"{",
"if",
"s",
".",
"Tags",
"!=",
"nil",
"{",
"<mask>",
"(",
"s",
".",
"Tags",
",",
"key",
")",
"\n",
"}",
"\n",
"}"
] |
22,083 | all-22084 | [
"/",
"*",
"ShutdownLoggers",
"will",
"run",
"ShutdownLogger",
"on",
"each",
"Logger",
"in",
"Base",
".",
"If",
"an",
"error",
"occurs",
"while",
"shutting",
"down",
"a",
"Logger",
"the",
"error",
"will",
"be",
"returned",
"and",
"all",
"the",
"loggers",
"that",
"were",
"already",
"shut",
"down",
"will",
"remain",
"shut",
"down",
"."
] | [
"func",
"(",
"b",
"*",
"Base",
")",
"ShutdownLoggers",
"(",
")",
"error",
"{",
"// Before shutting down we should flush all the messsages",
"b",
".",
"Flush",
"(",
")",
"\n\n",
"for",
"_",
",",
"logger",
":=",
"<mask>",
"b",
".",
"loggers",
"{",
"err",
":=",
"logger",
".",
"ShutdownLogger",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"b",
".",
"queue",
"!=",
"nil",
"{",
"b",
".",
"queue",
".",
"stopWorker",
"(",
")",
"\n",
"b",
".",
"queue",
"=",
"nil",
"\n",
"}",
"\n\n",
"if",
"b",
".",
"errorChan",
"!=",
"nil",
"{",
"close",
"(",
"b",
".",
"errorChan",
")",
"\n",
"b",
".",
"errorChan",
"=",
"nil",
"\n",
"}",
"\n\n",
"b",
".",
"isInitialized",
"=",
"false",
"\n",
"return",
"nil",
"\n",
"}"
] |
22,084 | all-22085 | [
"UnmarshalText",
"hydrates",
"this",
"instance",
"from",
"text"
] | [
"func",
"(",
"u",
"*",
"UUID4",
")",
"UnmarshalText",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"// validation is performed later on",
"*",
"u",
"=",
"UUID4",
"(",
"string",
"(",
"<mask>",
")",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
22,085 | all-22086 | [
"New",
"is",
"used",
"to",
"return",
"an",
"instance",
"of",
"the",
"UdevWatcher",
"struct"
] | [
"func",
"New",
"(",
"ctx",
"context",
".",
"<mask>",
",",
"primaryMAC",
"string",
",",
"udevwrap",
"udevwrapper",
".",
"Udev",
",",
"state",
"dockerstate",
".",
"TaskEngineState",
",",
"stateChangeEvents",
"chan",
"<-",
"statechange",
".",
"Event",
")",
"*",
"UdevWatcher",
"{",
"return",
"newWatcher",
"(",
"ctx",
",",
"primaryMAC",
",",
"netlinkwrapper",
".",
"New",
"(",
")",
",",
"udevwrap",
",",
"state",
",",
"stateChangeEvents",
")",
"\n",
"}"
] |
22,086 | all-22087 | [
"UpdateAnnotation",
"updates",
"passed",
"annotation",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"UpdateAnnotation",
"(",
"cfg",
"*",
"Annotation",
")",
"(",
"*",
"Annotation",
",",
"error",
")",
"{",
"if",
"cfg",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"annotationCID",
":=",
"string",
"(",
"cfg",
".",
"CID",
")",
"\n\n",
"matched",
",",
"err",
":=",
"regexp",
".",
"MatchString",
"(",
"config",
".",
"AnnotationCIDRegex",
",",
"annotationCID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"!",
"matched",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"annotationCID",
")",
"\n",
"}",
"\n\n",
"jsonCfg",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"cfg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"a",
".",
"Debug",
"{",
"a",
".",
"<mask>",
".",
"Printf",
"(",
"\"",
"\"",
",",
"string",
"(",
"jsonCfg",
")",
")",
"\n",
"}",
"\n\n",
"result",
",",
"err",
":=",
"a",
".",
"Put",
"(",
"annotationCID",
",",
"jsonCfg",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"annotation",
":=",
"&",
"Annotation",
"{",
"}",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"result",
",",
"annotation",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"annotation",
",",
"nil",
"\n",
"}"
] |
22,087 | all-22088 | [
"ToolsState",
"returns",
"state",
"of",
"the",
"VMware",
"Tools",
"suite",
"in",
"the",
"guest",
"."
] | [
"func",
"(",
"v",
"*",
"VM",
")",
"ToolsState",
"(",
")",
"(",
"GuestToolsState",
",",
"error",
")",
"{",
"var",
"err",
"C",
".",
"VixError",
"=",
"C",
".",
"VIX_OK",
"\n",
"state",
":=",
"C",
".",
"VIX_TOOLSSTATE_UNKNOWN",
"\n\n",
"err",
"=",
"C",
".",
"get_property",
"(",
"v",
".",
"handle",
",",
"C",
".",
"VIX_PROPERTY_VM_TOOLS_STATE",
",",
"unsafe",
".",
"Pointer",
"(",
"&",
"state",
")",
")",
"\n\n",
"if",
"C",
".",
"VIX_OK",
"!=",
"err",
"{",
"return",
"TOOLSSTATE_UNKNOWN",
",",
"&",
"Error",
"{",
"<mask>",
":",
"\"",
"\"",
",",
"Code",
":",
"int",
"(",
"err",
"&",
"0xFFFF",
")",
",",
"Text",
":",
"C",
".",
"GoString",
"(",
"C",
".",
"Vix_GetErrorText",
"(",
"err",
",",
"nil",
")",
")",
",",
"}",
"\n",
"}",
"\n\n",
"return",
"GuestToolsState",
"(",
"state",
")",
",",
"nil",
"\n",
"}"
] |
22,088 | all-22089 | [
"Format",
"formats",
"the",
"node",
"."
] | [
"func",
"(",
"node",
"*",
"Update",
")",
"Format",
"(",
"buf",
"*",
"TrackedBuffer",
")",
"{",
"buf",
".",
"Myprintf",
"(",
"\"",
"\"",
",",
"<mask>",
".",
"Comments",
",",
"node",
".",
"TableExprs",
",",
"node",
".",
"Exprs",
",",
"node",
".",
"Where",
",",
"node",
".",
"OrderBy",
",",
"node",
".",
"Limit",
")",
"\n",
"}"
] |
22,089 | all-22090 | [
"routineColor",
"returns",
"the",
"color",
"for",
"the",
"header",
"of",
"the",
"goroutines",
"bucket",
"."
] | [
"func",
"(",
"p",
"*",
"Palette",
")",
"routineColor",
"(",
"bucket",
"*",
"<mask>",
".",
"Bucket",
",",
"multipleBuckets",
"bool",
")",
"string",
"{",
"if",
"bucket",
".",
"First",
"&&",
"multipleBuckets",
"{",
"return",
"p",
".",
"RoutineFirst",
"\n",
"}",
"\n",
"return",
"p",
".",
"Routine",
"\n",
"}"
] |
22,090 | all-22091 | [
"CleanUrl",
"check",
"the",
"characteres",
"in",
"url",
"and",
"parser",
"it",
"with",
"url",
".",
"Parse",
".",
"If",
"url",
"is",
"ok",
"return",
"one",
"string",
"with",
"it",
"or",
"if",
"the",
"scheme",
"is",
"missing",
"return",
"the",
"url",
"and",
"an",
"error",
"."
] | [
"func",
"CleanUrl",
"(",
"rawurl",
"string",
",",
"min",
",",
"max",
"int",
")",
"(",
"string",
",",
"error",
")",
"{",
"err",
":=",
"CheckUrl",
"(",
"rawurl",
",",
"min",
",",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"e",
".",
"Forward",
"(",
"err",
")",
"\n",
"}",
"\n",
"u",
",",
"err",
":=",
"url",
".",
"Parse",
"(",
"rawurl",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"e",
".",
"Push",
"(",
"e",
".",
"New",
"(",
"ErrInvUrl",
")",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"u",
".",
"Scheme",
"==",
"\"",
"\"",
"{",
"return",
"u",
".",
"String",
"(",
")",
",",
"e",
".",
"New",
"(",
"ErrNoScheme",
")",
"\n",
"}",
"\n",
"return",
"u",
".",
"String",
"(",
")",
",",
"nil",
"\n",
"}"
] |
22,091 | all-22092 | [
"Step",
"1",
"is",
"the",
"removal",
"of",
"standard",
"suffixes",
"all",
"of",
"which",
"must",
"occur",
"in",
"RV",
".",
"Search",
"for",
"a",
"PERFECTIVE",
"GERUND",
"ending",
".",
"If",
"one",
"is",
"found",
"remove",
"it",
"and",
"that",
"is",
"then",
"the",
"end",
"of",
"step",
"1",
".",
"Otherwise",
"try",
"and",
"remove",
"a",
"REFLEXIVE",
"ending",
"and",
"then",
"search",
"in",
"turn",
"for",
"(",
"1",
")",
"an",
"ADJECTIVAL",
"(",
"2",
")",
"a",
"VERB",
"or",
"(",
"3",
")",
"a",
"NOUN",
"ending",
".",
"As",
"soon",
"as",
"one",
"of",
"the",
"endings",
"(",
"1",
")",
"to",
"(",
"3",
")",
"is",
"found",
"remove",
"it",
"and",
"terminate",
"step",
"1",
"."
] | [
"func",
"step1",
"(",
"word",
"*",
"snowballword",
".",
"SnowballWord",
")",
"bool",
"{",
"// `stop` will be used to signal early termination",
"var",
"stop",
"bool",
"\n\n",
"// Search for a PERFECTIVE GERUND ending",
"stop",
"=",
"removePerfectiveGerundEnding",
"(",
"word",
")",
"\n",
"if",
"stop",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"// Next remove reflexive endings",
"word",
".",
"RemoveFirstSuffixIn",
"(",
"word",
".",
"RVstart",
",",
"\"",
" ",
"\"",
"ь",
"",
"",
"\n\n",
"// Next remove adjectival endings",
"stop",
"=",
"removeAdjectivalEnding",
"(",
"word",
")",
"\n",
"if",
"stop",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"// Next remove verb endings",
"stop",
"=",
"removeVerbEnding",
"(",
"word",
")",
"\n",
"if",
"stop",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"// Next remove noun endings",
"suffix",
",",
"_",
":=",
"word",
".",
"RemoveFirstSuffixIn",
"(",
"word",
".",
"RVstart",
",",
"\"",
"я",
"м",
"\"",
"\"",
",",
"\"",
"\"",
"и",
"м",
"й",
"\"",
" ",
" ",
"\"",
"х",
"",
"",
"",
"",
"",
"",
"",
"",
"\"",
" ",
"\"",
"я",
"ь",
"ю",
",",
"\"",
",",
"\"",
" ",
"\"",
"й",
"о",
"в",
",",
"\"",
",",
"\"",
"",
"",
"",
"",
"",
"",
"",
"",
"\"",
" ",
"\"",
"и",
"и",
"е",
",",
"\"",
",",
"\"",
" ",
"\"",
"и",
"е",
"в",
",",
"\"",
",",
"\"",
"",
"",
"",
"",
"",
"",
"",
"",
"\"",
",",
" ",
"ю",
" ",
"\"",
"\"",
"\"",
"ы",
",",
"у",
"\"",
" ",
"\"",
",",
"\"",
",",
" ",
"и",
" ",
"\"",
"\"",
"\"",
"а",
",",
"",
"",
"",
"",
"",
")",
"\n",
"if",
"suffix",
"!=",
"\"",
"\"",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
22,092 | all-22093 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"ClearGeolocationOverrideParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoEmulation18",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
22,093 | all-22094 | [
"newDummyClient",
"creates",
"a",
"in",
"memory",
"client",
"representation",
"for",
"testing",
"such",
"that",
"we",
"do",
"not",
"need",
"to",
"use",
"a",
"kubernetes",
"API",
"Server",
"."
] | [
"func",
"newDummyClient",
"(",
"t",
"Type",
")",
"*",
"dummyClient",
"{",
"c",
":=",
"&",
"dummyClient",
"{",
"t",
":",
"t",
",",
"objects",
":",
"make",
"(",
"<mask>",
"[",
"string",
"]",
"Object",
")",
",",
"}",
"\n",
"return",
"c",
"\n",
"}"
] |
22,094 | all-22095 | [
"ListBuilds",
"returns",
"a",
"list",
"of",
"all",
"Jenkins",
"builds",
"for",
"the",
"provided",
"jobs",
"(",
"both",
"scheduled",
"and",
"enqueued",
")",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListBuilds",
"(",
"jobs",
"[",
"]",
"BuildQueryParams",
")",
"(",
"map",
"[",
"string",
"]",
"Build",
",",
"error",
")",
"{",
"// Get queued builds.",
"jenkinsBuilds",
",",
"err",
":=",
"c",
".",
"GetEnqueuedBuilds",
"(",
"jobs",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"buildChan",
":=",
"make",
"(",
"chan",
"map",
"[",
"string",
"]",
"Build",
",",
"len",
"(",
"jobs",
")",
")",
"\n",
"errChan",
":=",
"make",
"(",
"chan",
"error",
",",
"len",
"(",
"jobs",
")",
")",
"\n",
"wg",
":=",
"&",
"sync",
".",
"WaitGroup",
"{",
"}",
"\n",
"wg",
".",
"Add",
"(",
"len",
"(",
"jobs",
")",
")",
"\n\n",
"// Get all running builds for all provided jobs.",
"for",
"_",
",",
"job",
":=",
"range",
"jobs",
"{",
"// Start a goroutine per list",
"go",
"func",
"(",
"job",
"string",
")",
"{",
"defer",
"wg",
".",
"Done",
"(",
")",
"\n\n",
"builds",
",",
"err",
":=",
"c",
".",
"GetBuilds",
"(",
"job",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"errChan",
"<-",
"err",
"\n",
"}",
"else",
"{",
"buildChan",
"<-",
"builds",
"\n",
"}",
"\n",
"}",
"(",
"job",
".",
"JobName",
")",
"\n",
"}",
"\n",
"wg",
".",
"Wait",
"(",
")",
"\n\n",
"close",
"(",
"buildChan",
")",
"\n",
"close",
"(",
"errChan",
")",
"\n\n",
"for",
"err",
":=",
"range",
"errChan",
"{",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"for",
"builds",
":=",
"range",
"buildChan",
"{",
"for",
"<mask>",
",",
"build",
":=",
"range",
"builds",
"{",
"jenkinsBuilds",
"[",
"id",
"]",
"=",
"build",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"jenkinsBuilds",
",",
"nil",
"\n",
"}"
] |
22,095 | all-22096 | [
"GetEvaluationTimestamp",
"returns",
"the",
"time",
"the",
"last",
"evaluation",
"of",
"the",
"rule",
"group",
"took",
"place",
"."
] | [
"func",
"(",
"g",
"*",
"Group",
")",
"GetEvaluationTimestamp",
"(",
")",
"<mask>",
".",
"Time",
"{",
"g",
".",
"mtx",
".",
"Lock",
"(",
")",
"\n",
"defer",
"g",
".",
"mtx",
".",
"Unlock",
"(",
")",
"\n",
"return",
"g",
".",
"evaluationTimestamp",
"\n",
"}"
] |
22,096 | all-22097 | [
"withStateLock",
"performs",
"an",
"action",
"with",
"the",
"connection",
"state",
"mutex",
"locked"
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"withStateLock",
"(",
"f",
"func",
"(",
")",
"error",
")",
"error",
"{",
"c",
".",
"stateMut",
".",
"Lock",
"(",
")",
"\n",
"err",
":=",
"f",
"(",
")",
"\n",
"c",
".",
"stateMut",
".",
"Unlock",
"(",
")",
"\n\n",
"return",
"err",
"\n",
"}"
] |
22,097 | all-22098 | [
"UnmarshalText",
"parses",
"a",
"text",
"representation",
"into",
"a",
"date",
"type"
] | [
"func",
"(",
"d",
"*",
"Date",
")",
"UnmarshalText",
"(",
"text",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"len",
"(",
"text",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"dd",
",",
"err",
":=",
"time",
".",
"Parse",
"(",
"RFC3339FullDate",
",",
"string",
"(",
"text",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"*",
"d",
"=",
"<mask>",
"(",
"dd",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
22,098 | all-22099 | [
"RequestPhase",
"is",
"a",
"wrapper",
"around",
"gdk_frame_clock_request_phase",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"FrameClock",
")",
"RequestPhase",
"(",
"<mask>",
"ClockPhase",
")",
"{",
"C",
".",
"gdk_frame_clock_request_phase",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GdkFrameClockPhase",
"(",
"phase",
")",
")",
"\n",
"}"
] |
22,099 | all-22100 | [
"GetType",
"returns",
"the",
"Type",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"m",
"*",
"Monitor",
")",
"GetType",
"(",
")",
"string",
"{",
"if",
"m",
"==",
"nil",
"||",
"m",
".",
"Type",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"m",
".",
"<mask>",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.