id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
20,600
all-20601
[ "/", "*", "Set", "the", "request", "url", "of", "a", "transaction", ".", "The", "query", "part", "of", "the", "url", "is", "automatically", "stripped", "from", "the", "url", "." ]
[ "func", "TransactionSetRequestURL", "(", "id", "int64", ",", "<mask>", "string", ")", "(", "int", ",", "error", ")", "{", "curl", ":=", "C", ".", "CString", "(", "url", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "curl", ")", ")", "\n\n", "return", "errNo", "(", "C", ".", "newrelic_transaction_set_request_url", "(", "C", ".", "long", "(", "id", ")", ",", "curl", ")", ")", "\n", "}" ]
20,601
all-20602
[ "generate", "sampler", "object", "names" ]
[ "func", "GenSamplers", "(", "count", "int32", ",", "samplers", "*", "uint32", ")", "{", "syscall", ".", "Syscall", "(", "gpGenSamplers", ",", "2", ",", "uintptr", "(", "<mask>", ")", ",", "uintptr", "(", "unsafe", ".", "Pointer", "(", "samplers", ")", ")", ",", "0", ")", "\n", "}" ]
20,602
all-20603
[ "headContexts", "gets", "the", "status", "contexts", "for", "the", "commit", "with", "OID", "==", "pr", ".", "HeadRefOID", "First", "we", "try", "to", "get", "this", "value", "from", "the", "commits", "we", "got", "with", "the", "PR", "query", ".", "Unfortunately", "the", "last", "commit", "ordering", "is", "determined", "by", "author", "date", "not", "commit", "date", "so", "if", "commits", "are", "reordered", "non", "-", "chronologically", "on", "the", "PR", "branch", "the", "last", "commit", "isn", "t", "necessarily", "the", "logically", "last", "commit", ".", "We", "list", "multiple", "commits", "with", "the", "query", "to", "increase", "our", "chance", "of", "success", "but", "if", "we", "don", "t", "find", "the", "head", "commit", "we", "have", "to", "ask", "GitHub", "for", "it", "specifically", "(", "this", "costs", "an", "API", "token", ")", "." ]
[ "func", "headContexts", "(", "log", "*", "logrus", ".", "Entry", ",", "ghc", "githubClient", ",", "pr", "*", "PullRequest", ")", "(", "[", "]", "Context", ",", "error", ")", "{", "for", "_", ",", "node", ":=", "range", "pr", ".", "Commits", ".", "Nodes", "{", "if", "node", ".", "Commit", ".", "OID", "==", "pr", ".", "HeadRefOID", "{", "return", "node", ".", "Commit", ".", "Status", ".", "Contexts", ",", "nil", "\n", "}", "\n", "}", "\n", "// We didn't get the head commit from the query (the commits must not be", "// logically ordered) so we need to specifically ask GitHub for the status", "// and coerce it to a graphql type.", "org", ":=", "string", "(", "pr", ".", "Repository", ".", "Owner", ".", "Login", ")", "\n", "repo", ":=", "string", "(", "pr", ".", "Repository", ".", "Name", ")", "\n", "// Log this event so we can tune the number of commits we list to minimize this.", "log", ".", "Warnf", "(", "\"", "\"", ",", "len", "(", "pr", ".", "Commits", ".", "Nodes", ")", ")", "\n", "combined", ",", "err", ":=", "ghc", ".", "GetCombinedStatus", "(", "org", ",", "repo", ",", "string", "(", "pr", ".", "HeadRefOID", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "contexts", ":=", "make", "(", "[", "]", "Context", ",", "0", ",", "len", "(", "combined", ".", "Statuses", ")", ")", "\n", "for", "_", ",", "status", ":=", "range", "combined", ".", "Statuses", "{", "contexts", "=", "append", "(", "contexts", ",", "Context", "{", "Context", ":", "githubql", ".", "String", "(", "status", ".", "Context", ")", ",", "Description", ":", "githubql", ".", "String", "(", "status", ".", "Description", ")", ",", "State", ":", "githubql", ".", "StatusState", "(", "strings", ".", "ToUpper", "(", "status", ".", "State", ")", ")", ",", "}", ",", ")", "\n", "}", "\n", "// Add a commit with these contexts to pr for future look ups.", "pr", ".", "Commits", ".", "Nodes", "=", "<mask>", "(", "pr", ".", "Commits", ".", "Nodes", ",", "struct", "{", "Commit", "Commit", "}", "{", "Commit", ":", "Commit", "{", "OID", ":", "pr", ".", "HeadRefOID", ",", "Status", ":", "struct", "{", "Contexts", "[", "]", "Context", "}", "{", "Contexts", ":", "contexts", "}", ",", "}", ",", "}", ",", ")", "\n", "return", "contexts", ",", "nil", "\n", "}" ]
20,603
all-20604
[ "New", "creates", "a", "Differ", "instance", "for", "comparing", "two", "releases" ]
[ "func", "New", "(", "releaseRepo", "pull", ".", "Release", ",", "r1Path", ",", "r2Path", "string", ")", "(", "differ", "Differ", ",", "err", "error", ")", "{", "if", "filepath", ".", "Ext", "(", "r1Path", ")", "!=", "filepath", ".", "Ext", "(", "r2Path", ")", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", "+", "\"", "\"", ")", "\n", "return", "\n", "}", "\n", "if", "filepath", ".", "Ext", "(", "r1Path", ")", "==", "\"", "\"", "{", "var", "r1", ",", "r2", "*", "release", ".", "PivnetRelease", "\n", "if", "r1", ",", "err", "=", "release", ".", "LoadPivnetRelease", "(", "releaseRepo", ",", "r1Path", ")", ";", "err", "==", "nil", "{", "if", "r2", ",", "err", "=", "<mask>", ".", "LoadPivnetRelease", "(", "releaseRepo", ",", "r2Path", ")", ";", "err", "==", "nil", "{", "differ", "=", "pivnetReleaseDiffer", "{", "release1", ":", "r1", ",", "release2", ":", "r2", ",", "}", "\n", "}", "\n", "}", "\n", "}", "else", "{", "var", "r1", ",", "r2", "*", "release", ".", "BoshRelease", "\n", "if", "r1", ",", "err", "=", "release", ".", "LoadBoshRelease", "(", "releaseRepo", ",", "r1Path", ")", ";", "err", "==", "nil", "{", "if", "r2", ",", "err", "=", "release", ".", "LoadBoshRelease", "(", "releaseRepo", ",", "r2Path", ")", ";", "err", "==", "nil", "{", "differ", "=", "boshReleaseDiffer", "{", "release1", ":", "r1", ",", "release2", ":", "r2", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "\n", "}" ]
20,604
all-20605
[ "Check", "that", "the", "given", "list", "of", "update", "version", "numbers", "doesn", "t", "have", "holes", "that", "is", "each", "version", "equal", "the", "preceding", "version", "plus", "1", "." ]
[ "func", "checkSchemaVersionsHaveNoHoles", "(", "<mask>", "[", "]", "int", ")", "error", "{", "// Sanity check that there are no \"holes\" in the recorded", "// versions.", "for", "i", ":=", "range", "versions", "[", ":", "len", "(", "versions", ")", "-", "1", "]", "{", "if", "versions", "[", "i", "+", "1", "]", "!=", "versions", "[", "i", "]", "+", "1", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "versions", "[", "i", "]", ",", "versions", "[", "i", "+", "1", "]", ")", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
20,605
all-20606
[ "AcquireApplicationLock", "acquires", "an", "application", "lock", "by", "setting", "the", "lock", "field", "in", "the", "database", ".", "This", "method", "is", "already", "called", "by", "a", "connection", "middleware", "on", "requests", "with", ":", "app", "or", ":", "appname", "params", "that", "have", "side", "-", "effects", "." ]
[ "func", "AcquireApplicationLock", "(", "appName", "string", ",", "owner", "string", ",", "<mask>", "string", ")", "(", "bool", ",", "error", ")", "{", "return", "AcquireApplicationLockWait", "(", "appName", ",", "owner", ",", "reason", ",", "0", ")", "\n", "}" ]
20,606
all-20607
[ "/", "*", "Identify", "the", "beginning", "of", "a", "segment", "that", "performs", "a", "generic", "operation", ".", "This", "type", "of", "segment", "does", "not", "create", "metrics", "but", "can", "show", "up", "in", "a", "transaction", "trace", "if", "a", "transaction", "is", "slow", "enough", "." ]
[ "func", "SegmentGenericBegin", "(", "<mask>", ",", "parent", "int64", ",", "name", "string", ")", "(", "int64", ",", "error", ")", "{", "cname", ":=", "C", ".", "CString", "(", "name", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cname", ")", ")", "\n\n", "return", "errNoLong", "(", "C", ".", "newrelic_segment_generic_begin", "(", "C", ".", "long", "(", "id", ")", ",", "C", ".", "long", "(", "parent", ")", ",", "cname", ")", ")", "\n", "}" ]
20,607
all-20608
[ "PackEnd", "is", "a", "wrapper", "around", "gtk_header_bar_pack_end", "()", "." ]
[ "func", "(", "v", "*", "HeaderBar", ")", "PackEnd", "(", "child", "IWidget", ")", "{", "C", ".", "gtk_header_bar_pack_end", "(", "v", ".", "native", "(", ")", ",", "<mask>", ".", "toWidget", "(", ")", ")", "\n", "}" ]
20,608
all-20609
[ "title", ":", "show", "token", "path", ":", "/", "users", "/", "api", "-", "key", "method", ":", "GET", "produce", ":", "application", "/", "json", "responses", ":", "200", ":", "OK", "401", ":", "Unauthorized", "404", ":", "User", "not", "found" ]
[ "func", "showAPIToken", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "error", "{", "u", ",", "err", ":=", "auth", ".", "ConvertNewUser", "(", "t", ".", "User", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "email", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "if", "email", "!=", "\"", "\"", "{", "if", "!", "permission", ".", "Check", "(", "t", ",", "permission", ".", "PermUserUpdateToken", ")", "{", "return", "permission", ".", "ErrUnauthorized", "\n", "}", "\n", "u", ",", "err", "=", "auth", ".", "GetUserByEmail", "(", "email", ")", "\n", "if", "err", "!=", "nil", "{", "return", "&", "errors", ".", "HTTP", "{", "Code", ":", "<mask>", ".", "StatusNotFound", ",", "Message", ":", "err", ".", "Error", "(", ")", "}", "\n", "}", "\n", "}", "\n", "apiKey", ",", "err", ":=", "u", ".", "ShowAPIKey", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "w", ".", "Header", "(", ")", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "json", ".", "NewEncoder", "(", "w", ")", ".", "Encode", "(", "apiKey", ")", "\n", "}" ]
20,609
all-20610
[ "kvsToEvents", "gets", "all", "events", "for", "the", "watchers", "from", "all", "key", "-", "value", "pairs" ]
[ "func", "kvsToEvents", "(", "lg", "*", "zap", ".", "Logger", ",", "wg", "*", "watcherGroup", ",", "revs", ",", "vals", "[", "]", "[", "]", "byte", ")", "(", "evs", "[", "]", "mvccpb", ".", "Event", ")", "{", "for", "i", ",", "v", ":=", "range", "vals", "{", "var", "kv", "mvccpb", ".", "KeyValue", "\n", "if", "err", ":=", "kv", ".", "Unmarshal", "(", "v", ")", ";", "err", "!=", "nil", "{", "if", "lg", "!=", "nil", "{", "lg", ".", "Panic", "(", "\"", "\"", ",", "zap", ".", "Error", "(", "err", ")", ")", "\n", "}", "else", "{", "plog", ".", "Panicf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "\n\n", "if", "!", "wg", ".", "contains", "(", "string", "(", "kv", ".", "Key", ")", ")", "{", "continue", "\n", "}", "\n\n", "ty", ":=", "mvccpb", ".", "PUT", "\n", "if", "isTombstone", "(", "revs", "[", "i", "]", ")", "{", "ty", "=", "mvccpb", ".", "DELETE", "\n", "// patch in mod revision so watchers won't skip", "kv", ".", "ModRevision", "=", "bytesToRev", "(", "revs", "[", "i", "]", ")", ".", "main", "\n", "}", "\n", "evs", "=", "append", "(", "evs", ",", "mvccpb", ".", "Event", "{", "Kv", ":", "&", "kv", ",", "<mask>", ":", "ty", "}", ")", "\n", "}", "\n", "return", "evs", "\n", "}" ]
20,610
all-20611
[ "Read", "reads", "request", "header", "from", "r", ".", "io", ".", "EOF", "is", "returned", "if", "r", "is", "closed", "before", "reading", "the", "first", "header", "byte", "." ]
[ "func", "(", "h", "*", "RequestHeader", ")", "Read", "(", "r", "*", "bufio", ".", "Reader", ")", "error", "{", "n", ":=", "1", "\n", "for", "{", "err", ":=", "h", ".", "tryRead", "(", "r", ",", "n", ")", "\n", "if", "err", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "if", "err", "!=", "errNeedMore", "{", "h", ".", "resetSkipNormalize", "(", ")", "\n", "return", "<mask>", "\n", "}", "\n", "n", "=", "r", ".", "Buffered", "(", ")", "+", "1", "\n", "}", "\n", "}" ]
20,611
all-20612
[ "SetLevel", "sets", "lower", "level", "that", "current", "logger", "will", "process", "." ]
[ "func", "(", "logger", "*", "Logger", ")", "SetLevel", "(", "<mask>", "Level", ")", "{", "logger", ".", "lock", ".", "Lock", "(", ")", "\n", "logger", ".", "Level", "=", "level", "\n", "logger", ".", "flushBuffer", "(", ")", "\n", "logger", ".", "lock", ".", "Unlock", "(", ")", "\n", "}" ]
20,612
all-20613
[ "ImageNewFromStock", "is", "a", "wrapper", "around", "gtk_image_new_from_stock", "()", "." ]
[ "func", "ImageNewFromStock", "(", "stock", "Stock", ",", "size", "IconSize", ")", "(", "*", "Image", ",", "error", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "string", "(", "stock", ")", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "c", ":=", "C", ".", "gtk_image_new_from_stock", "(", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ",", "C", ".", "GtkIconSize", "(", "size", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "return", "wrapImage", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", ",", "nil", "\n", "}" ]
20,613
all-20614
[ "cephRBDVolumeCreate", "creates", "an", "RBD", "storage", "volume", ".", "Note", "that", "the", "set", "of", "features", "is", "intentionally", "limited", "is", "intentionally", "limited", "by", "passing", "--", "image", "-", "feature", "explicitly", ".", "This", "is", "done", "to", "ensure", "that", "the", "chances", "of", "a", "conflict", "between", "the", "features", "supported", "by", "the", "userspace", "library", "and", "the", "kernel", "module", "are", "minimized", ".", "Otherwise", "random", "panics", "might", "occur", "." ]
[ "func", "cephRBDVolumeCreate", "(", "clusterName", "string", ",", "poolName", "string", ",", "volumeName", "string", ",", "volumeType", "string", ",", "<mask>", "string", ",", "userName", "string", ")", "error", "{", "_", ",", "err", ":=", "shared", ".", "RunCommand", "(", "\"", "\"", ",", "\"", "\"", ",", "userName", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "clusterName", ",", "\"", "\"", ",", "poolName", ",", "\"", "\"", ",", "size", ",", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "volumeType", ",", "volumeName", ")", ")", "\n", "return", "err", "\n", "}" ]
20,614
all-20615
[ "FinishWithOptions", "belongs", "to", "the", "Span", "interface" ]
[ "func", "(", "s", "*", "MockSpan", ")", "FinishWithOptions", "(", "opts", "opentracing", ".", "FinishOptions", ")", "{", "s", ".", "Lock", "(", ")", "\n", "s", ".", "FinishTime", "=", "opts", ".", "FinishTime", "\n", "s", ".", "Unlock", "(", ")", "\n\n", "// Handle any late-bound LogRecords.", "for", "_", ",", "lr", ":=", "<mask>", "opts", ".", "LogRecords", "{", "s", ".", "logFieldsWithTimestamp", "(", "lr", ".", "Timestamp", ",", "lr", ".", "Fields", "...", ")", "\n", "}", "\n", "// Handle (deprecated) BulkLogData.", "for", "_", ",", "ld", ":=", "range", "opts", ".", "BulkLogData", "{", "if", "ld", ".", "Payload", "!=", "nil", "{", "s", ".", "logFieldsWithTimestamp", "(", "ld", ".", "Timestamp", ",", "log", ".", "String", "(", "\"", "\"", ",", "ld", ".", "Event", ")", ",", "log", ".", "Object", "(", "\"", "\"", ",", "ld", ".", "Payload", ")", ")", "\n", "}", "else", "{", "s", ".", "logFieldsWithTimestamp", "(", "ld", ".", "Timestamp", ",", "log", ".", "String", "(", "\"", "\"", ",", "ld", ".", "Event", ")", ")", "\n", "}", "\n", "}", "\n\n", "s", ".", "tracer", ".", "recordSpan", "(", "s", ")", "\n", "}" ]
20,615
all-20616
[ "Creates", "a", "new", "minio", "writer", "and", "a", "go", "routine", "to", "upload", "objects", "to", "minio", "server" ]
[ "func", "newMinioWriter", "(", "ctx", "context", ".", "Context", ",", "client", "*", "minioClient", ",", "name", "string", ")", "*", "minioWriter", "{", "reader", ",", "writer", ":=", "io", ".", "Pipe", "(", ")", "\n", "w", ":=", "&", "minioWriter", "{", "ctx", ":", "ctx", ",", "errChan", ":", "make", "(", "chan", "error", ")", ",", "pipe", ":", "writer", ",", "}", "\n", "go", "func", "(", ")", "{", "_", ",", "err", ":=", "client", ".", "PutObject", "(", "client", ".", "bucket", ",", "name", ",", "<mask>", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "reader", ".", "CloseWithError", "(", "err", ")", "\n", "}", "\n", "w", ".", "errChan", "<-", "err", "\n", "}", "(", ")", "\n", "return", "w", "\n", "}" ]
20,616
all-20617
[ "RunGlob", "is", "a", "helper", "that", "runs", "the", "files", "returned", "by", "filepath", ".", "Glob", ".", "runner", ".", "RunGlob", "(", "filepath", ".", "Glob", "(", "pattern", "))" ]
[ "func", "(", "r", "*", "Runner", ")", "RunGlob", "(", "<mask>", "[", "]", "string", ",", "err", "error", ")", "{", "if", "err", "!=", "nil", "{", "r", ".", "t", ".", "Log", "(", "\"", "\"", ",", "err", ")", "\n", "r", ".", "t", ".", "FailNow", "(", ")", "\n", "return", "\n", "}", "\n", "r", ".", "RunFile", "(", "files", "...", ")", "\n", "}" ]
20,617
all-20618
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniformMatrix4fv", "(", "<mask>", "uint32", ",", "location", "int32", ",", "count", "int32", ",", "transpose", "bool", ",", "value", "*", "float32", ")", "{", "C", ".", "glowProgramUniformMatrix4fv", "(", "gpProgramUniformMatrix4fv", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "C", ".", "GLint", ")", "(", "location", ")", ",", "(", "C", ".", "GLsizei", ")", "(", "count", ")", ",", "(", "C", ".", "GLboolean", ")", "(", "boolToInt", "(", "transpose", ")", ")", ",", "(", "*", "C", ".", "GLfloat", ")", "(", "unsafe", ".", "Pointer", "(", "value", ")", ")", ")", "\n", "}" ]
20,618
all-20619
[ "IsIPP", "()", "is", "a", "wrapper", "around", "gtk_paper_size_is_ipp", "()", "." ]
[ "func", "(", "<mask>", "*", "PaperSize", ")", "IsIPP", "(", ")", "bool", "{", "c", ":=", "C", ".", "gtk_paper_size_is_ipp", "(", "ps", ".", "native", "(", ")", ")", "\n", "return", "gobool", "(", "c", ")", "\n", "}" ]
20,619
all-20620
[ "HTTPReverseProxy", "provides", "a", "default", "setup", "for", "proxying", "internal", "components", "within", "the", "framework" ]
[ "func", "HTTPReverseProxy", "(", "options", "Options", ")", "(", "int", ",", "error", ")", "{", "<mask>", ":=", "options", ".", "ProxyPort", "\n", "var", "err", "error", "\n\n", "proxy", ":=", "httputil", ".", "NewSingleHostReverseProxy", "(", "&", "url", ".", "URL", "{", "Scheme", ":", "options", ".", "TargetScheme", ",", "Host", ":", "options", ".", "TargetAddress", ",", "}", ")", "\n\n", "if", "port", "==", "0", "{", "port", ",", "err", "=", "utils", ".", "GetFreePort", "(", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Println", "(", "\"", "\"", ",", "err", ")", "\n", "return", "0", ",", "err", "\n", "}", "\n", "}", "\n\n", "wrapper", ":=", "chainHandlers", "(", "append", "(", "options", ".", "Middleware", ",", "loggingMiddleware", ")", "...", ")", "\n\n", "log", ".", "Println", "(", "\"", "\"", ",", "port", ")", "\n", "go", "http", ".", "ListenAndServe", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "port", ")", ",", "wrapper", "(", "proxy", ")", ")", "\n\n", "return", "port", ",", "nil", "\n", "}" ]
20,620
all-20621
[ "Publish", "updates", "a", "mutable", "name", "to", "point", "to", "a", "given", "value" ]
[ "func", "(", "s", "*", "Shell", ")", "Publish", "(", "node", "string", ",", "value", "string", ")", "error", "{", "var", "pubResp", "PublishResponse", "\n", "req", ":=", "s", ".", "Request", "(", "\"", "\"", ")", "\n", "if", "<mask>", "!=", "\"", "\"", "{", "req", ".", "Arguments", "(", "node", ")", "\n", "}", "\n", "req", ".", "Arguments", "(", "value", ")", "\n\n", "return", "req", ".", "Exec", "(", "context", ".", "Background", "(", ")", ",", "&", "pubResp", ")", "\n", "}" ]
20,621
all-20622
[ "HasURL", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "Widget", ")", "HasURL", "(", ")", "bool", "{", "if", "w", "!=", "nil", "&&", "w", ".", "URL", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
20,622
all-20623
[ "TreeViewNewWithModel", "is", "a", "wrapper", "around", "gtk_tree_view_new_with_model", "()", "." ]
[ "func", "TreeViewNewWithModel", "(", "<mask>", "ITreeModel", ")", "(", "*", "TreeView", ",", "error", ")", "{", "return", "setupTreeView", "(", "unsafe", ".", "Pointer", "(", "C", ".", "gtk_tree_view_new_with_model", "(", "model", ".", "toTreeModel", "(", ")", ")", ")", ")", "\n", "}" ]
20,623
all-20624
[ "NewConcatIterator", "creates", "a", "new", "concatenated", "iterator" ]
[ "func", "NewConcatIterator", "(", "tbls", "[", "]", "*", "<mask>", ",", "reversed", "bool", ")", "*", "ConcatIterator", "{", "iters", ":=", "make", "(", "[", "]", "*", "Iterator", ",", "len", "(", "tbls", ")", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "tbls", ")", ";", "i", "++", "{", "iters", "[", "i", "]", "=", "tbls", "[", "i", "]", ".", "NewIterator", "(", "reversed", ")", "\n", "}", "\n", "return", "&", "ConcatIterator", "{", "reversed", ":", "reversed", ",", "iters", ":", "iters", ",", "tables", ":", "tbls", ",", "idx", ":", "-", "1", ",", "// Not really necessary because s.it.Valid()=false, but good to have.", "}", "\n", "}" ]
20,624
all-20625
[ "Merge", "updates", "global", "stats", "with", "partial", "stats", "and", "resets", "partial", "stats" ]
[ "func", "(", "s", "*", "Stats", ")", "Merge", "(", "sts", "*", "Stats", ")", "{", "atomic", ".", "AddUint64", "(", "&", "s", ".", "insertConflicts", ",", "sts", ".", "insertConflicts", ")", "\n", "sts", ".", "insertConflicts", "=", "0", "\n", "atomic", ".", "AddUint64", "(", "&", "s", ".", "readConflicts", ",", "sts", ".", "readConflicts", ")", "\n", "sts", ".", "readConflicts", "=", "0", "\n", "atomic", ".", "AddInt64", "(", "&", "s", ".", "softDeletes", ",", "sts", ".", "softDeletes", ")", "\n", "sts", ".", "softDeletes", "=", "0", "\n", "atomic", ".", "AddInt64", "(", "&", "s", ".", "nodeAllocs", ",", "sts", ".", "nodeAllocs", ")", "\n", "sts", ".", "nodeAllocs", "=", "0", "\n", "atomic", ".", "AddInt64", "(", "&", "s", ".", "nodeFrees", ",", "sts", ".", "nodeFrees", ")", "\n", "sts", ".", "nodeFrees", "=", "0", "\n", "atomic", ".", "AddInt64", "(", "&", "s", ".", "usedBytes", ",", "sts", ".", "usedBytes", ")", "\n", "sts", ".", "usedBytes", "=", "0", "\n\n", "for", "i", ",", "val", ":=", "<mask>", "sts", ".", "levelNodesCount", "{", "if", "val", "!=", "0", "{", "atomic", ".", "AddInt64", "(", "&", "s", ".", "levelNodesCount", "[", "i", "]", ",", "val", ")", "\n", "sts", ".", "levelNodesCount", "[", "i", "]", "=", "0", "\n", "}", "\n", "}", "\n", "}" ]
20,625
all-20626
[ "ChildType", "is", "a", "wrapper", "around", "gtk_container_child_type", "()", "." ]
[ "func", "(", "v", "*", "Container", ")", "ChildType", "(", ")", "glib", ".", "Type", "{", "c", ":=", "C", ".", "gtk_container_child_type", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "glib", ".", "<mask>", "(", "c", ")", "\n", "}" ]
20,626
all-20627
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "AddBindingParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime52", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
20,627
all-20628
[ "IntMax", "param", "must", "be", "a", "integer", "and", "range", "is", "[", "m", "]" ]
[ "func", "(", "c", "*", "Controller", ")", "IntMax", "(", "fieldName", "string", ",", "p", "interface", "{", "}", ",", "m", "int", ")", "int", "{", "if", "p", "==", "nil", "{", "p", "=", "\"", "\"", "\n", "}", "\n", "value", ",", "ok", ":=", "c", ".", "toNumber", "(", "p", ")", "\n", "if", "ok", "==", "false", "{", "panic", "(", "(", "&", "ValidationError", "{", "}", ")", ".", "New", "(", "fieldName", "+", "\"", "", "", "", "\n", "}", "\n", "b", ":=", "c", ".", "Validate", ".", "Max", "(", "value", ",", "m", ")", "\n", "if", "b", "==", "false", "{", "panic", "(", "(", "&", "ValidationError", "{", "}", ")", ".", "New", "(", "fieldName", "+", "\"", "o", "v", "Itoa(m)", ")", ")", "", "", "", "", "", "\n", "}", "\n", "return", "<mask>", "\n", "}" ]
20,628
all-20629
[ "PaperSizeNewFromPPD", "()", "is", "a", "wrapper", "around", "gtk_paper_size_new_from_ppd", "()", "." ]
[ "func", "PaperSizeNewFromPPD", "(", "<mask>", ",", "displayName", "string", ",", "width", ",", "height", "float64", ")", "(", "*", "PaperSize", ",", "error", ")", "{", "cName", ":=", "C", ".", "CString", "(", "name", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cName", ")", ")", "\n", "cDisplayName", ":=", "C", ".", "CString", "(", "displayName", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cDisplayName", ")", ")", "\n", "c", ":=", "C", ".", "gtk_paper_size_new_from_ppd", "(", "(", "*", "C", ".", "gchar", ")", "(", "cName", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cDisplayName", ")", ",", "C", ".", "gdouble", "(", "width", ")", ",", "C", ".", "gdouble", "(", "height", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "t", ":=", "&", "PaperSize", "{", "c", "}", "\n", "runtime", ".", "SetFinalizer", "(", "t", ",", "(", "*", "PaperSize", ")", ".", "free", ")", "\n", "return", "t", ",", "nil", "\n", "}" ]
20,629
all-20630
[ "verify", "all", "the", "field", "names", "in", "the", "response", "are", "what", "we", "expected", ".", "this", "is", "needed", "because", "a", "direct", "unmarshal", "is", "not", "case", "sensitive", "so", "can", "t", "ensure", "that", "the", "response", "is", "in", "valid", "format" ]
[ "func", "verifyResponseFieldNames", "(", "expectedFields", "[", "]", "string", ",", "responseBody", "[", "]", "byte", ",", "responseName", "string", ")", "error", "{", "var", "responseMap", "map", "[", "string", "]", "json", ".", "RawMessage", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "responseBody", ",", "&", "responseMap", ")", ";", "err", "!=", "nil", "{", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "responseName", ")", "\n", "}", "\n\n", "for", "_", ",", "field", ":=", "range", "expectedFields", "{", "if", "_", ",", "ok", ":=", "responseMap", "[", "<mask>", "]", ";", "!", "ok", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "field", ",", "responseName", ")", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
20,630
all-20631
[ "ensureTrailingDot", "ensures", "that", "the", "hostname", "receives", "a", "trailing", "dot", "if", "it", "hasn", "t", "already", "." ]
[ "func", "ensureTrailingDot", "(", "hostname", "string", ")", "string", "{", "if", "<mask>", ".", "ParseIP", "(", "hostname", ")", "!=", "nil", "{", "return", "hostname", "\n", "}", "\n\n", "return", "strings", ".", "TrimSuffix", "(", "hostname", ",", "\"", "\"", ")", "+", "\"", "\"", "\n", "}" ]
20,631
all-20632
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetHeapUsageParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime26", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
20,632
all-20633
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SetRequestInterceptionParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork10", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
20,633
all-20634
[ "GetSelectable", "is", "a", "wrapper", "around", "gtk_label_get_selectable", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetSelectable", "(", ")", "bool", "{", "c", ":=", "C", ".", "gtk_label_get_selectable", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "gobool", "(", "c", ")", "\n", "}" ]
20,634
all-20635
[ "GetVersionForBinary", "gets", "the", "version", "of", "a", "given", "Ruby", "binary" ]
[ "func", "(", "i", "*", "Installer", ")", "GetVersionForBinary", "(", "binary", "string", ")", "(", "version", "string", ",", "err", "error", ")", "{", "log", ".", "Println", "(", "\"", "\"", ",", "binary", ")", "\n\n", "content", ",", "err", ":=", "i", ".", "commander", ".", "Output", "(", "<mask>", ",", "\"", "\"", ")", "\n", "elements", ":=", "strings", ".", "Split", "(", "strings", ".", "TrimSpace", "(", "string", "(", "content", ")", ")", ",", "\"", "\\n", "\"", ")", "\n", "version", "=", "strings", ".", "TrimSpace", "(", "elements", "[", "len", "(", "elements", ")", "-", "1", "]", ")", "\n\n", "return", "version", ",", "err", "\n", "}" ]
20,635
all-20636
[ "Number", "returns", "the", "end", "position", "of", "the", "number", "that", "begins", "at", "the", "specified", "pos" ]
[ "func", "Number", "(", "in", "[", "]", "byte", ",", "pos", "int", ")", "(", "int", ",", "error", ")", "{", "pos", ",", "err", ":=", "skipSpace", "(", "in", ",", "pos", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n\n", "max", ":=", "len", "(", "in", ")", "\n", "for", "{", "v", ":=", "in", "[", "pos", "]", "\n", "switch", "v", "{", "case", "'-'", ",", "'+'", ",", "'.'", ",", "'e'", ",", "'E'", ",", "'1'", ",", "'2'", ",", "'3'", ",", "'4'", ",", "'5'", ",", "'6'", ",", "'7'", ",", "'8'", ",", "'9'", ",", "'0'", ":", "pos", "++", "\n", "default", ":", "return", "pos", ",", "nil", "\n", "}", "\n\n", "if", "<mask>", ">=", "max", "{", "return", "pos", ",", "nil", "\n", "}", "\n", "}", "\n\n", "return", "pos", ",", "nil", "\n", "}" ]
20,636
all-20637
[ "EtcdNodePortService", "returns", "a", "NodePort", "etcd", "service", ".", "This", "will", "let", "non", "-", "etcd", "pods", "talk", "to", "etcd" ]
[ "func", "EtcdNodePortService", "(", "local", "bool", ",", "opts", "*", "AssetOpts", ")", "*", "v1", ".", "Service", "{", "var", "clientNodePort", "int32", "\n", "if", "local", "{", "clientNodePort", "=", "32379", "\n", "}", "\n", "return", "&", "v1", ".", "<mask>", "{", "TypeMeta", ":", "metav1", ".", "TypeMeta", "{", "Kind", ":", "\"", "\"", ",", "APIVersion", ":", "\"", "\"", ",", "}", ",", "ObjectMeta", ":", "objectMeta", "(", "etcdName", ",", "labels", "(", "etcdName", ")", ",", "nil", ",", "opts", ".", "Namespace", ")", ",", "Spec", ":", "v1", ".", "ServiceSpec", "{", "Type", ":", "v1", ".", "ServiceTypeNodePort", ",", "Selector", ":", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "etcdName", ",", "}", ",", "Ports", ":", "[", "]", "v1", ".", "ServicePort", "{", "{", "Port", ":", "2379", ",", "Name", ":", "\"", "\"", ",", "NodePort", ":", "clientNodePort", ",", "}", ",", "}", ",", "}", ",", "}", "\n", "}" ]
20,637
all-20638
[ "Read", "reads", "request", "(", "including", "body", ")", "from", "the", "given", "r", ".", "RemoveMultipartFormFiles", "or", "Reset", "must", "be", "called", "after", "reading", "multipart", "/", "form", "-", "data", "request", "in", "order", "to", "delete", "temporarily", "uploaded", "files", ".", "If", "MayContinue", "returns", "true", "the", "caller", "must", ":", "-", "Either", "send", "StatusExpectationFailed", "response", "if", "request", "headers", "don", "t", "satisfy", "the", "caller", ".", "-", "Or", "send", "StatusContinue", "response", "before", "reading", "request", "body", "with", "ContinueReadBody", ".", "-", "Or", "close", "the", "connection", ".", "io", ".", "EOF", "is", "returned", "if", "r", "is", "closed", "before", "reading", "the", "first", "header", "byte", "." ]
[ "func", "(", "req", "*", "<mask>", ")", "Read", "(", "r", "*", "bufio", ".", "Reader", ")", "error", "{", "return", "req", ".", "ReadLimitBody", "(", "r", ",", "0", ")", "\n", "}" ]
20,638
all-20639
[ "NewReference", "returns", "an", "OpenShift", "reference", "for", "a", "reference", ".", "NamedTagged" ]
[ "func", "NewReference", "(", "dockerRef", "reference", ".", "NamedTagged", ")", "(", "types", ".", "ImageReference", ",", "error", ")", "{", "r", ":=", "strings", ".", "SplitN", "(", "reference", ".", "Path", "(", "dockerRef", ")", ",", "\"", "\"", ",", "3", ")", "\n", "if", "len", "(", "r", ")", "!=", "2", "{", "return", "nil", ",", "errors", ".", "Errorf", "(", "\"", "\"", ",", "reference", ".", "FamiliarString", "(", "dockerRef", ")", ")", "\n", "}", "\n", "return", "openshiftReference", "{", "namespace", ":", "r", "[", "0", "]", ",", "<mask>", ":", "r", "[", "1", "]", ",", "dockerReference", ":", "dockerRef", ",", "}", ",", "nil", "\n", "}" ]
20,639
all-20640
[ "ContentType", "changes", "the", "optional", "file", "content", "type", ".", "An", "empty", "string", "may", "be", "used", "to", "unset", "it", ".", "It", "is", "a", "runtime", "error", "to", "call", "this", "function", "when", "the", "file", "is", "not", "open", "for", "writing", "." ]
[ "func", "(", "file", "*", "GridFile", ")", "SetContentType", "(", "ctype", "string", ")", "{", "file", ".", "assertMode", "(", "gfsWriting", ")", "\n", "file", ".", "m", ".", "Lock", "(", ")", "\n", "file", ".", "doc", ".", "ContentType", "=", "ctype", "\n", "<mask>", ".", "m", ".", "Unlock", "(", ")", "\n", "}" ]
20,640
all-20641
[ "GetEvent", "returns", "the", "Event", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "r", "*", "reqGetEvent", ")", "GetEvent", "(", ")", "<mask>", "{", "if", "r", "==", "nil", "||", "r", ".", "Event", "==", "nil", "{", "return", "Event", "{", "}", "\n", "}", "\n", "return", "*", "r", ".", "Event", "\n", "}" ]
20,641
all-20642
[ "FromID", "locates", "a", "VirtualApp", "by", "its", "managed", "object", "reference", "ID", "." ]
[ "func", "FromID", "(", "client", "*", "govmomi", ".", "Client", ",", "id", "string", ")", "(", "*", "object", ".", "VirtualApp", ",", "error", ")", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "id", ")", "\n", "finder", ":=", "find", ".", "NewFinder", "(", "client", ".", "Client", ",", "false", ")", "\n\n", "ref", ":=", "types", ".", "ManagedObjectReference", "{", "Type", ":", "\"", "\"", ",", "Value", ":", "id", ",", "}", "\n\n", "ctx", ",", "cancel", ":=", "<mask>", ".", "WithTimeout", "(", "context", ".", "Background", "(", ")", ",", "provider", ".", "DefaultAPITimeout", ")", "\n", "defer", "cancel", "(", ")", "\n", "obj", ",", "err", ":=", "finder", ".", "ObjectReference", "(", "ctx", ",", "ref", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "log", ".", "Printf", "(", "\"", "\"", ",", "obj", ".", "Reference", "(", ")", ".", "Value", ")", "\n", "return", "obj", ".", "(", "*", "object", ".", "VirtualApp", ")", ",", "nil", "\n", "}" ]
20,642
all-20643
[ "setCall", "emits", "to", "fn", "code", "to", "evaluate", "all", "the", "parameters", "of", "a", "function", "call", "e", "and", "populates", "*", "c", "with", "those", "values", "." ]
[ "func", "(", "b", "*", "builder", ")", "setCall", "(", "fn", "*", "Function", ",", "e", "*", "ast", ".", "CallExpr", ",", "c", "*", "CallCommon", ")", "{", "// First deal with the f(...) part and optional receiver.", "b", ".", "setCallFunc", "(", "fn", ",", "e", ",", "c", ")", "\n\n", "// Then append the other actual parameters.", "sig", ",", "_", ":=", "fn", ".", "Pkg", ".", "typeOf", "(", "e", ".", "Fun", ")", ".", "Underlying", "(", ")", ".", "(", "*", "<mask>", ".", "Signature", ")", "\n", "if", "sig", "==", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "e", ".", "Fun", ")", ")", "\n", "}", "\n", "c", ".", "Args", "=", "b", ".", "emitCallArgs", "(", "fn", ",", "sig", ",", "e", ",", "c", ".", "Args", ")", "\n", "}" ]
20,643
all-20644
[ "SetTranslatorCredits", "is", "a", "wrapper", "around", "gtk_about_dialog_set_translator_credits", "()", "." ]
[ "func", "(", "v", "*", "AboutDialog", ")", "SetTranslatorCredits", "(", "translatorCredits", "string", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "translatorCredits", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "C", ".", "gtk_about_dialog_set_translator_credits", "(", "v", ".", "native", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", "\n", "}" ]
20,644
all-20645
[ "ListUsers", "lists", "all", "users" ]
[ "func", "(", "c", "*", "Client", ")", "ListUsers", "(", ")", "(", "*", "Users", ",", "error", ")", "{", "url", ":=", "umUsers", "(", ")", "+", "`?depth=`", "+", "c", ".", "client", ".", "<mask>", "+", "`&pretty=`", "+", "strconv", ".", "FormatBool", "(", "c", ".", "client", ".", "pretty", ")", "\n", "ret", ":=", "&", "Users", "{", "}", "\n", "err", ":=", "c", ".", "client", ".", "Get", "(", "url", ",", "ret", ",", "http", ".", "StatusOK", ")", "\n", "return", "ret", ",", "err", "\n", "}" ]
20,645
all-20646
[ "ChangeOfferingStatus", "initiates", "JobAgentPreOfferingMsgBCPublish", "JobAgentPreOfferingPopUp", "or", "JobAgentPreOfferingDelete", "job", "depending", "on", "a", "selected", "action", "." ]
[ "func", "(", "h", "*", "Handler", ")", "ChangeOfferingStatus", "(", "tkn", ",", "offering", ",", "action", "string", ",", "gasPrice", "uint64", ")", "error", "{", "logger", ":=", "h", ".", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "offering", ",", "\"", "\"", ",", "action", ",", "\"", "\"", ",", "gasPrice", ")", "\n\n", "if", "!", "h", ".", "token", ".", "Check", "(", "tkn", ")", "{", "logger", ".", "Warn", "(", "\"", "\"", ")", "\n", "return", "ErrAccessDenied", "\n", "}", "\n\n", "jobType", ",", "ok", ":=", "OfferingChangeActions", "[", "action", "]", "\n", "if", "!", "ok", "{", "logger", ".", "Warn", "(", "ErrBadOfferingStatusAction", ".", "Error", "(", ")", ")", "\n", "return", "ErrBadOfferingStatusAction", "\n", "}", "\n\n", "offer", ":=", "&", "data", ".", "Offering", "{", "}", "\n", "err", ":=", "h", ".", "findByPrimaryKey", "(", "logger", ",", "ErrOfferingNotFound", ",", "offer", ",", "offering", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "jobData", ":=", "&", "<mask>", ".", "JobPublishData", "{", "GasPrice", ":", "gasPrice", "}", "\n", "if", "err", ":=", "job", ".", "AddWithData", "(", "h", ".", "queue", ",", "nil", ",", "jobType", ",", "data", ".", "JobOffering", ",", "offering", ",", "data", ".", "JobUser", ",", "jobData", ")", ";", "err", "!=", "nil", "{", "logger", ".", "Error", "(", "err", ".", "Error", "(", ")", ")", "\n", "return", "ErrInternal", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
20,646
all-20647
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetFullAXTreeReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility7", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
20,647
all-20648
[ "DelClientCookie", "instructs", "the", "client", "to", "remove", "the", "given", "cookie", ".", "Use", "DelCookie", "if", "you", "want", "just", "removing", "the", "cookie", "from", "response", "header", "." ]
[ "func", "(", "h", "*", "ResponseHeader", ")", "DelClientCookie", "(", "key", "string", ")", "{", "h", ".", "DelCookie", "(", "key", ")", "\n\n", "c", ":=", "AcquireCookie", "(", ")", "\n", "c", ".", "SetKey", "(", "<mask>", ")", "\n", "c", ".", "SetExpire", "(", "CookieExpireDelete", ")", "\n", "h", ".", "SetCookie", "(", "c", ")", "\n", "ReleaseCookie", "(", "c", ")", "\n", "}" ]
20,648
all-20649
[ "query", "the", "index", "of", "a", "named", "resource", "within", "a", "program" ]
[ "func", "GetProgramResourceIndex", "(", "program", "uint32", ",", "programInterface", "uint32", ",", "<mask>", "*", "uint8", ")", "uint32", "{", "ret", ":=", "C", ".", "glowGetProgramResourceIndex", "(", "gpGetProgramResourceIndex", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "C", ".", "GLenum", ")", "(", "programInterface", ")", ",", "(", "*", "C", ".", "GLchar", ")", "(", "unsafe", ".", "Pointer", "(", "name", ")", ")", ")", "\n", "return", "(", "uint32", ")", "(", "ret", ")", "\n", "}" ]
20,649
all-20650
[ "WithCode", "unique", "DOM", "defined", "string", "value", "for", "each", "physical", "key", "(", "e", ".", "g", ".", "KeyA", ")", "(", "default", ":", ")", "." ]
[ "func", "(", "p", "DispatchKeyEventParams", ")", "WithCode", "(", "<mask>", "string", ")", "*", "DispatchKeyEventParams", "{", "p", ".", "Code", "=", "code", "\n", "return", "&", "p", "\n", "}" ]
20,650
all-20651
[ "GetLineWidth", "is", "a", "wrapper", "cairo_get_line_width", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetLineWidth", "(", ")", "float64", "{", "c", ":=", "C", ".", "cairo_get_line_width", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "float64", "(", "c", ")", "\n", "}" ]
20,651
all-20652
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "TakeResponseBodyForInterceptionAsStreamParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork4", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
20,652
all-20653
[ "StateChangeEvents", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockTaskEngine", ")", "StateChangeEvents", "(", ")", "chan", "statechange", ".", "Event", "{", "<mask>", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "chan", "statechange", ".", "Event", ")", "\n", "return", "ret0", "\n", "}" ]
20,653
all-20654
[ "BuildInfo", "retrieves", "the", "version", "and", "other", "details", "about", "the", "running", "MongoDB", "server", "." ]
[ "func", "(", "s", "*", "Session", ")", "BuildInfo", "(", ")", "(", "info", "BuildInfo", ",", "err", "error", ")", "{", "err", "=", "s", ".", "Run", "(", "bson", ".", "D", "{", "{", "\"", "\"", ",", "\"", "\"", "}", "}", ",", "&", "info", ")", "\n", "if", "len", "(", "info", ".", "VersionArray", ")", "==", "0", "{", "for", "_", ",", "a", ":=", "range", "strings", ".", "Split", "(", "info", ".", "Version", ",", "\"", "\"", ")", "{", "i", ",", "err", ":=", "strconv", ".", "Atoi", "(", "a", ")", "\n", "if", "err", "!=", "nil", "{", "break", "\n", "}", "\n", "info", ".", "VersionArray", "=", "append", "(", "info", ".", "VersionArray", ",", "i", ")", "\n", "}", "\n", "}", "\n", "for", "len", "(", "info", ".", "VersionArray", ")", "<", "4", "{", "info", ".", "VersionArray", "=", "append", "(", "info", ".", "VersionArray", ",", "0", ")", "\n", "}", "\n", "if", "i", ":=", "strings", ".", "IndexByte", "(", "info", ".", "GitVersion", ",", "' '", ")", ";", "i", ">=", "0", "{", "// Strip off the \" modules: enterprise\" suffix. This is a _git version_.", "// That information may be moved to another field if people need it.", "<mask>", ".", "GitVersion", "=", "info", ".", "GitVersion", "[", ":", "i", "]", "\n", "}", "\n", "return", "\n", "}" ]
20,654
all-20655
[ "LimitedGo", "creates", "a", "new", "process", "adds", "it", "as", "a", "child", "and", "spawns", "the", "ProcessFunc", "f", "in", "its", "own", "goroutine", "but", "may", "block", "according", "to", "the", "internal", "rate", "limit", ".", "It", "is", "equivalent", "to", ":", "func", "(", "f", "process", ".", "ProcessFunc", ")", "{", "<", "-", "limitch", "p", ".", "Go", "(", "func", "(", "child", "process", ".", "Process", ")", "{", "f", "(", "child", ")", "f", ".", "Close", "()", "//", "make", "sure", "its", "children", "close", "too!", "limitch<", "-", "struct", "{}", "{}", "}", ")", "/", "}", "It", "is", "useful", "to", "construct", "simple", "asynchronous", "workers", "children", "of", "p", "and", "rate", "limit", "their", "creation", "to", "avoid", "spinning", "up", "too", "many", "too", "fast", ".", "This", "is", "great", "for", "providing", "backpressure", "to", "producers", "." ]
[ "func", "(", "rl", "*", "RateLimiter", ")", "LimitedGo", "(", "f", "<mask>", ".", "ProcessFunc", ")", "{", "<-", "rl", ".", "limiter", "\n", "p", ":=", "rl", ".", "Go", "(", "f", ")", "\n\n", "// this <-closed() is here because the child may have spawned", "// children of its own, and our rate limiter should capture that.", "go", "func", "(", ")", "{", "<-", "p", ".", "Closed", "(", ")", "\n", "rl", ".", "limiter", "<-", "struct", "{", "}", "{", "}", "\n", "}", "(", ")", "\n", "}" ]
20,655
all-20656
[ "AwaitEOF", "waits", "for", "an", "EOF", "on", "the", "given", "stream", "returning", "an", "error", "if", "that", "fails", ".", "It", "waits", "at", "most", "EOFTimeout", "(", "defaults", "to", "1", "minute", ")", "after", "which", "it", "resets", "the", "stream", "." ]
[ "func", "AwaitEOF", "(", "s", "Stream", ")", "error", "{", "// So we don't wait forever", "s", ".", "SetDeadline", "(", "time", ".", "Now", "(", ")", ".", "Add", "(", "EOFTimeout", ")", ")", "\n\n", "// We *have* to observe the EOF. Otherwise, we leak the stream.", "// Now, technically, we should do this *before*", "// returning from SendMessage as the message", "// hasn't really been sent yet until we see the", "// EOF but we don't actually *know* what", "// protocol the other side is speaking.", "n", ",", "err", ":=", "s", ".", "Read", "(", "[", "]", "<mask>", "{", "0", "}", ")", "\n", "if", "n", ">", "0", "||", "err", "==", "nil", "{", "s", ".", "Reset", "(", ")", "\n", "return", "ErrExpectedEOF", "\n", "}", "\n", "if", "err", "!=", "io", ".", "EOF", "{", "s", ".", "Reset", "(", ")", "\n", "return", "err", "\n", "}", "\n", "return", "nil", "\n", "}" ]
20,656
all-20657
[ "Error", "returns", "the", "error", "string", "for", "MultiErr" ]
[ "func", "(", "me", "MultiErr", ")", "Error", "(", ")", "string", "{", "<mask>", ":=", "make", "(", "[", "]", "string", ",", "len", "(", "me", ".", "errors", ")", "+", "1", ")", "\n", "ret", "[", "0", "]", "=", "\"", "\"", "\n", "for", "ndx", ",", "err", ":=", "range", "me", ".", "errors", "{", "ret", "[", "ndx", "+", "1", "]", "=", "fmt", ".", "Sprintf", "(", "\"", "\\t", "\"", ",", "ndx", ",", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n", "return", "strings", ".", "Join", "(", "ret", ",", "\"", "\\n", "\"", ")", "\n", "}" ]
20,657
all-20658
[ "acquireGzipReader", "retrieves", "a", "(", "possibly", ")", "pre", "-", "initialized", "gzip", ".", "Reader", "from", "the", "package", "gzipPool", "(", "sync", ".", "Pool", ")", ".", "This", "reduces", "memory", "allocation", "overhead", "by", "re", "-", "using", "gzip", ".", "Readers" ]
[ "func", "acquireGzipReader", "(", "r", "<mask>", ".", "Reader", ")", "(", "*", "gzip", ".", "Reader", ",", "error", ")", "{", "v", ":=", "gzipPool", ".", "Get", "(", ")", "\n", "if", "v", "==", "nil", "{", "return", "gzip", ".", "NewReader", "(", "r", ")", "\n", "}", "\n", "zr", ":=", "v", ".", "(", "*", "gzip", ".", "Reader", ")", "\n", "if", "err", ":=", "zr", ".", "Reset", "(", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "zr", ",", "nil", "\n", "}" ]
20,658
all-20659
[ "labelSet", "parses", "a", "set", "of", "label", "matchers", "{", "[", "<labelname", ">", "=", "<match_string", ">", "...", "]", "}" ]
[ "func", "(", "p", "*", "parser", ")", "labelSet", "(", ")", "labels", ".", "Labels", "{", "set", ":=", "[", "]", "labels", ".", "Label", "{", "}", "\n", "for", "_", ",", "lm", ":=", "range", "p", ".", "labelMatchers", "(", "ItemEQL", ")", "{", "set", "=", "append", "(", "set", ",", "labels", ".", "Label", "{", "<mask>", ":", "lm", ".", "Name", ",", "Value", ":", "lm", ".", "Value", "}", ")", "\n", "}", "\n", "return", "labels", ".", "New", "(", "set", "...", ")", "\n", "}" ]
20,659
all-20660
[ "Routes", "implements", "scaffold", ".", "Platform", ".", "Routes" ]
[ "func", "(", "h", "*", "Hello", ")", "Routes", "(", "router", "*", "scaffold", ".", "Router", ")", "{", "router", ".", "Get", "(", "\"", "\"", ",", "scaffold", ".", "HandlerFunc", "(", "h", ".", "World", ")", ")", "\n", "router", ".", "Get", "(", "\"", "\"", ",", "scaffold", ".", "HandlerFunc", "(", "h", ".", "<mask>", ")", ")", "\n", "}" ]
20,660
all-20661
[ "HasEnd", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "d", "*", "Downtime", ")", "HasEnd", "(", ")", "bool", "{", "if", "d", "!=", "nil", "&&", "d", ".", "End", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
20,661
all-20662
[ "Do", "executes", "Page", ".", "searchInResource", "against", "the", "provided", "context", ".", "returns", ":", "result", "-", "List", "of", "search", "matches", "." ]
[ "func", "(", "p", "*", "SearchInResourceParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "result", "[", "]", "*", "debugger", ".", "SearchMatch", ",", "err", "error", ")", "{", "// execute", "var", "res", "SearchInResourceReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSearchInResource", ",", "p", ",", "&", "res", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "res", ".", "Result", ",", "nil", "\n", "}" ]
20,662
all-20663
[ "GetOverallStateModifiedOk", "returns", "a", "tuple", "with", "the", "OverallStateModified", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "m", "*", "Monitor", ")", "GetOverallStateModifiedOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "m", "==", "nil", "||", "m", ".", "OverallStateModified", "==", "nil", "{", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n", "return", "*", "m", ".", "OverallStateModified", ",", "true", "\n", "}" ]
20,663
all-20664
[ "TaskByArn", "returns", "a", "task", "for", "a", "given", "ARN" ]
[ "func", "(", "state", "*", "DockerTaskEngineState", ")", "TaskByArn", "(", "arn", "string", ")", "(", "*", "apitask", ".", "Task", ",", "bool", ")", "{", "state", ".", "lock", ".", "RLock", "(", ")", "\n", "defer", "<mask>", ".", "lock", ".", "RUnlock", "(", ")", "\n\n", "return", "state", ".", "taskByArn", "(", "arn", ")", "\n", "}" ]
20,664
all-20665
[ "See", "the", "documentation", "for", "Index", "for", "details", "." ]
[ "func", "(", "c", "*", "collection", ")", "indexPath", "(", "index", "*", "Index", ",", "indexVal", "<mask>", "{", "}", ",", "key", "string", ")", "string", "{", "return", "path", ".", "Join", "(", "c", ".", "indexDir", "(", "index", ",", "indexVal", ")", ",", "key", ")", "\n", "}" ]
20,665
all-20666
[ "Insert", "a", "secret", "into", "the", "secret", "storage", ".", "The", "supplied", "secrets", "will", "be", "provided", "verbatime", "via", "getSecret", "while", "the", "supplied", "scopes", "will", "be", "converted", "into", "credentials", "by", "getSecret", ".", "This", "method", "is", "not", "ordinarily", "used", "in", "production", ";", "instead", "the", "provisioner", "creates", "a", "new", "secret", "directly", "for", "each", "spot", "bid", ".", "Required", "scopes", ":", "aws", "-", "provisioner", ":", "create", "-", "secret", ":", "<workerType", ">", "See", "https", ":", "//", "docs", ".", "taskcluster", ".", "net", "/", "reference", "/", "core", "/", "aws", "-", "provisioner", "/", "api", "-", "docs#createSecret" ]
[ "func", "(", "awsProvisioner", "*", "AwsProvisioner", ")", "CreateSecret", "(", "token", "string", ",", "payload", "*", "SecretRequest", ")", "error", "{", "cd", ":=", "tcclient", ".", "Client", "(", "*", "awsProvisioner", ")", "\n", "_", ",", "_", ",", "err", ":=", "(", "&", "cd", ")", ".", "APICall", "(", "payload", ",", "\"", "\"", ",", "\"", "\"", "+", "<mask>", ".", "QueryEscape", "(", "token", ")", ",", "nil", ",", "nil", ")", "\n", "return", "err", "\n", "}" ]
20,666
all-20667
[ "Watch", "creates", "a", "new", "watcher", "in", "the", "stream", "and", "returns", "its", "WatchID", "." ]
[ "func", "(", "ws", "*", "watchStream", ")", "Watch", "(", "id", "WatchID", ",", "<mask>", ",", "end", "[", "]", "byte", ",", "startRev", "int64", ",", "fcs", "...", "FilterFunc", ")", "(", "WatchID", ",", "error", ")", "{", "// prevent wrong range where key >= end lexicographically", "// watch request with 'WithFromKey' has empty-byte range end", "if", "len", "(", "end", ")", "!=", "0", "&&", "bytes", ".", "Compare", "(", "key", ",", "end", ")", "!=", "-", "1", "{", "return", "-", "1", ",", "ErrEmptyWatcherRange", "\n", "}", "\n\n", "ws", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "ws", ".", "mu", ".", "Unlock", "(", ")", "\n", "if", "ws", ".", "closed", "{", "return", "-", "1", ",", "ErrEmptyWatcherRange", "\n", "}", "\n\n", "if", "id", "==", "AutoWatchID", "{", "for", "ws", ".", "watchers", "[", "ws", ".", "nextID", "]", "!=", "nil", "{", "ws", ".", "nextID", "++", "\n", "}", "\n", "id", "=", "ws", ".", "nextID", "\n", "ws", ".", "nextID", "++", "\n", "}", "else", "if", "_", ",", "ok", ":=", "ws", ".", "watchers", "[", "id", "]", ";", "ok", "{", "return", "-", "1", ",", "ErrWatcherDuplicateID", "\n", "}", "\n\n", "w", ",", "c", ":=", "ws", ".", "watchable", ".", "watch", "(", "key", ",", "end", ",", "startRev", ",", "id", ",", "ws", ".", "ch", ",", "fcs", "...", ")", "\n\n", "ws", ".", "cancels", "[", "id", "]", "=", "c", "\n", "ws", ".", "watchers", "[", "id", "]", "=", "w", "\n", "return", "id", ",", "nil", "\n", "}" ]
20,667
all-20668
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetInstrumentationBreakpointParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger1", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
20,668
all-20669
[ "contextDone", "returns", "an", "error", "if", "the", "context", "was", "canceled", "or", "timed", "out", "." ]
[ "func", "contextDone", "(", "ctx", "<mask>", ".", "Context", ",", "env", "string", ")", "error", "{", "if", "err", ":=", "ctx", ".", "Err", "(", ")", ";", "err", "!=", "nil", "{", "return", "contextErr", "(", "err", ",", "env", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
20,669
all-20670
[ "GetCurrentMode", "returns", "current", "logging", "mode" ]
[ "func", "(", "g", "*", "Glg", ")", "GetCurrentMode", "(", "<mask>", "LEVEL", ")", "MODE", "{", "l", ",", "ok", ":=", "g", ".", "logger", ".", "Load", "(", "level", ")", "\n", "if", "ok", "{", "return", "l", ".", "(", "*", "logger", ")", ".", "mode", "\n", "}", "\n", "return", "NONE", "\n", "}" ]
20,670
all-20671
[ "Endpoints", "returns", "endpoint", "objects", "." ]
[ "func", "(", "sc", "*", "fakeSource", ")", "Endpoints", "(", ")", "(", "[", "]", "*", "endpoint", ".", "Endpoint", ",", "error", ")", "{", "endpoints", ":=", "<mask>", "(", "[", "]", "*", "endpoint", ".", "Endpoint", ",", "10", ")", "\n\n", "for", "i", ":=", "0", ";", "i", "<", "10", ";", "i", "++", "{", "endpoints", "[", "i", "]", ",", "_", "=", "sc", ".", "generateEndpoint", "(", ")", "\n", "}", "\n\n", "return", "endpoints", ",", "nil", "\n", "}" ]
20,671
all-20672
[ "NewRcodeZeroProvider", "creates", "a", "new", "RcodeZero", "Anycast", "DNS", "provider", ".", "Returns", "the", "provider", "or", "an", "error", "if", "a", "provider", "could", "not", "be", "created", "." ]
[ "func", "NewRcodeZeroProvider", "(", "domainFilter", "DomainFilter", ",", "dryRun", "bool", ",", "txtEnc", "bool", ")", "(", "*", "RcodeZeroProvider", ",", "error", ")", "{", "client", ",", "err", ":=", "rc0", ".", "NewClient", "(", "os", ".", "Getenv", "(", "\"", "\"", ")", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "value", ":=", "os", ".", "Getenv", "(", "\"", "\"", ")", "\n", "if", "len", "(", "value", ")", "!=", "0", "{", "client", ".", "BaseURL", ",", "err", "=", "url", ".", "Parse", "(", "<mask>", ".", "Getenv", "(", "\"", "\"", ")", ")", "\n", "}", "\n\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n\n", "provider", ":=", "&", "RcodeZeroProvider", "{", "Client", ":", "client", ",", "DomainFilter", ":", "domainFilter", ",", "DryRun", ":", "dryRun", ",", "TXTEncrypt", ":", "txtEnc", ",", "}", "\n\n", "if", "txtEnc", "{", "provider", ".", "Key", "=", "[", "]", "byte", "(", "os", ".", "Getenv", "(", "\"", "\"", ")", ")", "\n", "}", "\n\n", "return", "provider", ",", "nil", "\n", "}" ]
20,672
all-20673
[ "AccelMapAddFilter", "is", "a", "wrapper", "around", "gtk_accel_map_add_filter", "()", "." ]
[ "func", "AccelMapAddFilter", "(", "<mask>", "string", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "filter", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n\n", "C", ".", "gtk_accel_map_add_filter", "(", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", "\n", "}" ]
20,673
all-20674
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetHeapObjectIDReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeapprofiler13", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
20,674
all-20675
[ "Writer", "implements", "the", "corresponding", "method", "in", "the", "Client", "interface" ]
[ "func", "(", "o", "*", "tracingObjClient", ")", "Writer", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "<mask>", ".", "WriteCloser", ",", "error", ")", "{", "span", ",", "ctx", ":=", "tracing", ".", "AddSpanToAnyExisting", "(", "ctx", ",", "o", ".", "provider", "+", "\"", "\"", ",", "\"", "\"", ",", "name", ")", "\n", "if", "span", "!=", "nil", "{", "defer", "span", ".", "Finish", "(", ")", "\n", "}", "\n", "return", "o", ".", "Client", ".", "Writer", "(", "ctx", ",", "name", ")", "\n", "}" ]
20,675
all-20676
[ "/", "*", "Fatalm", "uses", "msg", "as", "a", "format", "string", "with", "subsequent", "parameters", "as", "values", "and", "logs", "the", "resulting", "message", "to", "all", "added", "loggers", "at", "LogLevel", ".", "LevelFatal", ".", "It", "will", "also", "merge", "all", "attributes", "passed", "in", "m", "with", "any", "attributes", "added", "to", "Base", "and", "include", "them", "with", "the", "message", "if", "the", "Logger", "supports", "it", "." ]
[ "func", "(", "la", "*", "LogAdapter", ")", "Fatalm", "(", "m", "*", "Attrs", ",", "msg", "string", ",", "a", "...", "<mask>", "{", "}", ")", "error", "{", "return", "la", ".", "Log", "(", "LevelFatal", ",", "m", ",", "msg", ",", "a", "...", ")", "\n", "}" ]
20,676
all-20677
[ "IsKeyNotFound", "returns", "true", "if", "the", "error", "code", "is", "ErrorCodeKeyNotFound", "." ]
[ "func", "IsKeyNotFound", "(", "err", "error", ")", "bool", "{", "if", "cErr", ",", "<mask>", ":=", "err", ".", "(", "Error", ")", ";", "ok", "{", "return", "cErr", ".", "Code", "==", "ErrorCodeKeyNotFound", "\n", "}", "\n", "return", "false", "\n", "}" ]
20,677
all-20678
[ "Send", "msg", "to", "the", "channel", "identified", "by", "chID", "byte", ".", "Returns", "false", "if", "the", "send", "queue", "is", "full", "after", "timeout", "specified", "by", "MConnection", "." ]
[ "func", "(", "p", "*", "Peer", ")", "Send", "(", "chID", "byte", ",", "msg", "interface", "{", "}", ")", "bool", "{", "if", "!", "p", ".", "IsRunning", "(", ")", "{", "// see Switch#Broadcast, where we fetch the list of peers and loop over", "// them - while we're looping, one peer may be removed and stopped.", "return", "false", "\n", "}", "\n", "return", "p", ".", "mconn", ".", "Send", "(", "chID", ",", "<mask>", ")", "\n", "}" ]
20,678
all-20679
[ "JobURL", "returns", "the", "expected", "URL", "for", "ProwJobStatus", ".", "TODO", "(", "fejta", ")", ":", "consider", "moving", "default", "JobURLTemplate", "and", "JobURLPrefix", "out", "of", "plank" ]
[ "func", "JobURL", "(", "plank", "config", ".", "Plank", ",", "pj", "prowapi", ".", "ProwJob", ",", "log", "*", "logrus", ".", "Entry", ")", "string", "{", "if", "pj", ".", "Spec", ".", "DecorationConfig", "!=", "nil", "&&", "plank", ".", "GetJobURLPrefix", "(", "pj", ".", "Spec", ".", "Refs", ")", "!=", "\"", "\"", "{", "spec", ":=", "downwardapi", ".", "NewJobSpec", "(", "pj", ".", "Spec", ",", "pj", ".", "Status", ".", "BuildID", ",", "pj", ".", "Name", ")", "\n", "gcsConfig", ":=", "pj", ".", "Spec", ".", "DecorationConfig", ".", "GCSConfiguration", "\n", "_", ",", "gcsPath", ",", "_", ":=", "gcsupload", ".", "PathsForJob", "(", "gcsConfig", ",", "&", "spec", ",", "\"", "\"", ")", "\n\n", "prefix", ",", "_", ":=", "url", ".", "Parse", "(", "plank", ".", "GetJobURLPrefix", "(", "pj", ".", "Spec", ".", "Refs", ")", ")", "\n", "prefix", ".", "Path", "=", "path", ".", "Join", "(", "<mask>", ".", "Path", ",", "gcsConfig", ".", "Bucket", ",", "gcsPath", ")", "\n", "return", "prefix", ".", "String", "(", ")", "\n", "}", "\n", "var", "b", "bytes", ".", "Buffer", "\n", "if", "err", ":=", "plank", ".", "JobURLTemplate", ".", "Execute", "(", "&", "b", ",", "&", "pj", ")", ";", "err", "!=", "nil", "{", "log", ".", "WithFields", "(", "ProwJobFields", "(", "&", "pj", ")", ")", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "else", "{", "return", "b", ".", "String", "(", ")", "\n", "}", "\n", "return", "\"", "\"", "\n", "}" ]
20,679
all-20680
[ "GetWindowByID", "is", "a", "wrapper", "around", "gtk_application_get_window_by_id", "()", "." ]
[ "func", "(", "v", "*", "Application", ")", "GetWindowByID", "(", "<mask>", "uint", ")", "*", "Window", "{", "c", ":=", "C", ".", "gtk_application_get_window_by_id", "(", "v", ".", "native", "(", ")", ",", "C", ".", "guint", "(", "id", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "wrapWindow", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", "\n", "}" ]
20,680
all-20681
[ "Do", "executes", "BackgroundService", ".", "stopObserving", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "StopObservingParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandStopObserving", ",", "p", ",", "nil", ")", "\n", "}" ]
20,681
all-20682
[ "title", ":", "reset", "password", "path", ":", "/", "users", "/", "{", "email", "}", "/", "password", "method", ":", "POST", "responses", ":", "200", ":", "Ok", "400", ":", "Invalid", "data", "401", ":", "Unauthorized", "403", ":", "Forbidden", "404", ":", "Not", "found" ]
[ "func", "resetPassword", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "(", "err", "error", ")", "{", "managed", ",", "ok", ":=", "app", ".", "AuthScheme", ".", "(", "auth", ".", "ManagedScheme", ")", "\n", "if", "!", "ok", "{", "return", "&", "errors", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusBadRequest", ",", "Message", ":", "nonManagedSchemeMsg", "}", "\n", "}", "\n", "email", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "token", ":=", "InputValue", "(", "r", ",", "\"", "\"", ")", "\n", "evt", ",", "err", ":=", "<mask>", ".", "New", "(", "&", "event", ".", "Opts", "{", "Target", ":", "userTarget", "(", "email", ")", ",", "Kind", ":", "permission", ".", "PermUserUpdateReset", ",", "RawOwner", ":", "event", ".", "Owner", "{", "Type", ":", "event", ".", "OwnerTypeUser", ",", "Name", ":", "email", "}", ",", "CustomData", ":", "event", ".", "FormToCustomData", "(", "InputFields", "(", "r", ")", ")", ",", "Allowed", ":", "event", ".", "Allowed", "(", "permission", ".", "PermUserReadEvents", ",", "permission", ".", "Context", "(", "permTypes", ".", "CtxUser", ",", "email", ")", ")", ",", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "defer", "func", "(", ")", "{", "evt", ".", "Done", "(", "err", ")", "}", "(", ")", "\n", "u", ",", "err", ":=", "auth", ".", "GetUserByEmail", "(", "email", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "authTypes", ".", "ErrUserNotFound", "{", "return", "&", "errors", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusNotFound", ",", "Message", ":", "err", ".", "Error", "(", ")", "}", "\n", "}", "\n", "return", "err", "\n", "}", "\n", "if", "token", "==", "\"", "\"", "{", "return", "managed", ".", "StartPasswordReset", "(", "u", ")", "\n", "}", "\n", "return", "managed", ".", "ResetPassword", "(", "u", ",", "token", ")", "\n", "}" ]
20,682
all-20683
[ "Callback", "is", "a", "factory", "to", "create", "callbacks", "that", "can", "be", "used", "to", "enqueue", "jobs", "during", "request", "processing", "." ]
[ "func", "(", "q", "*", "Queue", ")", "Callback", "(", "name", "string", ",", "delay", "time", ".", "Duration", ",", "matcher", "fire", ".", "Matcher", ",", "cb", "func", "(", "ctx", "*", "fire", ".", "Context", ")", "Model", ")", "*", "fire", ".", "Callback", "{", "return", "fire", ".", "C", "(", "\"", "\"", ",", "matcher", ",", "func", "(", "ctx", "*", "fire", ".", "Context", ")", "error", "{", "// set task tag", "ctx", ".", "Tracer", ".", "<mask>", "(", "\"", "\"", ",", "name", ")", "\n\n", "// get data", "var", "data", "Model", "\n", "if", "cb", "!=", "nil", "{", "data", "=", "cb", "(", "ctx", ")", "\n", "}", "\n\n", "// check if controller uses same store", "if", "q", ".", "store", "==", "ctx", ".", "Controller", ".", "Store", "{", "// enqueue job using context store", "_", ",", "err", ":=", "Enqueue", "(", "ctx", ".", "Store", ",", "name", ",", "data", ",", "delay", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "else", "{", "// enqueue job using queue store", "_", ",", "err", ":=", "q", ".", "Enqueue", "(", "name", ",", "data", ",", "delay", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n\n", "// respond with an empty object", "if", "ctx", ".", "Operation", ".", "Action", "(", ")", "{", "err", ":=", "ctx", ".", "Respond", "(", "fire", ".", "Map", "{", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}", ")", "\n", "}" ]
20,683
all-20684
[ "Header", "indicates", "an", "expected", "call", "of", "Header" ]
[ "func", "(", "mr", "*", "MockResponseWriterMockRecorder", ")", "Header", "(", ")", "*", "gomock", ".", "Call", "{", "return", "mr", ".", "mock", ".", "ctrl", ".", "RecordCallWithMethodType", "(", "mr", ".", "mock", ",", "\"", "\"", ",", "reflect", ".", "TypeOf", "(", "(", "*", "MockResponseWriter", ")", "(", "nil", ")", ".", "<mask>", ")", ")", "\n", "}" ]
20,684
all-20685
[ "availableScsiDisk", "checks", "to", "make", "sure", "that", "a", "disk", "is", "available", "for", "use", "in", "a", "VMFS", "datastore", "and", "returns", "the", "ScsiDisk", "." ]
[ "func", "availableScsiDisk", "(", "dss", "*", "object", ".", "HostDatastoreSystem", ",", "name", "string", ")", "(", "*", "types", ".", "HostScsiDisk", ",", "error", ")", "{", "ctx", ",", "cancel", ":=", "context", ".", "WithTimeout", "(", "context", ".", "Background", "(", ")", ",", "defaultAPITimeout", ")", "\n", "defer", "cancel", "(", ")", "\n", "disks", ",", "err", ":=", "dss", ".", "QueryAvailableDisksForVmfs", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n\n", "var", "disk", "*", "types", ".", "HostScsiDisk", "\n", "for", "_", ",", "d", ":=", "range", "disks", "{", "if", "d", ".", "CanonicalName", "==", "name", "{", "disk", "=", "&", "d", "\n", "<mask>", "\n", "}", "\n", "}", "\n", "if", "disk", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n", "return", "disk", ",", "nil", "\n", "}" ]
20,685
all-20686
[ "LogReq", "is", "like", "log", ".", "Logger", ".", "Log", "()", "but", "it", "assumes", "that", "it", "s", "being", "called", "from", "the", "top", "level", "of", "a", "GRPC", "method", "implementation", "and", "correspondingly", "extracts", "the", "method", "name", "from", "the", "parent", "stack", "frame" ]
[ "func", "(", "a", "*", "apiServer", ")", "LogReq", "(", "request", "interface", "{", "}", ")", "{", "a", ".", "pachLogger", ".", "Log", "(", "<mask>", ",", "nil", ",", "nil", ",", "0", ")", "\n", "}" ]
20,686
all-20687
[ "ChildGetProperty", "is", "a", "wrapper", "around", "gtk_container_child_get_property", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "ChildGetProperty", "(", "child", "IWidget", ",", "name", "string", ",", "valueType", "glib", ".", "Type", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "gv", ",", "e", ":=", "glib", ".", "ValueInit", "(", "valueType", ")", "\n", "if", "e", "!=", "nil", "{", "return", "nil", ",", "e", "\n", "}", "\n", "cstr", ":=", "C", ".", "CString", "(", "name", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n\n", "C", ".", "gtk_container_child_get_property", "(", "v", ".", "native", "(", ")", ",", "child", ".", "toWidget", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ",", "(", "*", "C", ".", "GValue", ")", "(", "unsafe", ".", "Pointer", "(", "gv", ".", "Native", "(", ")", ")", ")", ")", "\n", "return", "gv", ".", "GoValue", "(", ")", "\n", "}" ]
20,687
all-20688
[ "expandClusterHostGroup", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "ClusterHostGroup", "." ]
[ "func", "expandClusterHostGroup", "(", "d", "*", "schema", ".", "ResourceData", ",", "name", "string", ")", "(", "*", "types", ".", "ClusterHostGroup", ",", "error", ")", "{", "obj", ":=", "&", "types", ".", "ClusterHostGroup", "{", "ClusterGroupInfo", ":", "types", ".", "ClusterGroupInfo", "{", "<mask>", ":", "name", ",", "UserCreated", ":", "structure", ".", "BoolPtr", "(", "true", ")", ",", "}", ",", "Host", ":", "structure", ".", "SliceInterfacesToManagedObjectReferences", "(", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "*", "schema", ".", "Set", ")", ".", "List", "(", ")", ",", "\"", "\"", ")", ",", "}", "\n", "return", "obj", ",", "nil", "\n", "}" ]
20,688
all-20689
[ "<ref", "-", "qualifier", ">", "::", "=", "R", "::", "=", "O" ]
[ "func", "(", "st", "*", "state", ")", "refQualifier", "(", ")", "string", "{", "if", "len", "(", "st", ".", "str", ")", ">", "0", "{", "switch", "st", ".", "str", "[", "0", "]", "{", "case", "'R'", ":", "st", ".", "advance", "(", "1", ")", "\n", "return", "\"", "\"", "\n", "<mask>", "'O'", ":", "st", ".", "advance", "(", "1", ")", "\n", "return", "\"", "\"", "\n", "}", "\n", "}", "\n", "return", "\"", "\"", "\n", "}" ]
20,689
all-20690
[ "ClientOAuth", "instantiates", "ClientOAuthAuthentication", "with", "the", "client", "OAuth", "tokens" ]
[ "func", "clientOAuth", "(", "tokens", "*", "oauthTokens", ")", "*", "clientOAuthAuthentication", "{", "a", ":=", "clientOAuthAuthentication", "{", "Tokens", ":", "tokens", ",", "BaseUrl", ":", "config", ".", "BaseUrl", ",", "Client", ":", "http", ".", "<mask>", "{", "Transport", ":", "&", "http", ".", "Transport", "{", "Dial", ":", "dialTimeout", ",", "}", ",", "}", ",", "}", "\n", "return", "&", "a", "\n", "}" ]
20,690
all-20691
[ "GetCustomUnitOk", "returns", "a", "tuple", "with", "the", "CustomUnit", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "g", "*", "GraphDefinition", ")", "GetCustomUnitOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "g", "==", "nil", "||", "g", ".", "CustomUnit", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "g", ".", "CustomUnit", ",", "<mask>", "\n", "}" ]
20,691
all-20692
[ "Veci", "creates", "a", "Vec", "from", "int", "values", "." ]
[ "func", "Veci", "(", "x", ",", "y", "int", ")", "Vec", "{", "<mask>", "Vec", "{", "float64", "(", "x", ")", ",", "float64", "(", "y", ")", "}", "\n", "}" ]
20,692
all-20693
[ "ContainerEvents", "indicates", "an", "expected", "call", "of", "ContainerEvents" ]
[ "func", "(", "mr", "*", "MockDockerClientMockRecorder", ")", "ContainerEvents", "(", "arg0", "<mask>", "{", "}", ")", "*", "gomock", ".", "Call", "{", "return", "mr", ".", "mock", ".", "ctrl", ".", "RecordCallWithMethodType", "(", "mr", ".", "mock", ",", "\"", "\"", ",", "reflect", ".", "TypeOf", "(", "(", "*", "MockDockerClient", ")", "(", "nil", ")", ".", "ContainerEvents", ")", ",", "arg0", ")", "\n", "}" ]
20,693
all-20694
[ "RemoveImage", "removes", "an", "image", "manifest", "from", "a", "remote", "registry", "v2", "server", "returning", "an", "error", "in", "case", "of", "failure", "." ]
[ "func", "RemoveImage", "(", "imageName", "string", ")", "error", "{", "registry", ",", "image", ",", "<mask>", ":=", "parseImage", "(", "imageName", ")", "\n", "if", "registry", "==", "\"", "\"", "{", "registry", ",", "_", "=", "config", ".", "GetString", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "registry", "==", "\"", "\"", "{", "// Nothing to do if no registry is set", "return", "nil", "\n", "}", "\n", "if", "image", "==", "\"", "\"", "{", "return", "errors", ".", "Errorf", "(", "\"", "\"", ",", "imageName", ")", "\n", "}", "\n", "r", ":=", "&", "dockerRegistry", "{", "server", ":", "registry", "}", "\n", "digest", ",", "err", ":=", "r", ".", "getDigest", "(", "image", ",", "tag", ")", "\n", "if", "err", "!=", "nil", "{", "return", "errors", ".", "Wrapf", "(", "err", ",", "\"", "\"", ",", "r", ".", "server", ",", "image", ",", "tag", ")", "\n", "}", "\n", "err", "=", "r", ".", "removeImage", "(", "image", ",", "digest", ")", "\n", "if", "err", "!=", "nil", "{", "return", "errors", ".", "Wrapf", "(", "err", ",", "\"", "\"", ",", "r", ".", "server", ",", "image", ",", "tag", ",", "digest", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
20,694
all-20695
[ "render", "indexed", "primitives", "from", "array", "data", "taking", "parameters", "from", "memory" ]
[ "func", "MultiDrawElementsIndirect", "(", "<mask>", "uint32", ",", "xtype", "uint32", ",", "indirect", "unsafe", ".", "Pointer", ",", "drawcount", "int32", ",", "stride", "int32", ")", "{", "syscall", ".", "Syscall6", "(", "gpMultiDrawElementsIndirect", ",", "5", ",", "uintptr", "(", "mode", ")", ",", "uintptr", "(", "xtype", ")", ",", "uintptr", "(", "indirect", ")", ",", "uintptr", "(", "drawcount", ")", ",", "uintptr", "(", "stride", ")", ",", "0", ")", "\n", "}" ]
20,695
all-20696
[ "Take", "wraps", "a", "unsafe", ".", "Pointer", "as", "a", "glib", ".", "Object", "taking", "ownership", "of", "it", ".", "This", "function", "is", "exported", "for", "visibility", "in", "other", "gotk3", "packages", "and", "is", "not", "meant", "to", "be", "used", "by", "applications", "." ]
[ "func", "Take", "(", "ptr", "unsafe", ".", "Pointer", ")", "*", "Object", "{", "obj", ":=", "newObject", "(", "ToGObject", "(", "ptr", ")", ")", "\n\n", "if", "obj", ".", "IsFloating", "(", ")", "{", "obj", ".", "RefSink", "(", ")", "\n", "}", "else", "{", "obj", ".", "Ref", "(", ")", "\n", "}", "\n\n", "runtime", ".", "SetFinalizer", "(", "obj", ",", "(", "*", "<mask>", ")", ".", "Unref", ")", "\n", "return", "obj", "\n", "}" ]
20,696
all-20697
[ "Claim", "validator" ]
[ "func", "(", "h", "*", "headerRule", ")", "Claim", "(", "r", "*", "http", ".", "<mask>", ")", "bool", "{", "return", "h", ".", "claim", "(", "r", ".", "Header", ".", "Get", ")", "\n", "}" ]
20,697
all-20698
[ "Restores", "a", "specific", "volume", "from", "a", "snapshot", ".", "volumeId", ":", "The", "id", "of", "the", "volume", "snapshotId", ":", "The", "id", "of", "the", "restore", "point" ]
[ "func", "(", "c", "*", "ClientManager", ")", "RestoreFromSnapshot", "(", "volumeId", "int", ",", "snapshotId", "int", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "StorageService", ".", "<mask>", "(", "volumeId", ")", ".", "RestoreFromSnapshot", "(", "sl", ".", "Int", "(", "snapshotId", ")", ")", "\n", "return", "err", "\n", "}" ]
20,698
all-20699
[ "MergeRules", "merges", "a", "list", "of", "generated", "repo", "rules", "with", "the", "already", "defined", "repo", "rules", "and", "then", "updates", "each", "rule", "s", "underlying", "file", ".", "If", "the", "generated", "rule", "matches", "an", "existing", "one", "then", "it", "inherits", "the", "file", "where", "the", "existing", "rule", "was", "defined", ".", "If", "the", "rule", "is", "new", "then", "its", "file", "is", "set", "as", "the", "destFile", "parameter", ".", "A", "list", "of", "the", "updated", "files", "is", "returned", "." ]
[ "func", "MergeRules", "(", "genRules", "[", "]", "*", "rule", ".", "Rule", ",", "existingRules", "map", "[", "*", "rule", ".", "File", "]", "[", "]", "string", ",", "destFile", "*", "rule", ".", "File", ",", "kinds", "map", "[", "string", "]", "rule", ".", "KindInfo", ")", "[", "]", "*", "rule", ".", "File", "{", "sort", ".", "Stable", "(", "byRuleName", "(", "genRules", ")", ")", "\n\n", "repoMap", ":=", "make", "(", "map", "[", "string", "]", "*", "rule", ".", "File", ")", "\n", "for", "file", ",", "repoNames", ":=", "range", "existingRules", "{", "if", "file", ".", "Path", "==", "destFile", ".", "Path", "&&", "file", ".", "MacroName", "(", ")", "!=", "\"", "\"", "&&", "file", ".", "MacroName", "(", ")", "==", "destFile", ".", "MacroName", "(", ")", "{", "file", "=", "destFile", "\n", "}", "\n", "for", "_", ",", "name", ":=", "range", "repoNames", "{", "repoMap", "[", "name", "]", "=", "<mask>", "\n", "}", "\n", "}", "\n\n", "rulesByFile", ":=", "make", "(", "map", "[", "*", "rule", ".", "File", "]", "[", "]", "*", "rule", ".", "Rule", ")", "\n", "for", "_", ",", "rule", ":=", "range", "genRules", "{", "dest", ":=", "destFile", "\n", "if", "file", ",", "ok", ":=", "repoMap", "[", "rule", ".", "Name", "(", ")", "]", ";", "ok", "{", "dest", "=", "file", "\n", "}", "\n", "rulesByFile", "[", "dest", "]", "=", "append", "(", "rulesByFile", "[", "dest", "]", ",", "rule", ")", "\n", "}", "\n\n", "updatedFiles", ":=", "make", "(", "map", "[", "string", "]", "*", "rule", ".", "File", ")", "\n", "for", "f", ",", "rules", ":=", "range", "rulesByFile", "{", "merger", ".", "MergeFile", "(", "f", ",", "nil", ",", "rules", ",", "merger", ".", "PreResolve", ",", "kinds", ")", "\n", "f", ".", "Sync", "(", ")", "\n", "if", "uf", ",", "ok", ":=", "updatedFiles", "[", "f", ".", "Path", "]", ";", "ok", "{", "uf", ".", "SyncMacroFile", "(", "f", ")", "\n", "}", "else", "{", "updatedFiles", "[", "f", ".", "Path", "]", "=", "f", "\n", "}", "\n", "}", "\n", "files", ":=", "make", "(", "[", "]", "*", "rule", ".", "File", ",", "0", ",", "len", "(", "updatedFiles", ")", ")", "\n", "for", "_", ",", "f", ":=", "range", "updatedFiles", "{", "files", "=", "append", "(", "files", ",", "f", ")", "\n", "}", "\n", "return", "files", "\n", "}" ]
20,699
all-20700
[ "GetHeading", "()", "is", "a", "wrapper", "around", "gtk_app_chooser_dialog_get_heading", "()", ".", "In", "case", "when", "gtk_app_chooser_dialog_get_heading", "()", "returns", "a", "nil", "string", "GetHeading", "()", "returns", "a", "non", "-", "nil", "error", "." ]
[ "func", "(", "v", "*", "AppChooserDialog", ")", "GetHeading", "(", ")", "(", "string", ",", "error", ")", "{", "cstr", ":=", "C", ".", "gtk_app_chooser_dialog_get_heading", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "cstr", "==", "nil", "{", "return", "\"", "\"", ",", "nilPtrErr", "\n", "}", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "return", "C", ".", "GoString", "(", "(", "*", "C", ".", "<mask>", ")", "(", "cstr", ")", ")", ",", "nil", "\n", "}" ]