id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
9,400 | all-9401 | [
"isResultPointer",
"returns",
"whether",
"the",
"result",
"for",
"this",
"method",
"is",
"a",
"pointer",
"."
] | [
"func",
"(",
"s",
"*",
"State",
")",
"isResultPointer",
"(",
"thriftType",
"*",
"<mask>",
".",
"Type",
")",
"bool",
"{",
"_",
",",
"basicGoType",
":=",
"thriftToGo",
"[",
"s",
".",
"rootType",
"(",
"thriftType",
")",
".",
"Name",
"]",
"\n",
"return",
"!",
"basicGoType",
"\n",
"}"
] |
9,401 | all-9402 | [
"Walk",
"implements",
"the",
"corresponding",
"method",
"in",
"the",
"Client",
"interface"
] | [
"func",
"(",
"o",
"*",
"tracingObjClient",
")",
"Walk",
"(",
"ctx",
"context",
".",
"Context",
",",
"prefix",
"string",
",",
"fn",
"func",
"(",
"name",
"string",
")",
"error",
")",
"error",
"{",
"span",
",",
"ctx",
":=",
"tracing",
".",
"AddSpanToAnyExisting",
"(",
"ctx",
",",
"o",
".",
"provider",
"+",
"\"",
"\"",
",",
"\"",
"\"",
",",
"<mask>",
")",
"\n",
"defer",
"tracing",
".",
"FinishAnySpan",
"(",
"span",
")",
"\n",
"return",
"o",
".",
"Client",
".",
"Walk",
"(",
"ctx",
",",
"prefix",
",",
"fn",
")",
"\n",
"}"
] |
9,402 | all-9403 | [
"DrawImage",
"draws",
"the",
"given",
"image",
"on",
"the",
"image",
"i",
".",
"DrawImage",
"accepts",
"the",
"options",
".",
"For",
"details",
"see",
"the",
"document",
"of",
"DrawImageOptions",
".",
"For",
"drawing",
"the",
"pixels",
"of",
"the",
"argument",
"image",
"at",
"the",
"time",
"of",
"this",
"call",
"is",
"adopted",
".",
"Even",
"if",
"the",
"argument",
"image",
"is",
"mutated",
"after",
"this",
"call",
"the",
"drawing",
"result",
"is",
"never",
"affected",
".",
"When",
"the",
"image",
"i",
"is",
"disposed",
"DrawImage",
"does",
"nothing",
".",
"When",
"the",
"given",
"image",
"img",
"is",
"disposed",
"DrawImage",
"panics",
".",
"When",
"the",
"given",
"image",
"is",
"as",
"same",
"as",
"i",
"DrawImage",
"panics",
".",
"DrawImage",
"works",
"more",
"efficiently",
"as",
"batches",
"when",
"the",
"successive",
"calls",
"of",
"DrawImages",
"satisfy",
"the",
"below",
"conditions",
":",
"*",
"All",
"render",
"targets",
"are",
"same",
"(",
"A",
"in",
"A",
".",
"DrawImage",
"(",
"B",
"op",
"))",
"*",
"Either",
"all",
"ColorM",
"element",
"values",
"are",
"same",
"or",
"all",
"the",
"ColorM",
"have",
"only",
"diagonal",
"(",
"scale",
")",
"elements",
"*",
"If",
"only",
"(",
"*",
"ColorM",
")",
".",
"Scale",
"is",
"applied",
"to",
"a",
"ColorM",
"the",
"ColorM",
"has",
"only",
"diagonal",
"elements",
".",
"The",
"other",
"ColorM",
"functions",
"might",
"modify",
"the",
"other",
"elements",
".",
"*",
"All",
"CompositeMode",
"values",
"are",
"same",
"*",
"All",
"Filter",
"values",
"are",
"same",
"Even",
"when",
"all",
"the",
"above",
"conditions",
"are",
"satisfied",
"multiple",
"draw",
"commands",
"can",
"be",
"used",
"in",
"really",
"rare",
"cases",
".",
"Ebiten",
"images",
"usually",
"share",
"an",
"internal",
"automatic",
"texture",
"atlas",
"but",
"when",
"you",
"consume",
"the",
"atlas",
"or",
"you",
"create",
"a",
"huge",
"image",
"those",
"images",
"cannot",
"be",
"on",
"the",
"same",
"texture",
"atlas",
".",
"In",
"this",
"case",
"draw",
"commands",
"are",
"separated",
".",
"The",
"texture",
"atlas",
"size",
"is",
"4096x4096",
"so",
"far",
".",
"Another",
"case",
"is",
"when",
"you",
"use",
"an",
"offscreen",
"as",
"a",
"render",
"source",
".",
"An",
"offscreen",
"doesn",
"t",
"share",
"the",
"texture",
"atlas",
"with",
"high",
"probability",
".",
"For",
"more",
"performance",
"tips",
"see",
"https",
":",
"//",
"github",
".",
"com",
"/",
"hajimehoshi",
"/",
"ebiten",
"/",
"wiki",
"/",
"Performance",
"-",
"Tips",
".",
"DrawImage",
"always",
"returns",
"nil",
"as",
"of",
"1",
".",
"5",
".",
"0",
"-",
"alpha",
"."
] | [
"func",
"(",
"i",
"*",
"Image",
")",
"DrawImage",
"(",
"img",
"*",
"Image",
",",
"options",
"*",
"DrawImageOptions",
")",
"error",
"{",
"i",
".",
"drawImage",
"(",
"img",
",",
"<mask>",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
9,403 | all-9404 | [
"populateDiscardStats",
"populates",
"vlog",
".",
"lfDiscardStats",
"This",
"function",
"will",
"be",
"called",
"while",
"initializing",
"valueLog"
] | [
"func",
"(",
"vlog",
"*",
"valueLog",
")",
"populateDiscardStats",
"(",
")",
"error",
"{",
"discardStatsKey",
":=",
"y",
".",
"KeyWithTs",
"(",
"lfDiscardStatsKey",
",",
"math",
".",
"MaxUint64",
")",
"\n",
"<mask>",
",",
"err",
":=",
"vlog",
".",
"db",
".",
"get",
"(",
"discardStatsKey",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// check if value is Empty",
"if",
"vs",
".",
"Value",
"==",
"nil",
"||",
"len",
"(",
"vs",
".",
"Value",
")",
"==",
"0",
"{",
"vlog",
".",
"lfDiscardStats",
"=",
"&",
"lfDiscardStats",
"{",
"m",
":",
"make",
"(",
"map",
"[",
"uint32",
"]",
"int64",
")",
"}",
"\n",
"return",
"nil",
"\n",
"}",
"\n\n",
"var",
"statsMap",
"map",
"[",
"uint32",
"]",
"int64",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"vs",
".",
"Value",
",",
"&",
"statsMap",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"vlog",
".",
"opt",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"statsMap",
")",
"\n",
"vlog",
".",
"lfDiscardStats",
"=",
"&",
"lfDiscardStats",
"{",
"m",
":",
"statsMap",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
9,404 | all-9405 | [
"IsExist",
"indicates",
"whether",
"the",
"agent",
"settings",
"for",
"a",
"given",
"instance",
"ID",
"exists",
"w",
"/",
"i",
"empty",
"."
] | [
"func",
"(",
"c",
"*",
"FakeClient",
")",
"IsExist",
"(",
"instanceID",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"c",
".",
"IsExistCalled",
"=",
"<mask>",
"\n",
"return",
"c",
".",
"Exist",
",",
"c",
".",
"IsExistErr",
"\n",
"}"
] |
9,405 | all-9406 | [
"HasLabel",
"checks",
"if",
"label",
"is",
"in",
"the",
"label",
"set",
"issueLabels",
"."
] | [
"func",
"HasLabel",
"(",
"label",
"string",
",",
"issueLabels",
"[",
"]",
"Label",
")",
"bool",
"{",
"for",
"_",
",",
"l",
":=",
"range",
"issueLabels",
"{",
"if",
"strings",
".",
"ToLower",
"(",
"l",
".",
"Name",
")",
"==",
"strings",
".",
"ToLower",
"(",
"label",
")",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"<mask>",
"\n",
"}"
] |
9,406 | all-9407 | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"DNSEndpointSpec",
"."
] | [
"func",
"(",
"in",
"*",
"DNSEndpointSpec",
")",
"DeepCopy",
"(",
")",
"*",
"DNSEndpointSpec",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"DNSEndpointSpec",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"<mask>",
")",
"\n",
"return",
"out",
"\n",
"}"
] |
9,407 | all-9408 | [
"HTTPLogger",
"is",
"simple",
"http",
"access",
"logger"
] | [
"func",
"(",
"g",
"*",
"Glg",
")",
"HTTPLogger",
"(",
"name",
"string",
",",
"handler",
"http",
".",
"Handler",
")",
"http",
".",
"Handler",
"{",
"return",
"g",
".",
"HTTPLoggerFunc",
"(",
"name",
",",
"<mask>",
".",
"ServeHTTP",
")",
"\n",
"}"
] |
9,408 | all-9409 | [
"Min",
"returns",
"the",
"smallest",
"value",
"in",
"the",
"total",
"range"
] | [
"func",
"(",
"l",
"*",
"InclusiveRanges",
")",
"Min",
"(",
")",
"int",
"{",
"val",
":=",
"l",
".",
"Start",
"(",
")",
"\n",
"for",
"_",
",",
"aRange",
":=",
"range",
"l",
".",
"<mask>",
"{",
"next",
":=",
"aRange",
".",
"Min",
"(",
")",
"\n",
"if",
"next",
"<",
"val",
"{",
"val",
"=",
"next",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"val",
"\n",
"}"
] |
9,409 | all-9410 | [
"metric",
"parses",
"a",
"metric",
".",
"<label_set",
">",
"<metric_identifier",
">",
"[",
"<label_set",
">",
"]"
] | [
"func",
"(",
"p",
"*",
"parser",
")",
"metric",
"(",
")",
"labels",
".",
"Labels",
"{",
"name",
":=",
"\"",
"\"",
"\n",
"var",
"m",
"labels",
".",
"Labels",
"\n\n",
"t",
":=",
"p",
".",
"peek",
"(",
")",
".",
"typ",
"\n",
"if",
"t",
"==",
"ItemIdentifier",
"||",
"t",
"==",
"ItemMetricIdentifier",
"{",
"name",
"=",
"p",
".",
"next",
"(",
")",
".",
"val",
"\n",
"t",
"=",
"p",
".",
"peek",
"(",
")",
".",
"typ",
"\n",
"}",
"\n",
"if",
"t",
"!=",
"ItemLeftBrace",
"&&",
"name",
"==",
"\"",
"\"",
"{",
"p",
".",
"errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"t",
"==",
"ItemLeftBrace",
"{",
"m",
"=",
"p",
".",
"labelSet",
"(",
")",
"\n",
"}",
"\n",
"if",
"name",
"!=",
"\"",
"\"",
"{",
"m",
"=",
"append",
"(",
"m",
",",
"labels",
".",
"Label",
"{",
"Name",
":",
"labels",
".",
"MetricName",
",",
"Value",
":",
"<mask>",
"}",
")",
"\n",
"sort",
".",
"Sort",
"(",
"m",
")",
"\n",
"}",
"\n",
"return",
"m",
"\n",
"}"
] |
9,410 | all-9411 | [
"expandCustomizationIdentification",
"reads",
"certain",
"ResourceData",
"keys",
"and",
"returns",
"a",
"CustomizationIdentification",
"."
] | [
"func",
"expandCustomizationIdentification",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
")",
"types",
".",
"CustomizationIdentification",
"{",
"obj",
":=",
"types",
".",
"CustomizationIdentification",
"{",
"JoinWorkgroup",
":",
"d",
".",
"Get",
"(",
"cWindowsKeyPrefix",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
")",
".",
"(",
"string",
")",
",",
"JoinDomain",
":",
"d",
".",
"Get",
"(",
"cWindowsKeyPrefix",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
")",
".",
"(",
"string",
")",
",",
"DomainAdmin",
":",
"d",
".",
"Get",
"(",
"cWindowsKeyPrefix",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
")",
".",
"(",
"string",
")",
",",
"}",
"\n",
"if",
"v",
",",
"ok",
":=",
"d",
".",
"GetOk",
"(",
"cWindowsKeyPrefix",
"+",
"\"",
"\"",
"+",
"\"",
"\"",
")",
";",
"ok",
"{",
"obj",
".",
"DomainAdminPassword",
"=",
"&",
"types",
".",
"CustomizationPassword",
"{",
"Value",
":",
"v",
".",
"(",
"string",
")",
",",
"PlainText",
":",
"<mask>",
",",
"}",
"\n",
"}",
"\n",
"return",
"obj",
"\n",
"}"
] |
9,411 | all-9412 | [
"GetLastTriggeredTs",
"returns",
"the",
"LastTriggeredTs",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"g",
"*",
"GroupData",
")",
"GetLastTriggeredTs",
"(",
")",
"int",
"{",
"if",
"g",
"==",
"nil",
"||",
"g",
".",
"LastTriggeredTs",
"==",
"nil",
"{",
"<mask>",
"0",
"\n",
"}",
"\n",
"return",
"*",
"g",
".",
"LastTriggeredTs",
"\n",
"}"
] |
9,412 | all-9413 | [
"flattenLinkDiscoveryProtocolConfig",
"reads",
"various",
"fields",
"from",
"a",
"LinkDiscoveryProtocolConfig",
"into",
"the",
"passed",
"in",
"ResourceData",
"."
] | [
"func",
"flattenLinkDiscoveryProtocolConfig",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"obj",
"*",
"<mask>",
".",
"LinkDiscoveryProtocolConfig",
")",
"error",
"{",
"d",
".",
"Set",
"(",
"\"",
"\"",
",",
"obj",
".",
"Operation",
")",
"\n",
"d",
".",
"Set",
"(",
"\"",
"\"",
",",
"obj",
".",
"Protocol",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
9,413 | all-9414 | [
"HasNoGroupHosts",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TileDef",
")",
"HasNoGroupHosts",
"(",
")",
"bool",
"{",
"if",
"t",
"!=",
"nil",
"&&",
"t",
".",
"NoGroupHosts",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
9,414 | all-9415 | [
"FileChooserDialogNewWith1Button",
"is",
"a",
"wrapper",
"around",
"gtk_file_chooser_dialog_new",
"()",
"with",
"one",
"button",
"."
] | [
"func",
"FileChooserDialogNewWith1Button",
"(",
"title",
"string",
",",
"<mask>",
"*",
"Window",
",",
"action",
"FileChooserAction",
",",
"first_button_text",
"string",
",",
"first_button_id",
"ResponseType",
")",
"(",
"*",
"FileChooserDialog",
",",
"error",
")",
"{",
"c_title",
":=",
"C",
".",
"CString",
"(",
"title",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"c_title",
")",
")",
"\n",
"c_first_button_text",
":=",
"C",
".",
"CString",
"(",
"first_button_text",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"c_first_button_text",
")",
")",
"\n",
"c",
":=",
"C",
".",
"gtk_file_chooser_dialog_new_1",
"(",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"c_title",
")",
",",
"parent",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkFileChooserAction",
"(",
"action",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"c_first_button_text",
")",
",",
"C",
".",
"int",
"(",
"first_button_id",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"obj",
":=",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"\n",
"return",
"wrapFileChooserDialog",
"(",
"obj",
")",
",",
"nil",
"\n",
"}"
] |
9,415 | all-9416 | [
"ConsistentlyWithOffset",
"operates",
"like",
"Consistnetly",
"but",
"takes",
"an",
"additional",
"initial",
"argument",
"to",
"indicate",
"an",
"offset",
"in",
"the",
"call",
"stack",
".",
"This",
"is",
"useful",
"when",
"building",
"helper",
"functions",
"that",
"contain",
"matchers",
".",
"To",
"learn",
"more",
"read",
"about",
"ExpectWithOffset",
"."
] | [
"func",
"ConsistentlyWithOffset",
"(",
"<mask>",
"int",
",",
"actual",
"interface",
"{",
"}",
",",
"intervals",
"...",
"interface",
"{",
"}",
")",
"AsyncAssertion",
"{",
"if",
"globalFailWrapper",
"==",
"nil",
"{",
"panic",
"(",
"nilFailHandlerPanic",
")",
"\n",
"}",
"\n",
"timeoutInterval",
":=",
"defaultConsistentlyDuration",
"\n",
"pollingInterval",
":=",
"defaultConsistentlyPollingInterval",
"\n",
"if",
"len",
"(",
"intervals",
")",
">",
"0",
"{",
"timeoutInterval",
"=",
"toDuration",
"(",
"intervals",
"[",
"0",
"]",
")",
"\n",
"}",
"\n",
"if",
"len",
"(",
"intervals",
")",
">",
"1",
"{",
"pollingInterval",
"=",
"toDuration",
"(",
"intervals",
"[",
"1",
"]",
")",
"\n",
"}",
"\n",
"return",
"asyncassertion",
".",
"New",
"(",
"asyncassertion",
".",
"AsyncAssertionTypeConsistently",
",",
"actual",
",",
"globalFailWrapper",
",",
"timeoutInterval",
",",
"pollingInterval",
",",
"offset",
")",
"\n",
"}"
] |
9,416 | all-9417 | [
"LegalPos",
"returns",
"the",
"legal",
"index",
"positions",
"[",
"a0",
"aLast",
"]",
"and",
"[",
"b0",
"bLast",
"]",
"inclusive",
"where",
"the",
"[",
"a0",
"aLast",
"]",
"holds",
"the",
"first",
"FIFO",
"ordered",
"segment",
"and",
"the",
"[",
"b0",
"bLast",
"]",
"holds",
"the",
"second",
"ordered",
"segment",
"if",
"any",
".",
"A",
"position",
"of",
"-",
"1",
"means",
"the",
"segment",
"is",
"not",
"used",
"perhaps",
"because",
"b",
".",
"Readable",
"is",
"zero",
"or",
"because",
"the",
"second",
"segment",
"[",
"b0",
"bLast",
"]",
"is",
"not",
"in",
"use",
"(",
"when",
"everything",
"fits",
"in",
"the",
"first",
"[",
"a0",
"aLast",
"]",
"segment",
")",
"."
] | [
"func",
"(",
"b",
"*",
"FixedSizeRingBuf",
")",
"LegalPos",
"(",
")",
"(",
"a0",
",",
"aLast",
",",
"b0",
",",
"bLast",
"int",
")",
"{",
"a0",
"=",
"-",
"1",
"\n",
"aLast",
"=",
"-",
"1",
"\n",
"b0",
"=",
"-",
"1",
"\n",
"bLast",
"=",
"-",
"1",
"\n",
"if",
"b",
".",
"Readable",
"==",
"0",
"{",
"return",
"\n",
"}",
"\n",
"a0",
"=",
"b",
".",
"Beg",
"\n",
"<mask>",
":=",
"b",
".",
"Beg",
"+",
"b",
".",
"Readable",
"-",
"1",
"\n",
"if",
"last",
"<",
"b",
".",
"N",
"{",
"aLast",
"=",
"last",
"\n",
"return",
"\n",
"}",
"\n",
"aLast",
"=",
"b",
".",
"N",
"-",
"1",
"\n",
"b0",
"=",
"0",
"\n",
"bLast",
"=",
"last",
"%",
"b",
".",
"N",
"\n",
"return",
"\n",
"}"
] |
9,417 | all-9418 | [
"resourceVSphereComputeClusterReadCustomAttributes",
"reads",
"the",
"custom",
"attributes",
"for",
"vsphere_compute_cluster",
"."
] | [
"func",
"resourceVSphereComputeClusterReadCustomAttributes",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"meta",
"interface",
"{",
"}",
",",
"cluster",
"*",
"object",
".",
"ClusterComputeResource",
",",
")",
"error",
"{",
"client",
":=",
"meta",
".",
"(",
"*",
"VSphereClient",
")",
".",
"vimClient",
"\n",
"// Read custom attributes",
"if",
"customattribute",
".",
"IsSupported",
"(",
"<mask>",
")",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"resourceVSphereComputeClusterIDString",
"(",
"d",
")",
")",
"\n",
"props",
",",
"err",
":=",
"clustercomputeresource",
".",
"Properties",
"(",
"cluster",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"customattribute",
".",
"ReadFromResource",
"(",
"client",
",",
"props",
".",
"Entity",
"(",
")",
",",
"d",
")",
"\n",
"}",
"else",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"resourceVSphereComputeClusterIDString",
"(",
"d",
")",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
9,418 | all-9419 | [
"ValidEnum",
"validates",
"a",
"proposed",
"value",
"for",
"this",
"enum",
".",
"Implements",
"the",
"Enum",
"interface",
"for",
"ManageOfferEffect"
] | [
"func",
"(",
"e",
"ManageOfferEffect",
")",
"ValidEnum",
"(",
"v",
"int32",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"manageOfferEffectMap",
"[",
"v",
"]",
"\n",
"return",
"<mask>",
"\n",
"}"
] |
9,419 | all-9420 | [
"Revoke",
"removes",
"a",
"set",
"of",
"permissions",
"to",
"the",
"permission",
"object",
"on",
"which",
"it",
"is",
"called",
"returning",
"a",
"new",
"permission",
"object",
"."
] | [
"func",
"(",
"p",
"Permissions",
")",
"Revoke",
"(",
"lg",
"*",
"zap",
".",
"Logger",
",",
"n",
"*",
"Permissions",
")",
"(",
"Permissions",
",",
"error",
")",
"{",
"var",
"out",
"Permissions",
"\n",
"<mask>",
"err",
"error",
"\n",
"if",
"n",
"==",
"nil",
"{",
"return",
"p",
",",
"nil",
"\n",
"}",
"\n",
"out",
".",
"KV",
",",
"err",
"=",
"p",
".",
"KV",
".",
"Revoke",
"(",
"lg",
",",
"n",
".",
"KV",
")",
"\n",
"return",
"out",
",",
"err",
"\n",
"}"
] |
9,420 | all-9421 | [
"Return",
"non",
"-",
"array",
"values"
] | [
"func",
"get",
"(",
"values",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"key",
"string",
")",
"interface",
"{",
"}",
"{",
"if",
"len",
"(",
"key",
")",
"==",
"0",
"||",
"values",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"key",
"=",
"strings",
".",
"ToLower",
"(",
"key",
")",
"\n",
"val",
",",
"<mask>",
":=",
"values",
"[",
"key",
"]",
"\n\n",
"if",
"ok",
"{",
"switch",
"val",
".",
"(",
"type",
")",
"{",
"case",
"[",
"]",
"interface",
"{",
"}",
":",
"return",
"nil",
"\n",
"default",
":",
"return",
"val",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
9,421 | all-9422 | [
"NewLedgerEntryChange",
"creates",
"a",
"new",
"LedgerEntryChange",
"."
] | [
"func",
"NewLedgerEntryChange",
"(",
"aType",
"LedgerEntryChangeType",
",",
"value",
"interface",
"{",
"}",
")",
"(",
"result",
"LedgerEntryChange",
",",
"err",
"error",
")",
"{",
"result",
".",
"Type",
"=",
"aType",
"\n",
"switch",
"LedgerEntryChangeType",
"(",
"aType",
")",
"{",
"case",
"LedgerEntryChangeTypeLedgerEntryCreated",
":",
"tv",
",",
"ok",
":=",
"value",
".",
"(",
"LedgerEntry",
")",
"\n",
"if",
"!",
"ok",
"{",
"err",
"=",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
"result",
".",
"Created",
"=",
"&",
"tv",
"\n",
"case",
"LedgerEntryChangeTypeLedgerEntryUpdated",
":",
"tv",
",",
"ok",
":=",
"value",
".",
"(",
"LedgerEntry",
")",
"\n",
"if",
"!",
"ok",
"{",
"err",
"=",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
"result",
".",
"Updated",
"=",
"&",
"<mask>",
"\n",
"case",
"LedgerEntryChangeTypeLedgerEntryRemoved",
":",
"tv",
",",
"ok",
":=",
"value",
".",
"(",
"LedgerKey",
")",
"\n",
"if",
"!",
"ok",
"{",
"err",
"=",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
"result",
".",
"Removed",
"=",
"&",
"tv",
"\n",
"case",
"LedgerEntryChangeTypeLedgerEntryState",
":",
"tv",
",",
"ok",
":=",
"value",
".",
"(",
"LedgerEntry",
")",
"\n",
"if",
"!",
"ok",
"{",
"err",
"=",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
"result",
".",
"State",
"=",
"&",
"tv",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
9,422 | all-9423 | [
"GetAll",
"get",
"all",
"Points",
"from",
"the",
"index",
"as",
"a",
"map",
"from",
"id",
"to",
"point"
] | [
"func",
"(",
"points",
"*",
"PointsIndex",
")",
"GetAll",
"(",
")",
"map",
"[",
"string",
"]",
"Point",
"{",
"newpoints",
":=",
"<mask>",
"(",
"map",
"[",
"string",
"]",
"Point",
",",
"0",
")",
"\n",
"for",
"i",
",",
"p",
":=",
"range",
"points",
".",
"currentPosition",
"{",
"newpoints",
"[",
"i",
"]",
"=",
"p",
"\n",
"}",
"\n",
"return",
"newpoints",
"\n",
"}"
] |
9,423 | all-9424 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"ReferrerPolicy",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"ReferrerPolicy",
"(",
"in",
".",
"String",
"(",
")",
")",
"{",
"case",
"ReferrerPolicyUnsafeURL",
":",
"*",
"t",
"=",
"ReferrerPolicyUnsafeURL",
"\n",
"case",
"ReferrerPolicyNoReferrerWhenDowngrade",
":",
"*",
"t",
"=",
"ReferrerPolicyNoReferrerWhenDowngrade",
"\n",
"case",
"ReferrerPolicyNoReferrer",
":",
"*",
"t",
"=",
"ReferrerPolicyNoReferrer",
"\n",
"case",
"ReferrerPolicyOrigin",
":",
"*",
"t",
"=",
"ReferrerPolicyOrigin",
"\n",
"case",
"ReferrerPolicyOriginWhenCrossOrigin",
":",
"*",
"t",
"=",
"ReferrerPolicyOriginWhenCrossOrigin",
"\n",
"case",
"ReferrerPolicySameOrigin",
":",
"*",
"t",
"=",
"ReferrerPolicySameOrigin",
"\n",
"case",
"ReferrerPolicyStrictOrigin",
":",
"*",
"t",
"=",
"ReferrerPolicyStrictOrigin",
"\n",
"case",
"ReferrerPolicyStrictOriginWhenCrossOrigin",
":",
"*",
"t",
"=",
"ReferrerPolicyStrictOriginWhenCrossOrigin",
"\n\n",
"<mask>",
":",
"in",
".",
"AddError",
"(",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"}"
] |
9,424 | all-9425 | [
"Serve",
"accepts",
"an",
"incoming",
"TELNET",
"or",
"TELNETS",
"client",
"connection",
"on",
"the",
"net",
".",
"Listener",
"listener",
"."
] | [
"func",
"Serve",
"(",
"listener",
"net",
".",
"Listener",
",",
"handler",
"<mask>",
")",
"error",
"{",
"server",
":=",
"&",
"Server",
"{",
"Handler",
":",
"handler",
"}",
"\n",
"return",
"server",
".",
"Serve",
"(",
"listener",
")",
"\n",
"}"
] |
9,425 | all-9426 | [
"SetCookie",
"sets",
"a",
"cookie",
"with",
"the",
"given",
"cookie",
"data",
";",
"may",
"overwrite",
"equivalent",
"cookies",
"if",
"they",
"exist",
".",
"See",
":",
"https",
":",
"//",
"chromedevtools",
".",
"github",
".",
"io",
"/",
"devtools",
"-",
"protocol",
"/",
"tot",
"/",
"Network#method",
"-",
"setCookie",
"parameters",
":",
"name",
"-",
"Cookie",
"name",
".",
"value",
"-",
"Cookie",
"value",
"."
] | [
"func",
"SetCookie",
"(",
"name",
"string",
",",
"value",
"string",
")",
"*",
"SetCookieParams",
"{",
"return",
"&",
"SetCookieParams",
"{",
"<mask>",
":",
"name",
",",
"Value",
":",
"value",
",",
"}",
"\n",
"}"
] |
9,426 | all-9427 | [
"SetRegistryAuthCredentials",
"sets",
"the",
"credentials",
"for",
"pulling",
"image",
"from",
"ECR"
] | [
"func",
"(",
"c",
"*",
"Container",
")",
"SetRegistryAuthCredentials",
"(",
"credential",
"credentials",
".",
"IAMRoleCredentials",
")",
"{",
"c",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"<mask>",
".",
"Unlock",
"(",
")",
"\n\n",
"c",
".",
"RegistryAuthentication",
".",
"ECRAuthData",
".",
"SetPullCredentials",
"(",
"credential",
")",
"\n",
"}"
] |
9,427 | all-9428 | [
"GetAggrOk",
"returns",
"a",
"tuple",
"with",
"the",
"Aggr",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"Series",
")",
"GetAggrOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"Aggr",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"s",
".",
"Aggr",
",",
"<mask>",
"\n",
"}"
] |
9,428 | all-9429 | [
"Scan",
"read",
"a",
"value",
"from",
"a",
"database",
"driver"
] | [
"func",
"(",
"h",
"*",
"Hostname",
")",
"Scan",
"(",
"raw",
"<mask>",
"{",
"}",
")",
"error",
"{",
"switch",
"v",
":=",
"raw",
".",
"(",
"type",
")",
"{",
"case",
"[",
"]",
"byte",
":",
"*",
"h",
"=",
"Hostname",
"(",
"string",
"(",
"v",
")",
")",
"\n",
"case",
"string",
":",
"*",
"h",
"=",
"Hostname",
"(",
"v",
")",
"\n",
"default",
":",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"v",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
9,429 | all-9430 | [
"When",
"you",
"create",
"or",
"delete",
"a",
"file",
"you",
"have",
"to",
"ensure",
"the",
"directory",
"entry",
"for",
"the",
"file",
"is",
"synced",
"in",
"order",
"to",
"guarantee",
"the",
"file",
"is",
"visible",
"(",
"if",
"the",
"system",
"crashes",
")",
".",
"(",
"See",
"the",
"man",
"page",
"for",
"fsync",
"or",
"see",
"https",
":",
"//",
"github",
".",
"com",
"/",
"coreos",
"/",
"etcd",
"/",
"issues",
"/",
"6368",
"for",
"an",
"example",
".",
")"
] | [
"func",
"syncDir",
"(",
"dir",
"string",
")",
"error",
"{",
"f",
",",
"err",
":=",
"openDir",
"(",
"dir",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
",",
"dir",
")",
"\n",
"}",
"\n",
"err",
"=",
"f",
".",
"Sync",
"(",
")",
"\n",
"closeErr",
":=",
"f",
".",
"Close",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"<mask>",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
",",
"dir",
")",
"\n",
"}",
"\n",
"return",
"errors",
".",
"Wrapf",
"(",
"closeErr",
",",
"\"",
"\"",
",",
"dir",
")",
"\n",
"}"
] |
9,430 | all-9431 | [
"Run",
"starts",
"the",
"job"
] | [
"func",
"(",
"config",
"*",
"Config",
")",
"Run",
"(",
")",
"{",
"err",
":=",
"config",
".",
"ensureLock",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"<mask>",
")",
"\n",
"}",
"\n",
"err",
"=",
"config",
".",
"runWorker",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
")",
"\n",
"}",
"\n",
"}"
] |
9,431 | all-9432 | [
"NewSetCommand",
"returns",
"the",
"CLI",
"command",
"for",
"set",
"."
] | [
"func",
"NewSetCommand",
"(",
")",
"cli",
".",
"Command",
"{",
"return",
"cli",
".",
"Command",
"{",
"Name",
":",
"\"",
"\"",
",",
"Usage",
":",
"\"",
"\"",
",",
"ArgsUsage",
":",
"\"",
"\"",
",",
"Description",
":",
"`Set sets the value of a key.\n\n When <value> begins with '-', <value> is interpreted as a flag.\n Insert '--' for workaround:\n\n $ set -- <key> <value>`",
",",
"Flags",
":",
"[",
"]",
"cli",
".",
"Flag",
"{",
"cli",
".",
"IntFlag",
"{",
"Name",
":",
"\"",
"\"",
",",
"Value",
":",
"0",
",",
"Usage",
":",
"\"",
"\"",
"}",
",",
"cli",
".",
"StringFlag",
"{",
"Name",
":",
"\"",
"\"",
",",
"Value",
":",
"\"",
"\"",
",",
"Usage",
":",
"\"",
"\"",
"}",
",",
"cli",
".",
"IntFlag",
"{",
"Name",
":",
"\"",
"\"",
",",
"<mask>",
":",
"0",
",",
"Usage",
":",
"\"",
"\"",
"}",
",",
"}",
",",
"Action",
":",
"func",
"(",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"setCommandFunc",
"(",
"c",
",",
"mustNewKeyAPI",
"(",
"c",
")",
")",
"\n",
"return",
"nil",
"\n",
"}",
",",
"}",
"\n",
"}"
] |
9,432 | all-9433 | [
"Infof",
"records",
"the",
"log",
"with",
"info",
"level"
] | [
"func",
"(",
"l",
"*",
"Logger",
")",
"Infof",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"l",
".",
"Output",
"(",
"2",
",",
"LevelInfo",
",",
"fmt",
".",
"Sprintf",
"(",
"<mask>",
",",
"args",
"...",
")",
")",
"\n",
"}"
] |
9,433 | all-9434 | [
"Madvise",
"uses",
"the",
"madvise",
"system",
"call",
"to",
"give",
"advise",
"about",
"the",
"use",
"of",
"memory",
"when",
"using",
"a",
"slice",
"that",
"is",
"memory",
"-",
"mapped",
"to",
"a",
"file",
".",
"Set",
"the",
"readahead",
"flag",
"to",
"false",
"if",
"page",
"references",
"are",
"expected",
"in",
"random",
"order",
"."
] | [
"func",
"Madvise",
"(",
"b",
"[",
"]",
"byte",
",",
"readahead",
"bool",
")",
"error",
"{",
"flags",
":=",
"unix",
".",
"MADV_NORMAL",
"\n",
"if",
"!",
"readahead",
"{",
"flags",
"=",
"unix",
".",
"MADV_RANDOM",
"\n",
"}",
"\n",
"return",
"madvise",
"(",
"b",
",",
"<mask>",
")",
"\n",
"}"
] |
9,434 | all-9435 | [
"LoadBoshRelease",
"creates",
"an",
"initialized",
"boshRelease",
"instance",
"from",
"the",
"specifed",
"local",
"or",
"remote",
".",
"tgz",
"file"
] | [
"func",
"LoadBoshRelease",
"(",
"releaseRepo",
"<mask>",
".",
"Release",
",",
"path",
"string",
")",
"(",
"release",
"*",
"BoshRelease",
",",
"err",
"error",
")",
"{",
"var",
"rr",
"io",
".",
"ReadCloser",
"\n",
"rr",
",",
"err",
"=",
"releaseRepo",
".",
"Read",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"defer",
"func",
"(",
")",
"{",
"if",
"cerr",
":=",
"rr",
".",
"Close",
"(",
")",
";",
"cerr",
"!=",
"nil",
"{",
"err",
"=",
"cerr",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n",
"release",
",",
"err",
"=",
"readBoshRelease",
"(",
"rr",
")",
"\n",
"return",
"\n",
"}"
] |
9,435 | all-9436 | [
"Uname",
"returns",
"the",
"uname",
"of",
"the",
"host",
"machine",
"."
] | [
"func",
"Uname",
"(",
")",
"string",
"{",
"buf",
":=",
"syscall",
".",
"Utsname",
"{",
"}",
"\n",
"err",
":=",
"syscall",
".",
"Uname",
"(",
"&",
"buf",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
"+",
"err",
".",
"<mask>",
"(",
")",
")",
"\n",
"}",
"\n\n",
"str",
":=",
"\"",
"\"",
"+",
"charsToString",
"(",
"buf",
".",
"Sysname",
"[",
":",
"]",
")",
"\n",
"str",
"+=",
"\"",
"\"",
"+",
"charsToString",
"(",
"buf",
".",
"Release",
"[",
":",
"]",
")",
"\n",
"str",
"+=",
"\"",
"\"",
"+",
"charsToString",
"(",
"buf",
".",
"Version",
"[",
":",
"]",
")",
"\n",
"str",
"+=",
"\"",
"\"",
"+",
"charsToString",
"(",
"buf",
".",
"Machine",
"[",
":",
"]",
")",
"\n",
"str",
"+=",
"\"",
"\"",
"+",
"charsToString",
"(",
"buf",
".",
"Nodename",
"[",
":",
"]",
")",
"\n",
"str",
"+=",
"\"",
"\"",
"+",
"charsToString",
"(",
"buf",
".",
"Domainname",
"[",
":",
"]",
")",
"+",
"\"",
"\"",
"\n",
"return",
"str",
"\n",
"}"
] |
9,436 | all-9437 | [
"Send",
"a",
"request",
"to",
"the",
"broker",
"to",
"sync",
"the",
"group",
"on",
"rebalance",
"()",
".",
"Returns",
"a",
"list",
"of",
"topics",
"and",
"partitions",
"to",
"consume",
"."
] | [
"func",
"(",
"c",
"*",
"Consumer",
")",
"syncGroup",
"(",
"strategy",
"*",
"balancer",
")",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"int32",
",",
"error",
")",
"{",
"memberID",
",",
"generationID",
":=",
"c",
".",
"membership",
"(",
")",
"\n",
"req",
":=",
"&",
"sarama",
".",
"SyncGroupRequest",
"{",
"GroupId",
":",
"c",
".",
"groupID",
",",
"MemberId",
":",
"memberID",
",",
"GenerationId",
":",
"generationID",
",",
"}",
"\n\n",
"if",
"strategy",
"!=",
"nil",
"{",
"for",
"memberID",
",",
"topics",
":=",
"range",
"strategy",
".",
"Perform",
"(",
")",
"{",
"if",
"err",
":=",
"req",
".",
"AddGroupAssignmentMember",
"(",
"memberID",
",",
"&",
"sarama",
".",
"ConsumerGroupMemberAssignment",
"{",
"Topics",
":",
"topics",
",",
"}",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"broker",
",",
"err",
":=",
"c",
".",
"client",
".",
"Coordinator",
"(",
"c",
".",
"groupID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"c",
".",
"closeCoordinator",
"(",
"broker",
",",
"err",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"resp",
",",
"err",
":=",
"broker",
".",
"SyncGroup",
"(",
"req",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"c",
".",
"closeCoordinator",
"(",
"broker",
",",
"err",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"else",
"if",
"resp",
".",
"Err",
"!=",
"sarama",
".",
"ErrNoError",
"{",
"c",
".",
"closeCoordinator",
"(",
"broker",
",",
"resp",
".",
"Err",
")",
"\n",
"return",
"nil",
",",
"resp",
".",
"Err",
"\n",
"}",
"\n\n",
"// Return if there is nothing to subscribe to",
"if",
"len",
"(",
"resp",
".",
"MemberAssignment",
")",
"==",
"0",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n\n",
"// Get assigned subscriptions",
"members",
",",
"err",
":=",
"resp",
".",
"GetMemberAssignment",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Sort partitions, for each topic",
"for",
"topic",
":=",
"<mask>",
"members",
".",
"Topics",
"{",
"sort",
".",
"Sort",
"(",
"int32Slice",
"(",
"members",
".",
"Topics",
"[",
"topic",
"]",
")",
")",
"\n",
"}",
"\n",
"return",
"members",
".",
"Topics",
",",
"nil",
"\n",
"}"
] |
9,437 | all-9438 | [
"copyExchanges",
"returns",
"a",
"copy",
"of",
"the",
"exchanges",
"if",
"the",
"exchange",
"is",
"active",
".",
"The",
"caller",
"must",
"lock",
"the",
"mexset",
"."
] | [
"func",
"(",
"mexset",
"*",
"messageExchangeSet",
")",
"copyExchanges",
"(",
")",
"(",
"shutdown",
"bool",
",",
"exchanges",
"<mask>",
"[",
"uint32",
"]",
"*",
"messageExchange",
")",
"{",
"if",
"mexset",
".",
"shutdown",
"{",
"return",
"true",
",",
"nil",
"\n",
"}",
"\n\n",
"exchangesCopy",
":=",
"make",
"(",
"map",
"[",
"uint32",
"]",
"*",
"messageExchange",
",",
"len",
"(",
"mexset",
".",
"exchanges",
")",
")",
"\n",
"for",
"k",
",",
"mex",
":=",
"range",
"mexset",
".",
"exchanges",
"{",
"exchangesCopy",
"[",
"k",
"]",
"=",
"mex",
"\n",
"}",
"\n\n",
"return",
"false",
",",
"exchangesCopy",
"\n",
"}"
] |
9,438 | all-9439 | [
"NewGroupMetrics",
"makes",
"a",
"new",
"Metrics",
"and",
"registers",
"them",
"with",
"then",
"provided",
"registerer",
"if",
"not",
"nil",
"."
] | [
"func",
"NewGroupMetrics",
"(",
"reg",
"prometheus",
".",
"Registerer",
")",
"*",
"Metrics",
"{",
"m",
":=",
"&",
"Metrics",
"{",
"evalDuration",
":",
"prometheus",
".",
"NewSummary",
"(",
"prometheus",
".",
"SummaryOpts",
"{",
"Namespace",
":",
"namespace",
",",
"Name",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"}",
")",
",",
"evalFailures",
":",
"prometheus",
".",
"NewCounter",
"(",
"prometheus",
".",
"CounterOpts",
"{",
"Namespace",
":",
"namespace",
",",
"Name",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"}",
")",
",",
"evalTotal",
":",
"prometheus",
".",
"NewCounter",
"(",
"prometheus",
".",
"CounterOpts",
"{",
"Namespace",
":",
"namespace",
",",
"<mask>",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"}",
")",
",",
"iterationDuration",
":",
"prometheus",
".",
"NewSummary",
"(",
"prometheus",
".",
"SummaryOpts",
"{",
"Namespace",
":",
"namespace",
",",
"Name",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"Objectives",
":",
"map",
"[",
"float64",
"]",
"float64",
"{",
"0.01",
":",
"0.001",
",",
"0.05",
":",
"0.005",
",",
"0.5",
":",
"0.05",
",",
"0.90",
":",
"0.01",
",",
"0.99",
":",
"0.001",
"}",
",",
"}",
")",
",",
"iterationsMissed",
":",
"prometheus",
".",
"NewCounter",
"(",
"prometheus",
".",
"CounterOpts",
"{",
"Namespace",
":",
"namespace",
",",
"Name",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"}",
")",
",",
"iterationsScheduled",
":",
"prometheus",
".",
"NewCounter",
"(",
"prometheus",
".",
"CounterOpts",
"{",
"Namespace",
":",
"namespace",
",",
"Name",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"}",
")",
",",
"groupLastEvalTime",
":",
"prometheus",
".",
"NewGaugeVec",
"(",
"prometheus",
".",
"GaugeOpts",
"{",
"Namespace",
":",
"namespace",
",",
"Name",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"}",
",",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
")",
",",
"groupLastDuration",
":",
"prometheus",
".",
"NewGaugeVec",
"(",
"prometheus",
".",
"GaugeOpts",
"{",
"Namespace",
":",
"namespace",
",",
"Name",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"}",
",",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
")",
",",
"groupRules",
":",
"prometheus",
".",
"NewGaugeVec",
"(",
"prometheus",
".",
"GaugeOpts",
"{",
"Namespace",
":",
"namespace",
",",
"Name",
":",
"\"",
"\"",
",",
"Help",
":",
"\"",
"\"",
",",
"}",
",",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
")",
",",
"}",
"\n\n",
"if",
"reg",
"!=",
"nil",
"{",
"reg",
".",
"MustRegister",
"(",
"m",
".",
"evalDuration",
",",
"m",
".",
"evalFailures",
",",
"m",
".",
"evalTotal",
",",
"m",
".",
"iterationDuration",
",",
"m",
".",
"iterationsMissed",
",",
"m",
".",
"iterationsScheduled",
",",
"m",
".",
"groupLastEvalTime",
",",
"m",
".",
"groupLastDuration",
",",
"m",
".",
"groupRules",
",",
")",
"\n",
"}",
"\n\n",
"return",
"m",
"\n",
"}"
] |
9,439 | all-9440 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EnableReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger44",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
9,440 | all-9441 | [
"NewIngressSource",
"creates",
"a",
"new",
"ingressSource",
"with",
"the",
"given",
"config",
"."
] | [
"func",
"NewIngressSource",
"(",
"kubeClient",
"kubernetes",
".",
"Interface",
",",
"namespace",
",",
"annotationFilter",
"string",
",",
"fqdnTemplate",
"string",
",",
"combineFqdnAnnotation",
"bool",
",",
"ignoreHostnameAnnotation",
"bool",
")",
"(",
"Source",
",",
"error",
")",
"{",
"var",
"(",
"tmpl",
"*",
"template",
".",
"<mask>",
"\n",
"err",
"error",
"\n",
")",
"\n",
"if",
"fqdnTemplate",
"!=",
"\"",
"\"",
"{",
"tmpl",
",",
"err",
"=",
"template",
".",
"New",
"(",
"\"",
"\"",
")",
".",
"Funcs",
"(",
"template",
".",
"FuncMap",
"{",
"\"",
"\"",
":",
"strings",
".",
"TrimPrefix",
",",
"}",
")",
".",
"Parse",
"(",
"fqdnTemplate",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Use shared informer to listen for add/update/delete of ingresses in the specified namespace.",
"// Set resync period to 0, to prevent processing when nothing has changed.",
"informerFactory",
":=",
"kubeinformers",
".",
"NewSharedInformerFactoryWithOptions",
"(",
"kubeClient",
",",
"0",
",",
"kubeinformers",
".",
"WithNamespace",
"(",
"namespace",
")",
")",
"\n",
"ingressInformer",
":=",
"informerFactory",
".",
"Extensions",
"(",
")",
".",
"V1beta1",
"(",
")",
".",
"Ingresses",
"(",
")",
"\n\n",
"// Add default resource event handlers to properly initialize informer.",
"ingressInformer",
".",
"Informer",
"(",
")",
".",
"AddEventHandler",
"(",
"cache",
".",
"ResourceEventHandlerFuncs",
"{",
"AddFunc",
":",
"func",
"(",
"obj",
"interface",
"{",
"}",
")",
"{",
"}",
",",
"}",
",",
")",
"\n\n",
"// TODO informer is not explicitly stopped since controller is not passing in its channel.",
"informerFactory",
".",
"Start",
"(",
"wait",
".",
"NeverStop",
")",
"\n\n",
"// wait for the local cache to be populated.",
"err",
"=",
"wait",
".",
"Poll",
"(",
"time",
".",
"Second",
",",
"60",
"*",
"time",
".",
"Second",
",",
"func",
"(",
")",
"(",
"bool",
",",
"error",
")",
"{",
"return",
"ingressInformer",
".",
"Informer",
"(",
")",
".",
"HasSynced",
"(",
")",
"==",
"true",
",",
"nil",
"\n",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"sc",
":=",
"&",
"ingressSource",
"{",
"client",
":",
"kubeClient",
",",
"namespace",
":",
"namespace",
",",
"annotationFilter",
":",
"annotationFilter",
",",
"fqdnTemplate",
":",
"tmpl",
",",
"combineFQDNAnnotation",
":",
"combineFqdnAnnotation",
",",
"ignoreHostnameAnnotation",
":",
"ignoreHostnameAnnotation",
",",
"ingressInformer",
":",
"ingressInformer",
",",
"}",
"\n",
"return",
"sc",
",",
"nil",
"\n",
"}"
] |
9,441 | all-9442 | [
"Formats",
"the",
"supplied",
"Diff",
"as",
"a",
"unified",
"-",
"diff",
"-",
"like",
"text",
"with",
"infinite",
"context",
"and",
"optionally",
"colorizes",
"it",
"."
] | [
"func",
"(",
"c",
"DiffCmd",
")",
"formatDiff",
"(",
"diffs",
"[",
"]",
"diffmatchpatch",
".",
"Diff",
",",
"color",
"bool",
")",
"string",
"{",
"var",
"buff",
"bytes",
".",
"Buffer",
"\n\n",
"for",
"_",
",",
"diff",
":=",
"range",
"diffs",
"{",
"text",
":=",
"diff",
".",
"Text",
"\n\n",
"switch",
"diff",
".",
"Type",
"{",
"case",
"diffmatchpatch",
".",
"DiffInsert",
":",
"if",
"color",
"{",
"_",
",",
"_",
"=",
"buff",
".",
"WriteString",
"(",
"\"",
"\\x1b",
"\"",
")",
"\n",
"}",
"\n",
"_",
",",
"_",
"=",
"buff",
".",
"WriteString",
"(",
"DiffLineStart",
".",
"ReplaceAllString",
"(",
"text",
",",
"\"",
"\"",
")",
")",
"\n",
"if",
"color",
"{",
"_",
",",
"_",
"=",
"buff",
".",
"WriteString",
"(",
"\"",
"\\x1b",
"\"",
")",
"\n",
"}",
"\n",
"case",
"diffmatchpatch",
".",
"DiffDelete",
":",
"if",
"color",
"{",
"_",
",",
"_",
"=",
"buff",
".",
"WriteString",
"(",
"\"",
"\\x1b",
"\"",
")",
"\n",
"}",
"\n",
"_",
",",
"_",
"=",
"buff",
".",
"WriteString",
"(",
"DiffLineStart",
".",
"ReplaceAllString",
"(",
"<mask>",
",",
"\"",
"\"",
")",
")",
"\n",
"if",
"color",
"{",
"_",
",",
"_",
"=",
"buff",
".",
"WriteString",
"(",
"\"",
"\\x1b",
"\"",
")",
"\n",
"}",
"\n",
"case",
"diffmatchpatch",
".",
"DiffEqual",
":",
"_",
",",
"_",
"=",
"buff",
".",
"WriteString",
"(",
"DiffLineStart",
".",
"ReplaceAllString",
"(",
"text",
",",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"buff",
".",
"String",
"(",
")",
"\n",
"}"
] |
9,442 | all-9443 | [
"creates",
"and",
"initializes",
"a",
"buffer",
"object",
"s",
"immutable",
"data",
"store"
] | [
"func",
"NamedBufferStorage",
"(",
"buffer",
"uint32",
",",
"size",
"int",
",",
"data",
"unsafe",
".",
"Pointer",
",",
"flags",
"uint32",
")",
"{",
"C",
".",
"glowNamedBufferStorage",
"(",
"gpNamedBufferStorage",
",",
"(",
"C",
".",
"GLuint",
")",
"(",
"<mask>",
")",
",",
"(",
"C",
".",
"GLsizeiptr",
")",
"(",
"size",
")",
",",
"data",
",",
"(",
"C",
".",
"GLbitfield",
")",
"(",
"flags",
")",
")",
"\n",
"}"
] |
9,443 | all-9444 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"CanEmulateReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoEmulation20",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
9,444 | all-9445 | [
"String",
"returns",
"a",
"human",
"readable",
"string",
"representation",
"of",
"DockerContainer"
] | [
"func",
"(",
"dc",
"*",
"DockerContainer",
")",
"<mask>",
"(",
")",
"string",
"{",
"if",
"dc",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"dc",
".",
"DockerID",
",",
"dc",
".",
"DockerName",
",",
"dc",
".",
"Container",
".",
"String",
"(",
")",
")",
"\n",
"}"
] |
9,445 | all-9446 | [
"VimValidateVirtualCenter",
"ensures",
"that",
"the",
"client",
"is",
"connected",
"to",
"vCenter",
".",
"This",
"is",
"a",
"lower",
"-",
"level",
"method",
"that",
"does",
"not",
"take",
"the",
"wrapped",
"client",
"from",
"the",
"higher",
"-",
"level",
"govmomi",
"object",
"and",
"can",
"be",
"used",
"to",
"facilitate",
"validation",
"when",
"it",
"s",
"not",
"available",
"."
] | [
"func",
"VimValidateVirtualCenter",
"(",
"c",
"*",
"vim25",
".",
"Client",
")",
"error",
"{",
"if",
"c",
".",
"ServiceContent",
".",
"About",
".",
"ApiType",
"!=",
"\"",
"\"",
"{",
"return",
"<mask>",
".",
"New",
"(",
"ErrVirtualCenterOnly",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
9,446 | all-9447 | [
"Add",
"adds",
"a",
"peer",
"to",
"the",
"list",
"if",
"it",
"does",
"not",
"exist",
"or",
"returns",
"any",
"existing",
"peer",
"."
] | [
"func",
"(",
"l",
"*",
"PeerList",
")",
"Add",
"(",
"hostPort",
"string",
")",
"*",
"Peer",
"{",
"if",
"ps",
",",
"<mask>",
":=",
"l",
".",
"exists",
"(",
"hostPort",
")",
";",
"ok",
"{",
"return",
"ps",
".",
"Peer",
"\n",
"}",
"\n",
"l",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"p",
",",
"ok",
":=",
"l",
".",
"peersByHostPort",
"[",
"hostPort",
"]",
";",
"ok",
"{",
"return",
"p",
".",
"Peer",
"\n",
"}",
"\n\n",
"p",
":=",
"l",
".",
"parent",
".",
"Add",
"(",
"hostPort",
")",
"\n",
"p",
".",
"addSC",
"(",
")",
"\n",
"ps",
":=",
"newPeerScore",
"(",
"p",
",",
"l",
".",
"scoreCalculator",
".",
"GetScore",
"(",
"p",
")",
")",
"\n\n",
"l",
".",
"peersByHostPort",
"[",
"hostPort",
"]",
"=",
"ps",
"\n",
"l",
".",
"peerHeap",
".",
"addPeer",
"(",
"ps",
")",
"\n",
"return",
"p",
"\n",
"}"
] |
9,447 | all-9448 | [
"ApplyChanges",
"applies",
"a",
"given",
"set",
"of",
"changes",
"in",
"a",
"given",
"zone",
"."
] | [
"func",
"(",
"p",
"*",
"NS1Provider",
")",
"ApplyChanges",
"(",
"changes",
"*",
"plan",
".",
"Changes",
")",
"error",
"{",
"combinedChanges",
":=",
"make",
"(",
"[",
"]",
"*",
"ns1Change",
",",
"0",
",",
"len",
"(",
"changes",
".",
"Create",
")",
"+",
"len",
"(",
"<mask>",
".",
"UpdateNew",
")",
"+",
"len",
"(",
"changes",
".",
"Delete",
")",
")",
"\n\n",
"combinedChanges",
"=",
"append",
"(",
"combinedChanges",
",",
"newNS1Changes",
"(",
"ns1Create",
",",
"changes",
".",
"Create",
")",
"...",
")",
"\n",
"combinedChanges",
"=",
"append",
"(",
"combinedChanges",
",",
"newNS1Changes",
"(",
"ns1Update",
",",
"changes",
".",
"UpdateNew",
")",
"...",
")",
"\n",
"combinedChanges",
"=",
"append",
"(",
"combinedChanges",
",",
"newNS1Changes",
"(",
"ns1Delete",
",",
"changes",
".",
"Delete",
")",
"...",
")",
"\n\n",
"return",
"p",
".",
"ns1SubmitChanges",
"(",
"combinedChanges",
")",
"\n",
"}"
] |
9,448 | all-9449 | [
"Swap",
"swaps",
"the",
"elements",
"at",
"i",
"and",
"j"
] | [
"func",
"(",
"s",
"LexSymbolSorter",
")",
"Swap",
"(",
"i",
",",
"j",
"int",
")",
"{",
"s",
".",
"<mask>",
"[",
"i",
"]",
",",
"s",
".",
"list",
"[",
"j",
"]",
"=",
"s",
".",
"list",
"[",
"j",
"]",
",",
"s",
".",
"list",
"[",
"i",
"]",
"\n",
"}"
] |
9,449 | all-9450 | [
"/",
"*",
"Wait",
"waits",
"until",
"the",
"wrapped",
"command",
"exits",
".",
"It",
"can",
"be",
"passed",
"an",
"optional",
"timeout",
".",
"If",
"the",
"command",
"does",
"not",
"exit",
"within",
"the",
"timeout",
"Wait",
"will",
"trigger",
"a",
"test",
"failure",
"."
] | [
"func",
"(",
"s",
"*",
"Session",
")",
"Wait",
"(",
"timeout",
"...",
"interface",
"{",
"}",
")",
"*",
"<mask>",
"{",
"EventuallyWithOffset",
"(",
"1",
",",
"s",
",",
"timeout",
"...",
")",
".",
"Should",
"(",
"Exit",
"(",
")",
")",
"\n",
"return",
"s",
"\n",
"}"
] |
9,450 | all-9451 | [
"GetQSetHash",
"retrieves",
"the",
"QSetHash",
"value",
"from",
"the",
"union",
"returning",
"ok",
"if",
"the",
"union",
"s",
"switch",
"indicated",
"the",
"value",
"is",
"valid",
"."
] | [
"func",
"(",
"u",
"StellarMessage",
")",
"GetQSetHash",
"(",
")",
"(",
"result",
"Uint256",
",",
"<mask>",
"bool",
")",
"{",
"armName",
",",
"_",
":=",
"u",
".",
"ArmForSwitch",
"(",
"int32",
"(",
"u",
".",
"Type",
")",
")",
"\n\n",
"if",
"armName",
"==",
"\"",
"\"",
"{",
"result",
"=",
"*",
"u",
".",
"QSetHash",
"\n",
"ok",
"=",
"true",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
] |
9,451 | all-9452 | [
"String",
"implements",
"fmt",
".",
"String"
] | [
"func",
"(",
"b",
"BuildInfo",
")",
"<mask>",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"b",
".",
"Version",
",",
"b",
".",
"Time",
")",
"\n",
"}"
] |
9,452 | all-9453 | [
"New",
"returns",
"a",
"new",
"Discovery",
"which",
"periodically",
"refreshes",
"its",
"targets",
"."
] | [
"func",
"New",
"(",
"logger",
"log",
".",
"Logger",
",",
"conf",
"*",
"SDConfig",
")",
"(",
"*",
"Discovery",
",",
"error",
")",
"{",
"tls",
",",
"err",
":=",
"config_util",
".",
"NewTLSConfig",
"(",
"&",
"conf",
".",
"TLSConfig",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"transport",
":=",
"&",
"http",
".",
"Transport",
"{",
"TLSClientConfig",
":",
"tls",
",",
"DialContext",
":",
"conntrack",
".",
"NewDialContextFunc",
"(",
"conntrack",
".",
"DialWithTracing",
"(",
")",
",",
"conntrack",
".",
"DialWithName",
"(",
"\"",
"\"",
")",
",",
")",
",",
"}",
"\n",
"client",
":=",
"&",
"http",
".",
"Client",
"{",
"Transport",
":",
"transport",
"}",
"\n\n",
"d",
":=",
"&",
"Discovery",
"{",
"client",
":",
"client",
",",
"interval",
":",
"<mask>",
".",
"Duration",
"(",
"conf",
".",
"RefreshInterval",
")",
",",
"sdConfig",
":",
"conf",
",",
"}",
"\n",
"d",
".",
"Discovery",
"=",
"refresh",
".",
"NewDiscovery",
"(",
"logger",
",",
"\"",
"\"",
",",
"time",
".",
"Duration",
"(",
"conf",
".",
"RefreshInterval",
")",
",",
"d",
".",
"refresh",
",",
")",
"\n",
"return",
"d",
",",
"nil",
"\n",
"}"
] |
9,453 | all-9454 | [
"Error",
"satisfies",
"error",
"interface"
] | [
"func",
"(",
"h",
"hookIgnoredError",
")",
"<mask>",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"h",
".",
"hookType",
",",
"h",
".",
"err",
")",
"\n",
"}"
] |
9,454 | all-9455 | [
"SetIconName",
"is",
"a",
"wrapper",
"around",
"gtk_window_set_icon_name",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Window",
")",
"SetIconName",
"(",
"<mask>",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"name",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_window_set_icon_name",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
9,455 | all-9456 | [
"first",
"returns",
"the",
"store",
"revision",
"from",
"the",
"first",
"fetch"
] | [
"func",
"(",
"rs",
"readSet",
")",
"first",
"(",
")",
"int64",
"{",
"ret",
":=",
"int64",
"(",
"math",
".",
"MaxInt64",
"-",
"1",
")",
"\n",
"for",
"_",
",",
"resp",
":=",
"range",
"<mask>",
"{",
"if",
"rev",
":=",
"resp",
".",
"Header",
".",
"Revision",
";",
"rev",
"<",
"ret",
"{",
"ret",
"=",
"rev",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"ret",
"\n",
"}"
] |
9,456 | all-9457 | [
"GetPaperSize",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_get_paper_size",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PrintSettings",
")",
"GetPaperSize",
"(",
")",
"(",
"*",
"PaperSize",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_print_settings_get_paper_size",
"(",
"ps",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"p",
":=",
"&",
"PaperSize",
"{",
"c",
"}",
"\n",
"runtime",
".",
"SetFinalizer",
"(",
"p",
",",
"(",
"*",
"PaperSize",
")",
".",
"<mask>",
")",
"\n",
"return",
"p",
",",
"nil",
"\n",
"}"
] |
9,457 | all-9458 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventExecutionContextsCleared",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime30",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
9,458 | all-9459 | [
"assignEthernetCard",
"is",
"a",
"subset",
"of",
"the",
"logic",
"that",
"goes",
"into",
"AssignController",
"right",
"now",
"but",
"with",
"an",
"unit",
"offset",
"of",
"7",
".",
"This",
"is",
"based",
"on",
"what",
"we",
"have",
"observed",
"on",
"vSphere",
"in",
"terms",
"of",
"reserved",
"PCI",
"unit",
"numbers",
"(",
"the",
"first",
"NIC",
"automatically",
"gets",
"re",
"-",
"assigned",
"to",
"unit",
"number",
"7",
"if",
"it",
"s",
"not",
"that",
"already",
".",
")"
] | [
"func",
"(",
"r",
"*",
"NetworkInterfaceSubresource",
")",
"assignEthernetCard",
"(",
"l",
"object",
".",
"VirtualDeviceList",
",",
"device",
"types",
".",
"BaseVirtualDevice",
",",
"c",
"types",
".",
"BaseVirtualController",
")",
"error",
"{",
"// The PCI device offset. This seems to be where vSphere starts assigning",
"// virtual NICs on the PCI controller.",
"pciDeviceOffset",
":=",
"int32",
"(",
"networkInterfacePciDeviceOffset",
")",
"\n\n",
"// The first part of this is basically the private newUnitNumber function",
"// from VirtualDeviceList, with a maximum unit count of 10. This basically",
"// means that no more than 10 virtual NICs can be assigned right now, which",
"// hopefully should be plenty.",
"units",
":=",
"make",
"(",
"[",
"]",
"bool",
",",
"10",
")",
"\n\n",
"ckey",
":=",
"c",
".",
"GetVirtualController",
"(",
")",
".",
"Key",
"\n\n",
"for",
"_",
",",
"device",
":=",
"range",
"l",
"{",
"d",
":=",
"<mask>",
".",
"GetVirtualDevice",
"(",
")",
"\n",
"if",
"d",
".",
"ControllerKey",
"!=",
"ckey",
"||",
"d",
".",
"UnitNumber",
"==",
"nil",
"||",
"*",
"d",
".",
"UnitNumber",
"<",
"pciDeviceOffset",
"||",
"*",
"d",
".",
"UnitNumber",
">=",
"pciDeviceOffset",
"+",
"10",
"{",
"continue",
"\n",
"}",
"\n",
"units",
"[",
"*",
"d",
".",
"UnitNumber",
"-",
"pciDeviceOffset",
"]",
"=",
"true",
"\n",
"}",
"\n\n",
"// Now that we know which units are used, we can pick one",
"newUnit",
":=",
"int32",
"(",
"r",
".",
"Index",
")",
"+",
"pciDeviceOffset",
"\n",
"if",
"units",
"[",
"newUnit",
"-",
"pciDeviceOffset",
"]",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"newUnit",
")",
"\n",
"}",
"\n\n",
"d",
":=",
"device",
".",
"GetVirtualDevice",
"(",
")",
"\n",
"d",
".",
"ControllerKey",
"=",
"c",
".",
"GetVirtualController",
"(",
")",
".",
"Key",
"\n",
"d",
".",
"UnitNumber",
"=",
"&",
"newUnit",
"\n",
"if",
"d",
".",
"Key",
"==",
"0",
"{",
"d",
".",
"Key",
"=",
"-",
"1",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
9,459 | all-9460 | [
"SetLatency",
"adds",
"latency",
"in",
"millisecond",
"scale",
"with",
"random",
"variations",
"."
] | [
"func",
"SetLatency",
"(",
"ms",
",",
"rv",
"int",
")",
"error",
"{",
"ifces",
",",
"err",
":=",
"GetDefaultInterfaces",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"rv",
">",
"ms",
"{",
"rv",
"=",
"1",
"\n",
"}",
"\n",
"for",
"ifce",
":=",
"<mask>",
"ifces",
"{",
"cmdStr",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"ifce",
",",
"ms",
",",
"rv",
")",
"\n",
"_",
",",
"err",
"=",
"exec",
".",
"Command",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"cmdStr",
")",
".",
"Output",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"// the rule has already been added. Overwrite it.",
"cmdStr",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"ifce",
",",
"ms",
",",
"rv",
")",
"\n",
"_",
",",
"err",
"=",
"exec",
".",
"Command",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"cmdStr",
")",
".",
"Output",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
9,460 | all-9461 | [
"base64Decode",
"decodes",
"the",
"given",
"string",
"as",
"a",
"base64",
"string",
"returning",
"an",
"error",
"if",
"it",
"fails",
"."
] | [
"func",
"base64Decode",
"(",
"s",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"base64",
".",
"StdEncoding",
".",
"DecodeString",
"(",
"s",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"<mask>",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"string",
"(",
"v",
")",
",",
"nil",
"\n",
"}"
] |
9,461 | all-9462 | [
"String",
"returns",
"a",
"base",
"-",
"64",
"string",
"representation",
"of",
"a",
"cursor",
"."
] | [
"func",
"(",
"c",
"Cursor",
")",
"<mask>",
"(",
")",
"string",
"{",
"if",
"c",
".",
"cc",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"b",
",",
"err",
":=",
"proto",
".",
"Marshal",
"(",
"c",
".",
"cc",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"// The only way to construct a Cursor with a non-nil cc field is to",
"// unmarshal from the byte representation. We panic if the unmarshal",
"// succeeds but the marshaling of the unchanged protobuf value fails.",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"err",
")",
")",
"\n",
"}",
"\n",
"return",
"strings",
".",
"TrimRight",
"(",
"base64",
".",
"URLEncoding",
".",
"EncodeToString",
"(",
"b",
")",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
9,462 | all-9463 | [
"newSTMSerializable",
"initiates",
"a",
"new",
"serialized",
"transaction",
";",
"reads",
"within",
"the",
"same",
"transaction",
"attempt",
"to",
"return",
"data",
"from",
"the",
"revision",
"of",
"the",
"first",
"read",
"."
] | [
"func",
"newSTMSerializable",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"v3",
".",
"<mask>",
",",
"apply",
"func",
"(",
"STM",
")",
"error",
",",
"dryrun",
"bool",
")",
"(",
"*",
"v3",
".",
"TxnResponse",
",",
"error",
")",
"{",
"s",
":=",
"&",
"stmSerializable",
"{",
"stm",
":",
"stm",
"{",
"client",
":",
"c",
",",
"ctx",
":",
"ctx",
"}",
",",
"prefetch",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"v3",
".",
"GetResponse",
")",
",",
"}",
"\n",
"return",
"runSTM",
"(",
"s",
",",
"apply",
",",
"dryrun",
")",
"\n",
"}"
] |
9,463 | all-9464 | [
"GoroutineCountCheck",
"returns",
"a",
"Check",
"that",
"fails",
"if",
"too",
"many",
"goroutines",
"are",
"running",
"(",
"which",
"could",
"indicate",
"a",
"resource",
"leak",
")",
"."
] | [
"func",
"GoroutineCountCheck",
"(",
"threshold",
"int",
")",
"Check",
"{",
"return",
"func",
"(",
")",
"error",
"{",
"count",
":=",
"runtime",
".",
"NumGoroutine",
"(",
")",
"\n",
"if",
"<mask>",
">",
"threshold",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"count",
",",
"threshold",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] |
9,464 | all-9465 | [
"/",
"*",
"InitializeFromReader",
"takes",
"a",
"reader",
"and",
"scans",
"it",
"for",
"an",
"ini",
"configuration",
".",
"The",
"caller",
"should",
"close",
"the",
"reader",
"."
] | [
"func",
"(",
"config",
"*",
"Config",
")",
"InitializeFromReader",
"(",
"input",
"io",
".",
"Reader",
")",
"error",
"{",
"var",
"currentSection",
"*",
"configSection",
"\n\n",
"scanner",
":=",
"bufio",
".",
"NewScanner",
"(",
"input",
")",
"\n",
"config",
".",
"values",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"config",
".",
"sections",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"configSection",
")",
"\n\n",
"for",
"scanner",
".",
"Scan",
"(",
")",
"{",
"curLine",
":=",
"scanner",
".",
"Text",
"(",
")",
"\n\n",
"curLine",
"=",
"strings",
".",
"TrimSpace",
"(",
"curLine",
")",
"\n\n",
"if",
"len",
"(",
"curLine",
")",
"==",
"0",
"{",
"continue",
"// ignore empty lines",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"curLine",
",",
"\"",
"\"",
")",
"||",
"strings",
".",
"HasPrefix",
"(",
"curLine",
",",
"\"",
"\"",
")",
"{",
"continue",
"// comment",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"curLine",
",",
"\"",
"\"",
")",
"{",
"if",
"!",
"strings",
".",
"HasSuffix",
"(",
"curLine",
",",
"\"",
"\"",
")",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"sectionName",
":=",
"curLine",
"[",
"1",
":",
"len",
"(",
"curLine",
")",
"-",
"1",
"]",
"\n\n",
"if",
"sect",
",",
"ok",
":=",
"config",
".",
"sections",
"[",
"sectionName",
"]",
";",
"!",
"ok",
"{",
"//reuse sections",
"currentSection",
"=",
"new",
"(",
"configSection",
")",
"\n",
"currentSection",
".",
"name",
"=",
"sectionName",
"\n",
"currentSection",
".",
"values",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"config",
".",
"sections",
"[",
"currentSection",
".",
"name",
"]",
"=",
"currentSection",
"\n",
"}",
"else",
"{",
"currentSection",
"=",
"sect",
"\n",
"}",
"\n\n",
"continue",
"\n",
"}",
"\n\n",
"index",
":=",
"strings",
".",
"Index",
"(",
"curLine",
",",
"\"",
"\"",
")",
"\n\n",
"if",
"index",
"<=",
"0",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"key",
":=",
"strings",
".",
"ToLower",
"(",
"strings",
".",
"TrimSpace",
"(",
"curLine",
"[",
"0",
":",
"index",
"]",
")",
")",
"\n",
"isArray",
":=",
"strings",
".",
"HasSuffix",
"(",
"key",
",",
"\"",
"\"",
")",
"\n\n",
"if",
"isArray",
"{",
"<mask>",
"=",
"key",
"[",
"0",
":",
"len",
"(",
"key",
")",
"-",
"2",
"]",
"\n",
"}",
"\n\n",
"value",
":=",
"strings",
".",
"TrimSpace",
"(",
"curLine",
"[",
"index",
"+",
"1",
":",
"]",
")",
"\n",
"value",
"=",
"strings",
".",
"Trim",
"(",
"value",
",",
"\"",
"\\\"",
"\"",
")",
"//clear quotes",
"\n\n",
"valueMap",
":=",
"config",
".",
"values",
"\n\n",
"if",
"currentSection",
"!=",
"nil",
"{",
"valueMap",
"=",
"currentSection",
".",
"values",
"\n",
"}",
"\n\n",
"if",
"isArray",
"{",
"arr",
":=",
"valueMap",
"[",
"key",
"]",
"\n\n",
"if",
"arr",
"==",
"nil",
"{",
"arr",
"=",
"make",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"0",
")",
"\n",
"valueMap",
"[",
"key",
"]",
"=",
"arr",
"\n",
"}",
"\n\n",
"valueMap",
"[",
"key",
"]",
"=",
"append",
"(",
"arr",
".",
"(",
"[",
"]",
"interface",
"{",
"}",
")",
",",
"value",
")",
"\n",
"}",
"else",
"{",
"valueMap",
"[",
"key",
"]",
"=",
"value",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"scanner",
".",
"Err",
"(",
")",
"\n",
"}"
] |
9,465 | all-9466 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventInspectModeCanceled",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoOverlay20",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
9,466 | all-9467 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"ContinueToLocationTargetCallFrames",
")",
"UnmarshalEasyJSON",
"(",
"<mask>",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"ContinueToLocationTargetCallFrames",
"(",
"in",
".",
"String",
"(",
")",
")",
"{",
"case",
"ContinueToLocationTargetCallFramesAny",
":",
"*",
"t",
"=",
"ContinueToLocationTargetCallFramesAny",
"\n",
"case",
"ContinueToLocationTargetCallFramesCurrent",
":",
"*",
"t",
"=",
"ContinueToLocationTargetCallFramesCurrent",
"\n\n",
"default",
":",
"in",
".",
"AddError",
"(",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"}"
] |
9,467 | all-9468 | [
"ParseUintHex",
"parses",
"a",
"hexadecimanl",
"representation",
"of",
"a",
"uint64",
"from",
"b",
".",
"The",
"function",
"is",
"equivalent",
"to",
"calling",
"strconv",
".",
"ParseUint",
"(",
"string",
"(",
"b",
")",
"16",
"64",
")",
"but",
"it",
"prevents",
"Go",
"from",
"making",
"a",
"memory",
"allocation",
"for",
"converting",
"a",
"byte",
"slice",
"to",
"a",
"string",
"(",
"escape",
"analysis",
"fails",
"due",
"to",
"the",
"error",
"returned",
"by",
"strconv",
".",
"ParseUint",
")",
".",
"Because",
"it",
"only",
"works",
"with",
"base",
"16",
"the",
"function",
"is",
"also",
"significantly",
"faster",
"than",
"strconv",
".",
"ParseUint",
"."
] | [
"func",
"ParseUintHex",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"uint64",
",",
"error",
")",
"{",
"const",
"max",
"=",
"Uint64Max",
"\n",
"const",
"lim",
"=",
"max",
"/",
"0x10",
"\n",
"var",
"val",
"uint64",
"\n\n",
"if",
"len",
"(",
"b",
")",
"==",
"0",
"{",
"return",
"0",
",",
"errorInvalidUint64",
"(",
"b",
")",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"d",
":=",
"range",
"b",
"{",
"var",
"x",
"uint64",
"\n\n",
"switch",
"{",
"case",
"d",
">=",
"'0'",
"&&",
"d",
"<=",
"'9'",
":",
"x",
"=",
"uint64",
"(",
"d",
"-",
"'0'",
")",
"\n\n",
"case",
"d",
">=",
"'A'",
"&&",
"d",
"<=",
"'F'",
":",
"x",
"=",
"uint64",
"(",
"d",
"-",
"'A'",
")",
"+",
"0xA",
"\n\n",
"case",
"d",
">=",
"'a'",
"&&",
"d",
"<=",
"'f'",
":",
"x",
"=",
"uint64",
"(",
"d",
"-",
"'a'",
")",
"+",
"0xA",
"\n\n",
"<mask>",
":",
"return",
"0",
",",
"errorInvalidUint64",
"(",
"b",
")",
"\n",
"}",
"\n\n",
"if",
"val",
">",
"lim",
"{",
"return",
"0",
",",
"errorOverflowUint64",
"(",
"b",
")",
"\n",
"}",
"\n\n",
"if",
"val",
"*=",
"0x10",
";",
"val",
">",
"(",
"max",
"-",
"x",
")",
"{",
"return",
"0",
",",
"errorOverflowUint64",
"(",
"b",
")",
"\n",
"}",
"\n\n",
"val",
"+=",
"x",
"\n",
"}",
"\n\n",
"return",
"val",
",",
"nil",
"\n",
"}"
] |
9,468 | all-9469 | [
"ConvertedFrom",
"reports",
"whether",
"value",
"v",
"was",
"converted",
"from",
"type",
"typ",
"."
] | [
"func",
"ConvertedFrom",
"(",
"v",
"Value",
",",
"typ",
"string",
")",
"bool",
"{",
"change",
",",
"ok",
":=",
"v",
".",
"Value",
".",
"(",
"*",
"ssa",
".",
"ChangeType",
")",
"\n",
"return",
"<mask>",
"&&",
"IsType",
"(",
"change",
".",
"X",
".",
"Type",
"(",
")",
",",
"typ",
")",
"\n",
"}"
] |
9,469 | all-9470 | [
"Unsubscribe",
"unsubscribes",
"a",
"channel"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"Unsubscribe",
"(",
"ch",
"chan",
"*",
"Event",
")",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"c",
".",
"subscribed",
"[",
"ch",
"]",
"!=",
"nil",
"{",
"c",
".",
"subscribed",
"[",
"ch",
"]",
"<-",
"<mask>",
"\n",
"}",
"\n",
"}"
] |
9,470 | all-9471 | [
"SetHeading",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_app_chooser_dialog_set_heading",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"AppChooserDialog",
")",
"SetHeading",
"(",
"<mask>",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"heading",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_app_chooser_dialog_set_heading",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
9,471 | all-9472 | [
"CreateProject",
"creates",
"a",
"new",
"empty",
"project",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateProject",
"(",
"project",
"*",
"Project",
")",
"(",
"*",
"Project",
",",
"error",
")",
"{",
"p",
":=",
"&",
"Project",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"post",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
"nil",
",",
"<mask>",
",",
"p",
")",
"\n",
"return",
"p",
",",
"err",
"\n",
"}"
] |
9,472 | all-9473 | [
"FindByPrimaryKeyTo",
"calls",
"db",
".",
"FindByPrimaryKeyTo",
"()",
"returning",
"more",
"descriptive",
"error",
"."
] | [
"func",
"FindByPrimaryKeyTo",
"(",
"db",
"*",
"reform",
".",
"Querier",
",",
"rec",
"reform",
".",
"Record",
",",
"<mask>",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"err",
":=",
"db",
".",
"FindByPrimaryKeyTo",
"(",
"rec",
",",
"key",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"rec",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
9,473 | all-9474 | [
"ImagesGetByNodeID",
"returns",
"all",
"images",
"that",
"the",
"LXD",
"node",
"instance",
"has",
"with",
"the",
"given",
"node",
"id",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"ImagesGetByNodeID",
"(",
"id",
"int64",
")",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
",",
"error",
")",
"{",
"images",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
")",
"// key is fingerprint, value is list of projects",
"\n",
"err",
":=",
"c",
".",
"Transaction",
"(",
"func",
"(",
"tx",
"*",
"ClusterTx",
")",
"error",
"{",
"stmt",
":=",
"`\n SELECT images.fingerprint, projects.name FROM images\n LEFT JOIN images_nodes ON images.id = images_nodes.image_id\n\t\t\tLEFT JOIN nodes ON images_nodes.node_id = nodes.id\n\t\t\tLEFT JOIN projects ON images.project_id = projects.id\n WHERE nodes.id = ?\n\t\t`",
"\n",
"rows",
",",
"err",
":=",
"tx",
".",
"tx",
".",
"Query",
"(",
"stmt",
",",
"id",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"var",
"fingerprint",
"string",
"\n",
"var",
"projectName",
"string",
"\n",
"for",
"rows",
".",
"Next",
"(",
")",
"{",
"err",
":=",
"rows",
".",
"Scan",
"(",
"&",
"fingerprint",
",",
"&",
"projectName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"images",
"[",
"fingerprint",
"]",
"=",
"append",
"(",
"images",
"[",
"fingerprint",
"]",
",",
"projectName",
")",
"\n",
"}",
"\n\n",
"return",
"<mask>",
".",
"Err",
"(",
")",
"\n",
"}",
")",
"\n",
"return",
"images",
",",
"err",
"\n",
"}"
] |
9,474 | all-9475 | [
"Returns",
"a",
"list",
"of",
"filtered",
"Zones"
] | [
"func",
"(",
"p",
"*",
"dnsimpleProvider",
")",
"Zones",
"(",
")",
"(",
"map",
"[",
"string",
"]",
"dnsimple",
".",
"Zone",
",",
"error",
")",
"{",
"zones",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"dnsimple",
".",
"Zone",
")",
"\n",
"page",
":=",
"1",
"\n",
"listOptions",
":=",
"&",
"dnsimple",
".",
"ZoneListOptions",
"{",
"}",
"\n",
"for",
"{",
"listOptions",
".",
"Page",
"=",
"page",
"\n",
"zonesResponse",
",",
"err",
":=",
"p",
".",
"client",
".",
"ListZones",
"(",
"p",
".",
"accountID",
",",
"listOptions",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"for",
"_",
",",
"zone",
":=",
"range",
"zonesResponse",
".",
"Data",
"{",
"if",
"!",
"p",
".",
"domainFilter",
".",
"Match",
"(",
"zone",
".",
"<mask>",
")",
"{",
"continue",
"\n",
"}",
"\n\n",
"if",
"!",
"p",
".",
"zoneIDFilter",
".",
"Match",
"(",
"strconv",
".",
"Itoa",
"(",
"zone",
".",
"ID",
")",
")",
"{",
"continue",
"\n",
"}",
"\n\n",
"zones",
"[",
"strconv",
".",
"Itoa",
"(",
"zone",
".",
"ID",
")",
"]",
"=",
"zone",
"\n",
"}",
"\n\n",
"page",
"++",
"\n",
"if",
"page",
">",
"zonesResponse",
".",
"Pagination",
".",
"TotalPages",
"{",
"break",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"zones",
",",
"nil",
"\n",
"}"
] |
9,475 | all-9476 | [
"/",
"*",
"Infof",
"uses",
"msg",
"as",
"a",
"format",
"string",
"with",
"subsequent",
"parameters",
"as",
"values",
"and",
"logs",
"the",
"resulting",
"message",
"to",
"all",
"added",
"loggers",
"at",
"LogLevel",
".",
"LevelInfo"
] | [
"func",
"(",
"b",
"*",
"Base",
")",
"Infof",
"(",
"msg",
"string",
",",
"a",
"...",
"<mask>",
"{",
"}",
")",
"error",
"{",
"return",
"b",
".",
"Log",
"(",
"LevelInfo",
",",
"nil",
",",
"msg",
",",
"a",
"...",
")",
"\n",
"}"
] |
9,476 | all-9477 | [
"Equals",
"compares",
"two",
"ed25519",
"public",
"keys",
"."
] | [
"func",
"(",
"k",
"*",
"Ed25519PublicKey",
")",
"Equals",
"(",
"o",
"Key",
")",
"bool",
"{",
"edk",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"Ed25519PublicKey",
")",
"\n",
"if",
"!",
"<mask>",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"bytes",
".",
"Equal",
"(",
"k",
".",
"k",
",",
"edk",
".",
"k",
")",
"\n",
"}"
] |
9,477 | all-9478 | [
"CreateRecords",
"creates",
"a",
"given",
"set",
"of",
"DNS",
"records",
"in",
"the",
"given",
"hosted",
"zone",
"."
] | [
"func",
"(",
"p",
"*",
"GoogleProvider",
")",
"CreateRecords",
"(",
"endpoints",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
")",
"error",
"{",
"change",
":=",
"&",
"dns",
".",
"Change",
"{",
"}",
"\n\n",
"change",
".",
"Additions",
"=",
"append",
"(",
"<mask>",
".",
"Additions",
",",
"p",
".",
"newFilteredRecords",
"(",
"endpoints",
")",
"...",
")",
"\n\n",
"return",
"p",
".",
"submitChange",
"(",
"change",
")",
"\n",
"}"
] |
9,478 | all-9479 | [
"CopyTo",
"copies",
"req",
"contents",
"to",
"dst",
"except",
"of",
"body",
"stream",
"."
] | [
"func",
"(",
"req",
"*",
"Request",
")",
"CopyTo",
"(",
"dst",
"*",
"Request",
")",
"{",
"req",
".",
"copyToSkipBody",
"(",
"dst",
")",
"\n",
"if",
"req",
".",
"body",
"!=",
"nil",
"{",
"dst",
".",
"bodyBuffer",
"(",
")",
".",
"<mask>",
"(",
"req",
".",
"body",
".",
"B",
")",
"\n",
"}",
"else",
"if",
"dst",
".",
"body",
"!=",
"nil",
"{",
"dst",
".",
"body",
".",
"Reset",
"(",
")",
"\n",
"}",
"\n",
"}"
] |
9,479 | all-9480 | [
"GetServiceServiceOk",
"returns",
"a",
"tuple",
"with",
"the",
"ServiceService",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"GetServiceServiceOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"w",
"==",
"nil",
"||",
"w",
".",
"ServiceService",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"w",
".",
"ServiceService",
",",
"<mask>",
"\n",
"}"
] |
9,480 | all-9481 | [
"RandomString",
"generates",
"a",
"random",
"set",
"of",
"characters",
"with",
"the",
"given",
"lenght",
"."
] | [
"func",
"RandomString",
"(",
"length",
"int",
")",
"string",
"{",
"src",
":=",
"rand",
".",
"NewSource",
"(",
"time",
".",
"Now",
"(",
")",
".",
"UnixNano",
"(",
")",
")",
"\n",
"b",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"length",
")",
"\n",
"for",
"i",
",",
"cache",
",",
"remain",
":=",
"length",
"-",
"1",
",",
"src",
".",
"Int63",
"(",
")",
",",
"letterIndexMax",
";",
"i",
">=",
"0",
";",
"{",
"if",
"remain",
"==",
"0",
"{",
"cache",
",",
"remain",
"=",
"src",
".",
"Int63",
"(",
")",
",",
"letterIndexMax",
"\n",
"}",
"\n",
"if",
"idx",
":=",
"int",
"(",
"<mask>",
"&",
"letterIndexMask",
")",
";",
"idx",
"<",
"len",
"(",
"letterBytes",
")",
"{",
"b",
"[",
"i",
"]",
"=",
"letterBytes",
"[",
"idx",
"]",
"\n",
"i",
"--",
"\n",
"}",
"\n",
"cache",
">>=",
"letterIndexBits",
"\n",
"remain",
"--",
"\n",
"}",
"\n\n",
"return",
"string",
"(",
"b",
")",
"\n",
"}"
] |
9,481 | all-9482 | [
"CutText",
"makes",
"a",
"text",
"no",
"longer",
"than",
"maxWidth"
] | [
"func",
"CutText",
"(",
"str",
"<mask>",
",",
"maxWidth",
"int",
")",
"string",
"{",
"ln",
":=",
"xs",
".",
"Len",
"(",
"str",
")",
"\n",
"if",
"ln",
"<=",
"maxWidth",
"{",
"return",
"str",
"\n",
"}",
"\n\n",
"return",
"xs",
".",
"Slice",
"(",
"str",
",",
"0",
",",
"maxWidth",
")",
"\n",
"}"
] |
9,482 | all-9483 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"EventAttributeRemoved",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom67",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
9,483 | all-9484 | [
"NewGroup",
"reads",
"the",
".",
"gitattributes",
"file",
"in",
"the",
"root",
"of",
"the",
"repository",
"only",
"."
] | [
"func",
"NewGroup",
"(",
"gitAttributesContent",
"func",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
")",
"(",
"*",
"Group",
",",
"error",
")",
"{",
"g",
":=",
"&",
"Group",
"{",
"LinguistGeneratedPatterns",
":",
"[",
"]",
"Pattern",
"{",
"}",
",",
"}",
"\n\n",
"bs",
",",
"err",
":=",
"gitAttributesContent",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"switch",
"err",
".",
"(",
"type",
")",
"{",
"case",
"*",
"github",
".",
"FileNotFound",
":",
"return",
"g",
",",
"nil",
"\n",
"<mask>",
":",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"g",
".",
"load",
"(",
"bytes",
".",
"NewBuffer",
"(",
"bs",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"g",
",",
"nil",
"\n",
"}"
] |
9,484 | all-9485 | [
"MarshalText",
"implements",
"encoding",
".",
"TextMarshaler",
".",
"It",
"will",
"encode",
"a",
"zero",
"if",
"this",
"Int",
"is",
"null",
"."
] | [
"func",
"(",
"i",
"Int",
")",
"MarshalText",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"n",
":=",
"i",
".",
"Int64",
"\n",
"if",
"!",
"i",
".",
"Valid",
"{",
"n",
"=",
"0",
"\n",
"}",
"\n",
"return",
"[",
"]",
"byte",
"(",
"strconv",
".",
"FormatInt",
"(",
"n",
",",
"10",
")",
")",
",",
"nil",
"\n",
"}"
] |
9,485 | all-9486 | [
"GetIndexes",
"provides",
"a",
"mock",
"function",
"with",
"given",
"fields",
":"
] | [
"func",
"(",
"_m",
"*",
"ObjectStoreOptions",
")",
"GetIndexes",
"(",
")",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
"{",
"ret",
":=",
"_m",
".",
"Called",
"(",
")",
"\n\n",
"var",
"r0",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
"\n",
"if",
"rf",
",",
"ok",
":=",
"ret",
".",
"Get",
"(",
"0",
")",
".",
"(",
"func",
"(",
")",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
")",
";",
"ok",
"{",
"r0",
"=",
"rf",
"(",
")",
"\n",
"}",
"else",
"{",
"if",
"ret",
".",
"Get",
"(",
"0",
")",
"!=",
"nil",
"{",
"r0",
"=",
"<mask>",
".",
"Get",
"(",
"0",
")",
".",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"r0",
"\n",
"}"
] |
9,486 | all-9487 | [
"ChMode",
"is",
"used",
"to",
"change",
"users",
"modes",
"in",
"a",
"channel",
"operator",
"=",
"+",
"o",
"deop",
"=",
"-",
"o",
"ban",
"=",
"+",
"b"
] | [
"func",
"(",
"bot",
"*",
"Bot",
")",
"ChMode",
"(",
"user",
",",
"channel",
",",
"mode",
"string",
")",
"{",
"bot",
".",
"Send",
"(",
"\"",
"\"",
"+",
"channel",
"+",
"\"",
"\"",
"+",
"mode",
"+",
"\"",
"\"",
"+",
"<mask>",
")",
"\n",
"}"
] |
9,487 | all-9488 | [
"/",
"*"
] | [
"func",
"MessageWithDiff",
"(",
"actual",
",",
"message",
",",
"expected",
"string",
")",
"string",
"{",
"if",
"TruncatedDiff",
"&&",
"len",
"(",
"actual",
")",
">=",
"truncateThreshold",
"&&",
"len",
"(",
"expected",
")",
">=",
"truncateThreshold",
"{",
"diffPoint",
":=",
"findFirstMismatch",
"(",
"actual",
",",
"expected",
")",
"\n",
"formattedActual",
":=",
"truncateAndFormat",
"(",
"actual",
",",
"diffPoint",
")",
"\n",
"formattedExpected",
":=",
"truncateAndFormat",
"(",
"expected",
",",
"diffPoint",
")",
"\n\n",
"spacesBeforeFormattedMismatch",
":=",
"findFirstMismatch",
"(",
"formattedActual",
",",
"formattedExpected",
")",
"\n\n",
"tabLength",
":=",
"4",
"\n",
"spaceFromMessageToActual",
":=",
"tabLength",
"+",
"len",
"(",
"\"",
"\"",
")",
"-",
"len",
"(",
"message",
")",
"\n",
"padding",
":=",
"strings",
".",
"Repeat",
"(",
"\"",
"\"",
",",
"spaceFromMessageToActual",
"+",
"spacesBeforeFormattedMismatch",
")",
"+",
"\"",
"\"",
"\n",
"return",
"Message",
"(",
"formattedActual",
",",
"message",
"+",
"padding",
",",
"formattedExpected",
")",
"\n",
"}",
"\n",
"return",
"Message",
"(",
"<mask>",
",",
"message",
",",
"expected",
")",
"\n",
"}"
] |
9,488 | all-9489 | [
"GetUserPermission",
"returns",
"the",
"user",
"s",
"permission",
"level",
"for",
"a",
"repo",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"repos",
"/",
"collaborators",
"/",
"#review",
"-",
"a",
"-",
"users",
"-",
"permission",
"-",
"level"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetUserPermission",
"(",
"org",
",",
"repo",
",",
"user",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
",",
"user",
")",
"\n\n",
"<mask>",
"perm",
"struct",
"{",
"Perm",
"string",
"`json:\"permission\"`",
"\n",
"}",
"\n",
"_",
",",
"err",
":=",
"c",
".",
"request",
"(",
"&",
"request",
"{",
"method",
":",
"http",
".",
"MethodGet",
",",
"path",
":",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
",",
"user",
")",
",",
"exitCodes",
":",
"[",
"]",
"int",
"{",
"200",
"}",
",",
"}",
",",
"&",
"perm",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"return",
"perm",
".",
"Perm",
",",
"nil",
"\n",
"}"
] |
9,489 | all-9490 | [
"MustExtract",
"behaves",
"as",
"Extract",
"but",
"panics",
"if",
"an",
"error",
"occurs",
"."
] | [
"func",
"(",
"a",
"Asset",
")",
"MustExtract",
"(",
"typ",
"<mask>",
"{",
"}",
",",
"code",
"interface",
"{",
"}",
",",
"issuer",
"interface",
"{",
"}",
")",
"{",
"err",
":=",
"a",
".",
"Extract",
"(",
"typ",
",",
"code",
",",
"issuer",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
")",
"\n",
"}",
"\n",
"}"
] |
9,490 | all-9491 | [
"Looks",
"up",
"if",
"the",
"origin",
"matches",
"one",
"of",
"the",
"patterns",
"provided",
"in",
"Options",
".",
"AllowOrigins",
"patterns",
"."
] | [
"func",
"(",
"o",
"*",
"Options",
")",
"IsOriginAllowed",
"(",
"origin",
"string",
")",
"(",
"allowed",
"bool",
")",
"{",
"for",
"_",
",",
"<mask>",
":=",
"range",
"o",
".",
"AllowOrigins",
"{",
"allowed",
",",
"_",
"=",
"regexp",
".",
"MatchString",
"(",
"pattern",
",",
"origin",
")",
"\n",
"if",
"allowed",
"{",
"return",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
9,491 | all-9492 | [
"JsonWrite",
"sets",
"response",
"content",
"type",
"to",
"JSON",
"sets",
"HTTP",
"status",
"and",
"serializes",
"defined",
"content",
"to",
"JSON",
"format",
"."
] | [
"func",
"JsonWrite",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"status",
"int",
",",
"<mask>",
"interface",
"{",
"}",
")",
"{",
"HttpHeader_ContentType_Json",
"(",
")",
".",
"SetWriter",
"(",
"w",
".",
"Header",
"(",
")",
")",
"\n",
"w",
".",
"WriteHeader",
"(",
"status",
")",
"\n",
"if",
"content",
"!=",
"nil",
"{",
"json",
".",
"NewEncoder",
"(",
"w",
")",
".",
"Encode",
"(",
"content",
")",
"\n",
"}",
"\n",
"}"
] |
9,492 | all-9493 | [
"RegisterObserver",
"registers",
"a",
"new",
"observer",
"."
] | [
"func",
"(",
"r",
"*",
"Raft",
")",
"RegisterObserver",
"(",
"or",
"*",
"Observer",
")",
"{",
"r",
".",
"observersLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r",
".",
"observersLock",
".",
"Unlock",
"(",
")",
"\n",
"r",
".",
"observers",
"[",
"or",
".",
"<mask>",
"]",
"=",
"or",
"\n",
"}"
] |
9,493 | all-9494 | [
"copy",
"a",
"two",
"-",
"dimensional",
"texture",
"subimage"
] | [
"func",
"CopyTexSubImage2D",
"(",
"target",
"uint32",
",",
"level",
"int32",
",",
"xoffset",
"int32",
",",
"yoffset",
"int32",
",",
"x",
"int32",
",",
"y",
"int32",
",",
"width",
"int32",
",",
"height",
"int32",
")",
"{",
"C",
".",
"glowCopyTexSubImage2D",
"(",
"gpCopyTexSubImage2D",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"target",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"<mask>",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"xoffset",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"yoffset",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"x",
")",
",",
"(",
"C",
".",
"GLint",
")",
"(",
"y",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"width",
")",
",",
"(",
"C",
".",
"GLsizei",
")",
"(",
"height",
")",
")",
"\n",
"}"
] |
9,494 | all-9495 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventRequestIntercepted",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork52",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
9,495 | all-9496 | [
"SetSize",
"changes",
"control",
"size",
".",
"Constant",
"DoNotChange",
"can",
"be",
"used",
"as",
"placeholder",
"to",
"indicate",
"that",
"the",
"control",
"attrubute",
"should",
"be",
"unchanged",
".",
"Method",
"does",
"nothing",
"if",
"new",
"size",
"is",
"less",
"than",
"minimal",
"size",
"CheckBox",
"height",
"cannot",
"be",
"changed",
"-",
"it",
"equals",
"1",
"always"
] | [
"func",
"(",
"c",
"*",
"CheckBox",
")",
"SetSize",
"(",
"width",
",",
"height",
"int",
")",
"{",
"if",
"width",
"!=",
"KeepValue",
"&&",
"(",
"width",
">",
"1000",
"||",
"width",
"<",
"c",
".",
"minW",
")",
"{",
"return",
"\n",
"}",
"\n",
"if",
"height",
"!=",
"KeepValue",
"&&",
"(",
"height",
">",
"200",
"||",
"height",
"<",
"c",
".",
"minH",
")",
"{",
"return",
"\n",
"}",
"\n\n",
"if",
"width",
"!=",
"KeepValue",
"{",
"c",
".",
"width",
"=",
"width",
"\n",
"}",
"\n\n",
"c",
".",
"<mask>",
"=",
"1",
"\n",
"}"
] |
9,496 | all-9497 | [
"cephRBDVolumeExists",
"checks",
"whether",
"a",
"given",
"RBD",
"storage",
"volume",
"exists",
"."
] | [
"func",
"cephRBDVolumeExists",
"(",
"clusterName",
"string",
",",
"poolName",
"string",
",",
"volumeName",
"string",
",",
"volumeType",
"string",
",",
"userName",
"string",
")",
"bool",
"{",
"_",
",",
"err",
":=",
"<mask>",
".",
"RunCommand",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"userName",
",",
"\"",
"\"",
",",
"clusterName",
",",
"\"",
"\"",
",",
"poolName",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"volumeType",
",",
"volumeName",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}"
] |
9,497 | all-9498 | [
"Do",
"executes",
"Animation",
".",
"resolveAnimation",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"remoteObject",
"-",
"Corresponding",
"remote",
"object",
"."
] | [
"func",
"(",
"p",
"*",
"ResolveAnimationParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"remoteObject",
"*",
"runtime",
".",
"RemoteObject",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"ResolveAnimationReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandResolveAnimation",
",",
"p",
",",
"&",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"res",
".",
"RemoteObject",
",",
"nil",
"\n",
"}"
] |
9,498 | all-9499 | [
"ServerOptions",
"for",
"logging",
"RPCs"
] | [
"func",
"ServerOptions",
"(",
"log",
"ttnlog",
".",
"Interface",
")",
"[",
"]",
"grpc",
".",
"ServerOption",
"{",
"return",
"[",
"]",
"grpc",
".",
"ServerOption",
"{",
"grpc",
".",
"UnaryInterceptor",
"(",
"UnaryServerInterceptor",
"(",
"log",
")",
")",
",",
"grpc",
".",
"StreamInterceptor",
"(",
"StreamServerInterceptor",
"(",
"<mask>",
")",
")",
",",
"}",
"\n",
"}"
] |
9,499 | all-9500 | [
"SetState",
"is",
"a",
"wrapper",
"around",
"gtk_style_context_set_state",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"StyleContext",
")",
"SetState",
"(",
"state",
"StateFlags",
")",
"{",
"C",
".",
"gtk_style_context_set_state",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkStateFlags",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.