id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
22,300
all-22301
[ "SetBool", "is", "a", "wrapper", "around", "g_value_set_boolean", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "SetBool", "(", "val", "bool", ")", "{", "C", ".", "g_value_set_boolean", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "val", ")", ")", "\n", "}" ]
22,301
all-22302
[ "flushLog", "attempts", "to", "flush", "any", "pending", "logs", "to", "the", "appserver", ".", "It", "should", "not", "be", "called", "concurrently", "." ]
[ "func", "(", "c", "*", "context", ")", "flushLog", "(", "force", "bool", ")", "(", "flushed", "bool", ")", "{", "c", ".", "pendingLogs", ".", "Lock", "(", ")", "\n", "// Grab up to 30 MB. We can get away with up to 32 MB, but let's be cautious.", "n", ",", "rem"...
22,302
all-22303
[ "SetReadDeadline", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockClientServer", ")", "SetReadDeadline", "(", "arg0", "<mask>", ".", "Time", ")", "error", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "ret"...
22,303
all-22304
[ "buf", "returns", "the", "buffer", "of", "the", "current", "token", "." ]
[ "func", "(", "l", "*", "promlexer", ")", "buf", "(", ")", "[", "]", "byte", "{", "return", "l", ".", "b", "[", "l", ".", "<mask>", ":", "l", ".", "i", "]", "\n", "}" ]
22,304
all-22305
[ "Handler", "handles", "functions", "of", "type", "GoannaHandlerFunc" ]
[ "func", "<mask>", "(", "gf", "GoannaHandlerFunc", ")", "http", ".", "HandlerFunc", "{", "return", "func", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "gr", ":=", "&", "Request", "{", "Request", ":", "r", ...
22,305
all-22306
[ "MustV0", "retrieves", "the", "V0", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
[ "func", "(", "u", "AuthenticatedMessage", ")", "MustV0", "(", ")", "AuthenticatedMessageV0", "{", "val", ",", "<mask>", ":=", "u", ".", "GetV0", "(", ")", "\n\n", "if", "!", "ok", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "val"...
22,306
all-22307
[ "Remove", "a", "key", "from", "the", "node", "list" ]
[ "func", "(", "l", "*", "NodeList", ")", "Remove", "(", "key", "[", "]", "byte", ")", "*", "skiplist", ".", "Node", "{", "var", "prev", "*", "skiplist", ".", "<mask>", "\n", "node", ":=", "l", ".", "head", "\n", "for", "node", "!=", "nil", "{", ...
22,307
all-22308
[ "Check", "Schedulers", "It", "verifies", "your", "scheduler", "configuration", "and", "validates", "related", "confs", "." ]
[ "func", "checkScheduler", "(", ")", "error", "{", "if", "servers", ",", "err", ":=", "config", ".", "Get", "(", "\"", "\"", ")", ";", "err", "==", "nil", "&&", "servers", "!=", "nil", "{", "return", "<mask>", ".", "Errorf", "(", "`Using docker:servers ...
22,308
all-22309
[ "Process", "does", "the", "main", "job", ":", "It", "tries", "to", "get", "the", "value", "of", "Remaining", "rate", "just", "before", "the", "token", "gets", "reset", ".", "It", "does", "that", "more", "and", "more", "often", "(", "as", "the", "reset"...
[ "func", "(", "t", "TokenHandler", ")", "Process", "(", ")", "{", "lastRate", ",", "err", ":=", "t", ".", "getCoreRate", "(", ")", "\n", "if", "err", "!=", "nil", "{", "glog", ".", "Fatalf", "(", "\"", "\"", ",", "t", ".", "login", ",", "err", "...
22,309
all-22310
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SetFontSizesParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage9", "(", "&", "w", ",", "v", ")",...
22,310
all-22311
[ "GetColorOk", "returns", "a", "tuple", "with", "the", "Color", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "f", "*", "FreeTextDefinition", ")", "GetColorOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "f", "==", "nil", "||", "f", ".", "Color", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*",...
22,311
all-22312
[ "GetSizeFormat", "returns", "the", "SizeFormat", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "t", "*", "TraceServiceDefinition", ")", "GetSizeFormat", "(", ")", "string", "{", "if", "t", "==", "nil", "||", "t", ".", "SizeFormat", "==", "nil", "{", "<mask>", "\"", "\"", "\n", "}", "\n", "return", "*", "t", ".", "SizeFormat", "\n"...
22,312
all-22313
[ "Collect", "adds", "any", "non", "nil", "errors", "in", "args", "to", "the", "list", "." ]
[ "func", "(", "list", "*", "ErrorList", ")", "Collect", "(", "args", "...", "interface", "{", "}", ")", "{", "for", "_", ",", "a", ":=", "range", "args", "{", "if", "err", ",", "_", ":=", "a", ".", "(", "error", ")", ";", "err", "!=", "nil", "...
22,313
all-22314
[ "Health", "health", "checks", "pachd", "it", "returns", "an", "error", "if", "pachd", "isn", "t", "healthy", "." ]
[ "func", "(", "c", "APIClient", ")", "Health", "(", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "healthClient", ".", "Health", "(", "c", ".", "Ctx", "(", ")", ",", "&", "<mask>", ".", "Empty", "{", "}", ")", "\n", "return", "grpcutil", "...
22,314
all-22315
[ "Scan", "satisfy", "sql", ".", "Scanner", "interface", "." ]
[ "func", "(", "b", "*", "Bag", ")", "Scan", "(", "src", "interface", "{", "}", ")", "(", "err", "error", ")", "{", "<mask>", "t", ":=", "src", ".", "(", "type", ")", "{", "case", "[", "]", "byte", ":", "err", "=", "gob", ".", "NewDecoder", "("...
22,315
all-22316
[ "Sunday", "sunday" ]
[ "func", "(", "<mask>", "*", "Now", ")", "Sunday", "(", ")", "time", ".", "Time", "{", "t", ":=", "now", ".", "BeginningOfDay", "(", ")", "\n", "weekday", ":=", "int", "(", "t", ".", "Weekday", "(", ")", ")", "\n", "if", "weekday", "==", "0", "{...
22,316
all-22317
[ "GetTitle", "returns", "the", "Title", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "a", "*", "AlertValueDefinition", ")", "GetTitle", "(", ")", "<mask>", "{", "if", "a", "==", "nil", "||", "a", ".", "Title", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "a", ".", "Title", "\n", "}" ]
22,317
all-22318
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventChildNodeRemoved", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom63", "(", "&", "w", ",", "v", ")"...
22,318
all-22319
[ "flattenClusterOrchestrationInfo", "saves", "a", "ClusterOrchestrationInfo", "into", "the", "supplied", "ResourceData", "." ]
[ "func", "flattenClusterOrchestrationInfo", "(", "d", "*", "schema", ".", "ResourceData", ",", "obj", "*", "types", ".", "ClusterOrchestrationInfo", ")", "error", "{", "return", "structure", ".", "SetBatch", "(", "d", ",", "map", "[", "string", "]", "<mask>", ...
22,319
all-22320
[ "SetMarginRight", "is", "a", "wrapper", "around", "gtk_widget_set_margin_right", "()", "." ]
[ "func", "(", "v", "*", "Widget", ")", "SetMarginRight", "(", "margin", "int", ")", "{", "C", ".", "gtk_widget_set_margin_right", "(", "v", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "<mask>", ")", ")", "\n", "}" ]
22,320
all-22321
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "ResourceTiming", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork23", "(", "&", "r",...
22,321
all-22322
[ "SaveLastSync", "saves", "last", "sync", "time", "in", "Unix", "to", "a", "volume" ]
[ "func", "(", "c", "*", "Controller", ")", "SaveLastSync", "(", "lastSync", "time", ".", "Time", ")", "error", "{", "if", "c", ".", "lastSyncFallback", "==", "\"", "\"", "{", "return", "nil", "\n", "}", "\n\n", "lastSyncUnix", ":=", "strconv", ".", "For...
22,322
all-22323
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetBrowserSamplingProfileReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory12", ...
22,323
all-22324
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "CustomPreview", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime43", "(", "&", "r"...
22,324
all-22325
[ "NewDataFile", "returns", "a", "new", "file", "based", "data", "buffer" ]
[ "func", "NewDataFile", "(", "f", "*", "<mask>", ".", "File", ")", "(", "*", "Data", ",", "error", ")", "{", "d", ":=", "newData", "(", ")", "\n", "return", "d", ",", "handleError", "(", "C", ".", "gpgme_data_new_from_fd", "(", "&", "d", ".", "dh", ...
22,325
all-22326
[ "MiddlewareFunc", "makes", "AuthBasicMiddleware", "implement", "the", "Middleware", "interface", "." ]
[ "func", "(", "mw", "*", "AuthBasicMiddleware", ")", "MiddlewareFunc", "(", "handler", "HandlerFunc", ")", "HandlerFunc", "{", "if", "mw", ".", "Realm", "==", "\"", "\"", "{", "log", ".", "Fatal", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "mw", "...
22,326
all-22327
[ "Find", "a", "task", "by", "index", "path", "and", "redirect", "to", "the", "artifact", "on", "the", "most", "recent", "run", "with", "the", "given", "name", ".", "Note", "that", "multiple", "calls", "to", "this", "endpoint", "may", "return", "artifacts", ...
[ "func", "(", "index", "*", "Index", ")", "FindArtifactFromTask", "(", "indexPath", ",", "name", "string", ")", "error", "{", "cd", ":=", "tcclient", ".", "Client", "(", "*", "index", ")", "\n", "_", ",", "_", ",", "err", ":=", "(", "&", "cd", ")", ...
22,327
all-22328
[ "GetOrgProjects", "returns", "the", "list", "of", "projects", "under", "an", "org" ]
[ "func", "(", "f", "*", "FakeClient", ")", "GetOrgProjects", "(", "org", "string", ")", "(", "[", "]", "github", ".", "<mask>", ",", "error", ")", "{", "return", "f", ".", "RepoProjects", "[", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "org", ")",...
22,328
all-22329
[ "the", "_actual_", "close", "process", "." ]
[ "func", "(", "p", "*", "process", ")", "doClose", "(", ")", "{", "// this function is only be called once (protected by p.Lock()).", "// and it will panic (on closing channels) otherwise.", "close", "(", "p", ".", "closing", ")", "// signal that we're shutting down (Closing)", ...
22,329
all-22330
[ "/", "*", "func", "(", "r", "*", "Render", ")", "HTML", "(", "status", "int", "name", "string", "binding", "interface", "{}", "htmlOpt", "...", "HTMLRenderOptions", ")", "{", "opt", ":", "=", "r", ".", "prepareHTMLRenderOptions", "(", "htmlOpt", ")", "as...
[ "func", "(", "r", "*", "Render", ")", "HTML", "(", "status", "int", ",", "name", "string", ",", "binding", "interface", "{", "}", ",", "htmlOpt", "...", "HTMLRenderOptions", ")", "{", "out", ",", "err", ":=", "r", ".", "renderBytes", "(", "name", ","...
22,330
all-22331
[ "GetHashTreeTag", "is", "a", "convenience", "function", "to", "deserialize", "a", "HashTree", "from", "an", "tagged", "object", "in", "the", "object", "store", "." ]
[ "func", "GetHashTreeTag", "(", "pachClient", "*", "<mask>", ".", "APIClient", ",", "storageRoot", "string", ",", "treeRef", "*", "pfs", ".", "Tag", ")", "(", "HashTree", ",", "error", ")", "{", "return", "getHashTree", "(", "storageRoot", ",", "func", "(",...
22,331
all-22332
[ "dispatchEvent", "sends", "a", "WatchResponse", "to", "the", "appropriate", "watcher", "stream" ]
[ "func", "(", "w", "*", "watchGrpcStream", ")", "dispatchEvent", "(", "pbresp", "*", "pb", ".", "WatchResponse", ")", "bool", "{", "events", ":=", "make", "(", "[", "]", "*", "<mask>", ",", "len", "(", "pbresp", ".", "Events", ")", ")", "\n", "for", ...
22,332
all-22333
[ "AddRepoTags", "adds", "the", "specified", "tags", "to", "the", "destination", "s", "repoTags", "." ]
[ "func", "(", "d", "*", "Destination", ")", "AddRepoTags", "(", "tags", "[", "]", "reference", ".", "NamedTagged", ")", "{", "d", ".", "repoTags", "=", "<mask>", "(", "d", ".", "repoTags", ",", "tags", "...", ")", "\n", "}" ]
22,333
all-22334
[ "wait", "until", "more", "than", "n", "bytes", "have", "been", "written" ]
[ "func", "(", "c", "*", "<mask>", ")", "wait", "(", "n", "int64", ")", "{", "c", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "mu", ".", "Unlock", "(", ")", "\n", "for", "c", ".", "n", "<", "n", "{", "c", ".", "cond", ".", ...
22,334
all-22335
[ "WithAbortContext", "specifies", "the", "context", "for", "permanently", "aborting", "the", "transaction", "." ]
[ "func", "WithAbortContext", "(", "ctx", "context", ".", "<mask>", ")", "stmOption", "{", "return", "func", "(", "so", "*", "stmOptions", ")", "{", "so", ".", "ctx", "=", "ctx", "}", "\n", "}" ]
22,335
all-22336
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "HighlightNodeParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoOverlay11", "(", "&", "w", ",", "v", ...
22,336
all-22337
[ "LoadFromPath", "is", "a", "wrapper", "around", "gtk_css_provider_load_from_path", "()", "." ]
[ "func", "(", "v", "*", "CssProvider", ")", "LoadFromPath", "(", "<mask>", "string", ")", "error", "{", "cpath", ":=", "C", ".", "CString", "(", "path", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cpath", ")", ")", "\n...
22,337
all-22338
[ "ReceiveIssue", "is", "a", "wrapper", "on", "plugin", ".", "ReceiveIssue", "()" ]
[ "func", "(", "o", "*", "FakeCommentPluginWrapper", ")", "ReceiveIssue", "(", "issue", "sql", ".", "Issue", ")", "[", "]", "Point", "{", "// Pass through", "return", "o", ".", "plugin", ".", "ReceiveIssue", "(", "<mask>", ")", "\n", "}" ]
22,338
all-22339
[ "PutBlob", "writes", "contents", "of", "stream", "and", "returns", "data", "representing", "the", "result", "(", "with", "all", "data", "filled", "in", ")", ".", "inputInfo", ".", "Digest", "can", "be", "optionally", "provided", "if", "known", ";", "it", "...
[ "func", "(", "d", "*", "dockerImageDestination", ")", "PutBlob", "(", "ctx", "context", ".", "Context", ",", "stream", "io", ".", "Reader", ",", "inputInfo", "types", ".", "BlobInfo", ",", "cache", "types", ".", "BlobInfoCache", ",", "isConfig", "bool", ")...
22,339
all-22340
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "Cookie", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoHar12", "(", "&", "w", ",", "v", ")", "\n", "re...
22,340
all-22341
[ "draw", "multiple", "instances", "of", "a", "set", "of", "elements", "with", "offset", "applied", "to", "instanced", "attributes" ]
[ "func", "DrawElementsInstancedBaseInstance", "(", "mode", "uint32", ",", "<mask>", "int32", ",", "xtype", "uint32", ",", "indices", "unsafe", ".", "Pointer", ",", "instancecount", "int32", ",", "baseinstance", "uint32", ")", "{", "C", ".", "glowDrawElementsInstanc...
22,341
all-22342
[ "Flags", "that", "were", "not", "set", "via", "command", "-", "line", "arguments", "and", "have", "defaulted", ".", "It", "s", "smart", "enough", "to", "respect", "a", "flag", "that", "was", "set", "to", "the", "default", "value", "via", "command", "-", ...
[ "func", "defaultedFlags", "(", ")", "[", "]", "string", "{", "m", ":=", "make", "(", "map", "[", "string", "]", "bool", ")", "\n\n", "FlagSet", ".", "VisitAll", "(", "func", "(", "f", "*", "flag", ".", "Flag", ")", "{", "m", "[", "f", ".", "<ma...
22,342
all-22343
[ "NewDiscovery", "returns", "a", "new", "OpenStack", "Discoverer", "which", "periodically", "refreshes", "its", "targets", "." ]
[ "func", "NewDiscovery", "(", "conf", "*", "SDConfig", ",", "l", "log", ".", "Logger", ")", "(", "*", "refresh", ".", "Discovery", ",", "error", ")", "{", "r", ",", "err", ":=", "newRefresher", "(", "conf", ",", "l", ")", "\n", "if", "err", "!=", ...
22,343
all-22344
[ "New", "creates", "a", "new", "configured", "Vault", "factory", "." ]
[ "func", "New", "(", "config", "Config", ")", "(", "spec", ".", "VaultFactory", ",", "error", ")", "{", "newVaultFactory", ":=", "&", "vaultFactory", "{", "Config", ":", "config", ",", "}", "\n\n", "// Dependencies.", "if", "newVaultFactory", ".", "<mask>", ...
22,344
all-22345
[ "Must", "be", "called", "while", "appendLock", "is", "held", "." ]
[ "func", "(", "mf", "*", "manifestFile", ")", "rewrite", "(", ")", "error", "{", "// In Windows the files should be closed before doing a Rename.", "if", "err", ":=", "mf", ".", "fp", ".", "Close", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n"...
22,345
all-22346
[ "Compare", "returns", "result", "of", "comparison", "between", "two", "versions" ]
[ "func", "(", "v", "*", "DottedVersion", ")", "Compare", "(", "other", "*", "DottedVersion", ")", "int", "{", "<mask>", ":=", "compareInts", "(", "v", ".", "Major", ",", "other", ".", "Major", ")", "\n", "if", "result", "!=", "0", "{", "return", "resu...
22,346
all-22347
[ "HasQueryConfig", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "o", "*", "<mask>", ")", "HasQueryConfig", "(", ")", "bool", "{", "if", "o", "!=", "nil", "&&", "o", ".", "QueryConfig", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
22,347
all-22348
[ "ReadConsoleInput", "reads", "(", "and", "removes", ")", "data", "from", "the", "console", "input", "buffer", ".", "See", "https", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "library", "/", "windows", "/", "desktop", "/...
[ "func", "ReadConsoleInput", "(", "handle", "uintptr", ",", "buffer", "[", "]", "INPUT_RECORD", ",", "count", "*", "uint32", ")", "error", "{", "r1", ",", "r2", ",", "err", ":=", "readConsoleInputProc", ".", "Call", "(", "handle", ",", "uintptr", "(", "un...
22,348
all-22349
[ "resourceVSphereDatastoreClusterApplySDRSConfig", "applies", "the", "SDRS", "configuration", "to", "a", "datastore", "cluster", "." ]
[ "func", "resourceVSphereDatastoreClusterApplySDRSConfig", "(", "d", "*", "schema", ".", "ResourceData", ",", "meta", "interface", "{", "}", ",", "pod", "*", "object", ".", "StoragePod", ")", "error", "{", "// This is a no-op if there is no SDRS config changed", "if", ...
22,349
all-22350
[ "initState", "Initializes", "the", "Sponge", "State", ".", "The", "first", "512", "bits", "are", "set", "to", "zeros", "and", "the", "remainder", "receive", "Blake2b", "s", "IV", "as", "per", "Blake2b", "s", "specification", ".", "<b", ">", "Note", ":", ...
[ "func", "initState", "(", ")", "[", "]", "uint64", "{", "state", ":=", "make", "(", "[", "]", "uint64", ",", "16", ")", "\n", "state", "[", "8", "]", "=", "blake2bIV", "[", "0", "]", "\n", "<mask>", "[", "9", "]", "=", "blake2bIV", "[", "1", ...
22,350
all-22351
[ "trace", "is", "a", "helper", "function", "for", "TraceExternal", "and", "TraceGeneric", "you", "probably", "don", "t", "want", "to", "use", "it", "directly", "." ]
[ "func", "trace", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "fn", "func", "(", "Tx", ")", "error", ")", "*", "Trace", "{", "if", "tx", ",", "ok", ":=", "FromContext", "(", "ctx", ")", ";", "ok", "{", "err", ":=", "fn", "...
22,351
all-22352
[ "Close", "destroys", "the", "nodetable" ]
[ "func", "(", "nt", "*", "NodeTable", ")", "Close", "(", ")", "{", "nt", ".", "fastHTCount", "=", "0", "\n", "nt", ".", "slowHTCount", "=", "0", "\n", "nt", ".", "conflicts", "=", "0", "\n", "nt", ".", "fastHT", "=", "make", "(", "<mask>", "[", ...
22,352
all-22353
[ "CreateServerGroup", "creates", "a", "new", "server", "group", "It", "takes", "an", "instance", "of", "ServerGroupOptions", ".", "Not", "all", "attributes", "can", "be", "specified", "at", "create", "time", "(", "such", "as", "Id", "which", "is", "allocated", ...
[ "func", "(", "c", "*", "Client", ")", "CreateServerGroup", "(", "newServerGroup", "*", "ServerGroupOptions", ")", "(", "*", "ServerGroup", ",", "error", ")", "{", "group", ":=", "<mask>", "(", "ServerGroup", ")", "\n", "_", ",", "err", ":=", "c", ".", ...
22,353
all-22354
[ "rgb", "converts", "a", "color", "(", "used", "by", "draw2d", ")", "into", "3", "int", "(", "used", "by", "gofpdf", ")" ]
[ "func", "rgb", "(", "c", "color", ".", "<mask>", ")", "(", "int", ",", "int", ",", "int", ")", "{", "r", ",", "g", ",", "b", ",", "_", ":=", "c", ".", "RGBA", "(", ")", "\n", "return", "int", "(", "float64", "(", "r", ")", "*", "c255", ")...
22,354
all-22355
[ "doRequest", "creates", "and", "performs", "an", "http", "request", "." ]
[ "func", "(", "c", "*", "Client", ")", "doRequest", "(", "host", "*", "URI", ",", "method", ",", "path", "string", ",", "headers", "map", "[", "string", "]", "string", ",", "reader", "<mask>", ".", "Reader", ")", "(", "*", "http", ".", "Response", "...
22,355
all-22356
[ "Set", "parses", "and", "updates", "v", "from", "the", "given", "version", "string", ".", "Implements", "flag", ".", "Value" ]
[ "func", "(", "v", "*", "Version", ")", "Set", "(", "version", "string", ")", "error", "{", "metadata", ":=", "splitOff", "(", "&", "version", ",", "\"", "\"", ")", "\n", "preRelease", ":=", "PreRelease", "(", "splitOff", "(", "&", "version", ",", "\"...
22,356
all-22357
[ "DeepCopyObject", "implements", "the", "runtime", ".", "Object", "interface" ]
[ "func", "(", "in", "*", "ResourcesConfigObject", ")", "DeepCopyObject", "(", ")", "runtime", ".", "<mask>", "{", "if", "c", ":=", "in", ".", "deepCopy", "(", ")", ";", "c", "!=", "nil", "{", "return", "c", "\n", "}", "\n", "return", "nil", "\n", "}...
22,357
all-22358
[ "Create", "creates", "a", "new", "file", "with", "b", "bytes", "." ]
[ "func", "Create", "(", "filename", "string", ",", "b", "[", "]", "byte", ")", "(", "err", "error", ")", "{", "file", ",", "err", ":=", "os", ".", "Create", "(", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n...
22,358
all-22359
[ "InitHtmlTemplates", "initialzes", "a", "series", "of", "HTML", "templates", "in", "the", "directory", "pattern", "." ]
[ "func", "InitHtmlTemplates", "(", "pattern", "string", ")", "(", "err", "error", ")", "{", "htmlTemp", ".", "<mask>", ",", "err", "=", "html", ".", "ParseGlob", "(", "pattern", ")", "\n", "return", "\n", "}" ]
22,359
all-22360
[ "/", "*", "external", "address", "helpers", "UPNP", "external", "address", "discovery", "&", "port", "mapping" ]
[ "func", "getUPNPExternalAddress", "(", "externalPort", ",", "internalPort", "int", ")", "*", "NetAddress", "{", "log", ".", "Info", "(", "\"", "\"", ")", "\n", "nat", ",", "err", ":=", "upnp", ".", "Discover", "(", ")", "\n", "if", "err", "!=", "nil", ...
22,360
all-22361
[ "schemaHostPortGroupSpec", "returns", "schema", "items", "for", "resources", "that", "need", "to", "work", "with", "HostPortGroupSpec", "such", "as", "port", "groups", "." ]
[ "func", "schemaHostPortGroupSpec", "(", ")", "map", "[", "string", "]", "*", "schema", ".", "Schema", "{", "s", ":=", "map", "[", "string", "]", "*", "schema", ".", "Schema", "{", "// HostPortGroupSpec", "\"", "\"", ":", "{", "Type", ":", "schema", "."...
22,361
all-22362
[ "WriteObject", "implements", "ObjectCodec", "." ]
[ "func", "(", "VarintObjectCodec", ")", "WriteObject", "(", "<mask>", "io", ".", "Writer", ",", "obj", "interface", "{", "}", ")", "error", "{", "data", ",", "err", ":=", "json", ".", "Marshal", "(", "obj", ")", "\n", "if", "err", "!=", "nil", "{", ...
22,362
all-22363
[ "RemoveUnits", "removes", "n", "units", "from", "the", "app", ".", "It", "s", "a", "process", "composed", "of", "multiple", "steps", ":", "1", ".", "Remove", "units", "from", "the", "provisioner", "2", ".", "Update", "quota" ]
[ "func", "(", "app", "*", "App", ")", "RemoveUnits", "(", "n", "uint", ",", "process", "string", ",", "w", "<mask>", ".", "Writer", ")", "error", "{", "prov", ",", "err", ":=", "app", ".", "getProvisioner", "(", ")", "\n", "if", "err", "!=", "nil", ...
22,363
all-22364
[ "CreateJob", "creates", "and", "runs", "a", "job", "in", "PPS", ".", "This", "function", "is", "mostly", "useful", "internally", "users", "should", "generally", "run", "work", "by", "creating", "pipelines", "as", "well", "." ]
[ "func", "(", "c", "APIClient", ")", "CreateJob", "(", "pipeline", "string", ",", "outputCommit", "*", "pfs", ".", "Commit", ")", "(", "*", "pps", ".", "Job", ",", "error", ")", "{", "job", ",", "err", ":=", "c", ".", "PpsAPIClient", ".", "CreateJob",...
22,364
all-22365
[ "if", "started", "with", "manual", "TLS", "stores", "TLS", "assets", "from", "tester", "/", "client", "to", "disk", "before", "starting", "etcd", "process" ]
[ "func", "(", "srv", "*", "Server", ")", "saveTLSAssets", "(", ")", "error", "{", "if", "srv", ".", "Member", ".", "PeerCertPath", "!=", "\"", "\"", "{", "if", "srv", ".", "Member", ".", "PeerCertData", "==", "\"", "\"", "{", "return", "fmt", ".", "...
22,365
all-22366
[ "Scan", "implements", "the", "database", "/", "sql", "/", "Scanner", "interface", "." ]
[ "func", "(", "d", "*", "Decimal", ")", "Scan", "(", "src", "interface", "{", "}", ")", "error", "{", "b", ",", "<mask>", ":=", "src", ".", "(", "[", "]", "byte", ")", "\n", "if", "!", "ok", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\""...
22,366
all-22367
[ "SafeLoad", "is", "a", "wrapper", "around", "Load", "()", "that", "does", "not", "error", "when", "invalid", "keys", "are", "found", "and", "just", "logs", "warnings", "instead", ".", "Other", "kinds", "of", "errors", "are", "still", "returned", "." ]
[ "func", "SafeLoad", "(", "schema", "Schema", ",", "<mask>", "map", "[", "string", "]", "string", ")", "(", "Map", ",", "error", ")", "{", "m", ",", "err", ":=", "Load", "(", "schema", ",", "values", ")", "\n", "if", "err", "!=", "nil", "{", "erro...
22,367
all-22368
[ "$", "{", "LXD_DIR", "}", "/", "storage", "-", "pools", "/", "<pool", ">", "/", "custom", "-", "snapshots", "/", "<custom", "volume", "name", ">", "/", "<snapshot", "name", ">" ]
[ "func", "getStoragePoolVolumeSnapshotMountPoint", "(", "poolName", "string", ",", "snapshotName", "string", ")", "string", "{", "return", "<mask>", ".", "VarPath", "(", "\"", "\"", ",", "poolName", ",", "\"", "\"", ",", "snapshotName", ")", "\n", "}" ]
22,368
all-22369
[ "ReleaseOne", "will", "release", "a", "resource", "as", "well", "as", "leased", "resources", "associated", "to", "it" ]
[ "func", "(", "c", "*", "Client", ")", "ReleaseOne", "(", "name", ",", "dest", "string", ")", "(", "allErrors", "error", ")", "{", "res", ",", "err", ":=", "c", ".", "getResource", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "allErrors", ...
22,369
all-22370
[ "PrivateKey", "is", "an", "Option", "for", "setting", "the", "identity", "s", "private", "key", "." ]
[ "func", "PrivateKey", "(", "<mask>", "crypto", ".", "Signer", ")", "Option", "{", "return", "func", "(", "c", "*", "configuration", ")", "{", "c", ".", "priv", "=", "&", "value", "\n", "}", "\n", "}" ]
22,370
all-22371
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "Bucket", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20", "(", "&", "r", ","...
22,371
all-22372
[ "Panics", "if", "error", "." ]
[ "func", "(", "cdc", "*", "Codec", ")", "MustUnmarshalBinaryLengthPrefixed", "(", "bz", "[", "]", "byte", ",", "ptr", "<mask>", "{", "}", ")", "{", "err", ":=", "cdc", ".", "UnmarshalBinaryLengthPrefixed", "(", "bz", ",", "ptr", ")", "\n", "if", "err", ...
22,372
all-22373
[ "Error", "call", "UI", ".", "Error", "to", "write", ".", "ErrorPrefix", "is", "used", "to", "prefix", "the", "message", "." ]
[ "func", "(", "ui", "*", "PrefixUI", ")", "Error", "(", "message", "string", ")", "{", "if", "ui", ".", "ErrorPrefix", "==", "\"", "\"", "{", "//Lets keep the space if they want one", "message", "=", "ui", ".", "ErrorPrefix", "+", "message", "\n", "}", "els...
22,373
all-22374
[ "MarshalEasyJSON", "satisfies", "easyjson", ".", "Marshaler", "." ]
[ "func", "(", "t", "CachedResponseType", ")", "MarshalEasyJSON", "(", "out", "*", "jwriter", ".", "Writer", ")", "{", "<mask>", ".", "String", "(", "string", "(", "t", ")", ")", "\n", "}" ]
22,374
all-22375
[ "year", ":", "set", "most", "sig", "bit", "month", "0", "based" ]
[ "func", "writeDate", "(", "wr", "*", "bufio", ".", "Writer", ",", "t", "time", ".", "Time", ")", "{", "//store in utc", "utc", ":=", "t", ".", "In", "(", "time", ".", "UTC", ")", "\n\n", "year", ",", "<mask>", ",", "day", ":=", "utc", ".", "Date"...
22,375
all-22376
[ "setupStreamContext", "is", "used", "to", "create", "a", "new", "stream", "context", ".", "This", "should", "be", "called", "with", "the", "stream", "lock", "held", "." ]
[ "func", "(", "n", "*", "NetworkTransport", ")", "setupStreamContext", "(", ")", "{", "ctx", ",", "cancel", ":=", "<mask>", ".", "WithCancel", "(", "context", ".", "Background", "(", ")", ")", "\n", "n", ".", "streamCtx", "=", "ctx", "\n", "n", ".", "...
22,376
all-22377
[ "calculateBlocks", "determines", "if", "a", "PR", "should", "be", "blocked", "and", "returns", "the", "summary", "describing", "the", "block", "." ]
[ "func", "calculateBlocks", "(", "changes", "[", "]", "github", ".", "PullRequestChange", ",", "blockades", "[", "]", "blockade", ")", "summary", "{", "sum", ":=", "make", "(", "summary", ")", "\n", "for", "_", ",", "change", ":=", "range", "<mask>", "{",...
22,377
all-22378
[ "native", "returns", "a", "pointer", "to", "the", "underlying", "GtkStack", "." ]
[ "func", "(", "v", "*", "Stack", ")", "native", "(", ")", "*", "C", ".", "GtkStack", "{", "if", "v", "==", "nil", "||", "v", ".", "GObject", "==", "nil", "{", "<mask>", "nil", "\n", "}", "\n", "p", ":=", "unsafe", ".", "Pointer", "(", "v", "."...
22,378
all-22379
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "NetworkOptionGroupAttachment", ")", "Locator", "(", "api", "*", "API", ")", "*", "NetworkOptionGroupAttachmentLocator", "{", "for", "_", ",", "l", ":=", "<mask>", "r", ".", "Links", "{", "if", "l", "[", "\"", "\"", "]", "==", "\...
22,379
all-22380
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "DeliverPushMessageParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker17", ...
22,380
all-22381
[ "Send", "a", "request", "to", "the", "broker", "to", "leave", "the", "group", "on", "failes", "rebalance", "()", "and", "on", "Close", "()" ]
[ "func", "(", "c", "*", "Consumer", ")", "leaveGroup", "(", ")", "error", "{", "broker", ",", "err", ":=", "c", ".", "<mask>", ".", "Coordinator", "(", "c", ".", "groupID", ")", "\n", "if", "err", "!=", "nil", "{", "c", ".", "closeCoordinator", "(",...
22,381
all-22382
[ "MarshalJSON", "returns", "the", "URI", "as", "JSON" ]
[ "func", "(", "u", "URI", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "<mask>", "w", "jwriter", ".", "Writer", "\n", "u", ".", "MarshalEasyJSON", "(", "&", "w", ")", "\n", "return", "w", ".", "BuildBytes", "(", ")"...
22,382
all-22383
[ "GridNew", "()", "is", "a", "wrapper", "around", "gtk_grid_new", "()", "." ]
[ "func", "GridNew", "(", ")", "(", "*", "Grid", ",", "<mask>", ")", "{", "c", ":=", "C", ".", "gtk_grid_new", "(", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "obj", ":=", "glib", ".", "Take", "(",...
22,383
all-22384
[ "PrivateKey", "returns", "the", "stored", "private", "key", "for", "the", "keystore", "." ]
[ "func", "(", "ks", "*", "Keystore", ")", "PrivateKey", "(", ")", "(", "crypto", ".", "PrivateKey", ",", "bool", ")", "{", "ks", ".", "rw", ".", "RLock", "(", ")", "\n", "defer", "ks", ".", "rw", ".", "RUnlock", "(", ")", "\n", "return", "ks", "...
22,384
all-22385
[ "SetVisible", "is", "a", "wrapper", "around", "gtk_widget_set_visible", "()", "." ]
[ "func", "(", "v", "*", "Widget", ")", "SetVisible", "(", "<mask>", "bool", ")", "{", "C", ".", "gtk_widget_set_visible", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "visible", ")", ")", "\n", "}" ]
22,385
all-22386
[ "RefreshImage", "requests", "that", "LXD", "issues", "an", "image", "refresh" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "RefreshImage", "(", "fingerprint", "string", ")", "(", "Operation", ",", "error", ")", "{", "if", "!", "r", ".", "HasExtension", "(", "\"", "\"", ")", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", ...
22,386
all-22387
[ "Implements", "Err" ]
[ "func", "(", "e", "*", "err", ")", "LogString", "(", ")", "string", "{", "return", "concatArgs", "(", "\"", "\"", ",", "\"", "\"", ",", "e", ".", "time", ",", "\"", "\"", ",", "e", ".", "wrappedErrStr", "(", ")", ",", "\"", "\"", "+", "concatAr...
22,387
all-22388
[ "HasIndex", "returns", "true", "if", "the", "given", "index", "is", "in", "the", "schema", "." ]
[ "func", "(", "s", "*", "Schema", ")", "HasIndex", "(", "indexName", "string", ")", "bool", "{", "_", ",", "ok", ":=", "s", ".", "indexes", "[", "indexName", "]", "\n", "return", "<mask>", "\n", "}" ]
22,388
all-22389
[ "HasTitle", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "s", "*", "ScreenboardLite", ")", "HasTitle", "(", ")", "bool", "{", "if", "s", "!=", "nil", "&&", "s", ".", "Title", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
22,389
all-22390
[ "Domains", "lists", "the", "domains", "on", "the", "server" ]
[ "func", "(", "cgp", "*", "CGP", ")", "Domains", "(", ")", "(", "[", "]", "*", "Domain", ",", "error", ")", "{", "<mask>", "vl", "valueList", "\n", "err", ":=", "cgp", ".", "request", "(", "listDomains", "{", "}", ",", "&", "vl", ")", "\n", "if"...
22,390
all-22391
[ "GroupByFilter", "creates", "a", "GroupBy", "query", "with", "the", "given", "filter", "and", "Rows", "queries" ]
[ "func", "(", "idx", "*", "<mask>", ")", "GroupByFilter", "(", "filterQuery", "*", "PQLRowQuery", ",", "rowsQueries", "...", "*", "PQLRowsQuery", ")", "*", "PQLBaseQuery", "{", "if", "len", "(", "rowsQueries", ")", "<", "1", "{", "return", "NewPQLBaseQuery", ...
22,391
all-22392
[ "PERFORMANCE", ":", "The", "code", "of", "this", "function", "is", "complicated", "because", "we", "try", "to", "call", "the", "underlying", "drivers", "as", "less", "as", "possible", "to", "get", "the", "information", "we", "need", "." ]
[ "func", "attemptGetHostState", "(", "h", "*", "host", ".", "Host", ",", "stateQueryChan", "chan", "<-", "HostListItem", ")", "{", "requestBeginning", ":=", "time", ".", "Now", "(", ")", "\n", "url", ":=", "\"", "\"", "\n", "currentState", ":=", "state", ...
22,392
all-22393
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventWebSocketCreated", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork45", "(", "&...
22,393
all-22394
[ "/", "*", "Frame", "returns", "a", "path", "to", "the", "given", "frame", "in", "the", "sequence", ".", "Integer", "or", "string", "digits", "are", "treated", "as", "a", "frame", "number", "and", "padding", "is", "applied", "all", "other", "values", "are...
[ "func", "(", "s", "*", "FileSequence", ")", "Frame", "(", "frame", "interface", "{", "}", ")", "(", "string", ",", "error", ")", "{", "var", "zframe", "string", "\n", "var", "isInt", "bool", "\n\n", "if", "s", ".", "frameSet", "!=", "nil", "{", "sw...
22,394
all-22395
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "ShapeOutsideInfo", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom1", "(", "&", "w", ",", "v", ")", "\...
22,395
all-22396
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SetGeolocationOverrideParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoEmulation7", "(", "&", "w", ",", ...
22,396
all-22397
[ "Next", "waits", "for", "the", "next", "record", "and", "returns", "that", "." ]
[ "func", "(", "s", "*", "PubSubSubscription", ")", "Next", "(", ")", "(", "*", "<mask>", ",", "error", ")", "{", "if", "s", ".", "resp", ".", "Error", "!=", "nil", "{", "return", "nil", ",", "s", ".", "resp", ".", "Error", "\n", "}", "\n\n", "d"...
22,397
all-22398
[ "SetShowFallback", "()", "is", "a", "wrapper", "around", "gtk_app_chooser_widget_set_show_fallback", "()", "." ]
[ "func", "(", "v", "*", "AppChooserWidget", ")", "SetShowFallback", "(", "setting", "bool", ")", "{", "C", ".", "gtk_app_chooser_widget_set_show_fallback", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "<mask>", ")", ")", "\n", "}" ]
22,398
all-22399
[ "DialTimeout", "dials", "the", "given", "TCP", "addr", "using", "tcp4", "using", "the", "given", "timeout", ".", "This", "function", "has", "the", "following", "additional", "features", "comparing", "to", "net", ".", "Dial", ":", "*", "It", "reduces", "load"...
[ "func", "(", "d", "*", "TCPDialer", ")", "DialTimeout", "(", "addr", "string", ",", "timeout", "time", ".", "Duration", ")", "(", "net", ".", "Conn", ",", "error", ")", "{", "return", "d", ".", "dial", "(", "addr", ",", "<mask>", ",", "timeout", ")...
22,399
all-22400
[ "DebugFunc", "outputs", "Debug", "level", "log", "returned", "from", "the", "function" ]
[ "func", "(", "g", "*", "Glg", ")", "DebugFunc", "(", "f", "func", "(", ")", "string", ")", "error", "{", "if", "g", ".", "isModeEnable", "(", "DEBG", ")", "{", "return", "g", ".", "<mask>", "(", "DEBG", ",", "\"", "\"", ",", "f", "(", ")", ")...