id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
1,800
all-1801
[ "Detaches", "a", "shader", "object", "from", "a", "program", "object", "to", "which", "it", "is", "attached" ]
[ "func", "DetachShader", "(", "<mask>", "uint32", ",", "shader", "uint32", ")", "{", "C", ".", "glowDetachShader", "(", "gpDetachShader", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "C", ".", "GLuint", ")", "(", "shader", ")", ")...
1,801
all-1802
[ "SetUInt", "is", "a", "wrapper", "around", "g_settings_set_uint", "()", "." ]
[ "func", "(", "v", "*", "Settings", ")", "SetUInt", "(", "name", "string", ",", "value", "uint", ")", "bool", "{", "cstr1", ":=", "(", "*", "C", ".", "gchar", ")", "(", "C", ".", "CString", "(", "name", ")", ")", "\n", "defer", "C", ".", "free",...
1,802
all-1803
[ "WithApp", "adds", "the", "app", "to", "the", "post", "apps", "app", "routes", "params" ]
[ "func", "(", "o", "*", "PostAppsAppRoutesParams", ")", "WithApp", "(", "app", "<mask>", ")", "*", "PostAppsAppRoutesParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
1,803
all-1804
[ "sortBuilds", "converts", "all", "build", "from", "str", "to", "int", "and", "sorts", "all", "builds", "in", "descending", "order", "and", "returns", "the", "sorted", "slice" ]
[ "func", "sortBuilds", "(", "strBuilds", "[", "]", "string", ")", "[", "]", "int", "{", "var", "res", "[", "]", "int", "\n", "for", "_", ",", "buildStr", ":=", "<mask>", "strBuilds", "{", "num", ",", "err", ":=", "strconv", ".", "Atoi", "(", "buildS...
1,804
all-1805
[ "Parse", "creates", "an", "AST", "tree", "for", "XPath", "expressions", "." ]
[ "func", "Parse", "(", "xp", "string", ")", "(", "*", "Node", ",", "error", ")", "{", "var", "err", "error", "\n", "c", ":=", "lexer", ".", "Lex", "(", "xp", ")", "\n", "n", ":=", "&", "Node", "{", "}", "\n", "p", ":=", "&", "parseStack", "{",...
1,805
all-1806
[ "ReadObject", "implements", "ObjectStream", "." ]
[ "func", "(", "t", "*", "bufferedObjectStream", ")", "ReadObject", "(", "v", "<mask>", "{", "}", ")", "error", "{", "return", "t", ".", "codec", ".", "ReadObject", "(", "t", ".", "r", ",", "v", ")", "\n", "}" ]
1,806
all-1807
[ "IsEquivalent", "returns", "true", "if", "other", "represents", "the", "same", "data", "type", "as", "the", "target", "." ]
[ "func", "(", "e", "*", "SourceUploadDataType", ")", "IsEquivalent", "(", "other", "DataType", ")", "bool", "{", "_", ",", "ok", ":=", "other", ".", "(", "*", "SourceUploadDataType", ")", "\n", "return", "<mask>", "\n", "}" ]
1,807
all-1808
[ "UpdatePassword", "updates", "the", "password", "." ]
[ "func", "(", "h", "*", "Handler", ")", "UpdatePassword", "(", "current", ",", "new", "string", ")", "error", "{", "logger", ":=", "h", ".", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "\n\n", "if", "err", ":=", "h", ".", "checkPa...
1,808
all-1809
[ "Fetch", "returns", "a", "peer", "matching", "the", "passed", "name", "without", "incrementing", "its", "refcount", ".", "If", "no", "matching", "peer", "is", "found", "Fetch", "returns", "nil", "." ]
[ "func", "(", "peers", "*", "Peers", ")", "Fetch", "(", "<mask>", "PeerName", ")", "*", "Peer", "{", "peers", ".", "RLock", "(", ")", "\n", "defer", "peers", ".", "RUnlock", "(", ")", "\n", "return", "peers", ".", "byName", "[", "name", "]", "\n", ...
1,809
all-1810
[ "GetTime", "returns", "the", "current", "Time", "(", "100s", "of", "nanoseconds", "since", "15", "Oct", "1582", ")", "and", "adjusts", "the", "clock", "sequence", "as", "needed", ".", "An", "error", "is", "returned", "if", "the", "current", "time", "cannot...
[ "func", "GetTime", "(", ")", "(", "Time", ",", "error", ")", "{", "t", ":=", "timeNow", "(", ")", "\n\n", "// If we don't have a clock sequence already, set one.", "if", "clock_seq", "==", "0", "{", "SetClockSequence", "(", "-", "1", ")", "\n", "}", "\n", ...
1,810
all-1811
[ "GetCorsInfo", "derives", "CorsInfo", "from", "Request", "." ]
[ "func", "(", "r", "*", "Request", ")", "GetCorsInfo", "(", ")", "*", "CorsInfo", "{", "origin", ":=", "r", ".", "Header", ".", "Get", "(", "\"", "\"", ")", "\n\n", "var", "originUrl", "*", "url", ".", "URL", "\n", "var", "isCors", "bool", "\n\n", ...
1,811
all-1812
[ "HTTPPostForm", "performs", "a", "HTTP", "POST", "request", "with", "data", "as", "application", "/", "x", "-", "www", "-", "form", "-", "urlencoded" ]
[ "func", "HTTPPostForm", "(", "url", "string", ",", "data", "url", ".", "Values", ")", "(", "statusCode", "int", ",", "statusText", "string", ",", "err", "error", ")", "{", "request", ",", "err", ":=", "http", ".", "NewRequest", "(", "\"", "\"", ",", ...
1,812
all-1813
[ "String", "implements", "the", "Stringer", "interface" ]
[ "func", "(", "n", "ImageName", ")", "String", "(", ")", "string", "{", "buf", ":=", "bytes", ".", "Buffer", "{", "}", "\n", "if", "n", ".", "Registry", "!=", "\"", "\"", "{", "buf", ".", "WriteString", "(", "n", ".", "Registry", ")", "\n", "buf",...
1,813
all-1814
[ "Records", "returns", "the", "list", "of", "records", "in", "a", "given", "hosted", "zone", "." ]
[ "func", "(", "p", "*", "OCIProvider", ")", "Records", "(", ")", "(", "[", "]", "*", "endpoint", ".", "Endpoint", ",", "error", ")", "{", "ctx", ":=", "context", ".", "Background", "(", ")", "\n", "zones", ",", "err", ":=", "p", ".", "zones", "(",...
1,814
all-1815
[ "Head", "is", "a", "shortcut", "method", "that", "instantiates", "a", "HEAD", "route", ".", "See", "the", "Route", "object", "the", "parameters", "definitions", ".", "Equivalent", "to", "&Route", "{", "HEAD", "pathExp", "handlerFunc", "}" ]
[ "func", "Head", "(", "pathExp", "string", ",", "handlerFunc", "HandlerFunc", ")", "*", "<mask>", "{", "return", "&", "Route", "{", "HttpMethod", ":", "\"", "\"", ",", "PathExp", ":", "pathExp", ",", "Func", ":", "handlerFunc", ",", "}", "\n", "}" ]
1,815
all-1816
[ "establish", "the", "data", "storage", "format", "dimensions", "and", "number", "of", "samples", "of", "a", "multisample", "texture", "s", "image" ]
[ "func", "TexImage3DMultisample", "(", "target", "uint32", ",", "samples", "int32", ",", "internalformat", "uint32", ",", "width", "int32", ",", "height", "int32", ",", "<mask>", "int32", ",", "fixedsamplelocations", "bool", ")", "{", "C", ".", "glowTexImage3DMul...
1,816
all-1817
[ "ApplicationGetDefault", "is", "a", "wrapper", "around", "g_application_get_default", "()", "." ]
[ "func", "ApplicationGetDefault", "(", ")", "*", "<mask>", "{", "c", ":=", "C", ".", "g_application_get_default", "(", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "wrapApplication", "(", "wrapObject", "(", "unsafe", ...
1,817
all-1818
[ "EdgeDriver", "returns", "an", "instance", "of", "a", "EdgeDriver", "WebDriver", ".", "Provided", "Options", "will", "apply", "as", "default", "arguments", "for", "new", "pages", ".", "New", "pages", "will", "accept", "invalid", "SSL", "certificates", "by", "d...
[ "func", "EdgeDriver", "(", "options", "...", "Option", ")", "*", "WebDriver", "{", "<mask>", "binaryName", "string", "\n", "if", "runtime", ".", "GOOS", "==", "\"", "\"", "{", "binaryName", "=", "\"", "\"", "\n", "}", "else", "{", "return", "nil", "\n"...
1,818
all-1819
[ "Insert3", "is", "more", "verbose", "version", "of", "Insert2" ]
[ "func", "(", "s", "*", "Skiplist", ")", "Insert3", "(", "itm", "unsafe", ".", "Pointer", ",", "insCmp", "CompareFn", ",", "eqCmp", "CompareFn", ",", "buf", "*", "ActionBuffer", ",", "itemLevel", "int", ",", "skipFindPath", "bool", ",", "sts", "*", "Stats...
1,819
all-1820
[ "UpdateSecretRequest", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "UpdateSecretRequest", "(", "arg0", "*", "secretsmanager", ".", "UpdateSecretInput", ")", "(", "*", "request", ".", "<mask>", ",", "*", "secretsmanager", ".", "UpdateSecretOutput", ")", "{", "ret", ":=", "m"...
1,820
all-1821
[ "Publish", "data", "to", "given", "channel", "." ]
[ "func", "(", "hub", "*", "hub", ")", "Publish", "(", "channels", "[", "]", "string", ",", "msg", "interface", "{", "}", ")", "{", "for", "_", ",", "name", ":=", "range", "channels", "{", "var", "cn", "=", "hub", ".", "getChannel", "(", "<mask>", ...
1,821
all-1822
[ "PreCreateCheck", "checks", "that", "the", "machine", "creation", "process", "can", "be", "started", "safely", "." ]
[ "func", "(", "d", "*", "Driver", ")", "PreCreateCheck", "(", ")", "error", "{", "log", ".", "Debug", "(", "\"", "\"", ")", "\n", "// Create context", "ctx", ",", "cancel", ":=", "context", ".", "WithCancel", "(", "context", ".", "Background", "(", ")",...
1,822
all-1823
[ "Do", "executes", "DOMDebugger", ".", "setInstrumentationBreakpoint", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetInstrumentationBreakpointParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetInstrumentationBreakpoint", ",", "p", ",", "nil", ...
1,823
all-1824
[ "OpenManaged", "returns", "a", "new", "DB", "which", "allows", "more", "control", "over", "setting", "transaction", "timestamps", "aka", "managed", "mode", ".", "This", "is", "only", "useful", "for", "databases", "built", "on", "top", "of", "Badger", "(", "l...
[ "func", "OpenManaged", "(", "opts", "<mask>", ")", "(", "*", "DB", ",", "error", ")", "{", "opts", ".", "managedTxns", "=", "true", "\n", "return", "Open", "(", "opts", ")", "\n", "}" ]
1,824
all-1825
[ "NewFakeClient", "creates", "a", "client", "that", "doesn", "t", "do", "anything", ".", "If", "you", "provide", "a", "deck", "URL", "then", "the", "client", "will", "hit", "that", "for", "the", "supported", "calls", "." ]
[ "func", "NewFakeClient", "(", "deckURL", "string", ")", "*", "<mask>", "{", "return", "&", "Client", "{", "namespace", ":", "\"", "\"", ",", "deckURL", ":", "deckURL", ",", "client", ":", "&", "http", ".", "Client", "{", "}", ",", "fake", ":", "true"...
1,825
all-1826
[ "HasCreator", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "m", "*", "Monitor", ")", "HasCreator", "(", ")", "bool", "{", "if", "m", "!=", "nil", "&&", "m", ".", "Creator", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
1,826
all-1827
[ "isNasVolume", "returns", "true", "if", "the", "HostFileSystemVolumeFileSystemType", "matches", "one", "of", "the", "possible", "filesystem", "types", "that", "a", "NAS", "datastore", "supports", "." ]
[ "func", "isNasVolume", "(", "t", "types", ".", "HostFileSystemVolumeFileSystemType", ")", "bool", "{", "switch", "t", "{", "case", "types", ".", "HostFileSystemVolumeFileSystemTypeNFS", ",", "<mask>", ".", "HostFileSystemVolumeFileSystemTypeNFS41", ":", "return", "true"...
1,827
all-1828
[ "SetVersion", "is", "a", "wrapper", "around", "gtk_about_dialog_set_version", "()", "." ]
[ "func", "(", "v", "*", "AboutDialog", ")", "SetVersion", "(", "version", "string", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "<mask>", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "C", ...
1,828
all-1829
[ "Returns", "the", "stemmed", "version", "of", "a", "word", "if", "it", "is", "a", "special", "case", "otherwise", "returns", "the", "empty", "string", "." ]
[ "func", "stemSpecialWord", "(", "word", "string", ")", "(", "stemmed", "string", ")", "{", "switch", "word", "{", "case", "\"", "\"", ":", "stemmed", "=", "\"", "\"", "\n", "case", "\"", "\"", ":", "stemmed", "=", "\"", "\"", "\n", "case", "\"", "\...
1,829
all-1830
[ "timeToJulianDay", "returns", "the", "Julian", "Date", "Number", "of", "time", "s", "date", "components", ".", "The", "algorithm", "is", "taken", "from", "https", ":", "//", "en", ".", "wikipedia", ".", "org", "/", "wiki", "/", "Julian_day", "." ]
[ "func", "timeToJulianDay", "(", "t", "<mask>", ".", "Time", ")", "int", "{", "t", "=", "t", ".", "UTC", "(", ")", "\n\n", "month", ":=", "int", "(", "t", ".", "Month", "(", ")", ")", "\n\n", "a", ":=", "(", "14", "-", "month", ")", "/", "12",...
1,830
all-1831
[ "NewSSAuthenticator", "returns", "an", "authenticator", "that", "wraps", "another", "one", "and", "adds", "the", "logic", "needed", "to", "create", "sessions", "in", "Self", "-", "Service", "." ]
[ "func", "NewSSAuthenticator", "(", "auther", "Authenticator", ",", "accountID", "int", ")", "Authenticator", "{", "if", "_", ",", "ok", ":=", "auther", ".", "(", "*", "ssAuthenticator", ")", ";", "ok", "{", "// Only wrap if not wrapped already", "return", "authe...
1,831
all-1832
[ "alarmListCommandFunc", "executes", "the", "alarm", "list", "command", "." ]
[ "func", "alarmListCommandFunc", "(", "cmd", "*", "cobra", ".", "Command", ",", "args", "[", "]", "string", ")", "{", "if", "len", "(", "args", ")", "!=", "0", "{", "ExitWithError", "(", "ExitBadArgs", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", ...
1,832
all-1833
[ "hasReturnType", "returns", "whether", "the", "mangled", "form", "of", "a", "will", "have", "a", "return", "type", "." ]
[ "func", "hasReturnType", "(", "a", "AST", ")", "bool", "{", "<mask>", "a", ":=", "a", ".", "(", "type", ")", "{", "case", "*", "Template", ":", "return", "!", "isCDtorConversion", "(", "a", ".", "Name", ")", "\n", "case", "*", "TypeWithQualifiers", "...
1,833
all-1834
[ "Push", "implements", "heap", "Push", "interface" ]
[ "func", "(", "ph", "*", "peerHeap", ")", "Push", "(", "x", "interface", "{", "}", ")", "{", "n", ":=", "len", "(", "ph", ".", "peerScores", ")", "\n", "item", ":=", "x", ".", "(", "*", "peerScore", ")", "\n", "<mask>", ".", "index", "=", "n", ...
1,834
all-1835
[ "readCore", "reads", "corefile", "and", "returns", "core", "and", "gocore", "process", "states", "." ]
[ "func", "readCore", "(", ")", "(", "*", "core", ".", "Process", ",", "*", "gocore", ".", "Process", ",", "error", ")", "{", "cc", ":=", "coreCache", "\n", "if", "cc", ".", "cfg", "==", "cfg", "{", "return", "<mask>", ".", "coreP", ",", "cc", ".",...
1,835
all-1836
[ "ParseShort", "creates", "a", "new", "*", "Durafmt", "struct", "short", "form", "returns", "error", "if", "input", "is", "invalid", "." ]
[ "func", "ParseShort", "(", "dinput", "time", ".", "Duration", ")", "*", "Durafmt", "{", "<mask>", ":=", "dinput", ".", "String", "(", ")", "\n", "return", "&", "Durafmt", "{", "dinput", ",", "input", ",", "true", "}", "\n", "}" ]
1,836
all-1837
[ "This", "will", "retrieve", "all", "old", "rows", "that", "were", "created", "before", "the", "row", "with", "id", "was", "created", "[", "1", "2", "3", "4", "]", "before", "2", "will", "return", "[", "3", "4", "]" ]
[ "func", "(", "s", "PostgresObjectStore", ")", "Before", "(", "id", "string", ",", "count", "int", ",", "skip", "int", ",", "store", "string", ")", "(", "prows", "ObjectRows", ",", "err", "error", ")", "{", "rows", ",", "err", ":=", "s", ".", "db", ...
1,837
all-1838
[ "BuildWithConfig", "allows", "to", "generate", "a", "Source", "implementation", "from", "the", "shared", "config" ]
[ "func", "BuildWithConfig", "(", "source", "string", ",", "p", "ClientGenerator", ",", "cfg", "*", "Config", ")", "(", "Source", ",", "error", ")", "{", "switch", "<mask>", "{", "case", "\"", "\"", ":", "client", ",", "err", ":=", "p", ".", "KubeClient"...
1,838
all-1839
[ "ApiClient", "retrieves", "a", "detailed", "view", "of", "one", "API", "client" ]
[ "func", "(", "c", "*", "Client", ")", "ApiClient", "(", "identifier", "string", ")", "(", "*", "ApiClient", ",", "error", ")", "{", "apiClient", ":=", "<mask>", "(", "ApiClient", ")", "\n", "_", ",", "err", ":=", "c", ".", "MakeApiRequest", "(", "\""...
1,839
all-1840
[ "CreateStore", "will", "dial", "the", "passed", "database", "and", "return", "a", "new", "store", ".", "It", "will", "return", "an", "error", "if", "the", "initial", "connection", "failed" ]
[ "func", "CreateStore", "(", "uri", "string", ")", "(", "*", "<mask>", ",", "error", ")", "{", "session", ",", "err", ":=", "mgo", ".", "Dial", "(", "uri", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", ...
1,840
all-1841
[ "NoErrorWithinTRetry", "checks", "that", "f", "finishes", "within", "time", "t", "and", "does", "not", "emit", "an", "error", ".", "Unlike", "NoErrorWithinT", "if", "f", "does", "error", "it", "will", "retry", "it", "." ]
[ "func", "NoErrorWithinTRetry", "(", "tb", "testing", ".", "TB", ",", "t", "time", ".", "Duration", ",", "f", "func", "(", ")", "error", ",", "msgAndArgs", "...", "interface", "{", "}", ")", "{", "tb", ".", "Helper", "(", ")", "\n", "doneCh", ":=", ...
1,841
all-1842
[ "Do", "executes", "Profiler", ".", "stopPreciseCoverage", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "StopPreciseCoverageParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandStopPreciseCoverage", ",", "nil", ",", "nil", ")", "\n", ...
1,842
all-1843
[ "NewSetOptionsResult", "creates", "a", "new", "SetOptionsResult", "." ]
[ "func", "NewSetOptionsResult", "(", "code", "SetOptionsResultCode", ",", "value", "<mask>", "{", "}", ")", "(", "result", "SetOptionsResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "SetOptionsResultCode", "(", "code"...
1,843
all-1844
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SetBreakpointOnFunctionCallParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger13", "(", "&", "w", ...
1,844
all-1845
[ "chain", "builds", "a", "http", ".", "Handler", "composed", "of", "an", "inline", "middleware", "stack", "and", "endpoint", "handler", "in", "the", "order", "they", "are", "passed", "." ]
[ "func", "chain", "(", "middlewares", "[", "]", "func", "(", "http", ".", "Handler", ")", "http", ".", "Handler", ",", "endpoint", "http", ".", "Handler", ")", "<mask>", ".", "Handler", "{", "// Return ahead of time if there aren't any middlewares for the chain", "...
1,845
all-1846
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SecurityDetails", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork19", "(", "&", "w", ",", "v", ")", ...
1,846
all-1847
[ "QueryLabels", "queries", "for", "label", "values", "against", "a", "Prometheus", "server", "." ]
[ "func", "QueryLabels", "(", "url", "*", "url", ".", "URL", ",", "<mask>", "string", ",", "p", "printer", ")", "int", "{", "config", ":=", "api", ".", "Config", "{", "Address", ":", "url", ".", "String", "(", ")", ",", "}", "\n\n", "// Create new clie...
1,847
all-1848
[ "match", "takes", "an", "import", "path", "and", "replacement", "map", "." ]
[ "func", "(", "c", "ImportConverter", ")", "match", "(", "importpath", "string", ")", "(", "string", ",", "bool", ")", "{", "for", "key", ",", "value", ":=", "<mask>", "c", ".", "Data", "{", "if", "!", "strings", ".", "HasPrefix", "(", "importpath", "...
1,848
all-1849
[ "GetConsoleScreenBufferInfo", "retrieves", "information", "about", "the", "specified", "console", "screen", "buffer", ".", "See", "http", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "library", "/", "windows", "/", "desktop", "...
[ "func", "GetConsoleScreenBufferInfo", "(", "handle", "uintptr", ")", "(", "*", "CONSOLE_SCREEN_BUFFER_INFO", ",", "error", ")", "{", "<mask>", ":=", "CONSOLE_SCREEN_BUFFER_INFO", "{", "}", "\n", "err", ":=", "checkError", "(", "getConsoleScreenBufferInfoProc", ".", ...
1,849
all-1850
[ "advance", "advances", "the", "read", "only", "request", "queue", "kept", "by", "the", "readonly", "struct", ".", "It", "dequeues", "the", "requests", "until", "it", "finds", "the", "read", "only", "request", "that", "has", "the", "same", "context", "as", ...
[ "func", "(", "ro", "*", "readOnly", ")", "advance", "(", "m", "pb", ".", "Message", ")", "[", "]", "*", "readIndexStatus", "{", "var", "(", "i", "int", "\n", "found", "bool", "\n", ")", "\n\n", "ctx", ":=", "string", "(", "m", ".", "Context", ")"...
1,850
all-1851
[ "VerifyBasicAuth", "returns", "a", "handler", "that", "verifies", "the", "request", "contains", "a", "BasicAuth", "Authorization", "header", "matching", "the", "passed", "in", "username", "and", "password" ]
[ "func", "VerifyBasicAuth", "(", "username", "string", ",", "password", "string", ")", "http", ".", "HandlerFunc", "{", "return", "func", "(", "w", "http", ".", "ResponseWriter", ",", "req", "*", "<mask>", ".", "Request", ")", "{", "auth", ":=", "req", "....
1,851
all-1852
[ "LastPathSegment", "returns", "the", "last", "part", "of", "uri", "path", "after", "/", ".", "Examples", ":", "*", "For", "/", "foo", "/", "bar", "/", "baz", ".", "html", "path", "returns", "baz", ".", "html", ".", "*", "For", "/", "foo", "/", "bar...
[ "func", "(", "u", "*", "URI", ")", "LastPathSegment", "(", ")", "[", "]", "byte", "{", "path", ":=", "u", ".", "Path", "(", ")", "\n", "n", ":=", "bytes", ".", "LastIndexByte", "(", "path", ",", "'/'", ")", "\n", "if", "n", "<", "0", "{", "re...
1,852
all-1853
[ "UnmarshalEasyJSON", "satisfies", "easyjson", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "ResourceType", ")", "UnmarshalEasyJSON", "(", "<mask>", "*", "jlexer", ".", "Lexer", ")", "{", "switch", "ResourceType", "(", "in", ".", "String", "(", ")", ")", "{", "case", "ResourceTypeDocument", ":", "*", "t", "=", "ResourceTy...
1,853
all-1854
[ "Draw", "draws", "the", "sprite", "." ]
[ "func", "(", "s", "*", "Sprite", ")", "Draw", "(", "screen", "*", "ebiten", ".", "Image", ",", "dx", ",", "dy", "int", ",", "alpha", "float64", ")", "{", "op", ":=", "&", "ebiten", ".", "DrawImageOptions", "{", "}", "\n", "op", ".", "GeoM", ".", ...
1,854
all-1855
[ "IsDuration", "returns", "true", "if", "the", "provided", "string", "is", "a", "valid", "duration" ]
[ "func", "IsDuration", "(", "str", "<mask>", ")", "bool", "{", "_", ",", "err", ":=", "ParseDuration", "(", "str", ")", "\n", "return", "err", "==", "nil", "\n", "}" ]
1,855
all-1856
[ "GetUser", "returns", "the", "user", "that", "match", "a", "handle", "or", "an", "error", "if", "not", "found" ]
[ "func", "(", "client", "*", "Client", ")", "GetUser", "(", "handle", "string", ")", "(", "user", "User", ",", "err", "error", ")", "{", "var", "udata", "userData", "\n", "uri", ":=", "\"", "\"", "+", "handle", "\n", "err", "=", "client", ".", "doJs...
1,856
all-1857
[ "CubicCurve", "draws", "a", "cubic", "curve", "with", "its", "control", "points", "." ]
[ "func", "CubicCurve", "(", "gc", "draw2d", ".", "GraphicContext", ",", "x", ",", "y", ",", "width", ",", "height", "float64", ")", "{", "sx", ",", "sy", ":=", "width", "/", "162", ",", "height", "/", "205", "\n", "x0", ",", "y0", ":=", "x", ",", ...
1,857
all-1858
[ "runSnapshots", "is", "a", "long", "running", "goroutine", "used", "to", "manage", "taking", "new", "snapshots", "of", "the", "FSM", ".", "It", "runs", "in", "parallel", "to", "the", "FSM", "and", "main", "goroutines", "so", "that", "snapshots", "do", "not...
[ "func", "(", "r", "*", "Raft", ")", "runSnapshots", "(", ")", "{", "for", "{", "select", "{", "case", "<-", "randomTimeout", "(", "r", ".", "conf", ".", "SnapshotInterval", ")", ":", "// Check if we should snapshot", "if", "!", "r", ".", "shouldSnapshot", ...
1,858
all-1859
[ "String", "returns", "a", "descriptive", "string", "for", "the", "item", "." ]
[ "func", "(", "i", "item", ")", "<mask>", "(", ")", "string", "{", "switch", "{", "case", "i", ".", "typ", "==", "ItemEOF", ":", "return", "\"", "\"", "\n", "case", "i", ".", "typ", "==", "ItemError", ":", "return", "i", ".", "val", "\n", "case", ...
1,859
all-1860
[ "ReplacePixels", "replaces", "the", "image", "pixels", "with", "the", "given", "pixels", "slice", ".", "If", "pixels", "is", "nil", "ReplacePixels", "clears", "the", "specified", "reagion", "." ]
[ "func", "(", "i", "*", "Image", ")", "ReplacePixels", "(", "pixels", "[", "]", "byte", ",", "x", ",", "y", ",", "width", ",", "height", "int", ")", "{", "w", ",", "h", ":=", "i", ".", "image", ".", "Size", "(", ")", "\n", "if", "width", "<=",...
1,860
all-1861
[ "GetAssetCode4", "retrieves", "the", "AssetCode4", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
[ "func", "(", "u", "AllowTrustOpAsset", ")", "GetAssetCode4", "(", ")", "(", "result", "[", "4", "]", "byte", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n\n", ...
1,861
all-1862
[ "GetText", "returns", "the", "Text", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "p", "*", "Period", ")", "GetText", "(", ")", "string", "{", "if", "p", "==", "nil", "||", "p", ".", "<mask>", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "p", ".", "Text", "\n", "}" ]
1,862
all-1863
[ "Request", "sends", "a", "request", "with", "params", "marshaled", "into", "a", "JSON", "payload", "in", "the", "body", "The", "response", "value", "is", "marshaled", "from", "JSON", "into", "the", "specified", "holder", "struct" ]
[ "func", "(", "r", "rpc", ")", "Request", "(", "method", "string", ",", "endpoint", "string", ",", "params", "interface", "{", "}", ",", "holder", "interface", "{", "}", ")", "error", "{", "jsonParams", ",", "err", ":=", "json", ".", "Marshal", "(", "...
1,863
all-1864
[ "AddFlags", "binds", "flags", "to", "options" ]
[ "func", "(", "o", "*", "Options", ")", "AddFlags", "(", "<mask>", "*", "flag", ".", "FlagSet", ")", "{", "o", ".", "GcsOptions", ".", "AddFlags", "(", "flags", ")", "\n", "// DeprecatedWrapperOptions flags should be unused, remove immediately", "}" ]
1,864
all-1865
[ "mergeSamples", "merges", "two", "lists", "of", "sample", "pairs", "and", "removes", "duplicate", "timestamps", ".", "It", "assumes", "that", "both", "lists", "are", "sorted", "by", "timestamp", "." ]
[ "func", "mergeSamples", "(", "a", ",", "b", "[", "]", "prompb", ".", "Sample", ")", "[", "]", "prompb", ".", "Sample", "{", "result", ":=", "make", "(", "[", "]", "prompb", ".", "Sample", ",", "0", ",", "len", "(", "a", ")", "+", "len", "(", ...
1,865
all-1866
[ "runWorker", "dequeues", "to", "reconcile", "until", "the", "queue", "has", "closed", "." ]
[ "func", "(", "c", "*", "<mask>", ")", "runWorker", "(", ")", "{", "for", "{", "key", ",", "shutdown", ":=", "c", ".", "workqueue", ".", "Get", "(", ")", "\n", "if", "shutdown", "{", "return", "\n", "}", "\n", "func", "(", ")", "{", "defer", "c"...
1,866
all-1867
[ "GenerateRSAKeyPair", "generates", "a", "new", "rsa", "private", "and", "public", "key" ]
[ "func", "GenerateRSAKeyPair", "(", "bits", "int", ",", "src", "<mask>", ".", "Reader", ")", "(", "PrivKey", ",", "PubKey", ",", "error", ")", "{", "if", "bits", "<", "512", "{", "return", "nil", ",", "nil", ",", "ErrRsaKeyTooSmall", "\n", "}", "\n", ...
1,867
all-1868
[ "isEphemeralHostPort", "returns", "if", "hostPort", "is", "the", "default", "ephemeral", "hostPort", "." ]
[ "func", "isEphemeralHostPort", "(", "hostPort", "string", ")", "bool", "{", "<mask>", "hostPort", "==", "\"", "\"", "||", "hostPort", "==", "ephemeralHostPort", "||", "strings", ".", "HasSuffix", "(", "hostPort", ",", "\"", "\"", ")", "\n", "}" ]
1,868
all-1869
[ "opengdpr_requests" ]
[ "func", "getRequest", "(", "opts", "*", "ServerOptions", ")", "Handler", "{", "return", "func", "(", "w", "io", ".", "Writer", ",", "_", "<mask>", ".", "Reader", ",", "p", "httprouter", ".", "Params", ")", "error", "{", "resp", ",", "err", ":=", "opt...
1,869
all-1870
[ "UnmarshalEasyJSON", "satisfies", "easyjson", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "WindowState", ")", "UnmarshalEasyJSON", "(", "<mask>", "*", "jlexer", ".", "Lexer", ")", "{", "switch", "WindowState", "(", "in", ".", "String", "(", ")", ")", "{", "case", "WindowStateNormal", ":", "*", "t", "=", "WindowStateNorm...
1,870
all-1871
[ "KeyFromMetadata", "gets", "the", "key", "from", "the", "metadata", "or", "returns", "ErrNoKey" ]
[ "func", "KeyFromMetadata", "(", "md", "metadata", ".", "MD", ")", "(", "string", ",", "error", ")", "{", "key", ",", "ok", ":=", "md", "[", "\"", "\"", "]", "\n", "if", "!", "ok", "||", "len", "(", "key", ")", "==", "0", "{", "return", "\"", ...
1,871
all-1872
[ "FindFirstControl", "returns", "the", "first", "child", "for", "that", "fn", "returns", "true", ".", "The", "function", "is", "used", "to", "find", "active", "or", "tab", "-", "stop", "control" ]
[ "func", "FindFirstControl", "(", "parent", "Control", ",", "fn", "func", "(", "<mask>", ")", "bool", ")", "Control", "{", "linear", ":=", "getLinearControlList", "(", "parent", ",", "fn", ")", "\n", "if", "len", "(", "linear", ")", "==", "0", "{", "ret...
1,872
all-1873
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "CompileScriptParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime45", "(", "&", "w", ",", "v", "...
1,873
all-1874
[ "Accounts", "retrieves", "a", "list", "of", "all", "accounts", "associated", "with", "the", "client", ".", "API", "Clients", "are", "only", "ever", "associated", "with", "one", "single", "account", ".", "User", "clients", "can", "have", "multiple", "accounts",...
[ "func", "(", "c", "*", "<mask>", ")", "Accounts", "(", ")", "(", "[", "]", "Account", ",", "error", ")", "{", "var", "accounts", "[", "]", "Account", "\n", "_", ",", "err", ":=", "c", ".", "MakeApiRequest", "(", "\"", "\"", ",", "\"", "\"", ","...
1,874
all-1875
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "Response", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoHar1", "(", "&", "r", ",", ...
1,875
all-1876
[ "Namespace", "returns", "the", "namespace", "to", "be", "used", "by", "Custom", "Resources" ]
[ "func", "(", "c", "*", "ClusterClient", ")", "Namespace", "(", ")", "<mask>", "{", "if", "c", ".", "CustomData", "!=", "nil", "&&", "c", ".", "CustomData", "[", "namespaceClusterKey", "]", "!=", "\"", "\"", "{", "return", "c", ".", "CustomData", "[", ...
1,876
all-1877
[ "lineLength", "-", "Counts", "size", "of", "table", "line", "length", "(", "with", "spaces", "etc", ".", ")", "." ]
[ "func", "(", "t", "*", "Table", ")", "lineLength", "(", ")", "(", "sum", "int", ")", "{", "for", "_", ",", "l", ":=", "range", "t", ".", "fieldSizes", "{", "<mask>", "+=", "l", "+", "1", "\n", "}", "\n", "return", "sum", "+", "1", "\n", "}" ]
1,877
all-1878
[ "Active", "is", "true", "if", "all", "the", "states", "are", "active", "." ]
[ "func", "(", "m", "*", "MultiState", ")", "Active", "(", ")", "bool", "{", "for", "_", ",", "state", ":=", "range", "m", ".", "states", "{", "if", "!", "<mask>", ".", "Active", "(", ")", "{", "return", "false", "\n", "}", "\n", "}", "\n", "retu...
1,878
all-1879
[ "Error", "implements", "the", "builtin", "error", "interface", "for", "demangleErr", "." ]
[ "func", "(", "de", "demangleErr", ")", "Error", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "<mask>", ".", "err", ",", "de", ".", "off", ")", "\n", "}" ]
1,879
all-1880
[ "ConfigBlob", "returns", "the", "blob", "described", "by", "ConfigInfo", "iff", "ConfigInfo", "()", ".", "Digest", "!", "=", ";", "nil", "otherwise", ".", "The", "result", "is", "cached", ";", "it", "is", "OK", "to", "call", "this", "however", "often", "...
[ "func", "(", "m", "*", "manifestSchema2", ")", "ConfigBlob", "(", "ctx", "context", ".", "<mask>", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "if", "m", ".", "configBlob", "==", "nil", "{", "if", "m", ".", "src", "==", "nil", "{", "retur...
1,880
all-1881
[ "NewPhoneNumber", "parses", "the", "given", "value", "as", "a", "phone", "number", "or", "returns", "an", "error", "if", "it", "cannot", "be", "parsed", "as", "one", ".", "If", "a", "phone", "number", "does", "not", "begin", "with", "a", "plus", "sign", ...
[ "func", "NewPhoneNumber", "(", "pn", "string", ")", "(", "PhoneNumber", ",", "error", ")", "{", "if", "len", "(", "pn", ")", "==", "0", "{", "return", "\"", "\"", ",", "ErrEmptyNumber", "\n", "}", "\n", "num", ",", "err", ":=", "libphonenumber", ".",...
1,881
all-1882
[ "Header", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockResponseWriter", ")", "<mask>", "(", ")", "http", ".", "Header", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "http"...
1,882
all-1883
[ "CreateExternalUser", "-" ]
[ "func", "(", "m", "*", "DefaultUAAManager", ")", "CreateExternalUser", "(", "userName", ",", "userEmail", ",", "externalID", ",", "origin", "string", ")", "(", "string", ",", "error", ")", "{", "if", "userName", "==", "\"", "\"", "||", "userEmail", "==", ...
1,883
all-1884
[ "renameTop", "renames", "all", "references", "to", "the", "top", "-", "level", "name", "old", ".", "It", "returns", "true", "if", "it", "makes", "any", "changes", "." ]
[ "func", "renameTop", "(", "f", "*", "ast", ".", "File", ",", "old", ",", "new", "string", ")", "bool", "{", "var", "fixed", "bool", "\n\n", "// Rename any conflicting imports", "// (assuming package name is last element of path).", "for", "_", ",", "s", ":=", "r...
1,884
all-1885
[ "CreateReview", "creates", "a", "review", "using", "the", "draft", ".", "https", ":", "//", "developer", ".", "github", ".", "com", "/", "v3", "/", "pulls", "/", "reviews", "/", "#create", "-", "a", "-", "pull", "-", "request", "-", "review" ]
[ "func", "(", "c", "*", "Client", ")", "CreateReview", "(", "org", ",", "repo", "string", ",", "number", "int", ",", "r", "DraftReview", ")", "error", "{", "c", ".", "log", "(", "\"", "\"", ",", "org", ",", "repo", ",", "number", ",", "r", ")", ...
1,885
all-1886
[ "Parse", "will", "load", "options", "from", "the", "specified", "map" ]
[ "func", "(", "opts", "*", "jwtOptions", ")", "Parse", "(", "optMap", "map", "[", "string", "]", "string", ")", "error", "{", "var", "err", "error", "\n", "if", "ttl", ":=", "optMap", "[", "optTTL", "]", ";", "ttl", "!=", "\"", "\"", "{", "opts", ...
1,886
all-1887
[ "Push", "adds", "event", "to", "the", "heap" ]
[ "func", "(", "t", "*", "EventTimeHeap", ")", "Push", "(", "x", "<mask>", "{", "}", ")", "{", "*", "t", "=", "append", "(", "*", "t", ",", "x", ".", "(", "sql", ".", "IssueEvent", ")", ")", "\n", "}" ]
1,887
all-1888
[ "Say", "write", "something", "in", "a", "chat" ]
[ "func", "(", "c", "*", "Client", ")", "Say", "(", "channel", ",", "text", "string", ")", "{", "channel", "=", "strings", ".", "ToLower", "(", "channel", ")", "\n\n", "c", ".", "send", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "<mask>", ",...
1,888
all-1889
[ "Get", "-" ]
[ "func", "(", "gateway", "*", "DefaultHttpGateway", ")", "Get", "(", "entity", "HttpRequestEntity", ")", "RequestAdaptor", "{", "return", "func", "(", ")", "(", "*", "http", ".", "<mask>", ",", "error", ")", "{", "return", "Request", "(", "entity", ",", "...
1,889
all-1890
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "delete", "Vm", "params" ]
[ "func", "(", "o", "*", "DeleteVMParams", ")", "WithTimeout", "(", "timeout", "<mask>", ".", "Duration", ")", "*", "DeleteVMParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
1,890
all-1891
[ "HasType", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "i", "*", "IntegrationGCPCreateRequest", ")", "HasType", "(", ")", "bool", "{", "if", "i", "!=", "nil", "&&", "i", ".", "Type", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
1,891
all-1892
[ "SetWriter", "sets", "HTTP", "header", "as", "defined", "by", "current", "instance", "to", "ResponseWriter", "Header", "." ]
[ "func", "(", "s", "*", "HttpHeader", ")", "SetWriter", "(", "h", "http", ".", "Header", ")", "*", "HttpHeader", "{", "h", ".", "<mask>", "(", "s", ".", "Name", ",", "s", ".", "Value", ")", "\n", "return", "s", "\n", "}" ]
1,892
all-1893
[ "NewPodLogArtifact", "creates", "a", "new", "PodLogArtifact" ]
[ "func", "NewPodLogArtifact", "(", "jobName", "string", ",", "buildID", "string", ",", "sizeLimit", "int64", ",", "ja", "jobAgent", ")", "(", "*", "PodLogArtifact", ",", "error", ")", "{", "if", "jobName", "==", "\"", "\"", "{", "return", "nil", ",", "err...
1,893
all-1894
[ "DataWrapped", "acts", "the", "same", "as", "data", "struct", "field", "but", "passes", "retrieved", "value", "before", "returning", "through", "wrap", "function", "set", "by", "DataWrapper", "()", ".", "If", "no", "wrap", "function", "is", "set", "it", "ret...
[ "func", "(", "v", "*", "<mask>", ")", "Data", "(", ")", "interface", "{", "}", "{", "ptr", ":=", "v", ".", "dataRaw", "(", ")", "\n", "if", "v", ".", "dataWrap", "!=", "nil", "{", "return", "v", ".", "dataWrap", "(", "ptr", ")", "\n", "}", "\...
1,894
all-1895
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetAttributesParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom53", "(", "&", "w", ",", "v", ")", ...
1,895
all-1896
[ "1", ".", "Check", "commit", "messages", "in", "the", "pull", "request", "for", "the", "sign", "-", "off", "string", "2", ".", "Check", "the", "existing", "status", "context", "value", "3", ".", "Check", "the", "existing", "PR", "labels", "4", ".", "If...
[ "func", "handle", "(", "gc", "gitHubClient", ",", "cp", "commentPruner", ",", "<mask>", "*", "logrus", ".", "Entry", ",", "org", ",", "repo", "string", ",", "pr", "github", ".", "PullRequest", ",", "addComment", "bool", ")", "error", "{", "l", ":=", "l...
1,896
all-1897
[ "MultiLogger", "creates", "a", "logger", "which", "contain", "multiple", "loggers", "." ]
[ "func", "MultiLogger", "(", "backends", "...", "Backend", ")", "LeveledBackend", "{", "<mask>", "leveledBackends", "[", "]", "LeveledBackend", "\n", "for", "_", ",", "backend", ":=", "range", "backends", "{", "leveledBackends", "=", "append", "(", "leveledBacken...
1,897
all-1898
[ "SetLevel", "propagates", "the", "same", "level", "to", "all", "backends", "." ]
[ "func", "(", "b", "*", "multiLogger", ")", "SetLevel", "(", "level", "Level", ",", "module", "string", ")", "{", "for", "_", ",", "backend", ":=", "range", "b", ".", "backends", "{", "backend", ".", "SetLevel", "(", "<mask>", ",", "module", ")", "\n"...
1,898
all-1899
[ "Sum64", "..." ]
[ "func", "Sum64", "(", "key", "string", ")", "uint64", "{", "h", ":=", "hasher", ".", "Get", "(", ")", ".", "(", "hash", ".", "Hash64", ")", "\n", "if", "_", ",", "err", ":=", "io", ".", "WriteString", "(", "h", ",", "<mask>", ")", ";", "err", ...
1,899
all-1900
[ "selectPackage", "chooses", "a", "package", "to", "generate", "rules", "for", "." ]
[ "func", "selectPackage", "(", "dir", ",", "rel", "string", ",", "packageMap", "map", "[", "string", "]", "*", "Package", ")", "(", "*", "Package", ",", "error", ")", "{", "if", "len", "(", "packageMap", ")", "==", "0", "{", "return", "nil", ",", "n...