id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
13,200 | all-13201 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SecurityDetails",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork19",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
13,201 | all-13202 | [
"Step",
"2a",
"is",
"the",
"removal",
"of",
"Verb",
"suffixes",
"beginning",
"with",
"i",
"in",
"the",
"RV",
"region",
"."
] | [
"func",
"step2a",
"(",
"word",
"*",
"snowballword",
".",
"SnowballWord",
")",
"bool",
"{",
"// Search for the longest among the following suffixes",
"// in RV and if found, delete if preceded by a non-vowel.",
"suffix",
",",
"suffixRunes",
":=",
"word",
".",
"FirstSuffixIn",
"(",
"<mask>",
".",
"RVstart",
",",
"len",
"(",
"word",
".",
"RS",
")",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
",",
" ",
"î",
" ",
"\"",
"s",
" ",
"\"",
"r",
"",
"",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
",",
" ",
"i",
",",
" ",
"i",
",",
" ",
"i",
",",
" ",
"i",
",",
" ",
"i",
",",
"",
")",
"\n",
"if",
"suffix",
"!=",
"\"",
"\"",
"{",
"sLen",
":=",
"len",
"(",
"suffixRunes",
")",
"\n",
"idx",
":=",
"len",
"(",
"word",
".",
"RS",
")",
"-",
"sLen",
"-",
"1",
"\n",
"if",
"idx",
">=",
"0",
"&&",
"word",
".",
"FitsInRV",
"(",
"sLen",
"+",
"1",
")",
"&&",
"isLowerVowel",
"(",
"word",
".",
"RS",
"[",
"idx",
"]",
")",
"==",
"false",
"{",
"word",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
] |
13,202 | all-13203 | [
"ReadUint32",
"reads",
"and",
"returns",
"an",
"uint32",
"."
] | [
"func",
"(",
"r",
"*",
"Reader",
")",
"ReadUint32",
"(",
")",
"uint32",
"{",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"0",
"\n",
"}",
"\n",
"var",
"n",
"int",
"\n",
"n",
",",
"r",
".",
"err",
"=",
"<mask>",
".",
"ReadFull",
"(",
"r",
".",
"rd",
",",
"r",
".",
"b",
"[",
":",
"4",
"]",
")",
"\n",
"r",
".",
"cnt",
"+=",
"n",
"\n",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"0",
"\n",
"}",
"\n",
"return",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"r",
".",
"b",
"[",
":",
"4",
"]",
")",
"\n",
"}"
] |
13,203 | all-13204 | [
"ObjectIdHex",
"returns",
"an",
"ObjectId",
"from",
"the",
"provided",
"hex",
"representation",
".",
"Calling",
"this",
"function",
"with",
"an",
"invalid",
"hex",
"representation",
"will",
"cause",
"a",
"runtime",
"panic",
".",
"See",
"the",
"IsObjectIdHex",
"function",
"."
] | [
"func",
"ObjectIdHex",
"(",
"s",
"string",
")",
"ObjectId",
"{",
"d",
",",
"err",
":=",
"<mask>",
".",
"DecodeString",
"(",
"s",
")",
"\n",
"if",
"err",
"!=",
"nil",
"||",
"len",
"(",
"d",
")",
"!=",
"12",
"{",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"s",
")",
")",
"\n",
"}",
"\n",
"return",
"ObjectId",
"(",
"d",
")",
"\n",
"}"
] |
13,204 | all-13205 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetUserAgentOverrideParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoEmulation2",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
13,205 | all-13206 | [
"IsKeyJustReleased",
"returns",
"a",
"boolean",
"value",
"indicating",
"whether",
"the",
"given",
"key",
"is",
"released",
"just",
"in",
"the",
"current",
"frame",
".",
"IsKeyJustReleased",
"is",
"concurrent",
"safe",
"."
] | [
"func",
"IsKeyJustReleased",
"(",
"key",
"ebiten",
".",
"<mask>",
")",
"bool",
"{",
"theInputState",
".",
"m",
".",
"RLock",
"(",
")",
"\n",
"r",
":=",
"theInputState",
".",
"keyDurations",
"[",
"key",
"]",
"==",
"0",
"&&",
"theInputState",
".",
"prevKeyDurations",
"[",
"key",
"]",
">",
"0",
"\n",
"theInputState",
".",
"m",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"r",
"\n",
"}"
] |
13,206 | all-13207 | [
"IntrospectState",
"returns",
"the",
"runtime",
"state",
"of",
"the"
] | [
"func",
"(",
"l",
"*",
"RootPeerList",
")",
"IntrospectState",
"(",
"opts",
"*",
"IntrospectionOptions",
")",
"<mask>",
"[",
"string",
"]",
"PeerRuntimeState",
"{",
"return",
"fromPeerList",
"(",
"l",
",",
"opts",
")",
"\n",
"}"
] |
13,207 | all-13208 | [
"fetchTTL",
"contains",
"the",
"essential",
"implementation",
"of",
"TTL",
"()",
".",
"Note",
"that",
"iface",
"should",
"either",
"be",
"the",
"receiver",
"s",
"or",
"a",
"containing",
"stmSerializeable",
"--",
"the",
"only",
"reason",
"iface",
"is",
"passed",
"as",
"a",
"separate",
"argument",
"is",
"because",
"fetchTTL",
"calls",
"iface",
".",
"fetch",
"()",
"and",
"the",
"implementation",
"of",
"fetch",
"is",
"different",
"for",
"stm",
"and",
"stmSerializeable",
".",
"Passing",
"the",
"interface",
"ensures",
"the",
"correct",
"version",
"of",
"fetch",
"()",
"is",
"called"
] | [
"func",
"(",
"s",
"*",
"stm",
")",
"fetchTTL",
"(",
"iface",
"STM",
",",
"key",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"// check wset cache",
"if",
"wv",
",",
"ok",
":=",
"s",
".",
"wset",
"[",
"key",
"]",
";",
"ok",
"{",
"return",
"wv",
".",
"ttl",
",",
"nil",
"\n",
"}",
"\n\n",
"// Read ttl through s.ttlset cache",
"if",
"ttl",
",",
"ok",
":=",
"s",
".",
"ttlset",
"[",
"key",
"]",
";",
"ok",
"{",
"return",
"ttl",
",",
"nil",
"\n",
"}",
"\n\n",
"// Read kv and lease ID, and cache new TTL",
"getResp",
":=",
"iface",
".",
"fetch",
"(",
"key",
")",
"// call correct implementation of fetch()",
"\n",
"if",
"len",
"(",
"getResp",
".",
"Kvs",
")",
"==",
"0",
"{",
"return",
"0",
",",
"ErrNotFound",
"{",
"Key",
":",
"key",
"}",
"\n",
"}",
"\n",
"leaseID",
":=",
"v3",
".",
"LeaseID",
"(",
"getResp",
".",
"Kvs",
"[",
"0",
"]",
".",
"Lease",
")",
"\n",
"if",
"leaseID",
"==",
"0",
"{",
"s",
".",
"ttlset",
"[",
"key",
"]",
"=",
"0",
"// 0 is default value, but now 'ok' will be true on check",
"\n",
"return",
"0",
",",
"nil",
"\n",
"}",
"\n",
"span",
",",
"ctx",
":=",
"tracing",
".",
"AddSpanToAnyExisting",
"(",
"s",
".",
"ctx",
",",
"\"",
"\"",
")",
"\n",
"defer",
"tracing",
".",
"FinishAnySpan",
"(",
"span",
")",
"\n",
"leaseResp",
",",
"err",
":=",
"s",
".",
"client",
".",
"TimeToLive",
"(",
"ctx",
",",
"leaseID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"stmError",
"{",
"err",
"}",
")",
"\n",
"}",
"\n",
"s",
".",
"ttlset",
"[",
"key",
"]",
"=",
"leaseResp",
".",
"TTL",
"\n",
"for",
"_",
",",
"key",
":=",
"<mask>",
"leaseResp",
".",
"Keys",
"{",
"s",
".",
"ttlset",
"[",
"string",
"(",
"key",
")",
"]",
"=",
"leaseResp",
".",
"TTL",
"\n",
"}",
"\n",
"return",
"leaseResp",
".",
"TTL",
",",
"nil",
"\n",
"}"
] |
13,208 | all-13209 | [
"Do",
"executes",
"Debugger",
".",
"removeBreakpoint",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"RemoveBreakpointParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandRemoveBreakpoint",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
13,209 | all-13210 | [
"PutFile",
"appends",
"data",
"to",
"a",
"file",
"(",
"and",
"creates",
"the",
"file",
"if",
"it",
"doesn",
"t",
"exist",
")",
"."
] | [
"func",
"(",
"h",
"*",
"dbHashTree",
")",
"PutFile",
"(",
"path",
"string",
",",
"objects",
"[",
"]",
"*",
"pfs",
".",
"Object",
",",
"size",
"int64",
")",
"error",
"{",
"return",
"h",
".",
"putFile",
"(",
"path",
",",
"<mask>",
",",
"nil",
",",
"size",
",",
"false",
")",
"\n",
"}"
] |
13,210 | all-13211 | [
"UrlFor",
"is",
"helper",
"function",
"for",
"controllers"
] | [
"func",
"(",
"c",
"*",
"Controller",
")",
"UrlFor",
"(",
"routeName",
"string",
",",
"args",
"...",
"string",
")",
"*",
"url",
".",
"<mask>",
"{",
"return",
"UrlFor",
"(",
"routeName",
",",
"args",
"...",
")",
"\n",
"}"
] |
13,211 | all-13212 | [
"GetType",
"returns",
"the",
"Type",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"e",
"*",
"EventTimelineDefinition",
")",
"GetType",
"(",
")",
"string",
"{",
"if",
"e",
"==",
"nil",
"||",
"e",
".",
"Type",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"e",
".",
"<mask>",
"\n",
"}"
] |
13,212 | all-13213 | [
"Close",
"terminates",
"all",
"previously",
"opened",
"websocket",
"connections",
"to",
"the",
"traffic",
"controller",
".",
"It",
"will",
"return",
"an",
"error",
"if",
"there",
"are",
"no",
"open",
"connections",
"or",
"if",
"it",
"has",
"problems",
"closing",
"any",
"connection",
"."
] | [
"func",
"(",
"c",
"*",
"Consumer",
")",
"Close",
"(",
")",
"error",
"{",
"c",
".",
"connsLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"connsLock",
".",
"Unlock",
"(",
")",
"\n\n",
"var",
"errStrings",
"[",
"]",
"string",
"\n\n",
"if",
"len",
"(",
"c",
".",
"conns",
")",
"==",
"0",
"{",
"return",
"<mask>",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"for",
"len",
"(",
"c",
".",
"conns",
")",
">",
"0",
"{",
"if",
"err",
":=",
"c",
".",
"conns",
"[",
"0",
"]",
".",
"close",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"errStrings",
"=",
"append",
"(",
"errStrings",
",",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"c",
".",
"conns",
"=",
"c",
".",
"conns",
"[",
"1",
":",
"]",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"errStrings",
")",
">",
"0",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"strings",
".",
"Join",
"(",
"errStrings",
",",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
13,213 | all-13214 | [
"NewMockIOUtil",
"creates",
"a",
"new",
"mock",
"instance"
] | [
"func",
"NewMockIOUtil",
"(",
"ctrl",
"*",
"gomock",
".",
"<mask>",
")",
"*",
"MockIOUtil",
"{",
"mock",
":=",
"&",
"MockIOUtil",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockIOUtilMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] |
13,214 | all-13215 | [
"WaitObject",
"specifies",
"an",
"object",
"from",
"the",
"table",
"to",
"wait",
"on",
".",
"For",
"hosts",
"hostgroups",
"servicegroups",
"contacts",
"and",
"contactgroups",
"tables",
"this",
"is",
"simply",
"the",
"name",
"of",
"the",
"object",
".",
"For",
"the",
"services",
"table",
"it",
"is",
"the",
"hostname",
"and",
"the",
"service",
"description",
"separated",
"by",
"a",
"space",
"."
] | [
"func",
"(",
"q",
"*",
"Query",
")",
"WaitObject",
"(",
"<mask>",
"string",
")",
"*",
"Query",
"{",
"q",
".",
"headers",
"=",
"append",
"(",
"q",
".",
"headers",
",",
"\"",
"\"",
"+",
"name",
")",
"\n",
"return",
"q",
"\n",
"}"
] |
13,215 | all-13216 | [
"SetDuplex",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_settings_set_duplex",
"()",
"."
] | [
"func",
"(",
"ps",
"*",
"PrintSettings",
")",
"SetDuplex",
"(",
"duplex",
"PrintDuplex",
")",
"{",
"C",
".",
"gtk_print_settings_set_duplex",
"(",
"<mask>",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkPrintDuplex",
"(",
"duplex",
")",
")",
"\n",
"}"
] |
13,216 | all-13217 | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"."
] | [
"func",
"(",
"pr",
"*",
"prReject",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"*",
"pr",
"=",
"prReject",
"{",
"}",
"\n",
"var",
"tmp",
"prReject",
"\n",
"if",
"err",
":=",
"paranoidUnmarshalJSONObjectExactFields",
"(",
"data",
",",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"\"",
"\"",
":",
"&",
"tmp",
".",
"<mask>",
",",
"}",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"tmp",
".",
"Type",
"!=",
"prTypeReject",
"{",
"return",
"InvalidPolicyFormatError",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
",",
"tmp",
".",
"Type",
")",
")",
"\n",
"}",
"\n",
"*",
"pr",
"=",
"*",
"newPRReject",
"(",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
13,217 | all-13218 | [
"FileInfo",
"returns",
"information",
"about",
"a",
"file",
"in",
"the",
"guest",
"operating",
"system",
".",
"Parameters",
":",
"filepath",
":",
"The",
"path",
"name",
"of",
"the",
"file",
"in",
"the",
"guest",
".",
"Remarks",
":",
"*",
"Only",
"absolute",
"paths",
"should",
"be",
"used",
"for",
"files",
"in",
"the",
"guest",
";",
"the",
"resolution",
"of",
"relative",
"paths",
"is",
"not",
"specified",
".",
"Since",
"VMware",
"Workstation",
"6",
".",
"5",
"Minimum",
"Supported",
"Guest",
"OS",
":",
"Microsoft",
"Windows",
"NT",
"Series",
"Linux"
] | [
"func",
"(",
"g",
"*",
"Guest",
")",
"FileInfo",
"(",
"filepath",
"string",
")",
"(",
"*",
"GuestFile",
",",
"error",
")",
"{",
"var",
"jobHandle",
"C",
".",
"VixHandle",
"=",
"C",
".",
"VIX_INVALID_HANDLE",
"\n",
"var",
"err",
"C",
".",
"VixError",
"=",
"C",
".",
"VIX_OK",
"\n",
"var",
"fsize",
"*",
"C",
".",
"int64",
"\n",
"var",
"flags",
"*",
"C",
".",
"int",
"\n",
"var",
"modtime",
"*",
"C",
".",
"int64",
"\n\n",
"fpath",
":=",
"C",
".",
"CString",
"(",
"filepath",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"fpath",
")",
")",
"\n\n",
"jobHandle",
"=",
"C",
".",
"VixVM_GetFileInfoInGuest",
"(",
"g",
".",
"handle",
",",
"fpath",
",",
"// file path name",
"nil",
",",
"// callbackProc",
"nil",
")",
"// clientData",
"\n\n",
"defer",
"C",
".",
"Vix_ReleaseHandle",
"(",
"jobHandle",
")",
"\n\n",
"err",
"=",
"C",
".",
"get_file_info",
"(",
"jobHandle",
",",
"fsize",
",",
"flags",
",",
"modtime",
")",
"\n",
"if",
"C",
".",
"VIX_OK",
"!=",
"err",
"{",
"return",
"nil",
",",
"&",
"Error",
"{",
"Operation",
":",
"\"",
"\"",
",",
"Code",
":",
"int",
"(",
"err",
"&",
"0xFFFF",
")",
",",
"<mask>",
":",
"C",
".",
"GoString",
"(",
"C",
".",
"Vix_GetErrorText",
"(",
"err",
",",
"nil",
")",
")",
",",
"}",
"\n",
"}",
"\n\n",
"return",
"&",
"GuestFile",
"{",
"Path",
":",
"filepath",
",",
"Size",
":",
"int64",
"(",
"*",
"fsize",
")",
",",
"Attrs",
":",
"FileAttr",
"(",
"*",
"flags",
")",
",",
"Modtime",
":",
"int64",
"(",
"*",
"modtime",
")",
",",
"}",
",",
"nil",
"\n",
"}"
] |
13,218 | all-13219 | [
"GetVisibleRect",
"is",
"a",
"wrapper",
"around",
"gtk_text_view_get_visible_rect",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TextView",
")",
"GetVisibleRect",
"(",
")",
"*",
"gdk",
".",
"Rectangle",
"{",
"<mask>",
"rect",
"C",
".",
"GdkRectangle",
"\n",
"C",
".",
"gtk_text_view_get_visible_rect",
"(",
"v",
".",
"native",
"(",
")",
",",
"&",
"rect",
")",
"\n",
"return",
"gdk",
".",
"WrapRectangle",
"(",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"&",
"rect",
")",
")",
")",
"\n",
"}"
] |
13,219 | all-13220 | [
"GetPublicIPAddress",
"attempts",
"to",
"get",
"public",
"IP",
"address",
"from",
"the",
"Public",
"IP",
"resource",
".",
"If",
"IP",
"address",
"is",
"not",
"allocated",
"yet",
"returns",
"empty",
"string",
".",
"If",
"useFqdn",
"is",
"set",
"to",
"true",
"the",
"a",
"FQDN",
"hostname",
"will",
"be",
"returned",
"."
] | [
"func",
"(",
"a",
"AzureClient",
")",
"GetPublicIPAddress",
"(",
"resourceGroup",
",",
"<mask>",
"string",
",",
"useFqdn",
"bool",
")",
"(",
"string",
",",
"error",
")",
"{",
"f",
":=",
"logutil",
".",
"Fields",
"{",
"\"",
"\"",
":",
"name",
"}",
"\n",
"log",
".",
"Debug",
"(",
"\"",
"\"",
",",
"f",
")",
"\n",
"ip",
",",
"err",
":=",
"a",
".",
"publicIPAddressClient",
"(",
")",
".",
"Get",
"(",
"resourceGroup",
",",
"name",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"if",
"ip",
".",
"Properties",
"==",
"nil",
"{",
"log",
".",
"Debug",
"(",
"\"",
"\"",
",",
"f",
")",
"\n",
"return",
"\"",
"\"",
",",
"nil",
"\n",
"}",
"\n\n",
"if",
"useFqdn",
"{",
"// return FQDN value on public IP",
"log",
".",
"Debug",
"(",
"\"",
"\"",
",",
"f",
")",
"\n",
"if",
"ip",
".",
"Properties",
".",
"DNSSettings",
"==",
"nil",
"||",
"ip",
".",
"Properties",
".",
"DNSSettings",
".",
"Fqdn",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"to",
".",
"String",
"(",
"ip",
".",
"Properties",
".",
"DNSSettings",
".",
"Fqdn",
")",
",",
"nil",
"\n",
"}",
"\n",
"return",
"to",
".",
"String",
"(",
"ip",
".",
"Properties",
".",
"IPAddress",
")",
",",
"nil",
"\n",
"}"
] |
13,220 | all-13221 | [
"BreadthMatchFirst",
"performs",
"a",
"breadth",
"first",
"search",
"of",
"the",
"Part",
"tree",
"and",
"returns",
"the",
"first",
"part",
"that",
"causes",
"the",
"given",
"matcher",
"to",
"return",
"true"
] | [
"func",
"(",
"p",
"*",
"<mask>",
")",
"BreadthMatchFirst",
"(",
"matcher",
"PartMatcher",
")",
"*",
"Part",
"{",
"q",
":=",
"list",
".",
"New",
"(",
")",
"\n",
"q",
".",
"PushBack",
"(",
"p",
")",
"\n\n",
"// Push children onto queue and attempt to match in that order",
"for",
"q",
".",
"Len",
"(",
")",
">",
"0",
"{",
"e",
":=",
"q",
".",
"Front",
"(",
")",
"\n",
"p",
":=",
"e",
".",
"Value",
".",
"(",
"*",
"Part",
")",
"\n",
"if",
"matcher",
"(",
"p",
")",
"{",
"return",
"p",
"\n",
"}",
"\n",
"q",
".",
"Remove",
"(",
"e",
")",
"\n",
"c",
":=",
"p",
".",
"FirstChild",
"\n",
"for",
"c",
"!=",
"nil",
"{",
"q",
".",
"PushBack",
"(",
"c",
")",
"\n",
"c",
"=",
"c",
".",
"NextSibling",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
13,221 | all-13222 | [
"Encode",
"encodes",
"uuid",
".",
"UUID",
"into",
"a",
"string",
"using",
"the",
"least",
"significant",
"bits",
"(",
"LSB",
")",
"first",
"according",
"to",
"the",
"alphabet",
".",
"if",
"the",
"most",
"significant",
"bits",
"(",
"MSB",
")",
"are",
"0",
"the",
"string",
"might",
"be",
"shorter",
"."
] | [
"func",
"(",
"b",
"base57",
")",
"Encode",
"(",
"u",
"uuid",
".",
"UUID",
")",
"string",
"{",
"<mask>",
"num",
"big",
".",
"Int",
"\n",
"num",
".",
"SetString",
"(",
"strings",
".",
"Replace",
"(",
"u",
".",
"String",
"(",
")",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"4",
")",
",",
"16",
")",
"\n\n",
"// Calculate encoded length.",
"factor",
":=",
"math",
".",
"Log",
"(",
"float64",
"(",
"25",
")",
")",
"/",
"math",
".",
"Log",
"(",
"float64",
"(",
"b",
".",
"alphabet",
".",
"Length",
"(",
")",
")",
")",
"\n",
"length",
":=",
"math",
".",
"Ceil",
"(",
"factor",
"*",
"float64",
"(",
"len",
"(",
"u",
")",
")",
")",
"\n\n",
"return",
"b",
".",
"numToString",
"(",
"&",
"num",
",",
"int",
"(",
"length",
")",
")",
"\n",
"}"
] |
13,222 | all-13223 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetBestEffortCoverageReturns",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoProfiler19",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
13,223 | all-13224 | [
"NewSeeforRouter",
"for",
"creating",
"a",
"new",
"instance",
"of",
"Seefor",
"router"
] | [
"func",
"NewSeeforRouter",
"(",
")",
"*",
"Seefor",
"{",
"c4",
":=",
"&",
"Seefor",
"{",
"}",
"\n",
"c4",
".",
"afters",
"=",
"make",
"(",
"[",
"]",
"After",
",",
"0",
")",
"\n",
"c4",
".",
"befores",
"=",
"<mask>",
"(",
"[",
"]",
"Before",
",",
"0",
")",
"\n",
"c4",
".",
"roots",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"rootNode",
")",
"\n",
"c4",
".",
"HandleMethodNotAllowed",
"=",
"true",
"\n",
"return",
"c4",
"\n",
"}"
] |
13,224 | all-13225 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetMatchedStylesForNodeReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss41",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
13,225 | all-13226 | [
"GetColor",
"returns",
"the",
"Color",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"c",
"*",
"ConditionalFormat",
")",
"GetColor",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"||",
"c",
".",
"<mask>",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"c",
".",
"Color",
"\n",
"}"
] |
13,226 | all-13227 | [
"TraceFunc",
"adds",
"a",
"generic",
"segment",
"autodetecting",
"the",
"function",
"name",
"with",
"runtime",
".",
"Caller",
"()",
"."
] | [
"func",
"TraceFunc",
"(",
"ctx",
"context",
".",
"Context",
")",
"*",
"Trace",
"{",
"name",
":=",
"caller",
"(",
"2",
")",
"// Get the caller that called TraceFunc.",
"\n",
"return",
"trace",
"(",
"ctx",
",",
"name",
",",
"func",
"(",
"tx",
"Tx",
")",
"error",
"{",
"return",
"<mask>",
".",
"StartGeneric",
"(",
"name",
")",
"\n",
"}",
")",
"\n",
"}"
] |
13,227 | all-13228 | [
"Attr",
"returns",
"the",
"value",
"of",
"the",
"named",
"attribute",
".",
"nil",
"is",
"returned",
"when",
"the",
"attribute",
"is",
"not",
"set",
"."
] | [
"func",
"(",
"r",
"*",
"Rule",
")",
"Attr",
"(",
"key",
"string",
")",
"bzl",
".",
"Expr",
"{",
"attr",
",",
"ok",
":=",
"r",
".",
"attrs",
"[",
"key",
"]",
"\n",
"if",
"!",
"<mask>",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"attr",
".",
"RHS",
"\n",
"}"
] |
13,228 | all-13229 | [
"NewWhisperAggregation",
"create",
"instance",
"of",
"WhisperAggregation"
] | [
"func",
"NewWhisperAggregation",
"(",
")",
"*",
"WhisperAggregation",
"{",
"return",
"&",
"WhisperAggregation",
"{",
"Data",
":",
"make",
"(",
"[",
"]",
"*",
"whisperAggregationItem",
",",
"0",
")",
",",
"Default",
":",
"&",
"whisperAggregationItem",
"{",
"name",
":",
"\"",
"\"",
",",
"<mask>",
":",
"nil",
",",
"xFilesFactor",
":",
"0.5",
",",
"aggregationMethodStr",
":",
"\"",
"\"",
",",
"aggregationMethod",
":",
"whisper",
".",
"Average",
",",
"}",
",",
"}",
"\n",
"}"
] |
13,229 | all-13230 | [
"Server",
"handling",
"functions",
"GetServer",
"returns",
"the",
"server",
"status",
"as",
"a",
"Server",
"struct"
] | [
"func",
"(",
"r",
"*",
"ProtocolLXD",
")",
"GetServer",
"(",
")",
"(",
"*",
"api",
".",
"Server",
",",
"string",
",",
"error",
")",
"{",
"server",
":=",
"api",
".",
"Server",
"{",
"}",
"\n\n",
"// Fetch the raw value",
"etag",
",",
"err",
":=",
"r",
".",
"queryStruct",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"\"",
"\"",
",",
"&",
"server",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"// Fill in certificate fingerprint if not provided",
"if",
"server",
".",
"Environment",
".",
"CertificateFingerprint",
"==",
"\"",
"\"",
"&&",
"server",
".",
"Environment",
".",
"Certificate",
"!=",
"\"",
"\"",
"{",
"<mask>",
"err",
"error",
"\n",
"server",
".",
"Environment",
".",
"CertificateFingerprint",
",",
"err",
"=",
"shared",
".",
"CertFingerprintStr",
"(",
"server",
".",
"Environment",
".",
"Certificate",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"!",
"server",
".",
"Public",
"&&",
"len",
"(",
"server",
".",
"AuthMethods",
")",
"==",
"0",
"{",
"// TLS is always available for LXD servers",
"server",
".",
"AuthMethods",
"=",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
"\n",
"}",
"\n\n",
"// Add the value to the cache",
"r",
".",
"server",
"=",
"&",
"server",
"\n\n",
"return",
"&",
"server",
",",
"etag",
",",
"nil",
"\n",
"}"
] |
13,230 | all-13231 | [
"RowExpanded",
"is",
"a",
"wrapper",
"around",
"gtk_tree_view_row_expanded",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TreeView",
")",
"RowExpanded",
"(",
"path",
"*",
"TreePath",
")",
"bool",
"{",
"return",
"gobool",
"(",
"C",
".",
"gtk_tree_view_row_expanded",
"(",
"v",
".",
"native",
"(",
")",
",",
"<mask>",
".",
"native",
"(",
")",
")",
")",
"\n",
"}"
] |
13,231 | all-13232 | [
"GetTextAlignOk",
"returns",
"a",
"tuple",
"with",
"the",
"TextAlign",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"t",
"*",
"TileDef",
")",
"GetTextAlignOk",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"t",
"==",
"nil",
"||",
"t",
".",
"TextAlign",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"t",
".",
"TextAlign",
",",
"true",
"\n",
"}"
] |
13,232 | all-13233 | [
"IAMRoleCredentialsFromACS",
"translates",
"ecsacs",
".",
"IAMRoleCredentials",
"object",
"to",
"api",
".",
"IAMRoleCredentials"
] | [
"func",
"IAMRoleCredentialsFromACS",
"(",
"roleCredentials",
"*",
"ecsacs",
".",
"IAMRoleCredentials",
",",
"roleType",
"<mask>",
")",
"IAMRoleCredentials",
"{",
"return",
"IAMRoleCredentials",
"{",
"CredentialsID",
":",
"aws",
".",
"StringValue",
"(",
"roleCredentials",
".",
"CredentialsId",
")",
",",
"SessionToken",
":",
"aws",
".",
"StringValue",
"(",
"roleCredentials",
".",
"SessionToken",
")",
",",
"RoleArn",
":",
"aws",
".",
"StringValue",
"(",
"roleCredentials",
".",
"RoleArn",
")",
",",
"AccessKeyID",
":",
"aws",
".",
"StringValue",
"(",
"roleCredentials",
".",
"AccessKeyId",
")",
",",
"SecretAccessKey",
":",
"aws",
".",
"StringValue",
"(",
"roleCredentials",
".",
"SecretAccessKey",
")",
",",
"Expiration",
":",
"aws",
".",
"StringValue",
"(",
"roleCredentials",
".",
"Expiration",
")",
",",
"RoleType",
":",
"roleType",
",",
"}",
"\n",
"}"
] |
13,233 | all-13234 | [
"InspectObject",
"returns",
"info",
"about",
"an",
"Object",
"."
] | [
"func",
"(",
"c",
"APIClient",
")",
"InspectObject",
"(",
"<mask>",
"string",
")",
"(",
"*",
"pfs",
".",
"ObjectInfo",
",",
"error",
")",
"{",
"value",
",",
"err",
":=",
"c",
".",
"ObjectAPIClient",
".",
"InspectObject",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pfs",
".",
"Object",
"{",
"Hash",
":",
"hash",
"}",
",",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"grpcutil",
".",
"ScrubGRPC",
"(",
"err",
")",
"\n",
"}",
"\n",
"return",
"value",
",",
"nil",
"\n",
"}"
] |
13,234 | all-13235 | [
"SetImagePosition",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_button_set_image_position",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Button",
")",
"SetImagePosition",
"(",
"position",
"PositionType",
")",
"{",
"C",
".",
"gtk_button_set_image_position",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"GtkPositionType",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
13,235 | all-13236 | [
"ListSecretVersionIds",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockSecretsManagerAPI",
")",
"ListSecretVersionIds",
"(",
"arg0",
"*",
"secretsmanager",
".",
"ListSecretVersionIdsInput",
")",
"(",
"*",
"secretsmanager",
".",
"ListSecretVersionIdsOutput",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret0",
",",
"_",
":=",
"<mask>",
"[",
"0",
"]",
".",
"(",
"*",
"secretsmanager",
".",
"ListSecretVersionIdsOutput",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] |
13,236 | all-13237 | [
"newImage",
"creates",
"an",
"image",
"that",
"also",
"knows",
"its",
"size"
] | [
"func",
"newImage",
"(",
"ctx",
"context",
".",
"Context",
",",
"sys",
"*",
"types",
".",
"SystemContext",
",",
"s",
"storageReference",
")",
"(",
"types",
".",
"ImageCloser",
",",
"error",
")",
"{",
"src",
",",
"err",
":=",
"newImageSource",
"(",
"s",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"img",
",",
"err",
":=",
"image",
".",
"FromSource",
"(",
"ctx",
",",
"sys",
",",
"src",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"size",
",",
"err",
":=",
"src",
".",
"getSize",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"&",
"storageImageCloser",
"{",
"ImageCloser",
":",
"img",
",",
"<mask>",
":",
"size",
"}",
",",
"nil",
"\n",
"}"
] |
13,237 | all-13238 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"SetStyleTextsParams",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss12",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
13,238 | all-13239 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetBoxModelReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"<mask>",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom50",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
13,239 | all-13240 | [
"Using",
"Inverse",
"Normal",
"CDF",
"function",
"mean",
"and",
"standard",
"deviation",
"to",
"get",
"the",
"Inverse",
"Norm",
"Dist",
".",
"referenced",
"from",
"http",
":",
"//",
"tibasicdev",
".",
"wikidot",
".",
"com",
"/",
"invnorm"
] | [
"func",
"InverseNormalDist",
"(",
"p",
"float64",
",",
"<mask>",
"float64",
",",
"stdv",
"float64",
")",
"float64",
"{",
"return",
"mean",
"+",
"stdv",
"*",
"InverserNormalCDF",
"(",
"p",
")",
"\n",
"}"
] |
13,240 | all-13241 | [
"ToHash",
"returns",
"the",
"ethereum",
"s",
"hash",
"represented",
"by",
"the",
"base64",
"string",
"s",
"."
] | [
"func",
"ToHash",
"(",
"h",
"Base64String",
")",
"(",
"common",
".",
"Hash",
",",
"error",
")",
"{",
"hashBytes",
",",
"err",
":=",
"ToBytes",
"(",
"h",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"err",
"=",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"<mask>",
".",
"BytesToHash",
"(",
"hashBytes",
")",
",",
"err",
"\n",
"}"
] |
13,241 | all-13242 | [
"Action",
"sends",
"an",
"action",
"to",
"who",
"(",
"user",
"or",
"channel",
")"
] | [
"func",
"(",
"bot",
"*",
"Bot",
")",
"Action",
"(",
"who",
",",
"text",
"string",
")",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\u0001",
"\\u0001",
"\"",
",",
"<mask>",
")",
"\n",
"bot",
".",
"Msg",
"(",
"who",
",",
"msg",
")",
"\n",
"}"
] |
13,242 | all-13243 | [
"NewAgent",
"--",
"creates",
"a",
"new",
"initialized",
"agent",
"object"
] | [
"func",
"NewAgent",
"(",
"t",
"TaskManagerInterface",
",",
"callerName",
"string",
")",
"*",
"Agent",
"{",
"return",
"&",
"Agent",
"{",
"killTaskPoller",
":",
"make",
"(",
"chan",
"bool",
",",
"1",
")",
",",
"processComplete",
":",
"make",
"(",
"chan",
"bool",
",",
"1",
")",
",",
"taskPollEmitter",
":",
"<mask>",
"(",
"chan",
"bool",
",",
"1",
")",
",",
"statusEmitter",
":",
"make",
"(",
"chan",
"string",
",",
"1",
")",
",",
"taskManager",
":",
"t",
",",
"task",
":",
"t",
".",
"NewTask",
"(",
"callerName",
",",
"TaskAgentLongRunning",
",",
"AgentTaskStatusInitializing",
")",
",",
"}",
"\n",
"}"
] |
13,243 | all-13244 | [
"newQuiescence",
"creates",
"a",
"new",
"quiescence",
"timer",
"for",
"the",
"given",
"template",
"."
] | [
"func",
"newQuiescence",
"(",
"ch",
"chan",
"*",
"template",
".",
"Template",
",",
"min",
",",
"max",
"time",
".",
"Duration",
",",
"t",
"*",
"template",
".",
"Template",
")",
"*",
"quiescence",
"{",
"return",
"&",
"quiescence",
"{",
"template",
":",
"t",
",",
"min",
":",
"min",
",",
"<mask>",
":",
"max",
",",
"ch",
":",
"ch",
",",
"}",
"\n",
"}"
] |
13,244 | all-13245 | [
"NewStringLexer",
"creates",
"a",
"new",
"lexer"
] | [
"func",
"NewStringLexer",
"(",
"template",
"string",
")",
"*",
"<mask>",
".",
"Lexer",
"{",
"l",
":=",
"parser",
".",
"NewStringLexer",
"(",
"template",
",",
"SymbolSet",
")",
"\n",
"l",
".",
"SetTagStart",
"(",
"\"",
"\"",
")",
"\n",
"l",
".",
"SetTagEnd",
"(",
"\"",
"\"",
")",
"\n\n",
"return",
"l",
"\n",
"}"
] |
13,245 | all-13246 | [
"GetTextAlign",
"returns",
"the",
"TextAlign",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"q",
"*",
"QueryValueDefinition",
")",
"GetTextAlign",
"(",
")",
"string",
"{",
"if",
"q",
"==",
"nil",
"||",
"q",
".",
"TextAlign",
"==",
"nil",
"{",
"<mask>",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"*",
"q",
".",
"TextAlign",
"\n",
"}"
] |
13,246 | all-13247 | [
"ReportUnreachable",
"reports",
"the",
"given",
"node",
"is",
"not",
"reachable",
"for",
"the",
"last",
"send",
"."
] | [
"func",
"(",
"rn",
"*",
"RawNode",
")",
"ReportUnreachable",
"(",
"id",
"uint64",
")",
"{",
"_",
"=",
"rn",
".",
"raft",
".",
"Step",
"(",
"pb",
".",
"Message",
"{",
"<mask>",
":",
"pb",
".",
"MsgUnreachable",
",",
"From",
":",
"id",
"}",
")",
"\n",
"}"
] |
13,247 | all-13248 | [
"handle",
"is",
"the",
"workhorse",
"notifying",
"issue",
"owner",
"to",
"add",
"a",
"sig",
"label",
"if",
"there",
"is",
"none",
"The",
"algorithm",
":",
"(",
"1",
")",
"return",
"if",
"this",
"is",
"not",
"an",
"opened",
"labelled",
"or",
"unlabelled",
"event",
"or",
"if",
"the",
"issue",
"is",
"closed",
".",
"(",
"2",
")",
"find",
"if",
"the",
"issue",
"has",
"a",
"sig",
"label",
"(",
"3",
")",
"find",
"if",
"the",
"issue",
"has",
"a",
"needs",
"-",
"sig",
"label",
"(",
"4",
")",
"if",
"the",
"issue",
"has",
"both",
"the",
"sig",
"and",
"needs",
"-",
"sig",
"labels",
"remove",
"the",
"needs",
"-",
"sig",
"label",
"and",
"delete",
"the",
"comment",
".",
"(",
"5",
")",
"if",
"the",
"issue",
"has",
"none",
"of",
"the",
"labels",
"add",
"the",
"needs",
"-",
"sig",
"label",
"and",
"comment",
"(",
"6",
")",
"if",
"the",
"issue",
"has",
"only",
"the",
"sig",
"label",
"do",
"nothing",
"(",
"7",
")",
"if",
"the",
"issue",
"has",
"only",
"the",
"needs",
"-",
"sig",
"label",
"do",
"nothing"
] | [
"func",
"handle",
"(",
"log",
"*",
"logrus",
".",
"Entry",
",",
"ghc",
"githubClient",
",",
"cp",
"commentPruner",
",",
"ie",
"*",
"github",
".",
"IssueEvent",
",",
"mentionRe",
"*",
"regexp",
".",
"Regexp",
")",
"error",
"{",
"// Ignore PRs, closed issues, and events that aren't new issues or sig label",
"// changes.",
"if",
"!",
"shouldReact",
"(",
"mentionRe",
",",
"ie",
")",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"org",
":=",
"ie",
".",
"Repo",
".",
"Owner",
".",
"Login",
"\n",
"repo",
":=",
"ie",
".",
"Repo",
".",
"Name",
"\n",
"number",
":=",
"ie",
".",
"Issue",
".",
"Number",
"\n\n",
"hasSigLabel",
":=",
"hasSigLabel",
"(",
"ie",
".",
"Issue",
".",
"Labels",
")",
"\n",
"hasNeedsSigLabel",
":=",
"github",
".",
"HasLabel",
"(",
"labels",
".",
"NeedsSig",
",",
"ie",
".",
"Issue",
".",
"Labels",
")",
"\n\n",
"if",
"hasSigLabel",
"&&",
"hasNeedsSigLabel",
"{",
"if",
"err",
":=",
"ghc",
".",
"RemoveLabel",
"(",
"org",
",",
"repo",
",",
"number",
",",
"labels",
".",
"NeedsSig",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"labels",
".",
"NeedsSig",
")",
"\n",
"}",
"\n",
"botName",
",",
"err",
":=",
"ghc",
".",
"BotName",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"cp",
".",
"PruneComments",
"(",
"shouldPrune",
"(",
"log",
",",
"botName",
")",
")",
"\n",
"}",
"else",
"if",
"!",
"hasSigLabel",
"&&",
"!",
"hasNeedsSigLabel",
"{",
"if",
"err",
":=",
"ghc",
".",
"AddLabel",
"(",
"org",
",",
"repo",
",",
"number",
",",
"labels",
".",
"NeedsSig",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"WithError",
"(",
"err",
")",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"labels",
".",
"NeedsSig",
")",
"\n",
"}",
"\n",
"<mask>",
":=",
"plugins",
".",
"FormatResponse",
"(",
"ie",
".",
"Issue",
".",
"User",
".",
"Login",
",",
"needsSIGMessage",
",",
"needsSIGDetails",
")",
"\n",
"if",
"err",
":=",
"ghc",
".",
"CreateComment",
"(",
"org",
",",
"repo",
",",
"number",
",",
"msg",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"WithError",
"(",
"err",
")",
".",
"Error",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
13,248 | all-13249 | [
"PushSMS",
"sends",
"an",
"SMS",
"message",
"with",
"pushbullet"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"PushSMS",
"(",
"userIden",
",",
"deviceIden",
",",
"phoneNumber",
",",
"message",
"string",
")",
"error",
"{",
"data",
":=",
"Ephemeral",
"{",
"Type",
":",
"\"",
"\"",
",",
"Push",
":",
"EphemeralPush",
"{",
"Type",
":",
"\"",
"\"",
",",
"PackageName",
":",
"\"",
"\"",
",",
"SourceUserIden",
":",
"userIden",
",",
"TargetDeviceIden",
":",
"deviceIden",
",",
"ConversationIden",
":",
"phoneNumber",
",",
"Message",
":",
"<mask>",
",",
"}",
",",
"}",
"\n",
"return",
"c",
".",
"Push",
"(",
"\"",
"\"",
",",
"data",
")",
"\n",
"}"
] |
13,249 | all-13250 | [
"Shutdown",
"is",
"used",
"to",
"stop",
"the",
"Raft",
"background",
"routines",
".",
"This",
"is",
"not",
"a",
"graceful",
"operation",
".",
"Provides",
"a",
"future",
"that",
"can",
"be",
"used",
"to",
"block",
"until",
"all",
"background",
"routines",
"have",
"exited",
"."
] | [
"func",
"(",
"r",
"*",
"Raft",
")",
"Shutdown",
"(",
")",
"<mask>",
"{",
"r",
".",
"shutdownLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r",
".",
"shutdownLock",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"!",
"r",
".",
"shutdown",
"{",
"close",
"(",
"r",
".",
"shutdownCh",
")",
"\n",
"r",
".",
"shutdown",
"=",
"true",
"\n",
"r",
".",
"setState",
"(",
"Shutdown",
")",
"\n",
"return",
"&",
"shutdownFuture",
"{",
"r",
"}",
"\n",
"}",
"\n\n",
"// avoid closing transport twice",
"return",
"&",
"shutdownFuture",
"{",
"nil",
"}",
"\n",
"}"
] |
13,250 | all-13251 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetAllCookiesReturns",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork38",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
13,251 | all-13252 | [
"columns",
"returns",
"the",
"comma",
"-",
"separated",
"column",
"name",
"with",
"quoted",
"."
] | [
"func",
"(",
"db",
"*",
"DB",
")",
"columns",
"(",
"tableName",
"string",
",",
"columns",
"[",
"]",
"interface",
"{",
"}",
")",
"string",
"{",
"if",
"len",
"(",
"columns",
")",
"==",
"0",
"{",
"return",
"ColumnName",
"(",
"db",
".",
"dialect",
",",
"tableName",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"names",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"columns",
")",
")",
"\n",
"for",
"i",
",",
"col",
":=",
"<mask>",
"columns",
"{",
"switch",
"c",
":=",
"col",
".",
"(",
"type",
")",
"{",
"case",
"Raw",
":",
"names",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprint",
"(",
"*",
"c",
")",
"\n",
"case",
"string",
":",
"names",
"[",
"i",
"]",
"=",
"ColumnName",
"(",
"db",
".",
"dialect",
",",
"tableName",
",",
"c",
")",
"\n",
"case",
"*",
"Distinct",
":",
"names",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"db",
".",
"columns",
"(",
"tableName",
",",
"ToInterfaceSlice",
"(",
"c",
".",
"columns",
")",
")",
")",
"\n",
"default",
":",
"panic",
"(",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"c",
")",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Join",
"(",
"names",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
13,252 | all-13253 | [
"GetPangoFontMap",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_context_get_pango_fontmap",
"()",
"."
] | [
"func",
"(",
"pc",
"*",
"PrintContext",
")",
"GetPangoFontMap",
"(",
")",
"*",
"pango",
".",
"FontMap",
"{",
"c",
":=",
"C",
".",
"gtk_print_context_get_pango_fontmap",
"(",
"<mask>",
".",
"native",
"(",
")",
")",
"\n",
"return",
"pango",
".",
"WrapFontMap",
"(",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
")",
"\n",
"}"
] |
13,253 | all-13254 | [
"HasMustShowBreakdown",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"HasMustShowBreakdown",
"(",
")",
"bool",
"{",
"if",
"w",
"!=",
"nil",
"&&",
"w",
".",
"MustShowBreakdown",
"!=",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] |
13,254 | all-13255 | [
"GetImageAlias",
"returns",
"an",
"existing",
"alias",
"as",
"an",
"ImageAliasesEntry",
"struct"
] | [
"func",
"(",
"r",
"*",
"ProtocolLXD",
")",
"GetImageAlias",
"(",
"<mask>",
"string",
")",
"(",
"*",
"api",
".",
"ImageAliasesEntry",
",",
"string",
",",
"error",
")",
"{",
"alias",
":=",
"api",
".",
"ImageAliasesEntry",
"{",
"}",
"\n\n",
"// Fetch the raw value",
"etag",
",",
"err",
":=",
"r",
".",
"queryStruct",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"url",
".",
"QueryEscape",
"(",
"name",
")",
")",
",",
"nil",
",",
"\"",
"\"",
",",
"&",
"alias",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"alias",
",",
"etag",
",",
"nil",
"\n",
"}"
] |
13,255 | all-13256 | [
"MoveToFolder",
"is",
"a",
"complex",
"method",
"that",
"moves",
"a",
"StoragePod",
"to",
"a",
"given",
"relative",
"datastore",
"folder",
"path",
".",
"Relative",
"here",
"means",
"relative",
"to",
"a",
"datacenter",
"which",
"is",
"discovered",
"from",
"the",
"current",
"StoragePod",
"path",
"."
] | [
"func",
"MoveToFolder",
"(",
"client",
"*",
"govmomi",
".",
"Client",
",",
"pod",
"*",
"object",
".",
"StoragePod",
",",
"relative",
"string",
")",
"error",
"{",
"f",
",",
"err",
":=",
"folder",
".",
"DatastoreFolderFromObject",
"(",
"client",
",",
"pod",
",",
"relative",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"<mask>",
".",
"MoveObjectTo",
"(",
"pod",
".",
"Reference",
"(",
")",
",",
"f",
")",
"\n",
"}"
] |
13,256 | all-13257 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"GetPossibleBreakpointsParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger36",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
13,257 | all-13258 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"SignedExchangeErrorField",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"SignedExchangeErrorField",
"(",
"in",
".",
"String",
"(",
")",
")",
"{",
"case",
"SignedExchangeErrorFieldSignatureSig",
":",
"*",
"t",
"=",
"SignedExchangeErrorFieldSignatureSig",
"\n",
"<mask>",
"SignedExchangeErrorFieldSignatureIntegrity",
":",
"*",
"t",
"=",
"SignedExchangeErrorFieldSignatureIntegrity",
"\n",
"case",
"SignedExchangeErrorFieldSignatureCertURL",
":",
"*",
"t",
"=",
"SignedExchangeErrorFieldSignatureCertURL",
"\n",
"case",
"SignedExchangeErrorFieldSignatureCertSha256",
":",
"*",
"t",
"=",
"SignedExchangeErrorFieldSignatureCertSha256",
"\n",
"case",
"SignedExchangeErrorFieldSignatureValidityURL",
":",
"*",
"t",
"=",
"SignedExchangeErrorFieldSignatureValidityURL",
"\n",
"case",
"SignedExchangeErrorFieldSignatureTimestamps",
":",
"*",
"t",
"=",
"SignedExchangeErrorFieldSignatureTimestamps",
"\n\n",
"default",
":",
"in",
".",
"AddError",
"(",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"}"
] |
13,258 | all-13259 | [
"FetchChildren",
"fetches",
"the",
"children",
"with",
"of",
"given",
"parent",
"identified",
"by",
"the",
"given",
"Identity",
"."
] | [
"func",
"(",
"s",
"*",
"Session",
")",
"FetchChildren",
"(",
"parent",
"Identifiable",
",",
"identity",
"Identity",
",",
"dest",
"interface",
"{",
"}",
",",
"info",
"*",
"FetchingInfo",
")",
"*",
"Error",
"{",
"url",
",",
"berr",
":=",
"s",
".",
"getURLForChildrenIdentity",
"(",
"parent",
",",
"identity",
")",
"\n",
"if",
"berr",
"!=",
"nil",
"{",
"return",
"berr",
"\n",
"}",
"\n\n",
"request",
",",
"err",
":=",
"http",
".",
"NewRequest",
"(",
"\"",
"\"",
",",
"url",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"NewBambouError",
"(",
"\"",
"\"",
",",
"err",
".",
"<mask>",
"(",
")",
")",
"\n",
"}",
"\n\n",
"response",
",",
"berr",
":=",
"s",
".",
"send",
"(",
"request",
",",
"info",
")",
"\n",
"if",
"berr",
"!=",
"nil",
"{",
"return",
"berr",
"\n",
"}",
"\n",
"defer",
"response",
".",
"Body",
".",
"Close",
"(",
")",
"\n\n",
"body",
",",
"_",
":=",
"ioutil",
".",
"ReadAll",
"(",
"response",
".",
"Body",
")",
"\n",
"log",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"string",
"(",
"body",
")",
")",
"\n\n",
"if",
"response",
".",
"StatusCode",
"==",
"http",
".",
"StatusNoContent",
"||",
"response",
".",
"ContentLength",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"body",
",",
"&",
"dest",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"NewBambouError",
"(",
"\"",
"\"",
",",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
13,259 | all-13260 | [
"GetNoShowAll",
"is",
"a",
"wrapper",
"around",
"gtk_widget_get_no_show_all",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Widget",
")",
"GetNoShowAll",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_widget_get_no_show_all",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
13,260 | all-13261 | [
"IsErrNoMetadata",
"returns",
"true",
"if",
"err",
"is",
"an",
"ErrNoMetadata",
"(",
"uses",
"string",
"comparison",
"to",
"work",
"across",
"RPC",
"boundaries",
")"
] | [
"func",
"IsErrNoMetadata",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"status",
".",
"Convert",
"(",
"ErrNoMetadata",
")",
".",
"<mask>",
"(",
")",
")",
"\n",
"}"
] |
13,261 | all-13262 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"BeginFrameReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental4",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
13,262 | all-13263 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetDeviceMetricsOverrideParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoEmulation12",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
13,263 | all-13264 | [
"Packages",
"returns",
"the",
"the",
"AST",
"packages",
"in",
"which",
"to",
"search",
"for",
"structs",
".",
"By",
"default",
"it",
"includes",
"the",
"lxd",
"/",
"db",
"and",
"shared",
"/",
"api",
"packages",
"."
] | [
"func",
"Packages",
"(",
")",
"(",
"map",
"[",
"string",
"]",
"*",
"ast",
".",
"Package",
",",
"error",
")",
"{",
"packages",
":=",
"map",
"[",
"string",
"]",
"*",
"ast",
".",
"Package",
"{",
"}",
"\n\n",
"for",
"_",
",",
"<mask>",
":=",
"range",
"defaultPackages",
"{",
"pkg",
",",
"err",
":=",
"lex",
".",
"Parse",
"(",
"name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrapf",
"(",
"err",
",",
"\"",
"\"",
",",
"name",
")",
"\n",
"}",
"\n",
"parts",
":=",
"strings",
".",
"Split",
"(",
"name",
",",
"\"",
"\"",
")",
"\n",
"packages",
"[",
"parts",
"[",
"len",
"(",
"parts",
")",
"-",
"1",
"]",
"]",
"=",
"pkg",
"\n",
"}",
"\n\n",
"return",
"packages",
",",
"nil",
"\n",
"}"
] |
13,264 | all-13265 | [
"=====",
"Actions",
"POST",
"/",
"api",
"/",
"analysis_snapshots",
"Create",
"a",
"new",
"AnalysisSnapshot",
"."
] | [
"func",
"(",
"loc",
"*",
"AnalysisSnapshotLocator",
")",
"Create",
"(",
"endTime",
"*",
"time",
".",
"Time",
",",
"granularity",
"string",
",",
"startTime",
"*",
"time",
".",
"Time",
",",
"options",
"rsapi",
".",
"APIParams",
")",
"(",
"*",
"AnalysisSnapshotLocator",
",",
"error",
")",
"{",
"var",
"res",
"*",
"AnalysisSnapshotLocator",
"\n",
"if",
"granularity",
"==",
"\"",
"\"",
"{",
"return",
"res",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"var",
"params",
"rsapi",
".",
"APIParams",
"\n",
"params",
"=",
"rsapi",
".",
"APIParams",
"{",
"}",
"\n",
"var",
"viewOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"viewOpt",
"!=",
"nil",
"{",
"params",
"[",
"\"",
"\"",
"]",
"=",
"viewOpt",
"\n",
"}",
"\n",
"var",
"p",
"rsapi",
".",
"APIParams",
"\n",
"p",
"=",
"rsapi",
".",
"APIParams",
"{",
"\"",
"\"",
":",
"endTime",
",",
"\"",
"\"",
":",
"granularity",
",",
"\"",
"\"",
":",
"startTime",
",",
"}",
"\n",
"var",
"excludedTagTypesOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"excludedTagTypesOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"excludedTagTypesOpt",
"\n",
"}",
"\n",
"var",
"filtersOpt",
"=",
"<mask>",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"filtersOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"filtersOpt",
"\n",
"}",
"\n",
"var",
"isComparisonOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"isComparisonOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"isComparisonOpt",
"\n",
"}",
"\n",
"var",
"metricsOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"metricsOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"metricsOpt",
"\n",
"}",
"\n",
"var",
"moduleStatesOpt",
"=",
"options",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"moduleStatesOpt",
"!=",
"nil",
"{",
"p",
"[",
"\"",
"\"",
"]",
"=",
"moduleStatesOpt",
"\n",
"}",
"\n",
"uri",
",",
"err",
":=",
"loc",
".",
"ActionPath",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"res",
",",
"err",
"\n",
"}",
"\n",
"req",
",",
"err",
":=",
"loc",
".",
"api",
".",
"BuildHTTPRequest",
"(",
"uri",
".",
"HTTPMethod",
",",
"uri",
".",
"Path",
",",
"APIVersion",
",",
"params",
",",
"p",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"res",
",",
"err",
"\n",
"}",
"\n",
"resp",
",",
"err",
":=",
"loc",
".",
"api",
".",
"PerformRequest",
"(",
"req",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"res",
",",
"err",
"\n",
"}",
"\n",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n",
"if",
"resp",
".",
"StatusCode",
"<",
"200",
"||",
"resp",
".",
"StatusCode",
">",
"299",
"{",
"respBody",
",",
"_",
":=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"sr",
":=",
"string",
"(",
"respBody",
")",
"\n",
"if",
"sr",
"!=",
"\"",
"\"",
"{",
"sr",
"=",
"\"",
"\"",
"+",
"sr",
"\n",
"}",
"\n",
"return",
"res",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"resp",
".",
"Status",
",",
"sr",
")",
"\n",
"}",
"\n",
"location",
":=",
"resp",
".",
"Header",
".",
"Get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"len",
"(",
"location",
")",
"==",
"0",
"{",
"return",
"res",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"else",
"{",
"return",
"&",
"AnalysisSnapshotLocator",
"{",
"Href",
"(",
"location",
")",
",",
"loc",
".",
"api",
"}",
",",
"nil",
"\n",
"}",
"\n",
"}"
] |
13,265 | all-13266 | [
"CopytoTemp",
"creates",
"a",
"temporary",
"file",
"from",
"the",
"source",
"file",
"into",
"the",
"default",
"directory",
"for",
"temporary",
"files",
"(",
"see",
"os",
".",
"TempDir",
")",
"whose",
"name",
"begins",
"with",
"prefix",
".",
"If",
"prefix",
"is",
"the",
"empty",
"string",
"uses",
"the",
"default",
"value",
"PREFIX_TEMP",
".",
"Returns",
"the",
"temporary",
"file",
"name",
"."
] | [
"func",
"CopytoTemp",
"(",
"source",
",",
"prefix",
"string",
")",
"(",
"tmpFile",
"string",
",",
"err",
"error",
")",
"{",
"if",
"prefix",
"==",
"\"",
"\"",
"{",
"prefix",
"=",
"PREFIX_TEMP",
"\n",
"}",
"\n\n",
"src",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"source",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"defer",
"func",
"(",
")",
"{",
"err2",
":=",
"src",
".",
"Close",
"(",
")",
"\n",
"if",
"err2",
"!=",
"nil",
"&&",
"err",
"==",
"nil",
"{",
"err",
"=",
"err2",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n\n",
"dest",
",",
"err",
":=",
"ioutil",
".",
"TempFile",
"(",
"\"",
"\"",
",",
"prefix",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"defer",
"func",
"(",
")",
"{",
"err2",
":=",
"<mask>",
".",
"Close",
"(",
")",
"\n",
"if",
"err2",
"!=",
"nil",
"&&",
"err",
"==",
"nil",
"{",
"err",
"=",
"err2",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n\n",
"if",
"_",
",",
"err",
"=",
"io",
".",
"Copy",
"(",
"dest",
",",
"src",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"return",
"dest",
".",
"Name",
"(",
")",
",",
"nil",
"\n",
"}"
] |
13,266 | all-13267 | [
"ApplyTransition",
"calls",
"the",
"function",
"required",
"to",
"move",
"to",
"the",
"specified",
"status"
] | [
"func",
"(",
"<mask>",
"*",
"SSMSecretResource",
")",
"ApplyTransition",
"(",
"nextState",
"resourcestatus",
".",
"ResourceStatus",
")",
"error",
"{",
"transitionFunc",
",",
"ok",
":=",
"secret",
".",
"resourceStatusToTransitionFunction",
"[",
"nextState",
"]",
"\n",
"if",
"!",
"ok",
"{",
"return",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"secret",
".",
"GetName",
"(",
")",
",",
"secret",
".",
"StatusString",
"(",
"nextState",
")",
")",
"\n",
"}",
"\n",
"return",
"transitionFunc",
"(",
")",
"\n",
"}"
] |
13,267 | all-13268 | [
"ListServers",
"lists",
"all",
"known",
"Mock",
"Servers"
] | [
"func",
"(",
"p",
"*",
"PactClient",
")",
"ListServers",
"(",
")",
"[",
"]",
"*",
"types",
".",
"MockServer",
"{",
"log",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n\n",
"var",
"servers",
"[",
"]",
"*",
"types",
".",
"MockServer",
"\n\n",
"for",
"port",
",",
"s",
":=",
"range",
"p",
".",
"pactMockSvcManager",
".",
"List",
"(",
")",
"{",
"servers",
"=",
"append",
"(",
"servers",
",",
"&",
"<mask>",
".",
"MockServer",
"{",
"Pid",
":",
"s",
".",
"Process",
".",
"Pid",
",",
"Port",
":",
"port",
",",
"}",
")",
"\n",
"}",
"\n\n",
"return",
"servers",
"\n",
"}"
] |
13,268 | all-13269 | [
"GenOLEODBC",
"generates",
"a",
"oleodbc",
"DSN",
"from",
"the",
"passed",
"URL",
"."
] | [
"func",
"GenOLEODBC",
"(",
"u",
"*",
"<mask>",
")",
"(",
"string",
",",
"error",
")",
"{",
"props",
",",
"err",
":=",
"GenODBC",
"(",
"u",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"nil",
"\n",
"}",
"\n\n",
"return",
"`Provider=MSDASQL.1;Extended Properties=\"`",
"+",
"props",
"+",
"`\"`",
",",
"nil",
"\n",
"}"
] |
13,269 | all-13270 | [
"BuildQwerty",
"builds",
"the",
"Qwerty",
"Graph"
] | [
"func",
"BuildQwerty",
"(",
")",
"Graph",
"{",
"data",
",",
"err",
":=",
"<mask>",
".",
"Asset",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"getAdjancencyGraphFromFile",
"(",
"data",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
13,270 | all-13271 | [
"List",
"implements",
"List",
"method",
"of",
"PlatformService",
"interface"
] | [
"func",
"(",
"s",
"*",
"platformService",
")",
"List",
"(",
"enabledOnly",
"bool",
")",
"(",
"[",
"]",
"appTypes",
".",
"<mask>",
",",
"error",
")",
"{",
"if",
"enabledOnly",
"{",
"return",
"s",
".",
"storage",
".",
"FindEnabled",
"(",
")",
"\n",
"}",
"\n",
"return",
"s",
".",
"storage",
".",
"FindAll",
"(",
")",
"\n",
"}"
] |
13,271 | all-13272 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"TakeHeapSnapshotParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeapprofiler",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
13,272 | all-13273 | [
"NewClient",
"returns",
"a",
"new",
"instance",
"of",
"roundtrip",
".",
"Client",
"or",
"nil",
"and",
"error",
"c",
"err",
":",
"=",
"NewClient",
"(",
"http",
":",
"//",
"localhost",
":",
"8080",
"v1",
")",
"if",
"err",
"!",
"=",
"nil",
"{",
"//",
"handle",
"error",
"}"
] | [
"func",
"NewClient",
"(",
"addr",
",",
"v",
"string",
",",
"params",
"...",
"ClientParam",
")",
"(",
"*",
"Client",
",",
"error",
")",
"{",
"c",
":=",
"&",
"Client",
"{",
"addr",
":",
"addr",
",",
"v",
":",
"v",
",",
"client",
":",
"&",
"http",
".",
"Client",
"{",
"}",
",",
"}",
"\n",
"for",
"_",
",",
"p",
":=",
"range",
"params",
"{",
"if",
"err",
":=",
"p",
"(",
"c",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"c",
".",
"<mask>",
"!=",
"nil",
"{",
"c",
".",
"client",
".",
"Jar",
"=",
"c",
".",
"jar",
"\n",
"}",
"\n",
"if",
"c",
".",
"newTracer",
"==",
"nil",
"{",
"c",
".",
"newTracer",
"=",
"NewNopTracer",
"\n",
"}",
"\n",
"return",
"c",
",",
"nil",
"\n",
"}"
] |
13,273 | all-13274 | [
"GetPixbuf",
"is",
"a",
"wrapper",
"around",
"gtk_offscreen_window_get_pixbuf",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"OffscreenWindow",
")",
"GetPixbuf",
"(",
")",
"(",
"*",
"gdk",
".",
"Pixbuf",
",",
"error",
")",
"{",
"c",
":=",
"C",
".",
"gtk_offscreen_window_get_pixbuf",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n\n",
"// Pixbuf is returned with ref count of 1, so don't increment.",
"// Is it a floating reference?",
"<mask>",
":=",
"&",
"gdk",
".",
"Pixbuf",
"{",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"}",
"\n",
"return",
"pb",
",",
"nil",
"\n",
"}"
] |
13,274 | all-13275 | [
"DurationVar",
"defines",
"a",
"time",
".",
"Duration",
"flag",
"with",
"specified",
"name",
"default",
"value",
"and",
"usage",
"string",
".",
"The",
"argument",
"p",
"points",
"to",
"a",
"time",
".",
"Duration",
"variable",
"in",
"which",
"to",
"store",
"the",
"value",
"of",
"the",
"flag",
"."
] | [
"func",
"DurationVar",
"(",
"p",
"*",
"time",
".",
"Duration",
",",
"name",
"string",
",",
"value",
"time",
".",
"Duration",
",",
"usage",
"string",
")",
"{",
"EnvironmentFlags",
".",
"DurationVar",
"(",
"p",
",",
"name",
",",
"<mask>",
",",
"usage",
")",
"\n",
"}"
] |
13,275 | all-13276 | [
"NewInlineQueryResultPhoto",
"returns",
"a",
"new",
"InlineQueryResultPhoto",
"with",
"all",
"mandatory",
"fields",
"set",
"."
] | [
"func",
"NewInlineQueryResultPhoto",
"(",
"id",
",",
"photoURL",
",",
"thumbURL",
"string",
")",
"*",
"InlineQueryResultPhoto",
"{",
"return",
"&",
"InlineQueryResultPhoto",
"{",
"InlineQueryResultBase",
":",
"InlineQueryResultBase",
"{",
"Type",
":",
"PhotoResult",
",",
"<mask>",
":",
"id",
",",
"}",
",",
"PhotoURL",
":",
"photoURL",
",",
"ThumbURL",
":",
"thumbURL",
",",
"}",
"\n",
"}"
] |
13,276 | all-13277 | [
"FetchMetricClusters",
"retrieves",
"all",
"metric",
"clusters",
"available",
"to",
"API",
"Token",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"FetchMetricClusters",
"(",
"extras",
"string",
")",
"(",
"*",
"[",
"]",
"MetricCluster",
",",
"error",
")",
"{",
"reqURL",
":=",
"url",
".",
"URL",
"{",
"Path",
":",
"config",
".",
"MetricClusterPrefix",
",",
"}",
"\n\n",
"extra",
":=",
"\"",
"\"",
"\n",
"switch",
"extras",
"{",
"case",
"\"",
"\"",
":",
"extra",
"=",
"\"",
"\"",
"\n",
"case",
"\"",
"\"",
":",
"extra",
"=",
"\"",
"\"",
"\n",
"}",
"\n\n",
"if",
"extra",
"!=",
"\"",
"\"",
"{",
"q",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"extra",
")",
"\n",
"reqURL",
".",
"RawQuery",
"=",
"q",
".",
"Encode",
"(",
")",
"\n",
"}",
"\n\n",
"result",
",",
"err",
":=",
"a",
".",
"Get",
"(",
"reqURL",
".",
"String",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"clusters",
"[",
"]",
"MetricCluster",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"<mask>",
",",
"&",
"clusters",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"clusters",
",",
"nil",
"\n",
"}"
] |
13,277 | all-13278 | [
"checkValidVersionByte",
"returns",
"an",
"error",
"if",
"the",
"provided",
"value",
"is",
"not",
"one",
"of",
"the",
"defined",
"valid",
"version",
"byte",
"constants",
"."
] | [
"func",
"checkValidVersionByte",
"(",
"version",
"VersionByte",
")",
"error",
"{",
"if",
"version",
"==",
"VersionByteAccountID",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"<mask>",
"==",
"VersionByteSeed",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"return",
"ErrInvalidVersionByte",
"\n",
"}"
] |
13,278 | all-13279 | [
"Exit",
"is",
"a",
"standalone",
"exit",
"function",
"for",
"simple",
"checks",
"without",
"multiple",
"results",
"or",
"perfdata",
"."
] | [
"func",
"Exit",
"(",
"status",
"Status",
",",
"<mask>",
"string",
")",
"{",
"fmt",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"status",
",",
"message",
")",
"\n",
"os",
".",
"Exit",
"(",
"int",
"(",
"status",
")",
")",
"\n",
"}"
] |
13,279 | all-13280 | [
"PubKey",
"returns",
"peer",
"s",
"public",
"key",
"."
] | [
"func",
"(",
"p",
"*",
"Peer",
")",
"PubKey",
"(",
")",
"crypto",
".",
"PubKeyEd25519",
"{",
"if",
"p",
".",
"config",
".",
"AuthEnc",
"{",
"return",
"p",
".",
"<mask>",
".",
"(",
"*",
"SecretConnection",
")",
".",
"RemotePubKey",
"(",
")",
"\n",
"}",
"\n",
"if",
"p",
".",
"NodeInfo",
"==",
"nil",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"p",
".",
"PubKey",
"(",
")",
"\n",
"}"
] |
13,280 | all-13281 | [
"MustPathPaymentOp",
"retrieves",
"the",
"PathPaymentOp",
"value",
"from",
"the",
"union",
"panicing",
"if",
"the",
"value",
"is",
"not",
"set",
"."
] | [
"func",
"(",
"u",
"OperationBody",
")",
"MustPathPaymentOp",
"(",
")",
"PathPaymentOp",
"{",
"val",
",",
"<mask>",
":=",
"u",
".",
"GetPathPaymentOp",
"(",
")",
"\n\n",
"if",
"!",
"ok",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"val",
"\n",
"}"
] |
13,281 | all-13282 | [
"Returns",
"a",
"Point"
] | [
"func",
"(",
"p",
"CvPoint2D32f",
")",
"ToPoint",
"(",
")",
"Point2D32f",
"{",
"<mask>",
"Point2D32f",
"{",
"float32",
"(",
"p",
".",
"x",
")",
",",
"float32",
"(",
"p",
".",
"y",
")",
"}",
"\n",
"}"
] |
13,282 | all-13283 | [
"GetTarget",
"returns",
"the",
"target",
"operation"
] | [
"func",
"(",
"op",
"*",
"remoteOperation",
")",
"GetTarget",
"(",
")",
"(",
"*",
"api",
".",
"<mask>",
",",
"error",
")",
"{",
"if",
"op",
".",
"targetOp",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"opAPI",
":=",
"op",
".",
"targetOp",
".",
"Get",
"(",
")",
"\n",
"return",
"&",
"opAPI",
",",
"nil",
"\n",
"}"
] |
13,283 | all-13284 | [
"HasPerUnit",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"m",
"*",
"MetricMetadata",
")",
"HasPerUnit",
"(",
")",
"bool",
"{",
"if",
"m",
"!=",
"nil",
"&&",
"m",
".",
"PerUnit",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
13,284 | all-13285 | [
"Do",
"executes",
"Profiler",
".",
"setSamplingInterval",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetSamplingIntervalParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetSamplingInterval",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
13,285 | all-13286 | [
"native",
"returns",
"a",
"pointer",
"to",
"the",
"underlying",
"GObject",
"as",
"a",
"GtkTextTag",
"."
] | [
"func",
"(",
"v",
"*",
"TextTag",
")",
"native",
"(",
")",
"*",
"C",
".",
"GtkTextTag",
"{",
"if",
"v",
"==",
"nil",
"||",
"v",
".",
"GObject",
"==",
"nil",
"{",
"<mask>",
"nil",
"\n",
"}",
"\n",
"p",
":=",
"unsafe",
".",
"Pointer",
"(",
"v",
".",
"GObject",
")",
"\n",
"return",
"C",
".",
"toGtkTextTag",
"(",
"p",
")",
"\n",
"}"
] |
13,286 | all-13287 | [
"resourceVSphereLicenseUpdate",
"check",
"for",
"change",
"in",
"labels",
"of",
"the",
"key",
"and",
"updates",
"them",
"."
] | [
"func",
"resourceVSphereLicenseUpdate",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"meta",
"interface",
"{",
"}",
")",
"error",
"{",
"log",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n\n",
"client",
":=",
"meta",
".",
"(",
"*",
"VSphereClient",
")",
".",
"vimClient",
"\n",
"manager",
":=",
"license",
".",
"NewManager",
"(",
"client",
".",
"Client",
")",
"\n\n",
"if",
"key",
",",
"ok",
":=",
"d",
".",
"GetOk",
"(",
"\"",
"\"",
")",
";",
"ok",
"{",
"licenseKey",
":=",
"key",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"isKeyPresent",
"(",
"licenseKey",
",",
"<mask>",
")",
"{",
"return",
"ErrNoSuchKeyFound",
"\n",
"}",
"\n\n",
"if",
"d",
".",
"HasChange",
"(",
"\"",
"\"",
")",
"{",
"labelMap",
":=",
"d",
".",
"Get",
"(",
"\"",
"\"",
")",
".",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n\n",
"err",
":=",
"updateLabels",
"(",
"manager",
",",
"licenseKey",
",",
"labelMap",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"resourceVSphereLicenseRead",
"(",
"d",
",",
"meta",
")",
"\n",
"}"
] |
13,287 | all-13288 | [
"SetUpper",
"is",
"a",
"wrapper",
"around",
"gtk_adjustment_set_upper",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Adjustment",
")",
"SetUpper",
"(",
"value",
"float64",
")",
"{",
"C",
".",
"gtk_adjustment_set_upper",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gdouble",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
13,288 | all-13289 | [
"Respond",
"without",
"doing",
"anything",
".",
"This",
"endpoint",
"is",
"used",
"to",
"check",
"that",
"the",
"service",
"is",
"up",
".",
"See",
"#ping"
] | [
"func",
"(",
"purgeCache",
"*",
"PurgeCache",
")",
"Ping",
"(",
")",
"error",
"{",
"<mask>",
":=",
"tcclient",
".",
"Client",
"(",
"*",
"purgeCache",
")",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"(",
"&",
"cd",
")",
".",
"APICall",
"(",
"nil",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"nil",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
13,289 | all-13290 | [
"ContinueOnError",
"ErrorHandling",
"//",
"Return",
"a",
"descriptive",
"error",
".",
"ExitOnError",
"//",
"Call",
"os",
".",
"Exit",
"(",
"2",
")",
".",
"PanicOnError",
"//",
"Call",
"panic",
"with",
"a",
"descriptive",
"error",
".",
"flag",
".",
"ContinueOnError"
] | [
"func",
"newOption",
"(",
"w",
"io",
".",
"Writer",
",",
"eh",
"flag",
".",
"ErrorHandling",
")",
"(",
"o",
"*",
"<mask>",
")",
"{",
"o",
"=",
"&",
"option",
"{",
"flagSet",
":",
"flag",
".",
"NewFlagSet",
"(",
"CommandName",
",",
"eh",
")",
",",
"}",
"\n",
"// option settings",
"o",
".",
"flagSet",
".",
"StringVar",
"(",
"&",
"o",
".",
"http",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"o",
".",
"flagSet",
".",
"StringVar",
"(",
"&",
"o",
".",
"udic",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"o",
".",
"flagSet",
".",
"StringVar",
"(",
"&",
"o",
".",
"sysdic",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}"
] |
13,290 | all-13291 | [
"GetTimeOk",
"returns",
"a",
"tuple",
"with",
"the",
"Time",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"s",
"*",
"ScatterplotDefinition",
")",
"GetTimeOk",
"(",
")",
"(",
"WidgetTime",
",",
"bool",
")",
"{",
"if",
"s",
"==",
"nil",
"||",
"s",
".",
"Time",
"==",
"nil",
"{",
"return",
"WidgetTime",
"{",
"}",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"s",
".",
"Time",
",",
"<mask>",
"\n",
"}"
] |
13,291 | all-13292 | [
"NewTaskResponse",
"creates",
"a",
"new",
"response",
"object",
"for",
"the",
"task"
] | [
"func",
"NewTaskResponse",
"(",
"taskARN",
"string",
",",
"state",
"dockerstate",
".",
"TaskEngineState",
",",
"ecsClient",
"api",
".",
"ECSClient",
",",
"cluster",
"string",
",",
"az",
"string",
",",
"containerInstanceArn",
"string",
",",
"propagateTags",
"bool",
")",
"(",
"*",
"TaskResponse",
",",
"error",
")",
"{",
"task",
",",
"ok",
":=",
"state",
".",
"TaskByArn",
"(",
"taskARN",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"taskARN",
")",
"\n",
"}",
"\n\n",
"resp",
":=",
"&",
"TaskResponse",
"{",
"Cluster",
":",
"cluster",
",",
"TaskARN",
":",
"<mask>",
".",
"Arn",
",",
"Family",
":",
"task",
".",
"Family",
",",
"Revision",
":",
"task",
".",
"Version",
",",
"DesiredStatus",
":",
"task",
".",
"GetDesiredStatus",
"(",
")",
".",
"String",
"(",
")",
",",
"KnownStatus",
":",
"task",
".",
"GetKnownStatus",
"(",
")",
".",
"String",
"(",
")",
",",
"AvailabilityZone",
":",
"az",
",",
"}",
"\n\n",
"taskCPU",
":=",
"task",
".",
"CPU",
"\n",
"taskMemory",
":=",
"task",
".",
"Memory",
"\n",
"if",
"taskCPU",
"!=",
"0",
"||",
"taskMemory",
"!=",
"0",
"{",
"taskLimits",
":=",
"&",
"LimitsResponse",
"{",
"}",
"\n",
"if",
"taskCPU",
"!=",
"0",
"{",
"taskLimits",
".",
"CPU",
"=",
"&",
"taskCPU",
"\n",
"}",
"\n",
"if",
"taskMemory",
"!=",
"0",
"{",
"taskLimits",
".",
"Memory",
"=",
"&",
"taskMemory",
"\n",
"}",
"\n",
"resp",
".",
"Limits",
"=",
"taskLimits",
"\n",
"}",
"\n\n",
"if",
"timestamp",
":=",
"task",
".",
"GetPullStartedAt",
"(",
")",
";",
"!",
"timestamp",
".",
"IsZero",
"(",
")",
"{",
"resp",
".",
"PullStartedAt",
"=",
"aws",
".",
"Time",
"(",
"timestamp",
".",
"UTC",
"(",
")",
")",
"\n",
"}",
"\n",
"if",
"timestamp",
":=",
"task",
".",
"GetPullStoppedAt",
"(",
")",
";",
"!",
"timestamp",
".",
"IsZero",
"(",
")",
"{",
"resp",
".",
"PullStoppedAt",
"=",
"aws",
".",
"Time",
"(",
"timestamp",
".",
"UTC",
"(",
")",
")",
"\n",
"}",
"\n",
"if",
"timestamp",
":=",
"task",
".",
"GetExecutionStoppedAt",
"(",
")",
";",
"!",
"timestamp",
".",
"IsZero",
"(",
")",
"{",
"resp",
".",
"ExecutionStoppedAt",
"=",
"aws",
".",
"Time",
"(",
"timestamp",
".",
"UTC",
"(",
")",
")",
"\n",
"}",
"\n",
"containerNameToDockerContainer",
",",
"ok",
":=",
"state",
".",
"ContainerMapByArn",
"(",
"task",
".",
"Arn",
")",
"\n",
"if",
"!",
"ok",
"{",
"seelog",
".",
"Warnf",
"(",
"\"",
"\"",
",",
"task",
".",
"Arn",
")",
"\n",
"return",
"resp",
",",
"nil",
"\n",
"}",
"\n\n",
"eni",
":=",
"task",
".",
"GetTaskENI",
"(",
")",
"\n",
"for",
"_",
",",
"dockerContainer",
":=",
"range",
"containerNameToDockerContainer",
"{",
"containerResponse",
":=",
"newContainerResponse",
"(",
"dockerContainer",
",",
"eni",
",",
"state",
")",
"\n",
"resp",
".",
"Containers",
"=",
"append",
"(",
"resp",
".",
"Containers",
",",
"containerResponse",
")",
"\n",
"}",
"\n\n",
"if",
"propagateTags",
"{",
"propagateTagsToMetadata",
"(",
"state",
",",
"ecsClient",
",",
"containerInstanceArn",
",",
"taskARN",
",",
"resp",
")",
"\n",
"}",
"\n\n",
"return",
"resp",
",",
"nil",
"\n",
"}"
] |
13,292 | all-13293 | [
"RegisterElectionHandler",
"registers",
"the",
"http",
"handlers",
"for",
"service",
"Election",
"to",
"mux",
".",
"The",
"handlers",
"forward",
"requests",
"to",
"the",
"grpc",
"endpoint",
"over",
"conn",
"."
] | [
"func",
"RegisterElectionHandler",
"(",
"ctx",
"context",
".",
"<mask>",
",",
"mux",
"*",
"runtime",
".",
"ServeMux",
",",
"conn",
"*",
"grpc",
".",
"ClientConn",
")",
"error",
"{",
"return",
"RegisterElectionHandlerClient",
"(",
"ctx",
",",
"mux",
",",
"v3electionpb",
".",
"NewElectionClient",
"(",
"conn",
")",
")",
"\n",
"}"
] |
13,293 | all-13294 | [
"UnmarshalJSON",
"satisfies",
"json",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"MouseType",
")",
"UnmarshalJSON",
"(",
"buf",
"[",
"]",
"<mask>",
")",
"error",
"{",
"return",
"easyjson",
".",
"Unmarshal",
"(",
"buf",
",",
"t",
")",
"\n",
"}"
] |
13,294 | all-13295 | [
"Parse",
"parses",
"the",
"given",
"string",
"contents",
"as",
"a",
"config"
] | [
"func",
"Parse",
"(",
"s",
"string",
")",
"(",
"*",
"Config",
",",
"error",
")",
"{",
"var",
"shadow",
"interface",
"{",
"}",
"\n",
"if",
"err",
":=",
"hcl",
".",
"Decode",
"(",
"&",
"shadow",
",",
"s",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// Convert to a map and flatten the keys we want to flatten",
"parsed",
",",
"ok",
":=",
"shadow",
".",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"if",
"!",
"<mask>",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"flattenKeys",
"(",
"parsed",
",",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"}",
")",
"\n\n",
"// FlattenFlatten keys belonging to the templates. We cannot do this above",
"// because it is an array of templates.",
"if",
"templates",
",",
"ok",
":=",
"parsed",
"[",
"\"",
"\"",
"]",
".",
"(",
"[",
"]",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
";",
"ok",
"{",
"for",
"_",
",",
"template",
":=",
"range",
"templates",
"{",
"flattenKeys",
"(",
"template",
",",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"}",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"// Create a new, empty config",
"var",
"c",
"Config",
"\n\n",
"// Use mapstructure to populate the basic config fields",
"var",
"md",
"mapstructure",
".",
"Metadata",
"\n",
"decoder",
",",
"err",
":=",
"mapstructure",
".",
"NewDecoder",
"(",
"&",
"mapstructure",
".",
"DecoderConfig",
"{",
"DecodeHook",
":",
"mapstructure",
".",
"ComposeDecodeHookFunc",
"(",
"ConsulStringToStructFunc",
"(",
")",
",",
"StringToFileModeFunc",
"(",
")",
",",
"signals",
".",
"StringToSignalFunc",
"(",
")",
",",
"StringToWaitDurationHookFunc",
"(",
")",
",",
"mapstructure",
".",
"StringToSliceHookFunc",
"(",
"\"",
"\"",
")",
",",
"mapstructure",
".",
"StringToTimeDurationHookFunc",
"(",
")",
",",
")",
",",
"ErrorUnused",
":",
"true",
",",
"Metadata",
":",
"&",
"md",
",",
"Result",
":",
"&",
"c",
",",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"err",
":=",
"decoder",
".",
"Decode",
"(",
"parsed",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrap",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"&",
"c",
",",
"nil",
"\n",
"}"
] |
13,295 | all-13296 | [
"isBlank",
"returns",
"whether",
"id",
"is",
"the",
"blank",
"identifier",
"_",
".",
"If",
"id",
"==",
"nil",
"the",
"answer",
"is",
"false",
"."
] | [
"func",
"IsBlank",
"(",
"<mask>",
"ast",
".",
"Expr",
")",
"bool",
"{",
"ident",
",",
"_",
":=",
"id",
".",
"(",
"*",
"ast",
".",
"Ident",
")",
"\n",
"return",
"ident",
"!=",
"nil",
"&&",
"ident",
".",
"Name",
"==",
"\"",
"\"",
"\n",
"}"
] |
13,296 | all-13297 | [
"TODO",
"(",
"jrick",
")",
"GdkDragAction",
"/",
"*",
"func",
"(",
"v",
"*",
"Entry",
")",
"SetIconDragSource",
"()",
"{",
"}",
"GetCurrentIconDragSource",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_entry_get_current_icon_drag_source",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"GetCurrentIconDragSource",
"(",
")",
"int",
"{",
"c",
":=",
"C",
".",
"gtk_entry_get_current_icon_drag_source",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"return",
"int",
"(",
"c",
")",
"\n",
"}"
] |
13,297 | all-13298 | [
"Receive",
"waits",
"to",
"receive",
"the",
"next",
"incoming",
"messages",
"from",
"the",
"CCS",
"connection",
"."
] | [
"func",
"(",
"c",
"*",
"Conn",
")",
"Receive",
"(",
")",
"(",
"*",
"InMsg",
",",
"error",
")",
"{",
"stanza",
",",
"err",
":=",
"c",
".",
"xmppConn",
".",
"Recv",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"c",
".",
"debug",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"stanza",
")",
"\n",
"}",
"\n\n",
"chat",
",",
"ok",
":=",
"stanza",
".",
"(",
"xmpp",
".",
"Chat",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n\n",
"if",
"chat",
".",
"Type",
"==",
"\"",
"\"",
"{",
"// todo: once go-xmpp can parse XMPP error messages, return error with XMPP error message (issue: https://github.com/soygul/gcm/issues/14)",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"var",
"m",
"InMsg",
"\n",
"if",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"[",
"]",
"byte",
"(",
"chat",
".",
"Other",
"[",
"0",
"]",
")",
",",
"&",
"m",
")",
";",
"err",
"!=",
"nil",
"{",
"// todo: handle other fields of chat (remote/type/text/other[1,2,..])",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"switch",
"m",
".",
"MessageType",
"{",
"case",
"\"",
"\"",
":",
"return",
"&",
"m",
",",
"nil",
"// todo: mark message as sent",
"\n",
"case",
"\"",
"\"",
":",
"return",
"&",
"m",
",",
"nil",
"// todo: try and resend the message (after reconnect if problem is about connection draining)",
"\n",
"<mask>",
"\"",
"\"",
":",
"return",
"&",
"m",
",",
"nil",
"// todo: mark message as delivered and remove from the queue",
"\n",
"case",
"\"",
"\"",
":",
"return",
"&",
"m",
",",
"nil",
"// todo: handle connection draining (and any other control message type?)",
"\n",
"case",
"\"",
"\"",
":",
"// acknowledge the incoming ordinary messages as per spec",
"ack",
":=",
"&",
"OutMsg",
"{",
"MessageType",
":",
"\"",
"\"",
",",
"To",
":",
"m",
".",
"From",
",",
"ID",
":",
"m",
".",
"ID",
"}",
"\n",
"if",
"_",
",",
"err",
"=",
"c",
".",
"Send",
"(",
"ack",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"&",
"m",
",",
"nil",
"\n",
"default",
":",
"// unknown message types can be ignored, as per GCM specs",
"}",
"\n",
"return",
"&",
"m",
",",
"nil",
"\n",
"}"
] |
13,298 | all-13299 | [
"NewCatalogServiceQuery",
"parses",
"a",
"string",
"into",
"a",
"CatalogServiceQuery",
"."
] | [
"func",
"NewCatalogServiceQuery",
"(",
"s",
"string",
")",
"(",
"*",
"CatalogServiceQuery",
",",
"error",
")",
"{",
"if",
"!",
"CatalogServiceQueryRe",
".",
"MatchString",
"(",
"s",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"s",
")",
"\n",
"}",
"\n\n",
"m",
":=",
"regexpMatch",
"(",
"CatalogServiceQueryRe",
",",
"s",
")",
"\n",
"return",
"&",
"CatalogServiceQuery",
"{",
"stopCh",
":",
"make",
"(",
"chan",
"struct",
"{",
"}",
",",
"1",
")",
",",
"dc",
":",
"m",
"[",
"\"",
"\"",
"]",
",",
"<mask>",
":",
"m",
"[",
"\"",
"\"",
"]",
",",
"near",
":",
"m",
"[",
"\"",
"\"",
"]",
",",
"tag",
":",
"m",
"[",
"\"",
"\"",
"]",
",",
"}",
",",
"nil",
"\n",
"}"
] |
13,299 | all-13300 | [
"PangoFontDescription",
"*",
"pango_font_description_copy",
"(",
"const",
"PangoFontDescription",
"*",
"desc",
")",
";"
] | [
"func",
"(",
"v",
"*",
"FontDescription",
")",
"Copy",
"(",
")",
"*",
"FontDescription",
"{",
"c",
":=",
"C",
".",
"pango_font_description_copy",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"v2",
":=",
"<mask>",
"(",
"FontDescription",
")",
"\n",
"v2",
".",
"pangoFontDescription",
"=",
"c",
"\n",
"return",
"v2",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.