id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
9,000
all-9001
[ "Acquire", "obtains", "an", "additional", "reference", "to", "the", "socket", ".", "The", "socket", "will", "only", "be", "recycled", "when", "it", "s", "released", "as", "many", "times", "as", "it", "s", "been", "acquired", "." ]
[ "func", "(", "socket", "*", "mongoSocket", ")", "Acquire", "(", ")", "(", "info", "*", "mongoServerInfo", ")", "{", "socket", ".", "Lock", "(", ")", "\n", "if", "<mask>", ".", "references", "==", "0", "{", "panic", "(", "\"", "\"", ")", "\n", "}", ...
9,001
all-9002
[ "Apps", "returns", "the", "apps", "collection", "from", "MongoDB", "." ]
[ "func", "(", "s", "*", "Storage", ")", "Apps", "(", ")", "*", "<mask>", ".", "Collection", "{", "nameIndex", ":=", "mgo", ".", "Index", "{", "Key", ":", "[", "]", "string", "{", "\"", "\"", "}", ",", "Unique", ":", "true", "}", "\n", "c", ":=",...
9,002
all-9003
[ "AssuanSend", "sends", "a", "raw", "Assuan", "command", "to", "gpg", "-", "agent" ]
[ "func", "(", "c", "*", "Context", ")", "AssuanSend", "(", "cmd", "string", ",", "data", "AssuanDataCallback", ",", "inquiry", "AssuanInquireCallback", ",", "status", "AssuanStatusCallback", ",", ")", "error", "{", "var", "operr", "C", ".", "gpgme_error_t", "\n...
9,003
all-9004
[ "lexLineComment", "scans", "a", "line", "comment", ".", "Left", "comment", "marker", "is", "known", "to", "be", "present", "." ]
[ "func", "lexLineComment", "(", "l", "*", "lexer", ")", "stateFn", "{", "l", ".", "<mask>", "+=", "Pos", "(", "len", "(", "lineComment", ")", ")", "\n", "for", "r", ":=", "l", ".", "next", "(", ")", ";", "!", "isEndOfLine", "(", "r", ")", "&&", ...
9,004
all-9005
[ "Equals", "compares", "two", "public", "keys" ]
[ "func", "(", "k", "*", "Secp256k1PublicKey", ")", "Equals", "(", "o", "<mask>", ")", "bool", "{", "sk", ",", "ok", ":=", "o", ".", "(", "*", "Secp256k1PublicKey", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n\n", "return", "(",...
9,005
all-9006
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "the", "current", "program", "object" ]
[ "func", "UniformMatrix4fv", "(", "location", "int32", ",", "count", "int32", ",", "transpose", "bool", ",", "value", "*", "float32", ")", "{", "syscall", ".", "Syscall6", "(", "gpUniformMatrix4fv", ",", "4", ",", "uintptr", "(", "<mask>", ")", ",", "uintpt...
9,006
all-9007
[ "Match", "returns", "true", "if", "patterns", "matches", "the", "string" ]
[ "func", "Match", "(", "s", ",", "pattern", "string", ")", "bool", "{", "r", ":=", "regexp", ".", "MustCompile", "(", "<mask>", ")", "\n", "return", "r", ".", "MatchString", "(", "s", ")", "\n", "}" ]
9,007
all-9008
[ "Do", "executes", "Storage", ".", "clearDataForOrigin", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "ClearDataForOriginParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandClearDataForOrigin", ",", "p", ",", "nil", ")", "\n", "}" ...
9,008
all-9009
[ "Start", "the", "server" ]
[ "func", "(", "s", "*", "Listener", ")", "Start", "(", "c", "context", ".", "<mask>", ",", "h", "http", ".", "Handler", ")", "error", "{", "s", ".", "Handler", "=", "h", "\n", "return", "s", ".", "Serve", "(", "s", ".", "Listener", ")", "\n", "}...
9,009
all-9010
[ "HasValue", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "d", "*", "DashboardConditionalFormat", ")", "HasValue", "(", ")", "bool", "{", "if", "d", "!=", "nil", "&&", "d", ".", "Value", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
9,010
all-9011
[ "HasEvent", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "r", "*", "reqGetEvent", ")", "HasEvent", "(", ")", "bool", "{", "if", "r", "!=", "nil", "&&", "r", ".", "<mask>", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
9,011
all-9012
[ "GetRGBA", "()", "is", "a", "wrapper", "around", "gtk_color_chooser_get_rgba", "()", "." ]
[ "func", "(", "v", "*", "ColorChooser", ")", "GetRGBA", "(", ")", "*", "gdk", ".", "RGBA", "{", "gdkColor", ":=", "gdk", ".", "NewRGBA", "(", ")", "\n", "C", ".", "gtk_color_chooser_get_rgba", "(", "v", ".", "native", "(", ")", ",", "(", "*", "C", ...
9,012
all-9013
[ "MutateCreateAccount", "for", "Destination", "sets", "the", "CreateAccountOp", "s", "Destination", "field" ]
[ "func", "(", "m", "Destination", ")", "MutateCreateAccount", "(", "o", "*", "xdr", ".", "CreateAccountOp", ")", "error", "{", "<mask>", "setAccountId", "(", "m", ".", "AddressOrSeed", ",", "&", "o", ".", "Destination", ")", "\n", "}" ]
9,013
all-9014
[ "Info", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockInfoLogger", ")", "Info", "(", "arg0", "...", "interface", "{", "}", ")", "{", "varargs", ":=", "[", "]", "interface", "{", "}", "{", "}", "\n", "for", "_", ",", "a", ":=", "<mask>", "arg0", "{", "varargs", "=", "appen...
9,014
all-9015
[ "Invite", "sends", "an", "invitation", ".", "If", "the", "from", "address", "is", "an", "empty", "string", "the", "default", "(", "yourapp" ]
[ "func", "Invite", "(", "c", "context", ".", "Context", ",", "to", ",", "from", "string", ")", "error", "{", "req", ":=", "&", "<mask>", ".", "XmppInviteRequest", "{", "Jid", ":", "&", "to", ",", "}", "\n", "if", "from", "!=", "\"", "\"", "{", "re...
9,015
all-9016
[ "FillStringAt", "draws", "the", "text", "at", "the", "specified", "point", "(", "x", "y", ")" ]
[ "func", "(", "gc", "*", "GraphicContext", ")", "FillStringAt", "(", "text", "string", ",", "x", ",", "y", "float64", ")", "(", "cursor", "float64", ")", "{", "return", "gc", ".", "drawString", "(", "<mask>", ",", "filled", ",", "x", ",", "y", ")", ...
9,016
all-9017
[ "native", "returns", "a", "pointer", "to", "the", "underlying", "GtkMenuShell", "." ]
[ "func", "(", "v", "*", "MenuShell", ")", "native", "(", ")", "*", "C", ".", "GtkMenuShell", "{", "if", "v", "==", "nil", "||", "v", ".", "GObject", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "p", ":=", "unsafe", ".", "Pointer", "(", "v...
9,017
all-9018
[ "HasDisplayName", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "s", "*", "Series", ")", "HasDisplayName", "(", ")", "bool", "{", "if", "s", "!=", "nil", "&&", "s", ".", "DisplayName", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
9,018
all-9019
[ "handleMetric", ":", "Handler", "for", "/", "metric", "Method", ":", "GET" ]
[ "func", "handleMetric", "(", "r", "*", "ranch", ".", "Ranch", ")", "http", ".", "HandlerFunc", "{", "return", "func", "(", "res", "http", ".", "ResponseWriter", ",", "req", "*", "http", ".", "Request", ")", "{", "logrus", ".", "WithField", "(", "\"", ...
9,019
all-9020
[ "ShowActions", "prints", "all", "known", "actions", "for", "an", "API", "or", "the", "selected", "resource", "if", "any", "." ]
[ "func", "(", "a", "*", "API", ")", "ShowActions", "(", "cmd", ",", "hrefPrefix", "string", ",", "values", "ActionCommands", ")", "error", "{", "res", ",", "_", ",", "err", ":=", "a", ".", "parseResource", "(", "cmd", ",", "hrefPrefix", ",", "values", ...
9,020
all-9021
[ "Parse", "the", "string", "and", "return", "an", "AST", "or", "an", "error" ]
[ "func", "Parse", "(", "s", "string", ")", "(", "*", "ast", ".", "Program", ",", "error", ")", "{", "p", ":=", "newParser", "(", "lexer", ".", "New", "(", "s", ")", ")", "\n", "prog", ":=", "p", ".", "parseProgram", "(", ")", "\n", "if", "len", ...
9,021
all-9022
[ "CompareKeys", "checks", "the", "key", "without", "timestamp", "and", "checks", "the", "timestamp", "if", "keyNoTs", "is", "same", ".", "a<timestamp", ">", "would", "be", "sorted", "higher", "than", "aa<timestamp", ">", "if", "we", "use", "bytes", ".", "comp...
[ "func", "CompareKeys", "(", "key1", ",", "key2", "[", "]", "byte", ")", "int", "{", "AssertTrue", "(", "len", "(", "key1", ")", ">", "8", "&&", "len", "(", "key2", ")", ">", "8", ")", "\n", "if", "cmp", ":=", "<mask>", ".", "Compare", "(", "key...
9,022
all-9023
[ "flattenDatastoreSummary", "reads", "various", "fields", "from", "a", "DatastoreSummary", "into", "the", "passed", "in", "ResourceData", "." ]
[ "func", "flattenDatastoreSummary", "(", "d", "*", "schema", ".", "ResourceData", ",", "obj", "*", "types", ".", "DatastoreSummary", ")", "error", "{", "d", ".", "Set", "(", "\"", "\"", ",", "obj", ".", "Accessible", ")", "\n", "d", ".", "Set", "(", "...
9,023
all-9024
[ "Code", "that", "checks", "whether", "variable", "with", "given", "name", "and", "type", "contains", "a", "blank", "value", "(", "empty", "string", "empty", "array", "or", "empy", "map", ")", ".", "Return", "empty", "string", "if", "type", "of", "variable"...
[ "func", "blankCondition", "(", "name", "string", ",", "t", "gen", ".", "DataType", ")", "(", "blank", "string", ")", "{", "name", "=", "fixReserved", "(", "name", ")", "\n", "switch", "<mask>", ":=", "t", ".", "(", "type", ")", "{", "case", "*", "g...
9,024
all-9025
[ "GetOfferingIncome", "returns", "total", "receipt", "balance", "from", "all", "channels", "of", "offering", "with", "given", "id", "." ]
[ "func", "(", "h", "*", "<mask>", ")", "GetOfferingIncome", "(", "tkn", ",", "offeringID", "string", ")", "(", "*", "uint", ",", "error", ")", "{", "logger", ":=", "h", ".", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ...
9,025
all-9026
[ "StartPipeline", "restarts", "a", "stopped", "pipeline", "." ]
[ "func", "(", "c", "APIClient", ")", "StartPipeline", "(", "name", "string", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "PpsAPIClient", ".", "StartPipeline", "(", "c", ".", "Ctx", "(", ")", ",", "&", "pps", ".", "StartPipelineRequest", "{", "...
9,026
all-9027
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetHighlightObjectForTestReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoOverlay15", ...
9,027
all-9028
[ "DateEntropy", "calculates", "the", "entropy", "provided", "by", "a", "date" ]
[ "func", "DateEntropy", "(", "dateMatch", "<mask>", ".", "DateMatch", ")", "float64", "{", "var", "entropy", "float64", "\n", "if", "dateMatch", ".", "Year", "<", "100", "{", "entropy", "=", "math", ".", "Log2", "(", "numDays", "*", "numMonths", "*", "100...
9,028
all-9029
[ "/", "*", "Keys", "returns", "all", "of", "the", "global", "keys", "in", "the", "config", "." ]
[ "func", "(", "config", "*", "Config", ")", "Keys", "(", ")", "[", "]", "string", "{", "keys", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "config", ".", "values", ")", ")", "\n", "for", "key", ":=", "range", "config", ".",...
9,029
all-9030
[ "temporaryUnapprovedFiles", "returns", "the", "list", "of", "files", "that", "wouldn", "t", "be", "approved", "by", "the", "given", "set", "of", "approvers", "." ]
[ "func", "(", "o", "Owners", ")", "temporaryUnapprovedFiles", "(", "approvers", "sets", ".", "String", ")", "sets", ".", "<mask>", "{", "ap", ":=", "NewApprovers", "(", "o", ")", "\n", "for", "approver", ":=", "range", "approvers", "{", "ap", ".", "AddApp...
9,030
all-9031
[ "fetchMore", "retrieves", "more", "results", "if", "there", "are", "no", "errors", "or", "pending", "results", "." ]
[ "func", "(", "t", "*", "Iterator", ")", "fetchMore", "(", ")", "{", "if", "t", ".", "err", "==", "nil", "&&", "len", "(", "t", ".", "listRes", ")", "+", "len", "(", "t", ".", "searchRes", ")", "==", "0", "&&", "t", ".", "more", "!=", "nil", ...
9,031
all-9032
[ "flattenStorageDrsIoLoadBalanceConfig", "saves", "a", "StorageDrsIoLoadBalanceConfig", "into", "the", "supplied", "ResourceData", "." ]
[ "func", "flattenStorageDrsIoLoadBalanceConfig", "(", "d", "*", "schema", ".", "ResourceData", ",", "obj", "*", "types", ".", "StorageDrsIoLoadBalanceConfig", ",", "version", "viapi", ".", "VSphereVersion", ",", ")", "error", "{", "attrs", ":=", "<mask>", "[", "s...
9,032
all-9033
[ "FullRune", "reports", "whether", "the", "bytes", "in", "p", "begin", "with", "a", "full", "CESU", "-", "8", "encoding", "of", "a", "rune", "." ]
[ "func", "FullRune", "(", "p", "[", "]", "byte", ")", "bool", "{", "high", ",", "n", ",", "short", ":=", "decodeRune", "(", "p", ")", "\n", "if", "<mask>", "{", "return", "false", "\n", "}", "\n", "if", "!", "utf16", ".", "IsSurrogate", "(", "high...
9,033
all-9034
[ "GetParameters", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSSMClient", ")", "GetParameters", "(", "arg0", "*", "ssm", ".", "GetParametersInput", ")", "(", "*", "ssm", ".", "GetParametersOutput", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"...
9,034
all-9035
[ "GetDynamicData", "returns", "the", "dynamic", "data", "with", "provided", "path", "from", "instance", "metadata" ]
[ "func", "(", "c", "*", "ec2MetadataClientImpl", ")", "GetDynamicData", "(", "<mask>", "string", ")", "(", "string", ",", "error", ")", "{", "return", "c", ".", "client", ".", "GetDynamicData", "(", "path", ")", "\n", "}" ]
9,035
all-9036
[ "IsWarning", "implements", "the", "driver", ".", "Error", "interface", "." ]
[ "func", "(", "e", "*", "hdbErrors", ")", "IsWarning", "(", ")", "bool", "{", "return", "e", ".", "<mask>", "[", "e", ".", "idx", "]", ".", "errorLevel", "==", "errorLevelWarning", "\n", "}" ]
9,036
all-9037
[ "WaitPeerListening", "wait", "for", "specified", "peer", "be", "ready", "for", "new", "connections", "." ]
[ "func", "WaitPeerListening", "(", "network", ",", "address", "string", ",", "timeout", "time", ".", "Duration", ")", "bool", "{", "return", "WaitFunc", "(", "100", "*", "time", ".", "Millisecond", ",", "timeout", ",", "func", "(", ")", "bool", "{", "c", ...
9,037
all-9038
[ "SetKeepBelow", "is", "a", "wrapper", "around", "gtk_window_set_keep_below", "()", "." ]
[ "func", "(", "v", "*", "Window", ")", "SetKeepBelow", "(", "setting", "bool", ")", "{", "C", ".", "gtk_window_set_keep_below", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "<mask>", ")", ")", "\n", "}" ]
9,038
all-9039
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniformMatrix2x4fv", "(", "program", "uint32", ",", "location", "int32", ",", "count", "int32", ",", "transpose", "bool", ",", "value", "*", "float32", ")", "{", "C", ".", "glowProgramUniformMatrix2x4fv", "(", "gpProgramUniformMatrix2x4fv", ",", "(...
9,039
all-9040
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "StopObservingParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice", "("...
9,040
all-9041
[ "Validate", "implements", "the", "coal", ".", "ValidatableModel", "interface", "." ]
[ "func", "(", "u", "*", "User", ")", "Validate", "(", ")", "error", "{", "// hash password if available", "err", ":=", "u", ".", "HashPassword", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// check id", "if", "!",...
9,041
all-9042
[ "native", "returns", "a", "pointer", "to", "the", "underlying", "GtkMisc", "." ]
[ "func", "(", "v", "*", "Misc", ")", "native", "(", ")", "*", "C", ".", "GtkMisc", "{", "if", "v", "==", "nil", "||", "v", ".", "GObject", "==", "nil", "{", "<mask>", "nil", "\n", "}", "\n", "p", ":=", "unsafe", ".", "Pointer", "(", "v", ".", ...
9,042
all-9043
[ "ParseBytes", "parses", "the", "given", "b", "containing", "query", "args", "." ]
[ "func", "(", "a", "*", "Args", ")", "ParseBytes", "(", "b", "[", "]", "byte", ")", "{", "a", ".", "Reset", "(", ")", "\n\n", "var", "s", "argsScanner", "\n", "s", ".", "b", "=", "b", "\n\n", "<mask>", "kv", "*", "argsKV", "\n", "a", ".", "arg...
9,043
all-9044
[ "Max", "returns", "the", "highest", "value", "in", "the", "range" ]
[ "func", "(", "r", "*", "InclusiveRange", ")", "Max", "(", ")", "int", "{", "start", ":=", "r", ".", "Start", "(", ")", "\n", "end", ":=", "r", ".", "End", "(", ")", "\n", "if", "<mask>", ">", "end", "{", "return", "start", "\n", "}", "\n", "r...
9,044
all-9045
[ "Null", "verifies", "the", "contents", "of", "bytes", "provided", "is", "a", "null", "starting", "as", "pos" ]
[ "func", "Null", "(", "in", "[", "]", "byte", ",", "pos", "int", ")", "(", "int", ",", "error", ")", "{", "switch", "in", "[", "pos", "]", "{", "case", "'n'", ":", "return", "expect", "(", "in", ",", "pos", ",", "n", "...", ")", "\n", "return"...
9,045
all-9046
[ "GetCreatedAt", "sets", "the", "timestamp", "for", "resource", "s", "creation", "time" ]
[ "func", "(", "<mask>", "*", "SSMSecretResource", ")", "GetCreatedAt", "(", ")", "time", ".", "Time", "{", "secret", ".", "lock", ".", "RLock", "(", ")", "\n", "defer", "secret", ".", "lock", ".", "RUnlock", "(", ")", "\n\n", "return", "secret", ".", ...
9,046
all-9047
[ "JsonnetVM", "constructs", "a", "new", "jsonnet", ".", "VM", "according", "to", "command", "line", "flags" ]
[ "func", "JsonnetVM", "(", "cmd", "*", "cobra", ".", "Command", ")", "(", "*", "jsonnet", ".", "VM", ",", "error", ")", "{", "vm", ":=", "jsonnet", ".", "MakeVM", "(", ")", "\n", "flags", ":=", "cmd", ".", "Flags", "(", ")", "\n\n", "var", "search...
9,047
all-9048
[ "Embedded", "returns", "a", "Document", "based", "on", "embedded", "specs", ".", "No", "analysis", "is", "required" ]
[ "func", "Embedded", "(", "orig", ",", "flat", "json", ".", "RawMessage", ")", "(", "*", "<mask>", ",", "error", ")", "{", "var", "origSpec", ",", "flatSpec", "spec", ".", "Swagger", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "orig", ",",...
9,048
all-9049
[ "GetCompareTo", "returns", "the", "CompareTo", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "g", "*", "GraphDefinitionRequest", ")", "GetCompareTo", "(", ")", "string", "{", "if", "g", "==", "nil", "||", "g", ".", "CompareTo", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "<mask>", "*", "g", ".", "CompareTo", "\n", ...
9,049
all-9050
[ "Expected", "will", "return", "the", "expected", "resource", "group", "as", "it", "would", "be", "defined", "in", "Azure" ]
[ "func", "(", "r", "*", "ResourceGroup", ")", "Expected", "(", "immutable", "*", "cluster", ".", "Cluster", ")", "(", "*", "cluster", ".", "Cluster", ",", "cloud", ".", "Resource", ",", "error", ")", "{", "logger", ".", "Debug", "(", "\"", "\"", ")", ...
9,050
all-9051
[ "updateBool", "will", "return", "true", "and", "set", "have", "to", "want", "iff", "they", "are", "set", "and", "different", "." ]
[ "func", "updateBool", "(", "have", ",", "want", "*", "bool", ")", "bool", "{", "<mask>", "{", "case", "have", "==", "nil", ":", "panic", "(", "\"", "\"", ")", "\n", "case", "want", "==", "nil", ":", "return", "false", "// do not care what we have", "\n...
9,051
all-9052
[ "HasQuery", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "e", "*", "EventStreamDefinition", ")", "HasQuery", "(", ")", "bool", "{", "if", "e", "!=", "nil", "&&", "e", ".", "Query", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
9,052
all-9053
[ "FormFile", "returns", "uploaded", "file", "associated", "with", "the", "given", "multipart", "form", "key", ".", "The", "file", "is", "automatically", "deleted", "after", "returning", "from", "RequestHandler", "so", "either", "move", "or", "copy", "uploaded", "...
[ "func", "(", "ctx", "*", "RequestCtx", ")", "FormFile", "(", "<mask>", "string", ")", "(", "*", "multipart", ".", "FileHeader", ",", "error", ")", "{", "mf", ",", "err", ":=", "ctx", ".", "MultipartForm", "(", ")", "\n", "if", "err", "!=", "nil", "...
9,053
all-9054
[ "IsNotExist", "will", "return", "true", "if", "the", "error", "is", "because", "the", "object", "does", "not", "exist", "." ]
[ "func", "IsNotExist", "(", "err", "error", ")", "bool", "{", "return", "os", ".", "IsNotExist", "(", "err", ")", "||", "err", "==", "<mask>", ".", "ErrObjectNotExist", "\n", "}" ]
9,054
all-9055
[ "GetMonitorOk", "returns", "a", "tuple", "with", "the", "Monitor", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "Widget", ")", "GetMonitorOk", "(", ")", "(", "ScreenboardMonitor", ",", "bool", ")", "{", "if", "w", "==", "nil", "||", "w", ".", "Monitor", "==", "nil", "{", "return", "ScreenboardMonitor", "{", "}", ",", "<mask>", "\n", "}",...
9,055
all-9056
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventReceivedMessageFromTarget", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget17", "...
9,056
all-9057
[ "Dial", "calls", "net", ".", "Dial", "on", "the", "address", "." ]
[ "func", "(", "na", "*", "NetAddress", ")", "Dial", "(", ")", "(", "net", ".", "Conn", ",", "error", ")", "{", "conn", ",", "err", ":=", "net", ".", "Dial", "(", "\"", "\"", ",", "na", ".", "String", "(", ")", ")", "\n", "if", "err", "!=", "...
9,057
all-9058
[ "GetItemIndex", "is", "a", "wrapper", "around", "gtk_toolbar_get_item_index", "()", "." ]
[ "func", "(", "v", "*", "Toolbar", ")", "GetItemIndex", "(", "item", "IToolItem", ")", "int", "{", "c", ":=", "C", ".", "gtk_toolbar_get_item_index", "(", "v", ".", "native", "(", ")", ",", "<mask>", ".", "toToolItem", "(", ")", ")", "\n", "return", "...
9,058
all-9059
[ "revertToManifest", "checks", "that", "all", "necessary", "table", "files", "exist", "and", "removes", "all", "table", "files", "not", "referenced", "by", "the", "manifest", ".", "idMap", "is", "a", "set", "of", "table", "file", "id", "s", "that", "were", ...
[ "func", "revertToManifest", "(", "kv", "*", "DB", ",", "mf", "*", "Manifest", ",", "idMap", "<mask>", "[", "uint64", "]", "struct", "{", "}", ")", "error", "{", "// 1. Check all files in manifest exist.", "for", "id", ":=", "range", "mf", ".", "Tables", "{...
9,059
all-9060
[ "Using", "the", "classic", "API", "posts", "a", "value", "to", "a", "stat", "at", "a", "specific", "time", "using", "DefaultReporter", "." ]
[ "func", "PostValueTime", "(", "statKey", ",", "userKey", "string", ",", "<mask>", "float64", ",", "timestamp", "int64", ")", "error", "{", "return", "DefaultReporter", ".", "PostValueTime", "(", "statKey", ",", "userKey", ",", "value", ",", "timestamp", ")", ...
9,060
all-9061
[ "Returns", "a", "parameter", "from", "a", "program", "object" ]
[ "func", "GetProgramiv", "(", "<mask>", "uint32", ",", "pname", "uint32", ",", "params", "*", "int32", ")", "{", "C", ".", "glowGetProgramiv", "(", "gpGetProgramiv", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "C", ".", "GLenum", ...
9,061
all-9062
[ "GetFile", "returns", "information", "about", "user", "upload", "file", "by", "given", "form", "field", "name", "." ]
[ "func", "(", "ctx", "*", "Context", ")", "GetFile", "(", "name", "string", ")", "(", "multipart", ".", "<mask>", ",", "*", "multipart", ".", "FileHeader", ",", "error", ")", "{", "return", "ctx", ".", "Req", ".", "FormFile", "(", "name", ")", "\n", ...
9,062
all-9063
[ "MultipartFormBoundary", "returns", "boundary", "part", "from", "multipart", "/", "form", "-", "data", ";", "boundary", "=", "...", "Content", "-", "Type", "." ]
[ "func", "(", "h", "*", "RequestHeader", ")", "MultipartFormBoundary", "(", ")", "[", "]", "byte", "{", "b", ":=", "h", ".", "ContentType", "(", ")", "\n", "if", "!", "bytes", ".", "HasPrefix", "(", "b", ",", "strMultipartFormData", ")", "{", "return", ...
9,063
all-9064
[ "UnmarshalText", "returns", "an", "error", "if", "text", "!", "=", "secret", "or", "closed" ]
[ "func", "(", "p", "*", "Privacy", ")", "UnmarshalText", "(", "text", "[", "]", "byte", ")", "error", "{", "v", ":=", "Privacy", "(", "text", ")", "\n", "if", "_", ",", "ok", ":=", "privacySettings", "[", "v", "]", ";", "!", "<mask>", "{", "return...
9,064
all-9065
[ "Message", "returns", "version", "with", "format", "version", "(", "first", "seven", "characters", "of", "commit", "hash", ")", "." ]
[ "func", "<mask>", "(", "commit", ",", "version", "string", ")", "string", "{", "var", "c", "string", "\n", "var", "v", "string", "\n\n", "if", "commit", "==", "\"", "\"", "{", "c", "=", "undefined", "\n", "}", "else", "if", "len", "(", "commit", ")...
9,065
all-9066
[ "RenameProfile", "renames", "an", "existing", "profile", "entry" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "RenameProfile", "(", "name", "string", ",", "<mask>", "api", ".", "ProfilePost", ")", "error", "{", "// Send the request", "_", ",", "_", ",", "err", ":=", "r", ".", "query", "(", "\"", "\"", ",", "fmt", "....
9,066
all-9067
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventChildNodeInserted", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom64", "(", "&", ...
9,067
all-9068
[ "FailRequest", "causes", "the", "request", "to", "fail", "with", "specified", "reason", ".", "See", ":", "https", ":", "//", "chromedevtools", ".", "github", ".", "io", "/", "devtools", "-", "protocol", "/", "tot", "/", "Fetch#method", "-", "failRequest", ...
[ "func", "FailRequest", "(", "requestID", "RequestID", ",", "errorReason", "<mask>", ".", "ErrorReason", ")", "*", "FailRequestParams", "{", "return", "&", "FailRequestParams", "{", "RequestID", ":", "requestID", ",", "ErrorReason", ":", "errorReason", ",", "}", ...
9,068
all-9069
[ "HasStatsdInterval", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "m", "*", "MetricMetadata", ")", "HasStatsdInterval", "(", ")", "bool", "{", "if", "m", "!=", "nil", "&&", "m", ".", "StatsdInterval", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
9,069
all-9070
[ "ReadFromResource", "reads", "the", "custom", "attributes", "from", "an", "object", "and", "saves", "the", "data", "into", "the", "supplied", "ResourceData", ".", "TODO", ":", "Add", "error", "handling", "and", "reporting", "to", "this", "method", "." ]
[ "func", "ReadFromResource", "(", "client", "*", "govmomi", ".", "Client", ",", "entity", "*", "mo", ".", "ManagedEntity", ",", "d", "*", "schema", ".", "ResourceData", ")", "{", "customAttrs", ":=", "make", "(", "map", "[", "string", "]", "interface", "{...
9,070
all-9071
[ "Copy", "returns", "a", "copy", "of", "the", "TypeToResources" ]
[ "func", "(", "t", "TypeToResources", ")", "Copy", "(", ")", "TypeToResources", "{", "n", ":=", "TypeToResources", "{", "}", "\n", "for", "k", ",", "v", ":=", "<mask>", "t", "{", "n", "[", "k", "]", "=", "v", "\n", "}", "\n", "return", "n", "\n", ...
9,071
all-9072
[ "explain", "prints", "a", "brief", "description", "of", "all", "the", "subcommands", "and", "the", "important", "top", "-", "level", "flags", "." ]
[ "func", "(", "cdr", "*", "Commander", ")", "explain", "(", "w", "io", ".", "Writer", ")", "{", "fmt", ".", "Fprintf", "(", "w", ",", "\"", "\\n", "\\n", "\"", ",", "cdr", ".", "name", ")", "\n", "sort", ".", "Sort", "(", "byGroupName", "(", "cd...
9,072
all-9073
[ "Do", "executes", "Input", ".", "dispatchTouchEvent", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "DispatchTouchEventParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandDispatchTouchEvent", ",", "p", ",", "nil", ")", "\n", "}" ...
9,073
all-9074
[ "GetStart", "returns", "the", "Start", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "p", "*", "Params", ")", "GetStart", "(", ")", "<mask>", "{", "if", "p", "==", "nil", "||", "p", ".", "Start", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "p", ".", "Start", "\n", "}" ]
9,074
all-9075
[ "Contains", "returns", "boolean", "indicating", "whether", "given", "ip", "is", "contained", "in", "any", "of", "the", "inserted", "networks", "." ]
[ "func", "(", "p", "*", "prefixTrie", ")", "Contains", "(", "<mask>", "net", ".", "IP", ")", "(", "bool", ",", "error", ")", "{", "nn", ":=", "rnet", ".", "NewNetworkNumber", "(", "ip", ")", "\n", "if", "nn", "==", "nil", "{", "return", "false", "...
9,075
all-9076
[ "AppendChild", "appends", "a", "child", "to", "the", "BasicEntity" ]
[ "func", "(", "e", "*", "BasicEntity", ")", "AppendChild", "(", "child", "*", "BasicEntity", ")", "{", "child", ".", "parent", "=", "e", "\n", "e", ".", "children", "=", "<mask>", "(", "e", ".", "children", ",", "*", "child", ")", "\n", "}" ]
9,076
all-9077
[ "TODO", "(", "c4milo", ")", ":", "Legacy", "function", "this", "is", "to", "be", "removed", "once", "we", "migrate", "the", "dependant", "code" ]
[ "func", "writeVmx", "(", "path", "string", ",", "vmx", "map", "[", "string", "]", "string", ")", "error", "{", "f", ",", "err", ":=", "os", ".", "Create", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", ...
9,077
all-9078
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "MediaQueryExpression", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss29", "(", "&", ...
9,078
all-9079
[ "GetPresence", "retrieves", "a", "user", "s", "presence", ".", "If", "the", "from", "address", "is", "an", "empty", "string", "the", "default", "(", "yourapp" ]
[ "func", "GetPresence", "(", "c", "context", ".", "Context", ",", "to", "string", ",", "from", "string", ")", "(", "string", ",", "error", ")", "{", "req", ":=", "&", "pb", ".", "PresenceRequest", "{", "Jid", ":", "&", "to", ",", "}", "\n", "if", ...
9,079
all-9080
[ "ReleaseBuffer", "returns", "a", "buffer", "to", "the", "pool", "to", "be", "re", "-", "used", "." ]
[ "func", "ReleaseBuffer", "(", "buf", "*", "<mask>", ".", "Buffer", ")", "{", "if", "buf", "!=", "nil", "{", "buf", ".", "Reset", "(", ")", "\n", "bufferPool", ".", "Put", "(", "buf", ")", "\n", "}", "\n", "}" ]
9,080
all-9081
[ "HasQuery", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "a", "*", "ApmOrLogQuerySearch", ")", "HasQuery", "(", ")", "bool", "{", "if", "a", "!=", "nil", "&&", "a", ".", "Query", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
9,081
all-9082
[ "InsertColumn", "()", "is", "a", "wrapper", "around", "gtk_grid_insert_column", "()", "." ]
[ "func", "(", "v", "*", "Grid", ")", "InsertColumn", "(", "position", "int", ")", "{", "C", ".", "gtk_grid_insert_column", "(", "v", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "<mask>", ")", ")", "\n", "}" ]
9,082
all-9083
[ "Internal", "helper", "to", "calculate", "new", "commitIndex", "from", "matchIndexes", ".", "Must", "be", "called", "with", "lock", "held", "." ]
[ "func", "(", "c", "*", "commitment", ")", "recalculate", "(", ")", "{", "if", "len", "(", "c", ".", "matchIndexes", ")", "==", "0", "{", "return", "\n", "}", "\n\n", "matched", ":=", "<mask>", "(", "[", "]", "uint64", ",", "0", ",", "len", "(", ...
9,083
all-9084
[ "LongestPrefix", "is", "like", "Get", "but", "instead", "of", "an", "exact", "match", "it", "will", "return", "the", "longest", "prefix", "match", "." ]
[ "func", "(", "t", "*", "Tree", ")", "LongestPrefix", "(", "s", "string", ")", "(", "string", ",", "interface", "{", "}", ",", "bool", ")", "{", "var", "last", "*", "leafNode", "\n", "n", ":=", "t", ".", "root", "\n", "search", ":=", "s", "\n", ...
9,084
all-9085
[ "Helper", "methods", "used", "by", "the", "application", "to", "get", "the", "request", "-", "scoped", "logger", "entry", "and", "set", "additional", "fields", "between", "handlers", ".", "This", "is", "a", "useful", "pattern", "to", "use", "to", "set", "s...
[ "func", "GetLogEntry", "(", "r", "*", "<mask>", ".", "Request", ")", "logrus", ".", "FieldLogger", "{", "entry", ":=", "middleware", ".", "GetLogEntry", "(", "r", ")", ".", "(", "*", "StructuredLoggerEntry", ")", "\n", "return", "entry", ".", "Logger", "...
9,085
all-9086
[ "Success", "outputs", "Success", "level", "log" ]
[ "func", "Success", "(", "val", "...", "interface", "{", "}", ")", "error", "{", "return", "glg", ".", "<mask>", "(", "OK", ",", "blankFormat", "(", "len", "(", "val", ")", ")", ",", "val", "...", ")", "\n", "}" ]
9,086
all-9087
[ "ServeHTTP", "logs", "the", "request", "and", "response", "data", "to", "Common", "Log", "Format" ]
[ "func", "(", "lh", "*", "commonLogHandler", ")", "ServeHTTP", "(", "w", "http", ".", "ResponseWriter", ",", "req", "*", "http", ".", "Request", ")", "{", "// take a copy of the request (so it's immutable)", "// watch the writer and capture the status and size", "logData",...
9,087
all-9088
[ "popRandom", "randomly", "selects", "an", "element", "of", "set", "and", "pops", "it", "." ]
[ "func", "popRandom", "(", "set", "sets", ".", "String", ")", "string", "{", "list", ":=", "set", ".", "<mask>", "(", ")", "\n", "sort", ".", "Strings", "(", "list", ")", "\n", "sel", ":=", "list", "[", "rand", ".", "Intn", "(", "len", "(", "list"...
9,088
all-9089
[ "ActivateCmd", "returns", "a", "cobra", ".", "Command", "to", "activate", "Pachyderm", "s", "auth", "system" ]
[ "func", "ActivateCmd", "(", "noMetrics", ",", "noPortForwarding", "*", "bool", ")", "*", "cobra", ".", "Command", "{", "var", "initialAdmin", "string", "\n", "activate", ":=", "&", "cobra", ".", "Command", "{", "Short", ":", "\"", "\"", ",", "Long", ":",...
9,089
all-9090
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetAppManifestReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage42", "(", "&", ...
9,090
all-9091
[ "linkGRs", "links", "two", "goroutines", "together", "allowing", "the", "child", "to", "access", "the", "data", "present", "in", "the", "parent", "." ]
[ "func", "linkGRs", "(", "parentData", "Values", ")", "{", "childID", ":=", "curGoroutineID", "(", ")", "\n", "dataLock", ".", "Lock", "(", ")", "\n", "<mask>", "[", "childID", "]", "=", "parentData", "\n", "dataLock", ".", "Unlock", "(", ")", "\n", "}"...
9,091
all-9092
[ "expandVirtualMachineConfigSpec", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "VirtualMachineConfigSpec", "." ]
[ "func", "expandVirtualMachineConfigSpec", "(", "d", "*", "schema", ".", "ResourceData", ",", "client", "*", "govmomi", ".", "Client", ")", "(", "<mask>", ".", "VirtualMachineConfigSpec", ",", "error", ")", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "...
9,092
all-9093
[ "Any", "tests", "an", "Enumerable", "to", "see", "if", "there", "are", "any", "elements", "present", "." ]
[ "func", "Any", "(", "iterator", "Enumerable", ")", "bool", "{", "done", ":=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "defer", "close", "(", "done", ")", "\n\n", "for", "range", "iterator", ".", "Enumerate", "(", "done", ")", "{", "return...
9,093
all-9094
[ "Permission", "returns", "the", "needed", "RBAC", "permission", "to", "cancel", "the", "oepration" ]
[ "func", "(", "t", "OperationType", ")", "Permission", "(", ")", "string", "{", "switch", "t", "{", "case", "OperationBackupCreate", ":", "return", "\"", "\"", "\n", "case", "OperationBackupRename", ":", "return", "\"", "\"", "\n", "case", "OperationBackupResto...
9,094
all-9095
[ "OpenExistingFile", "opens", "an", "existing", "file", "errors", "if", "it", "doesn", "t", "exist", "." ]
[ "func", "OpenExistingFile", "(", "filename", "string", ",", "<mask>", "uint32", ")", "(", "*", "os", ".", "File", ",", "error", ")", "{", "openFlags", ":=", "os", ".", "O_RDWR", "\n", "if", "flags", "&", "ReadOnly", "!=", "0", "{", "openFlags", "=", ...
9,095
all-9096
[ "file", "path", "helper" ]
[ "func", "ensureDir", "(", "dir", "string", ")", "error", "{", "if", "exists", "(", "dir", ")", "{", "return", "nil", "\n", "}", "\n", "return", "os", ".", "MkdirAll", "(", "dir", ",", "<mask>", ".", "FileMode", "(", "0744", ")", ")", "\n", "}" ]
9,096
all-9097
[ "SetPullCredentials", "sets", "the", "credentials", "to", "pull", "from", "ECR", "in", "the", "auth" ]
[ "func", "(", "auth", "*", "ECRAuthData", ")", "SetPullCredentials", "(", "creds", "credentials", ".", "IAMRoleCredentials", ")", "{", "auth", ".", "<mask>", ".", "Lock", "(", ")", "\n", "defer", "auth", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "auth...
9,097
all-9098
[ "ReadFrame", "reads", "a", "frame", "from", "the", "buffer", "input", "r", "returning", "it", "or", "an", "error", "if", "something", "went", "wrong", ".", "if", "frame", "err", ":", "=", "ReadFrame", "(", "r", ")", ";", "err", "!", "=", "nil", "{", ...
[ "func", "ReadFrame", "(", "r", "*", "bufio", ".", "Reader", ")", "(", "frame", "Frame", ",", "err", "error", ")", "{", "var", "size", "int32", "\n", "var", "ftype", "int32", "\n\n", "if", "err", "=", "binary", ".", "Read", "(", "r", ",", "binary", ...
9,098
all-9099
[ "flattenHostNasVolume", "reads", "various", "fields", "from", "a", "HostNasVolume", "into", "the", "passed", "in", "ResourceData", ".", "Note", "the", "name", "attribute", "is", "not", "set", "here", "bur", "rather", "set", "in", "flattenDatastoreSummary", "and", ...
[ "func", "flattenHostNasVolume", "(", "d", "*", "schema", ".", "ResourceData", ",", "obj", "*", "types", ".", "HostNasVolume", ")", "error", "{", "d", ".", "Set", "(", "\"", "\"", ",", "obj", ".", "RemotePath", ")", "\n", "d", ".", "<mask>", "(", "\""...
9,099
all-9100
[ "SetShowCloseButton", "is", "a", "wrapper", "around", "gtk_header_bar_set_show_close_button", "()", "." ]
[ "func", "(", "v", "*", "HeaderBar", ")", "SetShowCloseButton", "(", "<mask>", "bool", ")", "{", "C", ".", "gtk_header_bar_set_show_close_button", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "setting", ")", ")", "\n", "}" ]