id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
19,800
all-19801
[ "From", "lifts", "an", "error", "to", "be", "and", "Error" ]
[ "func", "From", "(", "in", "error", ")", "Error", "{", "if", "err", ",", "ok", ":=", "in", ".", "(", "Error", ")", ";", "ok", "{", "return", "err", "\n", "}", "\n\n", "return", "FromGRPC", "(", "<mask>", ")", "\n", "}" ]
19,801
all-19802
[ "lintReversedIPAddress", "lints", "the", "given", "name", "as", "either", "a", "reversed", "IPv4", "or", "IPv6", "address", "under", "the", "respective", "ARPA", "zone", "based", "on", "the", "address", "class", ".", "An", "error", "is", "returned", "if", ":", "1", ".", "The", "IP", "address", "labels", "parse", "as", "an", "IP", "of", "the", "wrong", "address", "class", "for", "the", "arpa", "suffix", "the", "name", "is", "using", ".", "2", ".", "The", "IP", "address", "is", "within", "an", "IANA", "reserved", "range", "." ]
[ "func", "lintReversedIPAddress", "(", "name", "string", ",", "ipv6", "bool", ")", "error", "{", "numRequiredLabels", ":=", "rdnsIPv4Labels", "\n", "zoneSuffix", ":=", "rdnsIPv4Suffix", "\n\n", "if", "ipv6", "{", "numRequiredLabels", "=", "rdnsIPv6Labels", "\n", "zoneSuffix", "=", "rdnsIPv6Suffix", "\n", "}", "\n\n", "// Strip off the zone suffix to get only the reversed IP address", "ipName", ":=", "strings", ".", "TrimSuffix", "(", "name", ",", "zoneSuffix", ")", "\n\n", "// A well encoded IPv4 or IPv6 reverse DNS name will have the correct number", "// of labels to express the address. If there isn't the right number of labels", "// a separate `lint_subject_contains_malformed_arpa_ip.go` linter will flag it", "// as a warning. This linter is specifically concerned with well formed rDNS", "// that specifies a reserved IP.", "ipLabels", ":=", "strings", ".", "Split", "(", "ipName", ",", "\"", "\"", ")", "\n", "if", "len", "(", "ipLabels", ")", "!=", "numRequiredLabels", "{", "return", "nil", "\n", "}", "\n\n", "// Reverse the IP labels and try to parse an IP address", "var", "ip", "<mask>", ".", "IP", "\n", "if", "ipv6", "{", "ip", "=", "reversedLabelsToIPv6", "(", "ipLabels", ")", "\n", "}", "else", "{", "ip", "=", "reversedLabelsToIPv4", "(", "ipLabels", ")", "\n", "}", "\n", "// If the result isn't an IP at all assume there is no problem - leave", "// `lint_subject_contains_malformed_arpa_ip` to flag it as a warning.", "if", "ip", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "!", "ipv6", "&&", "ip", ".", "To4", "(", ")", "==", "nil", "{", "// If we weren't expecting IPv6 and got it, that's a problem", "return", "fmt", ".", "Errorf", "(", "\"", "\"", "+", "\"", "\"", ",", "numRequiredLabels", ",", "name", ",", "rdnsIPv4Suffix", ")", "\n", "}", "else", "if", "ipv6", "&&", "ip", ".", "To4", "(", ")", "!=", "nil", "{", "// If we were expecting IPv6 and got an IPv4 address, that's a problem", "return", "fmt", ".", "Errorf", "(", "\"", "\"", "+", "\"", "\"", ",", "numRequiredLabels", ",", "name", ",", "rdnsIPv6Suffix", ")", "\n", "}", "\n\n", "// If the IP address is in an IANA reserved space, that's a problem.", "if", "util", ".", "IsIANAReserved", "(", "ip", ")", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", "+", "\"", "\"", ",", "numRequiredLabels", ",", "name", ")", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
19,802
all-19803
[ "SetShowDialogItem", "()", "is", "a", "wrapper", "around", "gtk_app_chooser_button_set_show_dialog_item", "()", "." ]
[ "func", "(", "v", "*", "AppChooserButton", ")", "SetShowDialogItem", "(", "<mask>", "bool", ")", "{", "C", ".", "gtk_app_chooser_button_set_show_dialog_item", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "setting", ")", ")", "\n", "}" ]
19,803
all-19804
[ "getCommandFunc", "executes", "the", "get", "command", "." ]
[ "func", "getCommandFunc", "(", "cmd", "*", "cobra", ".", "Command", ",", "args", "[", "]", "string", ")", "{", "key", ",", "opts", ":=", "getGetOp", "(", "args", ")", "\n", "ctx", ",", "cancel", ":=", "commandCtx", "(", "cmd", ")", "\n", "resp", ",", "err", ":=", "mustClientFromCmd", "(", "cmd", ")", ".", "Get", "(", "ctx", ",", "key", ",", "opts", "...", ")", "\n", "cancel", "(", ")", "\n", "if", "err", "!=", "nil", "{", "ExitWithError", "(", "ExitError", ",", "err", ")", "\n", "}", "\n\n", "if", "printValueOnly", "{", "dp", ",", "simple", ":=", "(", "display", ")", ".", "(", "*", "simplePrinter", ")", "\n", "if", "!", "simple", "{", "ExitWithError", "(", "ExitBadArgs", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", ")", "\n", "}", "\n", "<mask>", ".", "valueOnly", "=", "true", "\n", "}", "\n", "display", ".", "Get", "(", "*", "resp", ")", "\n", "}" ]
19,804
all-19805
[ "Context", "belongs", "to", "the", "Span", "interface" ]
[ "func", "(", "s", "*", "MockSpan", ")", "<mask>", "(", ")", "opentracing", ".", "SpanContext", "{", "s", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "Unlock", "(", ")", "\n", "return", "s", ".", "SpanContext", "\n", "}" ]
19,805
all-19806
[ "Set", "is", "equivalent", "of", "Txn", ".", "SetWithMeta", "." ]
[ "func", "(", "wb", "*", "WriteBatch", ")", "Set", "(", "k", ",", "v", "[", "]", "byte", ",", "meta", "byte", ")", "error", "{", "e", ":=", "&", "<mask>", "{", "Key", ":", "k", ",", "Value", ":", "v", ",", "UserMeta", ":", "meta", "}", "\n", "return", "wb", ".", "SetEntry", "(", "e", ")", "\n", "}" ]
19,806
all-19807
[ "GetQuery", "returns", "the", "Query", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "e", "*", "EventStreamDefinition", ")", "GetQuery", "(", ")", "string", "{", "if", "e", "==", "nil", "||", "e", ".", "<mask>", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "e", ".", "Query", "\n", "}" ]
19,807
all-19808
[ "title", ":", "service", "info", "path", ":", "/", "services", "/", "{", "name", "}", "method", ":", "GET", "produce", ":", "application", "/", "json", "responses", ":", "200", ":", "OK" ]
[ "func", "serviceInfo", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "<mask>", ",", "t", "auth", ".", "Token", ")", "error", "{", "serviceName", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "_", ",", "err", ":=", "getService", "(", "serviceName", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "contexts", ":=", "permission", ".", "ContextsForPermission", "(", "t", ",", "permission", ".", "PermServiceInstanceRead", ")", "\n", "instances", ",", "err", ":=", "readableInstances", "(", "t", ",", "contexts", ",", "\"", "\"", ",", "serviceName", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "var", "result", "[", "]", "service", ".", "ServiceInstanceWithInfo", "\n", "for", "_", ",", "instance", ":=", "range", "instances", "{", "infoData", ",", "err", ":=", "instance", ".", "ToInfo", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "result", "=", "append", "(", "result", ",", "infoData", ")", "\n", "}", "\n", "return", "json", ".", "NewEncoder", "(", "w", ")", ".", "Encode", "(", "result", ")", "\n", "}" ]
19,808
all-19809
[ "randomString", "generates", "a", "random", "string", "of", "given", "length", "using", "specified", "alphabet", "." ]
[ "func", "randomString", "(", "n", "int", ",", "alphabet", "string", ")", "string", "{", "r", ":=", "timeSeed", "(", ")", "\n", "b", ":=", "make", "(", "[", "]", "byte", ",", "n", ")", "\n", "for", "i", ":=", "<mask>", "b", "{", "b", "[", "i", "]", "=", "alphabet", "[", "r", ".", "Intn", "(", "len", "(", "alphabet", ")", ")", "]", "\n", "}", "\n", "return", "string", "(", "b", ")", "\n", "}" ]
19,809
all-19810
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetBackgroundColorsParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss48", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
19,810
all-19811
[ "poolPRMap", "collects", "all", "subpool", "PRs", "into", "a", "map", "containing", "all", "pooled", "PRs", "." ]
[ "func", "poolPRMap", "(", "subpoolMap", "map", "[", "string", "]", "*", "subpool", ")", "map", "[", "string", "]", "PullRequest", "{", "prs", ":=", "make", "(", "<mask>", "[", "string", "]", "PullRequest", ")", "\n", "for", "_", ",", "sp", ":=", "range", "subpoolMap", "{", "for", "_", ",", "pr", ":=", "range", "sp", ".", "prs", "{", "prs", "[", "prKey", "(", "&", "pr", ")", "]", "=", "pr", "\n", "}", "\n", "}", "\n", "return", "prs", "\n", "}" ]
19,811
all-19812
[ "GetSelected", "()", "is", "a", "wrapper", "around", "gtk_tree_selection_get_selected", "()", "." ]
[ "func", "(", "v", "*", "TreeSelection", ")", "GetSelected", "(", ")", "(", "model", "ITreeModel", ",", "iter", "*", "TreeIter", ",", "ok", "bool", ")", "{", "var", "cmodel", "*", "C", ".", "GtkTreeModel", "\n", "var", "citer", "C", ".", "GtkTreeIter", "\n", "c", ":=", "C", ".", "gtk_tree_selection_get_selected", "(", "v", ".", "native", "(", ")", ",", "&", "cmodel", ",", "&", "citer", ")", "\n", "<mask>", "=", "wrapTreeModel", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "cmodel", ")", ")", ")", "\n", "iter", "=", "&", "TreeIter", "{", "citer", "}", "\n", "ok", "=", "gobool", "(", "c", ")", "\n", "return", "\n", "}" ]
19,812
all-19813
[ "MarshalEasyJSON", "satisfies", "easyjson", ".", "Marshaler", "." ]
[ "func", "(", "t", "PermissionType", ")", "MarshalEasyJSON", "(", "<mask>", "*", "jwriter", ".", "Writer", ")", "{", "out", ".", "String", "(", "string", "(", "t", ")", ")", "\n", "}" ]
19,813
all-19814
[ "Do", "executes", "Performance", ".", "setTimeDomain", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetTimeDomainParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetTimeDomain", ",", "p", ",", "nil", ")", "\n", "}" ]
19,814
all-19815
[ "NewLogger", "creates", "a", "new", "database", "logger", "." ]
[ "func", "NewLogger", "(", "conf", "*", "Config", ",", "db", "*", "reform", ".", "DB", ")", "(", "<mask>", ".", "Logger", ",", "error", ")", "{", "l", ":=", "&", "dbLogger", "{", "db", ":", "db", "}", "\n\n", "base", ",", "err", ":=", "log", ".", "NewLoggerBase", "(", "conf", ".", "BaseConfig", ",", "l", ".", "log", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "l", ".", "LoggerBase", "=", "base", "\n", "return", "l", ",", "nil", "\n", "}" ]
19,815
all-19816
[ "HasCritical", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "ThresholdCount", ")", "HasCritical", "(", ")", "bool", "{", "if", "t", "!=", "nil", "&&", "t", ".", "Critical", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
19,816
all-19817
[ "runLeader", "runs", "the", "FSM", "for", "a", "leader", ".", "Do", "the", "setup", "here", "and", "drop", "into", "the", "leaderLoop", "for", "the", "hot", "loop", "." ]
[ "func", "(", "r", "*", "Raft", ")", "runLeader", "(", ")", "{", "r", ".", "logger", ".", "Info", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "r", ")", ")", "\n", "metrics", ".", "IncrCounter", "(", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", "}", ",", "1", ")", "\n\n", "// Notify that we are the leader", "asyncNotifyBool", "(", "r", ".", "leaderCh", ",", "true", ")", "\n\n", "// Push to the notify channel if given", "if", "notify", ":=", "r", ".", "conf", ".", "NotifyCh", ";", "notify", "!=", "nil", "{", "select", "{", "case", "notify", "<-", "true", ":", "case", "<-", "r", ".", "shutdownCh", ":", "}", "\n", "}", "\n\n", "// Setup leader state", "r", ".", "leaderState", ".", "commitCh", "=", "make", "(", "chan", "struct", "{", "}", ",", "1", ")", "\n", "r", ".", "leaderState", ".", "commitment", "=", "newCommitment", "(", "r", ".", "leaderState", ".", "commitCh", ",", "r", ".", "configurations", ".", "latest", ",", "r", ".", "getLastIndex", "(", ")", "+", "1", "/* first index that may be committed in this term */", ")", "\n", "r", ".", "leaderState", ".", "inflight", "=", "list", ".", "New", "(", ")", "\n", "r", ".", "leaderState", ".", "replState", "=", "make", "(", "map", "[", "ServerID", "]", "*", "followerReplication", ")", "\n", "r", ".", "leaderState", ".", "notify", "=", "make", "(", "map", "[", "*", "verifyFuture", "]", "struct", "{", "}", ")", "\n", "r", ".", "leaderState", ".", "stepDown", "=", "make", "(", "chan", "struct", "{", "}", ",", "1", ")", "\n\n", "// Cleanup state on step down", "defer", "func", "(", ")", "{", "// Since we were the leader previously, we update our", "// last contact time when we step down, so that we are not", "// reporting a last contact time from before we were the", "// leader. Otherwise, to a client it would seem our data", "// is extremely stale.", "r", ".", "setLastContact", "(", ")", "\n\n", "// Stop replication", "for", "_", ",", "p", ":=", "range", "r", ".", "leaderState", ".", "replState", "{", "close", "(", "p", ".", "stopCh", ")", "\n", "}", "\n\n", "// Respond to all inflight operations", "for", "e", ":=", "r", ".", "leaderState", ".", "inflight", ".", "Front", "(", ")", ";", "e", "!=", "nil", ";", "e", "=", "e", ".", "Next", "(", ")", "{", "e", ".", "Value", ".", "(", "*", "logFuture", ")", ".", "respond", "(", "ErrLeadershipLost", ")", "\n", "}", "\n\n", "// Respond to any pending verify requests", "for", "future", ":=", "<mask>", "r", ".", "leaderState", ".", "notify", "{", "future", ".", "respond", "(", "ErrLeadershipLost", ")", "\n", "}", "\n\n", "// Clear all the state", "r", ".", "leaderState", ".", "commitCh", "=", "nil", "\n", "r", ".", "leaderState", ".", "commitment", "=", "nil", "\n", "r", ".", "leaderState", ".", "inflight", "=", "nil", "\n", "r", ".", "leaderState", ".", "replState", "=", "nil", "\n", "r", ".", "leaderState", ".", "notify", "=", "nil", "\n", "r", ".", "leaderState", ".", "stepDown", "=", "nil", "\n\n", "// If we are stepping down for some reason, no known leader.", "// We may have stepped down due to an RPC call, which would", "// provide the leader, so we cannot always blank this out.", "r", ".", "leaderLock", ".", "Lock", "(", ")", "\n", "if", "r", ".", "leader", "==", "r", ".", "localAddr", "{", "r", ".", "leader", "=", "\"", "\"", "\n", "}", "\n", "r", ".", "leaderLock", ".", "Unlock", "(", ")", "\n\n", "// Notify that we are not the leader", "asyncNotifyBool", "(", "r", ".", "leaderCh", ",", "false", ")", "\n\n", "// Push to the notify channel if given", "if", "notify", ":=", "r", ".", "conf", ".", "NotifyCh", ";", "notify", "!=", "nil", "{", "select", "{", "case", "notify", "<-", "false", ":", "case", "<-", "r", ".", "shutdownCh", ":", "// On shutdown, make a best effort but do not block", "select", "{", "case", "notify", "<-", "false", ":", "default", ":", "}", "\n", "}", "\n", "}", "\n", "}", "(", ")", "\n\n", "// Start a replication routine for each peer", "r", ".", "startStopReplication", "(", ")", "\n\n", "// Dispatch a no-op log entry first. This gets this leader up to the latest", "// possible commit index, even in the absence of client commands. This used", "// to append a configuration entry instead of a noop. However, that permits", "// an unbounded number of uncommitted configurations in the log. We now", "// maintain that there exists at most one uncommitted configuration entry in", "// any log, so we have to do proper no-ops here.", "noop", ":=", "&", "logFuture", "{", "log", ":", "Log", "{", "Type", ":", "LogNoop", ",", "}", ",", "}", "\n", "r", ".", "dispatchLogs", "(", "[", "]", "*", "logFuture", "{", "noop", "}", ")", "\n\n", "// Sit in the leader loop until we step down", "r", ".", "leaderLoop", "(", ")", "\n", "}" ]
19,817
all-19818
[ "title", ":", "platform", "info", "path", ":", "/", "platforms", "/", "{", "name", "}", "method", ":", "GET", "produce", ":", "application", "/", "json", "responses", ":", "200", ":", "Platform", "info", "401", ":", "Unauthorized", "404", ":", "NotFound" ]
[ "func", "platformInfo", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "error", "{", "name", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "canUsePlat", ":=", "permission", ".", "Check", "(", "t", ",", "permission", ".", "PermPlatformUpdate", ")", "||", "permission", ".", "Check", "(", "t", ",", "permission", ".", "PermPlatformCreate", ")", "\n", "if", "!", "canUsePlat", "{", "return", "permission", ".", "ErrUnauthorized", "\n", "}", "\n", "platform", ",", "err", ":=", "servicemanager", ".", "Platform", ".", "FindByName", "(", "name", ")", "\n", "if", "err", "==", "appTypes", ".", "ErrPlatformNotFound", "{", "return", "&", "tErrors", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusNotFound", ",", "Message", ":", "err", ".", "Error", "(", ")", "}", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "images", ",", "err", ":=", "servicemanager", ".", "PlatformImage", ".", "ListImagesOrDefault", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "msg", ":=", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", "platform", ",", "\"", "\"", ":", "images", ",", "}", "\n", "w", ".", "Header", "(", ")", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "json", ".", "NewEncoder", "(", "w", ")", ".", "Encode", "(", "<mask>", ")", "\n", "}" ]
19,818
all-19819
[ "FriendlyPrice", "flips", "the", "sign", "of", "the", "Price", "(", "which", "is", "usually", "reported", "from", "the", "API", "as", "a", "negative", "number", ")", "and", "adds", "an", "appropriate", "currency", "symbol", "in", "front", "of", "it", ".", "For", "example", "a", "PriceUnit", "of", "USD", "and", "a", "Price", "of", "-", "1", ".", "25", "is", "reported", "as", "$1", ".", "25", "." ]
[ "func", "(", "r", "*", "Recording", ")", "FriendlyPrice", "(", ")", "string", "{", "if", "r", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "<mask>", "(", "r", ".", "PriceUnit", ",", "r", ".", "Price", ")", "\n", "}" ]
19,819
all-19820
[ "ExtractPipeline", "extracts", "a", "single", "pipeline", "." ]
[ "func", "(", "c", "APIClient", ")", "ExtractPipeline", "(", "pipelineName", "string", ")", "(", "*", "pps", ".", "CreatePipelineRequest", ",", "error", ")", "{", "op", ",", "<mask>", ":=", "c", ".", "AdminAPIClient", ".", "ExtractPipeline", "(", "c", ".", "Ctx", "(", ")", ",", "&", "admin", ".", "ExtractPipelineRequest", "{", "Pipeline", ":", "NewPipeline", "(", "pipelineName", ")", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "grpcutil", ".", "ScrubGRPC", "(", "err", ")", "\n", "}", "\n", "if", "op", ".", "Op1_9", "==", "nil", "||", "op", ".", "Op1_9", ".", "Pipeline", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "op", ".", "Op1_9", ".", "Pipeline", ",", "nil", "\n", "}" ]
19,820
all-19821
[ "SetStrv", "is", "a", "wrapper", "around", "g_settings_set_strv", "()", "." ]
[ "func", "(", "v", "*", "Settings", ")", "SetStrv", "(", "name", "string", ",", "values", "[", "]", "string", ")", "bool", "{", "cstr1", ":=", "(", "*", "C", ".", "gchar", ")", "(", "C", ".", "CString", "(", "name", ")", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr1", ")", ")", "\n\n", "cvalues", ":=", "make", "(", "[", "]", "*", "C", ".", "gchar", ",", "len", "(", "values", ")", ")", "\n", "for", "i", ",", "accel", ":=", "range", "values", "{", "cvalues", "[", "i", "]", "=", "(", "*", "C", ".", "gchar", ")", "(", "C", ".", "CString", "(", "accel", ")", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cvalues", "[", "i", "]", ")", ")", "\n", "}", "\n", "cvalues", "=", "<mask>", "(", "cvalues", ",", "nil", ")", "\n\n", "return", "gobool", "(", "C", ".", "g_settings_set_strv", "(", "v", ".", "native", "(", ")", ",", "cstr1", ",", "&", "cvalues", "[", "0", "]", ")", ")", "\n", "}" ]
19,821
all-19822
[ "SetTop", "sets", "the", "theoretical", "highest", "value", "of", "data", "flow", "to", "scale", "the", "chart" ]
[ "func", "(", "b", "*", "SparkChart", ")", "SetTop", "(", "top", "float64", ")", "{", "b", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "b", ".", "mtx", ".", "Unlock", "(", ")", "\n\n", "b", ".", "topValue", "=", "<mask>", "\n", "}" ]
19,822
all-19823
[ "Concat", "multiplies", "a", "geometry", "matrix", "with", "the", "other", "geometry", "matrix", ".", "This", "is", "same", "as", "muptiplying", "the", "matrix", "other", "and", "the", "matrix", "g", "in", "this", "order", "." ]
[ "func", "(", "g", "*", "GeoM", ")", "Concat", "(", "<mask>", "GeoM", ")", "{", "a", ":=", "(", "other", ".", "a_1", "+", "1", ")", "*", "(", "g", ".", "a_1", "+", "1", ")", "+", "other", ".", "b", "*", "g", ".", "c", "\n", "b", ":=", "(", "other", ".", "a_1", "+", "1", ")", "*", "g", ".", "b", "+", "other", ".", "b", "*", "(", "g", ".", "d_1", "+", "1", ")", "\n", "tx", ":=", "(", "other", ".", "a_1", "+", "1", ")", "*", "g", ".", "tx", "+", "other", ".", "b", "*", "g", ".", "ty", "+", "other", ".", "tx", "\n", "c", ":=", "other", ".", "c", "*", "(", "g", ".", "a_1", "+", "1", ")", "+", "(", "other", ".", "d_1", "+", "1", ")", "*", "g", ".", "c", "\n", "d", ":=", "other", ".", "c", "*", "g", ".", "b", "+", "(", "other", ".", "d_1", "+", "1", ")", "*", "(", "g", ".", "d_1", "+", "1", ")", "\n", "ty", ":=", "other", ".", "c", "*", "g", ".", "tx", "+", "(", "other", ".", "d_1", "+", "1", ")", "*", "g", ".", "ty", "+", "other", ".", "ty", "\n\n", "g", ".", "a_1", "=", "a", "-", "1", "\n", "g", ".", "b", "=", "b", "\n", "g", ".", "c", "=", "c", "\n", "g", ".", "d_1", "=", "d", "-", "1", "\n", "g", ".", "tx", "=", "tx", "\n", "g", ".", "ty", "=", "ty", "\n", "}" ]
19,823
all-19824
[ "UnmarshalEasyJSON", "satisfies", "easyjson", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "FrameID", ")", "UnmarshalEasyJSON", "(", "<mask>", "*", "jlexer", ".", "Lexer", ")", "{", "buf", ":=", "in", ".", "Raw", "(", ")", "\n", "if", "l", ":=", "len", "(", "buf", ")", ";", "l", ">", "2", "&&", "buf", "[", "0", "]", "==", "'\"'", "&&", "buf", "[", "l", "-", "1", "]", "==", "'\"'", "{", "buf", "=", "buf", "[", "1", ":", "l", "-", "1", "]", "\n", "}", "\n\n", "*", "t", "=", "FrameID", "(", "buf", ")", "\n", "}" ]
19,824
all-19825
[ "Path", "returns", "the", "full", "path", "of", "a", "key", "in", "the", "etcd", "namespace" ]
[ "func", "(", "c", "*", "collection", ")", "Path", "(", "key", "string", ")", "string", "{", "return", "<mask>", ".", "Join", "(", "c", ".", "prefix", ",", "key", ")", "\n", "}" ]
19,825
all-19826
[ "initConfig", "reads", "in", "config", "file", "and", "ENV", "variables", "if", "set", "." ]
[ "func", "initConfig", "(", ")", "{", "if", "cfgFile", "!=", "\"", "\"", "{", "// enable ability to specify config file via flag", "viper", ".", "SetConfigFile", "(", "cfgFile", ")", "\n", "}", "\n\n", "viper", ".", "SetConfigName", "(", "\"", "\"", ")", "// name of config file (without extension)", "\n", "viper", ".", "AddConfigPath", "(", "\"", "\"", ")", "// adding home directory as first search path", "\n", "viper", ".", "AutomaticEnv", "(", ")", "// read in environment variables that match", "\n\n", "// If a config file is found, read it in.", "if", "err", ":=", "viper", ".", "ReadInConfig", "(", ")", ";", "err", "==", "nil", "{", "fmt", ".", "Println", "(", "\"", "\"", ",", "viper", ".", "ConfigFileUsed", "(", ")", ")", "\n", "}", "\n\n", "fs", ",", "err", ":=", "fstack", ".", "OpenStack", "(", "stackFile", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ")", "\n", "}", "\n", "<mask>", "=", "fs", "\n", "}" ]
19,826
all-19827
[ "SetFocusChain", "is", "a", "wrapper", "around", "gtk_container_set_focus_chain", "()", "." ]
[ "func", "(", "v", "*", "Container", ")", "SetFocusChain", "(", "focusableWidgets", "[", "]", "IWidget", ")", "{", "var", "list", "*", "glib", ".", "List", "\n", "for", "_", ",", "w", ":=", "range", "focusableWidgets", "{", "data", ":=", "uintptr", "(", "unsafe", ".", "Pointer", "(", "w", ".", "toWidget", "(", ")", ")", ")", "\n", "list", "=", "list", ".", "Append", "(", "data", ")", "\n", "}", "\n", "glist", ":=", "(", "*", "C", ".", "GList", ")", "(", "unsafe", ".", "Pointer", "(", "<mask>", ")", ")", "\n", "C", ".", "gtk_container_set_focus_chain", "(", "v", ".", "native", "(", ")", ",", "glist", ")", "\n", "}" ]
19,827
all-19828
[ "MessageDialogNew", "()", "is", "a", "wrapper", "around", "gtk_message_dialog_new", "()", ".", "The", "text", "is", "created", "and", "formatted", "by", "the", "format", "specifier", "and", "any", "additional", "arguments", "." ]
[ "func", "MessageDialogNew", "(", "parent", "IWindow", ",", "flags", "DialogFlags", ",", "mType", "MessageType", ",", "buttons", "ButtonsType", ",", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "*", "MessageDialog", "{", "s", ":=", "fmt", ".", "Sprintf", "(", "<mask>", ",", "a", "...", ")", "\n", "cstr", ":=", "C", ".", "CString", "(", "s", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "var", "w", "*", "C", ".", "GtkWindow", "=", "nil", "\n", "if", "parent", "!=", "nil", "{", "w", "=", "parent", ".", "toWindow", "(", ")", "\n", "}", "\n", "c", ":=", "C", ".", "_gtk_message_dialog_new", "(", "w", ",", "C", ".", "GtkDialogFlags", "(", "flags", ")", ",", "C", ".", "GtkMessageType", "(", "mType", ")", ",", "C", ".", "GtkButtonsType", "(", "buttons", ")", ",", "cstr", ")", "\n", "return", "wrapMessageDialog", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", "\n", "}" ]
19,828
all-19829
[ "isEligibleTagEndpoint", "is", "a", "meta", "-", "validation", "that", "is", "used", "on", "login", "to", "see", "if", "the", "connected", "endpoint", "supports", "the", "CIS", "REST", "API", "which", "we", "use", "for", "tags", "." ]
[ "func", "isEligibleTagEndpoint", "(", "client", "*", "govmomi", ".", "Client", ")", "bool", "{", "if", "err", ":=", "viapi", ".", "ValidateVirtualCenter", "(", "client", ")", ";", "err", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n", "clientVer", ":=", "viapi", ".", "ParseVersionFromClient", "(", "client", ")", "\n", "if", "!", "clientVer", ".", "ProductEqual", "(", "tagsMinVersion", ")", "||", "clientVer", ".", "Older", "(", "tagsMinVersion", ")", "{", "return", "false", "\n", "}", "\n", "return", "true", "\n", "}" ]
19,829
all-19830
[ "UnmarshalJSON", "satisfies", "json", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "<mask>", ")", "UnmarshalJSON", "(", "buf", "[", "]", "byte", ")", "error", "{", "return", "easyjson", ".", "Unmarshal", "(", "buf", ",", "t", ")", "\n", "}" ]
19,830
all-19831
[ "Execute", "the", "given", "query", "and", "ensure", "that", "it", "yields", "rows", "with", "a", "single", "column", "of", "the", "given", "database", "type", ".", "For", "every", "row", "yielded", "execute", "the", "given", "scanner", "." ]
[ "func", "scanSingleColumn", "(", "tx", "*", "sql", ".", "Tx", ",", "query", "string", ",", "args", "[", "]", "interface", "{", "}", ",", "typeName", "string", ",", "scan", "scanFunc", ")", "error", "{", "rows", ",", "err", ":=", "tx", ".", "<mask>", "(", "query", ",", "args", "...", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "defer", "rows", ".", "Close", "(", ")", "\n\n", "for", "rows", ".", "Next", "(", ")", "{", "err", ":=", "scan", "(", "rows", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n\n", "err", "=", "rows", ".", "Err", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "nil", "\n", "}" ]
19,831
all-19832
[ "startResourceTransitions", "steps", "through", "each", "resource", "in", "the", "task", "and", "calls", "the", "passed", "transition", "function", "when", "a", "transition", "should", "occur" ]
[ "func", "(", "mtask", "*", "managedTask", ")", "startResourceTransitions", "(", "transitionFunc", "resourceTransitionFunc", ")", "(", "bool", ",", "<mask>", "[", "string", "]", "string", ")", "{", "anyCanTransition", ":=", "false", "\n", "transitions", ":=", "make", "(", "map", "[", "string", "]", "string", ")", "\n", "for", "_", ",", "res", ":=", "range", "mtask", ".", "GetResources", "(", ")", "{", "knownStatus", ":=", "res", ".", "GetKnownStatus", "(", ")", "\n", "desiredStatus", ":=", "res", ".", "GetDesiredStatus", "(", ")", "\n", "if", "knownStatus", ">=", "desiredStatus", "{", "seelog", ".", "Debugf", "(", "\"", "\"", ",", "mtask", ".", "Arn", ",", "res", ".", "GetName", "(", ")", ",", "res", ".", "StatusString", "(", "desiredStatus", ")", ",", "res", ".", "StatusString", "(", "knownStatus", ")", ")", "\n", "continue", "\n", "}", "\n", "anyCanTransition", "=", "true", "\n", "transition", ":=", "mtask", ".", "resourceNextState", "(", "res", ")", "\n", "// If the resource is already in a transition, skip", "if", "transition", ".", "actionRequired", "&&", "!", "res", ".", "SetAppliedStatus", "(", "transition", ".", "nextState", ")", "{", "// At least one resource is able to be moved forwards, so we're not deadlocked", "continue", "\n", "}", "\n", "if", "!", "transition", ".", "actionRequired", "{", "// no action is required for the transition, just set the known status without", "// calling any transition function", "go", "mtask", ".", "emitResourceChange", "(", "resourceStateChange", "{", "resource", ":", "res", ",", "nextState", ":", "transition", ".", "nextState", ",", "err", ":", "nil", ",", "}", ")", "\n", "continue", "\n", "}", "\n", "// At least one resource is able to be move forwards, so we're not deadlocked", "transitions", "[", "res", ".", "GetName", "(", ")", "]", "=", "transition", ".", "status", "\n", "go", "transitionFunc", "(", "res", ",", "transition", ".", "nextState", ")", "\n", "}", "\n", "return", "anyCanTransition", ",", "transitions", "\n", "}" ]
19,832
all-19833
[ "SetLevelByName", "sets", "log", "level", "by", "name" ]
[ "func", "(", "l", "*", "Logger", ")", "SetLevelByName", "(", "name", "string", ")", "{", "level", ":=", "LevelInfo", "\n", "switch", "strings", ".", "ToLower", "(", "name", ")", "{", "case", "\"", "\"", ":", "level", "=", "LevelTrace", "\n", "case", "\"", "\"", ":", "level", "=", "LevelDebug", "\n", "case", "\"", "\"", ",", "\"", "\"", ":", "level", "=", "LevelWarn", "\n", "<mask>", "\"", "\"", ":", "level", "=", "LevelError", "\n", "case", "\"", "\"", ":", "level", "=", "LevelFatal", "\n", "default", ":", "level", "=", "LevelInfo", "\n", "}", "\n\n", "l", ".", "SetLevel", "(", "level", ")", "\n", "}" ]
19,833
all-19834
[ "Set", "applies", "the", "tag", "to", "an", "existing", "Span", "." ]
[ "func", "(", "t", "Tag", ")", "Set", "(", "s", "Span", ")", "{", "s", ".", "SetTag", "(", "t", ".", "<mask>", ",", "t", ".", "Value", ")", "\n", "}" ]
19,834
all-19835
[ "New", "builds", "a", "new", "message", "with", "the", "current", "buffalo", ".", "Context" ]
[ "func", "New", "(", "c", "buffalo", ".", "Context", ")", "Message", "{", "m", ":=", "NewFromData", "(", "c", ".", "Data", "(", ")", ")", "\n", "m", ".", "<mask>", "=", "c", "\n", "return", "m", "\n", "}" ]
19,835
all-19836
[ "Sum", "appends", "the", "current", "hash", "to", "b", "and", "returns", "the", "resulting", "slice", ".", "It", "does", "not", "change", "the", "underlying", "hash", "state", "." ]
[ "func", "(", "xxh", "XXHZero", ")", "Sum", "(", "b", "[", "]", "byte", ")", "[", "]", "byte", "{", "h32", ":=", "xxh", ".", "Sum32", "(", ")", "\n", "return", "<mask>", "(", "b", ",", "byte", "(", "h32", ")", ",", "byte", "(", "h32", ">>", "8", ")", ",", "byte", "(", "h32", ">>", "16", ")", ",", "byte", "(", "h32", ">>", "24", ")", ")", "\n", "}" ]
19,836
all-19837
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetInstallabilityErrorsReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage38", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
19,837
all-19838
[ "MustCreatePassiveOfferOp", "retrieves", "the", "CreatePassiveOfferOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
[ "func", "(", "u", "OperationBody", ")", "MustCreatePassiveOfferOp", "(", ")", "CreatePassiveOfferOp", "{", "val", ",", "ok", ":=", "u", ".", "GetCreatePassiveOfferOp", "(", ")", "\n\n", "if", "!", "<mask>", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "val", "\n", "}" ]
19,838
all-19839
[ "HasProcessQuery", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "h", "*", "HostmapRequest", ")", "HasProcessQuery", "(", ")", "bool", "{", "if", "h", "!=", "nil", "&&", "h", ".", "ProcessQuery", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
19,839
all-19840
[ "Match", "checks", "whether", "a", "zone", "matches", "the", "zone", "type", "that", "s", "filtered", "for", "." ]
[ "func", "(", "f", "ZoneTypeFilter", ")", "Match", "(", "zone", "*", "route53", ".", "HostedZone", ")", "bool", "{", "// An empty zone filter includes all hosted zones.", "if", "f", ".", "zoneType", "==", "\"", "\"", "{", "return", "true", "\n", "}", "\n\n", "// If the zone has no config we assume it's a public zone since the config's field", "// `PrivateZone` is false by default in go.", "if", "zone", ".", "Config", "==", "nil", "{", "return", "f", ".", "zoneType", "==", "zoneTypePublic", "\n", "}", "\n\n", "// Given a zone type we return true if the given zone matches this type.", "switch", "f", ".", "zoneType", "{", "case", "zoneTypePublic", ":", "return", "!", "aws", ".", "BoolValue", "(", "zone", ".", "Config", ".", "PrivateZone", ")", "\n", "case", "zoneTypePrivate", ":", "return", "aws", ".", "BoolValue", "(", "<mask>", ".", "Config", ".", "PrivateZone", ")", "\n", "}", "\n\n", "// We return false on any other path, e.g. unknown zone type filter value.", "return", "false", "\n", "}" ]
19,840
all-19841
[ "Write", "checkout", "the", "error", "returned", "from", "the", "origin", "Write", "()", "method", ".", "If", "the", "error", "is", "not", "nil", "the", "connection", "is", "marked", "as", "unusable", "." ]
[ "func", "(", "c", "*", "WrappedConn", ")", "Write", "(", "b", "[", "]", "byte", ")", "(", "n", "int", ",", "err", "error", ")", "{", "//c.Conn is certainly not nil", "n", ",", "err", "=", "c", ".", "Conn", ".", "Write", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "c", ".", "unusable", "=", "true", "\n", "}", "else", "{", "c", ".", "<mask>", "=", "time", ".", "Now", "(", ")", "\n", "}", "\n", "return", "\n", "}" ]
19,841
all-19842
[ "NewLoopVar", "creates", "the", "loop", "variable" ]
[ "func", "NewLoopVar", "(", "idx", "int", ",", "array", "reflect", ".", "Value", ")", "*", "LoopVar", "{", "lv", ":=", "&", "LoopVar", "{", "Index", ":", "idx", ",", "Count", ":", "idx", "+", "1", ",", "Body", ":", "array", ",", "Size", ":", "array", ".", "Len", "(", ")", ",", "MaxIndex", ":", "array", ".", "Len", "(", ")", "-", "1", ",", "PeekNext", ":", "nil", ",", "PeekPrev", ":", "nil", ",", "IsFirst", ":", "false", ",", "IsLast", ":", "<mask>", ",", "}", "\n", "return", "lv", "\n", "}" ]
19,842
all-19843
[ "stringDash", "-", "output", "dash", "(", "on", "top", "and", "header", ")", "." ]
[ "func", "(", "t", "*", "<mask>", ")", "stringDash", "(", ")", "string", "{", "s", ":=", "\"", "\"", "\n", "for", "i", ":=", "0", ";", "i", "<", "t", ".", "lineLength", "(", ")", "-", "2", ";", "i", "++", "{", "s", "+=", "\"", "\"", "\n", "}", "\n", "s", "+=", "\"", "\"", "\n", "return", "s", "\n", "}" ]
19,843
all-19844
[ "ValidateKey", "allows", "us", "to", "verify", "the", "sanity", "of", "a", "key", "after", "loading", "it", "from", "disk" ]
[ "func", "(", "pk", "PrivKeyLedgerSecp256k1", ")", "ValidateKey", "(", ")", "error", "{", "// getPubKey will return an error if the ledger is not", "pub", ",", "err", ":=", "pk", ".", "getPubKey", "(", ")", "\n", "if", "<mask>", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "// verify this matches cached address", "if", "!", "pub", ".", "Equals", "(", "pk", ".", "CachedPubKey", ")", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
19,844
all-19845
[ "ContinueOnError", "ErrorHandling", "//", "Return", "a", "descriptive", "error", ".", "ExitOnError", "//", "Call", "os", ".", "Exit", "(", "2", ")", ".", "PanicOnError", "//", "Call", "panic", "with", "a", "descriptive", "error", ".", "flag", ".", "ContinueOnError" ]
[ "func", "newOption", "(", "w", "<mask>", ".", "Writer", ",", "eh", "flag", ".", "ErrorHandling", ")", "(", "o", "*", "option", ")", "{", "o", "=", "&", "option", "{", "flagSet", ":", "flag", ".", "NewFlagSet", "(", "CommandName", ",", "eh", ")", ",", "}", "\n", "// option settings", "o", ".", "flagSet", ".", "SetOutput", "(", "w", ")", "\n", "o", ".", "flagSet", ".", "StringVar", "(", "&", "o", ".", "file", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "o", ".", "flagSet", ".", "StringVar", "(", "&", "o", ".", "dic", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "o", ".", "flagSet", ".", "StringVar", "(", "&", "o", ".", "udic", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "o", ".", "flagSet", ".", "StringVar", "(", "&", "o", ".", "sysdic", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "o", ".", "flagSet", ".", "StringVar", "(", "&", "o", ".", "mode", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n\n", "return", "\n", "}" ]
19,845
all-19846
[ "Execute", "-", "creates", "private", "domains" ]
[ "func", "(", "c", "*", "CreatePrivateDomainsCommand", ")", "Execute", "(", "[", "]", "string", ")", "error", "{", "<mask>", "cfMgmt", "*", "CFMgmt", "\n", "var", "err", "error", "\n", "if", "cfMgmt", ",", "err", "=", "InitializePeekManagers", "(", "c", ".", "BaseCFConfigCommand", ",", "c", ".", "Peek", ")", ";", "err", "==", "nil", "{", "err", "=", "cfMgmt", ".", "PrivateDomainManager", ".", "CreatePrivateDomains", "(", ")", "\n", "}", "\n", "return", "err", "\n", "}" ]
19,846
all-19847
[ "resourceVSphereDRSVMOverrideParseID", "parses", "an", "ID", "for", "the", "vsphere_drs_vm_override", "and", "outputs", "its", "parts", "." ]
[ "func", "resourceVSphereDRSVMOverrideParseID", "(", "id", "string", ")", "(", "string", ",", "string", ",", "error", ")", "{", "parts", ":=", "strings", ".", "SplitN", "(", "id", ",", "\"", "\"", ",", "3", ")", "\n", "if", "len", "(", "parts", ")", "<", "2", "{", "return", "\"", "\"", ",", "\"", "\"", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "id", ")", "\n", "}", "\n", "return", "<mask>", "[", "0", "]", ",", "parts", "[", "1", "]", ",", "nil", "\n", "}" ]
19,847
all-19848
[ "isUpToDate", "determines", "if", "the", "given", "(", "lastIndex", "term", ")", "log", "is", "more", "up", "-", "to", "-", "date", "by", "comparing", "the", "index", "and", "term", "of", "the", "last", "entries", "in", "the", "existing", "logs", ".", "If", "the", "logs", "have", "last", "entries", "with", "different", "terms", "then", "the", "log", "with", "the", "later", "term", "is", "more", "up", "-", "to", "-", "date", ".", "If", "the", "logs", "end", "with", "the", "same", "term", "then", "whichever", "log", "has", "the", "larger", "lastIndex", "is", "more", "up", "-", "to", "-", "date", ".", "If", "the", "logs", "are", "the", "same", "the", "given", "log", "is", "up", "-", "to", "-", "date", "." ]
[ "func", "(", "l", "*", "raftLog", ")", "isUpToDate", "(", "lasti", ",", "<mask>", "uint64", ")", "bool", "{", "return", "term", ">", "l", ".", "lastTerm", "(", ")", "||", "(", "term", "==", "l", ".", "lastTerm", "(", ")", "&&", "lasti", ">=", "l", ".", "lastIndex", "(", ")", ")", "\n", "}" ]
19,848
all-19849
[ "Do", "executes", "Debugger", ".", "setBreakpointsActive", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetBreakpointsActiveParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetBreakpointsActive", ",", "p", ",", "nil", ")", "\n", "}" ]
19,849
all-19850
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetAutoAttachParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget2", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
19,850
all-19851
[ "getAccount", "returns", "gcloud", "config", "get", "-", "value", "core", "/", "account" ]
[ "func", "getAccount", "(", ")", "(", "string", ",", "error", ")", "{", "args", ",", "cmd", ":=", "<mask>", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "b", ",", "err", ":=", "cmd", ".", "Output", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "strings", ".", "Join", "(", "args", ",", "\"", "\"", ")", ",", "err", ")", "\n", "}", "\n", "return", "strings", ".", "TrimSpace", "(", "string", "(", "b", ")", ")", ",", "nil", "\n", "}" ]
19,851
all-19852
[ "setAccount", "calls", "gcloud", "config", "set", "core", "/", "account" ]
[ "func", "setAccount", "(", "account", "string", ")", "error", "{", "_", ",", "cmd", ":=", "command", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "<mask>", ")", "\n", "return", "cmd", ".", "Run", "(", ")", "\n", "}" ]
19,852
all-19853
[ "listGcsObjects", "get", "the", "slice", "of", "gcs", "objects", "under", "a", "given", "path" ]
[ "func", "listGcsObjects", "(", "ctx", "context", ".", "Context", ",", "<mask>", "*", "storage", ".", "Client", ",", "bucketName", ",", "prefix", ",", "delim", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "var", "objects", "[", "]", "string", "\n", "it", ":=", "client", ".", "Bucket", "(", "bucketName", ")", ".", "Objects", "(", "ctx", ",", "&", "storage", ".", "Query", "{", "Prefix", ":", "prefix", ",", "Delimiter", ":", "delim", ",", "}", ")", "\n\n", "for", "{", "attrs", ",", "err", ":=", "it", ".", "Next", "(", ")", "\n", "if", "err", "==", "iterator", ".", "Done", "{", "break", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "return", "objects", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n\n", "if", "attrs", ".", "Prefix", "!=", "\"", "\"", "{", "objects", "=", "append", "(", "objects", ",", "path", ".", "Base", "(", "attrs", ".", "Prefix", ")", ")", "\n", "}", "\n", "}", "\n", "logrus", ".", "Info", "(", "\"", "\"", ")", "\n", "return", "objects", ",", "nil", "\n", "}" ]
19,853
all-19854
[ "sendAcks", "sends", "ack", "requests", "to", "ACS" ]
[ "func", "(", "refreshHandler", "*", "refreshCredentialsHandler", ")", "sendAcks", "(", ")", "{", "for", "{", "select", "{", "<mask>", "ack", ":=", "<-", "refreshHandler", ".", "ackRequest", ":", "refreshHandler", ".", "ackMessage", "(", "ack", ")", "\n", "case", "<-", "refreshHandler", ".", "ctx", ".", "Done", "(", ")", ":", "return", "\n", "}", "\n", "}", "\n", "}" ]
19,854
all-19855
[ "Do", "executes", "DOM", ".", "setAttributesAsText", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetAttributesAsTextParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetAttributesAsText", ",", "p", ",", "nil", ")", "\n", "}" ]
19,855
all-19856
[ "GetPrivateImage", "is", "similar", "to", "GetImage", "but", "allows", "passing", "a", "secret", "download", "token" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "GetPrivateImage", "(", "fingerprint", "string", ",", "secret", "string", ")", "(", "*", "api", ".", "Image", ",", "string", ",", "error", ")", "{", "image", ":=", "api", ".", "Image", "{", "}", "\n\n", "// Build the API path", "path", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "url", ".", "QueryEscape", "(", "fingerprint", ")", ")", "\n", "var", "err", "error", "\n", "path", ",", "err", "=", "r", ".", "setQueryAttributes", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n\n", "if", "secret", "!=", "\"", "\"", "{", "path", ",", "err", "=", "setQueryParam", "(", "path", ",", "\"", "\"", ",", "secret", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "}", "\n\n", "// Fetch the raw value", "etag", ",", "err", ":=", "r", ".", "queryStruct", "(", "\"", "\"", ",", "path", ",", "nil", ",", "\"", "\"", ",", "&", "image", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n\n", "return", "&", "<mask>", ",", "etag", ",", "nil", "\n", "}" ]
19,856
all-19857
[ "SetValue", "provides", "a", "mock", "function", "with", "given", "fields", ":", "_a0", "_a1", "_a2", "_a3" ]
[ "func", "(", "_m", "*", "InstrumentedStorage", ")", "SetValue", "(", "_a0", "context", ".", "Context", ",", "_a1", "string", ",", "_a2", "string", ",", "_a3", "string", ")", "(", "map", "[", "string", "]", "string", ",", "error", ")", "{", "ret", ":=", "_m", ".", "Called", "(", "_a0", ",", "_a1", ",", "_a2", ",", "_a3", ")", "\n\n", "var", "r0", "map", "[", "string", "]", "string", "\n", "if", "rf", ",", "ok", ":=", "ret", ".", "Get", "(", "0", ")", ".", "(", "func", "(", "context", ".", "Context", ",", "string", ",", "string", ",", "string", ")", "map", "[", "string", "]", "string", ")", ";", "ok", "{", "r0", "=", "rf", "(", "_a0", ",", "_a1", ",", "_a2", ",", "_a3", ")", "\n", "}", "else", "{", "if", "ret", ".", "Get", "(", "0", ")", "!=", "nil", "{", "r0", "=", "ret", ".", "Get", "(", "0", ")", ".", "(", "map", "[", "string", "]", "string", ")", "\n", "}", "\n", "}", "\n\n", "var", "r1", "error", "\n", "if", "rf", ",", "ok", ":=", "ret", ".", "Get", "(", "1", ")", ".", "(", "func", "(", "context", ".", "<mask>", ",", "string", ",", "string", ",", "string", ")", "error", ")", ";", "ok", "{", "r1", "=", "rf", "(", "_a0", ",", "_a1", ",", "_a2", ",", "_a3", ")", "\n", "}", "else", "{", "r1", "=", "ret", ".", "Error", "(", "1", ")", "\n", "}", "\n\n", "return", "r0", ",", "r1", "\n", "}" ]
19,857
all-19858
[ "StoragePoolID", "returns", "the", "ID", "of", "the", "pool", "with", "the", "given", "name", "." ]
[ "func", "(", "c", "*", "ClusterTx", ")", "StoragePoolID", "(", "name", "string", ")", "(", "int64", ",", "error", ")", "{", "stmt", ":=", "\"", "\"", "\n", "ids", ",", "err", ":=", "query", ".", "SelectIntegers", "(", "c", ".", "tx", ",", "stmt", ",", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "err", "\n", "}", "\n", "switch", "len", "(", "<mask>", ")", "{", "case", "0", ":", "return", "-", "1", ",", "ErrNoSuchObject", "\n", "case", "1", ":", "return", "int64", "(", "ids", "[", "0", "]", ")", ",", "nil", "\n", "default", ":", "return", "-", "1", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "}" ]
19,858
all-19859
[ "New", "returns", "a", "session", "for", "the", "given", "name", "without", "adding", "it", "to", "the", "registry", "." ]
[ "func", "(", "m", "*", "MongoStore", ")", "New", "(", "r", "*", "http", ".", "Request", ",", "name", "string", ")", "(", "*", "sessions", ".", "Session", ",", "error", ")", "{", "session", ":=", "sessions", ".", "NewSession", "(", "m", ",", "name", ")", "\n", "session", ".", "Options", "=", "&", "sessions", ".", "Options", "{", "Path", ":", "m", ".", "Options", ".", "Path", ",", "MaxAge", ":", "m", ".", "Options", ".", "MaxAge", ",", "Domain", ":", "m", ".", "Options", ".", "Domain", ",", "Secure", ":", "m", ".", "Options", ".", "Secure", ",", "HttpOnly", ":", "m", ".", "Options", ".", "HttpOnly", ",", "}", "\n", "session", ".", "IsNew", "=", "true", "\n", "var", "err", "error", "\n", "if", "cook", ",", "errToken", ":=", "m", ".", "Token", ".", "GetToken", "(", "r", ",", "name", ")", ";", "errToken", "==", "nil", "{", "err", "=", "securecookie", ".", "DecodeMulti", "(", "name", ",", "cook", ",", "&", "session", ".", "ID", ",", "m", ".", "Codecs", "...", ")", "\n", "if", "err", "==", "nil", "{", "err", "=", "m", ".", "load", "(", "session", ")", "\n", "if", "err", "==", "nil", "{", "<mask>", ".", "IsNew", "=", "false", "\n", "}", "else", "{", "err", "=", "nil", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "session", ",", "err", "\n", "}" ]
19,859
all-19860
[ "Do", "executes", "Tethering", ".", "unbind", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "UnbindParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandUnbind", ",", "p", ",", "nil", ")", "\n", "}" ]
19,860
all-19861
[ "PrintServerInfo", "prints", "out", "information", "about", "the", "server", "." ]
[ "func", "PrintServerInfo", "(", "c", "lxd", ".", "ContainerServer", ")", "error", "{", "server", ",", "_", ",", "err", ":=", "c", ".", "GetServer", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "env", ":=", "server", ".", "Environment", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "Server", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "ServerVersion", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "Kernel", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "KernelArchitecture", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "KernelVersion", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "<mask>", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "StorageVersion", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "Driver", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "env", ".", "DriverVersion", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ")", "\n", "return", "nil", "\n", "}" ]
19,861
all-19862
[ "Frames", "returns", "a", "slice", "of", "the", "frame", "numbers", "that", "were", "parsed", "from", "the", "original", "frame", "range", "string", ".", "Warning", ":", "This", "allocates", "a", "slice", "containing", "number", "of", "elements", "equal", "to", "the", "Len", "()", "of", "the", "range", ".", "If", "the", "sequence", "is", "massive", "it", "could", "hit", "slice", "limits", ".", "Better", "to", "use", "IterFrames", "()" ]
[ "func", "(", "s", "*", "FrameSet", ")", "Frames", "(", ")", "[", "]", "int", "{", "size", ":=", "s", ".", "rangePtr", ".", "Len", "(", ")", "\n", "frames", ":=", "make", "(", "[", "]", "int", ",", "size", ",", "size", ")", "\n", "i", ":=", "0", "\n", "for", "it", ":=", "s", ".", "rangePtr", ".", "IterValues", "(", ")", ";", "!", "<mask>", ".", "IsDone", "(", ")", ";", "{", "frames", "[", "i", "]", "=", "it", ".", "Next", "(", ")", "\n", "i", "++", "\n", "}", "\n", "return", "frames", "\n", "}" ]
19,862
all-19863
[ "OnInvalidateShortIDs", "adds", "a", "new", "function", "to", "a", "set", "of", "functions", "that", "will", "be", "executed", "on", "all", "subsequent", "GC", "runs", "when", "the", "mapping", "from", "short", "IDs", "to", "peers", "has", "changed", "." ]
[ "func", "(", "peers", "*", "Peers", ")", "OnInvalidateShortIDs", "(", "callback", "func", "(", ")", ")", "{", "peers", ".", "Lock", "(", ")", "\n", "defer", "peers", ".", "Unlock", "(", ")", "\n\n", "// Safe, as in OnGC", "peers", ".", "onInvalidateShortIDs", "=", "append", "(", "peers", ".", "onInvalidateShortIDs", ",", "<mask>", ")", "\n", "}" ]
19,863
all-19864
[ "RetryKVClient", "implements", "a", "KVClient", "." ]
[ "func", "RetryKVClient", "(", "c", "*", "<mask>", ")", "pb", ".", "KVClient", "{", "return", "&", "retryKVClient", "{", "kc", ":", "pb", ".", "NewKVClient", "(", "c", ".", "conn", ")", ",", "}", "\n", "}" ]
19,864
all-19865
[ "ReduceDelta", "lowers", "the", "buffered", "time", "delta", "for", "the", "current", "SeriesIterator", "only", "." ]
[ "func", "(", "b", "*", "BufferedSeriesIterator", ")", "ReduceDelta", "(", "delta", "int64", ")", "bool", "{", "<mask>", "b", ".", "buf", ".", "reduceDelta", "(", "delta", ")", "\n", "}" ]
19,865
all-19866
[ "native", "()", "returns", "a", "pointer", "to", "the", "underlying", "GApplication", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "native", "(", ")", "*", "C", ".", "GApplication", "{", "if", "v", "==", "nil", "||", "v", ".", "GObject", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "C", ".", "toGApplication", "(", "unsafe", ".", "Pointer", "(", "v", ".", "GObject", ")", ")", "\n", "}" ]
19,866
all-19867
[ "GetFile", "executes", "get", "request", "and", "returns", "a", "file", "like", "object", "f", "err", ":", "=", "c", ".", "GetFile", "(", "files", "report", ".", "txt", ")", "//", "returns", "/", "v1", "/", "files", "/", "report", ".", "txt" ]
[ "func", "(", "c", "*", "Client", ")", "GetFile", "(", "ctx", "context", ".", "<mask>", ",", "endpoint", "string", ",", "params", "url", ".", "Values", ")", "(", "*", "FileResponse", ",", "error", ")", "{", "// If the sanitizer is enabled, make sure the requested path is safe.", "if", "c", ".", "sanitizerEnabled", "{", "err", ":=", "isPathSafe", "(", "endpoint", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "baseUrl", ",", "err", ":=", "url", ".", "Parse", "(", "endpoint", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "baseUrl", ".", "RawQuery", "=", "params", ".", "Encode", "(", ")", "\n", "req", ",", "err", ":=", "http", ".", "NewRequest", "(", "http", ".", "MethodGet", ",", "baseUrl", ".", "String", "(", ")", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "req", "=", "req", ".", "WithContext", "(", "ctx", ")", "\n", "c", ".", "addAuth", "(", "req", ")", "\n", "tracer", ":=", "c", ".", "newTracer", "(", ")", "\n", "tracer", ".", "Start", "(", "req", ")", "\n", "re", ",", "err", ":=", "c", ".", "client", ".", "Do", "(", "req", ")", "\n", "if", "err", "!=", "nil", "{", "tracer", ".", "Done", "(", "nil", ",", "err", ")", "\n", "return", "nil", ",", "err", "\n", "}", "\n", "tracer", ".", "Done", "(", "&", "Response", "{", "code", ":", "re", ".", "StatusCode", "}", ",", "err", ")", "\n", "return", "&", "FileResponse", "{", "code", ":", "re", ".", "StatusCode", ",", "headers", ":", "re", ".", "Header", ",", "body", ":", "re", ".", "Body", ",", "}", ",", "nil", "\n", "}" ]
19,867
all-19868
[ "NewClient", "creates", "a", "new", "GitHub", "GraphQL", "API", "v4", "client", "with", "the", "provided", "http", ".", "Client", ".", "If", "httpClient", "is", "nil", "then", "http", ".", "DefaultClient", "is", "used", ".", "Note", "that", "GitHub", "GraphQL", "API", "v4", "requires", "authentication", "so", "the", "provided", "http", ".", "Client", "is", "expected", "to", "take", "care", "of", "that", "." ]
[ "func", "NewClient", "(", "httpClient", "*", "http", ".", "<mask>", ")", "*", "Client", "{", "return", "&", "Client", "{", "client", ":", "graphql", ".", "NewClient", "(", "\"", "\"", ",", "httpClient", ")", ",", "}", "\n", "}" ]
19,868
all-19869
[ "Do", "executes", "Input", ".", "synthesizePinchGesture", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SynthesizePinchGestureParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSynthesizePinchGesture", ",", "p", ",", "nil", ")", "\n", "}" ]
19,869
all-19870
[ "ConnectAfter", "is", "a", "wrapper", "around", "g_signal_connect_closure", "()", ".", "f", "must", "be", "a", "function", "with", "a", "signaure", "matching", "the", "callback", "signature", "for", "detailedSignal", ".", "userData", "must", "either", "0", "or", "1", "elements", "which", "can", "be", "optionally", "passed", "to", "f", ".", "If", "f", "takes", "less", "arguments", "than", "it", "is", "passed", "from", "the", "GLib", "runtime", "the", "extra", "arguments", "are", "ignored", ".", "Arguments", "for", "f", "must", "be", "a", "matching", "Go", "equivalent", "type", "for", "the", "C", "callback", "or", "an", "interface", "type", "which", "the", "value", "may", "be", "packed", "in", ".", "If", "the", "type", "is", "not", "suitable", "a", "runtime", "panic", "will", "occur", "when", "the", "signal", "is", "emitted", ".", "The", "difference", "between", "Connect", "and", "ConnectAfter", "is", "that", "the", "latter", "will", "be", "invoked", "after", "the", "default", "handler", "not", "before", "." ]
[ "func", "(", "v", "*", "Object", ")", "ConnectAfter", "(", "detailedSignal", "string", ",", "f", "<mask>", "{", "}", ",", "userData", "...", "interface", "{", "}", ")", "(", "SignalHandle", ",", "error", ")", "{", "return", "v", ".", "connectClosure", "(", "true", ",", "detailedSignal", ",", "f", ",", "userData", "...", ")", "\n", "}" ]
19,870
all-19871
[ "playNote", "plays", "piano", "sound", "with", "the", "given", "frequency", "." ]
[ "func", "playNote", "(", "freq", "float64", ")", "{", "f", ":=", "int", "(", "freq", ")", "\n", "p", ",", "_", ":=", "<mask>", ".", "NewPlayerFromBytes", "(", "audioContext", ",", "pianoNoteSamples", "[", "f", "]", ")", "\n", "p", ".", "Play", "(", ")", "\n", "}" ]
19,871
all-19872
[ "////////////////////////////////////////////////////////////////" ]
[ "func", "(", "aci", "*", "Aci", ")", "tarAci", "(", "path", "string", ")", "error", "{", "tar", ":=", "new", "(", "archivex", ".", "TarFile", ")", "\n", "if", "err", ":=", "tar", ".", "Create", "(", "path", "+", "pathImageAci", ")", ";", "err", "!=", "nil", "{", "return", "errs", ".", "WithEF", "(", "err", ",", "aci", ".", "fields", ".", "WithField", "(", "\"", "\"", ",", "path", "+", "pathImageAci", ")", ",", "\"", "\"", ")", "\n", "}", "\n", "if", "err", ":=", "tar", ".", "AddFile", "(", "path", "+", "common", ".", "PathManifest", ")", ";", "err", "!=", "nil", "{", "return", "errs", ".", "WithEF", "(", "err", ",", "aci", ".", "fields", ".", "WithField", "(", "\"", "\"", ",", "path", "+", "common", ".", "PathManifest", ")", ",", "\"", "\"", ")", "\n", "}", "\n", "if", "err", ":=", "tar", ".", "AddAll", "(", "<mask>", "+", "common", ".", "PathRootfs", ",", "true", ")", ";", "err", "!=", "nil", "{", "return", "errs", ".", "WithEF", "(", "err", ",", "aci", ".", "fields", ".", "WithField", "(", "\"", "\"", ",", "path", "+", "common", ".", "PathRootfs", ")", ",", "\"", "\"", ")", "\n", "}", "\n", "if", "err", ":=", "tar", ".", "Close", "(", ")", ";", "err", "!=", "nil", "{", "return", "errs", ".", "WithEF", "(", "err", ",", "aci", ".", "fields", ".", "WithField", "(", "\"", "\"", ",", "path", ")", ",", "\"", "\"", ")", "\n", "}", "\n", "os", ".", "Rename", "(", "path", "+", "pathImageAci", "+", "\"", "\"", ",", "path", "+", "pathImageAci", ")", "\n", "return", "nil", "\n", "}" ]
19,872
all-19873
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "AllowTrustResultCode" ]
[ "func", "(", "e", "AllowTrustResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "<mask>", ":=", "allowTrustResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
19,873
all-19874
[ "verifyAndExtractSignature", "verifies", "that", "unverifiedSignature", "has", "been", "signed", "and", "that", "its", "principial", "components", "match", "expected", "values", "both", "as", "specified", "by", "rules", "and", "returns", "it" ]
[ "func", "verifyAndExtractSignature", "(", "mech", "SigningMechanism", ",", "unverifiedSignature", "[", "]", "byte", ",", "rules", "signatureAcceptanceRules", ")", "(", "*", "Signature", ",", "error", ")", "{", "signed", ",", "keyIdentity", ",", "err", ":=", "mech", ".", "Verify", "(", "unverifiedSignature", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "err", ":=", "rules", ".", "validateKeyIdentity", "(", "keyIdentity", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "unmatchedSignature", "untrustedSignature", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "signed", ",", "&", "unmatchedSignature", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "InvalidSignatureError", "{", "msg", ":", "err", ".", "<mask>", "(", ")", "}", "\n", "}", "\n", "if", "err", ":=", "rules", ".", "validateSignedDockerManifestDigest", "(", "unmatchedSignature", ".", "UntrustedDockerManifestDigest", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "err", ":=", "rules", ".", "validateSignedDockerReference", "(", "unmatchedSignature", ".", "UntrustedDockerReference", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "// signatureAcceptanceRules have accepted this value.", "return", "&", "Signature", "{", "DockerManifestDigest", ":", "unmatchedSignature", ".", "UntrustedDockerManifestDigest", ",", "DockerReference", ":", "unmatchedSignature", ".", "UntrustedDockerReference", ",", "}", ",", "nil", "\n", "}" ]
19,874
all-19875
[ "stop", "proxy", "etcd", "delete", "data", "directory" ]
[ "func", "(", "srv", "*", "Server", ")", "handle_SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT", "(", ")", "(", "*", "rpcpb", ".", "Response", ",", "error", ")", "{", "err", ":=", "srv", ".", "stopEtcd", "(", "syscall", ".", "SIGQUIT", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "srv", ".", "etcdServer", "!=", "nil", "{", "srv", ".", "etcdServer", ".", "GetLogger", "(", ")", ".", "Sync", "(", ")", "\n", "}", "else", "{", "srv", ".", "etcdLogFile", ".", "Sync", "(", ")", "\n", "srv", ".", "etcdLogFile", ".", "Close", "(", ")", "\n", "}", "\n\n", "err", "=", "os", ".", "RemoveAll", "(", "srv", ".", "Member", ".", "BaseDir", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "srv", ".", "lg", ".", "Info", "(", "\"", "\"", ",", "zap", ".", "String", "(", "\"", "\"", ",", "srv", ".", "Member", ".", "BaseDir", ")", ")", "\n\n", "// stop agent server", "srv", ".", "Stop", "(", ")", "\n\n", "return", "&", "rpcpb", ".", "Response", "{", "Success", ":", "true", ",", "<mask>", ":", "\"", "\"", ",", "}", ",", "nil", "\n", "}" ]
19,875
all-19876
[ "NewConsulEngine", "creates", "and", "return", "a", "new", "engine", "configured", "with", "config", "." ]
[ "func", "NewConsulEngine", "(", "config", "ConsulConfig", ")", "*", "ConsulEngine", "{", "if", "len", "(", "config", ".", "Address", ")", "==", "0", "{", "config", ".", "<mask>", "=", "DefaultConsulAddress", "\n", "}", "\n\n", "if", "len", "(", "config", ".", "Namespace", ")", "==", "0", "{", "config", ".", "Namespace", "=", "DefaultConsulNamespace", "\n", "}", "\n\n", "if", "config", ".", "NodeTimeout", "==", "0", "{", "config", ".", "NodeTimeout", "=", "DefaultLocalEngineNodeTimeout", "\n", "}", "\n\n", "if", "config", ".", "TombstoneTimeout", "==", "0", "{", "config", ".", "TombstoneTimeout", "=", "DefaultLocalEngineTombstoneTimeout", "\n", "}", "\n\n", "if", "!", "strings", ".", "Contains", "(", "config", ".", "Address", ",", "\"", "\"", ")", "{", "config", ".", "Address", "=", "\"", "\"", "+", "config", ".", "Address", "\n", "}", "\n\n", "return", "&", "ConsulEngine", "{", "client", ":", "http", ".", "Client", "{", "Transport", ":", "config", ".", "Transport", "}", ",", "address", ":", "config", ".", "Address", ",", "namespace", ":", "config", ".", "Namespace", ",", "nodeTimeout", ":", "config", ".", "NodeTimeout", ",", "tombTimeout", ":", "config", ".", "TombstoneTimeout", ",", "}", "\n", "}" ]
19,876
all-19877
[ "MustGetInt", "fetches", "the", "config", "and", "parses", "it", "into", "an", "int", ".", "Panics", "on", "failure", "." ]
[ "func", "(", "c", "*", "cachedLoader", ")", "MustGetInt", "(", "key", "string", ")", "int", "{", "b", ",", "err", ":=", "c", ".", "Get", "(", "key", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "key", ",", "err", ")", ")", "\n", "}", "\n\n", "var", "<mask>", "int", "\n", "err", "=", "json", ".", "Unmarshal", "(", "b", ",", "&", "ret", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "key", ",", "err", ")", ")", "\n", "}", "\n", "return", "ret", "\n", "}" ]
19,877
all-19878
[ "LoadMacroData", "parses", "a", "bzl", "file", "from", "a", "byte", "slice", "and", "scans", "for", "the", "load", "statements", "and", "the", "rules", "called", "from", "the", "given", "Starlark", "function", ".", "If", "there", "is", "no", "matching", "function", "name", "then", "a", "new", "function", "will", "be", "created", "and", "added", "to", "the", "File", "the", "next", "time", "Sync", "is", "called", ".", "The", "function", "s", "syntax", "tree", "will", "be", "returned", "within", "File", "and", "can", "be", "modified", "by", "Sync", "and", "Save", "calls", "." ]
[ "func", "LoadMacroData", "(", "path", ",", "pkg", ",", "defName", "string", ",", "<mask>", "[", "]", "byte", ")", "(", "*", "File", ",", "error", ")", "{", "ast", ",", "err", ":=", "bzl", ".", "ParseBzl", "(", "path", ",", "data", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "ScanASTBody", "(", "pkg", ",", "defName", ",", "ast", ")", ",", "nil", "\n", "}" ]
19,878
all-19879
[ "DatabaseSnapshot", "retrieves", "a", "detailed", "view", "of", "one", "database", "snapshot" ]
[ "func", "(", "c", "*", "Client", ")", "DatabaseSnapshot", "(", "identifier", "string", ")", "(", "*", "DatabaseSnapshot", ",", "error", ")", "{", "database_snapshot", ":=", "<mask>", "(", "DatabaseSnapshot", ")", "\n", "_", ",", "err", ":=", "c", ".", "MakeApiRequest", "(", "\"", "\"", ",", "\"", "\"", "+", "identifier", ",", "nil", ",", "database_snapshot", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "database_snapshot", ",", "err", "\n", "}" ]
19,879
all-19880
[ "Get", "a", "shared", "access", "signature", "(", "SAS", ")", "string", "for", "use", "with", "a", "specific", "Azure", "Blob", "Storage", "container", ".", "The", "level", "parameter", "can", "be", "read", "-", "write", "or", "read", "-", "only", "and", "determines", "which", "type", "of", "credentials", "are", "returned", ".", "If", "level", "is", "read", "-", "write", "it", "will", "create", "the", "container", "if", "it", "doesn", "t", "already", "exist", ".", "Required", "scopes", ":", "If", "levelIsReadOnly", ":", "Any", "of", ":", "-", "auth", ":", "azure", "-", "container", ":", "read", "-", "only", ":", "<account", ">", "/", "<container", ">", "-", "auth", ":", "azure", "-", "container", ":", "read", "-", "write", ":", "<account", ">", "/", "<container", ">", "See", "#azureContainerSAS" ]
[ "func", "(", "auth", "*", "Auth", ")", "AzureContainerSAS", "(", "<mask>", ",", "container", ",", "level", "string", ")", "(", "*", "AzureBlobSharedAccessSignature", ",", "error", ")", "{", "cd", ":=", "tcclient", ".", "Client", "(", "*", "auth", ")", "\n", "responseObject", ",", "_", ",", "err", ":=", "(", "&", "cd", ")", ".", "APICall", "(", "nil", ",", "\"", "\"", ",", "\"", "\"", "+", "url", ".", "QueryEscape", "(", "account", ")", "+", "\"", "\"", "+", "url", ".", "QueryEscape", "(", "container", ")", "+", "\"", "\"", "+", "url", ".", "QueryEscape", "(", "level", ")", ",", "new", "(", "AzureBlobSharedAccessSignature", ")", ",", "nil", ")", "\n", "return", "responseObject", ".", "(", "*", "AzureBlobSharedAccessSignature", ")", ",", "err", "\n", "}" ]
19,880
all-19881
[ "NewUnordered", "creates", "a", "new", "unordered", "hashtree", "." ]
[ "func", "NewUnordered", "(", "root", "string", ")", "*", "Unordered", "{", "return", "&", "Unordered", "{", "fs", ":", "make", "(", "map", "[", "string", "]", "*", "NodeProto", ")", ",", "root", ":", "clean", "(", "<mask>", ")", ",", "}", "\n", "}" ]
19,881
all-19882
[ "RunCursorAt", "executes", "the", "select", "list", "initializing", "the", "cursor", "to", "the", "given", "position", ".", "Invalid", "cursor", "positions", "will", "be", "clamped", "to", "valid", "values", ".", "It", "displays", "the", "label", "and", "the", "list", "of", "items", "asking", "the", "user", "to", "chose", "any", "value", "within", "to", "list", ".", "Run", "will", "keep", "the", "prompt", "alive", "until", "it", "has", "been", "canceled", "from", "the", "command", "prompt", "or", "it", "has", "received", "a", "valid", "value", ".", "It", "will", "return", "the", "value", "and", "an", "error", "if", "any", "occurred", "during", "the", "select", "s", "execution", "." ]
[ "func", "(", "s", "*", "Select", ")", "RunCursorAt", "(", "cursorPos", ",", "scroll", "int", ")", "(", "int", ",", "string", ",", "error", ")", "{", "if", "s", ".", "Size", "==", "0", "{", "s", ".", "Size", "=", "5", "\n", "}", "\n\n", "l", ",", "err", ":=", "<mask>", ".", "New", "(", "s", ".", "Items", ",", "s", ".", "Size", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "l", ".", "Searcher", "=", "s", ".", "Searcher", "\n\n", "s", ".", "list", "=", "l", "\n\n", "s", ".", "setKeys", "(", ")", "\n\n", "err", "=", "s", ".", "prepareTemplates", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "return", "s", ".", "innerRun", "(", "cursorPos", ",", "scroll", ",", "' '", ")", "\n", "}" ]
19,882
all-19883
[ "RL10", "authenticator", "uses", "special", "header" ]
[ "func", "(", "a", "*", "rl10Authenticator", ")", "Sign", "(", "r", "*", "http", ".", "<mask>", ")", "error", "{", "r", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "a", ".", "secret", ")", "\n", "return", "nil", "\n", "}" ]
19,883
all-19884
[ "GetSingleLineMode", "is", "a", "wrapper", "around", "gtk_label_get_single_line_mode", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetSingleLineMode", "(", ")", "bool", "{", "c", ":=", "C", ".", "gtk_label_get_single_line_mode", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "gobool", "(", "c", ")", "\n", "}" ]
19,884
all-19885
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "InternalPropertyDescriptor", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime18", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
19,885
all-19886
[ "WarpPerspective", "applies", "a", "perspective", "transformation", "to", "an", "image", ".", "Parameters", ":", "src", "-", "input", "image", "dst", "–", "output", "image", "mapMatrix", "–", "3x3", "transformation", "matrix", "flags", "–", "combination", "of", "interpolation", "methods", ".", "In", "the", "C", "version", "it", "is", "flags", "=", "CV_INTER_LINEAR", "+", "CV_WARP_FILL_OUTLIERS", "by", "default", "fillVal", "-", "In", "the", "C", "version", "it", "is", "fillval", "=", "(", "0", "0", "0", "0", ")", "by", "default" ]
[ "func", "WarpPerspective", "(", "src", ",", "dst", "*", "IplImage", ",", "mapMatrix", "*", "Mat", ",", "flags", "int", ",", "fillVal", "Scalar", ")", "{", "C", ".", "cvWarpPerspective", "(", "unsafe", ".", "Pointer", "(", "src", ")", ",", "unsafe", ".", "Pointer", "(", "dst", ")", ",", "(", "*", "C", ".", "struct_CvMat", ")", "(", "mapMatrix", ")", ",", "C", ".", "int", "(", "<mask>", ")", ",", "(", "C", ".", "CvScalar", ")", "(", "fillVal", ")", ")", "\n", "}" ]
19,886
all-19887
[ "InsertColumn", "is", "a", "wrapper", "around", "gtk_tree_view_insert_column", "()", "." ]
[ "func", "(", "v", "*", "TreeView", ")", "InsertColumn", "(", "column", "*", "TreeViewColumn", ",", "pos", "int", ")", "int", "{", "return", "int", "(", "C", ".", "gtk_tree_view_insert_column", "(", "v", ".", "native", "(", ")", ",", "column", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "<mask>", ")", ")", ")", "\n", "}" ]
19,887
all-19888
[ "FilterGet", "provides", "a", "mock", "function", "with", "given", "fields", ":", "filter", "store", "dst", "opts" ]
[ "func", "(", "_m", "*", "ObjectStore", ")", "FilterGet", "(", "<mask>", "map", "[", "string", "]", "interface", "{", "}", ",", "store", "string", ",", "dst", "interface", "{", "}", ",", "opts", "gostore", ".", "ObjectStoreOptions", ")", "error", "{", "ret", ":=", "_m", ".", "Called", "(", "filter", ",", "store", ",", "dst", ",", "opts", ")", "\n\n", "var", "r0", "error", "\n", "if", "rf", ",", "ok", ":=", "ret", ".", "Get", "(", "0", ")", ".", "(", "func", "(", "map", "[", "string", "]", "interface", "{", "}", ",", "string", ",", "interface", "{", "}", ",", "gostore", ".", "ObjectStoreOptions", ")", "error", ")", ";", "ok", "{", "r0", "=", "rf", "(", "filter", ",", "store", ",", "dst", ",", "opts", ")", "\n", "}", "else", "{", "r0", "=", "ret", ".", "Error", "(", "0", ")", "\n", "}", "\n\n", "return", "r0", "\n", "}" ]
19,888
all-19889
[ "strictUnmarshalJSON", "is", "UnmarshalJSON", "except", "that", "it", "may", "return", "the", "internal", "jsonFormatError", "error", "type", ".", "Splitting", "it", "into", "a", "separate", "function", "allows", "us", "to", "do", "the", "jsonFormatError", "→", "InvalidSignatureError", "in", "a", "single", "place", "the", "caller", "." ]
[ "func", "(", "s", "*", "untrustedSignature", ")", "strictUnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "critical", ",", "optional", "json", ".", "RawMessage", "\n", "if", "err", ":=", "paranoidUnmarshalJSONObjectExactFields", "(", "data", ",", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", "&", "critical", ",", "\"", "\"", ":", "&", "optional", ",", "}", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "var", "creatorID", "string", "\n", "var", "timestamp", "float64", "\n", "var", "gotCreatorID", ",", "gotTimestamp", "=", "false", ",", "false", "\n", "if", "err", ":=", "paranoidUnmarshalJSONObject", "(", "optional", ",", "func", "(", "key", "string", ")", "interface", "{", "}", "{", "switch", "key", "{", "case", "\"", "\"", ":", "gotCreatorID", "=", "true", "\n", "return", "&", "creatorID", "\n", "case", "\"", "\"", ":", "gotTimestamp", "=", "true", "\n", "return", "&", "timestamp", "\n", "default", ":", "var", "ignore", "interface", "{", "}", "\n", "return", "&", "ignore", "\n", "}", "\n", "}", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "gotCreatorID", "{", "s", ".", "UntrustedCreatorID", "=", "&", "creatorID", "\n", "}", "\n", "if", "gotTimestamp", "{", "intTimestamp", ":=", "int64", "(", "timestamp", ")", "\n", "if", "float64", "(", "intTimestamp", ")", "!=", "timestamp", "{", "return", "InvalidSignatureError", "{", "msg", ":", "\"", "\"", "}", "\n", "}", "\n", "s", ".", "UntrustedTimestamp", "=", "&", "intTimestamp", "\n", "}", "\n\n", "var", "t", "string", "\n", "var", "image", ",", "identity", "json", ".", "RawMessage", "\n", "if", "err", ":=", "paranoidUnmarshalJSONObjectExactFields", "(", "critical", ",", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", "&", "t", ",", "\"", "\"", ":", "&", "image", ",", "\"", "\"", ":", "&", "identity", ",", "}", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "t", "!=", "signatureType", "{", "return", "InvalidSignatureError", "{", "msg", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ")", "}", "\n", "}", "\n\n", "var", "digestString", "string", "\n", "if", "err", ":=", "paranoidUnmarshalJSONObjectExactFields", "(", "image", ",", "map", "[", "string", "]", "<mask>", "{", "}", "{", "\"", "\"", ":", "&", "digestString", ",", "}", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "s", ".", "UntrustedDockerManifestDigest", "=", "digest", ".", "Digest", "(", "digestString", ")", "\n\n", "return", "paranoidUnmarshalJSONObjectExactFields", "(", "identity", ",", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", "&", "s", ".", "UntrustedDockerReference", ",", "}", ")", "\n", "}" ]
19,889
all-19890
[ "Load", "loads", "all", "of", "the", "provided", "fields", "into", "l", ".", "It", "does", "not", "first", "reset", "*", "l", "to", "an", "empty", "slice", "." ]
[ "func", "(", "l", "*", "FieldList", ")", "Load", "(", "f", "[", "]", "<mask>", ",", "_", "*", "DocumentMetadata", ")", "error", "{", "*", "l", "=", "append", "(", "*", "l", ",", "f", "...", ")", "\n", "return", "nil", "\n", "}" ]
19,890
all-19891
[ "UnmarshalEasyJSON", "satisfies", "easyjson", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "ConnectionType", ")", "UnmarshalEasyJSON", "(", "in", "*", "jlexer", ".", "Lexer", ")", "{", "switch", "ConnectionType", "(", "in", ".", "String", "(", ")", ")", "{", "case", "ConnectionTypeNone", ":", "*", "t", "=", "ConnectionTypeNone", "\n", "case", "ConnectionTypeCellular2g", ":", "*", "t", "=", "ConnectionTypeCellular2g", "\n", "<mask>", "ConnectionTypeCellular3g", ":", "*", "t", "=", "ConnectionTypeCellular3g", "\n", "case", "ConnectionTypeCellular4g", ":", "*", "t", "=", "ConnectionTypeCellular4g", "\n", "case", "ConnectionTypeBluetooth", ":", "*", "t", "=", "ConnectionTypeBluetooth", "\n", "case", "ConnectionTypeEthernet", ":", "*", "t", "=", "ConnectionTypeEthernet", "\n", "case", "ConnectionTypeWifi", ":", "*", "t", "=", "ConnectionTypeWifi", "\n", "case", "ConnectionTypeWimax", ":", "*", "t", "=", "ConnectionTypeWimax", "\n", "case", "ConnectionTypeOther", ":", "*", "t", "=", "ConnectionTypeOther", "\n\n", "default", ":", "in", ".", "AddError", "(", "errors", ".", "New", "(", "\"", "\"", ")", ")", "\n", "}", "\n", "}" ]
19,891
all-19892
[ "copy", "pixels", "in", "the", "frame", "buffer" ]
[ "func", "CopyPixels", "(", "x", "int32", ",", "y", "int32", ",", "<mask>", "int32", ",", "height", "int32", ",", "xtype", "uint32", ")", "{", "syscall", ".", "Syscall6", "(", "gpCopyPixels", ",", "5", ",", "uintptr", "(", "x", ")", ",", "uintptr", "(", "y", ")", ",", "uintptr", "(", "width", ")", ",", "uintptr", "(", "height", ")", ",", "uintptr", "(", "xtype", ")", ",", "0", ")", "\n", "}" ]
19,892
all-19893
[ "bcastAppend", "sends", "RPC", "with", "entries", "to", "all", "peers", "that", "are", "not", "up", "-", "to", "-", "date", "according", "to", "the", "progress", "recorded", "in", "r", ".", "prs", "." ]
[ "func", "(", "r", "*", "raft", ")", "bcastAppend", "(", ")", "{", "r", ".", "forEachProgress", "(", "func", "(", "id", "uint64", ",", "_", "*", "Progress", ")", "{", "if", "<mask>", "==", "r", ".", "id", "{", "return", "\n", "}", "\n\n", "r", ".", "sendAppend", "(", "id", ")", "\n", "}", ")", "\n", "}" ]
19,893
all-19894
[ "RewriteReference", "will", "substitute", "the", "provided", "reference", "prefix", "to", "the", "endpoints", "location", "from", "the", "ref", "and", "creates", "a", "new", "named", "reference", "from", "it", ".", "The", "function", "errors", "if", "the", "newly", "created", "reference", "is", "not", "parsable", "." ]
[ "func", "(", "e", "*", "Endpoint", ")", "RewriteReference", "(", "ref", "reference", ".", "Named", ",", "prefix", "string", ")", "(", "reference", ".", "Named", ",", "error", ")", "{", "if", "ref", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "prefix", "==", "\"", "\"", "{", "return", "<mask>", ",", "nil", "\n", "}", "\n", "refString", ":=", "ref", ".", "String", "(", ")", "\n", "if", "refMatchesPrefix", "(", "refString", ",", "prefix", ")", "{", "newNamedRef", ":=", "strings", ".", "Replace", "(", "refString", ",", "prefix", ",", "e", ".", "Location", ",", "1", ")", "\n", "newParsedRef", ",", "err", ":=", "reference", ".", "ParseNamed", "(", "newNamedRef", ")", "\n", "if", "newParsedRef", "!=", "nil", "{", "logrus", ".", "Debugf", "(", "\"", "\"", ",", "refString", ",", "newParsedRef", ".", "String", "(", ")", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Wrapf", "(", "err", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "newParsedRef", ",", "nil", "\n", "}", "\n\n", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "prefix", ",", "refString", ")", "\n", "}" ]
19,894
all-19895
[ "NewTplFile", "cerates", "new", "template", "file", "with", "given", "name", "and", "data", "." ]
[ "func", "NewTplFile", "(", "name", "string", ",", "<mask>", "[", "]", "byte", ",", "ext", "string", ")", "*", "TplFile", "{", "return", "&", "TplFile", "{", "name", ",", "data", ",", "ext", "}", "\n", "}" ]
19,895
all-19896
[ "next", "advances", "the", "lexer", "position", "and", "returns", "the", "next", "rune", ".", "If", "the", "input", "does", "not", "have", "any", "more", "runes", "an", "eof", "is", "returned", "." ]
[ "func", "(", "l", "*", "Lexer", ")", "<mask>", "(", ")", "(", "r", "rune", ")", "{", "if", "l", ".", "Pos", ">=", "len", "(", "l", ".", "input", ")", "{", "l", ".", "Width", "=", "0", "\n", "return", "eof", "\n", "}", "\n", "r", ",", "l", ".", "Width", "=", "utf8", ".", "DecodeRuneInString", "(", "l", ".", "remaining", "(", ")", ")", "\n", "l", ".", "advance", "(", "l", ".", "Width", ")", "\n", "return", "\n", "}" ]
19,896
all-19897
[ "ServeMetrics", "serves", "Prometheus", "metrics", "endpoint", "on", "the", "provided", "net", ".", "Listener", "Use", "for", "long", "-", "running", "services", ".", "For", "cli", "tools", "use", "PushMetrics", "instead", "." ]
[ "func", "ServeMetrics", "(", "ctx", "context", ".", "<mask>", ",", "l", "net", ".", "Listener", ")", "error", "{", "return", "http", ".", "Serve", "(", "l", ",", "promhttp", ".", "Handler", "(", ")", ")", "\n", "}" ]
19,897
all-19898
[ "returns", "the", "phone", "number", "price", "by", "country" ]
[ "func", "(", "cpnps", "*", "CountryPhoneNumberPriceService", ")", "Get", "(", "ctx", "context", ".", "<mask>", ",", "isoCountry", "string", ")", "(", "*", "NumberPrice", ",", "error", ")", "{", "numberPrice", ":=", "new", "(", "NumberPrice", ")", "\n", "err", ":=", "cpnps", ".", "client", ".", "GetResource", "(", "ctx", ",", "phoneNumbersPathPart", "+", "\"", "\"", ",", "isoCountry", ",", "numberPrice", ")", "\n", "return", "numberPrice", ",", "err", "\n", "}" ]
19,898
all-19899
[ "LocalAddr", "implements", "net", ".", "PacketConn", "." ]
[ "func", "(", "p", "*", "Peer", ")", "LocalAddr", "(", ")", "net", ".", "Addr", "{", "return", "MeshAddr", "{", "PeerName", ":", "p", ".", "<mask>", ",", "PeerUID", ":", "p", ".", "uid", "}", "\n", "}" ]
19,899
all-19900
[ "IsGamepadButtonJustPressed", "returns", "a", "boolean", "value", "indicating", "whether", "the", "given", "gamepad", "button", "of", "the", "gamepad", "id", "is", "pressed", "just", "in", "the", "current", "frame", ".", "IsGamepadButtonJustPressed", "is", "concurrent", "safe", "." ]
[ "func", "IsGamepadButtonJustPressed", "(", "id", "int", ",", "<mask>", "ebiten", ".", "GamepadButton", ")", "bool", "{", "return", "GamepadButtonPressDuration", "(", "id", ",", "button", ")", "==", "1", "\n", "}" ]