id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
sequencelengths
1
418
pl_tokens
sequencelengths
22
4.98k
23,700
all-23701
[ "AllENIAttachments", "returns", "all", "the", "enis", "managed", "by", "ecs", "on", "the", "instance" ]
[ "func", "(", "state", "*", "DockerTaskEngineState", ")", "AllENIAttachments", "(", ")", "[", "]", "*", "apieni", ".", "ENIAttachment", "{", "state", ".", "<mask>", ".", "RLock", "(", ")", "\n", "defer", "state", ".", "lock", ".", "RUnlock", "(", ")", "\n\n", "return", "state", ".", "allENIAttachmentsUnsafe", "(", ")", "\n", "}" ]
23,701
all-23702
[ "ListZones", ":", "Method", "returns", "all", "enabled", "zones", "from", "PowerDNS", "ref", ":", "https", ":", "//", "doc", ".", "powerdns", ".", "com", "/", "authoritative", "/", "http", "-", "api", "/", "zone", ".", "html#get", "--", "servers", "-", "server_id", "-", "zones" ]
[ "func", "(", "c", "*", "PDNSAPIClient", ")", "ListZones", "(", ")", "(", "zones", "[", "]", "pgo", ".", "Zone", ",", "resp", "*", "http", ".", "Response", ",", "err", "error", ")", "{", "for", "i", ":=", "0", ";", "i", "<", "retryLimit", ";", "i", "++", "{", "zones", ",", "resp", ",", "err", "=", "c", ".", "client", ".", "ZonesApi", ".", "ListZones", "(", "c", ".", "authCtx", ",", "defaultServerID", ")", "\n", "if", "err", "!=", "nil", "{", "<mask>", ".", "Debugf", "(", "\"", "\"", ",", "err", ")", "\n", "log", ".", "Debugf", "(", "\"", "\"", ",", "i", ")", "\n", "time", ".", "Sleep", "(", "retryAfterTime", "*", "(", "1", "<<", "uint", "(", "i", ")", ")", ")", "\n", "continue", "\n", "}", "\n", "return", "zones", ",", "resp", ",", "err", "\n", "}", "\n\n", "log", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "return", "zones", ",", "resp", ",", "err", "\n\n", "}" ]
23,702
all-23703
[ "Do", "executes", "HeapProfiler", ".", "addInspectedHeapObject", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "AddInspectedHeapObjectParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandAddInspectedHeapObject", ",", "p", ",", "nil", ")", "\n", "}" ]
23,703
all-23704
[ "poll", "queries", "the", "Consul", "instance", "for", "data", "using", "the", "fetch", "function", "but", "also", "accounts", "for", "interrupts", "on", "the", "interrupt", "channel", ".", "This", "allows", "the", "poll", "function", "to", "be", "fired", "in", "a", "goroutine", "but", "then", "halted", "even", "if", "the", "fetch", "function", "is", "in", "the", "middle", "of", "a", "blocking", "query", "." ]
[ "func", "(", "v", "*", "View", ")", "poll", "(", "viewCh", "chan", "<-", "*", "View", ",", "errCh", "chan", "<-", "error", ")", "{", "var", "retries", "int", "\n\n", "for", "{", "doneCh", ":=", "make", "(", "chan", "struct", "{", "}", ",", "1", ")", "\n", "successCh", ":=", "make", "(", "chan", "struct", "{", "}", ",", "1", ")", "\n", "fetchErrCh", ":=", "make", "(", "chan", "error", ",", "1", ")", "\n", "go", "v", ".", "fetch", "(", "doneCh", ",", "successCh", ",", "fetchErrCh", ")", "\n\n", "WAIT", ":", "select", "{", "case", "<-", "doneCh", ":", "// Reset the retry to avoid exponentially incrementing retries when we", "// have some successful requests", "retries", "=", "0", "\n\n", "log", ".", "Printf", "(", "\"", "\"", ",", "v", ".", "dependency", ")", "\n", "select", "{", "case", "<-", "v", ".", "stopCh", ":", "return", "\n", "case", "viewCh", "<-", "v", ":", "}", "\n\n", "// If we are operating in once mode, do not loop - we received data at", "// least once which is the API promise here.", "if", "v", ".", "once", "{", "return", "\n", "}", "\n", "case", "<-", "successCh", ":", "// We successfully received a non-error response from the server. This", "// does not mean we have data (that's dataCh's job), but rather this", "// just resets the counter indicating we communicated successfully. For", "// example, Consul make have an outage, but when it returns, the view", "// is unchanged. We have to reset the counter retries, but not update the", "// actual template.", "log", ".", "Printf", "(", "\"", "\"", ",", "v", ".", "dependency", ")", "\n", "retries", "=", "0", "\n", "goto", "WAIT", "\n", "case", "err", ":=", "<-", "fetchErrCh", ":", "if", "v", ".", "retryFunc", "!=", "nil", "{", "retry", ",", "sleep", ":=", "v", ".", "retryFunc", "(", "retries", ")", "\n", "if", "retry", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "err", ",", "retries", "+", "1", ",", "sleep", ")", "\n", "select", "{", "case", "<-", "<mask>", ".", "After", "(", "sleep", ")", ":", "retries", "++", "\n", "continue", "\n", "case", "<-", "v", ".", "stopCh", ":", "return", "\n", "}", "\n", "}", "\n", "}", "\n\n", "log", ".", "Printf", "(", "\"", "\"", ",", "err", ")", "\n\n", "// Push the error back up to the watcher", "select", "{", "case", "<-", "v", ".", "stopCh", ":", "return", "\n", "case", "errCh", "<-", "err", ":", "return", "\n", "}", "\n", "case", "<-", "v", ".", "stopCh", ":", "log", ".", "Printf", "(", "\"", "\"", ",", "v", ".", "dependency", ")", "\n", "return", "\n", "}", "\n", "}", "\n", "}" ]
23,704
all-23705
[ "CreatePassiveOffer", "creates", "a", "new", "passive", "offer" ]
[ "func", "CreatePassiveOffer", "(", "rate", "Rate", ",", "amount", "Amount", ")", "(", "result", "ManageOfferBuilder", ")", "{", "return", "ManageOffer", "(", "true", ",", "rate", ",", "<mask>", ")", "\n", "}" ]
23,705
all-23706
[ "Accept", "accepts", "TCP", "connection", "sets", "keep", "alive", "and", "checks", "if", "a", "client", "requested", "an", "encrypted", "connection", "." ]
[ "func", "(", "l", "TLSListener", ")", "Accept", "(", ")", "(", "net", ".", "Conn", ",", "error", ")", "{", "c", ",", "err", ":=", "l", ".", "AcceptTCP", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "c", ".", "SetKeepAlive", "(", "true", ")", "\n", "c", ".", "SetKeepAlivePeriod", "(", "3", "*", "time", ".", "Minute", ")", "\n\n", "b", ":=", "make", "(", "[", "]", "byte", ",", "1", ")", "\n", "_", ",", "err", "=", "c", ".", "Read", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "c", ".", "Close", "(", ")", "\n", "if", "err", "!=", "io", ".", "EOF", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "con", ":=", "&", "conn", "{", "Conn", ":", "c", ",", "b", ":", "b", "[", "0", "]", ",", "e", ":", "err", ",", "f", ":", "true", ",", "}", "\n\n", "if", "b", "[", "0", "]", "==", "22", "{", "return", "tls", ".", "<mask>", "(", "con", ",", "l", ".", "TLSConfig", ")", ",", "nil", "\n", "}", "\n\n", "return", "con", ",", "nil", "\n", "}" ]
23,706
all-23707
[ "return", "a", "string", "describing", "the", "current", "GL", "connection" ]
[ "func", "GetString", "(", "name", "uint32", ")", "*", "uint8", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpGetString", ",", "1", ",", "uintptr", "(", "<mask>", ")", ",", "0", ",", "0", ")", "\n", "return", "(", "*", "uint8", ")", "(", "unsafe", ".", "Pointer", "(", "ret", ")", ")", "\n", "}" ]
23,707
all-23708
[ "MustGetBool", "fetches", "the", "config", "and", "parses", "it", "into", "a", "bool", ".", "Panics", "on", "failure", "." ]
[ "func", "(", "c", "*", "cachedLoader", ")", "MustGetBool", "(", "key", "string", ")", "bool", "{", "b", ",", "err", ":=", "c", ".", "Get", "(", "key", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "key", ",", "err", ")", ")", "\n", "}", "\n", "<mask>", "ret", "bool", "\n", "err", "=", "json", ".", "Unmarshal", "(", "b", ",", "&", "ret", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "key", ",", "err", ")", ")", "\n", "}", "\n", "return", "ret", "\n", "}" ]
23,708
all-23709
[ "String", "returns", "a", "string", "representation", "of", "Item" ]
[ "func", "(", "item", "*", "Item", ")", "<mask>", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "item", ".", "Key", "(", ")", ",", "item", ".", "Version", "(", ")", ",", "item", ".", "meta", ")", "\n", "}" ]
23,709
all-23710
[ "PrivateAttrKeys", "returns", "a", "sorted", "list", "of", "private", "attribute", "names", "." ]
[ "func", "(", "r", "*", "Rule", ")", "PrivateAttrKeys", "(", ")", "[", "]", "string", "{", "<mask>", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "r", ".", "private", ")", ")", "\n", "for", "k", ":=", "range", "r", ".", "private", "{", "keys", "=", "append", "(", "keys", ",", "k", ")", "\n", "}", "\n", "sort", ".", "Strings", "(", "keys", ")", "\n", "return", "keys", "\n", "}" ]
23,710
all-23711
[ "ErrorHandler", "sets", "the", "function", "called", "when", "an", "error", "happens", "when", "sending", "metrics", "(", "e", ".", "g", ".", "the", "StatsD", "daemon", "is", "not", "listening", "anymore", ")", ".", "By", "default", "these", "errors", "are", "ignored", ".", "This", "option", "is", "ignored", "in", "Client", ".", "Clone", "()", "." ]
[ "func", "ErrorHandler", "(", "h", "func", "(", "<mask>", ")", ")", "Option", "{", "return", "Option", "(", "func", "(", "c", "*", "config", ")", "{", "c", ".", "Conn", ".", "ErrorHandler", "=", "h", "\n", "}", ")", "\n", "}" ]
23,711
all-23712
[ "GetQuality", "()", "is", "a", "wrapper", "around", "gtk_print_settings_get_quality", "()", "." ]
[ "func", "(", "ps", "*", "PrintSettings", ")", "GetQuality", "(", ")", "PrintQuality", "{", "c", ":=", "C", ".", "gtk_print_settings_get_quality", "(", "<mask>", ".", "native", "(", ")", ")", "\n", "return", "PrintQuality", "(", "c", ")", "\n", "}" ]
23,712
all-23713
[ "servicesFunc", "returns", "or", "accumulates", "catalog", "services", "dependencies", "." ]
[ "func", "servicesFunc", "(", "b", "*", "Brain", ",", "used", ",", "missing", "*", "dep", ".", "Set", ")", "func", "(", "...", "string", ")", "(", "[", "]", "*", "dep", ".", "CatalogSnippet", ",", "error", ")", "{", "return", "func", "(", "s", "...", "string", ")", "(", "[", "]", "*", "dep", ".", "CatalogSnippet", ",", "error", ")", "{", "<mask>", ":=", "[", "]", "*", "dep", ".", "CatalogSnippet", "{", "}", "\n\n", "d", ",", "err", ":=", "dep", ".", "NewCatalogServicesQuery", "(", "strings", ".", "Join", "(", "s", ",", "\"", "\"", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "used", ".", "Add", "(", "d", ")", "\n\n", "if", "value", ",", "ok", ":=", "b", ".", "Recall", "(", "d", ")", ";", "ok", "{", "return", "value", ".", "(", "[", "]", "*", "dep", ".", "CatalogSnippet", ")", ",", "nil", "\n", "}", "\n\n", "missing", ".", "Add", "(", "d", ")", "\n\n", "return", "result", ",", "nil", "\n", "}", "\n", "}" ]
23,713
all-23714
[ "SetActivatesDefault", "()", "is", "a", "wrapper", "around", "gtk_entry_set_activates_default", "()", "." ]
[ "func", "(", "v", "*", "Entry", ")", "SetActivatesDefault", "(", "setting", "bool", ")", "{", "C", ".", "gtk_entry_set_activates_default", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "<mask>", ")", ")", "\n", "}" ]
23,714
all-23715
[ "Start", "-", "helper", "method", "to", "serve", "a", "network", "bus", "service" ]
[ "func", "(", "networkBus", "*", "NetworkBus", ")", "Start", "(", ")", "error", "{", "var", "err", "error", "\n", "<mask>", ":=", "networkBus", ".", "service", "\n", "clientService", ":=", "networkBus", ".", "Client", ".", "service", "\n", "serverService", ":=", "networkBus", ".", "Server", ".", "service", "\n", "if", "!", "service", ".", "started", "{", "server", ":=", "rpc", ".", "NewServer", "(", ")", "\n", "server", ".", "RegisterName", "(", "\"", "\"", ",", "serverService", ")", "\n", "server", ".", "RegisterName", "(", "\"", "\"", ",", "clientService", ")", "\n", "server", ".", "HandleHTTP", "(", "networkBus", ".", "path", ",", "\"", "\"", "+", "networkBus", ".", "path", ")", "\n", "l", ",", "e", ":=", "net", ".", "Listen", "(", "\"", "\"", ",", "networkBus", ".", "address", ")", "\n", "if", "e", "!=", "nil", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "e", ")", "\n", "}", "\n", "service", ".", "wg", ".", "Add", "(", "1", ")", "\n", "go", "http", ".", "Serve", "(", "l", ",", "nil", ")", "\n", "}", "else", "{", "err", "=", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "err", "\n", "}" ]
23,715
all-23716
[ "AppendPage", "()", "is", "a", "wrapper", "around", "gtk_notebook_append_page", "()", "." ]
[ "func", "(", "v", "*", "Notebook", ")", "AppendPage", "(", "<mask>", "IWidget", ",", "tabLabel", "IWidget", ")", "int", "{", "cTabLabel", ":=", "nullableWidget", "(", "tabLabel", ")", "\n", "c", ":=", "C", ".", "gtk_notebook_append_page", "(", "v", ".", "native", "(", ")", ",", "child", ".", "toWidget", "(", ")", ",", "cTabLabel", ")", "\n", "return", "int", "(", "c", ")", "\n", "}" ]
23,716
all-23717
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "Layer", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree14", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
23,717
all-23718
[ "UpdateConfig", "updates", "a", "given", "if", "it", "exists", "or", "fail", "otherwise" ]
[ "func", "(", "s", "*", "<mask>", ")", "UpdateConfig", "(", "conf", "common", ".", "ResourcesConfig", ")", "error", "{", "return", "s", ".", "configs", ".", "Update", "(", "conf", ")", "\n", "}" ]
23,718
all-23719
[ "NewFromEnv", "returns", "an", "*", "Index", "configured", "from", "environment", "variables", ".", "The", "root", "URL", "is", "taken", "from", "TASKCLUSTER_PROXY_URL", "if", "set", "to", "a", "non", "-", "empty", "string", "otherwise", "from", "TASKCLUSTER_ROOT_URL", "if", "set", "otherwise", "the", "empty", "string", ".", "The", "credentials", "are", "taken", "from", "environment", "variables", ":", "TASKCLUSTER_CLIENT_ID", "TASKCLUSTER_ACCESS_TOKEN", "TASKCLUSTER_CERTIFICATE", "If", "TASKCLUSTER_CLIENT_ID", "is", "empty", "/", "unset", "authentication", "will", "be", "disabled", "." ]
[ "func", "NewFromEnv", "(", ")", "*", "Index", "{", "c", ":=", "tcclient", ".", "CredentialsFromEnvVars", "(", ")", "\n", "return", "&", "<mask>", "{", "Credentials", ":", "c", ",", "BaseURL", ":", "tcclient", ".", "BaseURL", "(", "tcclient", ".", "RootURLFromEnvVars", "(", ")", ",", "\"", "\"", ",", "\"", "\"", ")", ",", "Authenticate", ":", "c", ".", "ClientID", "!=", "\"", "\"", ",", "}", "\n", "}" ]
23,719
all-23720
[ "GenerateSecp256k1Key", "generates", "a", "new", "Secp256k1", "private", "and", "public", "key", "pair" ]
[ "func", "GenerateSecp256k1Key", "(", "src", "<mask>", ".", "Reader", ")", "(", "PrivKey", ",", "PubKey", ",", "error", ")", "{", "privk", ",", "err", ":=", "btcec", ".", "NewPrivateKey", "(", "btcec", ".", "S256", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "nil", ",", "err", "\n", "}", "\n\n", "k", ":=", "(", "*", "Secp256k1PrivateKey", ")", "(", "privk", ")", "\n", "return", "k", ",", "k", ".", "GetPublic", "(", ")", ",", "nil", "\n", "}" ]
23,720
all-23721
[ "addExchange", "adds", "an", "exchange", "it", "must", "be", "called", "with", "the", "mexset", "locked", "." ]
[ "func", "(", "mexset", "*", "messageExchangeSet", ")", "addExchange", "(", "mex", "*", "messageExchange", ")", "error", "{", "if", "mexset", ".", "shutdown", "{", "return", "errMexSetShutdown", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "mexset", ".", "exchanges", "[", "mex", ".", "msgID", "]", ";", "<mask>", "{", "return", "errDuplicateMex", "\n", "}", "\n\n", "mexset", ".", "exchanges", "[", "mex", ".", "msgID", "]", "=", "mex", "\n", "return", "nil", "\n", "}" ]
23,721
all-23722
[ "HasMetric", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "s", "*", "Series", ")", "HasMetric", "(", ")", "bool", "{", "if", "s", "!=", "nil", "&&", "s", ".", "Metric", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
23,722
all-23723
[ "NewMessage", "is", "a", "helper", "for", "creating", "Message", "instances", "directly", ".", "A", "common", "use", "-", "case", "is", "for", "writing", "tests", "generally", "you", "won", "t", "use", "this", "directly", ".", "If", "you", "do", "use", "this", "the", "Command", "channel", "is", "used", "internally", "to", "communicate", "message", "commands", "such", "as", "Finish", "or", "Requeue", ".", "When", "using", "this", "for", "testing", "you", "can", "make", "a", "channel", "and", "inspect", "any", "message", "sent", "along", "it", "for", "assertions", "." ]
[ "func", "NewMessage", "(", "id", "MessageID", ",", "body", "[", "]", "byte", ",", "cmdChan", "chan", "<-", "Command", ")", "*", "Message", "{", "return", "&", "<mask>", "{", "ID", ":", "id", ",", "Body", ":", "body", ",", "cmdChan", ":", "cmdChan", ",", "}", "\n", "}" ]
23,723
all-23724
[ "Forget", "accepts", "a", "dependency", "and", "removes", "all", "associated", "data", "with", "this", "dependency", ".", "It", "also", "resets", "the", "receivedData", "internal", "map", "." ]
[ "func", "(", "b", "*", "Brain", ")", "Forget", "(", "d", "dep", ".", "Dependency", ")", "{", "b", ".", "Lock", "(", ")", "\n", "defer", "b", ".", "Unlock", "(", ")", "\n\n", "<mask>", "(", "b", ".", "data", ",", "d", ".", "String", "(", ")", ")", "\n", "delete", "(", "b", ".", "receivedData", ",", "d", ".", "String", "(", ")", ")", "\n", "}" ]
23,724
all-23725
[ "/", "*", "encode", "image", "and", "store", "the", "result", "as", "a", "byte", "vector", "(", "single", "-", "row", "8uC1", "matrix", ")" ]
[ "func", "EncodeImage", "(", "ext", "string", ",", "image", "unsafe", ".", "Pointer", ",", "params", "[", "]", "int", ")", "*", "Mat", "{", "var", "firstParam", "*", "C", ".", "int", "\n", "if", "len", "(", "params", ")", ">", "0", "{", "var", "params_c", "[", "]", "C", ".", "int", "\n", "for", "_", ",", "param", ":=", "range", "params", "{", "params_c", "=", "append", "(", "params_c", ",", "C", ".", "int", "(", "param", ")", ")", "\n", "}", "\n", "firstParam", "=", "&", "params_c", "[", "0", "]", "\n", "}", "\n", "ext_c", ":=", "C", ".", "CString", "(", "ext", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "ext_c", ")", ")", "\n\n", "rv", ":=", "C", ".", "cvEncodeImage", "(", "ext_c", ",", "(", "<mask>", ")", ",", "firstParam", ")", "\n", "return", "(", "*", "Mat", ")", "(", "rv", ")", "\n", "}" ]
23,725
all-23726
[ "Find", "finds", "exactly", "one", "element", "by", "CSS", "selector", "." ]
[ "func", "(", "s", "*", "selectable", ")", "Find", "(", "selector", "string", ")", "*", "Selection", "{", "return", "newSelection", "(", "s", ".", "session", ",", "s", ".", "selectors", ".", "Append", "(", "<mask>", ".", "CSS", ",", "selector", ")", ".", "Single", "(", ")", ")", "\n", "}" ]
23,726
all-23727
[ "Error", "formats", "the", "enmime", ".", "Error", "as", "a", "string", "." ]
[ "func", "(", "e", "*", "Error", ")", "<mask>", "(", ")", "string", "{", "sev", ":=", "\"", "\"", "\n", "if", "e", ".", "Severe", "{", "sev", "=", "\"", "\"", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "sev", ",", "e", ".", "Name", ",", "e", ".", "Detail", ")", "\n", "}" ]
23,727
all-23728
[ "NewContext", "returns", "a", "Context", "that", "can", "be", "used", "to", "make", "JSON", "calls", "." ]
[ "func", "NewContext", "(", "timeout", "time", ".", "Duration", ")", "(", "<mask>", ",", "context", ".", "CancelFunc", ")", "{", "ctx", ",", "cancel", ":=", "tchannel", ".", "NewContext", "(", "timeout", ")", "\n", "return", "tchannel", ".", "WrapWithHeaders", "(", "ctx", ",", "nil", ")", ",", "cancel", "\n", "}" ]
23,728
all-23729
[ "MakeWatcher", "returns", "a", "Watcher", "that", "uses", "the", "given", "event", "channel", "and", "done", "channel", "internally", "to", "deliver", "events", "and", "signal", "closure", "respectively", "." ]
[ "func", "MakeWatcher", "(", "eventCh", "chan", "*", "Event", ",", "done", "chan", "struct", "{", "}", ")", "Watcher", "{", "return", "&", "watcher", "{", "eventCh", ":", "eventCh", ",", "done", ":", "<mask>", ",", "}", "\n", "}" ]
23,729
all-23730
[ "GetCreatedByOk", "returns", "a", "tuple", "with", "the", "CreatedBy", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "d", "*", "DashboardLite", ")", "GetCreatedByOk", "(", ")", "(", "CreatedBy", ",", "bool", ")", "{", "if", "d", "==", "nil", "||", "d", ".", "CreatedBy", "==", "nil", "{", "return", "CreatedBy", "{", "}", ",", "<mask>", "\n", "}", "\n", "return", "*", "d", ".", "CreatedBy", ",", "true", "\n", "}" ]
23,730
all-23731
[ "Do", "executes", "Network", ".", "getCertificate", "against", "the", "provided", "context", ".", "returns", ":", "tableNames" ]
[ "func", "(", "p", "*", "GetCertificateParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "tableNames", "[", "]", "string", ",", "err", "error", ")", "{", "// execute", "var", "res", "GetCertificateReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandGetCertificate", ",", "p", ",", "&", "res", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "res", ".", "TableNames", ",", "nil", "\n", "}" ]
23,731
all-23732
[ "FromQuery", "unpacks", "a", "Query", "proto", "." ]
[ "func", "FromQuery", "(", "req", "*", "prompb", ".", "<mask>", ")", "(", "int64", ",", "int64", ",", "[", "]", "*", "labels", ".", "Matcher", ",", "*", "storage", ".", "SelectParams", ",", "error", ")", "{", "matchers", ",", "err", ":=", "fromLabelMatchers", "(", "req", ".", "Matchers", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "0", ",", "nil", ",", "nil", ",", "err", "\n", "}", "\n", "var", "selectParams", "*", "storage", ".", "SelectParams", "\n", "if", "req", ".", "Hints", "!=", "nil", "{", "selectParams", "=", "&", "storage", ".", "SelectParams", "{", "Start", ":", "req", ".", "Hints", ".", "StartMs", ",", "End", ":", "req", ".", "Hints", ".", "EndMs", ",", "Step", ":", "req", ".", "Hints", ".", "StepMs", ",", "Func", ":", "req", ".", "Hints", ".", "Func", ",", "}", "\n", "}", "\n\n", "return", "req", ".", "StartTimestampMs", ",", "req", ".", "EndTimestampMs", ",", "matchers", ",", "selectParams", ",", "nil", "\n", "}" ]
23,732
all-23733
[ "copy", "a", "three", "-", "dimensional", "texture", "subimage" ]
[ "func", "CopyTextureSubImage3D", "(", "texture", "uint32", ",", "level", "int32", ",", "xoffset", "int32", ",", "yoffset", "int32", ",", "zoffset", "int32", ",", "x", "int32", ",", "y", "int32", ",", "width", "int32", ",", "height", "int32", ")", "{", "syscall", ".", "Syscall9", "(", "gpCopyTextureSubImage3D", ",", "9", ",", "uintptr", "(", "texture", ")", ",", "uintptr", "(", "level", ")", ",", "uintptr", "(", "xoffset", ")", ",", "uintptr", "(", "yoffset", ")", ",", "uintptr", "(", "zoffset", ")", ",", "uintptr", "(", "x", ")", ",", "uintptr", "(", "y", ")", ",", "uintptr", "(", "width", ")", ",", "uintptr", "(", "<mask>", ")", ")", "\n", "}" ]
23,733
all-23734
[ "WriteDeflateLevel", "writes", "response", "with", "deflated", "body", "to", "w", ".", "Level", "is", "the", "desired", "compression", "level", ":", "*", "CompressNoCompression", "*", "CompressBestSpeed", "*", "CompressBestCompression", "*", "CompressDefaultCompression", "*", "CompressHuffmanOnly", "The", "method", "deflates", "response", "body", "and", "sets", "Content", "-", "Encoding", ":", "deflate", "header", "before", "writing", "response", "to", "w", ".", "WriteDeflateLevel", "doesn", "t", "flush", "response", "to", "w", "for", "performance", "reasons", "." ]
[ "func", "(", "resp", "*", "Response", ")", "WriteDeflateLevel", "(", "w", "*", "bufio", ".", "Writer", ",", "level", "int", ")", "error", "{", "if", "err", ":=", "resp", ".", "deflateBody", "(", "<mask>", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "resp", ".", "Write", "(", "w", ")", "\n", "}" ]
23,734
all-23735
[ "CreateIntegrationPD", "creates", "new", "PagerDuty", "Integrations", ".", "Use", "this", "if", "you", "want", "to", "setup", "the", "integration", "for", "the", "first", "time", "or", "to", "add", "more", "services", "/", "schedules", "." ]
[ "func", "(", "client", "*", "<mask>", ")", "CreateIntegrationPD", "(", "pdIntegration", "*", "IntegrationPDRequest", ")", "error", "{", "return", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "pdIntegration", ",", "nil", ")", "\n", "}" ]
23,735
all-23736
[ "SendActionCardMsg", "独立跳转ActionCard类型" ]
[ "func", "(", "w", "*", "Webhook", ")", "SendActionCardMsg", "(", "<mask>", ",", "content", "string", ",", "linkTitles", ",", "linkURLs", "[", "]", "string", ",", "hideAvatar", ",", "btnOrientation", "bool", ")", "error", "{", "if", "len", "(", "linkTitles", ")", "==", "0", "||", "len", "(", "linkURLs", ")", "==", "0", "{", "return", "errors", ".", "New", "(", "\"", "", "", "\n", "}", "\n", "if", "len", "(", "linkTitles", ")", "!=", "len", "(", "linkURLs", ")", "{", "return", "errors", ".", "New", "(", "\"", "", "", "\n", "}", "\n\n", "var", "strHideAvatar", "=", "\"", "\"", "\n", "if", "hideAvatar", "{", "strHideAvatar", "=", "\"", "\"", "\n", "}", "\n", "var", "strBtnOrientation", "=", "\"", "\"", "\n", "if", "btnOrientation", "{", "strBtnOrientation", "=", "\"", "\"", "\n", "}", "\n\n", "var", "btns", "[", "]", "struct", "{", "Title", "string", "`json:\"title\"`", "\n", "ActionURL", "string", "`json:\"actionURL\"`", "\n", "}", "\n\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "linkTitles", ")", ";", "i", "++", "{", "btns", "=", "append", "(", "btns", ",", "struct", "{", "Title", "string", "`json:\"title\"`", "\n", "ActionURL", "string", "`json:\"actionURL\"`", "\n", "}", "{", "Title", ":", "linkTitles", "[", "i", "]", ",", "ActionURL", ":", "linkURLs", "[", "i", "]", ",", "}", ")", "\n", "}", "\n\n", "return", "w", ".", "SendPayload", "(", "&", "Payload", "{", "MsgType", ":", "\"", "\"", ",", "ActionCard", ":", "ActionCard", "{", "Text", ":", "content", ",", "Title", ":", "title", ",", "HideAvatar", ":", "strHideAvatar", ",", "BtnOrientation", ":", "strBtnOrientation", ",", "Buttons", ":", "btns", ",", "}", ",", "}", ")", "\n", "}" ]
23,736
all-23737
[ "GetLimitOk", "returns", "a", "tuple", "with", "the", "Limit", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "a", "*", "ApmOrLogQueryGroupBy", ")", "GetLimitOk", "(", ")", "(", "int", ",", "bool", ")", "{", "if", "a", "==", "nil", "||", "a", ".", "Limit", "==", "nil", "{", "return", "0", ",", "<mask>", "\n", "}", "\n", "return", "*", "a", ".", "Limit", ",", "true", "\n", "}" ]
23,737
all-23738
[ "NewMockResult", "creates", "a", "new", "mock", "instance" ]
[ "func", "NewMockResult", "(", "ctrl", "*", "gomock", ".", "<mask>", ")", "*", "MockResult", "{", "mock", ":=", "&", "MockResult", "{", "ctrl", ":", "ctrl", "}", "\n", "mock", ".", "recorder", "=", "&", "MockResultMockRecorder", "{", "mock", "}", "\n", "return", "mock", "\n", "}" ]
23,738
all-23739
[ "NewTLSConfig", "returns", "a", "*", "tls", ".", "Config", "that", "is", "pre", "-", "configured", "to", "match", "(", "roughly", ")", "the", "Mozilla", "recommended", "TLS", "specification", ".", "Different", "levels", "of", "security", "-", "vs", "-", "compatbility", "can", "be", "specified", "via", "the", "level", "var", ".", "Based", "on", ":", "https", ":", "//", "blog", ".", "gopheracademy", ".", "com", "/", "advent", "-", "2016", "/", "exposing", "-", "go", "-", "on", "-", "the", "-", "internet", "/", "Last", "updated", ":", "2017", "-", "01", "-", "11" ]
[ "func", "NewTLSConfig", "(", "<mask>", "TLSConfigLevel", ")", "*", "tls", ".", "Config", "{", "// TLSConfigDefault - golang's default", "c", ":=", "&", "tls", ".", "Config", "{", "}", "\n\n", "switch", "level", "{", "case", "TLSConfigIntermediate", ":", "// Causes servers to use Go's default ciphersuite preferences, which are tuned to avoid attacks. Does nothing on clients.", "c", ".", "PreferServerCipherSuites", "=", "true", "\n", "// Only use curves which have assembly implementations", "c", ".", "CurvePreferences", "=", "[", "]", "tls", ".", "CurveID", "{", "tls", ".", "CurveP256", ",", "}", "\n", "case", "TLSConfigModern", ":", "// Modern compat sets TLS_1.2 minimum version and a set of ciphers that support PFS", "c", ".", "MinVersion", "=", "tls", ".", "VersionTLS12", "\n", "c", ".", "CipherSuites", "=", "[", "]", "uint16", "{", "tls", ".", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", ",", "tls", ".", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", ",", "tls", ".", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", ",", "tls", ".", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", ",", "}", "\n", "}", "\n", "return", "c", "\n", "}" ]
23,739
all-23740
[ "title", ":", "event", "cancel", "path", ":", "/", "events", "/", "{", "uuid", "}", "/", "cancel", "method", ":", "POST", "produce", ":", "application", "/", "json", "responses", ":", "204", ":", "OK", "400", ":", "Invalid", "uuid", "or", "empty", "reason", "401", ":", "Unauthorized", "404", ":", "Not", "found" ]
[ "func", "eventCancel", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "error", "{", "uuid", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "if", "!", "bson", ".", "IsObjectIdHex", "(", "uuid", ")", "{", "msg", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "uuid", ")", "\n", "return", "&", "errors", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusBadRequest", ",", "Message", ":", "msg", "}", "\n", "}", "\n", "objID", ":=", "bson", ".", "ObjectIdHex", "(", "uuid", ")", "\n", "e", ",", "err", ":=", "event", ".", "GetByID", "(", "objID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "&", "errors", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusNotFound", ",", "Message", ":", "err", ".", "Error", "(", ")", "}", "\n", "}", "\n", "reason", ":=", "InputValue", "(", "r", ",", "\"", "\"", ")", "\n", "if", "reason", "==", "\"", "\"", "{", "return", "&", "errors", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusBadRequest", ",", "Message", ":", "\"", "\"", "}", "\n", "}", "\n", "scheme", ",", "err", ":=", "permission", ".", "SafeGet", "(", "e", ".", "AllowedCancel", ".", "Scheme", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "allowed", ":=", "permission", ".", "Check", "(", "t", ",", "scheme", ",", "e", ".", "AllowedCancel", ".", "Contexts", "...", ")", "\n", "if", "!", "allowed", "{", "return", "permission", ".", "ErrUnauthorized", "\n", "}", "\n", "err", "=", "e", ".", "TryCancel", "(", "reason", ",", "t", ".", "GetUserName", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "event", ".", "ErrNotCancelable", "{", "return", "&", "<mask>", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusBadRequest", ",", "Message", ":", "err", ".", "Error", "(", ")", "}", "\n", "}", "\n", "return", "err", "\n", "}", "\n", "w", ".", "WriteHeader", "(", "http", ".", "StatusNoContent", ")", "\n", "return", "nil", "\n", "}" ]
23,740
all-23741
[ "GetEnv", "returns", "the", "Env", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "w", "*", "Widget", ")", "GetEnv", "(", ")", "string", "{", "if", "w", "==", "nil", "||", "w", ".", "Env", "==", "nil", "{", "<mask>", "\"", "\"", "\n", "}", "\n", "return", "*", "w", ".", "Env", "\n", "}" ]
23,741
all-23742
[ "Do", "executes", "ServiceWorker", ".", "updateRegistration", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "UpdateRegistrationParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandUpdateRegistration", ",", "p", ",", "nil", ")", "\n", "}" ]
23,742
all-23743
[ "resourceVSphereStorageDrsVMOverrideObjects", "handles", "the", "fetching", "of", "the", "datastore", "cluster", "and", "virtual", "machine", "depending", "on", "what", "attributes", "are", "available", ":", "*", "If", "the", "resource", "ID", "is", "available", "the", "data", "is", "derived", "from", "the", "ID", ".", "*", "If", "not", "it", "s", "derived", "from", "the", "datastore_cluster_id", "and", "virtual_machine_id", "attributes", "." ]
[ "func", "resourceVSphereStorageDrsVMOverrideObjects", "(", "d", "*", "schema", ".", "ResourceData", ",", "meta", "interface", "{", "}", ",", ")", "(", "*", "<mask>", ".", "StoragePod", ",", "*", "object", ".", "VirtualMachine", ",", "error", ")", "{", "if", "d", ".", "Id", "(", ")", "!=", "\"", "\"", "{", "return", "resourceVSphereStorageDrsVMOverrideObjectsFromID", "(", "d", ",", "meta", ")", "\n", "}", "\n", "return", "resourceVSphereStorageDrsVMOverrideObjectsFromAttributes", "(", "d", ",", "meta", ")", "\n", "}" ]
23,743
all-23744
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "PauseOnAsyncCallParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger29", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,744
all-23745
[ "NewParallelDispatcher", "creates", "a", "new", "PrallelDispatcher", "with", "the", "given", "handlers" ]
[ "func", "NewParallelDispatcher", "(", "handlers", "[", "]", "<mask>", ")", "Dispatcher", "{", "return", "&", "ParallelDispatcher", "{", "handlers", ":", "handlers", ",", "mutex", ":", "sync", ".", "RWMutex", "{", "}", ",", "}", "\n", "}" ]
23,745
all-23746
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EndParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoTracing11", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,746
all-23747
[ "ServeIntrospectionHTTPEndpoint", "serves", "information", "about", "this", "agent", "/", "containerInstance", "and", "tasks", "running", "on", "it", ".", "V1", "here", "indicates", "the", "hostname", "version", "of", "this", "server", "instead", "of", "the", "handler", "versions", "i", ".", "e", ".", "V1", "server", "can", "include", "V1", "and", "V2", "handlers", "." ]
[ "func", "ServeIntrospectionHTTPEndpoint", "(", "containerInstanceArn", "*", "string", ",", "taskEngine", "engine", ".", "TaskEngine", ",", "cfg", "*", "config", ".", "Config", ")", "{", "// Is this the right level to type assert, assuming we'd abstract multiple taskengines here?", "// Revisit if we ever add another type..", "dockerTaskEngine", ":=", "taskEngine", ".", "(", "*", "engine", ".", "DockerTaskEngine", ")", "\n\n", "server", ":=", "introspectionServerSetup", "(", "containerInstanceArn", ",", "dockerTaskEngine", ",", "cfg", ")", "\n", "for", "{", "once", ":=", "sync", ".", "Once", "{", "}", "\n", "retry", ".", "RetryWithBackoff", "(", "retry", ".", "NewExponentialBackoff", "(", "<mask>", ".", "Second", ",", "time", ".", "Minute", ",", "0.2", ",", "2", ")", ",", "func", "(", ")", "error", "{", "// TODO, make this cancellable and use the passed in context; for", "// now, not critical if this gets interrupted", "err", ":=", "server", ".", "ListenAndServe", "(", ")", "\n", "once", ".", "Do", "(", "func", "(", ")", "{", "seelog", ".", "Error", "(", "\"", "\"", ",", "\"", "\"", ",", "err", ")", "\n", "}", ")", "\n", "return", "err", "\n", "}", ")", "\n", "}", "\n", "}" ]
23,747
all-23748
[ "toImpl", "creates", "an", "equivalent", "impl", "for", "any", "Error" ]
[ "func", "toImpl", "(", "err", "<mask>", ")", "*", "impl", "{", "if", "i", ",", "ok", ":=", "err", ".", "(", "*", "impl", ")", ";", "ok", "{", "return", "i", "\n", "}", "\n\n", "return", "&", "impl", "{", "message", ":", "err", ".", "Error", "(", ")", ",", "code", ":", "err", ".", "Code", "(", ")", ",", "typ", ":", "err", ".", "Type", "(", ")", ",", "attributes", ":", "err", ".", "Attributes", "(", ")", ",", "}", "\n", "}" ]
23,748
all-23749
[ "isIgnoredTag", "returns", "whether", "the", "tag", "is", "cgo", "or", "is", "a", "release", "tag", ".", "Release", "tags", "match", "the", "pattern", "go", "[", "0", "-", "9", "]", "\\", ".", "[", "0", "-", "9", "]", "+", ".", "Gazelle", "won", "t", "consider", "whether", "an", "ignored", "tag", "is", "satisfied", "when", "evaluating", "build", "constraints", "for", "a", "file", "." ]
[ "func", "isIgnoredTag", "(", "tag", "string", ")", "bool", "{", "if", "tag", "==", "\"", "\"", "||", "<mask>", "==", "\"", "\"", "||", "tag", "==", "\"", "\"", "{", "return", "true", "\n", "}", "\n", "if", "len", "(", "tag", ")", "<", "5", "||", "!", "strings", ".", "HasPrefix", "(", "tag", ",", "\"", "\"", ")", "{", "return", "false", "\n", "}", "\n", "if", "tag", "[", "2", "]", "<", "'0'", "||", "tag", "[", "2", "]", ">", "'9'", "||", "tag", "[", "3", "]", "!=", "'.'", "{", "return", "false", "\n", "}", "\n", "for", "_", ",", "c", ":=", "range", "tag", "[", "4", ":", "]", "{", "if", "c", "<", "'0'", "||", "c", ">", "'9'", "{", "return", "false", "\n", "}", "\n", "}", "\n", "return", "true", "\n", "}" ]
23,749
all-23750
[ "retrieveSSMSecretValues", "retrieves", "secret", "values", "from", "SSM", "parameter", "store", "and", "caches", "them", "into", "memory" ]
[ "func", "(", "secret", "*", "SSMSecretResource", ")", "retrieveSSMSecretValues", "(", "region", "string", ",", "<mask>", "[", "]", "string", ",", "iamCredentials", "credentials", ".", "IAMRoleCredentials", ",", "wg", "*", "sync", ".", "WaitGroup", ",", "errorEvents", "chan", "error", ")", "{", "defer", "wg", ".", "Done", "(", ")", "\n\n", "ssmClient", ":=", "secret", ".", "ssmClientCreator", ".", "NewSSMClient", "(", "region", ",", "iamCredentials", ")", "\n", "seelog", ".", "Infof", "(", "\"", "\"", ",", "names", ",", "region", ",", "secret", ".", "taskARN", ")", "\n", "secValueMap", ",", "err", ":=", "ssm", ".", "GetSecretsFromSSM", "(", "names", ",", "ssmClient", ")", "\n", "if", "err", "!=", "nil", "{", "errorEvents", "<-", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "region", ",", "err", ")", "\n", "return", "\n", "}", "\n\n", "secret", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "secret", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "// put secret value in secretData", "for", "secretName", ",", "secretValue", ":=", "range", "secValueMap", "{", "secretKey", ":=", "secretName", "+", "\"", "\"", "+", "region", "\n", "secret", ".", "secretData", "[", "secretKey", "]", "=", "secretValue", "\n", "}", "\n", "}" ]
23,750
all-23751
[ "Add", "will", "add", "a", "controller", "to", "the", "group", "." ]
[ "func", "(", "g", "*", "Group", ")", "Add", "(", "controllers", "...", "*", "Controller", ")", "{", "for", "_", ",", "controller", ":=", "range", "controllers", "{", "// prepare controller", "controller", ".", "prepare", "(", ")", "\n\n", "// get name", "<mask>", ":=", "controller", ".", "Model", ".", "Meta", "(", ")", ".", "PluralName", "\n\n", "// check existence", "if", "g", ".", "controllers", "[", "name", "]", "!=", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "`fire: controller with name \"%s\" already exists`", ",", "name", ")", ")", "\n", "}", "\n\n", "// create entry in controller map", "g", ".", "controllers", "[", "name", "]", "=", "controller", "\n", "}", "\n", "}" ]
23,751
all-23752
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "PauseParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger28", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,752
all-23753
[ "GetPageSetup", "()", "is", "a", "wrapper", "around", "gtk_print_context_get_page_setup", "()", "." ]
[ "func", "(", "<mask>", "*", "PrintContext", ")", "GetPageSetup", "(", ")", "*", "PageSetup", "{", "c", ":=", "C", ".", "gtk_print_context_get_page_setup", "(", "pc", ".", "native", "(", ")", ")", "\n", "obj", ":=", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "\n", "return", "wrapPageSetup", "(", "obj", ")", "\n", "}" ]
23,753
all-23754
[ "NewOutgoingMessage", "creates", "a", "new", "outgoing", "message", "." ]
[ "func", "(", "api", "*", "TelegramBotAPI", ")", "NewOutgoingMessage", "(", "recipient", "Recipient", ",", "text", "string", ")", "*", "OutgoingMessage", "{", "return", "&", "OutgoingMessage", "{", "outgoingMessageBase", ":", "outgoingMessageBase", "{", "outgoingBase", ":", "outgoingBase", "{", "api", ":", "api", ",", "Recipient", ":", "recipient", ",", "}", ",", "}", ",", "Text", ":", "<mask>", ",", "ParseMode", ":", "ModeDefault", ",", "}", "\n", "}" ]
23,754
all-23755
[ "Find", "the", "first", "suffix", "in", "the", "word", "among", "those", "provided", ";", "then", "check", "to", "see", "if", "it", "begins", "after", "startPos", ".", "If", "it", "does", "remove", "it", "." ]
[ "func", "(", "w", "*", "SnowballWord", ")", "RemoveFirstSuffixIfIn", "(", "startPos", "int", ",", "suffixes", "...", "string", ")", "(", "suffix", "<mask>", ",", "suffixRunes", "[", "]", "rune", ")", "{", "suffix", ",", "suffixRunes", "=", "w", ".", "FirstSuffixIfIn", "(", "startPos", ",", "len", "(", "w", ".", "RS", ")", ",", "suffixes", "...", ")", "\n", "if", "suffix", "!=", "\"", "\"", "{", "w", ".", "RemoveLastNRunes", "(", "len", "(", "suffixRunes", ")", ")", "\n", "}", "\n", "return", "\n", "}" ]
23,755
all-23756
[ "IsAdmin", "returns", "whether", "or", "not", "the", "provided", "user", "is", "an", "admin", "." ]
[ "func", "(", "r", "*", "Server", ")", "IsAdmin", "(", "username", "string", ")", "bool", "{", "r", ".", "permissionsLock", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "permissionsLock", ".", "Unlock", "(", ")", "\n\n", "// Check whether the permissions are cached", "_", ",", "cached", ":=", "r", ".", "permissions", "[", "username", "]", "\n\n", "if", "!", "cached", "{", "r", ".", "syncPermissions", "(", "username", ")", "\n", "}", "\n\n", "return", "<mask>", ".", "StringInSlice", "(", "\"", "\"", ",", "r", ".", "permissions", "[", "username", "]", "[", "\"", "\"", "]", ")", "\n", "}" ]
23,756
all-23757
[ "logLinesAll", "reads", "all", "of", "an", "artifact", "and", "splits", "it", "into", "lines", "." ]
[ "func", "logLinesAll", "(", "artifact", "lenses", ".", "Artifact", ")", "(", "[", "]", "string", ",", "error", ")", "{", "read", ",", "err", ":=", "artifact", ".", "ReadAll", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "artifact", ".", "JobPath", "(", ")", ",", "err", ")", "\n", "}", "\n", "logLines", ":=", "strings", ".", "Split", "(", "string", "(", "<mask>", ")", ",", "\"", "\\n", "\"", ")", "\n\n", "return", "logLines", ",", "nil", "\n", "}" ]
23,757
all-23758
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SearchMatch", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDebugger19", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
23,758
all-23759
[ "Single", "retreives", "the", "only", "element", "from", "a", "list", "or", "returns", "nil", "and", "an", "error", "." ]
[ "func", "Single", "(", "iter", "Enumerable", ")", "(", "retval", "interface", "{", "}", ",", "err", "error", ")", "{", "done", ":=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "defer", "close", "(", "done", ")", "\n\n", "err", "=", "errNoElements", "\n\n", "firstPass", ":=", "true", "\n", "for", "entry", ":=", "<mask>", "iter", ".", "Enumerate", "(", "done", ")", "{", "if", "firstPass", "{", "retval", "=", "entry", "\n", "err", "=", "nil", "\n", "}", "else", "{", "retval", "=", "nil", "\n", "err", "=", "errMultipleElements", "\n", "break", "\n", "}", "\n", "firstPass", "=", "false", "\n", "}", "\n", "return", "\n", "}" ]
23,759
all-23760
[ "Endpoints", "returns", "endpoint", "objects", "." ]
[ "func", "(", "cs", "*", "crdSource", ")", "Endpoints", "(", ")", "(", "[", "]", "*", "endpoint", ".", "Endpoint", ",", "error", ")", "{", "endpoints", ":=", "[", "]", "*", "endpoint", ".", "Endpoint", "{", "}", "\n\n", "result", ",", "err", ":=", "cs", ".", "List", "(", "&", "metav1", ".", "ListOptions", "{", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "for", "_", ",", "dnsEndpoint", ":=", "<mask>", "result", ".", "Items", "{", "endpoints", "=", "append", "(", "endpoints", ",", "dnsEndpoint", ".", "Spec", ".", "Endpoints", "...", ")", "\n\n", "if", "dnsEndpoint", ".", "Status", ".", "ObservedGeneration", "==", "dnsEndpoint", ".", "Generation", "{", "continue", "\n", "}", "\n\n", "dnsEndpoint", ".", "Status", ".", "ObservedGeneration", "=", "dnsEndpoint", ".", "Generation", "\n", "// Update the ObservedGeneration", "_", ",", "err", "=", "cs", ".", "UpdateStatus", "(", "&", "dnsEndpoint", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Warnf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "\n\n", "return", "endpoints", ",", "nil", "\n", "}" ]
23,760
all-23761
[ "DelAllSvcComments", "creates", "a", "new", "DEL_ALL_SVC_COMMENTS", "Nagios", "command", ".", "Deletes", "all", "comments", "associated", "with", "a", "particular", "service", "." ]
[ "func", "DelAllSvcComments", "(", "host_name", "string", ",", "service_description", "<mask>", ",", ")", "*", "livestatus", ".", "Command", "{", "return", "livestatus", ".", "NewCommand", "(", "\"", "\"", ",", "stringifyArg", "(", "\"", "\"", ",", "\"", "\"", ",", "host_name", ")", ",", "stringifyArg", "(", "\"", "\"", ",", "\"", "\"", ",", "service_description", ")", ",", ")", "\n", "}" ]
23,761
all-23762
[ "GetSecureCookie", "returns", "given", "cookie", "value", "from", "request", "header", "with", "default", "secret", "string", "." ]
[ "func", "(", "ctx", "*", "Context", ")", "GetSecureCookie", "(", "key", "string", ")", "(", "string", ",", "bool", ")", "{", "return", "ctx", ".", "GetSuperSecureCookie", "(", "defaultCookieSecret", ",", "<mask>", ")", "\n", "}" ]
23,762
all-23763
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "ContinueRequestParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoFetch13", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,763
all-23764
[ "TODO", "refactor", "Entry", "and", "drop", "this" ]
[ "func", "createParams", "(", "paramArray", "[", "]", "string", ")", "map", "[", "string", "]", "string", "{", "p", ":=", "<mask>", "(", "map", "[", "string", "]", "string", ")", "\n", "for", "i", ":=", "len", "(", "paramArray", ")", "-", "1", ";", "i", ">=", "1", ";", "i", "-=", "2", "{", "p", "[", "paramArray", "[", "i", "-", "1", "]", "]", "=", "paramArray", "[", "i", "]", "\n", "}", "\n", "return", "p", "\n", "}" ]
23,764
all-23765
[ "HasExpression", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "WidgetMetadata", ")", "HasExpression", "(", ")", "bool", "{", "if", "w", "!=", "nil", "&&", "w", ".", "Expression", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
23,765
all-23766
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "PlacementGroup", ")", "Locator", "(", "api", "*", "API", ")", "*", "PlacementGroupLocator", "{", "for", "_", ",", "l", ":=", "<mask>", "r", ".", "Links", "{", "if", "l", "[", "\"", "\"", "]", "==", "\"", "\"", "{", "return", "api", ".", "PlacementGroupLocator", "(", "l", "[", "\"", "\"", "]", ")", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
23,766
all-23767
[ "StreamWithoutReconnect", "functions", "identically", "to", "Stream", "but", "without", "any", "reconnect", "attempts", "when", "errors", "occur", "." ]
[ "func", "(", "c", "*", "Consumer", ")", "StreamWithoutReconnect", "(", "appGuid", "string", ",", "authToken", "string", ")", "(", "<-", "chan", "*", "<mask>", ".", "Envelope", ",", "<-", "chan", "error", ")", "{", "return", "c", ".", "runStream", "(", "appGuid", ",", "authToken", ",", "false", ")", "\n", "}" ]
23,767
all-23768
[ "Try", "to", "abort", "multipart", "upload", ".", "Do", "not", "error", "on", "failure", "." ]
[ "func", "(", "lo", "*", "largeObject", ")", "abort", "(", ")", "{", "objects", ",", "err", ":=", "lo", ".", "c", ".", "ObjectNamesAll", "(", "lo", ".", "container", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "lo", ".", "logger", ".", "<mask>", "(", "swiftLargeObjectLogTag", ",", "fmt", ".", "Sprintf", "(", "\"", "\\n", "\"", ",", "err", ")", ")", "\n", "return", "\n", "}", "\n", "for", "_", ",", "object", ":=", "range", "objects", "{", "if", "strings", ".", "HasPrefix", "(", "object", ",", "lo", ".", "objectName", "+", "\"", "\"", "+", "lo", ".", "timestamp", "+", "\"", "\"", ")", "{", "err", "=", "lo", ".", "c", ".", "ObjectDelete", "(", "lo", ".", "container", ",", "object", ")", "\n", "if", "err", "!=", "nil", "{", "lo", ".", "logger", ".", "Error", "(", "swiftLargeObjectLogTag", ",", "fmt", ".", "Sprintf", "(", "\"", "\\n", "\"", ",", "err", ")", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "\n", "}" ]
23,768
all-23769
[ "GetChangeTypeOk", "returns", "a", "tuple", "with", "the", "ChangeType", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TileDefRequest", ")", "GetChangeTypeOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "t", "==", "nil", "||", "t", ".", "ChangeType", "==", "nil", "{", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n", "return", "*", "t", ".", "ChangeType", ",", "true", "\n", "}" ]
23,769
all-23770
[ "ClipboardGetForDisplay", "()", "is", "a", "wrapper", "around", "gtk_clipboard_get_for_display", "()", "." ]
[ "func", "ClipboardGetForDisplay", "(", "display", "*", "gdk", ".", "Display", ",", "atom", "gdk", ".", "Atom", ")", "(", "*", "Clipboard", ",", "error", ")", "{", "displayPtr", ":=", "(", "*", "C", ".", "GdkDisplay", ")", "(", "unsafe", ".", "Pointer", "(", "display", ".", "Native", "(", ")", ")", ")", "\n", "c", ":=", "C", ".", "gtk_clipboard_get_for_display", "(", "displayPtr", ",", "C", ".", "GdkAtom", "(", "unsafe", ".", "Pointer", "(", "<mask>", ")", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n\n", "cb", ":=", "&", "Clipboard", "{", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "}", "\n", "return", "cb", ",", "nil", "\n", "}" ]
23,770
all-23771
[ "OutgoingContextWithID", "returns", "an", "outgoing", "context", "with", "the", "id" ]
[ "func", "OutgoingContextWithID", "(", "ctx", "<mask>", ".", "Context", ",", "id", "string", ")", "context", ".", "Context", "{", "return", "outgoingContextWithMergedMetadata", "(", "ctx", ",", "\"", "\"", ",", "id", ")", "\n", "}" ]
23,771
all-23772
[ "Request", "is", "the", "underlying", "method", "that", "makes", "a", "raw", "API", "request", "without", "performing", "any", "json", "marshaling", "/", "unmarshaling", "of", "requests", "/", "responses", ".", "It", "is", "useful", "if", "you", "wish", "to", "handle", "raw", "payloads", "and", "/", "or", "raw", "http", "response", "bodies", "rather", "than", "calling", "APICall", "which", "translates", "[]", "byte", "to", "/", "from", "go", "types", "." ]
[ "func", "(", "client", "*", "Client", ")", "Request", "(", "rawPayload", "[", "]", "byte", ",", "method", ",", "route", "string", ",", "query", "url", ".", "Values", ")", "(", "*", "CallSummary", ",", "error", ")", "{", "callSummary", ":=", "new", "(", "CallSummary", ")", "\n", "callSummary", ".", "HTTPRequestBody", "=", "string", "(", "rawPayload", ")", "\n\n", "// function to perform http request - we call this using backoff library to", "// have exponential backoff in case of intermittent failures (e.g. network", "// blips or HTTP 5xx errors)", "httpCall", ":=", "func", "(", ")", "(", "*", "http", ".", "Response", ",", "error", ",", "error", ")", "{", "var", "ioReader", "io", ".", "Reader", "\n", "ioReader", "=", "bytes", ".", "NewReader", "(", "rawPayload", ")", "\n", "u", ",", "err", ":=", "setURL", "(", "client", ",", "route", ",", "query", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\\n", "\\n", "\"", ",", "err", ")", "\n", "}", "\n", "callSummary", ".", "HTTPRequest", ",", "err", "=", "http", ".", "NewRequest", "(", "method", ",", "u", ".", "String", "(", ")", ",", "ioReader", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\\n", "\\n", "\"", ",", "u", ".", "String", "(", ")", ",", "client", ".", "BaseURL", ",", "err", ")", "\n", "}", "\n", "if", "len", "(", "rawPayload", ")", ">", "0", "{", "callSummary", ".", "HTTPRequest", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "}", "\n", "// Refresh Authorization header with each call...", "// Only authenticate if client library user wishes to.", "if", "client", ".", "Authenticate", "{", "err", "=", "client", ".", "Credentials", ".", "SignRequest", "(", "callSummary", ".", "HTTPRequest", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "nil", ",", "err", "\n", "}", "\n", "}", "\n", "// Set context if one is given", "if", "client", ".", "Context", "!=", "nil", "{", "callSummary", ".", "HTTPRequest", "=", "callSummary", ".", "HTTPRequest", ".", "WithContext", "(", "client", ".", "Context", ")", "\n", "}", "\n", "var", "resp", "*", "http", ".", "Response", "\n", "if", "client", ".", "HTTPClient", "!=", "nil", "{", "resp", ",", "err", "=", "client", ".", "HTTPClient", ".", "Do", "(", "callSummary", ".", "HTTPRequest", ")", "\n", "}", "else", "{", "resp", ",", "err", "=", "defaultHTTPClient", ".", "Do", "(", "callSummary", ".", "HTTPRequest", ")", "\n", "}", "\n", "// return cancelled error, if context was cancelled", "if", "<mask>", ".", "Context", "!=", "nil", "&&", "client", ".", "Context", ".", "Err", "(", ")", "!=", "nil", "{", "return", "nil", ",", "nil", ",", "client", ".", "Context", ".", "Err", "(", ")", "\n", "}", "\n", "// b, e := httputil.DumpResponse(resp, true)", "// if e == nil {", "// \tfmt.Println(string(b))", "// }", "return", "resp", ",", "err", ",", "nil", "\n", "}", "\n\n", "// Make HTTP API calls using an exponential backoff algorithm...", "var", "err", "error", "\n", "callSummary", ".", "HTTPResponse", ",", "callSummary", ".", "Attempts", ",", "err", "=", "httpbackoff", ".", "Retry", "(", "httpCall", ")", "\n\n", "// read response into memory, so that we can return the body", "if", "callSummary", ".", "HTTPResponse", "!=", "nil", "{", "body", ",", "err2", ":=", "ioutil", ".", "ReadAll", "(", "callSummary", ".", "HTTPResponse", ".", "Body", ")", "\n", "if", "err2", "==", "nil", "{", "callSummary", ".", "HTTPResponseBody", "=", "string", "(", "body", ")", "\n", "}", "\n", "}", "\n\n", "return", "callSummary", ",", "err", "\n\n", "}" ]
23,772
all-23773
[ "recreateContainers", "relaunch", "all", "node", "containers", "in", "the", "cluster", "for", "the", "given", "DockerProvisioner", "logging", "progress", "to", "the", "given", "writer", ".", "It", "assumes", "that", "the", "given", "writer", "is", "thread", "safe", "." ]
[ "func", "recreateContainers", "(", "p", "DockerProvisioner", ",", "w", "io", ".", "Writer", ",", "nodes", "...", "cluster", ".", "Node", ")", "error", "{", "return", "ensureContainersStarted", "(", "p", ",", "w", ",", "<mask>", ",", "nil", ",", "nodes", "...", ")", "\n", "}" ]
23,773
all-23774
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "ObjectStoreIndex", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb6", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
23,774
all-23775
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "DispatchMouseEventParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,775
all-23776
[ "parsePREFSRC", "returns", "preferred", "source", "address", "and", "output", "interface", "index", "(", "RTA_OIF", ")", "." ]
[ "func", "parsePREFSRC", "(", "m", "*", "syscall", ".", "NetlinkMessage", ")", "(", "host", "string", ",", "oif", "uint32", ",", "err", "error", ")", "{", "<mask>", "attrs", "[", "]", "syscall", ".", "NetlinkRouteAttr", "\n", "attrs", ",", "err", "=", "syscall", ".", "ParseNetlinkRouteAttr", "(", "m", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "0", ",", "err", "\n", "}", "\n\n", "for", "_", ",", "attr", ":=", "range", "attrs", "{", "if", "attr", ".", "Attr", ".", "Type", "==", "syscall", ".", "RTA_PREFSRC", "{", "host", "=", "net", ".", "IP", "(", "attr", ".", "Value", ")", ".", "String", "(", ")", "\n", "}", "\n", "if", "attr", ".", "Attr", ".", "Type", "==", "syscall", ".", "RTA_OIF", "{", "oif", "=", "cpuutil", ".", "ByteOrder", "(", ")", ".", "Uint32", "(", "attr", ".", "Value", ")", "\n", "}", "\n", "if", "host", "!=", "\"", "\"", "&&", "oif", "!=", "uint32", "(", "0", ")", "{", "break", "\n", "}", "\n", "}", "\n\n", "if", "oif", "==", "0", "{", "err", "=", "errNoDefaultRoute", "\n", "}", "\n", "return", "host", ",", "oif", ",", "err", "\n", "}" ]
23,776
all-23777
[ "Update", "updates", "each", "System", "managed", "by", "the", "World", ".", "It", "is", "invoked", "by", "the", "engine", "once", "every", "frame", "with", "dt", "being", "the", "duration", "since", "the", "previous", "update", "." ]
[ "func", "(", "w", "*", "World", ")", "Update", "(", "dt", "float32", ")", "{", "for", "_", ",", "<mask>", ":=", "range", "w", ".", "Systems", "(", ")", "{", "system", ".", "Update", "(", "dt", ")", "\n", "}", "\n", "}" ]
23,777
all-23778
[ "Extractor", "extracts", "a", "token", "from", "a", "request" ]
[ "func", "Extractor", "(", "e", "<mask>", ".", "Extractor", ")", "TokenOpt", "{", "return", "TokenOpt", "{", "func", "(", "o", "*", "options", ")", "{", "o", ".", "extractor", "=", "e", "\n", "}", "}", "\n", "}" ]
23,778
all-23779
[ "All", "tests", "whether", "or", "not", "all", "items", "present", "meet", "a", "criteria", "." ]
[ "func", "(", "iter", "Enumerator", ")", "All", "(", "p", "Predicate", ")", "bool", "{", "for", "entry", ":=", "range", "iter", "{", "if", "!", "p", "(", "<mask>", ")", "{", "return", "false", "\n", "}", "\n", "}", "\n", "return", "true", "\n", "}" ]
23,779
all-23780
[ "MustPaymentOp", "retrieves", "the", "PaymentOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
[ "func", "(", "u", "OperationBody", ")", "MustPaymentOp", "(", ")", "PaymentOp", "{", "val", ",", "ok", ":=", "u", ".", "GetPaymentOp", "(", ")", "\n\n", "if", "!", "<mask>", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "val", "\n", "}" ]
23,780
all-23781
[ "assignOp", "emits", "to", "fn", "code", "to", "perform", "loc", "+", "=", "incr", "or", "loc", "-", "=", "incr", "." ]
[ "func", "(", "b", "*", "<mask>", ")", "assignOp", "(", "fn", "*", "Function", ",", "loc", "lvalue", ",", "incr", "Value", ",", "op", "token", ".", "Token", ",", "pos", "token", ".", "Pos", ")", "{", "oldv", ":=", "loc", ".", "load", "(", "fn", ")", "\n", "loc", ".", "store", "(", "fn", ",", "emitArith", "(", "fn", ",", "op", ",", "oldv", ",", "emitConv", "(", "fn", ",", "incr", ",", "oldv", ".", "Type", "(", ")", ")", ",", "loc", ".", "typ", "(", ")", ",", "pos", ")", ")", "\n", "}" ]
23,781
all-23782
[ "Do", "executes", "Emulation", ".", "resetPageScaleFactor", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "ResetPageScaleFactorParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandResetPageScaleFactor", ",", "nil", ",", "nil", ")", "\n", "}" ]
23,782
all-23783
[ "String", "returns", "the", "name", "of", "e" ]
[ "func", "(", "e", "ManageDataResultCode", ")", "String", "(", ")", "string", "{", "<mask>", ",", "_", ":=", "manageDataResultCodeMap", "[", "int32", "(", "e", ")", "]", "\n", "return", "name", "\n", "}" ]
23,783
all-23784
[ "Sets", "an", "(", "optional", ")", "function", "that", "is", "called", "with", "the", "key", "and", "value", "when", "an", "item", "is", "evicted", "from", "the", "cache", ".", "(", "Including", "when", "it", "is", "deleted", "manually", "but", "not", "when", "it", "is", "overwritten", ".", ")", "Set", "to", "nil", "to", "disable", "." ]
[ "func", "(", "c", "*", "<mask>", ")", "OnEvicted", "(", "f", "func", "(", "string", ",", "interface", "{", "}", ")", ")", "{", "c", ".", "mu", ".", "Lock", "(", ")", "\n", "c", ".", "onEvicted", "=", "f", "\n", "c", ".", "mu", ".", "Unlock", "(", ")", "\n", "}" ]
23,784
all-23785
[ "MarshalEasyJSON", "satisfies", "easyjson", ".", "Marshaler", "." ]
[ "func", "(", "t", "SetDownloadBehaviorBehavior", ")", "MarshalEasyJSON", "(", "out", "*", "jwriter", ".", "Writer", ")", "{", "<mask>", ".", "String", "(", "string", "(", "t", ")", ")", "\n", "}" ]
23,785
all-23786
[ "Next", "returns", "the", "next", "page", "of", "resources", ".", "If", "there", "are", "no", "more", "resources", "NoMoreResults", "is", "returned", "." ]
[ "func", "(", "m", "*", "messagePageIterator", ")", "Next", "(", "ctx", "<mask>", ".", "Context", ")", "(", "*", "MessagePage", ",", "error", ")", "{", "mp", ":=", "new", "(", "MessagePage", ")", "\n", "err", ":=", "m", ".", "p", ".", "Next", "(", "ctx", ",", "mp", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "m", ".", "p", ".", "SetNextPageURI", "(", "mp", ".", "NextPageURI", ")", "\n", "return", "mp", ",", "nil", "\n", "}" ]
23,786
all-23787
[ "Unit", "returns", "the", "metric", "name", "and", "unit", "in", "the", "current", "entry", ".", "Must", "only", "be", "called", "after", "Next", "returned", "a", "unit", "entry", ".", "The", "returned", "byte", "slices", "become", "invalid", "after", "the", "next", "call", "to", "Next", "." ]
[ "func", "(", "p", "*", "OpenMetricsParser", ")", "Unit", "(", ")", "(", "[", "]", "byte", ",", "[", "]", "<mask>", ")", "{", "// The Prometheus format does not have units.", "return", "p", ".", "l", ".", "b", "[", "p", ".", "offsets", "[", "0", "]", ":", "p", ".", "offsets", "[", "1", "]", "]", ",", "p", ".", "text", "\n", "}" ]
23,787
all-23788
[ "WithContext", "adds", "the", "context", "to", "the", "find", "vms", "by", "deployment", "params" ]
[ "func", "(", "o", "*", "FindVmsByDeploymentParams", ")", "WithContext", "(", "ctx", "<mask>", ".", "Context", ")", "*", "FindVmsByDeploymentParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
23,788
all-23789
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "patch", "apps", "app", "routes", "route", "params" ]
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteParams", ")", "WithHTTPClient", "(", "<mask>", "*", "http", ".", "Client", ")", "*", "PatchAppsAppRoutesRouteParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
23,789
all-23790
[ "importKeysFromBytes", "imports", "public", "keys", "from", "the", "supplied", "blob", "and", "returns", "their", "identities", ".", "The", "blob", "is", "assumed", "to", "have", "an", "appropriate", "format", "(", "the", "caller", "is", "expected", "to", "know", "which", "one", ")", "." ]
[ "func", "(", "m", "*", "openpgpSigningMechanism", ")", "importKeysFromBytes", "(", "blob", "[", "]", "byte", ")", "(", "[", "]", "string", ",", "error", ")", "{", "keyring", ",", "err", ":=", "openpgp", ".", "ReadKeyRing", "(", "bytes", ".", "NewReader", "(", "blob", ")", ")", "\n", "if", "err", "!=", "nil", "{", "k", ",", "e2", ":=", "openpgp", ".", "ReadArmoredKeyRing", "(", "bytes", ".", "NewReader", "(", "blob", ")", ")", "\n", "if", "e2", "!=", "nil", "{", "return", "nil", ",", "err", "// The original error -- FIXME: is this better?", "\n", "}", "\n", "keyring", "=", "k", "\n", "}", "\n\n", "keyIdentities", ":=", "[", "]", "string", "{", "}", "\n", "for", "_", ",", "entity", ":=", "range", "keyring", "{", "if", "entity", ".", "PrimaryKey", "==", "nil", "{", "// Coverage: This should never happen, openpgp.ReadEntity fails with a", "// openpgp.errors.StructuralError instead of returning an entity with this", "// field set to nil.", "continue", "\n", "}", "\n", "// Uppercase the fingerprint to be compatible with gpgme", "keyIdentities", "=", "append", "(", "keyIdentities", ",", "strings", ".", "ToUpper", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "entity", ".", "PrimaryKey", ".", "Fingerprint", ")", ")", ")", "\n", "m", ".", "keyring", "=", "<mask>", "(", "m", ".", "keyring", ",", "entity", ")", "\n", "}", "\n", "return", "keyIdentities", ",", "nil", "\n", "}" ]
23,790
all-23791
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "StopRuleUsageTrackingReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss6", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,791
all-23792
[ "RegisterFlags", "registers", "options", "for", "this", "munger", ";", "returns", "any", "that", "require", "a", "restart", "when", "changed", "." ]
[ "func", "(", "fjr", "*", "FlakyJobReporter", ")", "RegisterFlags", "(", ")", "{", "<mask>", ".", "StringVar", "(", "&", "fjr", ".", "flakyJobDataURL", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "flag", ".", "IntVar", "(", "&", "fjr", ".", "syncCount", ",", "\"", "\"", ",", "3", ",", "\"", "\"", ")", "\n", "}" ]
23,792
all-23793
[ "GetOrientation", "is", "a", "wrapper", "around", "gtk_tool_item_get_orientation", "()", "." ]
[ "func", "(", "v", "*", "ToolItem", ")", "GetOrientation", "(", ")", "Orientation", "{", "c", ":=", "C", ".", "gtk_tool_item_get_orientation", "(", "v", ".", "native", "(", ")", ")", "\n", "<mask>", "Orientation", "(", "c", ")", "\n", "}" ]
23,793
all-23794
[ "Change", "the", "sizeSplit", "fileLogger", "s", "single", "file", "size" ]
[ "func", "(", "f", "*", "FileLogger", ")", "SetMaxFileSize", "(", "size", "int64", ",", "unit", "UNIT", ")", "int64", "{", "f", ".", "fileSize", "=", "<mask>", "*", "int64", "(", "unit", ")", "\n", "return", "f", ".", "fileSize", "\n", "}" ]
23,794
all-23795
[ "Unregister", "removes", "the", "codec", "for", "a", "mimetype", "from", "r", "." ]
[ "func", "(", "reg", "*", "Registry", ")", "Unregister", "(", "mimetype", "string", ")", "{", "defer", "reg", ".", "mutex", ".", "Unlock", "(", ")", "\n", "reg", ".", "mutex", ".", "Lock", "(", ")", "\n\n", "<mask>", "(", "reg", ".", "codecs", ",", "mimetype", ")", "\n", "}" ]
23,795
all-23796
[ "ImageAssociateNode", "creates", "a", "new", "entry", "in", "the", "images_nodes", "table", "for", "tracking", "that", "the", "current", "node", "has", "the", "given", "image", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "ImageAssociateNode", "(", "project", ",", "fingerprint", "string", ")", "error", "{", "imageID", ",", "_", ",", "err", ":=", "c", ".", "ImageGet", "(", "<mask>", ",", "fingerprint", ",", "false", ",", "true", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "err", "=", "c", ".", "Transaction", "(", "func", "(", "tx", "*", "ClusterTx", ")", "error", "{", "_", ",", "err", ":=", "tx", ".", "tx", ".", "Exec", "(", "\"", "\"", ",", "imageID", ",", "c", ".", "nodeID", ")", "\n", "return", "err", "\n", "}", ")", "\n", "return", "err", "\n", "}" ]
23,796
all-23797
[ "ReleaseAll", "returns", "all", "resources", "hold", "by", "the", "client", "back", "to", "boskos", "and", "set", "them", "to", "dest", "state", "." ]
[ "func", "(", "c", "*", "Client", ")", "ReleaseAll", "(", "dest", "string", ")", "error", "{", "c", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "lock", ".", "Unlock", "(", ")", "\n", "resources", ",", "err", ":=", "c", ".", "storage", ".", "List", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "len", "(", "<mask>", ")", "==", "0", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "var", "allErrors", "error", "\n", "for", "_", ",", "r", ":=", "range", "resources", "{", "c", ".", "storage", ".", "Delete", "(", "r", ".", "GetName", "(", ")", ")", "\n", "err", ":=", "c", ".", "release", "(", "r", ".", "GetName", "(", ")", ",", "dest", ")", "\n", "if", "err", "!=", "nil", "{", "allErrors", "=", "multierror", ".", "Append", "(", "allErrors", ",", "err", ")", "\n", "}", "\n", "}", "\n", "return", "allErrors", "\n", "}" ]
23,797
all-23798
[ "Empty", "reports", "whether", "the", "rectangle", "contains", "no", "points", "." ]
[ "func", "(", "r", "Rectangle", ")", "Empty", "(", ")", "bool", "{", "<mask>", "r", ".", "Min", ".", "X", ">=", "r", ".", "Max", ".", "X", "||", "r", ".", "Min", ".", "Y", ">=", "r", ".", "Max", ".", "Y", "\n", "}" ]
23,798
all-23799
[ "Value", "converts", "a", "value", "to", "a", "database", "driver", "value" ]
[ "func", "(", "h", "Hostname", ")", "Value", "(", ")", "(", "driver", ".", "<mask>", ",", "error", ")", "{", "return", "driver", ".", "Value", "(", "string", "(", "h", ")", ")", ",", "nil", "\n", "}" ]
23,799
all-23800
[ "MutateTransaction", "for", "MemoText", "sets", "the", "memo", "." ]
[ "func", "(", "m", "MemoText", ")", "MutateTransaction", "(", "o", "*", "TransactionBuilder", ")", "(", "err", "error", ")", "{", "if", "len", "(", "[", "]", "byte", "(", "m", ".", "Value", ")", ")", ">", "MemoTextMaxLength", "{", "err", "=", "<mask>", ".", "New", "(", "\"", "\"", ")", "\n", "return", "\n", "}", "\n\n", "o", ".", "TX", ".", "Memo", ",", "err", "=", "xdr", ".", "NewMemo", "(", "xdr", ".", "MemoTypeMemoText", ",", "m", ".", "Value", ")", "\n", "return", "\n", "}" ]