id int32 0 25.3k | idx stringlengths 5 9 | nl_tokens listlengths 1 418 | pl_tokens listlengths 22 4.98k |
|---|---|---|---|
7,100 | all-7101 | [
"openLast",
"opens",
"the",
"last",
"wal",
"file",
"for",
"read",
"and",
"write",
"."
] | [
"func",
"openLast",
"(",
"lg",
"*",
"zap",
".",
"Logger",
",",
"dirpath",
"string",
")",
"(",
"*",
"fileutil",
".",
"LockedFile",
",",
"error",
")",
"{",
"names",
",",
"err",
":=",
"readWALNames",
"(",
"lg",
",",
"dirpath",
")",
"\n",
"if",
"err",
... |
7,101 | all-7102 | [
"PushNoteToChannel",
"pushes",
"a",
"note",
"with",
"title",
"and",
"body",
"to",
"a",
"specific",
"PushBullet",
"channel",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"PushNoteToChannel",
"(",
"tag",
"string",
",",
"title",
",",
"body",
"string",
")",
"error",
"{",
"data",
":=",
"Note",
"{",
"Tag",
":",
"<mask>",
",",
"Type",
":",
"\"",
"\"",
",",
"Title",
":",
"title",
",",... |
7,102 | all-7103 | [
"NewMockClientCreator",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockClientCreator",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockClientCreator",
"{",
"mock",
":=",
"&",
"MockClientCreator",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockClientCreatorMockRecorder",
"{",... |
7,103 | all-7104 | [
"Body",
"sets",
"the",
"request",
"body",
"to",
"the",
"given",
"reader",
"."
] | [
"func",
"(",
"r",
"*",
"RequestBuilder",
")",
"Body",
"(",
"body",
"io",
".",
"Reader",
")",
"*",
"RequestBuilder",
"{",
"r",
".",
"body",
"=",
"<mask>",
"\n",
"return",
"r",
"\n",
"}"
] |
7,104 | all-7105 | [
"SetClip",
"is",
"a",
"wrapper",
"around",
"gtk_widget_set_clip",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Widget",
")",
"SetClip",
"(",
"<mask>",
"*",
"Allocation",
")",
"{",
"C",
".",
"gtk_widget_set_clip",
"(",
"v",
".",
"native",
"(",
")",
",",
"clip",
".",
"native",
"(",
")",
")",
"\n",
"}"
] |
7,105 | all-7106 | [
"GetShowBorder",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_notebook_get_show_border",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Notebook",
")",
"GetShowBorder",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_notebook_get_show_border",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
7,106 | all-7107 | [
"HandleEvent",
"is",
"a",
"wrapper",
"around",
"gtk_search_bar_handle_event",
"()"
] | [
"func",
"(",
"v",
"*",
"SearchBar",
")",
"HandleEvent",
"(",
"event",
"*",
"gdk",
".",
"<mask>",
")",
"{",
"e",
":=",
"(",
"*",
"C",
".",
"GdkEvent",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"event",
".",
"Native",
"(",
")",
")",
")",
"\n",
"C"... |
7,107 | all-7108 | [
"isManifestInvalidError",
"returns",
"true",
"iff",
"err",
"from",
"client",
".",
"HandleErrorReponse",
"is",
"a",
"“manifest",
"invalid”",
"error",
"."
] | [
"func",
"isManifestInvalidError",
"(",
"err",
"error",
")",
"bool",
"{",
"errors",
",",
"ok",
":=",
"err",
".",
"(",
"errcode",
".",
"Errors",
")",
"\n",
"if",
"!",
"ok",
"||",
"len",
"(",
"errors",
")",
"==",
"0",
"{",
"return",
"false",
"\n",
"}"... |
7,108 | all-7109 | [
"Panic",
"application",
"but",
"deinit",
"first",
"so",
"that",
"the",
"terminal",
"will",
"not",
"be",
"corrupt",
"."
] | [
"func",
"Panic",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"termbox",
".",
"Close",
"(",
")",
"\n",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"<mask>",
",",
"args",
"...",
")",
"\n",
"panic",
"(",
"msg",
")",
"\... |
7,109 | all-7110 | [
"Parse",
"discovers",
"the",
"given",
"parameters",
"structure",
"and",
"associates",
"the",
"structure",
"s",
"field",
"names",
"with",
"their",
"values",
"into",
"the",
"Params",
"structure",
"."
] | [
"func",
"(",
"p",
"*",
"Params",
")",
"Parse",
"(",
"pvalue",
"*",
"reflect",
".",
"Value",
")",
"error",
"{",
"vtype",
":=",
"pvalue",
".",
"Type",
"(",
")",
".",
"Elem",
"(",
")",
"\n\n",
"for",
"idx",
":=",
"0",
";",
"idx",
"<",
"vtype",
"."... |
7,110 | all-7111 | [
"Returns",
"true",
"if",
"AppArmor",
"stacking",
"support",
"is",
"available",
"."
] | [
"func",
"appArmorCanStack",
"(",
")",
"bool",
"{",
"contentBytes",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"if",
"string",
"(",
"contentBytes",
")",
... |
7,111 | all-7112 | [
"ConvertErrorStatus",
"creates",
"an",
"error",
"that",
"implements",
"ErrorStatus",
"based",
"off",
"an",
"error"
] | [
"func",
"ConvertErrorStatus",
"(",
"status",
"int",
",",
"err",
"error",
")",
"error",
"{",
"return",
"&",
"errStatus",
"{",
"error",
":",
"err",
",",
"<mask>",
":",
"status",
",",
"}",
"\n",
"}"
] |
7,112 | all-7113 | [
"revokeUserCredentials",
"revokes",
"the",
"Pachyderm",
"authentication",
"token",
"userToken",
"using",
"the",
"vault",
"plugin",
"s",
"Admin",
"credentials",
"."
] | [
"func",
"revokeUserCredentials",
"(",
"ctx",
"<mask>",
".",
"Context",
",",
"pachdAddress",
"string",
",",
"userToken",
"string",
",",
"adminToken",
"string",
")",
"error",
"{",
"// Setup a single use client w the given admin token / address",
"client",
",",
"err",
":="... |
7,113 | all-7114 | [
"Snapshot",
"returns",
"a",
"Distribution"
] | [
"func",
"(",
"r",
"*",
"Reservoir",
")",
"Snapshot",
"(",
")",
"Distribution",
"{",
"h",
":=",
"newHistogram",
"(",
"defaultHistogramSize",
")",
"\n",
"r",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"h",
"=",
"r",
".",
"hist",
".",
"Copy",
"(",
"h",
... |
7,114 | all-7115 | [
"Generate",
"random",
"number",
"in",
"[",
"0",
"n",
")"
] | [
"func",
"GenerateRandomInt",
"(",
"<mask>",
",",
"max",
"int",
")",
"int",
"{",
"return",
"int",
"(",
"GenerateRandomInt64",
"(",
"int64",
"(",
"min",
")",
",",
"int64",
"(",
"max",
")",
")",
")",
"\n",
"}"
] |
7,115 | all-7116 | [
"gets",
"the",
"pull",
"commit",
"hash",
"from",
"metadata"
] | [
"func",
"getPullCommitHash",
"(",
"pull",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"match",
":=",
"pullCommitRe",
".",
"FindStringSubmatch",
"(",
"pull",
")",
"\n",
"if",
"len",
"(",
"<mask>",
")",
"!=",
"2",
"{",
"expected",
":=",
"\"",
"... |
7,116 | all-7117 | [
"Find",
"a",
"task",
"by",
"index",
"path",
"returning",
"the",
"highest",
"-",
"rank",
"task",
"with",
"that",
"path",
".",
"If",
"no",
"task",
"exists",
"for",
"the",
"given",
"path",
"this",
"API",
"end",
"-",
"point",
"will",
"respond",
"with",
"a"... | [
"func",
"(",
"index",
"*",
"Index",
")",
"FindTask",
"(",
"indexPath",
"string",
")",
"(",
"*",
"IndexedTaskResponse",
",",
"error",
")",
"{",
"<mask>",
":=",
"tcclient",
".",
"Client",
"(",
"*",
"index",
")",
"\n",
"responseObject",
",",
"_",
",",
"er... |
7,117 | all-7118 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"DescribeNodeParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom73",
"(",
"&",
"w",
",",
"v",
")",
... |
7,118 | all-7119 | [
"Render",
"implements",
"the",
"Render",
"interface",
".",
"This",
"is",
"called",
"from",
"queue",
"context",
"so",
"be",
"careful",
"to",
"not",
"use",
"blocking",
"calls",
"."
] | [
"func",
"(",
"e",
"*",
"Edit",
")",
"Render",
"(",
")",
"{",
"if",
"e",
".",
"visibility",
"==",
"VisibilityHide",
"{",
"e",
".",
"clear",
"(",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"filler",
":=",
"\"",
"\"",
"\n",
"l",
":=",
"e",
".",
"disp... |
7,119 | all-7120 | [
"appendVertices",
"appends",
"vertices",
"to",
"the",
"queue",
"."
] | [
"func",
"(",
"q",
"*",
"commandQueue",
")",
"appendVertices",
"(",
"vertices",
"[",
"]",
"float32",
")",
"{",
"if",
"len",
"(",
"q",
".",
"vertices",
")",
"<",
"q",
".",
"nvertices",
"+",
"len",
"(",
"vertices",
")",
"{",
"n",
":=",
"q",
".",
"nv... |
7,120 | all-7121 | [
"SetMultipartFormBoundary",
"sets",
"the",
"following",
"Content",
"-",
"Type",
":",
"multipart",
"/",
"form",
"-",
"data",
";",
"boundary",
"=",
"...",
"where",
"...",
"is",
"substituted",
"by",
"the",
"given",
"boundary",
"."
] | [
"func",
"(",
"h",
"*",
"RequestHeader",
")",
"SetMultipartFormBoundary",
"(",
"boundary",
"string",
")",
"{",
"h",
".",
"parseRawHeaders",
"(",
")",
"\n\n",
"b",
":=",
"h",
".",
"bufKV",
".",
"value",
"[",
":",
"0",
"]",
"\n",
"b",
"=",
"append",
"("... |
7,121 | all-7122 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"PositionTickInfo",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoProfiler18",
"(",
"&",
"... |
7,122 | all-7123 | [
"DrawTextVertical",
"draws",
"the",
"part",
"of",
"text",
"that",
"is",
"inside",
"the",
"current",
"clipping",
"rectangle",
".",
"DrawTextVertical",
"always",
"paints",
"colorized",
"string",
".",
"If",
"you",
"want",
"to",
"draw",
"raw",
"string",
"then",
"u... | [
"func",
"DrawTextVertical",
"(",
"x",
",",
"y",
"int",
",",
"text",
"string",
")",
"{",
"PushAttributes",
"(",
")",
"\n",
"defer",
"PopAttributes",
"(",
")",
"\n\n",
"defText",
",",
"defBack",
":=",
"TextColor",
"(",
")",
",",
"BackColor",
"(",
")",
"\... |
7,123 | all-7124 | [
"Move",
"moves",
"the",
"cursor",
"over",
"in",
"relative",
"terms",
"by",
"shift",
"indices",
"."
] | [
"func",
"(",
"c",
"*",
"Cursor",
")",
"Move",
"(",
"shift",
"int",
")",
"{",
"// delete the current cursor",
"c",
".",
"Position",
"=",
"c",
".",
"Position",
"+",
"<mask>",
"\n",
"c",
".",
"correctPosition",
"(",
")",
"\n",
"}"
] |
7,124 | all-7125 | [
"Recursively",
"record",
"all",
"type",
"declarations"
] | [
"func",
"(",
"p",
"*",
"ParamAnalyzer",
")",
"recordTypes",
"(",
"root",
"gen",
".",
"DataType",
")",
"{",
"if",
"o",
",",
"ok",
":=",
"root",
".",
"(",
"*",
"gen",
".",
"ObjectDataType",
")",
";",
"ok",
"{",
"if",
"_",
",",
"found",
":=",
"p",
... |
7,125 | all-7126 | [
"FindByLink",
"finds",
"exactly",
"one",
"anchor",
"element",
"by",
"its",
"text",
"content",
"."
] | [
"func",
"(",
"s",
"*",
"selectable",
")",
"FindByLink",
"(",
"text",
"string",
")",
"*",
"Selection",
"{",
"return",
"newSelection",
"(",
"s",
".",
"session",
",",
"s",
".",
"selectors",
".",
"Append",
"(",
"target",
".",
"Link",
",",
"<mask>",
")",
... |
7,126 | all-7127 | [
"NewInflationResult",
"creates",
"a",
"new",
"InflationResult",
"."
] | [
"func",
"NewInflationResult",
"(",
"<mask>",
"InflationResultCode",
",",
"value",
"interface",
"{",
"}",
")",
"(",
"result",
"InflationResult",
",",
"err",
"error",
")",
"{",
"result",
".",
"Code",
"=",
"code",
"\n",
"switch",
"InflationResultCode",
"(",
"code... |
7,127 | all-7128 | [
"GetProperty",
"is",
"a",
"wrapper",
"around",
"g_object_get_property",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Object",
")",
"GetProperty",
"(",
"name",
"string",
")",
"(",
"<mask>",
"{",
"}",
",",
"error",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"name",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",... |
7,128 | all-7129 | [
"TimeoutHandler",
"creates",
"RequestHandler",
"which",
"returns",
"StatusRequestTimeout",
"error",
"with",
"the",
"given",
"msg",
"to",
"the",
"client",
"if",
"h",
"didn",
"t",
"return",
"during",
"the",
"given",
"duration",
".",
"The",
"returned",
"handler",
"... | [
"func",
"TimeoutHandler",
"(",
"h",
"RequestHandler",
",",
"timeout",
"<mask>",
".",
"Duration",
",",
"msg",
"string",
")",
"RequestHandler",
"{",
"if",
"timeout",
"<=",
"0",
"{",
"return",
"h",
"\n",
"}",
"\n\n",
"return",
"func",
"(",
"ctx",
"*",
"Requ... |
7,129 | all-7130 | [
"newSizeHistogram",
"returns",
"a",
"new",
"instance",
"of",
"keyValueSizeHistogram",
"with",
"properly",
"initialized",
"fields",
"."
] | [
"func",
"newSizeHistogram",
"(",
")",
"*",
"sizeHistogram",
"{",
"// TODO(ibrahim): find appropriate bin size.",
"keyBins",
":=",
"createHistogramBins",
"(",
"1",
",",
"16",
")",
"\n",
"valueBins",
":=",
"createHistogramBins",
"(",
"1",
",",
"30",
")",
"\n",
"retu... |
7,130 | all-7131 | [
"NewOrdered",
"creates",
"a",
"new",
"ordered",
"hashtree",
"."
] | [
"func",
"NewOrdered",
"(",
"root",
"string",
")",
"*",
"Ordered",
"{",
"root",
"=",
"clean",
"(",
"root",
")",
"\n",
"o",
":=",
"&",
"Ordered",
"{",
"}",
"\n",
"n",
":=",
"&",
"node",
"{",
"path",
":",
"\"",
"\"",
",",
"nodeProto",
":",
"&",
"N... |
7,131 | all-7132 | [
"/",
"*",
"Reshape",
"changes",
"shape",
"of",
"the",
"image",
"without",
"copying",
"data",
".",
"A",
"value",
"of",
"0",
"means",
"that",
"channels",
"or",
"rows",
"remain",
"unchanged",
"."
] | [
"func",
"(",
"img",
"*",
"IplImage",
")",
"Reshape",
"(",
"channels",
",",
"rows",
",",
"_type",
"int",
")",
"*",
"Mat",
"{",
"total",
":=",
"img",
".",
"Width",
"(",
")",
"*",
"img",
".",
"Height",
"(",
")",
"\n",
"header",
":=",
"CreateMat",
"(... |
7,132 | all-7133 | [
"Add1",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_paned_add1",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Paned",
")",
"Add1",
"(",
"<mask>",
"IWidget",
")",
"{",
"C",
".",
"gtk_paned_add1",
"(",
"v",
".",
"native",
"(",
")",
",",
"child",
".",
"toWidget",
"(",
")",
")",
"\n",
"}"
] |
7,133 | all-7134 | [
"mergeConfig",
"merges",
"two",
"JobConfig",
"together",
"It",
"will",
"try",
"to",
"merge",
":",
"-",
"Presubmits",
"-",
"Postsubmits",
"-",
"Periodics",
"-",
"PodPresets"
] | [
"func",
"(",
"c",
"*",
"Config",
")",
"mergeJobConfig",
"(",
"jc",
"JobConfig",
")",
"error",
"{",
"// Merge everything",
"// *** Presets ***",
"c",
".",
"Presets",
"=",
"append",
"(",
"c",
".",
"Presets",
",",
"jc",
".",
"Presets",
"...",
")",
"\n\n",
"... |
7,134 | all-7135 | [
"CallPeer",
"makes",
"a",
"JSON",
"call",
"using",
"the",
"given",
"peer",
"."
] | [
"func",
"CallPeer",
"(",
"ctx",
"<mask>",
",",
"peer",
"*",
"tchannel",
".",
"Peer",
",",
"serviceName",
",",
"method",
"string",
",",
"arg",
",",
"resp",
"interface",
"{",
"}",
")",
"error",
"{",
"call",
",",
"err",
":=",
"peer",
".",
"BeginCall",
"... |
7,135 | all-7136 | [
"KeyValue",
"creates",
"a",
"Key",
"/",
"Value",
"pair",
"that",
"is",
"suitable",
"for",
"use",
"in",
"the",
"LogMessage",
"()",
"function"
] | [
"func",
"KeyValue",
"(",
"key",
"string",
",",
"val",
"interface",
"{",
"}",
")",
"keyval",
"{",
"return",
"keyval",
"{",
"key",
":",
"<mask>",
",",
"val",
":",
"val",
"}",
"\n",
"}"
] |
7,136 | all-7137 | [
"GetMetricQuery",
"returns",
"the",
"MetricQuery",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"s",
"*",
"ScatterplotRequest",
")",
"GetMetricQuery",
"(",
")",
"<mask>",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"MetricQuery",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"s",
".",
"MetricQuery",
"\n",... |
7,137 | all-7138 | [
"assign",
"emits",
"to",
"fn",
"code",
"to",
"initialize",
"the",
"lvalue",
"loc",
"with",
"the",
"value",
"of",
"expression",
"e",
".",
"If",
"isZero",
"is",
"true",
"assign",
"assumes",
"that",
"loc",
"holds",
"the",
"zero",
"value",
"for",
"its",
"typ... | [
"func",
"(",
"b",
"*",
"builder",
")",
"assign",
"(",
"fn",
"*",
"Function",
",",
"loc",
"lvalue",
",",
"e",
"ast",
".",
"Expr",
",",
"isZero",
"bool",
",",
"sb",
"*",
"storebuf",
")",
"{",
"// Can we initialize it in place?",
"if",
"e",
",",
"ok",
"... |
7,138 | all-7139 | [
"export",
"FileSequence_String"
] | [
"func",
"FileSequence_String",
"(",
"id",
"FileSeqId",
")",
"*",
"C",
".",
"char",
"{",
"fs",
",",
"ok",
":=",
"sFileSeqs",
".",
"Get",
"(",
"id",
")",
"\n",
"// caller must free string",
"if",
"!",
"ok",
"{",
"return",
"C",
".",
"CString",
"(",
"\"",
... |
7,139 | all-7140 | [
"SelectRange",
"is",
"a",
"wrapper",
"around",
"gtk_text_buffer_select_range",
"."
] | [
"func",
"(",
"v",
"*",
"TextBuffer",
")",
"SelectRange",
"(",
"start",
",",
"<mask>",
"*",
"TextIter",
")",
"{",
"C",
".",
"gtk_text_buffer_select_range",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"GtkTextIter",
")",
"(",
"start",
"... |
7,140 | all-7141 | [
"The",
"node",
"ID",
"of",
"the",
"source",
"of",
"this",
"Msg",
".",
"Returns",
"nil",
"if",
"it",
"isn",
"t",
"present",
".",
"TODO",
":",
"Can",
"we",
"verify",
"Msgs",
"more",
"aggressively",
"so",
"this",
"is",
"guaranteed",
"to",
"return",
"a",
... | [
"func",
"(",
"m",
"Msg",
")",
"SenderID",
"(",
")",
"*",
"ID",
"{",
"switch",
"m",
".",
"Y",
"{",
"case",
"\"",
"\"",
":",
"if",
"m",
".",
"A",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"&",
"m",
".",
"A",
".",
"ID",
"... |
7,141 | all-7142 | [
"Body",
"returns",
"response",
"body",
".",
"The",
"returned",
"body",
"is",
"valid",
"until",
"the",
"response",
"modification",
"."
] | [
"func",
"(",
"resp",
"*",
"<mask>",
")",
"Body",
"(",
")",
"[",
"]",
"byte",
"{",
"if",
"resp",
".",
"bodyStream",
"!=",
"nil",
"{",
"bodyBuf",
":=",
"resp",
".",
"bodyBuffer",
"(",
")",
"\n",
"bodyBuf",
".",
"Reset",
"(",
")",
"\n",
"_",
",",
... |
7,142 | all-7143 | [
"Labels",
"returns",
"the",
"labels",
"to",
"apply",
"to",
"the",
"issue",
"created",
"for",
"this",
"cluster",
"on",
"github",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"Labels",
"(",
")",
"[",
"]",
"string",
"{",
"labels",
":=",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
"\n\n",
"topTests",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"c",
".",
"Tests",
")",
... |
7,143 | all-7144 | [
"/",
"*",
"Identify",
"the",
"beginning",
"of",
"a",
"segment",
"that",
"performs",
"an",
"external",
"service",
"."
] | [
"func",
"SegmentExternalBegin",
"(",
"<mask>",
",",
"parent",
"int64",
",",
"host",
",",
"name",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"cname",
":=",
"C",
".",
"CString",
"(",
"name",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe"... |
7,144 | all-7145 | [
"UUIDsForMOIDs",
"returns",
"a",
"MOIDForUUIDResults",
"for",
"a",
"list",
"of",
"MOIDs",
".",
"If",
"one",
"MOID",
"cannot",
"be",
"found",
"an",
"error",
"is",
"returned",
".",
"There",
"are",
"no",
"partial",
"results",
"returned",
"."
] | [
"func",
"UUIDsForMOIDs",
"(",
"client",
"*",
"govmomi",
".",
"Client",
",",
"moids",
"[",
"]",
"string",
")",
"(",
"MOIDForUUIDResults",
",",
"error",
")",
"{",
"var",
"<mask>",
"MOIDForUUIDResults",
"\n",
"for",
"_",
",",
"uuid",
":=",
"range",
"moids",
... |
7,145 | all-7146 | [
"PrintFunc",
"outputs",
"Print",
"log",
"returned",
"from",
"the",
"function"
] | [
"func",
"PrintFunc",
"(",
"f",
"func",
"(",
")",
"string",
")",
"error",
"{",
"if",
"isModeEnable",
"(",
"PRINT",
")",
"{",
"return",
"glg",
".",
"<mask>",
"(",
"PRINT",
",",
"\"",
"\"",
",",
"f",
"(",
")",
")",
"\n",
"}",
"\n",
"return",
"nil",
... |
7,146 | all-7147 | [
"GetType",
"returns",
"the",
"Type",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"m",
"*",
"Metric",
")",
"GetType",
"(",
")",
"string",
"{",
"if",
"m",
"==",
"nil",
"||",
"m",
".",
"Type",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"m",
".",
"<mask>",
"\n",
"}"
] |
7,147 | all-7148 | [
"RawWebsocket",
"allows",
"directly",
"connection",
"to",
"LXD",
"API",
"websockets",
"This",
"should",
"only",
"be",
"used",
"by",
"internal",
"LXD",
"tools",
"."
] | [
"func",
"(",
"r",
"*",
"ProtocolLXD",
")",
"RawWebsocket",
"(",
"path",
"string",
")",
"(",
"*",
"websocket",
".",
"Conn",
",",
"error",
")",
"{",
"return",
"r",
".",
"websocket",
"(",
"<mask>",
")",
"\n",
"}"
] |
7,148 | all-7149 | [
"resolveTCPAddrs",
"is",
"a",
"convenience",
"wrapper",
"for",
"net",
".",
"ResolveTCPAddr",
".",
"resolveTCPAddrs",
"return",
"a",
"new",
"set",
"of",
"url",
".",
"URLs",
"in",
"which",
"all",
"DNS",
"hostnames",
"are",
"resolved",
"."
] | [
"func",
"resolveTCPAddrs",
"(",
"ctx",
"context",
".",
"Context",
",",
"lg",
"*",
"zap",
".",
"Logger",
",",
"urls",
"[",
"]",
"[",
"]",
"url",
".",
"URL",
")",
"(",
"[",
"]",
"[",
"]",
"url",
".",
"URL",
",",
"error",
")",
"{",
"newurls",
":="... |
7,149 | all-7150 | [
"/",
"*",
"ProcessEvent",
"processes",
"all",
"events",
"come",
"from",
"the",
"control",
"parent",
".",
"If",
"a",
"control",
"processes",
"an",
"event",
"it",
"should",
"return",
"true",
".",
"If",
"the",
"method",
"returns",
"false",
"it",
"means",
"tha... | [
"func",
"(",
"l",
"*",
"TextView",
")",
"ProcessEvent",
"(",
"event",
"Event",
")",
"bool",
"{",
"if",
"!",
"l",
".",
"Active",
"(",
")",
"||",
"!",
"l",
".",
"Enabled",
"(",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"switch",
"event",
".",... |
7,150 | all-7151 | [
"Close",
"closes",
"current",
"connection",
"to",
"Sentinel",
"."
] | [
"func",
"(",
"s",
"*",
"Sentinel",
")",
"Close",
"(",
")",
"error",
"{",
"s",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"s",
".",
"<mask>",
"(",
")",
"\n",
"s",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
7,151 | all-7152 | [
"Finish",
"finishes",
"the",
"table",
"by",
"appending",
"the",
"index",
"."
] | [
"func",
"(",
"b",
"*",
"Builder",
")",
"Finish",
"(",
")",
"[",
"]",
"byte",
"{",
"bf",
":=",
"bbloom",
".",
"New",
"(",
"float64",
"(",
"b",
".",
"keyCount",
")",
",",
"0.01",
")",
"\n",
"var",
"klen",
"[",
"2",
"]",
"byte",
"\n",
"key",
":=... |
7,152 | all-7153 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"WebSocketRequest",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork1",
"(",
"&",
"... |
7,153 | all-7154 | [
"OnStart",
"implements",
"BaseService"
] | [
"func",
"(",
"r",
"*",
"PEXReactor",
")",
"OnStart",
"(",
")",
"error",
"{",
"r",
".",
"BaseReactor",
".",
"OnStart",
"(",
")",
"\n",
"r",
".",
"<mask>",
".",
"Start",
"(",
")",
"\n",
"go",
"r",
".",
"ensurePeersRoutine",
"(",
")",
"\n",
"go",
"r... |
7,154 | all-7155 | [
"WithScale",
"scale",
"to",
"apply",
"to",
"resulting",
"view",
"image",
"."
] | [
"func",
"(",
"p",
"SetDeviceMetricsOverrideParams",
")",
"WithScale",
"(",
"<mask>",
"float64",
")",
"*",
"SetDeviceMetricsOverrideParams",
"{",
"p",
".",
"Scale",
"=",
"scale",
"\n",
"return",
"&",
"p",
"\n",
"}"
] |
7,155 | all-7156 | [
"Records",
"returns",
"the",
"list",
"of",
"records",
"."
] | [
"func",
"(",
"p",
"designateProvider",
")",
"Records",
"(",
")",
"(",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
",",
"error",
")",
"{",
"var",
"result",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
"\n",
"managedZones",
",",
"err",
":=",
"p",
".",
... |
7,156 | all-7157 | [
"Count",
"loads",
"the",
"row",
"count",
"for",
"the",
"provided",
"dataset",
".",
"tablename"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"Count",
"(",
"dataset",
",",
"project",
",",
"datasetTable",
"string",
")",
"int64",
"{",
"qstr",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"datasetTable",
")",
"\n",
"<mask>",
",",
"err",
":=",
"c",
... |
7,157 | all-7158 | [
"hasLocalMember",
"checks",
"that",
"the",
"cluster",
"at",
"least",
"contains",
"the",
"local",
"server",
"."
] | [
"func",
"(",
"c",
"*",
"ServerConfig",
")",
"hasLocalMember",
"(",
")",
"error",
"{",
"if",
"urls",
":=",
"c",
".",
"InitialPeerURLsMap",
"[",
"c",
".",
"<mask>",
"]",
";",
"urls",
"==",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
... |
7,158 | all-7159 | [
"SubscribeAsync",
"subscribes",
"to",
"a",
"topic",
"with",
"an",
"asynchronous",
"callback",
"Transactional",
"determines",
"whether",
"subsequent",
"callbacks",
"for",
"a",
"topic",
"are",
"run",
"serially",
"(",
"true",
")",
"or",
"concurrently",
"(",
"false",
... | [
"func",
"(",
"bus",
"*",
"EventBus",
")",
"SubscribeAsync",
"(",
"topic",
"string",
",",
"fn",
"interface",
"{",
"}",
",",
"transactional",
"bool",
")",
"error",
"{",
"return",
"bus",
".",
"doSubscribe",
"(",
"topic",
",",
"fn",
",",
"&",
"eventHandler",... |
7,159 | all-7160 | [
"notify",
"function",
"notifies",
"the",
"watcher",
".",
"If",
"the",
"watcher",
"interests",
"in",
"the",
"given",
"path",
"the",
"function",
"will",
"return",
"true",
"."
] | [
"func",
"(",
"w",
"*",
"watcher",
")",
"notify",
"(",
"e",
"*",
"Event",
",",
"originalPath",
"bool",
",",
"deleted",
"bool",
")",
"bool",
"{",
"// watcher is interested the path in three cases and under one condition",
"// the condition is that the event happens after the ... |
7,160 | all-7161 | [
"splitN",
"creates",
"N",
"Enumerators",
"each",
"will",
"be",
"a",
"subset",
"of",
"the",
"original",
"Enumerator",
"and",
"will",
"have",
"distinct",
"populations",
"from",
"one",
"another",
"."
] | [
"func",
"(",
"iter",
"Enumerator",
")",
"splitN",
"(",
"operation",
"Transform",
",",
"n",
"uint",
")",
"[",
"]",
"Enumerator",
"{",
"results",
",",
"cast",
":=",
"make",
"(",
"[",
"]",
"chan",
"interface",
"{",
"}",
",",
"n",
",",
"n",
")",
",",
... |
7,161 | all-7162 | [
"TODO",
":",
"This",
"could",
"use",
"a",
"unit",
"test",
"."
] | [
"func",
"parseSwarm",
"(",
"hostURL",
"string",
",",
"h",
"*",
"host",
".",
"Host",
")",
"(",
"string",
",",
"error",
")",
"{",
"swarmOptions",
":=",
"h",
".",
"HostOptions",
".",
"SwarmOptions",
"\n\n",
"if",
"!",
"swarmOptions",
".",
"Master",
"{",
"... |
7,162 | all-7163 | [
"Sign",
"creates",
"a",
"signature",
"for",
"buf",
"returning",
"it",
"as",
"a",
"URL",
"-",
"safe",
"base64",
"encoded",
"byte",
"slice",
"."
] | [
"func",
"(",
"hs",
"*",
"HmacSigner",
")",
"Sign",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"sig",
",",
"err",
":=",
"hs",
".",
"SignBytes",
"(",
"buf",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ret... |
7,163 | all-7164 | [
"CopyState",
"copies",
"the",
"alerting",
"rule",
"and",
"staleness",
"related",
"state",
"from",
"the",
"given",
"group",
".",
"Rules",
"are",
"matched",
"based",
"on",
"their",
"name",
"and",
"labels",
".",
"If",
"there",
"are",
"duplicates",
"the",
"first... | [
"func",
"(",
"g",
"*",
"Group",
")",
"CopyState",
"(",
"from",
"*",
"Group",
")",
"{",
"g",
".",
"evaluationDuration",
"=",
"from",
".",
"evaluationDuration",
"\n\n",
"ruleMap",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"int",
",",
"len... |
7,164 | all-7165 | [
"removeExpired",
"remove",
"all",
"expired",
"values",
"from",
"current",
"Cache",
"instance",
"list",
".",
"Returns",
"the",
"locking",
"status",
"of",
"current",
"instance",
"."
] | [
"func",
"(",
"s",
"*",
"Cache",
")",
"removeExpired",
"(",
")",
"raiqub",
".",
"LockStatus",
"{",
"writeLocked",
":=",
"false",
"\n",
"s",
".",
"RLock",
"(",
")",
"\n",
"for",
"i",
":=",
"range",
"s",
".",
"<mask>",
"{",
"if",
"s",
".",
"values",
... |
7,165 | all-7166 | [
"NewMockECRFactory",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockECRFactory",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockECRFactory",
"{",
"mock",
":=",
"&",
"MockECRFactory",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockECRFactoryMockRecorder",
"{",
"mock",
... |
7,166 | all-7167 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetScrollbarsHiddenParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoEmulation4",
"(",
"&",
"w",
",",
... |
7,167 | all-7168 | [
"Fatalf",
"logging"
] | [
"func",
"(",
"l",
"*",
"MyLogger",
")",
"Fatalf",
"(",
"msg",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"log",
".",
"Panicf",
"(",
"<mask>",
",",
"args",
"...",
")",
"\n",
"}"
] |
7,168 | all-7169 | [
"MutateManageOffer",
"for",
"Rate",
"sets",
"the",
"ManageOfferOp",
"s",
"selling",
"buying",
"and",
"price",
"fields"
] | [
"func",
"(",
"m",
"Rate",
")",
"MutateManageOffer",
"(",
"o",
"interface",
"{",
"}",
")",
"(",
"err",
"error",
")",
"{",
"switch",
"o",
":=",
"o",
".",
"(",
"type",
")",
"{",
"default",
":",
"err",
"=",
"errors",
".",
"New",
"(",
"\"",
"\"",
")... |
7,169 | all-7170 | [
"MarkDay",
"is",
"a",
"wrapper",
"around",
"gtk_calendar_mark_day",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Calendar",
")",
"MarkDay",
"(",
"day",
"uint",
")",
"{",
"C",
".",
"gtk_calendar_mark_day",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"guint",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
7,170 | all-7171 | [
"ConnectSignals",
"is",
"a",
"wrapper",
"around",
"gtk_builder_connect_signals_full",
"()",
"."
] | [
"func",
"(",
"b",
"*",
"Builder",
")",
"ConnectSignals",
"(",
"signals",
"map",
"[",
"string",
"]",
"<mask>",
"{",
"}",
")",
"{",
"builderSignals",
".",
"Lock",
"(",
")",
"\n",
"builderSignals",
".",
"m",
"[",
"b",
".",
"native",
"(",
")",
"]",
"="... |
7,171 | all-7172 | [
"ReceiveIssue",
"creates",
"a",
"fake",
"opened",
"event"
] | [
"func",
"(",
"o",
"*",
"FakeOpenPluginWrapper",
")",
"ReceiveIssue",
"(",
"issue",
"sql",
".",
"Issue",
")",
"[",
"]",
"Point",
"{",
"if",
"_",
",",
"ok",
":=",
"o",
".",
"alreadyOpen",
"[",
"issue",
".",
"ID",
"]",
";",
"!",
"<mask>",
"{",
"// Cre... |
7,172 | all-7173 | [
"NewGraphicContext",
"creates",
"a",
"new",
"Graphic",
"context",
"from",
"an",
"image",
"."
] | [
"func",
"NewGraphicContext",
"(",
"img",
"draw",
".",
"Image",
")",
"*",
"GraphicContext",
"{",
"var",
"painter",
"Painter",
"\n",
"switch",
"selectImage",
":=",
"img",
".",
"(",
"type",
")",
"{",
"<mask>",
"*",
"image",
".",
"RGBA",
":",
"painter",
"=",... |
7,173 | all-7174 | [
"Send",
"implements",
"TCPSender",
"by",
"encoding",
"the",
"msg",
"."
] | [
"func",
"(",
"sender",
"*",
"gobTCPSender",
")",
"Send",
"(",
"msg",
"[",
"]",
"<mask>",
")",
"error",
"{",
"return",
"sender",
".",
"encoder",
".",
"Encode",
"(",
"msg",
")",
"\n",
"}"
] |
7,174 | all-7175 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"Type",
")",
"UnmarshalEasyJSON",
"(",
"<mask>",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"Type",
"(",
"in",
".",
"String",
"(",
")",
")",
"{",
"case",
"TypeCSSTransition",
":",
"*",
"t",
"=",
"TypeCSSTransition",
"\n",
... |
7,175 | all-7176 | [
"Do",
"executes",
"Page",
".",
"stopLoading",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"StopLoadingParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandStopLoading",
",",
"nil",
",",
"nil",
")",
"\n",
"}"
] |
7,176 | all-7177 | [
"monitorDiskAndEvict",
"loops",
"monitoring",
"the",
"disk",
"evicting",
"cache",
"entries",
"when",
"the",
"disk",
"passes",
"either",
"minPercentBlocksFree",
"until",
"the",
"disk",
"is",
"above",
"evictUntilPercentBlocksFree"
] | [
"func",
"monitorDiskAndEvict",
"(",
"c",
"*",
"diskcache",
".",
"Cache",
",",
"interval",
"time",
".",
"Duration",
",",
"minPercentBlocksFree",
",",
"evictUntilPercentBlocksFree",
"float64",
",",
")",
"{",
"diskRoot",
":=",
"c",
".",
"DiskRoot",
"(",
")",
"\n"... |
7,177 | all-7178 | [
"GetStringPolicy",
"reads",
"a",
"ResourceData",
"and",
"returns",
"an",
"appropriate",
"StringPolicy",
"for",
"the",
"state",
"of",
"the",
"definition",
".",
"nil",
"is",
"returned",
"if",
"it",
"does",
"not",
"exist",
"."
] | [
"func",
"GetStringPolicy",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"key",
"string",
")",
"*",
"<mask>",
".",
"StringPolicy",
"{",
"v",
",",
"e",
":=",
"d",
".",
"GetOkExists",
"(",
"key",
")",
"\n",
"if",
"e",
"{",
"return",
"StringPolicy",
... |
7,178 | all-7179 | [
"/",
"1",
".",
"0",
"/",
"storage",
"-",
"pools",
"/",
"{",
"pool",
"}",
"/",
"volumes",
"/",
"{",
"type",
"}",
"/",
"{",
"name",
"}",
"Get",
"storage",
"volume",
"of",
"a",
"given",
"volume",
"type",
"on",
"a",
"given",
"storage",
"pool",
"."
] | [
"func",
"storagePoolVolumeTypeGet",
"(",
"d",
"*",
"Daemon",
",",
"r",
"*",
"http",
".",
"Request",
",",
"volumeTypeName",
"string",
")",
"Response",
"{",
"project",
":=",
"projectParam",
"(",
"r",
")",
"\n\n",
"// Get the name of the storage volume.",
"var",
"v... |
7,179 | all-7180 | [
"JSONUnmarshal",
"decodes",
"data",
"into",
"v",
"and",
"returns",
"json",
".",
"SyntaxError",
"and",
"json",
".",
"UnmarshalTypeError",
"formated",
"with",
"additional",
"information",
"."
] | [
"func",
"JSONUnmarshal",
"(",
"data",
"[",
"]",
"byte",
",",
"v",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"data",
",",
"v",
")",
";",
"err",
"!=",
"nil",
"{",
"switch",
"e",
":=",
"err",
".",
... |
7,180 | all-7181 | [
"Delete",
"all",
"items",
"from",
"the",
"cache",
"."
] | [
"func",
"(",
"c",
"*",
"cache",
")",
"Flush",
"(",
")",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"c",
".",
"items",
"=",
"<mask>",
"[",
"string",
"]",
"Item",
"{",
"}",
"\n",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"}"
] |
7,181 | all-7182 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"ViolationSetting",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog",
"(",
"&",
"r",
... |
7,182 | all-7183 | [
"Valid",
"returns",
"whether",
"the",
"MergeIterator",
"is",
"at",
"a",
"valid",
"element",
"."
] | [
"func",
"(",
"s",
"*",
"MergeIterator",
")",
"Valid",
"(",
")",
"bool",
"{",
"if",
"s",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"len",
"(",
"s",
".",
"h",
")",
"==",
"0",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"return",
... |
7,183 | all-7184 | [
"PostForm",
"posts",
"urlencoded",
"form",
"with",
"values",
"and",
"returns",
"the",
"result",
"c",
".",
"PostForm",
"(",
"c",
".",
"Endpoint",
"(",
"users",
")",
"url",
".",
"Values",
"{",
"name",
":",
"[]",
"string",
"{",
"John",
"}}",
")"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"PostForm",
"(",
"ctx",
"context",
".",
"Context",
",",
"endpoint",
"string",
",",
"vals",
"url",
".",
"Values",
",",
"files",
"...",
"<mask>",
")",
"(",
"*",
"Response",
",",
"error",
")",
"{",
"// If the sanitize... |
7,184 | all-7185 | [
"GetEvent",
"()",
"is",
"a",
"wrapper",
"around",
"gdk_display_get_event",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Display",
")",
"GetEvent",
"(",
")",
"(",
"*",
"Event",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gdk_display_get_event",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",... |
7,185 | all-7186 | [
"GetSecondsOk",
"returns",
"a",
"tuple",
"with",
"the",
"Seconds",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"p",
"*",
"Period",
")",
"GetSecondsOk",
"(",
")",
"(",
"json",
".",
"Number",
",",
"bool",
")",
"{",
"if",
"p",
"==",
"nil",
"||",
"p",
".",
"Seconds",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"false",
"\n",
"}",
"\n",
"return... |
7,186 | all-7187 | [
"RemoveNetworkAdapter",
"deletes",
"network",
"adapter",
"from",
"VMX",
"file",
"that",
"matches",
"the",
"ID",
"in",
"adapter",
".",
"Id",
"."
] | [
"func",
"(",
"v",
"*",
"VM",
")",
"RemoveNetworkAdapter",
"(",
"adapter",
"*",
"NetworkAdapter",
")",
"error",
"{",
"isVMRunning",
",",
"err",
":=",
"v",
".",
"IsRunning",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n... |
7,187 | all-7188 | [
"GetBool",
"returns",
"a",
"boolean",
"value",
"for",
"a",
"specific",
"column",
"."
] | [
"func",
"(",
"r",
"Record",
")",
"GetBool",
"(",
"<mask>",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"r",
".",
"getKey",
"(",
"reflect",
".",
"Float64",
",",
"column",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"... |
7,188 | all-7189 | [
"Expand",
"until",
"there",
"are",
"no",
"more",
"expansions",
"to",
"do"
] | [
"func",
"(",
"tokens",
"Tokens",
")",
"Expand",
"(",
")",
"(",
"result",
"Tokens",
",",
"err",
"error",
")",
"{",
"var",
"updated",
"bool",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"tokens",
")",
";",
"i",
"++",
"{",
"var",
"star... |
7,189 | all-7190 | [
"MustSetOptionsOp",
"retrieves",
"the",
"SetOptionsOp",
"value",
"from",
"the",
"union",
"panicing",
"if",
"the",
"value",
"is",
"not",
"set",
"."
] | [
"func",
"(",
"u",
"OperationBody",
")",
"MustSetOptionsOp",
"(",
")",
"SetOptionsOp",
"{",
"val",
",",
"ok",
":=",
"u",
".",
"GetSetOptionsOp",
"(",
")",
"\n\n",
"if",
"!",
"<mask>",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"v... |
7,190 | all-7191 | [
"handleMessages",
"processes",
"refresh",
"credentials",
"messages",
"in",
"the",
"buffer",
"in",
"-",
"order"
] | [
"func",
"(",
"refreshHandler",
"*",
"refreshCredentialsHandler",
")",
"handleMessages",
"(",
")",
"{",
"for",
"{",
"<mask>",
"{",
"case",
"message",
":=",
"<-",
"refreshHandler",
".",
"messageBuffer",
":",
"refreshHandler",
".",
"handleSingleMessage",
"(",
"messag... |
7,191 | all-7192 | [
"Warnf",
"logs",
"at",
"the",
"WARNING",
"log",
"level",
"using",
"a",
"standard",
"printf",
"format",
"string"
] | [
"func",
"Warnf",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"if",
"Log",
"!=",
"nil",
"{",
"Log",
".",
"Warn",
"(",
"fmt",
".",
"Sprintf",
"(",
"<mask>",
",",
"args",
"...",
")",
")",
"\n",
"}",
"\n",
"}"
] |
7,192 | all-7193 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"CachedResponseType",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"CachedResponseType",
"(",
"in",
".",
"<mask>",
"(",
")",
")",
"{",
"case",
"CachedResponseTypeBasic",
":",
"*",
"t",
"=",
... |
7,193 | all-7194 | [
"Write",
"marshals",
"and",
"writes",
"VMX",
"file",
"to",
"disk"
] | [
"func",
"(",
"vmxfile",
"*",
"VMXFile",
")",
"Write",
"(",
")",
"error",
"{",
"file",
",",
"err",
":=",
"os",
".",
"Create",
"(",
"vmxfile",
".",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defer",
"file",... |
7,194 | all-7195 | [
"Repeat",
"emits",
"n",
"copies",
"of",
"s",
"."
] | [
"func",
"Repeat",
"(",
"s",
"string",
",",
"n",
"int",
")",
"<mask>",
"{",
"return",
"FilterFunc",
"(",
"func",
"(",
"arg",
"Arg",
")",
"error",
"{",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
"{",
"arg",
".",
"Out",
"<-",
"s"... |
7,195 | all-7196 | [
"GetImageAliases",
"returns",
"the",
"list",
"of",
"available",
"aliases",
"as",
"ImageAliasesEntry",
"structs"
] | [
"func",
"(",
"r",
"*",
"ProtocolLXD",
")",
"GetImageAliases",
"(",
")",
"(",
"[",
"]",
"api",
".",
"ImageAliasesEntry",
",",
"error",
")",
"{",
"aliases",
":=",
"[",
"]",
"api",
".",
"ImageAliasesEntry",
"{",
"}",
"\n\n",
"// Fetch the raw value",
"_",
"... |
7,196 | all-7197 | [
"Skip",
"skips",
"cnt",
"bytes",
"from",
"reading",
"."
] | [
"func",
"(",
"r",
"*",
"Reader",
")",
"Skip",
"(",
"cnt",
"int",
")",
"{",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"<mask>",
"n",
"int",
"\n",
"n",
",",
"r",
".",
"err",
"=",
"r",
".",
"rd",
".",
"Discard",
"(",
... |
7,197 | all-7198 | [
"output",
"writes",
"the",
"data",
"to",
"the",
"log",
"files",
"and",
"releases",
"the",
"buffer",
"."
] | [
"func",
"(",
"l",
"*",
"<mask>",
")",
"output",
"(",
"s",
"Severity",
",",
"buf",
"*",
"buffer",
",",
"file",
"string",
",",
"line",
"int",
")",
"{",
"l",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"if",
"l",
".",
"traceLocation",
".",
"isSet",
"(... |
7,198 | all-7199 | [
"NetworkRename",
"renames",
"a",
"network",
"."
] | [
"func",
"(",
"c",
"*",
"Cluster",
")",
"NetworkRename",
"(",
"oldName",
"string",
",",
"newName",
"string",
")",
"error",
"{",
"<mask>",
",",
"_",
",",
"err",
":=",
"c",
".",
"NetworkGet",
"(",
"oldName",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"... |
7,199 | all-7200 | [
"DepthMatchAll",
"performs",
"a",
"depth",
"first",
"search",
"of",
"the",
"Part",
"tree",
"and",
"returns",
"all",
"parts",
"that",
"causes",
"the",
"given",
"matcher",
"to",
"return",
"true"
] | [
"func",
"(",
"p",
"*",
"Part",
")",
"DepthMatchAll",
"(",
"matcher",
"PartMatcher",
")",
"[",
"]",
"*",
"Part",
"{",
"root",
":=",
"p",
"\n",
"matches",
":=",
"make",
"(",
"[",
"]",
"*",
"<mask>",
",",
"0",
",",
"10",
")",
"\n",
"for",
"{",
"if... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.