id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
sequencelengths
1
418
pl_tokens
sequencelengths
22
4.98k
9,600
all-9601
[ "SetCookie", "sets", "key", ":", "value", "cookies", "." ]
[ "func", "(", "h", "*", "RequestHeader", ")", "SetCookie", "(", "key", ",", "<mask>", "string", ")", "{", "h", ".", "parseRawHeaders", "(", ")", "\n", "h", ".", "collectCookies", "(", ")", "\n", "h", ".", "cookies", "=", "setArg", "(", "h", ".", "cookies", ",", "key", ",", "value", ",", "argsHasValue", ")", "\n", "}" ]
9,601
all-9602
[ "HasType", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "g", "*", "GroupDefinition", ")", "HasType", "(", ")", "bool", "{", "if", "g", "!=", "nil", "&&", "g", ".", "<mask>", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
9,602
all-9603
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "the", "current", "program", "object" ]
[ "func", "UniformMatrix2fv", "(", "location", "int32", ",", "count", "int32", ",", "transpose", "bool", ",", "value", "*", "float32", ")", "{", "C", ".", "glowUniformMatrix2fv", "(", "gpUniformMatrix2fv", ",", "(", "C", ".", "GLint", ")", "(", "location", ")", ",", "(", "C", ".", "GLsizei", ")", "(", "count", ")", ",", "(", "C", ".", "GLboolean", ")", "(", "boolToInt", "(", "transpose", ")", ")", ",", "(", "*", "C", ".", "GLfloat", ")", "(", "unsafe", ".", "Pointer", "(", "<mask>", ")", ")", ")", "\n", "}" ]
9,603
all-9604
[ "voteResponseType", "maps", "vote", "and", "prevote", "message", "types", "to", "their", "corresponding", "responses", "." ]
[ "func", "voteRespMsgType", "(", "msgt", "pb", ".", "MessageType", ")", "pb", ".", "MessageType", "{", "<mask>", "msgt", "{", "case", "pb", ".", "MsgVote", ":", "return", "pb", ".", "MsgVoteResp", "\n", "case", "pb", ".", "MsgPreVote", ":", "return", "pb", ".", "MsgPreVoteResp", "\n", "default", ":", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "msgt", ")", ")", "\n", "}", "\n", "}" ]
9,604
all-9605
[ "Walk", "walks", "the", "pfs", "filesystem", "rooted", "at", "path", ".", "walkFn", "will", "be", "called", "for", "each", "file", "found", "under", "path", "in", "lexicographical", "order", ".", "This", "includes", "both", "regular", "files", "and", "directories", "." ]
[ "func", "(", "c", "APIClient", ")", "Walk", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ",", "f", "WalkFn", ")", "error", "{", "<mask>", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "WalkFile", "(", "c", ".", "Ctx", "(", ")", ",", "&", "pfs", ".", "WalkFileRequest", "{", "File", ":", "NewFile", "(", "repoName", ",", "commitID", ",", "path", ")", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "grpcutil", ".", "ScrubGRPC", "(", "err", ")", "\n", "}", "\n", "for", "{", "fi", ",", "err", ":=", "fs", ".", "Recv", "(", ")", "\n", "if", "err", "==", "io", ".", "EOF", "{", "return", "nil", "\n", "}", "else", "if", "err", "!=", "nil", "{", "return", "grpcutil", ".", "ScrubGRPC", "(", "err", ")", "\n", "}", "\n", "if", "err", ":=", "f", "(", "fi", ")", ";", "err", "!=", "nil", "{", "if", "err", "==", "errutil", ".", "ErrBreak", "{", "return", "nil", "\n", "}", "\n", "return", "err", "\n", "}", "\n", "}", "\n", "}" ]
9,605
all-9606
[ "JustConnectedGamepadIDs", "returns", "gamepad", "IDs", "that", "are", "connected", "just", "in", "the", "current", "frame", ".", "JustConnectedGamepadIDs", "might", "return", "nil", "when", "there", "is", "no", "connected", "gamepad", ".", "JustConnectedGamepadIDs", "is", "concurrent", "safe", "." ]
[ "func", "JustConnectedGamepadIDs", "(", ")", "[", "]", "int", "{", "var", "ids", "[", "]", "int", "\n", "theInputState", ".", "m", ".", "RLock", "(", ")", "\n", "for", "id", ":=", "range", "theInputState", ".", "gamepadIDs", "{", "if", "_", ",", "ok", ":=", "theInputState", ".", "prevGamepadIDs", "[", "<mask>", "]", ";", "!", "ok", "{", "ids", "=", "append", "(", "ids", ",", "id", ")", "\n", "}", "\n", "}", "\n", "theInputState", ".", "m", ".", "RUnlock", "(", ")", "\n", "sort", ".", "Ints", "(", "ids", ")", "\n", "return", "ids", "\n", "}" ]
9,606
all-9607
[ "PrependItem", "is", "a", "wrapper", "around", "g_menu_prepend_item", "()", "." ]
[ "func", "(", "v", "*", "Menu", ")", "PrependItem", "(", "item", "*", "MenuItem", ")", "{", "C", ".", "g_menu_prepend_item", "(", "v", ".", "native", "(", ")", ",", "<mask>", ".", "native", "(", ")", ")", "\n", "}" ]
9,607
all-9608
[ "GetUserConfigDir", "is", "a", "wrapper", "around", "g_get_user_config_dir", "()", "." ]
[ "func", "GetUserConfigDir", "(", ")", "string", "{", "c", ":=", "C", ".", "g_get_user_config_dir", "(", ")", "\n", "return", "C", ".", "GoString", "(", "(", "*", "C", ".", "<mask>", ")", "(", "c", ")", ")", "\n", "}" ]
9,608
all-9609
[ "GetCCs", "gets", "the", "list", "of", "suggested", "approvers", "for", "a", "pull", "-", "request", ".", "It", "now", "considers", "current", "assignees", "as", "potential", "approvers", ".", "Here", "is", "how", "it", "works", ":", "-", "We", "find", "suggested", "approvers", "from", "all", "potential", "approvers", "but", "remove", "those", "that", "are", "not", "useful", "considering", "current", "approvers", "and", "assignees", ".", "This", "only", "uses", "leaf", "approvers", "to", "find", "the", "closest", "approvers", "to", "the", "changes", ".", "-", "We", "find", "a", "subset", "of", "suggested", "approvers", "from", "current", "approvers", "suggested", "approvers", "and", "assignees", "but", "we", "remove", "those", "that", "are", "not", "useful", "considering", "suggested", "approvers", "and", "current", "approvers", ".", "This", "uses", "the", "full", "approvers", "list", "and", "will", "result", "in", "root", "approvers", "to", "be", "suggested", "when", "they", "are", "assigned", ".", "We", "return", "the", "union", "of", "the", "two", "sets", ":", "suggested", "and", "suggested", "assignees", ".", "The", "goal", "of", "this", "second", "step", "is", "to", "only", "keep", "the", "assignees", "that", "are", "the", "most", "useful", "." ]
[ "func", "(", "ap", "Approvers", ")", "GetCCs", "(", ")", "[", "]", "string", "{", "randomizedApprovers", ":=", "ap", ".", "owners", ".", "GetShuffledApprovers", "(", ")", "\n\n", "currentApprovers", ":=", "ap", ".", "GetCurrentApproversSet", "(", ")", "\n", "approversAndAssignees", ":=", "currentApprovers", ".", "Union", "(", "ap", ".", "assignees", ")", "\n", "leafReverseMap", ":=", "ap", ".", "owners", ".", "GetReverseMap", "(", "ap", ".", "owners", ".", "GetLeafApprovers", "(", ")", ")", "\n", "suggested", ":=", "ap", ".", "owners", ".", "KeepCoveringApprovers", "(", "leafReverseMap", ",", "approversAndAssignees", ",", "randomizedApprovers", ")", "\n", "approversAndSuggested", ":=", "currentApprovers", ".", "Union", "(", "suggested", ")", "\n", "everyone", ":=", "approversAndSuggested", ".", "Union", "(", "ap", ".", "assignees", ")", "\n", "fullReverseMap", ":=", "ap", ".", "owners", ".", "GetReverseMap", "(", "ap", ".", "owners", ".", "GetApprovers", "(", ")", ")", "\n", "keepAssignees", ":=", "ap", ".", "owners", ".", "KeepCoveringApprovers", "(", "fullReverseMap", ",", "approversAndSuggested", ",", "everyone", ".", "<mask>", "(", ")", ")", "\n\n", "return", "suggested", ".", "Union", "(", "keepAssignees", ")", ".", "List", "(", ")", "\n", "}" ]
9,609
all-9610
[ "NewTokenAuthenticator", "returns", "an", "authenticator", "that", "use", "an", "oauth", "access", "token", "to", "do", "authentication", ".", "This", "is", "useful", "if", "the", "oauth", "handshake", "has", "already", "happened", ".", "Use", "the", "OAuthAuthenticator", "to", "use", "a", "refresh", "token", "and", "have", "the", "authenticator", "do", "the", "handshake", ".", "Specifying", "the", "accountID", "is", "only", "required", "if", "the", "API", "requires", "the", "X", "-", "Account", "header", "to", "be", "set", "(", "this", "is", "true", "of", "CM", "1", ".", "6", "at", "the", "moment", ")", "." ]
[ "func", "NewTokenAuthenticator", "(", "token", "string", ",", "accountID", "int", ")", "Authenticator", "{", "return", "&", "tokenAuthenticator", "{", "<mask>", ":", "token", ",", "accountID", ":", "accountID", "}", "\n", "}" ]
9,610
all-9611
[ "SendFile", "registers", "file", "on", "the", "given", "path", "to", "be", "used", "as", "response", "body", "when", "Write", "is", "called", ".", "Note", "that", "SendFile", "doesn", "t", "set", "Content", "-", "Type", "so", "set", "it", "yourself", "with", "Header", ".", "SetContentType", "." ]
[ "func", "(", "resp", "*", "Response", ")", "SendFile", "(", "path", "string", ")", "error", "{", "f", ",", "err", ":=", "os", ".", "Open", "(", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "fileInfo", ",", "err", ":=", "f", ".", "Stat", "(", ")", "\n", "if", "err", "!=", "nil", "{", "f", ".", "Close", "(", ")", "\n", "return", "err", "\n", "}", "\n", "size64", ":=", "fileInfo", ".", "Size", "(", ")", "\n", "size", ":=", "int", "(", "size64", ")", "\n", "if", "int64", "(", "size", ")", "!=", "size64", "{", "size", "=", "-", "1", "\n", "}", "\n\n", "resp", ".", "Header", ".", "SetLastModified", "(", "fileInfo", ".", "ModTime", "(", ")", ")", "\n", "resp", ".", "SetBodyStream", "(", "f", ",", "size", ")", "\n", "return", "nil", "\n", "}" ]
9,611
all-9612
[ "ReadAll", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockFileSystem", ")", "ReadAll", "(", "arg0", "io", ".", "Reader", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "<mask>", "[", "0", "]", ".", "(", "[", "]", "byte", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "error", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
9,612
all-9613
[ "isFullscreen", "must", "be", "called", "from", "the", "main", "thread", "." ]
[ "func", "(", "u", "*", "UserInterface", ")", "isFullscreen", "(", ")", "bool", "{", "if", "!", "u", ".", "isRunning", "(", ")", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "u", ".", "<mask>", ".", "GetMonitor", "(", ")", "!=", "nil", "\n", "}" ]
9,613
all-9614
[ "/", "*", "Warningf", "uses", "msg", "as", "a", "format", "string", "with", "subsequent", "parameters", "as", "values", "and", "logs", "the", "resulting", "message", "to", "all", "added", "loggers", "at", "LogLevel", ".", "LevelWarning" ]
[ "func", "(", "la", "*", "LogAdapter", ")", "Warningf", "(", "<mask>", "string", ",", "a", "...", "interface", "{", "}", ")", "error", "{", "return", "la", ".", "Log", "(", "LevelWarning", ",", "nil", ",", "msg", ",", "a", "...", ")", "\n", "}" ]
9,614
all-9615
[ "GetIncreaseGoodOk", "returns", "a", "tuple", "with", "the", "IncreaseGood", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "ChangeRequest", ")", "GetIncreaseGoodOk", "(", ")", "(", "bool", ",", "bool", ")", "{", "if", "c", "==", "nil", "||", "c", ".", "IncreaseGood", "==", "nil", "{", "return", "<mask>", ",", "false", "\n", "}", "\n", "return", "*", "c", ".", "IncreaseGood", ",", "true", "\n", "}" ]
9,615
all-9616
[ "ListImages", "returns", "an", "Collection", "struct" ]
[ "func", "(", "c", "*", "Client", ")", "ListImages", "(", ")", "(", "*", "Images", ",", "error", ")", "{", "url", ":=", "imageColPath", "(", ")", "+", "`?depth=`", "+", "c", ".", "client", ".", "depth", "+", "`&pretty=`", "+", "strconv", ".", "FormatBool", "(", "c", ".", "client", ".", "pretty", ")", "\n", "<mask>", ":=", "&", "Images", "{", "}", "\n", "err", ":=", "c", ".", "client", ".", "Get", "(", "url", ",", "ret", ",", "http", ".", "StatusOK", ")", "\n", "return", "ret", ",", "err", "\n", "}" ]
9,616
all-9617
[ "maybeDecrTo", "returns", "false", "if", "the", "given", "to", "index", "comes", "from", "an", "out", "of", "order", "message", ".", "Otherwise", "it", "decreases", "the", "progress", "next", "index", "to", "min", "(", "rejected", "last", ")", "and", "returns", "true", "." ]
[ "func", "(", "pr", "*", "Progress", ")", "maybeDecrTo", "(", "rejected", ",", "last", "uint64", ")", "bool", "{", "if", "pr", ".", "State", "==", "ProgressStateReplicate", "{", "// the rejection must be stale if the progress has matched and \"rejected\"", "// is smaller than \"match\".", "if", "rejected", "<=", "pr", ".", "Match", "{", "return", "false", "\n", "}", "\n", "// directly decrease next to match + 1", "pr", ".", "Next", "=", "pr", ".", "Match", "+", "1", "\n", "return", "true", "\n", "}", "\n\n", "// the rejection must be stale if \"rejected\" does not match next - 1", "if", "pr", ".", "Next", "-", "1", "!=", "rejected", "{", "return", "false", "\n", "}", "\n\n", "if", "pr", ".", "Next", "=", "min", "(", "rejected", ",", "<mask>", "+", "1", ")", ";", "pr", ".", "Next", "<", "1", "{", "pr", ".", "Next", "=", "1", "\n", "}", "\n", "pr", ".", "resume", "(", ")", "\n", "return", "true", "\n", "}" ]
9,617
all-9618
[ "PolicyConfigurationIdentity", "returns", "a", "string", "representation", "of", "the", "reference", "suitable", "for", "policy", "lookup", ".", "This", "MUST", "reflect", "user", "intent", "not", "e", ".", "g", ".", "after", "processing", "of", "third", "-", "party", "redirects", "or", "aliases", ";", "The", "value", "SHOULD", "be", "fully", "explicit", "about", "its", "semantics", "with", "no", "hidden", "defaults", "AND", "canonical", "(", "i", ".", "e", ".", "various", "references", "with", "exactly", "the", "same", "semantics", "should", "return", "the", "same", "configuration", "identity", ")", "It", "is", "fine", "for", "the", "return", "value", "to", "be", "equal", "to", "StringWithinTransport", "()", "and", "it", "is", "desirable", "but", "not", "required", "/", "guaranteed", "that", "it", "will", "be", "a", "valid", "input", "to", "Transport", "()", ".", "ParseReference", "()", ".", "Returns", "if", "configuration", "identities", "for", "these", "references", "are", "not", "supported", "." ]
[ "func", "(", "ref", "daemonReference", ")", "PolicyConfigurationIdentity", "(", ")", "string", "{", "// We must allow referring to images in the daemon by image ID, otherwise untagged images would not be accessible.", "// But the existence of image IDs means that we can’t truly well namespace the input:", "// a single image can be namespaced either using the name or the ID depending on how it is named.", "//", "// That’s fairly unexpected, but we have to cope somehow.", "//", "// So, use the ordinary docker/policyconfiguration namespacing for named images.", "// image IDs all fall into the root namespace.", "// Users can set up the root namespace to be either untrusted or rejected,", "// and to set up specific trust for named namespaces. This allows verifying image", "// identity when a name is known, and unnamed images would be untrusted or rejected.", "switch", "{", "case", "ref", ".", "<mask>", "!=", "\"", "\"", ":", "return", "\"", "\"", "// This still allows using the default \"\" scope to define a global policy for ID-identified images.", "\n", "case", "ref", ".", "ref", "!=", "nil", ":", "res", ",", "err", ":=", "policyconfiguration", ".", "DockerReferenceIdentity", "(", "ref", ".", "ref", ")", "\n", "if", "res", "==", "\"", "\"", "||", "err", "!=", "nil", "{", "// Coverage: Should never happen, NewReference above should refuse values which could cause a failure.", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "res", ",", "err", ")", ")", "\n", "}", "\n", "return", "res", "\n", "default", ":", "// Coverage: Should never happen, NewReference above should refuse such values.", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "}" ]
9,618
all-9619
[ "Reset", "clears", "the", "cookie", "." ]
[ "func", "(", "c", "*", "Cookie", ")", "Reset", "(", ")", "{", "c", ".", "key", "=", "c", ".", "key", "[", ":", "0", "]", "\n", "c", ".", "value", "=", "c", ".", "value", "[", ":", "0", "]", "\n", "c", ".", "expire", "=", "zeroTime", "\n", "c", ".", "maxAge", "=", "0", "\n", "c", ".", "domain", "=", "c", ".", "<mask>", "[", ":", "0", "]", "\n", "c", ".", "path", "=", "c", ".", "path", "[", ":", "0", "]", "\n", "c", ".", "httpOnly", "=", "false", "\n", "c", ".", "secure", "=", "false", "\n", "c", ".", "sameSite", "=", "CookieSameSiteDisabled", "\n", "}" ]
9,619
all-9620
[ "GRPCCode", "returns", "the", "corresponding", "http", "status", "code", "from", "an", "error" ]
[ "func", "GRPCCode", "(", "err", "error", ")", "codes", ".", "Code", "{", "e", ",", "ok", ":=", "err", ".", "(", "Error", ")", "\n", "if", "<mask>", "{", "return", "e", ".", "Type", "(", ")", ".", "GRPCCode", "(", ")", "\n", "}", "\n\n", "return", "grpc", ".", "Code", "(", "err", ")", "\n", "}" ]
9,620
all-9621
[ "handle", "drives", "the", "pull", "request", "to", "the", "desired", "state", ".", "If", "any", "user", "adds", "a", "/", "hold", "directive", "we", "want", "to", "add", "a", "label", "if", "one", "does", "not", "already", "exist", ".", "If", "they", "add", "/", "hold", "cancel", "we", "want", "to", "remove", "the", "label", "if", "it", "exists", "." ]
[ "func", "handle", "(", "gc", "githubClient", ",", "log", "*", "logrus", ".", "<mask>", ",", "e", "*", "github", ".", "GenericCommentEvent", ",", "f", "hasLabelFunc", ")", "error", "{", "if", "e", ".", "Action", "!=", "github", ".", "GenericCommentActionCreated", "{", "return", "nil", "\n", "}", "\n", "needsLabel", ":=", "false", "\n", "if", "labelRe", ".", "MatchString", "(", "e", ".", "Body", ")", "{", "needsLabel", "=", "true", "\n", "}", "else", "if", "labelCancelRe", ".", "MatchString", "(", "e", ".", "Body", ")", "{", "needsLabel", "=", "false", "\n", "}", "else", "{", "return", "nil", "\n", "}", "\n\n", "org", ":=", "e", ".", "Repo", ".", "Owner", ".", "Login", "\n", "repo", ":=", "e", ".", "Repo", ".", "Name", "\n", "issueLabels", ",", "err", ":=", "gc", ".", "GetIssueLabels", "(", "org", ",", "repo", ",", "e", ".", "Number", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "org", ",", "repo", ",", "e", ".", "Number", ",", "err", ")", "\n", "}", "\n\n", "hasLabel", ":=", "f", "(", "labels", ".", "Hold", ",", "issueLabels", ")", "\n", "if", "hasLabel", "&&", "!", "needsLabel", "{", "log", ".", "Infof", "(", "\"", "\"", ",", "labels", ".", "Hold", ",", "org", ",", "repo", ",", "e", ".", "Number", ")", "\n", "return", "gc", ".", "RemoveLabel", "(", "org", ",", "repo", ",", "e", ".", "Number", ",", "labels", ".", "Hold", ")", "\n", "}", "else", "if", "!", "hasLabel", "&&", "needsLabel", "{", "log", ".", "Infof", "(", "\"", "\"", ",", "labels", ".", "Hold", ",", "org", ",", "repo", ",", "e", ".", "Number", ")", "\n", "return", "gc", ".", "AddLabel", "(", "org", ",", "repo", ",", "e", ".", "Number", ",", "labels", ".", "Hold", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
9,621
all-9622
[ "GetActiveText", "is", "a", "wrapper", "around", "gtk_combo_box_text_get_active_text", "()", "." ]
[ "func", "(", "v", "*", "ComboBoxText", ")", "GetActiveText", "(", ")", "string", "{", "c", ":=", "(", "*", "C", ".", "<mask>", ")", "(", "C", ".", "gtk_combo_box_text_get_active_text", "(", "v", ".", "native", "(", ")", ")", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "\n", "return", "C", ".", "GoString", "(", "c", ")", "\n", "}" ]
9,622
all-9623
[ "Equals", "returns", "whether", "the", "contents", "of", "two", "sets", "are", "identical" ]
[ "func", "(", "us", "*", "unsafeSet", ")", "Equals", "(", "other", "Set", ")", "bool", "{", "v1", ":=", "sort", ".", "StringSlice", "(", "us", ".", "Values", "(", ")", ")", "\n", "v2", ":=", "<mask>", ".", "StringSlice", "(", "other", ".", "Values", "(", ")", ")", "\n", "v1", ".", "Sort", "(", ")", "\n", "v2", ".", "Sort", "(", ")", "\n", "return", "reflect", ".", "DeepEqual", "(", "v1", ",", "v2", ")", "\n", "}" ]
9,623
all-9624
[ "Given", "a", "path", "and", "whatever", "the", "http", "method", "return", "all", "the", "matching", "routes", "." ]
[ "func", "(", "t", "*", "Trie", ")", "FindRoutesForPath", "(", "path", "string", ")", "[", "]", "*", "Match", "{", "context", ":=", "newFindContext", "(", ")", "\n", "matches", ":=", "[", "]", "*", "Match", "{", "}", "\n", "context", ".", "matchFunc", "=", "func", "(", "httpMethod", ",", "path", "string", ",", "node", "*", "node", ")", "{", "params", ":=", "context", ".", "paramsAsMap", "(", ")", "\n", "for", "_", ",", "route", ":=", "range", "node", ".", "HttpMethodToRoute", "{", "matches", "=", "append", "(", "matches", ",", "&", "Match", "{", "Route", ":", "route", ",", "Params", ":", "params", ",", "}", ",", ")", "\n", "}", "\n", "}", "\n", "t", ".", "root", ".", "<mask>", "(", "\"", "\"", ",", "path", ",", "context", ")", "\n", "return", "matches", "\n", "}" ]
9,624
all-9625
[ "WriteTo", "writes", "data", "to", "w", "." ]
[ "func", "(", "e", "*", "plainText", ")", "WriteTo", "(", "w", "io", ".", "Writer", ")", "(", "int64", ",", "error", ")", "{", "var", "bf", "bytes", ".", "Buffer", "\n\n", "// Write the plain text.", "bf", ".", "WriteString", "(", "strings", ".", "Join", "(", "e", ".", "ln", ".", "tokens", "[", "1", ":", "]", ",", "<mask>", ")", ")", "\n\n", "if", "len", "(", "e", ".", "ln", ".", "tokens", ")", ">", "1", "&&", "e", ".", "insertBr", "{", "bf", ".", "WriteString", "(", "htmlBr", ")", "\n", "}", "\n\n", "// Write the children's HTML.", "if", "len", "(", "e", ".", "children", ")", ">", "0", "{", "bf", ".", "WriteString", "(", "lf", ")", "\n\n", "if", "i", ",", "err", ":=", "e", ".", "writeChildren", "(", "&", "bf", ")", ";", "err", "!=", "nil", "{", "return", "i", ",", "err", "\n", "}", "\n", "}", "\n\n", "// Write the buffer.", "i", ",", "err", ":=", "w", ".", "Write", "(", "bf", ".", "Bytes", "(", ")", ")", "\n\n", "return", "int64", "(", "i", ")", ",", "err", "\n", "}" ]
9,625
all-9626
[ "Update", "updates", "the", "value", "/", "ttl", "of", "the", "node", ".", "If", "the", "node", "is", "a", "file", "the", "value", "and", "the", "ttl", "can", "be", "updated", ".", "If", "the", "node", "is", "a", "directory", "only", "the", "ttl", "can", "be", "updated", "." ]
[ "func", "(", "s", "*", "store", ")", "Update", "(", "nodePath", "string", ",", "newValue", "string", ",", "expireOpts", "TTLOptionSet", ")", "(", "*", "Event", ",", "error", ")", "{", "<mask>", "err", "*", "v2error", ".", "Error", "\n\n", "s", ".", "worldLock", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "worldLock", ".", "Unlock", "(", ")", "\n\n", "defer", "func", "(", ")", "{", "if", "err", "==", "nil", "{", "s", ".", "Stats", ".", "Inc", "(", "UpdateSuccess", ")", "\n", "reportWriteSuccess", "(", "Update", ")", "\n", "return", "\n", "}", "\n\n", "s", ".", "Stats", ".", "Inc", "(", "UpdateFail", ")", "\n", "reportWriteFailure", "(", "Update", ")", "\n", "}", "(", ")", "\n\n", "nodePath", "=", "path", ".", "Clean", "(", "path", ".", "Join", "(", "\"", "\"", ",", "nodePath", ")", ")", "\n", "// we do not allow the user to change \"/\"", "if", "s", ".", "readonlySet", ".", "Contains", "(", "nodePath", ")", "{", "return", "nil", ",", "v2error", ".", "NewError", "(", "v2error", ".", "EcodeRootROnly", ",", "\"", "\"", ",", "s", ".", "CurrentIndex", ")", "\n", "}", "\n\n", "currIndex", ",", "nextIndex", ":=", "s", ".", "CurrentIndex", ",", "s", ".", "CurrentIndex", "+", "1", "\n\n", "n", ",", "err", ":=", "s", ".", "internalGet", "(", "nodePath", ")", "\n", "if", "err", "!=", "nil", "{", "// if the node does not exist, return error", "return", "nil", ",", "err", "\n", "}", "\n", "if", "n", ".", "IsDir", "(", ")", "&&", "len", "(", "newValue", ")", "!=", "0", "{", "// if the node is a directory, we cannot update value to non-empty", "return", "nil", ",", "v2error", ".", "NewError", "(", "v2error", ".", "EcodeNotFile", ",", "nodePath", ",", "currIndex", ")", "\n", "}", "\n\n", "if", "expireOpts", ".", "Refresh", "{", "newValue", "=", "n", ".", "Value", "\n", "}", "\n\n", "e", ":=", "newEvent", "(", "Update", ",", "nodePath", ",", "nextIndex", ",", "n", ".", "CreatedIndex", ")", "\n", "e", ".", "EtcdIndex", "=", "nextIndex", "\n", "e", ".", "PrevNode", "=", "n", ".", "Repr", "(", "false", ",", "false", ",", "s", ".", "clock", ")", "\n", "eNode", ":=", "e", ".", "Node", "\n\n", "n", ".", "Write", "(", "newValue", ",", "nextIndex", ")", "\n\n", "if", "n", ".", "IsDir", "(", ")", "{", "eNode", ".", "Dir", "=", "true", "\n", "}", "else", "{", "// copy the value for safety", "newValueCopy", ":=", "newValue", "\n", "eNode", ".", "Value", "=", "&", "newValueCopy", "\n", "}", "\n\n", "// update ttl", "n", ".", "UpdateTTL", "(", "expireOpts", ".", "ExpireTime", ")", "\n\n", "eNode", ".", "Expiration", ",", "eNode", ".", "TTL", "=", "n", ".", "expirationAndTTL", "(", "s", ".", "clock", ")", "\n\n", "if", "!", "expireOpts", ".", "Refresh", "{", "s", ".", "WatcherHub", ".", "notify", "(", "e", ")", "\n", "}", "else", "{", "e", ".", "SetRefresh", "(", ")", "\n", "s", ".", "WatcherHub", ".", "add", "(", "e", ")", "\n", "}", "\n\n", "s", ".", "CurrentIndex", "=", "nextIndex", "\n\n", "return", "e", ",", "nil", "\n", "}" ]
9,626
all-9627
[ "RegisterTopicValidator", "registers", "a", "validator", "for", "topic", "." ]
[ "func", "(", "p", "*", "PubSub", ")", "RegisterTopicValidator", "(", "topic", "string", ",", "val", "Validator", ",", "opts", "...", "ValidatorOpt", ")", "error", "{", "addVal", ":=", "&", "addValReq", "{", "topic", ":", "topic", ",", "validate", ":", "val", ",", "resp", ":", "make", "(", "chan", "error", ",", "1", ")", ",", "}", "\n\n", "for", "_", ",", "<mask>", ":=", "range", "opts", "{", "err", ":=", "opt", "(", "addVal", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n\n", "p", ".", "addVal", "<-", "addVal", "\n", "return", "<-", "addVal", ".", "resp", "\n", "}" ]
9,627
all-9628
[ "MiddlewareFunc", "makes", "ContentTypeCheckerMiddleware", "implement", "the", "Middleware", "interface", "." ]
[ "func", "(", "mw", "*", "ContentTypeCheckerMiddleware", ")", "MiddlewareFunc", "(", "handler", "HandlerFunc", ")", "HandlerFunc", "{", "return", "func", "(", "w", "ResponseWriter", ",", "r", "*", "Request", ")", "{", "mediatype", ",", "params", ",", "_", ":=", "mime", ".", "ParseMediaType", "(", "r", ".", "Header", ".", "Get", "(", "\"", "\"", ")", ")", "\n", "charset", ",", "<mask>", ":=", "params", "[", "\"", "\"", "]", "\n", "if", "!", "ok", "{", "charset", "=", "\"", "\"", "\n", "}", "\n\n", "// per net/http doc, means that the length is known and non-null", "if", "r", ".", "ContentLength", ">", "0", "&&", "!", "(", "mediatype", "==", "\"", "\"", "&&", "strings", ".", "ToUpper", "(", "charset", ")", "==", "\"", "\"", ")", "{", "Error", "(", "w", ",", "\"", "\"", ",", "http", ".", "StatusUnsupportedMediaType", ",", ")", "\n", "return", "\n", "}", "\n\n", "// call the wrapped handler", "handler", "(", "w", ",", "r", ")", "\n", "}", "\n", "}" ]
9,628
all-9629
[ "Synchronous", "." ]
[ "func", "(", "<mask>", "*", "localPeer", ")", "doDeleteConnection", "(", "conn", "ourConnection", ")", "{", "resultChan", ":=", "make", "(", "chan", "interface", "{", "}", ")", "\n", "peer", ".", "actionChan", "<-", "func", "(", ")", "{", "peer", ".", "handleDeleteConnection", "(", "conn", ")", "\n", "resultChan", "<-", "nil", "\n", "}", "\n", "<-", "resultChan", "\n", "}" ]
9,629
all-9630
[ "logPanic", "logs", "the", "caller", "tree", "when", "a", "panic", "occurs", "." ]
[ "func", "logPanic", "(", "r", "interface", "{", "}", ")", "{", "callers", ":=", "\"", "\"", "\n", "for", "i", ":=", "0", ";", "true", ";", "i", "++", "{", "_", ",", "file", ",", "line", ",", "ok", ":=", "runtime", ".", "Caller", "(", "i", ")", "\n", "if", "!", "ok", "{", "break", "\n", "}", "\n", "callers", "=", "callers", "+", "fmt", ".", "Sprintf", "(", "\"", "\\n", "\"", ",", "file", ",", "<mask>", ")", "\n", "}", "\n", "logger", ".", "Get", "(", ")", ".", "Error", "(", "\"", "\\n", "\"", ",", "r", ",", "r", ",", "callers", ")", "\n", "}" ]
9,630
all-9631
[ "MustGetScpLedgerSeq", "retrieves", "the", "GetScpLedgerSeq", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
[ "func", "(", "u", "StellarMessage", ")", "MustGetScpLedgerSeq", "(", ")", "Uint32", "{", "val", ",", "<mask>", ":=", "u", ".", "GetGetScpLedgerSeq", "(", ")", "\n\n", "if", "!", "ok", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "val", "\n", "}" ]
9,631
all-9632
[ "ClearMilestone", "clears", "the", "milestone", "from", "the", "specified", "issue", "See", "https", ":", "//", "developer", ".", "github", ".", "com", "/", "v3", "/", "issues", "/", "#edit", "-", "an", "-", "issue" ]
[ "func", "(", "c", "*", "Client", ")", "ClearMilestone", "(", "org", ",", "repo", "string", ",", "num", "int", ")", "error", "{", "c", ".", "log", "(", "\"", "\"", ",", "org", ",", "repo", ",", "num", ")", "\n\n", "issue", ":=", "&", "struct", "{", "// Clearing the milestone requires providing a null value, and", "// interface{} will serialize to null.", "Milestone", "interface", "{", "}", "`json:\"milestone\"`", "\n", "}", "{", "}", "\n", "_", ",", "err", ":=", "c", ".", "request", "(", "&", "request", "{", "method", ":", "http", ".", "MethodPatch", ",", "path", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "org", ",", "repo", ",", "num", ")", ",", "requestBody", ":", "&", "<mask>", ",", "exitCodes", ":", "[", "]", "int", "{", "200", "}", ",", "}", ",", "nil", ")", "\n", "return", "err", "\n", "}" ]
9,632
all-9633
[ "RowsColumn", "creates", "a", "Rows", "query", "with", "the", "given", "column", "ID", "/", "key" ]
[ "func", "(", "f", "*", "Field", ")", "RowsColumn", "(", "columnIDOrKey", "<mask>", "{", "}", ")", "*", "PQLRowsQuery", "{", "idKey", ",", "err", ":=", "formatIDKey", "(", "columnIDOrKey", ")", "\n", "if", "err", "!=", "nil", "{", "return", "NewPQLRowsQuery", "(", "\"", "\"", ",", "f", ".", "index", ",", "err", ")", "\n", "}", "\n", "text", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "f", ".", "name", ",", "idKey", ")", "\n", "return", "NewPQLRowsQuery", "(", "text", ",", "f", ".", "index", ",", "nil", ")", "\n", "}" ]
9,633
all-9634
[ "GetDashboardList", "returns", "a", "single", "dashboard", "list", "created", "on", "this", "account", "." ]
[ "func", "(", "client", "*", "Client", ")", "GetDashboardList", "(", "<mask>", "int", ")", "(", "*", "DashboardList", ",", "error", ")", "{", "var", "out", "DashboardList", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "id", ")", ",", "nil", ",", "&", "out", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "out", ",", "nil", "\n", "}" ]
9,634
all-9635
[ "Listen", "bind", "port", ".", "Receive", "messages", "and", "send", "to", "out", "channel" ]
[ "func", "(", "api", "*", "Api", ")", "Listen", "(", "addr", "*", "net", ".", "TCPAddr", ")", "error", "{", "return", "api", ".", "StartFunc", "(", "func", "(", ")", "error", "{", "tcpListener", ",", "err", ":=", "net", ".", "ListenTCP", "(", "\"", "\"", ",", "addr", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "s", ":=", "grpc", ".", "NewServer", "(", ")", "\n", "carbonpb", ".", "RegisterCarbonServer", "(", "s", ",", "api", ")", "\n", "// Register reflection service on gRPC server.", "reflection", ".", "Register", "(", "s", ")", "\n\n", "api", ".", "Go", "(", "func", "(", "exit", "chan", "struct", "{", "}", ")", "{", "<-", "<mask>", "\n", "s", ".", "Stop", "(", ")", "\n", "}", ")", "\n\n", "api", ".", "Go", "(", "func", "(", "exit", "chan", "struct", "{", "}", ")", "{", "defer", "s", ".", "Stop", "(", ")", "\n\n", "if", "err", ":=", "s", ".", "Serve", "(", "tcpListener", ")", ";", "err", "!=", "nil", "{", "// may be stopped - not error", "// zapwriter.Logger(\"api\").Fatal(\"failed to serve\", zap.Error(err))", "}", "\n\n", "}", ")", "\n\n", "api", ".", "listener", "=", "tcpListener", "\n\n", "return", "nil", "\n", "}", ")", "\n", "}" ]
9,635
all-9636
[ "Add", "a", "new", "operation", "to", "the", "bundle", ".", "The", "operation", "will", "be", "invoked", "with", "a", "context", "that", "will", "be", "cancelled", "if", "any", "other", "operation", "fails", "or", "has", "already", "failed", "." ]
[ "func", "(", "b", "*", "Bundle", ")", "Add", "(", "f", "func", "(", "context", ".", "Context", ")", "error", ")", "{", "b", ".", "waitGroup", ".", "Add", "(", "1", ")", "\n\n", "// Run the function in the background.", "<mask>", "func", "(", ")", "{", "defer", "b", ".", "waitGroup", ".", "Done", "(", ")", "\n\n", "err", ":=", "f", "(", "b", ".", "context", ")", "\n", "if", "err", "==", "nil", "{", "return", "\n", "}", "\n\n", "// On first error, cancel the context and save the error.", "b", ".", "errorOnce", ".", "Do", "(", "func", "(", ")", "{", "b", ".", "firstError", "=", "err", "\n", "b", ".", "cancel", "(", ")", "\n", "}", ")", "\n", "}", "(", ")", "\n", "}" ]
9,636
all-9637
[ "Output", "records", "the", "log", "with", "special", "callstack", "depth", "and", "log", "level", "." ]
[ "func", "(", "l", "*", "Logger", ")", "Output", "(", "callDepth", "int", ",", "level", "Level", ",", "msg", "string", ")", "{", "if", "l", ".", "level", ">", "level", "{", "return", "\n", "}", "\n\n", "buf", ":=", "l", ".", "bufs", ".", "Get", "(", ")", ".", "(", "[", "]", "byte", ")", "\n", "buf", "=", "buf", "[", "0", ":", "0", "]", "\n", "defer", "l", ".", "bufs", ".", "Put", "(", "buf", ")", "\n\n", "if", "l", ".", "flag", "&", "Ltime", ">", "0", "{", "now", ":=", "time", ".", "Now", "(", ")", ".", "Format", "(", "timeFormat", ")", "\n", "buf", "=", "append", "(", "buf", ",", "'['", ")", "\n", "buf", "=", "append", "(", "buf", ",", "now", "...", ")", "\n", "buf", "=", "append", "(", "buf", ",", "\"", "\"", "...", ")", "\n", "}", "\n\n", "if", "l", ".", "flag", "&", "Llevel", ">", "0", "{", "buf", "=", "append", "(", "buf", ",", "'['", ")", "\n", "buf", "=", "append", "(", "buf", ",", "level", ".", "String", "(", ")", "...", ")", "\n", "buf", "=", "append", "(", "buf", ",", "\"", "\"", "...", ")", "\n", "}", "\n\n", "if", "l", ".", "flag", "&", "Lfile", ">", "0", "{", "_", ",", "file", ",", "line", ",", "ok", ":=", "runtime", ".", "Caller", "(", "callDepth", ")", "\n", "if", "!", "ok", "{", "file", "=", "\"", "\"", "\n", "line", "=", "0", "\n", "}", "else", "{", "for", "i", ":=", "len", "(", "file", ")", "-", "1", ";", "i", ">", "0", ";", "i", "--", "{", "if", "file", "[", "i", "]", "==", "'/'", "{", "file", "=", "file", "[", "i", "+", "1", ":", "]", "\n", "break", "\n", "}", "\n", "}", "\n", "}", "\n\n", "buf", "=", "append", "(", "buf", ",", "file", "...", ")", "\n", "buf", "=", "append", "(", "buf", ",", "':'", ")", "\n\n", "buf", "=", "strconv", ".", "AppendInt", "(", "buf", ",", "int64", "(", "line", ")", ",", "10", ")", "\n", "buf", "=", "<mask>", "(", "buf", ",", "' '", ")", "\n", "}", "\n\n", "buf", "=", "append", "(", "buf", ",", "msg", "...", ")", "\n", "if", "len", "(", "msg", ")", "==", "0", "||", "msg", "[", "len", "(", "msg", ")", "-", "1", "]", "!=", "'\\n'", "{", "buf", "=", "append", "(", "buf", ",", "'\\n'", ")", "\n", "}", "\n\n", "l", ".", "hLock", ".", "Lock", "(", ")", "\n", "l", ".", "handler", ".", "Write", "(", "buf", ")", "\n", "l", ".", "hLock", ".", "Unlock", "(", ")", "\n", "}" ]
9,637
all-9638
[ "Start", "-", "starts", "a", "service", "for", "remote", "clients", "to", "subscribe", "to", "events" ]
[ "func", "(", "server", "*", "Server", ")", "Start", "(", ")", "error", "{", "var", "err", "error", "\n", "service", ":=", "server", ".", "service", "\n", "if", "!", "service", ".", "started", "{", "rpcServer", ":=", "rpc", ".", "NewServer", "(", ")", "\n", "rpcServer", ".", "Register", "(", "service", ")", "\n", "rpcServer", ".", "HandleHTTP", "(", "server", ".", "path", ",", "\"", "\"", "+", "server", ".", "path", ")", "\n", "l", ",", "e", ":=", "net", ".", "Listen", "(", "\"", "\"", ",", "<mask>", ".", "address", ")", "\n", "if", "e", "!=", "nil", "{", "err", "=", "e", "\n", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "e", ")", "\n", "}", "\n", "service", ".", "started", "=", "true", "\n", "service", ".", "wg", ".", "Add", "(", "1", ")", "\n", "go", "http", ".", "Serve", "(", "l", ",", "nil", ")", "\n", "}", "else", "{", "err", "=", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "err", "\n", "}" ]
9,638
all-9639
[ "IterNthChild", "is", "a", "wrapper", "around", "gtk_tree_model_iter_nth_child", "()", "." ]
[ "func", "(", "v", "*", "TreeModel", ")", "IterNthChild", "(", "iter", "*", "TreeIter", ",", "parent", "*", "TreeIter", ",", "n", "int", ")", "bool", "{", "c", ":=", "C", ".", "gtk_tree_model_iter_nth_child", "(", "v", ".", "native", "(", ")", ",", "iter", ".", "native", "(", ")", ",", "<mask>", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "n", ")", ")", "\n", "return", "gobool", "(", "c", ")", "\n", "}" ]
9,639
all-9640
[ "UpdateOutlierReport", "updates", "passed", "outlier", "report", "." ]
[ "func", "(", "a", "*", "API", ")", "UpdateOutlierReport", "(", "cfg", "*", "OutlierReport", ")", "(", "*", "OutlierReport", ",", "error", ")", "{", "if", "cfg", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "reportCID", ":=", "string", "(", "cfg", ".", "CID", ")", "\n\n", "matched", ",", "err", ":=", "regexp", ".", "MatchString", "(", "config", ".", "OutlierReportCIDRegex", ",", "reportCID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "!", "<mask>", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "reportCID", ")", "\n", "}", "\n\n", "jsonCfg", ",", "err", ":=", "json", ".", "Marshal", "(", "cfg", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "a", ".", "Debug", "{", "a", ".", "Log", ".", "Printf", "(", "\"", "\"", ",", "string", "(", "jsonCfg", ")", ")", "\n", "}", "\n\n", "result", ",", "err", ":=", "a", ".", "Put", "(", "reportCID", ",", "jsonCfg", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "report", ":=", "&", "OutlierReport", "{", "}", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "result", ",", "report", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "report", ",", "nil", "\n", "}" ]
9,640
all-9641
[ "At", "implements", "storage", ".", "SeriesIterator", "." ]
[ "func", "(", "c", "*", "concreteSeriesIterator", ")", "At", "(", ")", "(", "t", "int64", ",", "v", "float64", ")", "{", "s", ":=", "c", ".", "series", ".", "samples", "[", "c", ".", "cur", "]", "\n", "return", "s", ".", "Timestamp", ",", "s", ".", "<mask>", "\n", "}" ]
9,641
all-9642
[ "Rows", "creates", "a", "Rows", "query", "with", "defaults" ]
[ "func", "(", "f", "*", "Field", ")", "Rows", "(", ")", "*", "PQLRowsQuery", "{", "text", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "f", ".", "name", ")", "\n", "return", "NewPQLRowsQuery", "(", "text", ",", "f", ".", "<mask>", ",", "nil", ")", "\n", "}" ]
9,642
all-9643
[ "NewDBFromConnStr", "connects", "to", "db", "and", "returns", "db", "instance", "." ]
[ "func", "NewDBFromConnStr", "(", "connStr", "string", ")", "(", "*", "reform", ".", "<mask>", ",", "error", ")", "{", "conn", ",", "err", ":=", "dbConnect", "(", "connStr", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "newReform", "(", "conn", ")", ",", "nil", "\n", "}" ]
9,643
all-9644
[ "UpdateMessagePact", "adds", "a", "pact", "message", "to", "a", "contract", "file" ]
[ "func", "(", "p", "*", "PactClient", ")", "UpdateMessagePact", "(", "request", "types", ".", "PactMessageRequest", ")", "error", "{", "log", ".", "Println", "(", "\"", "\"", ")", "\n\n", "// Convert request into flags, and validate request", "err", ":=", "<mask>", ".", "Validate", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "svc", ":=", "p", ".", "messageSvcManager", ".", "NewService", "(", "request", ".", "Args", ")", "\n", "cmd", ":=", "svc", ".", "Command", "(", ")", "\n\n", "stdOutPipe", ",", "err", ":=", "cmd", ".", "StdoutPipe", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "stdErrPipe", ",", "err", ":=", "cmd", ".", "StderrPipe", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "err", "=", "cmd", ".", "Start", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "stdOut", ",", "err", ":=", "ioutil", ".", "ReadAll", "(", "stdOutPipe", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "stdErr", ",", "err", ":=", "ioutil", ".", "ReadAll", "(", "stdErrPipe", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "err", "=", "cmd", ".", "Wait", "(", ")", "\n\n", "if", "err", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "return", "fmt", ".", "Errorf", "(", "\"", "\\n", "\\n", "\\n", "\\n", "\\n", "\\n", "\"", ",", "err", ",", "stdErr", ",", "stdOut", ")", "\n", "}" ]
9,644
all-9645
[ "**************************************************************************************", "\\", "Drawing", "*", "\\", "***************************************************************************************", "/", "*", "Draws", "4", "-", "connected", "8", "-", "connected", "or", "antialiased", "line", "segment", "connecting", "two", "points", "color", "Scalar" ]
[ "func", "Line", "(", "image", "*", "IplImage", ",", "pt1", ",", "pt2", "Point", ",", "color", "Scalar", ",", "thickness", ",", "line_type", ",", "shift", "int", ")", "{", "C", ".", "cvLine", "(", "unsafe", ".", "Pointer", "(", "image", ")", ",", "C", ".", "cvPoint", "(", "C", ".", "int", "(", "pt1", ".", "X", ")", ",", "C", ".", "int", "(", "pt1", ".", "Y", ")", ")", ",", "C", ".", "cvPoint", "(", "C", ".", "int", "(", "pt2", ".", "X", ")", ",", "C", ".", "int", "(", "pt2", ".", "Y", ")", ")", ",", "(", "C", ".", "CvScalar", ")", "(", "color", ")", ",", "C", ".", "int", "(", "thickness", ")", ",", "C", ".", "int", "(", "line_type", ")", ",", "C", ".", "int", "(", "<mask>", ")", ",", ")", "\n", "}" ]
9,645
all-9646
[ "AddSystemUser", "adds", "a", "system", "user", "to", "both", "user", "and", "shadow", "files", "." ]
[ "func", "AddSystemUser", "(", "name", ",", "homeDir", "string", ",", "gid", "int", ")", "(", "uid", "int", ",", "err", "error", ")", "{", "s", ":=", "NewShadow", "(", "name", ")", "\n", "if", "err", "=", "s", ".", "Add", "(", "nil", ")", ";", "err", "!=", "nil", "{", "return", "\n", "}", "\n\n", "return", "NewSystemUser", "(", "<mask>", ",", "homeDir", ",", "gid", ")", ".", "Add", "(", ")", "\n", "}" ]
9,646
all-9647
[ "rate", "returns", "the", "per", "-", "second", "rate", "." ]
[ "func", "(", "r", "*", "ewmaRate", ")", "<mask>", "(", ")", "float64", "{", "r", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "mutex", ".", "Unlock", "(", ")", "\n", "return", "r", ".", "lastRate", "\n", "}" ]
9,647
all-9648
[ "Diem", "will", "log", "a", "message", "using", "Fatalm", "call", "ShutdownLoggers", "and", "then", "exit", "the", "application", "with", "the", "provided", "exit", "code", "." ]
[ "func", "(", "la", "*", "LogAdapter", ")", "Diem", "(", "exitCode", "int", ",", "m", "*", "Attrs", ",", "<mask>", "string", ",", "a", "...", "interface", "{", "}", ")", "{", "la", ".", "Log", "(", "LevelFatal", ",", "m", ",", "msg", ",", "a", "...", ")", "\n", "la", ".", "base", ".", "ShutdownLoggers", "(", ")", "\n", "curExiter", ".", "Exit", "(", "exitCode", ")", "\n", "}" ]
9,648
all-9649
[ "GetLogger", "returns", "a", "logger", "suitable", "for", "using", "as", "logger", ".", "Log", "." ]
[ "func", "GetLogger", "(", "syslog", "string", ",", "logfile", "string", ",", "verbose", "bool", ",", "debug", "bool", ",", "customHandler", "log", ".", "Handler", ")", "(", "logger", ".", "Logger", ",", "error", ")", "{", "Log", ":=", "log", ".", "New", "(", ")", "\n\n", "var", "handlers", "[", "]", "log", ".", "Handler", "\n", "var", "syshandler", "log", ".", "Handler", "\n\n", "// System specific handler", "syshandler", "=", "getSystemHandler", "(", "syslog", ",", "debug", ",", "LogfmtFormat", "(", ")", ")", "\n", "if", "syshandler", "!=", "nil", "{", "handlers", "=", "append", "(", "handlers", ",", "syshandler", ")", "\n", "}", "\n\n", "// FileHandler", "if", "logfile", "!=", "\"", "\"", "{", "if", "!", "pathExists", "(", "filepath", ".", "Dir", "(", "logfile", ")", ")", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "filepath", ".", "Dir", "(", "logfile", ")", ")", "\n", "}", "\n\n", "if", "!", "debug", "{", "handlers", "=", "append", "(", "handlers", ",", "log", ".", "LvlFilterHandler", "(", "log", ".", "LvlInfo", ",", "log", ".", "Must", ".", "FileHandler", "(", "logfile", ",", "LogfmtFormat", "(", ")", ")", ",", ")", ",", ")", "\n", "}", "else", "{", "handlers", "=", "append", "(", "handlers", ",", "log", ".", "Must", ".", "FileHandler", "(", "logfile", ",", "LogfmtFormat", "(", ")", ")", ")", "\n", "}", "\n", "}", "\n\n", "// StderrHandler", "<mask>", ":=", "LogfmtFormat", "(", ")", "\n", "if", "term", ".", "IsTty", "(", "os", ".", "Stderr", ".", "Fd", "(", ")", ")", "{", "format", "=", "TerminalFormat", "(", ")", "\n", "}", "\n\n", "if", "verbose", "||", "debug", "{", "if", "!", "debug", "{", "handlers", "=", "append", "(", "handlers", ",", "log", ".", "LvlFilterHandler", "(", "log", ".", "LvlInfo", ",", "log", ".", "StreamHandler", "(", "os", ".", "Stderr", ",", "format", ")", ",", ")", ",", ")", "\n", "}", "else", "{", "handlers", "=", "append", "(", "handlers", ",", "log", ".", "StreamHandler", "(", "os", ".", "Stderr", ",", "format", ")", ")", "\n", "}", "\n", "}", "else", "{", "handlers", "=", "append", "(", "handlers", ",", "log", ".", "LvlFilterHandler", "(", "log", ".", "LvlWarn", ",", "log", ".", "StreamHandler", "(", "os", ".", "Stderr", ",", "format", ")", ",", ")", ",", ")", "\n", "}", "\n\n", "if", "customHandler", "!=", "nil", "{", "handlers", "=", "append", "(", "handlers", ",", "customHandler", ")", "\n", "}", "\n\n", "Log", ".", "SetHandler", "(", "log", ".", "MultiHandler", "(", "handlers", "...", ")", ")", "\n\n", "return", "Log", ",", "nil", "\n", "}" ]
9,649
all-9650
[ "SetShowRecommended", "()", "is", "a", "wrapper", "around", "gtk_app_chooser_widget_set_show_recommended", "()", "." ]
[ "func", "(", "v", "*", "AppChooserWidget", ")", "SetShowRecommended", "(", "<mask>", "bool", ")", "{", "C", ".", "gtk_app_chooser_widget_set_show_recommended", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "setting", ")", ")", "\n", "}" ]
9,650
all-9651
[ "Move", "enqueues", "tile", "moving", "tasks", "." ]
[ "func", "(", "b", "*", "Board", ")", "Move", "(", "dir", "Dir", ")", "error", "{", "for", "t", ":=", "range", "b", ".", "tiles", "{", "t", ".", "stopAnimation", "(", ")", "\n", "}", "\n", "if", "!", "MoveTiles", "(", "b", ".", "tiles", ",", "b", ".", "size", ",", "dir", ")", "{", "return", "nil", "\n", "}", "\n", "b", ".", "tasks", "=", "append", "(", "b", ".", "tasks", ",", "func", "(", ")", "error", "{", "for", "t", ":=", "range", "b", ".", "tiles", "{", "if", "t", ".", "IsMoving", "(", ")", "{", "return", "nil", "\n", "}", "\n", "}", "\n", "return", "taskTerminated", "\n", "}", ")", "\n", "b", ".", "tasks", "=", "append", "(", "b", ".", "tasks", ",", "func", "(", ")", "error", "{", "nextTiles", ":=", "map", "[", "*", "Tile", "]", "struct", "{", "}", "{", "}", "\n", "for", "t", ":=", "range", "b", ".", "tiles", "{", "if", "t", ".", "IsMoving", "(", ")", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "t", ".", "next", ".", "<mask>", "!=", "0", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "t", ".", "current", ".", "value", "==", "0", "{", "continue", "\n", "}", "\n", "nextTiles", "[", "t", "]", "=", "struct", "{", "}", "{", "}", "\n", "}", "\n", "b", ".", "tiles", "=", "nextTiles", "\n", "if", "err", ":=", "addRandomTile", "(", "b", ".", "tiles", ",", "b", ".", "size", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "taskTerminated", "\n", "}", ")", "\n", "return", "nil", "\n", "}" ]
9,651
all-9652
[ "DeepCopyObject", "implements", "Collection", "interface" ]
[ "func", "(", "in", "*", "ResourceCollection", ")", "DeepCopyObject", "(", ")", "runtime", ".", "Object", "{", "if", "c", ":=", "<mask>", ".", "deepCopy", "(", ")", ";", "c", "!=", "nil", "{", "return", "c", "\n", "}", "\n", "return", "nil", "\n", "}" ]
9,652
all-9653
[ "OSFamily", "uses", "the", "resource", "pool", "s", "environment", "browser", "to", "get", "the", "OS", "family", "for", "a", "specific", "guest", "ID", "." ]
[ "func", "OSFamily", "(", "client", "*", "govmomi", ".", "Client", ",", "pool", "*", "object", ".", "ResourcePool", ",", "guest", "string", ")", "(", "string", ",", "error", ")", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "guest", ")", "\n", "pprops", ",", "err", ":=", "Properties", "(", "pool", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n", "return", "computeresource", ".", "OSFamily", "(", "<mask>", ",", "pprops", ".", "Owner", ",", "guest", ")", "\n", "}" ]
9,653
all-9654
[ "Start", "the", "server" ]
[ "func", "(", "s", "*", "TLS", ")", "Start", "(", "c", "context", ".", "Context", ",", "h", "<mask>", ".", "Handler", ")", "error", "{", "s", ".", "Handler", "=", "h", "\n", "return", "s", ".", "ListenAndServeTLS", "(", "s", ".", "CertFile", ",", "s", ".", "KeyFile", ")", "\n", "}" ]
9,654
all-9655
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SetInstrumentationBreakpointParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger1", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
9,655
all-9656
[ "IMPLEMENTATION", "MakeHub", "returns", "new", "instance", "of", "the", "pubsub", "hub", "." ]
[ "func", "MakeHub", "(", "config", "HubConfig", ")", "(", "Hub", ",", "error", ")", "{", "if", "config", "==", "nil", "{", "return", "NewHub", "(", ")", ",", "nil", "\n", "}", "\n\n", "driverName", ":=", "getDriverName", "(", "config", ")", "\n", "if", "len", "(", "driverName", ")", "==", "0", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "d", ",", "<mask>", ":=", "drivers", "[", "driverName", "]", "\n", "if", "ok", "{", "h", ",", "err", ":=", "d", ".", "Create", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Errorf", "(", "\"", "\"", ",", "driverName", ",", "err", ")", "\n", "return", "nil", ",", "err", "\n", "}", "\n", "log", ".", "Info", "(", "\"", "\"", ",", "driverName", ")", "\n", "return", "h", ",", "nil", "\n", "}", "\n\n", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "driverName", ")", "\n", "}" ]
9,656
all-9657
[ "PrettyPrintCode", "renders", "h", "as", "<error", "code", ">", "<description", ">", "e", ".", "g", ".", "200", "OK" ]
[ "func", "PrettyPrintCode", "(", "h", "*", "HTTPError", ")", "string", "{", "codeNumber", ":=", "h", ".", "Code", "(", ")", "\n", "codeText", ":=", "<mask>", ".", "StatusText", "(", "h", ".", "Code", "(", ")", ")", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "codeNumber", ",", "codeText", ")", "\n", "}" ]
9,657
all-9658
[ "AddEntry", "add", "new", "child", "entry", ".", "Child", "entries", "are", "sorted", "irrespective", "of", "order", "they", "are", "added", ".", "Static", "patterns", "would", "be", "indexed", "ahead", "of", "match", "patterns", "." ]
[ "func", "(", "e", "*", "Entry", ")", "AddEntry", "(", "child", "*", "Entry", ")", "{", "length", ":=", "len", "(", "e", ".", "entries", ")", "\n", "if", "length", "==", "0", "{", "e", ".", "entries", "=", "append", "(", "e", ".", "entries", ",", "child", ")", "\n", "return", "\n", "}", "\n\n", "index", ":=", "sort", ".", "Search", "(", "length", ",", "func", "(", "i", "int", ")", "bool", "{", "return", "child", ".", "weight", ">", "e", ".", "entries", "[", "i", "]", ".", "weight", "\n", "}", ")", "\n\n", "if", "index", "==", "length", "{", "e", ".", "entries", "=", "<mask>", "(", "e", ".", "entries", ",", "child", ")", "\n", "return", "\n", "}", "\n\n", "e", ".", "entries", "=", "append", "(", "e", ".", "entries", ",", "nil", ")", "\n", "copy", "(", "e", ".", "entries", "[", "index", "+", "1", ":", "]", ",", "e", ".", "entries", "[", "index", ":", "]", ")", "\n", "e", ".", "entries", "[", "index", "]", "=", "child", "\n", "}" ]
9,658
all-9659
[ "Do", "executes", "Overlay", ".", "setInspectMode", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetInspectModeParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetInspectMode", ",", "p", ",", "nil", ")", "\n", "}" ]
9,659
all-9660
[ "String", "returns", "a", "human", "-", "readable", "string", "representing", "the", "edit", "-", "script", "where", "Identity", "UniqueX", "UniqueY", "and", "Modified", "are", "represented", "by", "the", ".", "X", "Y", "and", "M", "characters", "respectively", "." ]
[ "func", "(", "es", "EditScript", ")", "String", "(", ")", "string", "{", "b", ":=", "make", "(", "[", "]", "byte", ",", "len", "(", "es", ")", ")", "\n", "for", "i", ",", "e", ":=", "range", "es", "{", "<mask>", "e", "{", "case", "Identity", ":", "b", "[", "i", "]", "=", "'.'", "\n", "case", "UniqueX", ":", "b", "[", "i", "]", "=", "'X'", "\n", "case", "UniqueY", ":", "b", "[", "i", "]", "=", "'Y'", "\n", "case", "Modified", ":", "b", "[", "i", "]", "=", "'M'", "\n", "default", ":", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "}", "\n", "return", "string", "(", "b", ")", "\n", "}" ]
9,660
all-9661
[ "AddMetadata", "adds", "necessary", "metadata", "(", "including", "authentication", "credentials", ")", "to", "the", "context", "ctx", "preserving", "any", "metadata", "that", "is", "present", "in", "either", "the", "incoming", "or", "outgoing", "metadata", "of", "ctx", "." ]
[ "func", "(", "c", "*", "APIClient", ")", "AddMetadata", "(", "ctx", "context", ".", "Context", ")", "context", ".", "<mask>", "{", "// TODO(msteffen): There are several places in this client where it's possible", "// to set per-request metadata (specifically auth tokens): client.WithCtx(),", "// client.SetAuthToken(), etc. These should be consolidated, as this API", "// doesn't make it obvious how these settings are resolved when they conflict.", "clientData", ":=", "make", "(", "map", "[", "string", "]", "string", ")", "\n", "if", "c", ".", "authenticationToken", "!=", "\"", "\"", "{", "clientData", "[", "auth", ".", "ContextTokenKey", "]", "=", "c", ".", "authenticationToken", "\n", "}", "\n", "// metadata API downcases all the key names", "if", "c", ".", "metricsUserID", "!=", "\"", "\"", "{", "clientData", "[", "\"", "\"", "]", "=", "c", ".", "metricsUserID", "\n", "clientData", "[", "\"", "\"", "]", "=", "c", ".", "metricsPrefix", "\n", "}", "\n\n", "// Rescue any metadata pairs already in 'ctx' (otherwise", "// metadata.NewOutgoingContext() would drop them). Note that this is similar", "// to metadata.Join(), but distinct because it discards conflicting k/v pairs", "// instead of merging them)", "incomingMD", ",", "_", ":=", "metadata", ".", "FromIncomingContext", "(", "ctx", ")", "\n", "outgoingMD", ",", "_", ":=", "metadata", ".", "FromOutgoingContext", "(", "ctx", ")", "\n", "clientMD", ":=", "metadata", ".", "New", "(", "clientData", ")", "\n", "finalMD", ":=", "make", "(", "metadata", ".", "MD", ")", "// Collect k/v pairs", "\n", "for", "_", ",", "md", ":=", "range", "[", "]", "metadata", ".", "MD", "{", "incomingMD", ",", "outgoingMD", ",", "clientMD", "}", "{", "for", "k", ",", "v", ":=", "range", "md", "{", "finalMD", "[", "k", "]", "=", "v", "\n", "}", "\n", "}", "\n", "return", "metadata", ".", "NewOutgoingContext", "(", "ctx", ",", "finalMD", ")", "\n", "}" ]
9,661
all-9662
[ "verifyTaskMetadata", "verifies", "the", "number", "of", "containers", "in", "task", "metadata", "make", "sure", "each", "necessary", "field", "is", "not", "empty", "we", "cannot", "check", "the", "values", "of", "those", "fields", "since", "they", "are", "dynamic", ".", "It", "also", "verifies", "the", "container", "metadata", "." ]
[ "func", "verifyTaskMetadata", "(", "taskMetadataRawMsg", "json", ".", "RawMessage", ")", "error", "{", "taskMetadataMap", ":=", "make", "(", "<mask>", "[", "string", "]", "json", ".", "RawMessage", ")", "\n", "json", ".", "Unmarshal", "(", "taskMetadataRawMsg", ",", "&", "taskMetadataMap", ")", "\n\n", "if", "taskMetadataMap", "[", "\"", "\"", "]", "==", "nil", "{", "return", "notEmptyErrMsg", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "taskMetadataMap", "[", "\"", "\"", "]", "==", "nil", "{", "return", "notEmptyErrMsg", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "taskMetadataMap", "[", "\"", "\"", "]", "==", "nil", "{", "return", "notEmptyErrMsg", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "taskMetadataMap", "[", "\"", "\"", "]", "==", "nil", "{", "return", "notEmptyErrMsg", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "taskMetadataMap", "[", "\"", "\"", "]", "==", "nil", "{", "return", "notEmptyErrMsg", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "taskMetadataMap", "[", "\"", "\"", "]", "==", "nil", "{", "return", "notEmptyErrMsg", "(", "\"", "\"", ")", "\n", "}", "\n\n", "var", "containersMetadataArray", "[", "]", "json", ".", "RawMessage", "\n", "json", ".", "Unmarshal", "(", "taskMetadataMap", "[", "\"", "\"", "]", ",", "&", "containersMetadataArray", ")", "\n", "if", "len", "(", "containersMetadataArray", ")", "!=", "1", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "len", "(", "containersMetadataArray", ")", ")", "\n", "}", "\n\n", "return", "verifyContainerMetadata", "(", "containersMetadataArray", "[", "0", "]", ")", "\n", "}" ]
9,662
all-9663
[ "SupportsSignatures", "returns", "an", "error", "(", "to", "be", "displayed", "to", "the", "user", ")", "if", "the", "destination", "certainly", "can", "t", "store", "signatures" ]
[ "func", "(", "d", "*", "ociArchiveImageDestination", ")", "SupportsSignatures", "(", "ctx", "context", ".", "<mask>", ")", "error", "{", "return", "d", ".", "unpackedDest", ".", "SupportsSignatures", "(", "ctx", ")", "\n", "}" ]
9,663
all-9664
[ "NewImageDestination", "returns", "a", "types", ".", "ImageDestination", "for", "this", "reference", ".", "The", "caller", "must", "call", ".", "Close", "()", "on", "the", "returned", "ImageDestination", "." ]
[ "func", "(", "<mask>", "archiveReference", ")", "NewImageDestination", "(", "ctx", "context", ".", "Context", ",", "sys", "*", "types", ".", "SystemContext", ")", "(", "types", ".", "ImageDestination", ",", "error", ")", "{", "return", "newImageDestination", "(", "sys", ",", "ref", ")", "\n", "}" ]
9,664
all-9665
[ "StorageVolumeCleanupImages", "removes", "the", "volumes", "with", "the", "given", "fingerprints", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "StorageVolumeCleanupImages", "(", "fingerprints", "[", "]", "string", ")", "error", "{", "stmt", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "query", ".", "Params", "(", "len", "(", "fingerprints", ")", ")", ")", "\n", "args", ":=", "[", "]", "<mask>", "{", "}", "{", "StoragePoolVolumeTypeImage", "}", "\n", "for", "_", ",", "fingerprint", ":=", "range", "fingerprints", "{", "args", "=", "append", "(", "args", ",", "fingerprint", ")", "\n", "}", "\n", "err", ":=", "exec", "(", "c", ".", "db", ",", "stmt", ",", "args", "...", ")", "\n", "return", "err", "\n", "}" ]
9,665
all-9666
[ "appendIterators", "appends", "iterators", "to", "an", "array", "of", "iterators", "for", "merging", ".", "Note", ":", "This", "obtains", "references", "for", "the", "table", "handlers", ".", "Remember", "to", "close", "these", "iterators", "." ]
[ "func", "(", "s", "*", "levelsController", ")", "appendIterators", "(", "iters", "[", "]", "y", ".", "Iterator", ",", "opt", "*", "IteratorOptions", ")", "[", "]", "y", ".", "Iterator", "{", "// Just like with get, it's important we iterate the levels from 0 on upward, to avoid missing", "// data when there's a compaction.", "for", "_", ",", "level", ":=", "range", "s", ".", "levels", "{", "iters", "=", "level", ".", "appendIterators", "(", "iters", ",", "<mask>", ")", "\n", "}", "\n", "return", "iters", "\n", "}" ]
9,666
all-9667
[ "MonitoringMetricLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "MonitoringMetricLocator", "(", "href", "<mask>", ")", "*", "MonitoringMetricLocator", "{", "return", "&", "MonitoringMetricLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
9,667
all-9668
[ "GetDouble", "()", "is", "a", "wrapper", "around", "gtk_print_settings_get_double", "()", "." ]
[ "func", "(", "ps", "*", "PrintSettings", ")", "GetDouble", "(", "key", "string", ")", "float64", "{", "cstr", ":=", "C", ".", "CString", "(", "<mask>", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "c", ":=", "C", ".", "gtk_print_settings_get_double", "(", "ps", ".", "native", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", "\n", "return", "float64", "(", "c", ")", "\n", "}" ]
9,668
all-9669
[ "ReadAll", "reads", "all", "available", "pod", "logs", "failing", "if", "they", "are", "too", "large" ]
[ "func", "(", "a", "*", "PodLogArtifact", ")", "ReadAll", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "<mask>", ",", "err", ":=", "a", ".", "Size", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "if", "size", ">", "a", ".", "sizeLimit", "{", "return", "nil", ",", "lenses", ".", "ErrFileTooLarge", "\n", "}", "\n", "logs", ",", "err", ":=", "a", ".", "jobAgent", ".", "GetJobLog", "(", "a", ".", "name", ",", "a", ".", "buildID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "return", "logs", ",", "nil", "\n", "}" ]
9,669
all-9670
[ "GetPerspectiveTransform", "calculates", "a", "perspective", "transform", "from", "four", "pairs", "of", "the", "corresponding", "points", ".", "Parameters", ":", "src", "–", "Coordinates", "of", "quadrangle", "vertices", "in", "the", "source", "image", ".", "dst", "–", "Coordinates", "of", "the", "corresponding", "quadrangle", "vertices", "in", "the", "destination", "image", ".", "Returns", "the", "computed", "matrix" ]
[ "func", "GetPerspectiveTransform", "(", "rect", ",", "dst", "[", "]", "CvPoint2D32f", ")", "*", "Mat", "{", "mat", ":=", "CreateMat", "(", "3", ",", "3", ",", "CV_64F", ")", "\n", "result", ":=", "C", ".", "cvGetPerspectiveTransform", "(", "(", "*", "C", ".", "CvPoint2D32f", ")", "(", "&", "rect", "[", "0", "]", ")", ",", "(", "*", "C", ".", "CvPoint2D32f", ")", "(", "&", "dst", "[", "0", "]", ")", ",", "(", "*", "C", ".", "struct_CvMat", ")", "(", "mat", ")", ")", "\n", "return", "(", "*", "Mat", ")", "(", "<mask>", ")", "\n", "}" ]
9,670
all-9671
[ "ParseCommits", "converts", "all", "arguments", "to", "*", "pfs", ".", "Commit", "structs", "using", "the", "semantics", "of", "ParseCommit" ]
[ "func", "ParseCommits", "(", "args", "[", "]", "string", ")", "(", "[", "]", "*", "pfs", ".", "Commit", ",", "error", ")", "{", "var", "results", "[", "]", "*", "pfs", ".", "Commit", "\n", "for", "_", ",", "arg", ":=", "range", "args", "{", "commit", ",", "err", ":=", "ParseCommit", "(", "arg", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "results", "=", "append", "(", "results", ",", "<mask>", ")", "\n", "}", "\n", "return", "results", ",", "nil", "\n", "}" ]
9,671
all-9672
[ "MarshalYAML", "implements", "the", "yaml", ".", "Marshaler", "interface", "." ]
[ "func", "(", "tg", "Group", ")", "MarshalYAML", "(", ")", "(", "<mask>", "{", "}", ",", "error", ")", "{", "g", ":=", "&", "struct", "{", "Targets", "[", "]", "string", "`yaml:\"targets\"`", "\n", "Labels", "model", ".", "LabelSet", "`yaml:\"labels,omitempty\"`", "\n", "}", "{", "Targets", ":", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "tg", ".", "Targets", ")", ")", ",", "Labels", ":", "tg", ".", "Labels", ",", "}", "\n", "for", "_", ",", "t", ":=", "range", "tg", ".", "Targets", "{", "g", ".", "Targets", "=", "append", "(", "g", ".", "Targets", ",", "string", "(", "t", "[", "model", ".", "AddressLabel", "]", ")", ")", "\n", "}", "\n", "return", "g", ",", "nil", "\n", "}" ]
9,672
all-9673
[ "ApplyRuleIf", "test", "if", "condition", "is", "true", "than", "apply", "rule", ".", "If", "condition", "is", "false", "do", "nothing", "return", "true", "." ]
[ "func", "ApplyRuleIf", "(", "condition", ",", "rule", "Ruler", ")", "Ruler", "{", "return", "&", "apply", "{", "<mask>", ":", "condition", ",", "rule", ":", "rule", ",", "}", "\n", "}" ]
9,673
all-9674
[ "GetTriggerWindowOk", "returns", "a", "tuple", "with", "the", "TriggerWindow", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "ThresholdWindows", ")", "GetTriggerWindowOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "t", "==", "nil", "||", "t", ".", "TriggerWindow", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "t", ".", "TriggerWindow", ",", "<mask>", "\n", "}" ]
9,674
all-9675
[ "HasIncreaseGood", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TileDefRequest", ")", "HasIncreaseGood", "(", ")", "bool", "{", "if", "t", "!=", "nil", "&&", "t", ".", "IncreaseGood", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
9,675
all-9676
[ "Calculates", "approximate", "distance", "between", "two", "points", "using", "euclidian", "distance", ".", "The", "assumption", "here", "is", "that", "the", "points", "are", "relatively", "close", "to", "each", "other", "." ]
[ "func", "approximateSquareDistance", "(", "p1", ",", "p2", "Point", ")", "Meters", "{", "avgLat", ":=", "(", "p1", ".", "Lat", "(", ")", "+", "p2", ".", "Lat", "(", ")", ")", "/", "2.0", "\n\n", "latLen", ":=", "math", ".", "Abs", "(", "p1", ".", "Lat", "(", ")", "-", "p2", ".", "Lat", "(", ")", ")", "*", "float64", "(", "latDegreeLength", ")", "\n", "lonLen", ":=", "math", ".", "Abs", "(", "p1", ".", "Lon", "(", ")", "-", "p2", ".", "Lon", "(", ")", ")", "*", "float64", "(", "lonLength", ".", "<mask>", "(", "avgLat", ")", ")", "\n\n", "return", "Meters", "(", "latLen", "*", "latLen", "+", "lonLen", "*", "lonLen", ")", "\n", "}" ]
9,676
all-9677
[ "RunWithRetry", "will", "take", "a", "function", "that", "makes", "the", "TChannel", "call", "and", "will", "rerun", "it", "as", "specifed", "in", "the", "RetryOptions", "in", "the", "Context", "." ]
[ "func", "(", "ch", "*", "Channel", ")", "RunWithRetry", "(", "runCtx", "context", ".", "Context", ",", "f", "RetriableFunc", ")", "error", "{", "var", "err", "error", "\n\n", "opts", ":=", "getRetryOptions", "(", "runCtx", ")", "\n", "rs", ":=", "ch", ".", "getRequestState", "(", "opts", ")", "\n", "defer", "requestStatePool", ".", "Put", "(", "rs", ")", "\n\n", "for", "i", ":=", "0", ";", "i", "<", "opts", ".", "MaxAttempts", ";", "i", "++", "{", "rs", ".", "Attempt", "++", "\n\n", "if", "opts", ".", "TimeoutPerAttempt", "==", "0", "{", "err", "=", "f", "(", "runCtx", ",", "rs", ")", "\n", "}", "else", "{", "attemptCtx", ",", "cancel", ":=", "context", ".", "WithTimeout", "(", "runCtx", ",", "opts", ".", "TimeoutPerAttempt", ")", "\n", "err", "=", "f", "(", "attemptCtx", ",", "rs", ")", "\n", "cancel", "(", ")", "\n", "}", "\n\n", "if", "err", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "if", "!", "opts", ".", "RetryOn", ".", "CanRetry", "(", "err", ")", "{", "if", "ch", ".", "log", ".", "Enabled", "(", "LogLevelInfo", ")", "{", "ch", ".", "log", ".", "WithFields", "(", "ErrField", "(", "err", ")", ")", ".", "Info", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "err", "\n", "}", "\n\n", "ch", ".", "log", ".", "WithFields", "(", "ErrField", "(", "err", ")", ",", "LogField", "{", "\"", "\"", ",", "<mask>", ".", "Attempt", "}", ",", "LogField", "{", "\"", "\"", ",", "opts", ".", "MaxAttempts", "}", ",", ")", ".", "Info", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Too many retries, return the last error", "return", "err", "\n", "}" ]
9,677
all-9678
[ "Augment", "processes", "source", "files", "to", "improve", "calls", "to", "be", "more", "descriptive", ".", "It", "modifies", "goroutines", "in", "place", ".", "It", "requires", "calling", "ParseDump", "()", "with", "guesspaths", "set", "to", "true", "to", "work", "properly", "." ]
[ "func", "Augment", "(", "goroutines", "[", "]", "*", "Goroutine", ")", "{", "c", ":=", "&", "cache", "{", "}", "\n", "for", "_", ",", "g", ":=", "<mask>", "goroutines", "{", "c", ".", "augmentGoroutine", "(", "g", ")", "\n", "}", "\n", "}" ]
9,678
all-9679
[ "GetUint64", "implements", "the", "StableStore", "interface", "." ]
[ "func", "(", "i", "*", "InmemStore", ")", "GetUint64", "(", "key", "[", "]", "byte", ")", "(", "uint64", ",", "error", ")", "{", "i", ".", "l", ".", "RLock", "(", ")", "\n", "defer", "i", ".", "l", ".", "RUnlock", "(", ")", "\n", "return", "i", ".", "kvInt", "[", "string", "(", "<mask>", ")", "]", ",", "nil", "\n", "}" ]
9,679
all-9680
[ "add", "adds", "a", "new", "service", "to", "list", "of", "services", "." ]
[ "func", "(", "s", "*", "services", ")", "<mask>", "(", "r", "*", "repoService", ")", "{", "s", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "Unlock", "(", ")", "\n\n", "s", ".", "services", "=", "append", "(", "s", ".", "services", ",", "r", ")", "\n", "}" ]
9,680
all-9681
[ "GetClient", "on", "linux", "will", "simply", "return", "the", "cached", "client", "from", "the", "map" ]
[ "func", "(", "f", "*", "factory", ")", "GetClient", "(", "<mask>", "dockerclient", ".", "DockerVersion", ")", "(", "sdkclient", ".", "Client", ",", "error", ")", "{", "return", "f", ".", "getClient", "(", "version", ")", "\n", "}" ]
9,681
all-9682
[ "DrawLine", "draws", "a", "line", "segment", "on", "the", "given", "destination", "dst", ".", "DrawLine", "is", "intended", "to", "be", "used", "mainly", "for", "debugging", "or", "prototyping", "purpose", "." ]
[ "func", "DrawLine", "(", "dst", "*", "ebiten", ".", "<mask>", ",", "x1", ",", "y1", ",", "x2", ",", "y2", "float64", ",", "clr", "color", ".", "Color", ")", "{", "ew", ",", "eh", ":=", "emptyImage", ".", "Size", "(", ")", "\n", "length", ":=", "math", ".", "Hypot", "(", "x2", "-", "x1", ",", "y2", "-", "y1", ")", "\n\n", "op", ":=", "&", "ebiten", ".", "DrawImageOptions", "{", "}", "\n", "op", ".", "GeoM", ".", "Scale", "(", "length", "/", "float64", "(", "ew", ")", ",", "1", "/", "float64", "(", "eh", ")", ")", "\n", "op", ".", "GeoM", ".", "Rotate", "(", "math", ".", "Atan2", "(", "y2", "-", "y1", ",", "x2", "-", "x1", ")", ")", "\n", "op", ".", "GeoM", ".", "Translate", "(", "x1", ",", "y1", ")", "\n", "op", ".", "ColorM", ".", "Scale", "(", "colorScale", "(", "clr", ")", ")", "\n", "// Filter must be 'nearest' filter (default).", "// Linear filtering would make edges blurred.", "_", "=", "dst", ".", "DrawImage", "(", "emptyImage", ",", "op", ")", "\n", "}" ]
9,682
all-9683
[ "GetMinLocationFailedOk", "returns", "a", "tuple", "with", "the", "MinLocationFailed", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "s", "*", "SyntheticsOptions", ")", "GetMinLocationFailedOk", "(", ")", "(", "int", ",", "bool", ")", "{", "if", "s", "==", "nil", "||", "s", ".", "MinLocationFailed", "==", "nil", "{", "return", "0", ",", "<mask>", "\n", "}", "\n", "return", "*", "s", ".", "MinLocationFailed", ",", "true", "\n", "}" ]
9,683
all-9684
[ "DeleteResourcePolicyRequest", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "DeleteResourcePolicyRequest", "(", "arg0", "*", "secretsmanager", ".", "DeleteResourcePolicyInput", ")", "(", "*", "request", ".", "Request", ",", "*", "secretsmanager", ".", "DeleteResourcePolicyOutput", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "*", "<mask>", ".", "Request", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "*", "secretsmanager", ".", "DeleteResourcePolicyOutput", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
9,684
all-9685
[ "HasCreatedAt", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "s", "*", "SyntheticsTest", ")", "HasCreatedAt", "(", ")", "bool", "{", "if", "s", "!=", "nil", "&&", "s", ".", "CreatedAt", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
9,685
all-9686
[ "FirstByName", "finds", "the", "first", "element", "with", "the", "provided", "name", "attribute", "." ]
[ "func", "(", "s", "*", "selectable", ")", "FirstByName", "(", "name", "string", ")", "*", "Selection", "{", "return", "newSelection", "(", "s", ".", "<mask>", ",", "s", ".", "selectors", ".", "Append", "(", "target", ".", "Name", ",", "name", ")", ".", "At", "(", "0", ")", ")", "\n", "}" ]
9,686
all-9687
[ "HasType", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "m", "*", "Monitor", ")", "HasType", "(", ")", "bool", "{", "if", "m", "!=", "nil", "&&", "m", ".", "Type", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
9,687
all-9688
[ "Run", "is", "a", "wrapper", "around", "g_application_run", "()", "." ]
[ "func", "(", "v", "*", "Application", ")", "Run", "(", "args", "[", "]", "string", ")", "int", "{", "cargs", ":=", "C", ".", "make_strings", "(", "C", ".", "int", "(", "len", "(", "args", ")", ")", ")", "\n", "defer", "C", ".", "destroy_strings", "(", "cargs", ")", "\n\n", "for", "i", ",", "arg", ":=", "<mask>", "args", "{", "cstr", ":=", "C", ".", "CString", "(", "arg", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "C", ".", "set_string", "(", "cargs", ",", "C", ".", "int", "(", "i", ")", ",", "(", "*", "C", ".", "char", ")", "(", "cstr", ")", ")", "\n", "}", "\n\n", "return", "int", "(", "C", ".", "g_application_run", "(", "v", ".", "native", "(", ")", ",", "C", ".", "int", "(", "len", "(", "args", ")", ")", ",", "cargs", ")", ")", "\n", "}" ]
9,688
all-9689
[ "Do", "executes", "CSS", ".", "getBackgroundColors", "against", "the", "provided", "context", ".", "returns", ":", "backgroundColors", "-", "The", "range", "of", "background", "colors", "behind", "this", "element", "if", "it", "contains", "any", "visible", "text", ".", "If", "no", "visible", "text", "is", "present", "this", "will", "be", "undefined", ".", "In", "the", "case", "of", "a", "flat", "background", "color", "this", "will", "consist", "of", "simply", "that", "color", ".", "In", "the", "case", "of", "a", "gradient", "this", "will", "consist", "of", "each", "of", "the", "color", "stops", ".", "For", "anything", "more", "complicated", "this", "will", "be", "an", "empty", "array", ".", "Images", "will", "be", "ignored", "(", "as", "if", "the", "image", "had", "failed", "to", "load", ")", ".", "computedFontSize", "-", "The", "computed", "font", "size", "for", "this", "node", "as", "a", "CSS", "computed", "value", "string", "(", "e", ".", "g", ".", "12px", ")", ".", "computedFontWeight", "-", "The", "computed", "font", "weight", "for", "this", "node", "as", "a", "CSS", "computed", "value", "string", "(", "e", ".", "g", ".", "normal", "or", "100", ")", "." ]
[ "func", "(", "p", "*", "GetBackgroundColorsParams", ")", "Do", "(", "ctx", "context", ".", "Context", ")", "(", "backgroundColors", "[", "]", "string", ",", "computedFontSize", "string", ",", "computedFontWeight", "string", ",", "err", "error", ")", "{", "// execute", "var", "<mask>", "GetBackgroundColorsReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandGetBackgroundColors", ",", "p", ",", "&", "res", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "\"", "\"", ",", "err", "\n", "}", "\n\n", "return", "res", ".", "BackgroundColors", ",", "res", ".", "ComputedFontSize", ",", "res", ".", "ComputedFontWeight", ",", "nil", "\n", "}" ]
9,689
all-9690
[ "native", "()", "returns", "a", "pointer", "to", "the", "underlying", "GtkBuilder", "." ]
[ "func", "(", "b", "*", "<mask>", ")", "native", "(", ")", "*", "C", ".", "GtkBuilder", "{", "if", "b", "==", "nil", "||", "b", ".", "GObject", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "p", ":=", "unsafe", ".", "Pointer", "(", "b", ".", "GObject", ")", "\n", "return", "C", ".", "toGtkBuilder", "(", "p", ")", "\n", "}" ]
9,690
all-9691
[ "copy", "a", "two", "-", "dimensional", "texture", "subimage" ]
[ "func", "CopyTexSubImage2D", "(", "target", "uint32", ",", "level", "int32", ",", "xoffset", "int32", ",", "yoffset", "int32", ",", "x", "int32", ",", "y", "int32", ",", "<mask>", "int32", ",", "height", "int32", ")", "{", "syscall", ".", "Syscall9", "(", "gpCopyTexSubImage2D", ",", "8", ",", "uintptr", "(", "target", ")", ",", "uintptr", "(", "level", ")", ",", "uintptr", "(", "xoffset", ")", ",", "uintptr", "(", "yoffset", ")", ",", "uintptr", "(", "x", ")", ",", "uintptr", "(", "y", ")", ",", "uintptr", "(", "width", ")", ",", "uintptr", "(", "height", ")", ",", "0", ")", "\n", "}" ]
9,691
all-9692
[ "Get", "a", "registered", "ErrorHandler", "for", "this", "status", "code", ".", "If", "no", "ErrorHandler", "has", "been", "registered", "a", "default", "one", "will", "be", "returned", "." ]
[ "func", "(", "e", "ErrorHandlers", ")", "Get", "(", "status", "int", ")", "ErrorHandler", "{", "if", "eh", ",", "ok", ":=", "e", "[", "status", "]", ";", "ok", "{", "return", "eh", "\n", "}", "\n", "if", "eh", ",", "ok", ":=", "e", "[", "0", "]", ";", "<mask>", "{", "return", "eh", "\n", "}", "\n", "return", "defaultErrorHandler", "\n", "}" ]
9,692
all-9693
[ "StrLenIn", "param", "is", "a", "string", "length", "is", "in", "array" ]
[ "func", "(", "c", "*", "Controller", ")", "StrLenIn", "(", "fieldName", "string", ",", "p", "interface", "{", "}", ",", "l", "...", "int", ")", "string", "{", "if", "p", "==", "nil", "{", "p", "=", "\"", "\"", "\n", "}", "\n", "v", ",", "ok", ":=", "p", ".", "(", "string", ")", "\n", "if", "ok", "==", "<mask>", "{", "panic", "(", "(", "&", "ValidationError", "{", "}", ")", ".", "New", "(", "fieldName", "+", "\"", "", "", "", "\n", "}", "\n", "length", ":=", "utf8", ".", "RuneCountInString", "(", "v", ")", "\n", "b", ":=", "false", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "l", ")", ";", "i", "++", "{", "if", "l", "[", "i", "]", "==", "length", "{", "b", "=", "true", "\n", "}", "\n", "}", "\n", "if", "b", "==", "false", "{", "panic", "(", "(", "&", "ValidationError", "{", "}", ")", ".", "New", "(", "fieldName", "+", "\"", "p", "a", "e(strin", "g", "s.Trim(", "f", "mt.Spri", "n", "t(l)", ",", " \"[", "]", "\"), \" ", "\"", ",", " ", "\"", "\"", "-", "1", ")", "+", "\"", "中", ")", "", "", "", "", "", "", "", "", "", "", "\n", "}", "\n", "return", "v", "\n", "}" ]
9,693
all-9694
[ "StatusString", "returns", "a", "human", "readable", "string", "representation", "of", "this", "object" ]
[ "func", "(", "as", "ASMSecretStatus", ")", "<mask>", "(", ")", "string", "{", "for", "k", ",", "v", ":=", "range", "asmSecretStatusMap", "{", "if", "v", "==", "as", "{", "return", "k", "\n", "}", "\n", "}", "\n", "return", "\"", "\"", "\n", "}" ]
9,694
all-9695
[ "ProduceCovList", "summarizes", "profiles", "and", "returns", "the", "result" ]
[ "func", "ProduceCovList", "(", "profiles", "[", "]", "*", "cover", ".", "Profile", ")", "*", "CoverageList", "{", "covList", ":=", "newCoverageList", "(", "\"", "\"", ")", "\n", "for", "_", ",", "prof", ":=", "range", "profiles", "{", "covList", ".", "<mask>", "=", "append", "(", "covList", ".", "Group", ",", "summarizeBlocks", "(", "prof", ")", ")", "\n", "}", "\n", "return", "covList", "\n", "}" ]
9,695
all-9696
[ "JSON", "-" ]
[ "func", "(", "s", "*", "FakeRenderer", ")", "JSON", "(", "status", "int", ",", "v", "<mask>", "{", "}", ")", "{", "s", ".", "SpyStatus", "=", "status", "\n", "s", ".", "SpyValue", "=", "v", "\n", "}" ]
9,696
all-9697
[ "RestoreSecret", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "RestoreSecret", "(", "arg0", "*", "secretsmanager", ".", "RestoreSecretInput", ")", "(", "*", "secretsmanager", ".", "RestoreSecretOutput", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "*", "secretsmanager", ".", "RestoreSecretOutput", ")", "\n", "ret1", ",", "_", ":=", "<mask>", "[", "1", "]", ".", "(", "error", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
9,697
all-9698
[ "Set", "is", "required", "for", "kingpin", "interfaces", "to", "allow", "command", "line", "params", "to", "be", "set", "to", "our", "map", "datatype" ]
[ "func", "(", "o", "*", "MapUint8Option", ")", "Set", "(", "value", "string", ")", "error", "{", "parts", ":=", "stringMapRegex", ".", "Split", "(", "value", ",", "2", ")", "\n", "if", "len", "(", "parts", ")", "!=", "2", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "value", ")", "\n", "}", "\n", "val", ":=", "Uint8Option", "{", "}", "\n", "val", ".", "<mask>", "(", "parts", "[", "1", "]", ")", "\n", "(", "*", "o", ")", "[", "parts", "[", "0", "]", "]", "=", "val", "\n", "return", "nil", "\n", "}" ]
9,698
all-9699
[ "ParseConfig", "loads", "config", "from", "config", "file", "schemas", ".", "conf", "aggregation", ".", "conf" ]
[ "func", "(", "app", "*", "App", ")", "ParseConfig", "(", ")", "<mask>", "{", "app", ".", "Lock", "(", ")", "\n", "defer", "app", ".", "Unlock", "(", ")", "\n\n", "err", ":=", "app", ".", "configure", "(", ")", "\n\n", "if", "app", ".", "PromRegisterer", "==", "nil", "{", "app", ".", "PromRegisterer", "=", "prometheus", ".", "WrapRegistererWith", "(", "prometheus", ".", "Labels", "(", "app", ".", "Config", ".", "Prometheus", ".", "Labels", ")", ",", "app", ".", "PromRegistry", ",", ")", "\n", "}", "\n\n", "return", "err", "\n", "}" ]
9,699
all-9700
[ "EndOfMonth", "end", "of", "month" ]
[ "func", "(", "now", "*", "Now", ")", "EndOfMonth", "(", ")", "<mask>", ".", "Time", "{", "return", "now", ".", "BeginningOfMonth", "(", ")", ".", "AddDate", "(", "0", ",", "1", ",", "0", ")", ".", "Add", "(", "-", "time", ".", "Nanosecond", ")", "\n", "}" ]