id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
12,000 | all-12001 | [
"attach",
"a",
"buffer",
"object",
"s",
"data",
"store",
"to",
"a",
"buffer",
"texture",
"object"
] | [
"func",
"TextureBuffer",
"(",
"texture",
"uint32",
",",
"internalformat",
"uint32",
",",
"<mask>",
"uint32",
")",
"{",
"syscall",
".",
"Syscall",
"(",
"gpTextureBuffer",
",",
"3",
",",
"uintptr",
"(",
"texture",
")",
",",
"uintptr",
"(",
"internalformat",
")",
",",
"uintptr",
"(",
"buffer",
")",
")",
"\n",
"}"
] |
12,001 | all-12002 | [
"verifyLeader",
"must",
"be",
"called",
"from",
"the",
"main",
"thread",
"for",
"safety",
".",
"Causes",
"the",
"followers",
"to",
"attempt",
"an",
"immediate",
"heartbeat",
"."
] | [
"func",
"(",
"r",
"*",
"Raft",
")",
"verifyLeader",
"(",
"v",
"*",
"verifyFuture",
")",
"{",
"// Current leader always votes for self",
"v",
".",
"votes",
"=",
"1",
"\n\n",
"// Set the quorum size, hot-path for single node",
"v",
".",
"quorumSize",
"=",
"r",
".",
"quorumSize",
"(",
")",
"\n",
"if",
"v",
".",
"quorumSize",
"==",
"1",
"{",
"v",
".",
"respond",
"(",
"nil",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"// Track this request",
"v",
".",
"notifyCh",
"=",
"r",
".",
"verifyCh",
"\n",
"r",
".",
"leaderState",
".",
"notify",
"[",
"v",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n\n",
"// Trigger immediate heartbeats",
"for",
"_",
",",
"repl",
":=",
"<mask>",
"r",
".",
"leaderState",
".",
"replState",
"{",
"repl",
".",
"notifyLock",
".",
"Lock",
"(",
")",
"\n",
"repl",
".",
"notify",
"[",
"v",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n",
"repl",
".",
"notifyLock",
".",
"Unlock",
"(",
")",
"\n",
"asyncNotifyCh",
"(",
"repl",
".",
"notifyCh",
")",
"\n",
"}",
"\n",
"}"
] |
12,002 | all-12003 | [
"ColumnFields",
"returns",
"the",
"fields",
"that",
"map",
"directly",
"to",
"a",
"database",
"column",
"either",
"on",
"this",
"table",
"or",
"on",
"a",
"joined",
"one",
"."
] | [
"func",
"(",
"m",
"*",
"Mapping",
")",
"ColumnFields",
"(",
"exclude",
"...",
"string",
")",
"[",
"]",
"*",
"Field",
"{",
"fields",
":=",
"[",
"]",
"*",
"Field",
"{",
"}",
"\n\n",
"for",
"_",
",",
"field",
":=",
"range",
"m",
".",
"Fields",
"{",
"if",
"shared",
".",
"StringInSlice",
"(",
"<mask>",
".",
"Name",
",",
"exclude",
")",
"{",
"continue",
"\n",
"}",
"\n",
"if",
"field",
".",
"Type",
".",
"Code",
"==",
"TypeColumn",
"{",
"fields",
"=",
"append",
"(",
"fields",
",",
"field",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"fields",
"\n",
"}"
] |
12,003 | all-12004 | [
"NewLuaObjectFromName",
"creates",
"a",
"new",
"LuaObject",
"from",
"the",
"object",
"designated",
"by",
"the",
"sequence",
"of",
"subfields",
"."
] | [
"func",
"NewLuaObjectFromName",
"(",
"L",
"*",
"lua",
".",
"State",
",",
"subfields",
"...",
"<mask>",
"{",
"}",
")",
"*",
"LuaObject",
"{",
"L",
".",
"GetGlobal",
"(",
"\"",
"\"",
")",
"\n",
"defer",
"L",
".",
"Pop",
"(",
"1",
")",
"\n",
"err",
":=",
"get",
"(",
"L",
",",
"subfields",
"...",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"val",
":=",
"NewLuaObject",
"(",
"L",
",",
"-",
"1",
")",
"\n",
"L",
".",
"Pop",
"(",
"1",
")",
"\n",
"return",
"val",
"\n",
"}"
] |
12,004 | all-12005 | [
"NewClient",
"returns",
"an",
"authenticated",
"Client",
"using",
"the",
"keys",
"in",
"the",
"Cluster",
"."
] | [
"func",
"NewClient",
"(",
"c",
"*",
"Cluster",
",",
"namespace",
"string",
")",
"(",
"*",
"Client",
",",
"error",
")",
"{",
"// Relies on json encoding/decoding []byte as base64",
"// https://golang.org/pkg/encoding/json/#Marshal",
"cc",
":=",
"c",
".",
"ClientCertificate",
"\n",
"ck",
":=",
"c",
".",
"ClientKey",
"\n",
"ca",
":=",
"c",
".",
"ClusterCACertificate",
"\n\n",
"cert",
",",
"err",
":=",
"tls",
".",
"X509KeyPair",
"(",
"cc",
",",
"ck",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"cp",
":=",
"x509",
".",
"NewCertPool",
"(",
")",
"\n",
"cp",
".",
"AppendCertsFromPEM",
"(",
"ca",
")",
"\n\n",
"tr",
":=",
"&",
"http",
".",
"Transport",
"{",
"TLSClientConfig",
":",
"&",
"tls",
".",
"Config",
"{",
"MinVersion",
":",
"tls",
".",
"VersionTLS12",
",",
"Certificates",
":",
"[",
"]",
"tls",
".",
"Certificate",
"{",
"cert",
"}",
",",
"RootCAs",
":",
"cp",
",",
"}",
",",
"}",
"\n",
"return",
"&",
"Client",
"{",
"logger",
":",
"logrus",
".",
"WithField",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
",",
"baseURL",
":",
"c",
".",
"Endpoint",
",",
"<mask>",
":",
"&",
"http",
".",
"Client",
"{",
"Transport",
":",
"tr",
",",
"Timeout",
":",
"requestTimeout",
"}",
",",
"namespace",
":",
"namespace",
",",
"}",
",",
"nil",
"\n",
"}"
] |
12,005 | all-12006 | [
"Do",
"executes",
"Page",
".",
"removeScriptToEvaluateOnNewDocument",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"RemoveScriptToEvaluateOnNewDocumentParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandRemoveScriptToEvaluateOnNewDocument",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
12,006 | all-12007 | [
"Set",
"a",
"value",
"into",
"the",
"ENV",
".",
"This",
"is",
"NOT",
"permanent",
".",
"It",
"will",
"only",
"affect",
"values",
"accessed",
"through",
"envy",
"."
] | [
"func",
"<mask>",
"(",
"key",
"string",
",",
"value",
"string",
")",
"{",
"gil",
".",
"Lock",
"(",
")",
"\n",
"defer",
"gil",
".",
"Unlock",
"(",
")",
"\n",
"env",
"[",
"key",
"]",
"=",
"value",
"\n",
"}"
] |
12,007 | all-12008 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventMetrics",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance4",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
12,008 | all-12009 | [
"WriteConsoleOutput",
"writes",
"the",
"CHAR_INFOs",
"from",
"the",
"provided",
"buffer",
"to",
"the",
"active",
"console",
"buffer",
".",
"See",
"https",
":",
"//",
"msdn",
".",
"microsoft",
".",
"com",
"/",
"en",
"-",
"us",
"/",
"library",
"/",
"windows",
"/",
"desktop",
"/",
"ms687404",
"(",
"v",
"=",
"vs",
".",
"85",
")",
".",
"aspx",
"."
] | [
"func",
"WriteConsoleOutput",
"(",
"handle",
"uintptr",
",",
"buffer",
"[",
"]",
"CHAR_INFO",
",",
"bufferSize",
"COORD",
",",
"bufferCoord",
"COORD",
",",
"writeRegion",
"*",
"SMALL_RECT",
")",
"error",
"{",
"r1",
",",
"r2",
",",
"err",
":=",
"writeConsoleOutputProc",
".",
"Call",
"(",
"handle",
",",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"&",
"buffer",
"[",
"0",
"]",
")",
")",
",",
"coordToPointer",
"(",
"bufferSize",
")",
",",
"coordToPointer",
"(",
"bufferCoord",
")",
",",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"writeRegion",
")",
")",
")",
"\n",
"use",
"(",
"<mask>",
")",
"\n",
"use",
"(",
"bufferSize",
")",
"\n",
"use",
"(",
"bufferCoord",
")",
"\n",
"return",
"checkError",
"(",
"r1",
",",
"r2",
",",
"err",
")",
"\n",
"}"
] |
12,009 | all-12010 | [
"MarshalJSON",
"serialises",
"the",
"ASMAuthResource",
"struct",
"to",
"JSON"
] | [
"func",
"(",
"auth",
"*",
"ASMAuthResource",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"auth",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"createdAt",
":=",
"auth",
".",
"GetCreatedAt",
"(",
")",
"\n",
"return",
"json",
".",
"Marshal",
"(",
"asmAuthResourceJSON",
"{",
"TaskARN",
":",
"auth",
".",
"taskARN",
",",
"CreatedAt",
":",
"&",
"createdAt",
",",
"DesiredStatus",
":",
"func",
"(",
")",
"*",
"ASMAuthStatus",
"{",
"desiredState",
":=",
"auth",
".",
"GetDesiredStatus",
"(",
")",
"\n",
"status",
":=",
"ASMAuthStatus",
"(",
"desiredState",
")",
"\n",
"return",
"&",
"status",
"\n",
"}",
"(",
")",
",",
"KnownStatus",
":",
"func",
"(",
")",
"*",
"ASMAuthStatus",
"{",
"knownState",
":=",
"auth",
".",
"GetKnownStatus",
"(",
")",
"\n",
"<mask>",
":=",
"ASMAuthStatus",
"(",
"knownState",
")",
"\n",
"return",
"&",
"status",
"\n",
"}",
"(",
")",
",",
"RequiredASMResources",
":",
"auth",
".",
"GetRequiredASMResources",
"(",
")",
",",
"ExecutionCredentialsID",
":",
"auth",
".",
"GetExecutionCredentialsID",
"(",
")",
",",
"}",
")",
"\n",
"}"
] |
12,010 | all-12011 | [
"SaveIPv4",
"changes",
"the",
"ipv4",
"configuration",
"of",
"the",
"host",
"-",
"only",
"network",
"."
] | [
"func",
"(",
"n",
"*",
"hostOnlyNetwork",
")",
"SaveIPv4",
"(",
"vbox",
"VBoxManager",
")",
"error",
"{",
"if",
"n",
".",
"IPv4",
".",
"IP",
"!=",
"nil",
"&&",
"n",
".",
"IPv4",
".",
"Mask",
"!=",
"nil",
"{",
"if",
"runtime",
".",
"GOOS",
"==",
"\"",
"\"",
"{",
"log",
".",
"Warn",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"vbox",
".",
"vbm",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"n",
".",
"Name",
",",
"\"",
"\"",
",",
"n",
".",
"IPv4",
".",
"IP",
".",
"String",
"(",
")",
",",
"\"",
"\"",
",",
"net",
".",
"IP",
"(",
"n",
".",
"IPv4",
".",
"Mask",
")",
".",
"<mask>",
"(",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
12,011 | all-12012 | [
"DelNetwork",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockCNI",
")",
"DelNetwork",
"(",
"arg0",
"*",
"libcni",
".",
"NetworkConfig",
",",
"arg1",
"*",
"libcni",
".",
"RuntimeConf",
")",
"error",
"{",
"<mask>",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] |
12,012 | all-12013 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"GetEncodedResponseReturns",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"<mask>",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoAudits",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
12,013 | all-12014 | [
"UpdateProduct",
"updates",
"a",
"product",
"."
] | [
"func",
"(",
"h",
"*",
"Handler",
")",
"UpdateProduct",
"(",
"tkn",
"string",
",",
"product",
"data",
".",
"Product",
")",
"error",
"{",
"logger",
":=",
"h",
".",
"logger",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"product",
")",
"\n\n",
"if",
"!",
"h",
".",
"token",
".",
"Check",
"(",
"tkn",
")",
"{",
"logger",
".",
"Warn",
"(",
"\"",
"\"",
")",
"\n",
"return",
"ErrAccessDenied",
"\n",
"}",
"\n\n",
"oldProduct",
":=",
"&",
"data",
".",
"Product",
"{",
"}",
"\n",
"if",
"err",
":=",
"h",
".",
"findByPrimaryKey",
"(",
"logger",
",",
"ErrProductNotFound",
",",
"oldProduct",
",",
"<mask>",
".",
"ID",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"product",
".",
"Salt",
"==",
"0",
"{",
"product",
".",
"Salt",
"=",
"oldProduct",
".",
"Salt",
"\n",
"}",
"\n\n",
"if",
"product",
".",
"Password",
"==",
"\"",
"\"",
"{",
"product",
".",
"Password",
"=",
"oldProduct",
".",
"Password",
"\n",
"}",
"\n\n",
"if",
"product",
".",
"ServiceEndpointAddress",
"!=",
"nil",
"&&",
"!",
"isValidSEAddress",
"(",
"*",
"product",
".",
"ServiceEndpointAddress",
")",
"{",
"return",
"ErrBadServiceEndpointAddress",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"update",
"(",
"logger",
",",
"h",
".",
"db",
".",
"Querier",
",",
"&",
"product",
")",
";",
"err",
"!=",
"nil",
"{",
"logger",
".",
"Error",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"return",
"ErrInternal",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
12,014 | all-12015 | [
"LockServer",
"locks",
"an",
"existing",
"server",
"preventing",
"it",
"s",
"destruction",
"without",
"first",
"unlocking",
".",
"Deprecated",
"use",
"LockResource",
"instead",
"."
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"LockServer",
"(",
"identifier",
"string",
")",
"error",
"{",
"return",
"c",
".",
"LockResource",
"(",
"Server",
"{",
"<mask>",
":",
"identifier",
"}",
")",
"\n",
"}"
] |
12,015 | all-12016 | [
"MailingList",
"creates",
"a",
"MailingList",
"type",
"from",
"a",
"domain",
"with",
"the",
"given",
"name"
] | [
"func",
"(",
"dom",
"*",
"<mask>",
")",
"MailingList",
"(",
"name",
"string",
")",
"*",
"MailingList",
"{",
"return",
"&",
"MailingList",
"{",
"Domain",
":",
"dom",
",",
"Name",
":",
"name",
"}",
"\n",
"}"
] |
12,016 | all-12017 | [
"GetApmQuery",
"returns",
"the",
"ApmQuery",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"d",
"*",
"DistributionRequest",
")",
"GetApmQuery",
"(",
")",
"WidgetApmOrLogQuery",
"{",
"if",
"d",
"==",
"nil",
"||",
"d",
".",
"ApmQuery",
"==",
"nil",
"{",
"return",
"WidgetApmOrLogQuery",
"{",
"}",
"\n",
"}",
"\n",
"<mask>",
"*",
"d",
".",
"ApmQuery",
"\n",
"}"
] |
12,017 | all-12018 | [
"CanMerge",
"returns",
"a",
"boolean",
"value",
"indicating",
"whether",
"the",
"other",
"drawTrianglesCommand",
"can",
"be",
"merged",
"with",
"the",
"drawTrianglesCommand",
"c",
"."
] | [
"func",
"(",
"c",
"*",
"drawTrianglesCommand",
")",
"CanMerge",
"(",
"dst",
",",
"src",
"*",
"Image",
",",
"color",
"*",
"affine",
".",
"ColorM",
",",
"mode",
"graphics",
".",
"CompositeMode",
",",
"filter",
"graphics",
".",
"Filter",
",",
"address",
"graphics",
".",
"Address",
")",
"bool",
"{",
"if",
"c",
".",
"dst",
"!=",
"dst",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"c",
".",
"src",
"!=",
"src",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"c",
".",
"color",
".",
"Equals",
"(",
"color",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"c",
".",
"mode",
"!=",
"mode",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"c",
".",
"<mask>",
"!=",
"filter",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"c",
".",
"address",
"!=",
"address",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}"
] |
12,018 | all-12019 | [
"export",
"FileSequence_FrameRangePadded"
] | [
"func",
"FileSequence_FrameRangePadded",
"(",
"id",
"FileSeqId",
")",
"*",
"C",
".",
"char",
"{",
"fs",
",",
"ok",
":=",
"sFileSeqs",
".",
"Get",
"(",
"id",
")",
"\n",
"// caller must free string",
"if",
"!",
"ok",
"{",
"return",
"C",
".",
"CString",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"C",
".",
"CString",
"(",
"<mask>",
".",
"FrameRangePadded",
"(",
")",
")",
"\n",
"}"
] |
12,019 | all-12020 | [
"Param",
"defines",
"a",
"parameter",
"with",
"the",
"specified",
"name",
"."
] | [
"func",
"(",
"p",
"ParamSet",
")",
"Param",
"(",
"name",
"string",
",",
"value",
"<mask>",
"{",
"}",
")",
"{",
"p",
".",
"params",
"[",
"name",
"]",
"=",
"value",
"\n",
"}"
] |
12,020 | all-12021 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"EventVirtualTimeBudgetExpired",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoEmulation17",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
12,021 | all-12022 | [
"Equal",
"returns",
"true",
"if",
"the",
"version",
"is",
"equal",
"to",
"the",
"supplied",
"version",
"."
] | [
"func",
"(",
"v",
"VSphereVersion",
")",
"Equal",
"(",
"other",
"VSphereVersion",
")",
"bool",
"{",
"return",
"v",
".",
"ProductEqual",
"(",
"<mask>",
")",
"&&",
"!",
"v",
".",
"Older",
"(",
"other",
")",
"&&",
"!",
"v",
".",
"Newer",
"(",
"other",
")",
"\n",
"}"
] |
12,022 | all-12023 | [
"This",
"endpoint",
"will",
"remove",
"a",
"hook",
"definition",
".",
"Required",
"scopes",
":",
"hooks",
":",
"modify",
"-",
"hook",
":",
"<hookGroupId",
">",
"/",
"<hookId",
">",
"See",
"#removeHook"
] | [
"func",
"(",
"hooks",
"*",
"Hooks",
")",
"RemoveHook",
"(",
"hookGroupId",
",",
"hookId",
"string",
")",
"error",
"{",
"cd",
":=",
"tcclient",
".",
"Client",
"(",
"*",
"hooks",
")",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"(",
"&",
"cd",
")",
".",
"APICall",
"(",
"nil",
",",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"<mask>",
".",
"QueryEscape",
"(",
"hookGroupId",
")",
"+",
"\"",
"\"",
"+",
"url",
".",
"QueryEscape",
"(",
"hookId",
")",
",",
"nil",
",",
"nil",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
12,023 | all-12024 | [
"ShouldKeep",
"returns",
"whether",
"e",
"is",
"marked",
"with",
"a",
"#",
"keep",
"comment",
".",
"Kept",
"expressions",
"should",
"not",
"be",
"removed",
"or",
"modified",
"."
] | [
"func",
"ShouldKeep",
"(",
"e",
"bzl",
".",
"Expr",
")",
"bool",
"{",
"for",
"_",
",",
"c",
":=",
"range",
"append",
"(",
"e",
".",
"Comment",
"(",
")",
".",
"Before",
",",
"e",
".",
"Comment",
"(",
")",
".",
"Suffix",
"...",
")",
"{",
"<mask>",
":=",
"strings",
".",
"TrimSpace",
"(",
"strings",
".",
"TrimPrefix",
"(",
"c",
".",
"Token",
",",
"\"",
"\"",
")",
")",
"\n",
"if",
"text",
"==",
"\"",
"\"",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
] |
12,024 | all-12025 | [
"pageOverJob",
"loads",
"results",
"for",
"the",
"given",
"job",
"reference",
"and",
"if",
"the",
"total",
"results",
"has",
"not",
"been",
"hit",
"continues",
"to",
"load",
"recursively"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"pageOverJob",
"(",
"rowCount",
"int",
",",
"jobRef",
"*",
"bigquery",
".",
"JobReference",
",",
"pageToken",
"string",
",",
"resultChan",
"chan",
"[",
"]",
"[",
"]",
"interface",
"{",
"}",
",",
"headersChan",
"chan",
"[",
"]",
"string",
")",
"error",
"{",
"service",
",",
"err",
":=",
"c",
".",
"connect",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"qrc",
":=",
"service",
".",
"Jobs",
".",
"GetQueryResults",
"(",
"jobRef",
".",
"ProjectId",
",",
"jobRef",
".",
"JobId",
")",
"\n",
"if",
"len",
"(",
"pageToken",
")",
">",
"0",
"{",
"qrc",
".",
"PageToken",
"(",
"pageToken",
")",
"\n",
"}",
"\n\n",
"qr",
",",
"err",
":=",
"qrc",
".",
"Do",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"c",
".",
"printDebug",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"close",
"(",
"resultChan",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"qr",
".",
"JobComplete",
"{",
"c",
".",
"printDebug",
"(",
"\"",
"\"",
")",
"\n",
"headers",
",",
"rows",
":=",
"c",
".",
"headersAndRows",
"(",
"qr",
".",
"Schema",
",",
"qr",
".",
"Rows",
")",
"\n",
"if",
"headersChan",
"!=",
"nil",
"{",
"headersChan",
"<-",
"headers",
"\n",
"close",
"(",
"headersChan",
")",
"\n",
"}",
"\n\n",
"// send back the rows we got",
"c",
".",
"printDebug",
"(",
"\"",
"\"",
")",
"\n",
"resultChan",
"<-",
"rows",
"\n",
"rowCount",
"=",
"rowCount",
"+",
"len",
"(",
"<mask>",
")",
"\n",
"c",
".",
"printDebug",
"(",
"\"",
"\"",
",",
"rowCount",
")",
"\n",
"}",
"\n\n",
"if",
"qr",
".",
"TotalRows",
">",
"uint64",
"(",
"rowCount",
")",
"||",
"!",
"qr",
".",
"JobComplete",
"{",
"c",
".",
"printDebug",
"(",
"\"",
"\"",
")",
"\n",
"if",
"qr",
".",
"JobReference",
"==",
"nil",
"{",
"c",
".",
"pageOverJob",
"(",
"rowCount",
",",
"jobRef",
",",
"pageToken",
",",
"resultChan",
",",
"headersChan",
")",
"\n",
"}",
"else",
"{",
"c",
".",
"pageOverJob",
"(",
"rowCount",
",",
"qr",
".",
"JobReference",
",",
"qr",
".",
"PageToken",
",",
"resultChan",
",",
"nil",
")",
"\n",
"}",
"\n",
"}",
"else",
"{",
"close",
"(",
"resultChan",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
12,025 | all-12026 | [
"ShiftOwner",
"updates",
"uid",
"and",
"gid",
"for",
"a",
"file",
"when",
"entering",
"/",
"exiting",
"a",
"namespace"
] | [
"func",
"ShiftOwner",
"(",
"basepath",
"string",
",",
"path",
"string",
",",
"uid",
"int",
",",
"gid",
"int",
")",
"error",
"{",
"cbasepath",
":=",
"C",
".",
"CString",
"(",
"basepath",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cbasepath",
")",
")",
"\n\n",
"cpath",
":=",
"C",
".",
"CString",
"(",
"path",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cpath",
")",
")",
"\n\n",
"r",
":=",
"C",
".",
"shiftowner",
"(",
"cbasepath",
",",
"cpath",
",",
"C",
".",
"int",
"(",
"uid",
")",
",",
"C",
".",
"int",
"(",
"gid",
")",
")",
"\n",
"if",
"r",
"!=",
"0",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"<mask>",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
12,026 | all-12027 | [
"nextBlockInFile",
"reads",
"the",
"next",
"file",
"block",
"in",
"the",
"current",
"file",
"at",
"the",
"current",
"archive",
"file",
"position",
"or",
"returns",
"an",
"error",
"if",
"there",
"is",
"a",
"problem",
".",
"It",
"is",
"invalid",
"to",
"call",
"this",
"when",
"already",
"at",
"the",
"last",
"block",
"in",
"the",
"current",
"file",
"."
] | [
"func",
"(",
"f",
"*",
"packedFileReader",
")",
"nextBlockInFile",
"(",
")",
"error",
"{",
"h",
",",
"err",
":=",
"f",
".",
"r",
".",
"next",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"err",
"==",
"<mask>",
".",
"EOF",
"{",
"// archive ended, but file hasn't",
"return",
"errUnexpectedArcEnd",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"if",
"h",
".",
"first",
"||",
"h",
".",
"Name",
"!=",
"f",
".",
"h",
".",
"Name",
"{",
"return",
"errInvalidFileBlock",
"\n",
"}",
"\n",
"f",
".",
"h",
"=",
"h",
"\n",
"return",
"nil",
"\n",
"}"
] |
12,027 | all-12028 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"ResourceTiming",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"<mask>",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork23",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
12,028 | all-12029 | [
"ChecksumString32S",
"returns",
"the",
"checksum",
"of",
"the",
"input",
"data",
"without",
"creating",
"a",
"copy",
"with",
"the",
"specific",
"seed",
"."
] | [
"func",
"ChecksumString32S",
"(",
"s",
"string",
",",
"seed",
"uint32",
")",
"uint32",
"{",
"if",
"len",
"(",
"s",
")",
"==",
"0",
"{",
"return",
"Checksum32S",
"(",
"nil",
",",
"<mask>",
")",
"\n",
"}",
"\n",
"ss",
":=",
"(",
"*",
"reflect",
".",
"StringHeader",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"&",
"s",
")",
")",
"\n",
"return",
"Checksum32S",
"(",
"(",
"*",
"[",
"maxInt32",
"]",
"byte",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"ss",
".",
"Data",
")",
")",
"[",
":",
"len",
"(",
"s",
")",
":",
"len",
"(",
"s",
")",
"]",
",",
"seed",
")",
"\n",
"}"
] |
12,029 | all-12030 | [
"Run",
"issues",
"the",
"provided",
"command",
"on",
"the",
"admin",
"database",
"and",
"and",
"unmarshals",
"its",
"result",
"in",
"the",
"respective",
"argument",
".",
"The",
"cmd",
"argument",
"may",
"be",
"either",
"a",
"string",
"with",
"the",
"command",
"name",
"itself",
"in",
"which",
"case",
"an",
"empty",
"document",
"of",
"the",
"form",
"bson",
".",
"M",
"{",
"cmd",
":",
"1",
"}",
"will",
"be",
"used",
"or",
"it",
"may",
"be",
"a",
"full",
"command",
"document",
".",
"Note",
"that",
"MongoDB",
"considers",
"the",
"first",
"marshalled",
"key",
"as",
"the",
"command",
"name",
"so",
"when",
"providing",
"a",
"command",
"with",
"options",
"it",
"s",
"important",
"to",
"use",
"an",
"ordering",
"-",
"preserving",
"document",
"such",
"as",
"a",
"struct",
"value",
"or",
"an",
"instance",
"of",
"bson",
".",
"D",
".",
"For",
"instance",
":",
"db",
".",
"Run",
"(",
"bson",
".",
"D",
"{{",
"create",
"mycollection",
"}",
"{",
"size",
"1024",
"}}",
")",
"For",
"commands",
"on",
"arbitrary",
"databases",
"see",
"the",
"Run",
"method",
"in",
"the",
"Database",
"type",
".",
"Relevant",
"documentation",
":",
"http",
":",
"//",
"www",
".",
"mongodb",
".",
"org",
"/",
"display",
"/",
"DOCS",
"/",
"Commands",
"http",
":",
"//",
"www",
".",
"mongodb",
".",
"org",
"/",
"display",
"/",
"DOCS",
"/",
"List",
"+",
"of",
"+",
"Database",
"+",
"CommandSkips"
] | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"Run",
"(",
"cmd",
"interface",
"{",
"}",
",",
"result",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"s",
".",
"DB",
"(",
"\"",
"\"",
")",
".",
"Run",
"(",
"cmd",
",",
"result",
")",
"\n",
"}"
] |
12,030 | all-12031 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"ScrollRectType",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"switch",
"ScrollRectType",
"(",
"in",
".",
"String",
"(",
")",
")",
"{",
"case",
"ScrollRectTypeRepaintsOnScroll",
":",
"*",
"t",
"=",
"ScrollRectTypeRepaintsOnScroll",
"\n",
"case",
"ScrollRectTypeTouchEventHandler",
":",
"*",
"t",
"=",
"ScrollRectTypeTouchEventHandler",
"\n",
"<mask>",
"ScrollRectTypeWheelEventHandler",
":",
"*",
"t",
"=",
"ScrollRectTypeWheelEventHandler",
"\n\n",
"default",
":",
"in",
".",
"AddError",
"(",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}",
"\n",
"}"
] |
12,031 | all-12032 | [
"WaitIsImageAvailable",
"is",
"a",
"wrapper",
"around",
"gtk_clipboard_wait_is_image_available"
] | [
"func",
"(",
"v",
"*",
"Clipboard",
")",
"WaitIsImageAvailable",
"(",
")",
"bool",
"{",
"c",
":=",
"C",
".",
"gtk_clipboard_wait_is_image_available",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
12,032 | all-12033 | [
"Update",
"updates",
"the",
"agent",
"settings",
"for",
"a",
"given",
"instance",
"ID",
"."
] | [
"func",
"(",
"c",
"*",
"FakeClient",
")",
"Update",
"(",
"instanceID",
"string",
",",
"agentSettings",
"registry",
".",
"AgentSettings",
")",
"error",
"{",
"c",
".",
"UpdateCalled",
"=",
"<mask>",
"\n",
"c",
".",
"UpdateSettings",
"=",
"agentSettings",
"\n",
"return",
"c",
".",
"UpdateErr",
"\n",
"}"
] |
12,033 | all-12034 | [
"E",
"is",
"a",
"short",
"-",
"hand",
"to",
"construct",
"an",
"error",
"."
] | [
"func",
"E",
"(",
"reason",
"string",
",",
"retry",
"bool",
")",
"*",
"<mask>",
"{",
"return",
"&",
"Error",
"{",
"Reason",
":",
"reason",
",",
"Retry",
":",
"retry",
",",
"}",
"\n",
"}"
] |
12,034 | all-12035 | [
"/",
"*",
"retrieve",
"or",
"set",
"trackbar",
"position"
] | [
"func",
"(",
"win",
"*",
"Window",
")",
"GetTrackbarPos",
"(",
"name",
"string",
")",
"(",
"value",
",",
"max",
"int",
")",
"{",
"rv",
":=",
"C",
".",
"cvGetTrackbarPos",
"(",
"win",
".",
"trackbarName",
"[",
"<mask>",
"]",
",",
"win",
".",
"name_c",
")",
"\n",
"return",
"int",
"(",
"rv",
")",
",",
"win",
".",
"trackbarMax",
"[",
"name",
"]",
"\n",
"}"
] |
12,035 | all-12036 | [
"Stats",
"retrieves",
"the",
"current",
"memcache",
"statistics",
"."
] | [
"func",
"Stats",
"(",
"c",
"context",
".",
"Context",
")",
"(",
"*",
"Statistics",
",",
"error",
")",
"{",
"req",
":=",
"&",
"pb",
".",
"MemcacheStatsRequest",
"{",
"}",
"\n",
"res",
":=",
"&",
"pb",
".",
"MemcacheStatsResponse",
"{",
"}",
"\n",
"if",
"err",
":=",
"internal",
".",
"Call",
"(",
"c",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"req",
",",
"res",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"<mask>",
".",
"Stats",
"==",
"nil",
"{",
"return",
"nil",
",",
"ErrNoStats",
"\n",
"}",
"\n",
"return",
"&",
"Statistics",
"{",
"Hits",
":",
"*",
"res",
".",
"Stats",
".",
"Hits",
",",
"Misses",
":",
"*",
"res",
".",
"Stats",
".",
"Misses",
",",
"ByteHits",
":",
"*",
"res",
".",
"Stats",
".",
"ByteHits",
",",
"Items",
":",
"*",
"res",
".",
"Stats",
".",
"Items",
",",
"Bytes",
":",
"*",
"res",
".",
"Stats",
".",
"Bytes",
",",
"Oldest",
":",
"int64",
"(",
"*",
"res",
".",
"Stats",
".",
"OldestItemAge",
")",
",",
"}",
",",
"nil",
"\n",
"}"
] |
12,036 | all-12037 | [
"version",
"scans",
"the",
"volume",
"ID",
"in",
"b",
"and",
"returns",
"its",
"version",
"tag",
"."
] | [
"func",
"(",
"b",
"*",
"b2dISO",
")",
"version",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"b",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"nil",
"\n",
"}",
"\n\n",
"iso",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"b",
".",
"commonIsoPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"defer",
"iso",
".",
"Close",
"(",
")",
"\n\n",
"isoMetadata",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"b",
".",
"volumeIDLength",
")",
"\n",
"_",
",",
"err",
"=",
"iso",
".",
"ReadAt",
"(",
"isoMetadata",
",",
"b",
".",
"volumeIDOffset",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"trimmedVersion",
":=",
"strings",
".",
"TrimSpace",
"(",
"string",
"(",
"isoMetadata",
")",
")",
"\n\n",
"versionIndex",
":=",
"strings",
".",
"<mask>",
"(",
"trimmedVersion",
",",
"versionPrefix",
")",
"\n",
"if",
"versionIndex",
"==",
"-",
"1",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"versionPrefix",
")",
"\n",
"}",
"\n\n",
"// Original magic file string looks similar to this: \"Boot2Docker-v0.1.0 \"",
"// This will return \"v0.1.0\" given the above string",
"vers",
":=",
"trimmedVersion",
"[",
"versionIndex",
"+",
"1",
":",
"]",
"\n\n",
"log",
".",
"Debug",
"(",
"\"",
"\"",
",",
"vers",
")",
"\n",
"return",
"vers",
",",
"nil",
"\n",
"}"
] |
12,037 | all-12038 | [
"NewClientHandler",
"returns",
"a",
"new",
"remote",
"client",
"handler",
"which",
"asks",
"the",
"remote",
"handler",
"the",
"cached",
"entry",
"s",
"response",
"with",
"a",
"GET",
"request",
"or",
"add",
"a",
"response",
"with",
"POST",
"request",
"these",
"all",
"are",
"done",
"automatically",
"users",
"can",
"use",
"this",
"handler",
"as",
"they",
"use",
"the",
"local",
".",
"go",
"/",
"NewHandler",
"the",
"ClientHandler",
"is",
"useful",
"when",
"user",
"wants",
"to",
"apply",
"horizontal",
"scaling",
"to",
"the",
"app",
"and",
"has",
"a",
"central",
"http",
"server",
"which",
"handles"
] | [
"func",
"NewClientHandler",
"(",
"bodyHandler",
"fasthttp",
".",
"RequestHandler",
",",
"life",
"time",
".",
"Duration",
",",
"<mask>",
"string",
")",
"*",
"ClientHandler",
"{",
"return",
"&",
"ClientHandler",
"{",
"bodyHandler",
":",
"bodyHandler",
",",
"rule",
":",
"DefaultRuleSet",
",",
"life",
":",
"life",
",",
"remoteHandlerURL",
":",
"remote",
",",
"}",
"\n",
"}"
] |
12,038 | all-12039 | [
"Removes",
"the",
"first",
"suffix",
"found",
"that",
"is",
"in",
"word",
".",
"RS",
"[",
"startPos",
":",
"len",
"(",
"word",
".",
"RS",
")",
"]"
] | [
"func",
"(",
"w",
"*",
"SnowballWord",
")",
"RemoveFirstSuffixIn",
"(",
"startPos",
"int",
",",
"suffixes",
"...",
"string",
")",
"(",
"suffix",
"<mask>",
",",
"suffixRunes",
"[",
"]",
"rune",
")",
"{",
"suffix",
",",
"suffixRunes",
"=",
"w",
".",
"FirstSuffixIn",
"(",
"startPos",
",",
"len",
"(",
"w",
".",
"RS",
")",
",",
"suffixes",
"...",
")",
"\n",
"if",
"suffix",
"!=",
"\"",
"\"",
"{",
"w",
".",
"RemoveLastNRunes",
"(",
"len",
"(",
"suffixRunes",
")",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
12,039 | all-12040 | [
"broadcastResponse",
"send",
"a",
"watch",
"response",
"to",
"all",
"watch",
"substreams",
"."
] | [
"func",
"(",
"w",
"*",
"watchGrpcStream",
")",
"broadcastResponse",
"(",
"wr",
"*",
"WatchResponse",
")",
"bool",
"{",
"for",
"_",
",",
"<mask>",
":=",
"range",
"w",
".",
"substreams",
"{",
"select",
"{",
"case",
"ws",
".",
"recvc",
"<-",
"wr",
":",
"case",
"<-",
"ws",
".",
"donec",
":",
"}",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}"
] |
12,040 | all-12041 | [
"ReconfigureVM",
"reconfigures",
"a",
"virtual",
"machine",
"via",
"the",
"StorageResourceManager",
"API",
"applying",
"any",
"disk",
"modifications",
"that",
"will",
"require",
"going",
"through",
"Storage",
"DRS",
".",
"It",
"mimics",
"our",
"helper",
"in",
"the",
"virtualmachine",
"package",
"in",
"functionality",
".",
"Note",
"that",
"this",
"function",
"will",
"fail",
"if",
"there",
"are",
"no",
"new",
"disks",
"in",
"the",
"spec",
"check",
"this",
"first",
"before",
"using",
"this",
"function",
".",
"If",
"no",
"disk",
"create",
"operations",
"are",
"necessary",
"use",
"the",
"regular",
"Reconfigure",
"function",
"in",
"the",
"virtualmachine",
"helper",
"package",
"."
] | [
"func",
"ReconfigureVM",
"(",
"client",
"*",
"govmomi",
".",
"<mask>",
",",
"vm",
"*",
"object",
".",
"VirtualMachine",
",",
"spec",
"types",
".",
"VirtualMachineConfigSpec",
",",
"pod",
"*",
"object",
".",
"StoragePod",
",",
")",
"error",
"{",
"sdrsEnabled",
",",
"err",
":=",
"StorageDRSEnabled",
"(",
"pod",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"!",
"sdrsEnabled",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"pod",
".",
"Name",
"(",
")",
")",
"\n",
"}",
"\n\n",
"log",
".",
"Printf",
"(",
"\"",
"\"",
",",
"vm",
".",
"InventoryPath",
",",
"pod",
".",
"Name",
"(",
")",
",",
")",
"\n\n",
"sps",
":=",
"types",
".",
"StoragePlacementSpec",
"{",
"Type",
":",
"string",
"(",
"types",
".",
"StoragePlacementSpecPlacementTypeReconfigure",
")",
",",
"PodSelectionSpec",
":",
"types",
".",
"StorageDrsPodSelectionSpec",
"{",
"InitialVmConfig",
":",
"expandVMPodConfigForPlacement",
"(",
"spec",
".",
"DeviceChange",
",",
"pod",
")",
",",
"}",
",",
"Vm",
":",
"types",
".",
"NewReference",
"(",
"vm",
".",
"Reference",
"(",
")",
")",
",",
"ConfigSpec",
":",
"&",
"spec",
",",
"}",
"\n\n",
"_",
",",
"err",
"=",
"recommendAndApplySDRS",
"(",
"client",
",",
"sps",
",",
"provider",
".",
"DefaultAPITimeout",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
12,041 | all-12042 | [
"Error",
"is",
"part",
"of",
"the",
"error",
"interface",
"."
] | [
"func",
"(",
"err",
"AggregateError",
")",
"Error",
"(",
")",
"string",
"{",
"if",
"len",
"(",
"err",
")",
"==",
"0",
"{",
"// This should never happen, really.",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"if",
"len",
"(",
"err",
")",
"==",
"1",
"{",
"return",
"err",
"[",
"0",
"]",
".",
"Error",
"(",
")",
"\n",
"}",
"\n",
"result",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"err",
"[",
"0",
"]",
".",
"Error",
"(",
")",
")",
"\n",
"for",
"i",
":=",
"1",
";",
"i",
"<",
"len",
"(",
"err",
")",
";",
"i",
"++",
"{",
"<mask>",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"err",
"[",
"i",
"]",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"result",
"+=",
"\"",
"\"",
"\n",
"return",
"result",
"\n",
"}"
] |
12,042 | all-12043 | [
"GetRunCheckOk",
"returns",
"a",
"tuple",
"with",
"the",
"RunCheck",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"i",
"*",
"IntegrationPDRequest",
")",
"GetRunCheckOk",
"(",
")",
"(",
"bool",
",",
"bool",
")",
"{",
"if",
"i",
"==",
"nil",
"||",
"i",
".",
"RunCheck",
"==",
"nil",
"{",
"return",
"false",
",",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"i",
".",
"RunCheck",
",",
"true",
"\n",
"}"
] |
12,043 | all-12044 | [
"Resize",
"is",
"a",
"wrapper",
"around",
"gtk_window_resize",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Window",
")",
"Resize",
"(",
"width",
",",
"height",
"int",
")",
"{",
"C",
".",
"gtk_window_resize",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"width",
")",
",",
"C",
".",
"gint",
"(",
"<mask>",
")",
")",
"\n",
"}"
] |
12,044 | all-12045 | [
"Add",
"adds",
"a",
"flash",
"value",
"for",
"a",
"flash",
"key",
"if",
"the",
"key",
"already",
"has",
"values",
"the",
"list",
"for",
"that",
"value",
"grows",
"."
] | [
"func",
"(",
"f",
"Flash",
")",
"Add",
"(",
"key",
",",
"value",
"string",
")",
"{",
"if",
"len",
"(",
"f",
".",
"data",
"[",
"key",
"]",
")",
"==",
"0",
"{",
"f",
".",
"data",
"[",
"key",
"]",
"=",
"[",
"]",
"string",
"{",
"value",
"}",
"\n",
"return",
"\n",
"}",
"\n\n",
"f",
".",
"<mask>",
"[",
"key",
"]",
"=",
"append",
"(",
"f",
".",
"data",
"[",
"key",
"]",
",",
"value",
")",
"\n",
"}"
] |
12,045 | all-12046 | [
"FetchAcknowledgements",
"retrieves",
"all",
"acknowledgements",
"available",
"to",
"the",
"API",
"Token",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"FetchAcknowledgements",
"(",
")",
"(",
"*",
"[",
"]",
"Acknowledgement",
",",
"error",
")",
"{",
"result",
",",
"err",
":=",
"a",
".",
"Get",
"(",
"config",
".",
"AcknowledgementPrefix",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"<mask>",
"acknowledgements",
"[",
"]",
"Acknowledgement",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"result",
",",
"&",
"acknowledgements",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"acknowledgements",
",",
"nil",
"\n",
"}"
] |
12,046 | all-12047 | [
"ClearAll",
"clears",
"all",
"the",
"keys",
"."
] | [
"func",
"(",
"h",
"*",
"kvHandler",
")",
"ClearAll",
"(",
"ctx",
"thrift",
".",
"<mask>",
")",
"error",
"{",
"if",
"!",
"isAdmin",
"(",
"ctx",
")",
"{",
"return",
"&",
"keyvalue",
".",
"NotAuthorized",
"{",
"}",
"\n",
"}",
"\n\n",
"h",
".",
"Lock",
"(",
")",
"\n",
"defer",
"h",
".",
"Unlock",
"(",
")",
"\n\n",
"h",
".",
"vals",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
12,047 | all-12048 | [
"Logout",
"will",
"clear",
"out",
"the",
"session",
"and",
"call",
"the",
"Logout",
"()",
"user",
"function",
"."
] | [
"func",
"Logout",
"(",
"s",
"sessions",
".",
"Session",
",",
"user",
"<mask>",
")",
"{",
"user",
".",
"Logout",
"(",
")",
"\n",
"s",
".",
"Delete",
"(",
"SessionKey",
")",
"\n",
"}"
] |
12,048 | all-12049 | [
"WithMaxConcurrentStreams",
"instructs",
"the",
"New",
"*",
"functions",
"to",
"create",
"client",
"that",
"can",
"have",
"at",
"most",
"streams",
"concurrent",
"streams",
"open",
"with",
"pachd",
"at",
"a",
"time"
] | [
"func",
"WithMaxConcurrentStreams",
"(",
"streams",
"int",
")",
"Option",
"{",
"return",
"func",
"(",
"<mask>",
"*",
"clientSettings",
")",
"error",
"{",
"settings",
".",
"maxConcurrentStreams",
"=",
"streams",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] |
12,049 | all-12050 | [
"Close",
"closes",
"the",
"Writer",
"flushing",
"any",
"unwritten",
"data",
"to",
"the",
"underlying",
"io",
".",
"Writer",
"but",
"does",
"not",
"close",
"the",
"underlying",
"io",
".",
"Writer",
"."
] | [
"func",
"(",
"z",
"*",
"<mask>",
")",
"Close",
"(",
")",
"error",
"{",
"if",
"!",
"z",
".",
"Header",
".",
"done",
"{",
"if",
"err",
":=",
"z",
".",
"writeHeader",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"z",
".",
"Flush",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"debugFlag",
"{",
"debug",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"err",
":=",
"z",
".",
"writeUint32",
"(",
"0",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"!",
"z",
".",
"NoChecksum",
"{",
"checksum",
":=",
"z",
".",
"checksum",
".",
"Sum32",
"(",
")",
"\n",
"if",
"debugFlag",
"{",
"debug",
"(",
"\"",
"\"",
",",
"checksum",
")",
"\n",
"}",
"\n",
"if",
"err",
":=",
"z",
".",
"writeUint32",
"(",
"checksum",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
12,050 | all-12051 | [
"Json",
"is",
"middleware",
"to",
"deserialize",
"a",
"JSON",
"payload",
"from",
"the",
"request",
"into",
"the",
"struct",
"that",
"is",
"passed",
"in",
".",
"The",
"resulting",
"struct",
"is",
"then",
"validated",
"but",
"no",
"error",
"handling",
"is",
"actually",
"performed",
"here",
".",
"An",
"interface",
"pointer",
"can",
"be",
"added",
"as",
"a",
"second",
"argument",
"in",
"order",
"to",
"map",
"the",
"struct",
"to",
"a",
"specific",
"interface",
"."
] | [
"func",
"Json",
"(",
"jsonStruct",
"interface",
"{",
"}",
",",
"ifacePtr",
"...",
"interface",
"{",
"}",
")",
"martini",
".",
"Handler",
"{",
"return",
"func",
"(",
"context",
"martini",
".",
"Context",
",",
"req",
"*",
"http",
".",
"Request",
")",
"{",
"ensureNotPointer",
"(",
"jsonStruct",
")",
"\n",
"jsonStruct",
":=",
"reflect",
".",
"New",
"(",
"reflect",
".",
"TypeOf",
"(",
"jsonStruct",
")",
")",
"\n",
"errors",
":=",
"newErrors",
"(",
")",
"\n\n",
"if",
"req",
".",
"Body",
"!=",
"nil",
"{",
"defer",
"req",
".",
"<mask>",
".",
"Close",
"(",
")",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"json",
".",
"NewDecoder",
"(",
"req",
".",
"Body",
")",
".",
"Decode",
"(",
"jsonStruct",
".",
"Interface",
"(",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"errors",
".",
"Overall",
"[",
"DeserializationError",
"]",
"=",
"err",
".",
"Error",
"(",
")",
"\n",
"}",
"\n\n",
"validateAndMap",
"(",
"jsonStruct",
",",
"context",
",",
"errors",
",",
"ifacePtr",
"...",
")",
"\n",
"}",
"\n",
"}"
] |
12,051 | all-12052 | [
"Locator",
"returns",
"a",
"locator",
"for",
"the",
"given",
"resource"
] | [
"func",
"(",
"r",
"*",
"Publication",
")",
"Locator",
"(",
"api",
"*",
"API",
")",
"*",
"PublicationLocator",
"{",
"for",
"_",
",",
"l",
":=",
"<mask>",
"r",
".",
"Links",
"{",
"if",
"l",
"[",
"\"",
"\"",
"]",
"==",
"\"",
"\"",
"{",
"return",
"api",
".",
"PublicationLocator",
"(",
"l",
"[",
"\"",
"\"",
"]",
")",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
12,052 | all-12053 | [
"ContinueReadBody",
"reads",
"request",
"body",
"if",
"request",
"header",
"contains",
"Expect",
":",
"100",
"-",
"continue",
".",
"The",
"caller",
"must",
"send",
"StatusContinue",
"response",
"before",
"calling",
"this",
"method",
".",
"If",
"maxBodySize",
">",
"0",
"and",
"the",
"body",
"size",
"exceeds",
"maxBodySize",
"then",
"ErrBodyTooLarge",
"is",
"returned",
"."
] | [
"func",
"(",
"req",
"*",
"Request",
")",
"ContinueReadBody",
"(",
"r",
"*",
"bufio",
".",
"Reader",
",",
"maxBodySize",
"int",
")",
"error",
"{",
"<mask>",
"err",
"error",
"\n",
"contentLength",
":=",
"req",
".",
"Header",
".",
"realContentLength",
"(",
")",
"\n",
"if",
"contentLength",
">",
"0",
"{",
"if",
"maxBodySize",
">",
"0",
"&&",
"contentLength",
">",
"maxBodySize",
"{",
"return",
"ErrBodyTooLarge",
"\n",
"}",
"\n\n",
"// Pre-read multipart form data of known length.",
"// This way we limit memory usage for large file uploads, since their contents",
"// is streamed into temporary files if file size exceeds defaultMaxInMemoryFileSize.",
"req",
".",
"multipartFormBoundary",
"=",
"string",
"(",
"req",
".",
"Header",
".",
"MultipartFormBoundary",
"(",
")",
")",
"\n",
"if",
"len",
"(",
"req",
".",
"multipartFormBoundary",
")",
">",
"0",
"&&",
"len",
"(",
"req",
".",
"Header",
".",
"peek",
"(",
"strContentEncoding",
")",
")",
"==",
"0",
"{",
"req",
".",
"multipartForm",
",",
"err",
"=",
"readMultipartForm",
"(",
"r",
",",
"req",
".",
"multipartFormBoundary",
",",
"contentLength",
",",
"defaultMaxInMemoryFileSize",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"req",
".",
"Reset",
"(",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"contentLength",
"==",
"-",
"2",
"{",
"// identity body has no sense for http requests, since",
"// the end of body is determined by connection close.",
"// So just ignore request body for requests without",
"// 'Content-Length' and 'Transfer-Encoding' headers.",
"req",
".",
"Header",
".",
"SetContentLength",
"(",
"0",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n\n",
"bodyBuf",
":=",
"req",
".",
"bodyBuffer",
"(",
")",
"\n",
"bodyBuf",
".",
"Reset",
"(",
")",
"\n",
"bodyBuf",
".",
"B",
",",
"err",
"=",
"readBody",
"(",
"r",
",",
"contentLength",
",",
"maxBodySize",
",",
"bodyBuf",
".",
"B",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"req",
".",
"Reset",
"(",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"req",
".",
"Header",
".",
"SetContentLength",
"(",
"len",
"(",
"bodyBuf",
".",
"B",
")",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
12,053 | all-12054 | [
"Do",
"executes",
"Page",
".",
"setDownloadBehavior",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"SetDownloadBehaviorParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetDownloadBehavior",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
12,054 | all-12055 | [
"SetCairoContext",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_print_context_set_cairo_context",
"()",
"."
] | [
"func",
"(",
"<mask>",
"*",
"PrintContext",
")",
"SetCairoContext",
"(",
"cr",
"*",
"cairo",
".",
"Context",
",",
"dpiX",
",",
"dpiY",
"float64",
")",
"{",
"C",
".",
"gtk_print_context_set_cairo_context",
"(",
"pc",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"cairo_t",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"cr",
".",
"Native",
"(",
")",
")",
")",
",",
"C",
".",
"double",
"(",
"dpiX",
")",
",",
"C",
".",
"double",
"(",
"dpiY",
")",
")",
"\n",
"}"
] |
12,055 | all-12056 | [
"Create",
"the",
"network",
"on",
"the",
"system",
".",
"The",
"withDatabase",
"flag",
"is",
"used",
"to",
"decide",
"whether",
"to",
"cleanup",
"the",
"database",
"if",
"an",
"error",
"occurs",
"."
] | [
"func",
"doNetworksCreate",
"(",
"d",
"*",
"Daemon",
",",
"req",
"api",
".",
"NetworksPost",
",",
"withDatabase",
"bool",
")",
"error",
"{",
"// Start the network",
"n",
",",
"err",
":=",
"networkLoadByName",
"(",
"d",
".",
"State",
"(",
")",
",",
"req",
".",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"err",
"=",
"n",
".",
"Start",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"n",
".",
"Delete",
"(",
"withDatabase",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
12,056 | all-12057 | [
"fetchRawIDPMetadata",
"is",
"a",
"helper",
"of",
"validateConfig",
"below",
".",
"It",
"takes",
"the",
"URL",
"of",
"a",
"SAML",
"IdP",
"s",
"Metadata",
"service",
"queries",
"it",
"parses",
"the",
"result",
"and",
"returns",
"it",
"as",
"a",
"struct",
"the",
"crewjam",
"/",
"saml",
"library",
"can",
"use",
".",
"This",
"code",
"is",
"heavily",
"based",
"on",
"the",
"crewjam",
"/",
"saml",
"/",
"samlsp",
".",
"Middleware",
"constructor"
] | [
"func",
"fetchRawIDPMetadata",
"(",
"name",
"string",
",",
"mdURL",
"*",
"url",
".",
"URL",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"c",
":=",
"http",
".",
"DefaultClient",
"\n",
"req",
",",
"err",
":=",
"http",
".",
"NewRequest",
"(",
"\"",
"\"",
",",
"mdURL",
".",
"String",
"(",
")",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"name",
",",
"err",
")",
"\n",
"}",
"\n",
"req",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n\n",
"var",
"rawMetadata",
"[",
"]",
"byte",
"\n",
"b",
":=",
"backoff",
".",
"NewInfiniteBackOff",
"(",
")",
"\n",
"b",
".",
"MaxElapsedTime",
"=",
"30",
"*",
"time",
".",
"Second",
"\n",
"b",
".",
"MaxInterval",
"=",
"2",
"*",
"time",
".",
"Second",
"\n",
"if",
"err",
":=",
"backoff",
".",
"RetryNotify",
"(",
"func",
"(",
")",
"error",
"{",
"resp",
",",
"err",
":=",
"c",
".",
"Do",
"(",
"req",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"resp",
".",
"StatusCode",
"!=",
"http",
".",
"StatusOK",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"resp",
".",
"StatusCode",
",",
"resp",
".",
"Status",
")",
"\n",
"}",
"\n",
"rawMetadata",
",",
"err",
"=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"resp",
".",
"<mask>",
".",
"Close",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"if",
"len",
"(",
"rawMetadata",
")",
"==",
"0",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
",",
"b",
",",
"func",
"(",
"err",
"error",
",",
"d",
"time",
".",
"Duration",
")",
"error",
"{",
"logrus",
".",
"Printf",
"(",
"\"",
"\"",
",",
"err",
",",
"d",
")",
"\n",
"return",
"nil",
"\n",
"}",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Successfully retrieved metadata",
"return",
"rawMetadata",
",",
"nil",
"\n",
"}"
] |
12,057 | all-12058 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"EventScriptFailedToParse",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"<mask>",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger38",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
12,058 | all-12059 | [
"Comments",
"returns",
"the",
"list",
"of",
"comments",
"in",
"a",
"given",
"section",
".",
"For",
"the",
"empty",
"string",
"returns",
"the",
"file",
"comments",
"."
] | [
"func",
"(",
"c",
"*",
"Config",
")",
"Comments",
"(",
"section",
"string",
")",
"[",
"]",
"string",
"{",
"if",
"section",
"==",
"\"",
"\"",
"{",
"return",
"c",
".",
"comments",
"\n",
"}",
"\n",
"for",
"_",
",",
"sect",
":=",
"range",
"c",
".",
"sections",
"{",
"if",
"sect",
".",
"name",
"==",
"section",
"{",
"return",
"sect",
".",
"<mask>",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
12,059 | all-12060 | [
"WriteTo",
"writes",
"the",
"entire",
"database",
"to",
"a",
"writer",
".",
"If",
"err",
"==",
"nil",
"then",
"exactly",
"tx",
".",
"Size",
"()",
"bytes",
"will",
"be",
"written",
"into",
"the",
"writer",
"."
] | [
"func",
"(",
"tx",
"*",
"Tx",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"int64",
",",
"error",
")",
"{",
"n",
",",
"err",
":=",
"<mask>",
".",
"Tx",
".",
"WriteTo",
"(",
"w",
")",
"\n",
"return",
"n",
",",
"errorsp",
".",
"WithStacks",
"(",
"err",
")",
"\n",
"}"
] |
12,060 | all-12061 | [
"/",
"*",
"Strings",
"looks",
"for",
"an",
"array",
"of",
"strings",
"under",
"the",
"provided",
"key",
".",
"If",
"no",
"matches",
"are",
"found",
"nil",
"is",
"returned",
".",
"If",
"only",
"one",
"matches",
"an",
"array",
"of",
"1",
"is",
"returned",
"."
] | [
"func",
"(",
"config",
"*",
"Config",
")",
"Strings",
"(",
"key",
"string",
")",
"[",
"]",
"string",
"{",
"return",
"getStrings",
"(",
"config",
".",
"values",
",",
"<mask>",
")",
"\n",
"}"
] |
12,061 | all-12062 | [
"Do",
"executes",
"Page",
".",
"captureSnapshot",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"data",
"-",
"Serialized",
"page",
"data",
"."
] | [
"func",
"(",
"p",
"*",
"CaptureSnapshotParams",
")",
"Do",
"(",
"ctx",
"<mask>",
".",
"Context",
")",
"(",
"data",
"string",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"CaptureSnapshotReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandCaptureSnapshot",
",",
"p",
",",
"&",
"res",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"res",
".",
"Data",
",",
"nil",
"\n",
"}"
] |
12,062 | all-12063 | [
"NewConfig",
"..."
] | [
"func",
"NewConfig",
"(",
")",
"*",
"Config",
"{",
"cfg",
":=",
"&",
"Config",
"{",
"Common",
":",
"commonConfig",
"{",
"GraphPrefix",
":",
"\"",
"\"",
",",
"MetricInterval",
":",
"&",
"Duration",
"{",
"Duration",
":",
"time",
".",
"Minute",
",",
"}",
",",
"MetricEndpoint",
":",
"MetricEndpointLocal",
",",
"MaxCPU",
":",
"1",
",",
"User",
":",
"\"",
"\"",
",",
"}",
",",
"Whisper",
":",
"whisperConfig",
"{",
"DataDir",
":",
"\"",
"\"",
",",
"SchemasFilename",
":",
"\"",
"\"",
",",
"AggregationFilename",
":",
"\"",
"\"",
",",
"MaxUpdatesPerSecond",
":",
"0",
",",
"Enabled",
":",
"true",
",",
"Workers",
":",
"1",
",",
"Sparse",
":",
"false",
",",
"FLock",
":",
"false",
",",
"HashFilenames",
":",
"true",
",",
"}",
",",
"Cache",
":",
"cacheConfig",
"{",
"MaxSize",
":",
"1000000",
",",
"WriteStrategy",
":",
"\"",
"\"",
",",
"}",
",",
"Udp",
":",
"udp",
".",
"NewOptions",
"(",
")",
",",
"Tcp",
":",
"tcp",
".",
"NewOptions",
"(",
")",
",",
"Pickle",
":",
"tcp",
".",
"NewFramingOptions",
"(",
")",
",",
"Carbonserver",
":",
"carbonserverConfig",
"{",
"Listen",
":",
"\"",
"\"",
",",
"Enabled",
":",
"false",
",",
"Buckets",
":",
"10",
",",
"MaxGlobs",
":",
"100",
",",
"FailOnMaxGlobs",
":",
"false",
",",
"MetricsAsCounters",
":",
"false",
",",
"ScanFrequency",
":",
"&",
"Duration",
"{",
"Duration",
":",
"300",
"*",
"time",
".",
"Second",
",",
"}",
",",
"ReadTimeout",
":",
"&",
"Duration",
"{",
"Duration",
":",
"60",
"*",
"time",
".",
"Second",
",",
"}",
",",
"IdleTimeout",
":",
"&",
"Duration",
"{",
"Duration",
":",
"60",
"*",
"time",
".",
"Second",
",",
"}",
",",
"WriteTimeout",
":",
"&",
"Duration",
"{",
"Duration",
":",
"60",
"*",
"<mask>",
".",
"Second",
",",
"}",
",",
"QueryCacheEnabled",
":",
"true",
",",
"QueryCacheSizeMB",
":",
"0",
",",
"FindCacheEnabled",
":",
"true",
",",
"TrigramIndex",
":",
"true",
",",
"}",
",",
"Carbonlink",
":",
"carbonlinkConfig",
"{",
"Listen",
":",
"\"",
"\"",
",",
"Enabled",
":",
"true",
",",
"ReadTimeout",
":",
"&",
"Duration",
"{",
"Duration",
":",
"30",
"*",
"time",
".",
"Second",
",",
"}",
",",
"}",
",",
"Grpc",
":",
"grpcConfig",
"{",
"Listen",
":",
"\"",
"\"",
",",
"Enabled",
":",
"true",
",",
"}",
",",
"Tags",
":",
"tagsConfig",
"{",
"Enabled",
":",
"false",
",",
"TagDB",
":",
"\"",
"\"",
",",
"TagDBTimeout",
":",
"&",
"Duration",
"{",
"Duration",
":",
"time",
".",
"Second",
",",
"}",
",",
"TagDBChunkSize",
":",
"32",
",",
"TagDBUpdateInterval",
":",
"100",
",",
"LocalDir",
":",
"\"",
"\"",
",",
"}",
",",
"Pprof",
":",
"pprofConfig",
"{",
"Listen",
":",
"\"",
"\"",
",",
"Enabled",
":",
"false",
",",
"}",
",",
"Dump",
":",
"dumpConfig",
"{",
"Path",
":",
"\"",
"\"",
",",
"}",
",",
"Prometheus",
":",
"prometheusConfig",
"{",
"Enabled",
":",
"false",
",",
"Endpoint",
":",
"\"",
"\"",
",",
"Labels",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
",",
"}",
",",
"Logging",
":",
"nil",
",",
"}",
"\n\n",
"return",
"cfg",
"\n",
"}"
] |
12,063 | all-12064 | [
"Enqueue",
"will",
"enqueue",
"a",
"job",
"using",
"the",
"specified",
"name",
"and",
"data",
".",
"If",
"a",
"delay",
"is",
"specified",
"the",
"job",
"will",
"not",
"dequeued",
"until",
"the",
"specified",
"time",
"has",
"passed",
"."
] | [
"func",
"(",
"q",
"*",
"Queue",
")",
"Enqueue",
"(",
"name",
"string",
",",
"data",
"Model",
",",
"delay",
"time",
".",
"Duration",
")",
"(",
"*",
"Job",
",",
"error",
")",
"{",
"// copy store",
"<mask>",
":=",
"q",
".",
"store",
".",
"Copy",
"(",
")",
"\n",
"defer",
"store",
".",
"Close",
"(",
")",
"\n\n",
"// enqueue job",
"job",
",",
"err",
":=",
"Enqueue",
"(",
"store",
",",
"name",
",",
"data",
",",
"delay",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"job",
",",
"nil",
"\n",
"}"
] |
12,064 | all-12065 | [
"MarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Marshaler",
"."
] | [
"func",
"(",
"t",
"CaptureSnapshotFormat",
")",
"MarshalEasyJSON",
"(",
"out",
"*",
"jwriter",
".",
"Writer",
")",
"{",
"<mask>",
".",
"String",
"(",
"string",
"(",
"t",
")",
")",
"\n",
"}"
] |
12,065 | all-12066 | [
"Delete",
"destroys",
"a",
"ClusterComputeResource",
"."
] | [
"func",
"Delete",
"(",
"cluster",
"*",
"object",
".",
"ClusterComputeResource",
")",
"error",
"{",
"<mask>",
".",
"Printf",
"(",
"\"",
"\"",
",",
"cluster",
".",
"InventoryPath",
")",
"\n",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"provider",
".",
"DefaultAPITimeout",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n",
"task",
",",
"err",
":=",
"cluster",
".",
"Destroy",
"(",
"ctx",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"task",
".",
"Wait",
"(",
"ctx",
")",
"\n",
"}"
] |
12,066 | all-12067 | [
"Loader",
"functions"
] | [
"func",
"containerCreateAsEmpty",
"(",
"d",
"*",
"Daemon",
",",
"args",
"<mask>",
".",
"ContainerArgs",
")",
"(",
"container",
",",
"error",
")",
"{",
"// Create the container",
"c",
",",
"err",
":=",
"containerCreateInternal",
"(",
"d",
".",
"State",
"(",
")",
",",
"args",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Now create the empty storage",
"err",
"=",
"c",
".",
"Storage",
"(",
")",
".",
"ContainerCreate",
"(",
"c",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"c",
".",
"Delete",
"(",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Apply any post-storage configuration",
"err",
"=",
"containerConfigureInternal",
"(",
"c",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"c",
".",
"Delete",
"(",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"c",
",",
"nil",
"\n",
"}"
] |
12,067 | all-12068 | [
"IsMouseButtonPressed",
"returns",
"a",
"boolean",
"indicating",
"whether",
"mouseButton",
"is",
"pressed",
".",
"IsMouseButtonPressed",
"is",
"concurrent",
"-",
"safe",
".",
"Note",
"that",
"touch",
"events",
"not",
"longer",
"affect",
"IsMouseButtonPressed",
"s",
"result",
"as",
"of",
"1",
".",
"4",
".",
"0",
"-",
"alpha",
".",
"Use",
"Touches",
"instead",
"."
] | [
"func",
"IsMouseButtonPressed",
"(",
"mouseButton",
"MouseButton",
")",
"bool",
"{",
"return",
"uiDriver",
"(",
")",
".",
"<mask>",
"(",
")",
".",
"IsMouseButtonPressed",
"(",
"driver",
".",
"MouseButton",
"(",
"mouseButton",
")",
")",
"\n",
"}"
] |
12,068 | all-12069 | [
"SetEntry",
"is",
"the",
"equivalent",
"of",
"Txn",
".",
"SetEntry",
"."
] | [
"func",
"(",
"wb",
"*",
"WriteBatch",
")",
"SetEntry",
"(",
"e",
"*",
"Entry",
")",
"error",
"{",
"wb",
".",
"Lock",
"(",
")",
"\n",
"defer",
"wb",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"err",
":=",
"wb",
".",
"txn",
".",
"SetEntry",
"(",
"e",
")",
";",
"err",
"!=",
"ErrTxnTooBig",
"{",
"return",
"err",
"\n",
"}",
"\n",
"// Txn has reached it's zenith. Commit now.",
"if",
"cerr",
":=",
"wb",
".",
"<mask>",
"(",
")",
";",
"cerr",
"!=",
"nil",
"{",
"return",
"cerr",
"\n",
"}",
"\n",
"// This time the error must not be ErrTxnTooBig, otherwise, we make the",
"// error permanent.",
"if",
"err",
":=",
"wb",
".",
"txn",
".",
"SetEntry",
"(",
"e",
")",
";",
"err",
"!=",
"nil",
"{",
"wb",
".",
"err",
"=",
"err",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
12,069 | all-12070 | [
"/",
"*",
"HeaderBar",
"GetDecorationLayout",
"is",
"a",
"wrapper",
"around",
"gtk_header_bar_get_decoration_layout",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"HeaderBar",
")",
"GetDecorationLayout",
"(",
")",
"string",
"{",
"c",
":=",
"C",
".",
"gtk_header_bar_get_decoration_layout",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"return",
"C",
".",
"GoString",
"(",
"(",
"*",
"C",
".",
"<mask>",
")",
"(",
"c",
")",
")",
"\n",
"}"
] |
12,070 | all-12071 | [
"Init2",
"prepares",
"ctx",
"for",
"passing",
"to",
"RequestHandler",
".",
"conn",
"is",
"used",
"only",
"for",
"determining",
"local",
"and",
"remote",
"addresses",
".",
"This",
"function",
"is",
"intended",
"for",
"custom",
"Server",
"implementations",
".",
"See",
"https",
":",
"//",
"github",
".",
"com",
"/",
"valyala",
"/",
"httpteleport",
"for",
"details",
"."
] | [
"func",
"(",
"ctx",
"*",
"RequestCtx",
")",
"Init2",
"(",
"conn",
"net",
".",
"Conn",
",",
"logger",
"Logger",
",",
"reduceMemoryUsage",
"bool",
")",
"{",
"ctx",
".",
"c",
"=",
"conn",
"\n",
"ctx",
".",
"logger",
".",
"logger",
"=",
"logger",
"\n",
"ctx",
".",
"connID",
"=",
"nextConnID",
"(",
")",
"\n",
"ctx",
".",
"s",
"=",
"fakeServer",
"\n",
"ctx",
".",
"connRequestNum",
"=",
"0",
"\n",
"ctx",
".",
"connTime",
"=",
"time",
".",
"Now",
"(",
")",
"\n\n",
"keepBodyBuffer",
":=",
"!",
"reduceMemoryUsage",
"\n",
"ctx",
".",
"<mask>",
".",
"keepBodyBuffer",
"=",
"keepBodyBuffer",
"\n",
"ctx",
".",
"Response",
".",
"keepBodyBuffer",
"=",
"keepBodyBuffer",
"\n",
"}"
] |
12,071 | all-12072 | [
"ArrowNew",
"is",
"a",
"wrapper",
"around",
"gtk_arrow_new",
"()",
"."
] | [
"func",
"ArrowNew",
"(",
"arrowType",
"ArrowType",
",",
"shadowType",
"ShadowType",
")",
"(",
"*",
"Arrow",
",",
"<mask>",
")",
"{",
"c",
":=",
"C",
".",
"gtk_arrow_new",
"(",
"C",
".",
"GtkArrowType",
"(",
"arrowType",
")",
",",
"C",
".",
"GtkShadowType",
"(",
"shadowType",
")",
")",
"\n",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
",",
"nilPtrErr",
"\n",
"}",
"\n",
"obj",
":=",
"glib",
".",
"Take",
"(",
"unsafe",
".",
"Pointer",
"(",
"c",
")",
")",
"\n",
"return",
"wrapArrow",
"(",
"obj",
")",
",",
"nil",
"\n",
"}"
] |
12,072 | all-12073 | [
"NewConfigurationTrustProvider",
"creates",
"a",
"configuration",
"for",
"server",
"with",
"no",
"enforcement",
"for",
"token",
"sig",
"alg",
"type",
"instead",
"trust",
"provider"
] | [
"func",
"NewConfigurationTrustProvider",
"(",
"provider",
"SecretProvider",
",",
"audience",
"[",
"]",
"string",
",",
"issuer",
"string",
")",
"<mask>",
"{",
"return",
"Configuration",
"{",
"secretProvider",
":",
"provider",
",",
"expectedClaims",
":",
"jwt",
".",
"Expected",
"{",
"Issuer",
":",
"issuer",
",",
"Audience",
":",
"audience",
"}",
",",
"}",
"\n",
"}"
] |
12,073 | all-12074 | [
"SetSearchEntry",
"is",
"a",
"wrapper",
"around",
"gtk_tree_view_set_search_entry",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"TreeView",
")",
"SetSearchEntry",
"(",
"e",
"*",
"<mask>",
")",
"{",
"C",
".",
"gtk_tree_view_set_search_entry",
"(",
"v",
".",
"native",
"(",
")",
",",
"e",
".",
"native",
"(",
")",
")",
"\n",
"}"
] |
12,074 | all-12075 | [
"Del",
"deletes",
"the",
"label",
"of",
"the",
"given",
"name",
"."
] | [
"func",
"(",
"b",
"*",
"Builder",
")",
"Del",
"(",
"<mask>",
"...",
"string",
")",
"*",
"Builder",
"{",
"for",
"_",
",",
"n",
":=",
"range",
"ns",
"{",
"for",
"i",
",",
"a",
":=",
"range",
"b",
".",
"add",
"{",
"if",
"a",
".",
"Name",
"==",
"n",
"{",
"b",
".",
"add",
"=",
"append",
"(",
"b",
".",
"add",
"[",
":",
"i",
"]",
",",
"b",
".",
"add",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"}",
"\n",
"}",
"\n",
"b",
".",
"del",
"=",
"append",
"(",
"b",
".",
"del",
",",
"n",
")",
"\n",
"}",
"\n",
"return",
"b",
"\n",
"}"
] |
12,075 | all-12076 | [
"NewSprocketsServer",
"creates",
"a",
"Sprockets",
"asset",
"pipeline"
] | [
"func",
"NewSprocketsServer",
"(",
"target",
"*",
"url",
".",
"URL",
")",
"(",
"*",
"SprocketsServer",
",",
"error",
")",
"{",
"s",
":=",
"SprocketsServer",
"{",
"Handler",
":",
"httputil",
".",
"NewSingleHostReverseProxy",
"(",
"<mask>",
")",
",",
"target",
":",
"target",
",",
"}",
"\n\n",
"return",
"&",
"s",
",",
"nil",
"\n",
"}"
] |
12,076 | all-12077 | [
"getIDs",
"returns",
"an",
"ordered",
"set",
"of",
"IDs",
"included",
"in",
"the",
"given",
"snapshot",
"and",
"the",
"entries",
".",
"The",
"given",
"snapshot",
"/",
"entries",
"can",
"contain",
"two",
"kinds",
"of",
"ID",
"-",
"related",
"entry",
":",
"-",
"ConfChangeAddNode",
"in",
"which",
"case",
"the",
"contained",
"ID",
"will",
"be",
"added",
"into",
"the",
"set",
".",
"-",
"ConfChangeRemoveNode",
"in",
"which",
"case",
"the",
"contained",
"ID",
"will",
"be",
"removed",
"from",
"the",
"set",
"."
] | [
"func",
"getIDs",
"(",
"lg",
"*",
"zap",
".",
"Logger",
",",
"snap",
"*",
"raftpb",
".",
"Snapshot",
",",
"ents",
"[",
"]",
"raftpb",
".",
"Entry",
")",
"[",
"]",
"uint64",
"{",
"ids",
":=",
"make",
"(",
"map",
"[",
"uint64",
"]",
"bool",
")",
"\n",
"if",
"snap",
"!=",
"nil",
"{",
"for",
"_",
",",
"id",
":=",
"range",
"snap",
".",
"Metadata",
".",
"ConfState",
".",
"Nodes",
"{",
"ids",
"[",
"id",
"]",
"=",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"_",
",",
"e",
":=",
"range",
"ents",
"{",
"if",
"e",
".",
"Type",
"!=",
"raftpb",
".",
"EntryConfChange",
"{",
"continue",
"\n",
"}",
"\n",
"var",
"cc",
"raftpb",
".",
"ConfChange",
"\n",
"pbutil",
".",
"MustUnmarshal",
"(",
"&",
"cc",
",",
"e",
".",
"Data",
")",
"\n",
"switch",
"cc",
".",
"Type",
"{",
"case",
"raftpb",
".",
"ConfChangeAddNode",
":",
"ids",
"[",
"cc",
".",
"NodeID",
"]",
"=",
"true",
"\n",
"case",
"raftpb",
".",
"ConfChangeRemoveNode",
":",
"delete",
"(",
"ids",
",",
"cc",
".",
"NodeID",
")",
"\n",
"case",
"raftpb",
".",
"ConfChangeUpdateNode",
":",
"// do nothing",
"default",
":",
"if",
"lg",
"!=",
"nil",
"{",
"lg",
".",
"Panic",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"cc",
".",
"Type",
".",
"String",
"(",
")",
")",
")",
"\n",
"}",
"else",
"{",
"plog",
".",
"Panicf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"sids",
":=",
"make",
"(",
"types",
".",
"Uint64Slice",
",",
"0",
",",
"len",
"(",
"ids",
")",
")",
"\n",
"for",
"id",
":=",
"<mask>",
"ids",
"{",
"sids",
"=",
"append",
"(",
"sids",
",",
"id",
")",
"\n",
"}",
"\n",
"sort",
".",
"Sort",
"(",
"sids",
")",
"\n",
"return",
"[",
"]",
"uint64",
"(",
"sids",
")",
"\n",
"}"
] |
12,077 | all-12078 | [
"GetThresholdsOk",
"returns",
"a",
"tuple",
"with",
"the",
"Thresholds",
"field",
"if",
"it",
"s",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"and",
"a",
"boolean",
"to",
"check",
"if",
"the",
"value",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"o",
"*",
"<mask>",
")",
"GetThresholdsOk",
"(",
")",
"(",
"ThresholdCount",
",",
"bool",
")",
"{",
"if",
"o",
"==",
"nil",
"||",
"o",
".",
"Thresholds",
"==",
"nil",
"{",
"return",
"ThresholdCount",
"{",
"}",
",",
"false",
"\n",
"}",
"\n",
"return",
"*",
"o",
".",
"Thresholds",
",",
"true",
"\n",
"}"
] |
12,078 | all-12079 | [
"PolicyConfigurationNamespaces",
"returns",
"a",
"list",
"of",
"other",
"policy",
"configuration",
"namespaces",
"to",
"search",
"for",
"if",
"explicit",
"configuration",
"for",
"PolicyConfigurationIdentity",
"()",
"is",
"not",
"set",
".",
"The",
"list",
"will",
"be",
"processed",
"in",
"order",
"terminating",
"on",
"first",
"match",
"and",
"an",
"implicit",
"is",
"always",
"checked",
"at",
"the",
"end",
".",
"It",
"is",
"STRONGLY",
"recommended",
"for",
"the",
"first",
"element",
"if",
"any",
"to",
"be",
"a",
"prefix",
"of",
"PolicyConfigurationIdentity",
"()",
"and",
"each",
"following",
"element",
"to",
"be",
"a",
"prefix",
"of",
"the",
"element",
"preceding",
"it",
"."
] | [
"func",
"(",
"<mask>",
"ostreeReference",
")",
"PolicyConfigurationNamespaces",
"(",
")",
"[",
"]",
"string",
"{",
"s",
":=",
"strings",
".",
"SplitN",
"(",
"ref",
".",
"image",
",",
"\"",
"\"",
",",
"2",
")",
"\n",
"if",
"len",
"(",
"s",
")",
"!=",
"2",
"{",
"// Coverage: Should never happen, NewReference above ensures ref.image has a :tag.",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"ref",
".",
"image",
")",
")",
"\n",
"}",
"\n",
"name",
":=",
"s",
"[",
"0",
"]",
"\n",
"res",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"{",
"res",
"=",
"append",
"(",
"res",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"ref",
".",
"repo",
",",
"name",
")",
")",
"\n\n",
"lastSlash",
":=",
"strings",
".",
"LastIndex",
"(",
"name",
",",
"\"",
"\"",
")",
"\n",
"if",
"lastSlash",
"==",
"-",
"1",
"{",
"break",
"\n",
"}",
"\n",
"name",
"=",
"name",
"[",
":",
"lastSlash",
"]",
"\n",
"}",
"\n",
"return",
"res",
"\n",
"}"
] |
12,079 | all-12080 | [
"GetAttributeVal",
"is",
"like",
"GetAttribute",
"except",
"it",
"returns",
"the",
"attribute",
"s",
"value",
"."
] | [
"func",
"GetAttributeVal",
"(",
"n",
"Elem",
",",
"local",
",",
"<mask>",
"string",
")",
"(",
"string",
",",
"bool",
")",
"{",
"attr",
",",
"ok",
":=",
"GetAttribute",
"(",
"n",
",",
"local",
",",
"space",
")",
"\n",
"return",
"attr",
".",
"Value",
",",
"ok",
"\n",
"}"
] |
12,080 | all-12081 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetNodeNameReturns",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom4",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"<mask>",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"Error",
"\n",
"}"
] |
12,081 | all-12082 | [
"Get",
"a",
"list",
"of",
"ports",
"and",
"a",
"list",
"of",
"labels",
"from",
"a",
"PortMapping",
"."
] | [
"func",
"extractPortMapping",
"(",
"portMappings",
"[",
"]",
"portMapping",
",",
"containerNet",
"bool",
")",
"(",
"[",
"]",
"uint32",
",",
"[",
"]",
"map",
"[",
"string",
"]",
"string",
")",
"{",
"<mask>",
":=",
"make",
"(",
"[",
"]",
"uint32",
",",
"len",
"(",
"portMappings",
")",
")",
"\n",
"labels",
":=",
"make",
"(",
"[",
"]",
"map",
"[",
"string",
"]",
"string",
",",
"len",
"(",
"portMappings",
")",
")",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"portMappings",
")",
";",
"i",
"++",
"{",
"labels",
"[",
"i",
"]",
"=",
"portMappings",
"[",
"i",
"]",
".",
"Labels",
"\n\n",
"if",
"containerNet",
"{",
"// If the app is in a container network, connect directly to the container port.",
"ports",
"[",
"i",
"]",
"=",
"portMappings",
"[",
"i",
"]",
".",
"ContainerPort",
"\n",
"}",
"else",
"{",
"// Otherwise, connect to the allocated host port for the container.",
"// Note that this host port is likely set to 0 in the app definition, which means it is",
"// automatically generated and needs to be extracted from the task's 'ports' array at a later stage.",
"ports",
"[",
"i",
"]",
"=",
"portMappings",
"[",
"i",
"]",
".",
"HostPort",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"ports",
",",
"labels",
"\n",
"}"
] |
12,082 | all-12083 | [
"GetMustShowResourceList",
"returns",
"the",
"MustShowResourceList",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"w",
"*",
"Widget",
")",
"GetMustShowResourceList",
"(",
")",
"bool",
"{",
"if",
"w",
"==",
"nil",
"||",
"w",
".",
"MustShowResourceList",
"==",
"nil",
"{",
"return",
"<mask>",
"\n",
"}",
"\n",
"return",
"*",
"w",
".",
"MustShowResourceList",
"\n",
"}"
] |
12,083 | all-12084 | [
"/",
"*",
"The",
"most",
"usual",
"method",
"of",
"parsing",
"an",
"evaluation",
"stage",
"for",
"a",
"given",
"precedence",
".",
"Most",
"stages",
"use",
"the",
"same",
"logic"
] | [
"func",
"planPrecedenceLevel",
"(",
"stream",
"*",
"tokenStream",
",",
"typeErrorFormat",
"string",
",",
"validSymbols",
"map",
"[",
"string",
"]",
"OperatorSymbol",
",",
"validKinds",
"[",
"]",
"TokenKind",
",",
"rightPrecedent",
"precedent",
",",
"leftPrecedent",
"precedent",
")",
"(",
"*",
"evaluationStage",
",",
"error",
")",
"{",
"var",
"token",
"ExpressionToken",
"\n",
"var",
"symbol",
"OperatorSymbol",
"\n",
"var",
"leftStage",
",",
"rightStage",
"*",
"evaluationStage",
"\n",
"var",
"checks",
"typeChecks",
"\n",
"var",
"err",
"error",
"\n",
"var",
"keyFound",
"bool",
"\n\n",
"if",
"leftPrecedent",
"!=",
"nil",
"{",
"leftStage",
",",
"err",
"=",
"leftPrecedent",
"(",
"stream",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"for",
"stream",
".",
"hasNext",
"(",
")",
"{",
"token",
"=",
"stream",
".",
"<mask>",
"(",
")",
"\n\n",
"if",
"len",
"(",
"validKinds",
")",
">",
"0",
"{",
"keyFound",
"=",
"false",
"\n",
"for",
"_",
",",
"kind",
":=",
"range",
"validKinds",
"{",
"if",
"kind",
"==",
"token",
".",
"Kind",
"{",
"keyFound",
"=",
"true",
"\n",
"break",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"!",
"keyFound",
"{",
"break",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"validSymbols",
"!=",
"nil",
"{",
"if",
"!",
"isString",
"(",
"token",
".",
"Value",
")",
"{",
"break",
"\n",
"}",
"\n\n",
"symbol",
",",
"keyFound",
"=",
"validSymbols",
"[",
"token",
".",
"Value",
".",
"(",
"string",
")",
"]",
"\n",
"if",
"!",
"keyFound",
"{",
"break",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"rightPrecedent",
"!=",
"nil",
"{",
"rightStage",
",",
"err",
"=",
"rightPrecedent",
"(",
"stream",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"}",
"\n\n",
"checks",
"=",
"findTypeChecks",
"(",
"symbol",
")",
"\n\n",
"return",
"&",
"evaluationStage",
"{",
"symbol",
":",
"symbol",
",",
"leftStage",
":",
"leftStage",
",",
"rightStage",
":",
"rightStage",
",",
"operator",
":",
"stageSymbolMap",
"[",
"symbol",
"]",
",",
"leftTypeCheck",
":",
"checks",
".",
"left",
",",
"rightTypeCheck",
":",
"checks",
".",
"right",
",",
"typeCheck",
":",
"checks",
".",
"combined",
",",
"typeErrorFormat",
":",
"typeErrorFormat",
",",
"}",
",",
"nil",
"\n",
"}",
"\n\n",
"stream",
".",
"rewind",
"(",
")",
"\n",
"return",
"leftStage",
",",
"nil",
"\n",
"}"
] |
12,084 | all-12085 | [
"SearchAlerts",
"returns",
"alerts",
"matching",
"the",
"specified",
"search",
"query",
"and",
"/",
"or",
"filter",
".",
"If",
"nil",
"is",
"passed",
"for",
"both",
"parameters",
"all",
"alerts",
"will",
"be",
"returned",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"SearchAlerts",
"(",
"searchCriteria",
"*",
"SearchQueryType",
",",
"filterCriteria",
"*",
"SearchFilterType",
")",
"(",
"*",
"[",
"]",
"Alert",
",",
"error",
")",
"{",
"q",
":=",
"<mask>",
".",
"Values",
"{",
"}",
"\n\n",
"if",
"searchCriteria",
"!=",
"nil",
"&&",
"*",
"searchCriteria",
"!=",
"\"",
"\"",
"{",
"q",
".",
"Set",
"(",
"\"",
"\"",
",",
"string",
"(",
"*",
"searchCriteria",
")",
")",
"\n",
"}",
"\n\n",
"if",
"filterCriteria",
"!=",
"nil",
"&&",
"len",
"(",
"*",
"filterCriteria",
")",
">",
"0",
"{",
"for",
"filter",
",",
"criteria",
":=",
"range",
"*",
"filterCriteria",
"{",
"for",
"_",
",",
"val",
":=",
"range",
"criteria",
"{",
"q",
".",
"Add",
"(",
"filter",
",",
"val",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"q",
".",
"Encode",
"(",
")",
"==",
"\"",
"\"",
"{",
"return",
"a",
".",
"FetchAlerts",
"(",
")",
"\n",
"}",
"\n\n",
"reqURL",
":=",
"url",
".",
"URL",
"{",
"Path",
":",
"config",
".",
"AlertPrefix",
",",
"RawQuery",
":",
"q",
".",
"Encode",
"(",
")",
",",
"}",
"\n\n",
"result",
",",
"err",
":=",
"a",
".",
"Get",
"(",
"reqURL",
".",
"String",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"var",
"alerts",
"[",
"]",
"Alert",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"result",
",",
"&",
"alerts",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"alerts",
",",
"nil",
"\n",
"}"
] |
12,085 | all-12086 | [
"PutFileSplitWriter",
"writes",
"a",
"multiple",
"files",
"to",
"PFS",
"by",
"splitting",
"up",
"the",
"data",
"that",
"is",
"written",
"to",
"it",
".",
"NOTE",
":",
"PutFileSplitWriter",
"returns",
"an",
"io",
".",
"WriteCloser",
"you",
"must",
"call",
"Close",
"on",
"it",
"when",
"you",
"are",
"done",
"writing",
"."
] | [
"func",
"(",
"c",
"*",
"putFileClient",
")",
"PutFileSplitWriter",
"(",
"repoName",
"string",
",",
"commitID",
"string",
",",
"<mask>",
"string",
",",
"delimiter",
"pfs",
".",
"Delimiter",
",",
"targetFileDatums",
"int64",
",",
"targetFileBytes",
"int64",
",",
"headerRecords",
"int64",
",",
"overwrite",
"bool",
")",
"(",
"io",
".",
"WriteCloser",
",",
"error",
")",
"{",
"// TODO(msteffen) add headerRecords",
"var",
"overwriteIndex",
"*",
"pfs",
".",
"OverwriteIndex",
"\n",
"if",
"overwrite",
"{",
"overwriteIndex",
"=",
"&",
"pfs",
".",
"OverwriteIndex",
"{",
"}",
"\n",
"}",
"\n",
"return",
"c",
".",
"newPutFileWriteCloser",
"(",
"repoName",
",",
"commitID",
",",
"path",
",",
"delimiter",
",",
"targetFileDatums",
",",
"targetFileBytes",
",",
"headerRecords",
",",
"overwriteIndex",
")",
"\n",
"}"
] |
12,086 | all-12087 | [
"UpdateResource",
"updates",
"a",
"resource",
"if",
"it",
"exists",
"errors",
"otherwise"
] | [
"func",
"(",
"s",
"*",
"Storage",
")",
"UpdateResource",
"(",
"resource",
"common",
".",
"Resource",
")",
"error",
"{",
"return",
"s",
".",
"<mask>",
".",
"Update",
"(",
"resource",
")",
"\n",
"}"
] |
12,087 | all-12088 | [
"SetTooltipMarkup",
"is",
"a",
"wrapper",
"around",
"gtk_tool_item_set_tooltip_markup",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"ToolItem",
")",
"SetTooltipMarkup",
"(",
"<mask>",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"text",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"gtk_tool_item_set_tooltip_markup",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"gchar",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
12,088 | all-12089 | [
"Parse",
"reads",
"a",
"label",
"from",
"a",
"string",
".",
"See",
"https",
":",
"//",
"docs",
".",
"bazel",
".",
"build",
"/",
"versions",
"/",
"master",
"/",
"build",
"-",
"ref",
".",
"html#lexi",
"."
] | [
"func",
"Parse",
"(",
"s",
"string",
")",
"(",
"Label",
",",
"error",
")",
"{",
"origStr",
":=",
"s",
"\n\n",
"relative",
":=",
"true",
"\n",
"var",
"repo",
"string",
"\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"s",
",",
"\"",
"\"",
")",
"{",
"relative",
"=",
"false",
"\n",
"endRepo",
":=",
"strings",
".",
"Index",
"(",
"s",
",",
"\"",
"\"",
")",
"\n",
"if",
"endRepo",
"<",
"0",
"{",
"return",
"NoLabel",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"origStr",
")",
"\n",
"}",
"\n",
"repo",
"=",
"s",
"[",
"len",
"(",
"\"",
"\"",
")",
":",
"endRepo",
"]",
"\n",
"if",
"!",
"labelRepoRegexp",
".",
"MatchString",
"(",
"repo",
")",
"{",
"return",
"NoLabel",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"origStr",
")",
"\n",
"}",
"\n",
"s",
"=",
"s",
"[",
"endRepo",
":",
"]",
"\n",
"}",
"\n\n",
"var",
"pkg",
"string",
"\n",
"if",
"strings",
".",
"HasPrefix",
"(",
"s",
",",
"\"",
"\"",
")",
"{",
"relative",
"=",
"<mask>",
"\n",
"endPkg",
":=",
"strings",
".",
"Index",
"(",
"s",
",",
"\"",
"\"",
")",
"\n",
"if",
"endPkg",
"<",
"0",
"{",
"pkg",
"=",
"s",
"[",
"len",
"(",
"\"",
"\"",
")",
":",
"]",
"\n",
"s",
"=",
"\"",
"\"",
"\n",
"}",
"else",
"{",
"pkg",
"=",
"s",
"[",
"len",
"(",
"\"",
"\"",
")",
":",
"endPkg",
"]",
"\n",
"s",
"=",
"s",
"[",
"endPkg",
":",
"]",
"\n",
"}",
"\n",
"if",
"!",
"labelPkgRegexp",
".",
"MatchString",
"(",
"pkg",
")",
"{",
"return",
"NoLabel",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"origStr",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"if",
"s",
"==",
"\"",
"\"",
"{",
"return",
"NoLabel",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"origStr",
")",
"\n",
"}",
"\n",
"name",
":=",
"strings",
".",
"TrimPrefix",
"(",
"s",
",",
"\"",
"\"",
")",
"\n",
"if",
"!",
"labelNameRegexp",
".",
"MatchString",
"(",
"name",
")",
"{",
"return",
"NoLabel",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"origStr",
")",
"\n",
"}",
"\n\n",
"if",
"pkg",
"==",
"\"",
"\"",
"&&",
"name",
"==",
"\"",
"\"",
"{",
"return",
"NoLabel",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"origStr",
")",
"\n",
"}",
"\n",
"if",
"name",
"==",
"\"",
"\"",
"{",
"name",
"=",
"path",
".",
"Base",
"(",
"pkg",
")",
"\n",
"}",
"\n\n",
"return",
"Label",
"{",
"Repo",
":",
"repo",
",",
"Pkg",
":",
"pkg",
",",
"Name",
":",
"name",
",",
"Relative",
":",
"relative",
",",
"}",
",",
"nil",
"\n",
"}"
] |
12,089 | all-12090 | [
"LoadBalancers",
"retrieves",
"a",
"list",
"of",
"all",
"load",
"balancers"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"LoadBalancers",
"(",
")",
"(",
"[",
"]",
"LoadBalancer",
",",
"error",
")",
"{",
"<mask>",
"lbs",
"[",
"]",
"LoadBalancer",
"\n",
"_",
",",
"err",
":=",
"c",
".",
"MakeApiRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"lbs",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"lbs",
",",
"err",
"\n",
"}"
] |
12,090 | all-12091 | [
"Writes",
"next",
"msgPacket",
"to",
"w",
".",
"Not",
"goroutine",
"-",
"safe"
] | [
"func",
"(",
"ch",
"*",
"Channel",
")",
"writeMsgPacketTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"packet",
":=",
"ch",
".",
"nextMsgPacket",
"(",
")",
"\n",
"<mask>",
".",
"Debug",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"ch",
".",
"conn",
",",
"\"",
"\"",
",",
"packet",
")",
"\n",
"wire",
".",
"WriteByte",
"(",
"packetTypeMsg",
",",
"w",
",",
"&",
"n",
",",
"&",
"err",
")",
"\n",
"wire",
".",
"WriteBinary",
"(",
"packet",
",",
"w",
",",
"&",
"n",
",",
"&",
"err",
")",
"\n",
"if",
"err",
"==",
"nil",
"{",
"ch",
".",
"recentlySent",
"+=",
"int64",
"(",
"n",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
12,091 | all-12092 | [
"Scaffold",
"creates",
"a",
"router",
"and",
"passes",
"it",
"to",
"a",
"platorm"
] | [
"func",
"Scaffold",
"(",
"d",
"Dispatcher",
",",
"platform",
"Platform",
")",
"Handler",
"{",
"router",
":=",
"New",
"(",
"d",
")",
"\n",
"<mask>",
".",
"Routes",
"(",
"router",
")",
"\n",
"return",
"router",
".",
"dispatcher",
"\n",
"}"
] |
12,092 | all-12093 | [
"SetValue",
"sets",
"cookie",
"value",
"."
] | [
"func",
"(",
"c",
"*",
"Cookie",
")",
"SetValue",
"(",
"value",
"string",
")",
"{",
"c",
".",
"value",
"=",
"append",
"(",
"c",
".",
"value",
"[",
":",
"0",
"]",
",",
"<mask>",
"...",
")",
"\n",
"}"
] |
12,093 | all-12094 | [
"GetOwner",
"returns",
"who",
"owns",
"the",
"lockfile",
"."
] | [
"func",
"(",
"l",
"Lockfile",
")",
"GetOwner",
"(",
")",
"(",
"*",
"<mask>",
".",
"Process",
",",
"error",
")",
"{",
"name",
":=",
"string",
"(",
"l",
")",
"\n\n",
"// Ok, see, if we have a stale lockfile here",
"content",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// try hard for pids. If no pid, the lockfile is junk anyway and we delete it.",
"pid",
",",
"err",
":=",
"scanPidLine",
"(",
"content",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"running",
",",
"err",
":=",
"isRunning",
"(",
"pid",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"running",
"{",
"proc",
",",
"err",
":=",
"os",
".",
"FindProcess",
"(",
"pid",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"proc",
",",
"nil",
"\n",
"}",
"\n",
"return",
"nil",
",",
"ErrDeadOwner",
"\n\n",
"}"
] |
12,094 | all-12095 | [
"/",
"*",
"Get1D",
"return",
"a",
"specific",
"element",
"from",
"a",
"1",
"-",
"dimensional",
"matrix",
"."
] | [
"func",
"(",
"m",
"*",
"Mat",
")",
"Get1D",
"(",
"x",
"int",
")",
"Scalar",
"{",
"<mask>",
":=",
"C",
".",
"cvGet1D",
"(",
"unsafe",
".",
"Pointer",
"(",
"m",
")",
",",
"C",
".",
"int",
"(",
"x",
")",
")",
"\n",
"return",
"Scalar",
"(",
"ret",
")",
"\n",
"}"
] |
12,095 | all-12096 | [
"changesByZone",
"separates",
"a",
"multi",
"-",
"zone",
"change",
"into",
"a",
"single",
"change",
"per",
"zone",
"."
] | [
"func",
"(",
"p",
"*",
"CloudFlareProvider",
")",
"changesByZone",
"(",
"zones",
"[",
"]",
"cloudflare",
".",
"Zone",
",",
"changeSet",
"[",
"]",
"*",
"cloudFlareChange",
")",
"map",
"[",
"string",
"]",
"[",
"]",
"*",
"cloudFlareChange",
"{",
"changes",
":=",
"<mask>",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"*",
"cloudFlareChange",
")",
"\n",
"zoneNameIDMapper",
":=",
"zoneIDName",
"{",
"}",
"\n\n",
"for",
"_",
",",
"z",
":=",
"range",
"zones",
"{",
"zoneNameIDMapper",
".",
"Add",
"(",
"z",
".",
"ID",
",",
"z",
".",
"Name",
")",
"\n",
"changes",
"[",
"z",
".",
"ID",
"]",
"=",
"[",
"]",
"*",
"cloudFlareChange",
"{",
"}",
"\n",
"}",
"\n\n",
"for",
"_",
",",
"c",
":=",
"range",
"changeSet",
"{",
"zoneID",
",",
"_",
":=",
"zoneNameIDMapper",
".",
"FindZone",
"(",
"c",
".",
"ResourceRecordSet",
"[",
"0",
"]",
".",
"Name",
")",
"\n",
"if",
"zoneID",
"==",
"\"",
"\"",
"{",
"log",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"c",
".",
"ResourceRecordSet",
"[",
"0",
"]",
".",
"Name",
")",
"\n",
"continue",
"\n",
"}",
"\n",
"changes",
"[",
"zoneID",
"]",
"=",
"append",
"(",
"changes",
"[",
"zoneID",
"]",
",",
"c",
")",
"\n",
"}",
"\n\n",
"return",
"changes",
"\n",
"}"
] |
12,096 | all-12097 | [
"Do",
"executes",
"Debugger",
".",
"setBreakpointOnFunctionCall",
"against",
"the",
"provided",
"context",
".",
"returns",
":",
"breakpointID",
"-",
"Id",
"of",
"the",
"created",
"breakpoint",
"for",
"further",
"reference",
"."
] | [
"func",
"(",
"p",
"*",
"SetBreakpointOnFunctionCallParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"breakpointID",
"BreakpointID",
",",
"err",
"error",
")",
"{",
"// execute",
"var",
"res",
"SetBreakpointOnFunctionCallReturns",
"\n",
"err",
"=",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandSetBreakpointOnFunctionCall",
",",
"p",
",",
"&",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"res",
".",
"BreakpointID",
",",
"nil",
"\n",
"}"
] |
12,097 | all-12098 | [
"Get",
"..."
] | [
"func",
"(",
"c",
"*",
"Context",
")",
"Get",
"(",
"key",
"string",
")",
"interface",
"{",
"}",
"{",
"if",
"<mask>",
",",
"ok",
":=",
"c",
".",
"set",
"[",
"key",
"]",
";",
"ok",
"{",
"return",
"value",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] |
12,098 | all-12099 | [
"Respond",
"without",
"doing",
"anything",
".",
"This",
"endpoint",
"is",
"used",
"to",
"check",
"that",
"the",
"service",
"is",
"up",
".",
"See",
"https",
":",
"//",
"docs",
".",
"taskcluster",
".",
"net",
"/",
"reference",
"/",
"core",
"/",
"aws",
"-",
"provisioner",
"/",
"api",
"-",
"docs#ping"
] | [
"func",
"(",
"awsProvisioner",
"*",
"AwsProvisioner",
")",
"Ping",
"(",
")",
"error",
"{",
"cd",
":=",
"tcclient",
".",
"<mask>",
"(",
"*",
"awsProvisioner",
")",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"(",
"&",
"cd",
")",
".",
"APICall",
"(",
"nil",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"nil",
")",
"\n",
"return",
"err",
"\n",
"}"
] |
12,099 | all-12100 | [
"CompileScript",
"compiles",
"expression",
".",
"See",
":",
"https",
":",
"//",
"chromedevtools",
".",
"github",
".",
"io",
"/",
"devtools",
"-",
"protocol",
"/",
"tot",
"/",
"Runtime#method",
"-",
"compileScript",
"parameters",
":",
"expression",
"-",
"Expression",
"to",
"compile",
".",
"sourceURL",
"-",
"Source",
"url",
"to",
"be",
"set",
"for",
"the",
"script",
".",
"persistScript",
"-",
"Specifies",
"whether",
"the",
"compiled",
"script",
"should",
"be",
"persisted",
"."
] | [
"func",
"CompileScript",
"(",
"<mask>",
"string",
",",
"sourceURL",
"string",
",",
"persistScript",
"bool",
")",
"*",
"CompileScriptParams",
"{",
"return",
"&",
"CompileScriptParams",
"{",
"Expression",
":",
"expression",
",",
"SourceURL",
":",
"sourceURL",
",",
"PersistScript",
":",
"persistScript",
",",
"}",
"\n",
"}"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.