id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
16,400
all-16401
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "DeliverPushMessageParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoServiceworker17", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
16,401
all-16402
[ "checkExistingStatus", "will", "retrieve", "the", "current", "status", "of", "the", "DCO", "context", "for", "the", "provided", "SHA", "." ]
[ "func", "checkExistingStatus", "(", "gc", "gitHubClient", ",", "l", "*", "logrus", ".", "Entry", ",", "org", ",", "repo", ",", "sha", "string", ")", "(", "string", ",", "error", ")", "{", "statuses", ",", "err", ":=", "gc", ".", "ListStatuses", "(", "org", ",", "repo", ",", "sha", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n\n", "existingStatus", ":=", "\"", "\"", "\n", "for", "_", ",", "<mask>", ":=", "range", "statuses", "{", "if", "status", ".", "Context", "!=", "dcoContextName", "{", "continue", "\n", "}", "\n", "existingStatus", "=", "status", ".", "State", "\n", "break", "\n", "}", "\n", "l", ".", "Debugf", "(", "\"", "\"", ",", "existingStatus", ")", "\n", "return", "existingStatus", ",", "nil", "\n", "}" ]
16,402
all-16403
[ "SetRoutingDelegate", "sets", "the", "RoutingDelegate", "call", "options", "(", "rd", "transport", "header", ")", "." ]
[ "func", "(", "cb", "*", "ContextBuilder", ")", "SetRoutingDelegate", "(", "rd", "string", ")", "*", "ContextBuilder", "{", "if", "cb", ".", "CallOptions", "==", "nil", "{", "cb", ".", "CallOptions", "=", "<mask>", "(", "CallOptions", ")", "\n", "}", "\n", "cb", ".", "CallOptions", ".", "RoutingDelegate", "=", "rd", "\n", "return", "cb", "\n", "}" ]
16,403
all-16404
[ "Addrs", "returns", "discovered", "addresses", "for", "the", "mDNS", "package", "." ]
[ "func", "(", "p", "*", "Provider", ")", "Addrs", "(", "args", "map", "[", "string", "]", "string", ",", "l", "*", "log", ".", "Logger", ")", "(", "[", "]", "string", ",", "error", ")", "{", "var", "params", "*", "m", ".", "QueryParam", "\n", "var", "ch", "chan", "*", "m", ".", "ServiceEntry", "\n", "<mask>", "v6", ",", "v4", "bool", "\n", "var", "addrs", "[", "]", "string", "\n", "var", "err", "error", "\n\n", "// default to null logger", "if", "l", "==", "nil", "{", "l", "=", "log", ".", "New", "(", "ioutil", ".", "Discard", ",", "\"", "\"", ",", "0", ")", "\n", "}", "\n\n", "// init params", "params", "=", "new", "(", "m", ".", "QueryParam", ")", "\n\n", "// validate and set service record", "if", "args", "[", "\"", "\"", "]", "==", "\"", "\"", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", "+", "\"", "\"", ")", "\n", "}", "\n", "params", ".", "Service", "=", "args", "[", "\"", "\"", "]", "\n\n", "// validate and set domain", "if", "args", "[", "\"", "\"", "]", "!=", "\"", "\"", "{", "params", ".", "Domain", "=", "args", "[", "\"", "\"", "]", "\n", "}", "else", "{", "params", ".", "Domain", "=", "\"", "\"", "\n", "}", "\n\n", "// validate and set timeout", "if", "args", "[", "\"", "\"", "]", "!=", "\"", "\"", "{", "if", "params", ".", "Timeout", ",", "err", "=", "time", ".", "ParseDuration", "(", "args", "[", "\"", "\"", "]", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "else", "{", "params", ".", "Timeout", "=", "5", "*", "time", ".", "Second", "\n", "}", "\n\n", "// validate and set v6 toggle", "if", "args", "[", "\"", "\"", "]", "!=", "\"", "\"", "{", "if", "v6", ",", "err", "=", "strconv", ".", "ParseBool", "(", "args", "[", "\"", "\"", "]", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "else", "{", "v6", "=", "true", "\n", "}", "\n\n", "// validate and set v4 toggle", "if", "args", "[", "\"", "\"", "]", "!=", "\"", "\"", "{", "if", "v4", ",", "err", "=", "strconv", ".", "ParseBool", "(", "args", "[", "\"", "\"", "]", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "else", "{", "v4", "=", "true", "\n", "}", "\n\n", "// init entries channel", "ch", "=", "make", "(", "chan", "*", "m", ".", "ServiceEntry", ")", "\n", "defer", "close", "(", "ch", ")", "\n", "params", ".", "Entries", "=", "ch", "\n\n", "// build addresses", "go", "func", "(", ")", "{", "var", "addr", "string", "\n", "for", "e", ":=", "range", "ch", "{", "addr", "=", "\"", "\"", "// reset addr each loop", "\n", "if", "v6", "&&", "e", ".", "AddrV6", "!=", "nil", "{", "addr", "=", "net", ".", "JoinHostPort", "(", "e", ".", "AddrV6", ".", "String", "(", ")", ",", "strconv", ".", "Itoa", "(", "e", ".", "Port", ")", ")", "\n", "}", "\n", "if", "addr", "==", "\"", "\"", "&&", "v4", "&&", "e", ".", "AddrV4", "!=", "nil", "{", "addr", "=", "net", ".", "JoinHostPort", "(", "e", ".", "AddrV4", ".", "String", "(", ")", ",", "strconv", ".", "Itoa", "(", "e", ".", "Port", ")", ")", "\n", "}", "\n", "if", "addr", "!=", "\"", "\"", "{", "l", ".", "Printf", "(", "\"", "\"", ",", "e", ".", "Host", ",", "addr", ")", "\n", "// build address list", "addrs", "=", "append", "(", "addrs", ",", "addr", ")", "\n", "}", "\n", "}", "\n", "}", "(", ")", "\n\n", "// lookup and return", "return", "addrs", ",", "m", ".", "Query", "(", "params", ")", "\n", "}" ]
16,404
all-16405
[ "HasIncludeNoMetricHosts", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "g", "*", "GraphDefinition", ")", "HasIncludeNoMetricHosts", "(", ")", "bool", "{", "if", "g", "!=", "nil", "&&", "g", ".", "IncludeNoMetricHosts", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
16,405
all-16406
[ "MarshalBinary", "interface", "implementation" ]
[ "func", "(", "m", "*", "ErrorBody", ")", "MarshalBinary", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "if", "m", "==", "nil", "{", "return", "nil", ",", "nil", "\n", "}", "\n", "return", "swag", ".", "WriteJSON", "(", "m", ")", "\n", "}" ]
16,406
all-16407
[ "TODO", ":", "gtk_container_forall", "GetBorderWidth", "is", "a", "wrapper", "around", "gtk_container_get_border_width", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetBorderWidth", "(", ")", "uint", "{", "c", ":=", "C", ".", "gtk_container_get_border_width", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "uint", "(", "c", ")", "\n", "}" ]
16,407
all-16408
[ "transformSecret", "transforms", "an", "api", "secret", "into", "our", "secret", ".", "This", "does", "not", "deep", "copy", "underlying", "deep", "data", "structures", "so", "it", "s", "not", "safe", "to", "modify", "the", "vault", "secret", "as", "that", "may", "modify", "the", "data", "in", "the", "transformed", "secret", "." ]
[ "func", "transformSecret", "(", "theirs", "*", "api", ".", "Secret", ")", "*", "Secret", "{", "<mask>", "ours", "Secret", "\n", "updateSecret", "(", "&", "ours", ",", "theirs", ")", "\n", "return", "&", "ours", "\n", "}" ]
16,408
all-16409
[ "IDFromIncomingContext", "gets", "the", "key", "from", "the", "incoming", "context", "or", "returns", "ErrNoID" ]
[ "func", "IDFromIncomingContext", "(", "ctx", "context", ".", "Context", ")", "(", "string", ",", "error", ")", "{", "<mask>", ":=", "MetadataFromIncomingContext", "(", "ctx", ")", "\n", "return", "IDFromMetadata", "(", "md", ")", "\n", "}" ]
16,409
all-16410
[ "InVMTeam", "returns", "whether", "the", "virtual", "machine", "is", "a", "member", "of", "a", "team", "." ]
[ "func", "(", "v", "*", "VM", ")", "InVMTeam", "(", ")", "(", "bool", ",", "error", ")", "{", "var", "err", "C", ".", "VixError", "=", "C", ".", "VIX_OK", "\n", "inTeam", ":=", "C", ".", "VIX_PROPERTY_NONE", "\n\n", "err", "=", "C", ".", "get_property", "(", "v", ".", "handle", ",", "C", ".", "VIX_PROPERTY_VM_IN_VMTEAM", ",", "unsafe", ".", "Pointer", "(", "&", "inTeam", ")", ")", "\n\n", "if", "C", ".", "VIX_OK", "!=", "err", "{", "return", "false", ",", "&", "<mask>", "{", "Operation", ":", "\"", "\"", ",", "Code", ":", "int", "(", "err", "&", "0xFFFF", ")", ",", "Text", ":", "C", ".", "GoString", "(", "C", ".", "Vix_GetErrorText", "(", "err", ",", "nil", ")", ")", ",", "}", "\n", "}", "\n\n", "if", "inTeam", "==", "0", "{", "return", "false", ",", "nil", "\n", "}", "\n\n", "return", "true", ",", "nil", "\n", "}" ]
16,410
all-16411
[ "GorillaPath", "----------------------------------------------------------------" ]
[ "func", "NewGorillaPath", "(", "pattern", "string", ",", "strictSlash", "bool", ")", "(", "*", "GorillaPath", ",", "error", ")", "{", "regexpPattern", ",", "err", ":=", "gorillaPattern", "(", "pattern", ",", "<mask>", ",", "false", ",", "strictSlash", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "r", ",", "err", ":=", "CompileRegexp", "(", "regexpPattern", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "GorillaPath", "{", "*", "r", ",", "pattern", ",", "strictSlash", "}", ",", "nil", "\n", "}" ]
16,411
all-16412
[ "Do", "executes", "Animation", ".", "setTiming", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetTimingParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetTiming", ",", "p", ",", "nil", ")", "\n", "}" ]
16,412
all-16413
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "RequestNodeParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom13", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
16,413
all-16414
[ "convert", "to", "a", "StateCannotBeChanged", "if", "appropriate", "or", "else", "return", "the", "original", "error" ]
[ "func", "stateCannotBeChangedOrOriginalError", "(", "err", "error", ")", "error", "{", "requestErr", ",", "<mask>", ":=", "err", ".", "(", "requestError", ")", "\n", "if", "ok", "{", "for", "_", ",", "errorMsg", ":=", "range", "requestErr", ".", "ErrorMessages", "(", ")", "{", "if", "strings", ".", "Contains", "(", "errorMsg", ",", "stateCannotBeChangedMessagePrefix", ")", "{", "return", "StateCannotBeChanged", "{", "Message", ":", "errorMsg", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "err", "\n", "}" ]
16,414
all-16415
[ "BuildRequest", "builds", "a", "HTTP", "request", "from", "a", "resource", "name", "and", "href", "and", "an", "action", "name", "and", "parameters", ".", "It", "is", "intended", "for", "generic", "clients", "that", "need", "to", "consume", "APIs", "in", "a", "generic", "maner", ".", "The", "method", "builds", "an", "HTTP", "request", "that", "can", "be", "fed", "to", "PerformRequest", "." ]
[ "func", "(", "a", "*", "API", ")", "BuildRequest", "(", "resource", ",", "<mask>", ",", "href", "string", ",", "params", "rsapi", ".", "APIParams", ")", "(", "*", "http", ".", "Request", ",", "error", ")", "{", "// First lookup metadata", "res", ",", "ok", ":=", "GenMetadata", "[", "resource", "]", "\n", "if", "!", "ok", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "resource", ")", "\n", "}", "\n", "act", ":=", "res", ".", "GetAction", "(", "action", ")", "\n", "if", "act", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "action", ",", "resource", ")", "\n", "}", "\n\n", "// Now lookup action request HTTP method, url, params and payload.", "vars", ",", "err", ":=", "res", ".", "ExtractVariables", "(", "href", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "actionURL", ",", "err", ":=", "act", ".", "URL", "(", "vars", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "_", ",", "queryParams", ":=", "rsapi", ".", "IdentifyParams", "(", "act", ",", "params", ")", "\n", "return", "a", ".", "BuildHTTPRequest", "(", "\"", "\"", ",", "actionURL", ".", "Path", ",", "\"", "\"", ",", "queryParams", ",", "nil", ")", "\n", "}" ]
16,415
all-16416
[ "NewPgRemoteDumpWithPath", "-" ]
[ "func", "NewPgRemoteDumpWithPath", "(", "port", "int", ",", "<mask>", ",", "username", ",", "password", "string", ",", "sshCfg", "command", ".", "SshConfig", ",", "remoteArchivePath", "string", ")", "(", "*", "PgDump", ",", "error", ")", "{", "remoteExecuter", ",", "err", ":=", "command", ".", "NewRemoteExecutor", "(", "sshCfg", ")", "\n", "remoteOps", ":=", "osutils", ".", "NewRemoteOperations", "(", "sshCfg", ")", "\n", "if", "len", "(", "remoteArchivePath", ")", ">", "0", "{", "remoteOps", ".", "SetPath", "(", "remoteArchivePath", ")", "\n", "}", "\n", "pgDump", ":=", "NewPgDump", "(", "\"", "\"", ",", "port", ",", "database", ",", "username", ",", "password", ")", "\n", "pgDump", ".", "sshCfg", "=", "sshCfg", "\n", "pgDump", ".", "Caller", "=", "remoteExecuter", "\n", "pgDump", ".", "RemoteOps", "=", "remoteOps", "\n\n", "return", "pgDump", ",", "err", "\n", "}" ]
16,416
all-16417
[ "set", "the", "scale", "and", "units", "used", "to", "calculate", "depth", "values" ]
[ "func", "PolygonOffset", "(", "<mask>", "float32", ",", "units", "float32", ")", "{", "syscall", ".", "Syscall", "(", "gpPolygonOffset", ",", "2", ",", "uintptr", "(", "math", ".", "Float32bits", "(", "factor", ")", ")", ",", "uintptr", "(", "math", ".", "Float32bits", "(", "units", ")", ")", ",", "0", ")", "\n", "}" ]
16,417
all-16418
[ "return", "error", "information" ]
[ "func", "GetError", "(", ")", "uint32", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpGetError", ",", "0", ",", "0", ",", "0", ",", "0", ")", "\n", "return", "(", "uint32", ")", "(", "<mask>", ")", "\n", "}" ]
16,418
all-16419
[ "title", ":", "event", "block", "list", "path", ":", "/", "events", "/", "blocks", "method", ":", "GET", "produce", ":", "application", "/", "json", "responses", ":", "200", ":", "OK", "204", ":", "No", "content", "401", ":", "Unauthorized" ]
[ "func", "eventBlockList", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "error", "{", "if", "!", "permission", ".", "Check", "(", "t", ",", "permission", ".", "PermEventBlockRead", ")", "{", "return", "permission", ".", "ErrUnauthorized", "\n", "}", "\n", "var", "active", "*", "bool", "\n", "if", "activeStr", ":=", "InputValue", "(", "r", ",", "\"", "\"", ")", ";", "activeStr", "!=", "\"", "\"", "{", "b", ",", "_", ":=", "strconv", ".", "ParseBool", "(", "activeStr", ")", "\n", "active", "=", "&", "b", "\n", "}", "\n", "<mask>", ",", "err", ":=", "event", ".", "ListBlocks", "(", "active", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "len", "(", "blocks", ")", "==", "0", "{", "w", ".", "WriteHeader", "(", "http", ".", "StatusNoContent", ")", "\n", "return", "nil", "\n", "}", "\n", "w", ".", "Header", "(", ")", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "json", ".", "NewEncoder", "(", "w", ")", ".", "Encode", "(", "blocks", ")", "\n", "}" ]
16,419
all-16420
[ "UnmarshalText", "implements", "encoding", "/", "text", ".", "Unmarshaler", ".", "This", "allows", "FailStrategy", "to", "be", "specified", "as", "a", "string", "in", "many", "file", "formats", "(", "e", ".", "g", ".", "JSON", "YAML", "TOML", ")", "." ]
[ "func", "(", "f", "*", "FailStrategy", ")", "UnmarshalText", "(", "text", "[", "]", "byte", ")", "error", "{", "<mask>", "strategy", ":=", "string", "(", "text", ")", ";", "strategy", "{", "case", "\"", "\"", ",", "\"", "\"", ":", "*", "f", "=", "FailStrategyFatal", "\n", "case", "\"", "\"", ":", "*", "f", "=", "FailStrategyIgnore", "\n", "default", ":", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "strategy", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
16,420
all-16421
[ "Validate", "that", "options", "are", "usuable" ]
[ "func", "(", "opts", "*", "Options", ")", "Validate", "(", ")", "error", "{", "if", "opts", ".", "<mask>", "==", "nil", "{", "opts", ".", "Options", "=", "&", "core", ".", "Options", "{", "}", "\n", "}", "\n", "return", "opts", ".", "Options", ".", "Validate", "(", ")", "\n", "}" ]
16,421
all-16422
[ "Handle", "adds", "the", "route", "pattern", "that", "matches", "any", "http", "method", "to", "execute", "the", "handler", "http", ".", "Handler", "." ]
[ "func", "(", "mx", "*", "Mux", ")", "Handle", "(", "pattern", "string", ",", "handler", "http", ".", "Handler", ")", "{", "mx", ".", "handle", "(", "mALL", ",", "pattern", ",", "<mask>", ")", "\n", "}" ]
16,422
all-16423
[ "Returns", "true", "if", "the", "Watcher", "is", "actively", "looking", "for", "changes", "." ]
[ "func", "(", "w", "*", "Watcher", ")", "Active", "(", ")", "bool", "{", "<mask>", "w", ".", "paths", "!=", "nil", "&&", "len", "(", "w", ".", "paths", ")", ">", "0", "\n", "}" ]
16,423
all-16424
[ "/", "*", "Sets", "every", "element", "of", "an", "array", "to", "a", "given", "value", "." ]
[ "func", "(", "img", "*", "IplImage", ")", "Set", "(", "<mask>", "Scalar", ")", "{", "C", ".", "cvSet", "(", "unsafe", ".", "Pointer", "(", "img", ")", ",", "(", "C", ".", "CvScalar", ")", "(", "value", ")", ",", "nil", ")", "\n", "}" ]
16,424
all-16425
[ "TailingLogsWithoutReconnect", "functions", "identically", "to", "TailingLogs", "but", "without", "any", "reconnect", "attempts", "when", "errors", "occur", "." ]
[ "func", "(", "c", "*", "<mask>", ")", "TailingLogsWithoutReconnect", "(", "appGuid", "string", ",", "authToken", "string", ")", "(", "<-", "chan", "*", "events", ".", "LogMessage", ",", "<-", "chan", "error", ")", "{", "return", "c", ".", "tailingLogs", "(", "appGuid", ",", "authToken", ",", "false", ")", "\n", "}" ]
16,425
all-16426
[ "GetRepoLabels", "gets", "labels", "in", "a", "repo", "." ]
[ "func", "(", "f", "*", "FakeClient", ")", "GetRepoLabels", "(", "owner", ",", "repo", "string", ")", "(", "[", "]", "github", ".", "Label", ",", "error", ")", "{", "la", ":=", "[", "]", "github", ".", "Label", "{", "}", "\n", "for", "_", ",", "l", ":=", "range", "f", ".", "RepoLabelsExisting", "{", "la", "=", "append", "(", "la", ",", "github", ".", "Label", "{", "<mask>", ":", "l", "}", ")", "\n", "}", "\n", "return", "la", ",", "nil", "\n", "}" ]
16,426
all-16427
[ "Execute", "-", "applies", "all", "the", "config", "in", "order" ]
[ "func", "(", "c", "*", "ApplyCommand", ")", "Execute", "(", "[", "]", "string", ")", "error", "{", "var", "cfMgmt", "*", "CFMgmt", "\n", "<mask>", "err", "error", "\n", "if", "cfMgmt", ",", "err", "=", "InitializePeekManagers", "(", "c", ".", "BaseCFConfigCommand", ",", "c", ".", "Peek", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "err", "=", "cfMgmt", ".", "UserManager", ".", "InitializeLdap", "(", "c", ".", "LdapUser", ",", "c", ".", "LdapPassword", ",", "c", ".", "LdapServer", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "defer", "cfMgmt", ".", "UserManager", ".", "DeinitializeLdap", "(", ")", "\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "OrgManager", ".", "CreateOrgs", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "OrgManager", ".", "UpdateOrgsMetadata", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "OrgManager", ".", "DeleteOrgs", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "UserManager", ".", "UpdateOrgUsers", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "SecurityGroupManager", ".", "CreateGlobalSecurityGroups", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "SecurityGroupManager", ".", "AssignDefaultSecurityGroups", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "PrivateDomainManager", ".", "CreatePrivateDomains", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "PrivateDomainManager", ".", "SharePrivateDomains", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "QuotaManager", ".", "CreateOrgQuotas", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "SpaceManager", ".", "CreateSpaces", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "SpaceManager", ".", "DeleteSpaces", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "SpaceManager", ".", "UpdateSpaces", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "SpaceManager", ".", "UpdateSpacesMetadata", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "UserManager", ".", "UpdateSpaceUsers", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "QuotaManager", ".", "CreateSpaceQuotas", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "SecurityGroupManager", ".", "CreateApplicationSecurityGroups", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "IsolationSegmentManager", ".", "Apply", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "ServiceAccessManager", ".", "Apply", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "UserManager", ".", "CleanupOrgUsers", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "if", "err", "=", "cfMgmt", ".", "SharedDomainManager", ".", "Apply", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
16,427
all-16428
[ "Auth", "performs", "an", "authentication", "request", "for", "a", "Swauth", "-", "based", "user", "." ]
[ "func", "Auth", "(", "c", "*", "gophercloud", ".", "ProviderClient", ",", "opts", "AuthOptsBuilder", ")", "(", "r", "GetAuthResult", ")", "{", "h", ":=", "make", "(", "map", "[", "string", "]", "string", ")", "\n\n", "if", "opts", "!=", "nil", "{", "headers", ",", "err", ":=", "opts", ".", "ToAuthOptsMap", "(", ")", "\n", "if", "err", "!=", "nil", "{", "r", ".", "Err", "=", "err", "\n", "return", "\n", "}", "\n\n", "for", "k", ",", "v", ":=", "range", "<mask>", "{", "h", "[", "k", "]", "=", "v", "\n", "}", "\n", "}", "\n\n", "resp", ",", "err", ":=", "c", ".", "Request", "(", "\"", "\"", ",", "getURL", "(", "c", ")", ",", "&", "gophercloud", ".", "RequestOpts", "{", "MoreHeaders", ":", "h", ",", "OkCodes", ":", "[", "]", "int", "{", "200", "}", ",", "}", ")", "\n\n", "if", "resp", "!=", "nil", "{", "r", ".", "Header", "=", "resp", ".", "Header", "\n", "}", "\n\n", "r", ".", "Err", "=", "err", "\n\n", "return", "r", "\n", "}" ]
16,428
all-16429
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetLifecycleEventsEnabledParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage8", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
16,429
all-16430
[ "LoadGroups", "reads", "groups", "from", "a", "list", "of", "files", "." ]
[ "func", "(", "m", "*", "Manager", ")", "LoadGroups", "(", "interval", "time", ".", "Duration", ",", "externalLabels", "labels", ".", "Labels", ",", "filenames", "...", "string", ",", ")", "(", "map", "[", "string", "]", "*", "Group", ",", "[", "]", "error", ")", "{", "groups", ":=", "make", "(", "map", "[", "string", "]", "*", "Group", ")", "\n\n", "shouldRestore", ":=", "!", "m", ".", "restored", "\n\n", "for", "_", ",", "fn", ":=", "range", "filenames", "{", "rgs", ",", "errs", ":=", "rulefmt", ".", "ParseFile", "(", "fn", ")", "\n", "if", "errs", "!=", "nil", "{", "return", "nil", ",", "errs", "\n", "}", "\n\n", "for", "_", ",", "rg", ":=", "range", "rgs", ".", "Groups", "{", "itv", ":=", "interval", "\n", "if", "rg", ".", "Interval", "!=", "0", "{", "itv", "=", "time", ".", "Duration", "(", "rg", ".", "Interval", ")", "\n", "}", "\n\n", "<mask>", ":=", "make", "(", "[", "]", "Rule", ",", "0", ",", "len", "(", "rg", ".", "Rules", ")", ")", "\n", "for", "_", ",", "r", ":=", "range", "rg", ".", "Rules", "{", "expr", ",", "err", ":=", "promql", ".", "ParseExpr", "(", "r", ".", "Expr", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "[", "]", "error", "{", "err", "}", "\n", "}", "\n\n", "if", "r", ".", "Alert", "!=", "\"", "\"", "{", "rules", "=", "append", "(", "rules", ",", "NewAlertingRule", "(", "r", ".", "Alert", ",", "expr", ",", "time", ".", "Duration", "(", "r", ".", "For", ")", ",", "labels", ".", "FromMap", "(", "r", ".", "Labels", ")", ",", "labels", ".", "FromMap", "(", "r", ".", "Annotations", ")", ",", "externalLabels", ",", "m", ".", "restored", ",", "log", ".", "With", "(", "m", ".", "logger", ",", "\"", "\"", ",", "r", ".", "Alert", ")", ",", ")", ")", "\n", "continue", "\n", "}", "\n", "rules", "=", "append", "(", "rules", ",", "NewRecordingRule", "(", "r", ".", "Record", ",", "expr", ",", "labels", ".", "FromMap", "(", "r", ".", "Labels", ")", ",", ")", ")", "\n", "}", "\n\n", "groups", "[", "groupKey", "(", "rg", ".", "Name", ",", "fn", ")", "]", "=", "NewGroup", "(", "rg", ".", "Name", ",", "fn", ",", "itv", ",", "rules", ",", "shouldRestore", ",", "m", ".", "opts", ")", "\n", "}", "\n", "}", "\n\n", "return", "groups", ",", "nil", "\n", "}" ]
16,430
all-16431
[ "Grab", "()", "is", "a", "wrapper", "around", "gdk_device_grab", "()", "." ]
[ "func", "(", "v", "*", "Device", ")", "Grab", "(", "w", "*", "Window", ",", "ownership", "GrabOwnership", ",", "owner_events", "bool", ",", "event_mask", "EventMask", ",", "cursor", "*", "Cursor", ",", "time", "uint32", ")", "GrabStatus", "{", "ret", ":=", "C", ".", "gdk_device_grab", "(", "v", ".", "native", "(", ")", ",", "w", ".", "native", "(", ")", ",", "C", ".", "GdkGrabOwnership", "(", "ownership", ")", ",", "gbool", "(", "owner_events", ")", ",", "C", ".", "GdkEventMask", "(", "event_mask", ")", ",", "cursor", ".", "native", "(", ")", ",", "C", ".", "guint32", "(", "<mask>", ")", ",", ")", "\n", "return", "GrabStatus", "(", "ret", ")", "\n", "}" ]
16,431
all-16432
[ "specify", "storage", "for", "a", "two", "-", "dimensional", "multisample", "texture" ]
[ "func", "TexStorage2DMultisample", "(", "target", "uint32", ",", "samples", "int32", ",", "internalformat", "uint32", ",", "width", "int32", ",", "<mask>", "int32", ",", "fixedsamplelocations", "bool", ")", "{", "syscall", ".", "Syscall6", "(", "gpTexStorage2DMultisample", ",", "6", ",", "uintptr", "(", "target", ")", ",", "uintptr", "(", "samples", ")", ",", "uintptr", "(", "internalformat", ")", ",", "uintptr", "(", "width", ")", ",", "uintptr", "(", "height", ")", ",", "boolToUintptr", "(", "fixedsamplelocations", ")", ")", "\n", "}" ]
16,432
all-16433
[ "ClientOptions", "for", "logging", "RPCs" ]
[ "func", "ClientOptions", "(", "log", "ttnlog", ".", "Interface", ")", "[", "]", "grpc", ".", "DialOption", "{", "return", "[", "]", "grpc", ".", "DialOption", "{", "grpc", ".", "WithUnaryInterceptor", "(", "UnaryClientInterceptor", "(", "<mask>", ")", ")", ",", "grpc", ".", "WithStreamInterceptor", "(", "StreamClientInterceptor", "(", "log", ")", ")", ",", "}", "\n", "}" ]
16,433
all-16434
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "CreateTargetReturns", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget22", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
16,434
all-16435
[ "WithRoute", "adds", "the", "route", "to", "the", "get", "apps", "app", "routes", "route", "params" ]
[ "func", "(", "o", "*", "GetAppsAppRoutesRouteParams", ")", "WithRoute", "(", "<mask>", "string", ")", "*", "GetAppsAppRoutesRouteParams", "{", "o", ".", "SetRoute", "(", "route", ")", "\n", "return", "o", "\n", "}" ]
16,435
all-16436
[ "HasType", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "i", "*", "IframeDefinition", ")", "HasType", "(", ")", "bool", "{", "if", "i", "!=", "nil", "&&", "i", ".", "<mask>", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
16,436
all-16437
[ "All", "retrieves", "all", "documents", "from", "the", "result", "set", "into", "the", "provided", "slice", "and", "closes", "the", "iterator", ".", "The", "result", "argument", "must", "necessarily", "be", "the", "address", "for", "a", "slice", ".", "The", "slice", "may", "be", "nil", "or", "previously", "allocated", ".", "WARNING", ":", "Obviously", "All", "must", "not", "be", "used", "with", "result", "sets", "that", "may", "be", "potentially", "large", "since", "it", "may", "consume", "all", "memory", "until", "the", "system", "crashes", ".", "Consider", "building", "the", "query", "with", "a", "Limit", "clause", "to", "ensure", "the", "result", "size", "is", "bounded", ".", "For", "instance", ":", "var", "result", "[]", "struct", "{", "Value", "int", "}", "iter", ":", "=", "collection", ".", "Find", "(", "nil", ")", ".", "Limit", "(", "100", ")", ".", "Iter", "()", "err", ":", "=", "iter", ".", "All", "(", "&result", ")", "if", "err", "!", "=", "nil", "{", "return", "err", "}" ]
[ "func", "(", "iter", "*", "Iter", ")", "All", "(", "result", "interface", "{", "}", ")", "error", "{", "resultv", ":=", "reflect", ".", "ValueOf", "(", "result", ")", "\n", "if", "resultv", ".", "Kind", "(", ")", "!=", "reflect", ".", "Ptr", "||", "resultv", ".", "Elem", "(", ")", ".", "Kind", "(", ")", "!=", "reflect", ".", "Slice", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "slicev", ":=", "resultv", ".", "Elem", "(", ")", "\n", "slicev", "=", "slicev", ".", "Slice", "(", "0", ",", "slicev", ".", "Cap", "(", ")", ")", "\n", "elemt", ":=", "slicev", ".", "Type", "(", ")", ".", "Elem", "(", ")", "\n", "i", ":=", "0", "\n", "for", "{", "if", "slicev", ".", "Len", "(", ")", "==", "i", "{", "elemp", ":=", "reflect", ".", "New", "(", "elemt", ")", "\n", "if", "!", "iter", ".", "Next", "(", "elemp", ".", "Interface", "(", ")", ")", "{", "break", "\n", "}", "\n", "slicev", "=", "reflect", ".", "Append", "(", "slicev", ",", "elemp", ".", "Elem", "(", ")", ")", "\n", "slicev", "=", "slicev", ".", "Slice", "(", "0", ",", "slicev", ".", "Cap", "(", ")", ")", "\n", "}", "else", "{", "if", "!", "iter", ".", "Next", "(", "slicev", ".", "Index", "(", "i", ")", ".", "Addr", "(", ")", ".", "Interface", "(", ")", ")", "{", "<mask>", "\n", "}", "\n", "}", "\n", "i", "++", "\n", "}", "\n", "resultv", ".", "Elem", "(", ")", ".", "Set", "(", "slicev", ".", "Slice", "(", "0", ",", "i", ")", ")", "\n", "return", "iter", ".", "Close", "(", ")", "\n", "}" ]
16,437
all-16438
[ "terminateDupes", "aborts", "presubmits", "that", "have", "a", "newer", "version", ".", "It", "modifies", "pjs", "in", "-", "place", "when", "it", "aborts", "." ]
[ "func", "(", "c", "*", "Controller", ")", "terminateDupes", "(", "pjs", "[", "]", "prowapi", ".", "ProwJob", ",", "jbs", "<mask>", "[", "string", "]", "Build", ")", "error", "{", "// \"job org/repo#number\" -> newest job", "dupes", ":=", "make", "(", "map", "[", "string", "]", "int", ")", "\n", "for", "i", ",", "pj", ":=", "range", "pjs", "{", "if", "pj", ".", "Complete", "(", ")", "||", "pj", ".", "Spec", ".", "Type", "!=", "prowapi", ".", "PresubmitJob", "{", "continue", "\n", "}", "\n", "n", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "pj", ".", "Spec", ".", "Job", ",", "pj", ".", "Spec", ".", "Refs", ".", "Org", ",", "pj", ".", "Spec", ".", "Refs", ".", "Repo", ",", "pj", ".", "Spec", ".", "Refs", ".", "Pulls", "[", "0", "]", ".", "Number", ")", "\n", "prev", ",", "ok", ":=", "dupes", "[", "n", "]", "\n", "if", "!", "ok", "{", "dupes", "[", "n", "]", "=", "i", "\n", "continue", "\n", "}", "\n", "cancelIndex", ":=", "i", "\n", "if", "(", "&", "pjs", "[", "prev", "]", ".", "Status", ".", "StartTime", ")", ".", "Before", "(", "&", "pj", ".", "Status", ".", "StartTime", ")", "{", "cancelIndex", "=", "prev", "\n", "dupes", "[", "n", "]", "=", "i", "\n", "}", "\n", "toCancel", ":=", "pjs", "[", "cancelIndex", "]", "\n", "// Allow aborting presubmit jobs for commits that have been superseded by", "// newer commits in GitHub pull requests.", "if", "c", ".", "config", "(", ")", ".", "AllowCancellations", "{", "build", ",", "buildExists", ":=", "jbs", "[", "toCancel", ".", "ObjectMeta", ".", "Name", "]", "\n", "// Avoid cancelling enqueued builds.", "if", "buildExists", "&&", "build", ".", "IsEnqueued", "(", ")", "{", "continue", "\n", "}", "\n", "// Otherwise, abort it.", "if", "buildExists", "{", "if", "err", ":=", "c", ".", "jc", ".", "Abort", "(", "getJobName", "(", "&", "toCancel", ".", "Spec", ")", ",", "&", "build", ")", ";", "err", "!=", "nil", "{", "c", ".", "log", ".", "WithError", "(", "err", ")", ".", "WithFields", "(", "pjutil", ".", "ProwJobFields", "(", "&", "toCancel", ")", ")", ".", "Warn", "(", "\"", "\"", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "toCancel", ".", "SetComplete", "(", ")", "\n", "prevState", ":=", "toCancel", ".", "Status", ".", "State", "\n", "toCancel", ".", "Status", ".", "State", "=", "prowapi", ".", "AbortedState", "\n", "c", ".", "log", ".", "WithFields", "(", "pjutil", ".", "ProwJobFields", "(", "&", "toCancel", ")", ")", ".", "WithField", "(", "\"", "\"", ",", "prevState", ")", ".", "WithField", "(", "\"", "\"", ",", "toCancel", ".", "Status", ".", "State", ")", ".", "Info", "(", "\"", "\"", ")", "\n", "npj", ",", "err", ":=", "c", ".", "prowJobClient", ".", "Update", "(", "&", "toCancel", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "pjs", "[", "cancelIndex", "]", "=", "*", "npj", "\n", "}", "\n", "return", "nil", "\n", "}" ]
16,438
all-16439
[ "Get", "returns", "a", "value", "previously", "set", "by", "Add", "or", "Set" ]
[ "func", "(", "s", "*", "Scratch", ")", "Get", "(", "k", "string", ")", "interface", "{", "}", "{", "s", ".", "RLock", "(", ")", "\n", "defer", "s", ".", "RUnlock", "(", ")", "\n", "return", "s", ".", "<mask>", "[", "k", "]", "\n", "}" ]
16,439
all-16440
[ "Dir", "returns", "the", "home", "directory", "for", "the", "executing", "user", ".", "An", "error", "is", "returned", "if", "a", "home", "directory", "cannot", "be", "detected", "." ]
[ "func", "Dir", "(", ")", "(", "string", ",", "error", ")", "{", "currentUser", ",", "err", ":=", "<mask>", ".", "Current", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n", "if", "currentUser", ".", "HomeDir", "==", "\"", "\"", "{", "return", "\"", "\"", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "currentUser", ".", "HomeDir", ",", "nil", "\n", "}" ]
16,440
all-16441
[ "hash", "function" ]
[ "func", "fnv32", "(", "key", "string", ")", "uint32", "{", "<mask>", ":=", "uint32", "(", "2166136261", ")", "\n", "const", "prime32", "=", "uint32", "(", "16777619", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "key", ")", ";", "i", "++", "{", "hash", "*=", "prime32", "\n", "hash", "^=", "uint32", "(", "key", "[", "i", "]", ")", "\n", "}", "\n", "return", "hash", "\n", "}" ]
16,441
all-16442
[ "GetRequests", "returns", "the", "Requests", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "h", "*", "HostmapDefinition", ")", "GetRequests", "(", ")", "HostmapRequests", "{", "if", "h", "==", "nil", "||", "h", ".", "Requests", "==", "nil", "{", "return", "HostmapRequests", "{", "}", "\n", "}", "\n", "<mask>", "*", "h", ".", "Requests", "\n", "}" ]
16,442
all-16443
[ "StackSidebarNew", "is", "a", "wrapper", "around", "gtk_stack_sidebar_new", "()", "." ]
[ "func", "StackSidebarNew", "(", ")", "(", "*", "StackSidebar", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_stack_sidebar_new", "(", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "<mask>", "wrapStackSidebar", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", ",", "nil", "\n", "}" ]
16,443
all-16444
[ "SASLAuthenticate", "performs", "SASL", "authentication", "ref", ":", "https", ":", "//", "github", ".", "com", "/", "atheme", "/", "charybdis", "/", "blob", "/", "master", "/", "doc", "/", "sasl", ".", "txt" ]
[ "func", "(", "bot", "*", "Bot", ")", "SASLAuthenticate", "(", "user", ",", "pass", "string", ")", "{", "bot", ".", "Debug", "(", "\"", "\"", ")", "\n", "bot", ".", "Send", "(", "\"", "\"", ")", "\n", "bot", ".", "SetNick", "(", "bot", ".", "Nick", ")", "\n", "bot", ".", "sendUserCommand", "(", "bot", ".", "Nick", ",", "bot", ".", "Nick", ",", "\"", "\"", ")", "\n\n", "bot", ".", "WaitFor", "(", "func", "(", "mes", "*", "Message", ")", "bool", "{", "return", "strings", ".", "TrimSpace", "(", "mes", ".", "Content", ")", "==", "\"", "\"", "&&", "len", "(", "mes", ".", "Params", ")", ">", "1", "&&", "mes", ".", "Params", "[", "1", "]", "==", "\"", "\"", "\n", "}", ")", "\n", "bot", ".", "Debug", "(", "\"", "\"", ")", "\n", "bot", ".", "Send", "(", "\"", "\"", ")", "\n\n", "bot", ".", "WaitFor", "(", "func", "(", "mes", "*", "Message", ")", "bool", "{", "return", "mes", ".", "Command", "==", "\"", "\"", "&&", "len", "(", "mes", ".", "Params", ")", "==", "1", "&&", "mes", ".", "Params", "[", "0", "]", "==", "\"", "\"", "\n", "}", ")", "\n\n", "bot", ".", "Debug", "(", "\"", "\"", ")", "\n\n", "out", ":=", "<mask>", ".", "Join", "(", "[", "]", "[", "]", "byte", "{", "[", "]", "byte", "(", "user", ")", ",", "[", "]", "byte", "(", "user", ")", ",", "[", "]", "byte", "(", "pass", ")", "}", ",", "[", "]", "byte", "{", "0", "}", ")", "\n", "encpass", ":=", "base64", ".", "StdEncoding", ".", "EncodeToString", "(", "out", ")", "\n", "bot", ".", "Send", "(", "\"", "\"", "+", "encpass", ")", "\n", "bot", ".", "Send", "(", "\"", "\"", ")", "\n", "bot", ".", "Send", "(", "\"", "\"", ")", "\n", "}" ]
16,444
all-16445
[ "GetCreatedAt", "sets", "the", "timestamp", "for", "resource", "s", "creation", "time" ]
[ "func", "(", "auth", "*", "ASMAuthResource", ")", "GetCreatedAt", "(", ")", "<mask>", ".", "Time", "{", "auth", ".", "lock", ".", "RLock", "(", ")", "\n", "defer", "auth", ".", "lock", ".", "RUnlock", "(", ")", "\n\n", "return", "auth", ".", "createdAt", "\n", "}" ]
16,445
all-16446
[ "PeekCookie", "is", "able", "to", "returns", "cookie", "by", "a", "given", "key", "from", "response", "." ]
[ "func", "(", "h", "*", "ResponseHeader", ")", "PeekCookie", "(", "<mask>", "string", ")", "[", "]", "byte", "{", "return", "peekArgStr", "(", "h", ".", "cookies", ",", "key", ")", "\n", "}" ]
16,446
all-16447
[ "SetProviderConfig", "is", "a", "convenience", "method", "that", "will", "attempt", "to", "set", "a", "provider", "config", "on", "a", "particular", "cluster", ".", "Just", "like", "it", "s", "counterpart", "ProviderConfig", "this", "makes", "working", "with", "the", "legacy", "API", "much", "easier", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "SetProviderConfig", "(", "config", "*", "ControlPlaneProviderConfig", ")", "error", "{", "bytes", ",", "err", ":=", "json", ".", "Marshal", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "logger", ".", "Critical", "(", "\"", "\"", ",", "err", ")", "\n", "return", "err", "\n", "}", "\n", "str", ":=", "string", "(", "<mask>", ")", "\n", "c", ".", "ClusterAPI", ".", "Spec", ".", "ProviderConfig", "=", "str", "\n", "return", "nil", "\n", "}" ]
16,447
all-16448
[ "WriteFileBytes", "-" ]
[ "func", "WriteFileBytes", "(", "configFile", "string", ",", "<mask>", "[", "]", "byte", ")", "error", "{", "return", "ioutil", ".", "WriteFile", "(", "configFile", ",", "data", ",", "0755", ")", "\n", "}" ]
16,448
all-16449
[ "createBridgeNetworkConfigWithoutIPAM", "creates", "the", "config", "of", "the", "bridge", "for", "removal" ]
[ "func", "(", "client", "*", "cniClient", ")", "createBridgeNetworkConfigWithoutIPAM", "(", "cfg", "*", "Config", ")", "(", "string", ",", "*", "libcni", ".", "NetworkConfig", ",", "error", ")", "{", "networkConfig", ",", "err", ":=", "client", ".", "constructNetworkConfig", "(", "<mask>", ".", "createBridgeConfig", "(", "cfg", ")", ",", "ECSBridgePluginName", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "nil", ",", "errors", ".", "Wrap", "(", "err", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "defaultVethName", ",", "networkConfig", ",", "nil", "\n", "}" ]
16,449
all-16450
[ "lookupFromAnyServer", "uses", "all", "configured", "servers", "to", "try", "and", "resolve", "a", "specific", "name", ".", "If", "a", "viable", "answer", "is", "received", "from", "a", "server", "then", "it", "is", "immediately", "returned", "otherwise", "the", "other", "servers", "in", "the", "config", "are", "tried", "and", "if", "none", "of", "them", "return", "a", "viable", "answer", "an", "error", "is", "returned", ".", "A", "viable", "answer", "is", "one", "which", "indicates", "either", ":", "1", ".", "yes", "I", "know", "that", "name", "and", "here", "are", "its", "records", "of", "the", "requested", "type", "(", "RCODE", "==", "SUCCESS", "ANCOUNT", ">", "0", ")", ";", "2", ".", "yes", "I", "know", "that", "name", "but", "it", "has", "no", "records", "of", "the", "requested", "type", "(", "RCODE", "==", "SUCCESS", "ANCOUNT", "==", "0", ")", ";", "or", "3", ".", "I", "know", "that", "name", "doesn", "t", "exist", "(", "RCODE", "==", "NXDOMAIN", ")", ".", "A", "non", "-", "viable", "answer", "is", "anything", "else", "which", "encompasses", "both", "various", "system", "-", "level", "problems", "(", "like", "network", "timeouts", ")", "and", "also", "valid", "-", "but", "-", "unexpected", "DNS", "responses", "(", "SERVFAIL", "REFUSED", "etc", ")", "." ]
[ "func", "lookupFromAnyServer", "(", "name", "string", ",", "qtype", "uint16", ",", "conf", "*", "dns", ".", "ClientConfig", ",", "logger", "log", ".", "Logger", ")", "(", "*", "dns", ".", "Msg", ",", "error", ")", "{", "client", ":=", "&", "dns", ".", "Client", "{", "}", "\n\n", "for", "_", ",", "server", ":=", "range", "conf", ".", "Servers", "{", "servAddr", ":=", "net", ".", "JoinHostPort", "(", "server", ",", "conf", ".", "Port", ")", "\n", "msg", ",", "err", ":=", "askServerForName", "(", "name", ",", "qtype", ",", "client", ",", "servAddr", ",", "true", ")", "\n", "if", "err", "!=", "nil", "{", "level", ".", "Warn", "(", "logger", ")", ".", "Log", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "server", ",", "\"", "\"", ",", "name", ",", "\"", "\"", ",", "err", ")", "\n", "continue", "\n", "}", "\n\n", "if", "msg", ".", "Rcode", "==", "dns", ".", "RcodeSuccess", "||", "msg", ".", "Rcode", "==", "dns", ".", "RcodeNameError", "{", "// We have our answer. Time to go home.", "return", "msg", ",", "nil", "\n", "}", "\n", "}", "\n\n", "return", "nil", ",", "errors", ".", "Errorf", "(", "\"", "\"", ",", "<mask>", ")", "\n", "}" ]
16,450
all-16451
[ "blobPath", "returns", "a", "path", "for", "a", "blob", "within", "a", "directory", "using", "OCI", "image", "-", "layout", "conventions", "." ]
[ "func", "(", "ref", "ociReference", ")", "blobPath", "(", "digest", "digest", ".", "Digest", ",", "sharedBlobDir", "string", ")", "(", "string", ",", "error", ")", "{", "if", "err", ":=", "digest", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "<mask>", ".", "Wrapf", "(", "err", ",", "\"", "\"", ",", "digest", ")", "\n", "}", "\n", "blobDir", ":=", "filepath", ".", "Join", "(", "ref", ".", "dir", ",", "\"", "\"", ")", "\n", "if", "sharedBlobDir", "!=", "\"", "\"", "{", "blobDir", "=", "sharedBlobDir", "\n", "}", "\n", "return", "filepath", ".", "Join", "(", "blobDir", ",", "digest", ".", "Algorithm", "(", ")", ".", "String", "(", ")", ",", "digest", ".", "Hex", "(", ")", ")", ",", "nil", "\n", "}" ]
16,451
all-16452
[ "WritePact", "writes", "the", "pact", "file", "to", "disk", "." ]
[ "func", "(", "m", "*", "MockService", ")", "WritePact", "(", ")", "error", "{", "log", ".", "Println", "(", "\"", "\"", ")", "\n\n", "if", "m", ".", "Consumer", "==", "\"", "\"", "||", "m", ".", "Provider", "==", "\"", "\"", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "m", ".", "PactFileWriteMode", "==", "\"", "\"", "{", "m", ".", "PactFileWriteMode", "=", "\"", "\"", "\n", "}", "\n\n", "pact", ":=", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", "<mask>", "[", "string", "]", "string", "{", "\"", "\"", ":", "m", ".", "Consumer", ",", "}", ",", "\"", "\"", ":", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "m", ".", "Provider", ",", "}", ",", "\"", "\"", ":", "m", ".", "PactFileWriteMode", ",", "}", "\n\n", "url", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "m", ".", "BaseURL", ")", "\n", "return", "m", ".", "call", "(", "\"", "\"", ",", "url", ",", "pact", ")", "\n", "}" ]
16,452
all-16453
[ "GetHideZeroCountsOk", "returns", "a", "tuple", "with", "the", "HideZeroCounts", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "m", "*", "ManageStatusDefinition", ")", "GetHideZeroCountsOk", "(", ")", "(", "bool", ",", "bool", ")", "{", "if", "m", "==", "nil", "||", "m", ".", "HideZeroCounts", "==", "nil", "{", "return", "false", ",", "false", "\n", "}", "\n", "return", "*", "m", ".", "HideZeroCounts", ",", "<mask>", "\n", "}" ]
16,453
all-16454
[ "RetryNWithBackoff", "takes", "a", "Backoff", "a", "maximum", "number", "of", "tries", "n", "and", "a", "function", "that", "returns", "an", "error", ".", "The", "function", "is", "called", "until", "either", "it", "does", "not", "return", "an", "error", "or", "the", "maximum", "tries", "have", "been", "reached", ".", "If", "the", "error", "returned", "is", "Retriable", "the", "Retriability", "of", "it", "will", "be", "respected", ".", "If", "the", "number", "of", "tries", "is", "exhausted", "the", "last", "error", "will", "be", "returned", "." ]
[ "func", "RetryNWithBackoff", "(", "backoff", "Backoff", ",", "n", "int", ",", "fn", "func", "(", ")", "error", ")", "error", "{", "return", "RetryNWithBackoffCtx", "(", "<mask>", ".", "Background", "(", ")", ",", "backoff", ",", "n", ",", "fn", ")", "\n", "}" ]
16,454
all-16455
[ "determine", "if", "a", "name", "corresponds", "to", "a", "vertex", "array", "object" ]
[ "func", "IsVertexArray", "(", "<mask>", "uint32", ")", "bool", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpIsVertexArray", ",", "1", ",", "uintptr", "(", "array", ")", ",", "0", ",", "0", ")", "\n", "return", "ret", "!=", "0", "\n", "}" ]
16,455
all-16456
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetHighlightObjectForTestParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoOverlay16", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
16,456
all-16457
[ "RetrieveTaskStatus", "-" ]
[ "func", "(", "director", "*", "BoshDirector", ")", "RetrieveTaskStatus", "(", "taskID", "int", ")", "(", "task", "*", "Task", ",", "err", "error", ")", "{", "endpoint", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "director", ".", "ip", ",", "director", ".", "port", ",", "taskID", ")", "\n", "httpEntity", ":=", "director", ".", "getEntity", "(", "endpoint", ",", "http", ".", "NO_CONTENT_TYPE", ")", "\n", "request", ":=", "director", ".", "gateway", ".", "Get", "(", "httpEntity", ")", "\n", "resp", ",", "err", ":=", "<mask>", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "return", "retrieveTaskStatus", "(", "resp", ")", "\n", "}" ]
16,457
all-16458
[ "EditScriptForStrings", "returns", "an", "optimal", "edit", "script", "to", "turn", "source", "into", "target", "." ]
[ "func", "EditScriptForStrings", "(", "source", "[", "]", "rune", ",", "target", "[", "]", "rune", ",", "op", "<mask>", ")", "EditScript", "{", "return", "backtrace", "(", "len", "(", "source", ")", ",", "len", "(", "target", ")", ",", "MatrixForStrings", "(", "source", ",", "target", ",", "op", ")", ",", "op", ")", "\n", "}" ]
16,458
all-16459
[ "UnmarshalJSON", "satisfies", "json", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "AuthChallengeResponseResponse", ")", "UnmarshalJSON", "(", "buf", "[", "]", "<mask>", ")", "error", "{", "return", "easyjson", ".", "Unmarshal", "(", "buf", ",", "t", ")", "\n", "}" ]
16,459
all-16460
[ "ElementSizeExceeded", "returns", "an", "error", "describing", "the", "violated", "size", "constraint", ".", "This", "function", "is", "used", "by", "the", "generated", "marshalling", "code", "." ]
[ "func", "ElementSizeExceeded", "(", "<mask>", "string", ",", "size", ",", "limit", "int", ")", "error", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "field", ",", "size", ",", "limit", ")", "\n", "}" ]
16,460
all-16461
[ "GetActionOutputs", "fetches", "the", "output", "for", "the", "given", "action", "If", "the", "action", "has", "no", "output", "returns", "nil" ]
[ "func", "(", "c", "*", "Client", ")", "GetActionOutputs", "(", "a", "*", "Action", ")", "(", "[", "]", "*", "Output", ",", "error", ")", "{", "if", "!", "a", ".", "HasOutput", "||", "a", ".", "OutputURL", "==", "\"", "\"", "{", "return", "nil", ",", "nil", "\n", "}", "\n\n", "req", ",", "err", ":=", "http", ".", "NewRequest", "(", "\"", "\"", ",", "a", ".", "OutputURL", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "c", ".", "debugRequest", "(", "req", ")", "\n\n", "resp", ",", "err", ":=", "c", ".", "client", "(", ")", ".", "Do", "(", "req", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "defer", "resp", ".", "<mask>", ".", "Close", "(", ")", "\n\n", "c", ".", "debugResponse", "(", "resp", ")", "\n\n", "output", ":=", "[", "]", "*", "Output", "{", "}", "\n", "if", "err", "=", "json", ".", "NewDecoder", "(", "resp", ".", "Body", ")", ".", "Decode", "(", "&", "output", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "output", ",", "nil", "\n", "}" ]
16,461
all-16462
[ "CONTRACT", ":", "rv", ".", "CanAddr", "()", "is", "true", ".", "NOTE", ":", "Keep", "the", "code", "structure", "similar", "to", "decodeReflectBinarySlice", "." ]
[ "func", "(", "cdc", "*", "Codec", ")", "decodeReflectBinaryArray", "(", "bz", "[", "]", "byte", ",", "info", "*", "TypeInfo", ",", "rv", "reflect", ".", "Value", ",", "fopts", "FieldOptions", ",", "bare", "bool", ")", "(", "n", "int", ",", "err", "error", ")", "{", "if", "!", "rv", ".", "CanAddr", "(", ")", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "printLog", "{", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "defer", "func", "(", ")", "{", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "err", ")", "\n", "}", "(", ")", "\n", "}", "\n", "ert", ":=", "info", ".", "Type", ".", "Elem", "(", ")", "\n", "if", "ert", ".", "Kind", "(", ")", "==", "reflect", ".", "Uint8", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "length", ":=", "info", ".", "Type", ".", "Len", "(", ")", "\n", "einfo", ",", "err", ":=", "cdc", ".", "getTypeInfo_wlock", "(", "ert", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n\n", "if", "!", "bare", "{", "// Read byte-length prefixed byteslice.", "var", "buf", ",", "_n", "=", "[", "]", "byte", "(", "nil", ")", ",", "int", "(", "0", ")", "\n", "buf", ",", "_n", ",", "err", "=", "DecodeByteSlice", "(", "bz", ")", "\n", "if", "slide", "(", "&", "bz", ",", "nil", ",", "_n", ")", "&&", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "// This is a trick for debuggability -- we slide on &n more later.", "n", "+=", "UvarintSize", "(", "uint64", "(", "len", "(", "buf", ")", ")", ")", "\n", "bz", "=", "buf", "\n", "}", "\n\n", "// If elem is not already a ByteLength type, read in packed form.", "// This is a Proto wart due to Proto backwards compatibility issues.", "// Amino2 will probably migrate to use the List typ3.", "typ3", ":=", "typeToTyp3", "(", "einfo", ".", "Type", ",", "fopts", ")", "\n", "if", "typ3", "!=", "Typ3_ByteLength", "{", "// Read elements in packed form.", "for", "i", ":=", "0", ";", "i", "<", "length", ";", "i", "++", "{", "var", "erv", ",", "_n", "=", "rv", ".", "Index", "(", "i", ")", ",", "int", "(", "0", ")", "\n", "_n", ",", "err", "=", "cdc", ".", "decodeReflectBinary", "(", "bz", ",", "einfo", ",", "erv", ",", "fopts", ",", "<mask>", ")", "\n", "if", "slide", "(", "&", "bz", ",", "&", "n", ",", "_n", ")", "&&", "err", "!=", "nil", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "return", "\n", "}", "\n", "// Special case when reading default value, prefer nil.", "if", "erv", ".", "Kind", "(", ")", "==", "reflect", ".", "Ptr", "{", "_", ",", "isDefault", ":=", "isDefaultValue", "(", "erv", ")", "\n", "if", "isDefault", "{", "erv", ".", "Set", "(", "reflect", ".", "Zero", "(", "erv", ".", "Type", "(", ")", ")", ")", "\n", "continue", "\n", "}", "\n", "}", "\n", "}", "\n", "// Ensure that we read the whole buffer.", "if", "len", "(", "bz", ")", ">", "0", "{", "err", "=", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "return", "\n", "}", "\n", "}", "else", "{", "// NOTE: ert is for the element value, while einfo.Type is dereferenced.", "isErtStructPointer", ":=", "ert", ".", "Kind", "(", ")", "==", "reflect", ".", "Ptr", "&&", "einfo", ".", "Type", ".", "Kind", "(", ")", "==", "reflect", ".", "Struct", "\n\n", "// Read elements in unpacked form.", "for", "i", ":=", "0", ";", "i", "<", "length", ";", "i", "++", "{", "// Read field key (number and type).", "var", "fnum", ",", "typ", ",", "_n", "=", "uint32", "(", "0", ")", ",", "Typ3", "(", "0x00", ")", ",", "int", "(", "0", ")", "\n", "fnum", ",", "typ", ",", "_n", ",", "err", "=", "decodeFieldNumberAndTyp3", "(", "bz", ")", "\n", "// Validate field number and typ3.", "if", "fnum", "!=", "fopts", ".", "BinFieldNum", "{", "err", "=", "errors", ".", "New", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "fopts", ".", "BinFieldNum", ",", "fnum", ")", ")", "\n", "return", "\n", "}", "\n", "if", "typ", "!=", "Typ3_ByteLength", "{", "err", "=", "errors", ".", "New", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "Typ3_ByteLength", ",", "typ", ")", ")", "\n", "return", "\n", "}", "\n", "if", "slide", "(", "&", "bz", ",", "&", "n", ",", "_n", ")", "&&", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "// Decode the next ByteLength bytes into erv.", "var", "erv", "=", "rv", ".", "Index", "(", "i", ")", "\n", "// Special case if:", "// * next ByteLength bytes are 0x00, and", "// * - erv is not a struct pointer, or", "// - field option doesn't have EmptyElements set", "// (the condition below uses demorgan's law)", "if", "(", "len", "(", "bz", ")", ">", "0", "&&", "bz", "[", "0", "]", "==", "0x00", ")", "&&", "!", "(", "isErtStructPointer", "&&", "fopts", ".", "EmptyElements", ")", "{", "slide", "(", "&", "bz", ",", "&", "n", ",", "1", ")", "\n", "erv", ".", "Set", "(", "defaultValue", "(", "erv", ".", "Type", "(", ")", ")", ")", "\n", "continue", "\n", "}", "\n", "// Normal case, read next non-nil element from bz.", "// In case of any inner lists in unpacked form.", "efopts", ":=", "fopts", "\n", "efopts", ".", "BinFieldNum", "=", "1", "\n", "_n", ",", "err", "=", "cdc", ".", "decodeReflectBinary", "(", "bz", ",", "einfo", ",", "erv", ",", "efopts", ",", "false", ")", "\n", "if", "slide", "(", "&", "bz", ",", "&", "n", ",", "_n", ")", "&&", "err", "!=", "nil", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "return", "\n", "}", "\n", "}", "\n", "// Ensure that there are no more elements left,", "// and no field number regression either.", "// This is to provide better error messages.", "if", "len", "(", "bz", ")", ">", "0", "{", "var", "fnum", "=", "uint32", "(", "0", ")", "\n", "fnum", ",", "_", ",", "_", ",", "err", "=", "decodeFieldNumberAndTyp3", "(", "bz", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "if", "fnum", "<=", "fopts", ".", "BinFieldNum", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "fnum", ",", "fopts", ".", "BinFieldNum", ")", "\n", "return", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "\n", "}" ]
16,462
all-16463
[ "One", "executes", "the", "query", "and", "unmarshals", "the", "first", "obtained", "document", "into", "the", "result", "argument", ".", "The", "result", "must", "be", "a", "struct", "or", "map", "value", "capable", "of", "being", "unmarshalled", "into", "by", "gobson", ".", "This", "function", "blocks", "until", "either", "a", "result", "is", "available", "or", "an", "error", "happens", ".", "For", "example", ":", "err", ":", "=", "collection", ".", "Find", "(", "bson", ".", "M", "{", "a", "1", "}", ")", ".", "One", "(", "&result", ")", "In", "case", "the", "resulting", "document", "includes", "a", "field", "named", "$err", "or", "errmsg", "which", "are", "standard", "ways", "for", "MongoDB", "to", "return", "query", "errors", "the", "returned", "err", "will", "be", "set", "to", "a", "*", "QueryError", "value", "including", "the", "Err", "message", "and", "the", "Code", ".", "In", "those", "cases", "the", "result", "argument", "is", "still", "unmarshalled", "into", "with", "the", "received", "document", "so", "that", "any", "other", "custom", "values", "may", "be", "obtained", "if", "desired", "." ]
[ "func", "(", "q", "*", "Query", ")", "One", "(", "result", "interface", "{", "}", ")", "(", "err", "error", ")", "{", "q", ".", "m", ".", "Lock", "(", ")", "\n", "session", ":=", "q", ".", "session", "\n", "op", ":=", "q", ".", "op", "// Copy.", "\n", "q", ".", "m", ".", "Unlock", "(", ")", "\n\n", "socket", ",", "err", ":=", "session", ".", "acquireSocket", "(", "true", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "defer", "socket", ".", "Release", "(", ")", "\n\n", "op", ".", "<mask>", "|=", "session", ".", "slaveOkFlag", "(", ")", "\n", "op", ".", "limit", "=", "-", "1", "\n\n", "data", ",", "err", ":=", "socket", ".", "SimpleQuery", "(", "&", "op", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "data", "==", "nil", "{", "return", "ErrNotFound", "\n", "}", "\n", "if", "result", "!=", "nil", "{", "err", "=", "bson", ".", "Unmarshal", "(", "data", ",", "result", ")", "\n", "if", "err", "==", "nil", "{", "debugf", "(", "\"", "\"", ",", "q", ",", "result", ")", "\n", "}", "else", "{", "debugf", "(", "\"", "\"", ",", "q", ",", "err", ")", "\n", "return", "err", "\n", "}", "\n", "}", "\n", "return", "checkQueryError", "(", "op", ".", "collection", ",", "data", ")", "\n", "}" ]
16,463
all-16464
[ "validate", "runs", "checks", "to", "ensure", "the", "label", "inputs", "are", "valid", "It", "ensures", "that", "no", "two", "label", "names", "(", "including", "previous", "names", ")", "have", "the", "same", "lowercase", "value", "and", "that", "the", "description", "is", "not", "over", "100", "characters", "." ]
[ "func", "validate", "(", "labels", "[", "]", "Label", ",", "parent", "string", ",", "seen", "map", "[", "string", "]", "string", ")", "(", "map", "[", "string", "]", "string", ",", "error", ")", "{", "newSeen", ":=", "copyStringMap", "(", "seen", ")", "\n", "for", "_", ",", "l", ":=", "range", "labels", "{", "name", ":=", "strings", ".", "ToLower", "(", "l", ".", "Name", ")", "\n", "path", ":=", "parent", "+", "\"", "\"", "+", "name", "\n", "if", "other", ",", "present", ":=", "newSeen", "[", "name", "]", ";", "present", "{", "return", "newSeen", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "name", ",", "path", ",", "other", ")", "\n", "}", "\n", "newSeen", "[", "name", "]", "=", "<mask>", "\n", "if", "newSeen", ",", "err", ":=", "validate", "(", "l", ".", "Previously", ",", "path", ",", "newSeen", ")", ";", "err", "!=", "nil", "{", "return", "newSeen", ",", "err", "\n", "}", "\n", "if", "len", "(", "l", ".", "Description", ")", ">", "100", "{", "// github limits the description field to 100 chars", "return", "newSeen", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n", "}", "\n", "return", "newSeen", ",", "nil", "\n", "}" ]
16,464
all-16465
[ "topic", "watcher", "loop", "triggered", "by", "the", "mainLoop" ]
[ "func", "(", "c", "*", "Consumer", ")", "twLoop", "(", "stopped", "<-", "chan", "none", ")", "{", "ticker", ":=", "time", ".", "NewTicker", "(", "c", ".", "client", ".", "config", ".", "Metadata", ".", "RefreshFrequency", "/", "2", ")", "\n", "defer", "ticker", ".", "Stop", "(", ")", "\n\n", "for", "{", "<mask>", "{", "case", "<-", "ticker", ".", "C", ":", "topics", ",", "err", ":=", "c", ".", "client", ".", "Topics", "(", ")", "\n", "if", "err", "!=", "nil", "{", "c", ".", "handleError", "(", "&", "Error", "{", "Ctx", ":", "\"", "\"", ",", "error", ":", "err", "}", ")", "\n", "return", "\n", "}", "\n\n", "for", "_", ",", "topic", ":=", "range", "topics", "{", "if", "!", "c", ".", "isKnownCoreTopic", "(", "topic", ")", "&&", "!", "c", ".", "isKnownExtraTopic", "(", "topic", ")", "&&", "c", ".", "isPotentialExtraTopic", "(", "topic", ")", "{", "return", "\n", "}", "\n", "}", "\n", "case", "<-", "stopped", ":", "return", "\n", "case", "<-", "c", ".", "dying", ":", "return", "\n", "}", "\n", "}", "\n", "}" ]
16,465
all-16466
[ "Sort", "action", "params", "by", "name" ]
[ "func", "appendSorted", "(", "params", "[", "]", "*", "gen", ".", "ActionParam", ",", "param", "*", "<mask>", ".", "ActionParam", ")", "[", "]", "*", "gen", ".", "ActionParam", "{", "params", "=", "append", "(", "params", ",", "param", ")", "\n", "sort", ".", "Sort", "(", "gen", ".", "ByName", "(", "params", ")", ")", "\n", "return", "params", "\n", "}" ]
16,466
all-16467
[ "ExtractToWriter", "writes", "the", "content", "of", "a", "given", "file", "inside", "the", "archive", "to", "dst" ]
[ "func", "(", "a", "*", "Archive", ")", "ExtractToWriter", "(", "dst", "io", ".", "Writer", ",", "name", "string", ")", "error", "{", "r", ",", "err", ":=", "a", ".", "GetFileReader", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "_", ",", "err", "=", "<mask>", ".", "Copy", "(", "dst", ",", "r", ")", "\n", "err2", ":=", "r", ".", "Close", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "err2", "\n", "}" ]
16,467
all-16468
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "StartParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoTracing1", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
16,468
all-16469
[ "func", "(", "me", "*", "CompactIPv4NodeInfo", ")", "Scrub", "()", "{", "slices", ".", "FilterInPlace", "(", "me", "func", "(", "ni", "*", "NodeInfo", ")", "bool", "{", "ni", ".", "Addr", ".", "IP", "=", "ni", ".", "Addr", ".", "IP", ".", "To4", "()", "return", "ni", ".", "Addr", ".", "IP", "!", "=", "nil", "}", ")", "}" ]
[ "func", "(", "me", "CompactIPv4NodeInfo", ")", "MarshalBinary", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "return", "marshalBinarySlice", "(", "slices", ".", "Map", "(", "func", "(", "ni", "NodeInfo", ")", "NodeInfo", "{", "ni", ".", "Addr", ".", "IP", "=", "ni", ".", "Addr", ".", "IP", ".", "To4", "(", ")", "\n", "return", "ni", "\n", "}", ",", "me", ")", ".", "(", "CompactIPv4NodeInfo", ")", ")", "\n", "}" ]
16,469
all-16470
[ "If", "the", "current", "fileLogger", "need", "to", "split", "just", "split" ]
[ "func", "(", "f", "*", "FileLogger", ")", "fileCheck", "(", ")", "{", "defer", "func", "(", ")", "{", "if", "err", ":=", "recover", "(", ")", ";", "err", "!=", "nil", "{", "f", ".", "lg", ".", "Printf", "(", "\"", "\\n", "\"", ",", "err", ")", "\n", "}", "\n", "}", "(", ")", "\n\n", "if", "f", ".", "isMustSplit", "(", ")", "{", "f", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "f", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "f", ".", "<mask>", "(", ")", "\n", "}", "\n", "}" ]
16,470
all-16471
[ "ApplyChanges", "applies", "the", "given", "changes", ".", "Returns", "nil", "if", "the", "operation", "was", "successful", "or", "an", "error", "if", "the", "operation", "failed", "." ]
[ "func", "(", "p", "*", "AzureProvider", ")", "ApplyChanges", "(", "changes", "*", "plan", ".", "Changes", ")", "error", "{", "zones", ",", "err", ":=", "p", ".", "zones", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "deleted", ",", "updated", ":=", "p", ".", "mapChanges", "(", "zones", ",", "changes", ")", "\n", "p", ".", "deleteRecords", "(", "deleted", ")", "\n", "p", ".", "updateRecords", "(", "<mask>", ")", "\n", "return", "nil", "\n", "}" ]
16,471
all-16472
[ "Handler", "sastisfy", "interface" ]
[ "func", "(", "mux", "*", "LoggingServeMux", ")", "<mask>", "(", "r", "*", "http", ".", "Request", ")", "(", "h", "http", ".", "Handler", ",", "pattern", "string", ")", "{", "return", "mux", ".", "serveMux", ".", "Handler", "(", "r", ")", "\n", "}" ]
16,472
all-16473
[ "Ask", "will", "call", "UI", ".", "Output", "with", "message", "then", "wait", "for", "UI", ".", "Ask", "to", "return", "a", "response", "and", "/", "or", "error", ".", "It", "will", "clean", "the", "response", "by", "removing", "any", "carriage", "returns", "and", "new", "lines", "that", "if", "finds", ".", "Then", "it", "will", "trim", "the", "message", "using", "the", "trim", "variable", ".", "Use", "and", "empty", "string", "to", "specify", "you", "do", "not", "want", "to", "trim", ".", "If", "a", "message", "is", "not", "used", "(", ")", "then", "it", "will", "not", "prompt", "user", "before", "waiting", "on", "a", "response", ".", "AskFGColor", "and", "AskBGColor", "are", "used", "for", "message", "color", ".", "ResponseFGColor", "and", "ResponseBGColor", "are", "used", "for", "response", "color", "." ]
[ "func", "(", "ui", "*", "ColorUI", ")", "Ask", "(", "message", ",", "trim", "string", ")", "(", "string", ",", "error", ")", "{", "if", "<mask>", "!=", "\"", "\"", "{", "ct", ".", "ChangeColor", "(", "ui", ".", "AskFGColor", ".", "Code", ",", "ui", ".", "AskFGColor", ".", "Bright", ",", "ui", ".", "AskBGColor", ".", "Code", ",", "ui", ".", "AskBGColor", ".", "Bright", ")", "\n", "ui", ".", "UI", ".", "Output", "(", "message", ")", "\n", "ct", ".", "ResetColor", "(", ")", "\n", "}", "\n", "ct", ".", "ChangeColor", "(", "ui", ".", "ResponseFGColor", ".", "Code", ",", "ui", ".", "ResponseFGColor", ".", "Bright", ",", "ui", ".", "ResponseBGColor", ".", "Code", ",", "ui", ".", "ResponseBGColor", ".", "Bright", ")", "\n", "res", ",", "err", ":=", "ui", ".", "UI", ".", "Ask", "(", "\"", "\"", ",", "trim", ")", "\n", "ct", ".", "ResetColor", "(", ")", "\n", "return", "res", ",", "err", "\n", "}" ]
16,473
all-16474
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "CollectClassNamesFromSubtreeReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom76", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
16,474
all-16475
[ "NewPool", "creates", "a", "new", "connection", "pool", "with", "connections", "to", "pods", "in", "the", "given", "service", "." ]
[ "func", "NewPool", "(", "kubeClient", "*", "kube", ".", "Clientset", ",", "namespace", "string", ",", "serviceName", "string", ",", "port", "int", ",", "queueSize", "int64", ",", "opts", "...", "grpc", ".", "DialOption", ")", "(", "*", "Pool", ",", "error", ")", "{", "endpointsInterface", ":=", "kubeClient", ".", "CoreV1", "(", ")", ".", "Endpoints", "(", "namespace", ")", "\n\n", "watch", ",", "err", ":=", "endpointsInterface", ".", "Watch", "(", "metav1", ".", "ListOptions", "{", "LabelSelector", ":", "metav1", ".", "FormatLabelSelector", "(", "metav1", ".", "SetAsLabelSelector", "(", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "serviceName", "}", ",", ")", ")", ",", "Watch", ":", "true", ",", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "pool", ":=", "&", "Pool", "{", "port", ":", "port", ",", "endpointsWatch", ":", "watch", ",", "opts", ":", "opts", ",", "done", ":", "make", "(", "chan", "struct", "{", "}", ")", ",", "queueSize", ":", "queueSize", ",", "}", "\n", "pool", ".", "connsCond", "=", "sync", ".", "NewCond", "(", "&", "pool", ".", "connsLock", ")", "\n", "<mask>", "pool", ".", "watchEndpoints", "(", ")", "\n", "return", "pool", ",", "nil", "\n", "}" ]
16,475
all-16476
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "DeleteCookiesParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork60", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
16,476
all-16477
[ "Ensure", "that", "the", "schema", "exists", "." ]
[ "func", "ensureSchemaTableExists", "(", "tx", "*", "sql", ".", "Tx", ")", "error", "{", "exists", ",", "err", ":=", "DoesSchemaTableExist", "(", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "if", "!", "exists", "{", "err", ":=", "createSchemaTable", "(", "tx", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
16,477
all-16478
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "TransactionHistoryResultEntryExt" ]
[ "func", "(", "u", "TransactionHistoryResultEntryExt", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "int32", "(", "sw", ")", "{", "case", "0", ":", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n", "return", "\"", "\"", ",", "false", "\n", "}" ]
16,478
all-16479
[ "NewFromAddress", "constructs", "a", "new", "APIClient", "for", "the", "server", "at", "addr", "." ]
[ "func", "NewFromAddress", "(", "addr", "string", ",", "options", "...", "Option", ")", "(", "*", "APIClient", ",", "error", ")", "{", "// Apply creation options", "settings", ":=", "clientSettings", "{", "maxConcurrentStreams", ":", "DefaultMaxConcurrentStreams", ",", "dialTimeout", ":", "DefaultDialTimeout", ",", "}", "\n", "for", "_", ",", "option", ":=", "range", "options", "{", "if", "err", ":=", "<mask>", "(", "&", "settings", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n", "c", ":=", "&", "APIClient", "{", "addr", ":", "addr", ",", "caCerts", ":", "settings", ".", "caCerts", ",", "limiter", ":", "limit", ".", "New", "(", "settings", ".", "maxConcurrentStreams", ")", ",", "}", "\n", "if", "err", ":=", "c", ".", "connect", "(", "settings", ".", "dialTimeout", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "c", ",", "nil", "\n", "}" ]
16,479
all-16480
[ "WithSizeOnly", "whether", "to", "only", "return", "the", "size", "information", "(", "defaults", "to", "false", ")", "." ]
[ "func", "(", "p", "GetEncodedResponseParams", ")", "WithSizeOnly", "(", "sizeOnly", "bool", ")", "*", "GetEncodedResponseParams", "{", "p", ".", "SizeOnly", "=", "sizeOnly", "\n", "<mask>", "&", "p", "\n", "}" ]
16,480
all-16481
[ "Inspect", "returns", "various", "information", "for", "(", "skopeo", "inspect", ")", "parsed", "from", "the", "manifest", "and", "configuration", "." ]
[ "func", "(", "m", "*", "Schema1", ")", "Inspect", "(", "_", "func", "(", "types", ".", "BlobInfo", ")", "(", "[", "]", "byte", ",", "error", ")", ")", "(", "*", "types", ".", "ImageInspectInfo", ",", "error", ")", "{", "s1", ":=", "&", "Schema2V1Image", "{", "}", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "[", "]", "byte", "(", "m", ".", "History", "[", "0", "]", ".", "V1Compatibility", ")", ",", "s1", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "i", ":=", "&", "types", ".", "ImageInspectInfo", "{", "<mask>", ":", "m", ".", "Tag", ",", "Created", ":", "&", "s1", ".", "Created", ",", "DockerVersion", ":", "s1", ".", "DockerVersion", ",", "Architecture", ":", "s1", ".", "Architecture", ",", "Os", ":", "s1", ".", "OS", ",", "Layers", ":", "layerInfosToStrings", "(", "m", ".", "LayerInfos", "(", ")", ")", ",", "}", "\n", "if", "s1", ".", "Config", "!=", "nil", "{", "i", ".", "Labels", "=", "s1", ".", "Config", ".", "Labels", "\n", "}", "\n", "return", "i", ",", "nil", "\n", "}" ]
16,481
all-16482
[ "Clean", "compresses", "all", "adjacent", "whitespace", "to", "a", "single", "space", "and", "trims", "s", "." ]
[ "func", "Clean", "(", "s", "<mask>", ")", "string", "{", "s", "=", "spacesRe", ".", "ReplaceAllString", "(", "s", ",", "\"", "\"", ")", "\n", "s", "=", "beginEndSpacesRe", ".", "ReplaceAllString", "(", "s", ",", "\"", "\"", ")", "\n", "return", "s", "\n", "}" ]
16,482
all-16483
[ "/", "*", "Set3D", "sets", "a", "particular", "element", "in", "the", "image" ]
[ "func", "(", "img", "*", "IplImage", ")", "Set3D", "(", "x", ",", "y", ",", "z", "int", ",", "value", "Scalar", ")", "{", "C", ".", "cvSet3D", "(", "unsafe", ".", "Pointer", "(", "img", ")", ",", "C", ".", "int", "(", "z", ")", ",", "C", ".", "int", "(", "y", ")", ",", "C", ".", "int", "(", "x", ")", ",", "(", "C", ".", "CvScalar", ")", "(", "<mask>", ")", ")", "\n", "}" ]
16,483
all-16484
[ "SetTimeout", "changes", "the", "timeout", "used", "on", "socket", "operations", "." ]
[ "func", "(", "socket", "*", "mongoSocket", ")", "SetTimeout", "(", "d", "time", ".", "Duration", ")", "{", "socket", ".", "Lock", "(", ")", "\n", "<mask>", ".", "timeout", "=", "d", "\n", "socket", ".", "Unlock", "(", ")", "\n", "}" ]
16,484
all-16485
[ "GetMonitor", "retrieves", "a", "monitor", "by", "identifier" ]
[ "func", "(", "client", "*", "Client", ")", "GetMonitor", "(", "id", "int", ")", "(", "*", "Monitor", ",", "error", ")", "{", "var", "<mask>", "Monitor", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "id", ")", ",", "nil", ",", "&", "out", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "out", ",", "nil", "\n", "}" ]
16,485
all-16486
[ "GetBool", "reads", "a", "ResourceData", "and", "returns", "a", "*", "bool", ".", "This", "differs", "from", "GetBoolPtr", "in", "that", "a", "nil", "value", "is", "never", "returned", "." ]
[ "func", "GetBool", "(", "d", "*", "schema", ".", "ResourceData", ",", "<mask>", "string", ")", "*", "bool", "{", "return", "BoolPtr", "(", "d", ".", "Get", "(", "key", ")", ".", "(", "bool", ")", ")", "\n", "}" ]
16,486
all-16487
[ "addPeer", "adds", "a", "peer", "to", "the", "Hyperbahn", "subchannel", ".", "TODO", "(", "prashant", ")", ":", "Start", "connections", "to", "the", "peers", "in", "the", "background", "." ]
[ "func", "addPeer", "(", "ch", "*", "tchannel", ".", "<mask>", ",", "hostPort", "string", ")", "{", "peers", ":=", "ch", ".", "GetSubChannel", "(", "hyperbahnServiceName", ")", ".", "Peers", "(", ")", "\n", "peers", ".", "Add", "(", "hostPort", ")", "\n", "}" ]
16,487
all-16488
[ "Schedule", "schedules", "a", "job", "that", "will", "be", "ran", "in", "FIFO", "order", "sequentially", "." ]
[ "func", "(", "f", "*", "fifo", ")", "Schedule", "(", "j", "Job", ")", "{", "f", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "f", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "if", "f", ".", "cancel", "==", "nil", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "len", "(", "f", ".", "pendings", ")", "==", "0", "{", "select", "{", "<mask>", "f", ".", "resume", "<-", "struct", "{", "}", "{", "}", ":", "default", ":", "}", "\n", "}", "\n", "f", ".", "pendings", "=", "append", "(", "f", ".", "pendings", ",", "j", ")", "\n", "}" ]
16,488
all-16489
[ "GetInt", "()", "is", "a", "wrapper", "around", "gtk_print_settings_get_int", "()", "." ]
[ "func", "(", "<mask>", "*", "PrintSettings", ")", "GetInt", "(", "key", "string", ")", "int", "{", "cstr", ":=", "C", ".", "CString", "(", "key", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "c", ":=", "C", ".", "gtk_print_settings_get_int", "(", "ps", ".", "native", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", "\n", "return", "int", "(", "c", ")", "\n", "}" ]
16,489
all-16490
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "PublicKey" ]
[ "func", "(", "u", "AccountId", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "<mask>", ",", "bool", ")", "{", "return", "PublicKey", "(", "u", ")", ".", "ArmForSwitch", "(", "sw", ")", "\n", "}" ]
16,490
all-16491
[ "Proxy", "is", "a", "GServiceAccount", "option", "to", "set", "a", "HTTP", "proxy", "used", "for", "by", "the", "token", "source", "." ]
[ "func", "Proxy", "(", "proxy", "string", ")", "Option", "{", "return", "func", "(", "gsa", "*", "GServiceAccount", ")", "error", "{", "u", ",", "err", ":=", "url", ".", "Parse", "(", "proxy", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "Transport", "(", "&", "http", ".", "Transport", "{", "<mask>", ":", "http", ".", "ProxyURL", "(", "u", ")", ",", "}", ")", "(", "gsa", ")", "\n", "}", "\n", "}" ]
16,491
all-16492
[ "NewWorker", "returns", "new", "instance", "of", "worker", "." ]
[ "func", "NewWorker", "(", "logger", "log", ".", "Logger", ",", "db", "*", "reform", ".", "DB", ",", "ethBack", "eth", ".", "Backend", ",", "gasConc", "*", "GasConf", ",", "pscAddr", "common", ".", "Address", ",", "payAddr", "string", ",", "pwdGetter", "data", ".", "PWDGetter", ",", "countryConf", "*", "country", ".", "Config", ",", "decryptKeyFunc", "<mask>", ".", "ToPrivateKeyFunc", ",", "eptConf", "*", "ept", ".", "Config", ",", "torHostname", "string", ",", "somcClientBuilder", "somc", ".", "ClientBuilderInterface", ")", "(", "*", "Worker", ",", "error", ")", "{", "l", ":=", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "\n\n", "abi", ",", "err", ":=", "abi", ".", "JSON", "(", "strings", ".", "NewReader", "(", "contract", ".", "PrivatixServiceContractABI", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "eptService", ",", "err", ":=", "ept", ".", "New", "(", "db", ",", "logger", ",", "payAddr", ",", "eptConf", ".", "Timeout", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "Worker", "{", "abi", ":", "abi", ",", "logger", ":", "l", ",", "db", ":", "db", ",", "decryptKeyFunc", ":", "decryptKeyFunc", ",", "gasConf", ":", "gasConc", ",", "ept", ":", "eptService", ",", "ethBack", ":", "ethBack", ",", "pscAddr", ":", "pscAddr", ",", "pwdGetter", ":", "pwdGetter", ",", "countryConfig", ":", "countryConf", ",", "torHostName", ":", "data", ".", "FromBytes", "(", "[", "]", "byte", "(", "torHostname", ")", ")", ",", "somcClientBuilder", ":", "somcClientBuilder", ",", "}", ",", "nil", "\n", "}" ]
16,492
all-16493
[ "Close", "releases", "any", "resources", "associated", "with", "the", "data", "buffer" ]
[ "func", "(", "d", "*", "Data", ")", "Close", "(", ")", "error", "{", "if", "d", ".", "dh", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "if", "d", ".", "cbc", ">", "0", "{", "callbackDelete", "(", "d", ".", "cbc", ")", "\n", "}", "\n", "_", ",", "<mask>", ":=", "C", ".", "gpgme_data_release", "(", "d", ".", "dh", ")", "\n", "d", ".", "dh", "=", "nil", "\n", "return", "err", "\n", "}" ]
16,493
all-16494
[ "GetContainerSnapshots", "returns", "a", "list", "of", "snapshots", "for", "the", "container" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "GetContainerSnapshots", "(", "containerName", "string", ")", "(", "[", "]", "api", ".", "ContainerSnapshot", ",", "error", ")", "{", "snapshots", ":=", "[", "]", "api", ".", "ContainerSnapshot", "{", "}", "\n\n", "// Fetch the raw value", "_", ",", "err", ":=", "r", ".", "queryStruct", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "<mask>", ".", "QueryEscape", "(", "containerName", ")", ")", ",", "nil", ",", "\"", "\"", ",", "&", "snapshots", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "snapshots", ",", "nil", "\n", "}" ]
16,494
all-16495
[ "GetStatus", "returns", "the", "Status", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "s", "*", "SyntheticsTest", ")", "GetStatus", "(", ")", "string", "{", "if", "s", "==", "nil", "||", "s", ".", "<mask>", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "s", ".", "Status", "\n", "}" ]
16,495
all-16496
[ "Set", "parses", "a", "command", "line", "set", "of", "URLs", "formatted", "like", ":", "http", ":", "//", "127", ".", "0", ".", "0", ".", "1", ":", "2380", "http", ":", "//", "10", ".", "1", ".", "1", ".", "2", ":", "80", "Implements", "flag", ".", "Value", "interface", "." ]
[ "func", "(", "us", "*", "URLsValue", ")", "Set", "(", "s", "string", ")", "error", "{", "ss", ",", "err", ":=", "<mask>", ".", "NewURLs", "(", "strings", ".", "Split", "(", "s", ",", "\"", "\"", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "*", "us", "=", "URLsValue", "(", "ss", ")", "\n", "return", "nil", "\n", "}" ]
16,496
all-16497
[ "for", "debugging", "purposes" ]
[ "func", "Printrecord", "(", "x", "IP2Locationrecord", ")", "{", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Country_short", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Country_long", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Region", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "City", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Isp", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Latitude", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Longitude", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "<mask>", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Zipcode", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Timezone", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Netspeed", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Iddcode", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Areacode", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Weatherstationcode", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Weatherstationname", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Mcc", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Mnc", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Mobilebrand", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Elevation", ")", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "x", ".", "Usagetype", ")", "\n", "}" ]
16,497
all-16498
[ "Diff", "returns", "a", "human", "-", "readable", "report", "of", "the", "differences", "between", "two", "values", ".", "It", "returns", "an", "empty", "string", "if", "and", "only", "if", "Equal", "returns", "true", "for", "the", "same", "input", "values", "and", "options", ".", "The", "output", "is", "displayed", "as", "a", "literal", "in", "pseudo", "-", "Go", "syntax", ".", "At", "the", "start", "of", "each", "line", "a", "-", "prefix", "indicates", "an", "element", "removed", "from", "x", "a", "+", "prefix", "to", "indicates", "an", "element", "added", "to", "y", "and", "the", "lack", "of", "a", "prefix", "indicates", "an", "element", "common", "to", "both", "x", "and", "y", ".", "If", "possible", "the", "output", "uses", "fmt", ".", "Stringer", ".", "String", "or", "error", ".", "Error", "methods", "to", "produce", "more", "humanly", "readable", "outputs", ".", "In", "such", "cases", "the", "string", "is", "prefixed", "with", "either", "an", "s", "or", "e", "character", "respectively", "to", "indicate", "that", "the", "method", "was", "called", ".", "Do", "not", "depend", "on", "this", "output", "being", "stable", ".", "If", "you", "need", "the", "ability", "to", "programmatically", "interpret", "the", "difference", "consider", "using", "a", "custom", "Reporter", "." ]
[ "func", "Diff", "(", "x", ",", "y", "interface", "{", "}", ",", "opts", "...", "Option", ")", "string", "{", "r", ":=", "<mask>", "(", "defaultReporter", ")", "\n", "eq", ":=", "Equal", "(", "x", ",", "y", ",", "Options", "(", "opts", ")", ",", "Reporter", "(", "r", ")", ")", "\n", "d", ":=", "r", ".", "String", "(", ")", "\n", "if", "(", "d", "==", "\"", "\"", ")", "!=", "eq", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "d", "\n", "}" ]
16,498
all-16499
[ "WithContext", "adds", "the", "context", "to", "the", "delete", "apps", "app", "params" ]
[ "func", "(", "o", "*", "DeleteAppsAppParams", ")", "WithContext", "(", "ctx", "context", ".", "<mask>", ")", "*", "DeleteAppsAppParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
16,499
all-16500
[ "HasPriority", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "e", "*", "Event", ")", "HasPriority", "(", ")", "bool", "{", "if", "e", "!=", "nil", "&&", "e", ".", "Priority", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]