id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
20,000
all-20001
[ "FindIndex", "accepts", "a", "JSON", "array", "and", "return", "the", "value", "of", "the", "element", "at", "the", "specified", "index" ]
[ "func", "FindIndex", "(", "in", "[", "]", "byte", ",", "pos", ",", "index", "int", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "pos", ",", "err", ":=", "skipSpace", "(", "in", ",", "pos", ")", "\n", "if", "err", "!=", "nil", "{", "ret...
20,001
all-20002
[ "title", ":", "service", "instance", "status", "path", ":", "/", "services", "/", "{", "service", "}", "/", "instances", "/", "{", "instance", "}", "/", "status", "method", ":", "GET", "responses", ":", "200", ":", "List", "services", "instances", "401",...
[ "func", "serviceInstanceStatus", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "<mask>", ".", "Request", ",", "t", "auth", ".", "Token", ")", "error", "{", "instanceName", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\""...
20,002
all-20003
[ "New", "ValidationError", ".", "New" ]
[ "func", "(", "e", "*", "ValidationError", ")", "New", "(", "message", "string", ")", "*", "ValidationError", "{", "e", ".", "HTTPCode", "=", "<mask>", ".", "StatusBadRequest", "\n", "e", ".", "Errno", "=", "0", "\n", "e", ".", "Message", "=", "message"...
20,003
all-20004
[ "SaveUser", "adds", "a", "new", "user", "replacing", "if", "the", "same", "username", "is", "in", "use", "." ]
[ "func", "(", "m", "MongoDb", ")", "SaveUser", "(", "user", "models", ".", "User", ")", "error", "{", "c", ":=", "m", ".", "Connect", "(", "models", ".", "COLL_NAME_USER", ")", "\n", "defer", "m", ".", "Close", "(", "c", ")", "\n\n", "_", ",", "er...
20,004
all-20005
[ "Stop", "stops", "sending", "samples", "to", "the", "remote", "storage", "and", "waits", "for", "pending", "sends", "to", "complete", "." ]
[ "func", "(", "t", "*", "QueueManager", ")", "Stop", "(", ")", "{", "level", ".", "Info", "(", "t", ".", "logger", ")", ".", "Log", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "defer", "level", ".", "Info", "(", "t", ".", "logger", ")", ".", ...
20,005
all-20006
[ "GetAll", "runs", "the", "query", "in", "the", "given", "context", "and", "returns", "all", "keys", "that", "match", "that", "query", "as", "well", "as", "appending", "the", "values", "to", "dst", ".", "dst", "must", "have", "type", "*", "[]", "S", "or...
[ "func", "(", "q", "*", "Query", ")", "GetAll", "(", "c", "context", ".", "Context", ",", "dst", "interface", "{", "}", ")", "(", "[", "]", "*", "Key", ",", "error", ")", "{", "var", "(", "dv", "reflect", ".", "Value", "\n", "mat", "multiArgType",...
20,006
all-20007
[ "Mutate", "executes", "a", "single", "GraphQL", "mutation", "request", "with", "a", "mutation", "derived", "from", "m", "populating", "the", "response", "into", "it", ".", "m", "should", "be", "a", "pointer", "to", "struct", "that", "corresponds", "to", "the...
[ "func", "(", "c", "*", "Client", ")", "Mutate", "(", "ctx", "context", ".", "Context", ",", "m", "interface", "{", "}", ",", "input", "<mask>", ",", "variables", "map", "[", "string", "]", "interface", "{", "}", ")", "error", "{", "if", "variables", ...
20,007
all-20008
[ "HasProjectID", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "i", "*", "IntegrationGCP", ")", "HasProjectID", "(", ")", "bool", "{", "if", "i", "!=", "nil", "&&", "i", ".", "ProjectID", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
20,008
all-20009
[ "PutSecretValue", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "PutSecretValue", "(", "arg0", "*", "secretsmanager", ".", "PutSecretValueInput", ")", "(", "*", "secretsmanager", ".", "PutSecretValueOutput", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "...
20,009
all-20010
[ "IsEquivalent", "returns", "true", "if", "other", "represents", "the", "same", "data", "type", "as", "the", "target", "." ]
[ "func", "(", "p", "*", "ActionParam", ")", "IsEquivalent", "(", "other", "*", "ActionParam", ")", "bool", "{", "return", "p", ".", "Name", "==", "other", ".", "<mask>", "&&", "p", ".", "Type", ".", "IsEquivalent", "(", "other", ".", "Type", ")", "\n"...
20,010
all-20011
[ "MakeBuf", "creates", "an", "action", "buffer" ]
[ "func", "(", "s", "*", "Skiplist", ")", "MakeBuf", "(", ")", "*", "ActionBuffer", "{", "return", "&", "ActionBuffer", "{", "preds", ":", "make", "(", "[", "]", "*", "Node", ",", "MaxLevel", "+", "1", ")", ",", "succs", ":", "make", "(", "[", "]",...
20,011
all-20012
[ "New", "--", "return", "a", "new", "SKU", "provider" ]
[ "func", "(", "s", "*", "SkuM1SmallBuilder", ")", "New", "(", "tm", "skurepo", ".", "TaskManager", ",", "meta", "map", "[", "string", "]", "interface", "{", "}", ")", "skurepo", ".", "Sku", "{", "var", "procurementMeta", "=", "make", "(", "map", "[", ...
20,012
all-20013
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "WebSocketFrame", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork2", "(", "&", "w", ",", "v", ")", ...
20,013
all-20014
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventContextDestroyed", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoWebaudio2", "(", "&", "w", ",", "v",...
20,014
all-20015
[ "Unmarshal", "message", "from", "byte", "array", "." ]
[ "func", "Unmarshal", "(", "data", "[", "]", "byte", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "<mask>", "msg", "map", "[", "string", "]", "interface", "{", "}", "\n", "err", ":=", "json", ".", "Unmarshal", "(", "data", ",", "&", "m...
20,015
all-20016
[ "UnmarshalEasyJSON", "satisfies", "easyjson", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "StreamCompression", ")", "UnmarshalEasyJSON", "(", "<mask>", "*", "jlexer", ".", "Lexer", ")", "{", "switch", "StreamCompression", "(", "in", ".", "String", "(", ")", ")", "{", "case", "StreamCompressionNone", ":", "*", "t", "=", ...
20,016
all-20017
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "ClearDeviceMetricsOverrideParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoEmulation19", "(", "&", "w", ...
20,017
all-20018
[ "doHttp", "uses", "the", "clients", "internal", "TLS", "configuration", "for", "doing", "the", "provided", "HTTP", "request", ".", "It", "returns", "the", "response", "and", "an", "error", "on", "failure", "." ]
[ "func", "(", "c", "*", "dockerClient", ")", "doHTTP", "(", "req", "*", "<mask>", ".", "Request", ")", "(", "*", "http", ".", "Response", ",", "error", ")", "{", "tr", ":=", "tlsclientconfig", ".", "NewTransport", "(", ")", "\n", "tr", ".", "TLSClient...
20,018
all-20019
[ "NewRunner", "accepts", "a", "slice", "of", "TemplateConfigs", "and", "returns", "a", "pointer", "to", "the", "new", "Runner", "and", "any", "error", "that", "occurred", "during", "creation", "." ]
[ "func", "NewRunner", "(", "config", "*", "config", ".", "Config", ",", "dry", ",", "once", "bool", ")", "(", "*", "Runner", ",", "error", ")", "{", "<mask>", ".", "Printf", "(", "\"", "\"", ",", "dry", ",", "once", ")", "\n\n", "runner", ":=", "&...
20,019
all-20020
[ "MarshalEasyJSON", "satisfies", "easyjson", ".", "Marshaler", "." ]
[ "func", "(", "t", "PseudoType", ")", "MarshalEasyJSON", "(", "out", "*", "jwriter", ".", "<mask>", ")", "{", "out", ".", "String", "(", "string", "(", "t", ")", ")", "\n", "}" ]
20,020
all-20021
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventFrameDetached", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage65", "(", "&", "w", ",", "v", ")"...
20,021
all-20022
[ "determine", "if", "a", "name", "corresponds", "to", "a", "transform", "feedback", "object" ]
[ "func", "IsTransformFeedback", "(", "id", "uint32", ")", "bool", "{", "<mask>", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpIsTransformFeedback", ",", "1", ",", "uintptr", "(", "id", ")", ",", "0", ",", "0", ")", "\n", "return", "ret...
20,022
all-20023
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventWorkerErrorReported", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoServiceworker12", "(", "&", "w", ",",...
20,023
all-20024
[ "GetScopeOk", "returns", "a", "tuple", "with", "the", "Scope", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "s", "*", "Series", ")", "GetScopeOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "s", "==", "nil", "||", "s", ".", "Scope", "==", "nil", "{", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n", "return", "*", "s", "...
20,024
all-20025
[ "SetMilestone", "sets", "the", "milestone", "." ]
[ "func", "(", "f", "*", "FakeClient", ")", "SetMilestone", "(", "org", ",", "repo", "<mask>", ",", "issueNum", ",", "milestoneNum", "int", ")", "error", "{", "if", "milestoneNum", "<", "0", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\...
20,025
all-20026
[ "SetAccelPath", "is", "a", "wrapper", "around", "gtk_menu_set_accel_path", "()", "." ]
[ "func", "(", "v", "*", "Menu", ")", "SetAccelPath", "(", "path", "string", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "path", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n\n", "C", ".", ...
20,026
all-20027
[ "ApplyChanges", "applies", "a", "given", "set", "of", "changes", "to", "a", "given", "zone", "." ]
[ "func", "(", "p", "*", "OCIProvider", ")", "ApplyChanges", "(", "changes", "*", "plan", ".", "Changes", ")", "error", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "changes", ")", "\n\n", "ops", ":=", "[", "]", "dns", ".", "RecordOperation", "{", ...
20,027
all-20028
[ "Stability", ":", "***", "EXPERIMENTAL", "***", "Ensure", "that", "a", "keypair", "of", "a", "given", "name", "does", "not", "exist", ".", "Required", "scopes", ":", "ec2", "-", "manager", ":", "manage", "-", "key", "-", "pairs", ":", "<name", ">", "Se...
[ "func", "(", "eC2Manager", "*", "EC2Manager", ")", "RemoveKeyPair", "(", "name", "string", ")", "error", "{", "cd", ":=", "tcclient", ".", "Client", "(", "*", "eC2Manager", ")", "\n", "_", ",", "_", ",", "err", ":=", "(", "&", "cd", ")", ".", "APIC...
20,028
all-20029
[ "RegisterBuilder", "creates", "and", "registers", "a", "builder", ".", "Since", "this", "function", "calls", "balancer", ".", "Register", "it", "must", "be", "invoked", "at", "initialization", "time", "." ]
[ "func", "RegisterBuilder", "(", "cfg", "Config", ")", "{", "bb", ":=", "&", "builder", "{", "cfg", "}", "\n", "balancer", ".", "Register", "(", "bb", ")", "\n\n", "bb", ".", "cfg", ".", "Logger", ".", "Debug", "(", "\"", "\"", ",", "zap", ".", "S...
20,029
all-20030
[ "HandleSubConnStateChange", "implements", "grpc", "/", "balancer", ".", "Balancer", "interface", "." ]
[ "func", "(", "bb", "*", "baseBalancer", ")", "HandleSubConnStateChange", "(", "sc", "balancer", ".", "SubConn", ",", "s", "connectivity", ".", "State", ")", "{", "bb", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "bb", ".", "mu", ".", "Unlock", "...
20,030
all-20031
[ "NewEllipticSigner", "creates", "an", "Elliptic", "Curve", "Signer", "for", "the", "specified", "curve", "." ]
[ "func", "NewEllipticSigner", "(", "alg", "Algorithm", ",", "curve", "elliptic", ".", "Curve", ")", "func", "(", "Store", ",", "crypto", ".", "Hash", ")", "(", "Signer", ",", "error", ")", "{", "curveBitSize", ":=", "curve", ".", "Params", "(", ")", "."...
20,031
all-20032
[ "FinishReportAndFlushUserAction", "immediately", "reports", "the", "metric", "but", "does", "not", "block", "execution", ".", "It", "returns", "a", "wait", "function", "which", "waits", "or", "times", "out", "after", "5s", ".", "It", "is", "used", "by", "the",...
[ "func", "FinishReportAndFlushUserAction", "(", "action", "string", ",", "err", "error", ",", "start", "time", ".", "Time", ")", "func", "(", ")", "{", "var", "wait", "func", "(", ")", "\n", "if", "err", "!=", "nil", "{", "wait", "=", "reportAndFlushUserA...
20,032
all-20033
[ "FieldColumnName", "returns", "the", "column", "name", "of", "the", "field", "with", "the", "given", "name", "prefixed", "with", "the", "entity", "s", "table", "name", "." ]
[ "func", "(", "m", "*", "Mapping", ")", "FieldColumnName", "(", "name", "string", ")", "string", "{", "field", ":=", "m", ".", "FieldByName", "(", "<mask>", ")", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "entityTable", "(", "m", "."...
20,033
all-20034
[ "DatacenterLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "DatacenterLocator", "(", "href", "<mask>", ")", "*", "DatacenterLocator", "{", "return", "&", "DatacenterLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
20,034
all-20035
[ "DeepCopy", "copies", "src", "to", "dest", "by", "using", "encoding", "/", "gob", "so", "its", "not", "that", "fast", "." ]
[ "func", "DeepCopy", "(", "src", ",", "dest", "interface", "{", "}", ")", "error", "{", "buff", ":=", "new", "(", "bytes", ".", "Buffer", ")", "\n", "enc", ":=", "gob", ".", "NewEncoder", "(", "buff", ")", "\n", "dec", ":=", "gob", ".", "NewDecoder"...
20,035
all-20036
[ "NewGShadow", "returns", "a", "new", "GShadow", "." ]
[ "func", "NewGShadow", "(", "username", "string", ",", "members", "...", "string", ")", "*", "GShadow", "{", "return", "&", "GShadow", "{", "<mask>", ":", "username", ",", "UserList", ":", "members", ",", "}", "\n", "}" ]
20,036
all-20037
[ "ConfigSchema", "returns", "the", "schema", "for", "custom", "attribute", "configuration", "for", "each", "resource", "that", "needs", "it", ".", "The", "key", "should", "be", "set", "to", "the", "ConfigKey", "constant", "and", "should", "be", "a", "map", "o...
[ "func", "ConfigSchema", "(", ")", "*", "schema", ".", "Schema", "{", "return", "&", "schema", ".", "Schema", "{", "Type", ":", "schema", ".", "TypeMap", ",", "<mask>", ":", "\"", "\"", ",", "Optional", ":", "true", ",", "}", "\n", "}" ]
20,037
all-20038
[ "Uint16", "returns", "the", "uint16", "value", "stored", "in", "r", ".", "r", "must", "have", "type", "uint16", "." ]
[ "func", "(", "r", "<mask>", ")", "Uint16", "(", ")", "uint16", "{", "if", "r", ".", "typ", ".", "Kind", "!=", "KindUint", "||", "r", ".", "typ", ".", "Size", "!=", "2", "{", "panic", "(", "\"", "\"", "+", "r", ".", "typ", ".", "Name", ")", ...
20,038
all-20039
[ "UnmarshalJSON", "sets", "the", "ObjectId", "from", "JSON" ]
[ "func", "(", "id", "*", "ObjectId", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "l", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "id", ".", "UnmarshalEasyJSON", "(", "&", "l", ")", "\n", "return"...
20,039
all-20040
[ "loadClusterConfig", "loads", "connection", "configuration", "for", "the", "cluster", "we", "re", "deploying", "to", ".", "We", "prefer", "to", "use", "in", "-", "cluster", "configuration", "if", "possible", "but", "will", "fall", "back", "to", "using", "defau...
[ "func", "loadClusterConfig", "(", ")", "(", "*", "<mask>", ".", "Config", ",", "error", ")", "{", "clusterConfig", ",", "err", ":=", "rest", ".", "InClusterConfig", "(", ")", "\n", "if", "err", "==", "nil", "{", "return", "clusterConfig", ",", "nil", "...
20,040
all-20041
[ "GetDisplayFormatOk", "returns", "a", "tuple", "with", "the", "DisplayFormat", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "m", "*", "ManageStatusDefinition", ")", "GetDisplayFormatOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "m", "==", "nil", "||", "m", ".", "DisplayFormat", "==", "nil", "{", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n...
20,041
all-20042
[ "For", "debugging" ]
[ "func", "dumpJSON", "(", "v", "interface", "{", "}", ")", "string", "{", "buf", ":=", "bytes", ".", "NewBuffer", "(", "nil", ")", "\n", "enc", ":=", "json", ".", "NewEncoder", "(", "buf", ")", "\n", "enc", ".", "SetIndent", "(", "\"", "\"", ",", ...
20,042
all-20043
[ "NewReader", "returns", "a", "new", "Reader", "that", "reads", "from", "r", "." ]
[ "func", "NewReader", "(", "r", "<mask>", ".", "Reader", ")", "*", "Reader", "{", "return", "&", "Reader", "{", "Reader", ":", "csv", ".", "NewReader", "(", "r", ")", ",", "}", "\n", "}" ]
20,043
all-20044
[ "TODO", ":", "gtk_container_foreach", "GetChildren", "is", "a", "wrapper", "around", "gtk_container_get_children", "()", "." ]
[ "func", "(", "v", "*", "Container", ")", "GetChildren", "(", ")", "*", "glib", ".", "List", "{", "clist", ":=", "C", ".", "gtk_container_get_children", "(", "v", ".", "native", "(", ")", ")", "\n", "glist", ":=", "glib", ".", "WrapList", "(", "uintpt...
20,044
all-20045
[ "UnmarshalJSON", "satisfies", "json", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "PausedReason", ")", "UnmarshalJSON", "(", "buf", "[", "]", "<mask>", ")", "error", "{", "return", "easyjson", ".", "Unmarshal", "(", "buf", ",", "t", ")", "\n", "}" ]
20,045
all-20046
[ "XzDecompressor", "is", "a", "DecompressorFunc", "for", "the", "xz", "compression", "algorithm", "." ]
[ "func", "XzDecompressor", "(", "r", "io", ".", "Reader", ")", "(", "<mask>", ".", "ReadCloser", ",", "error", ")", "{", "r", ",", "err", ":=", "xz", ".", "NewReader", "(", "r", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err"...
20,046
all-20047
[ "Adopt", "()", ":", "non", "-", "standard", ".", "For", "efficiency", "s", "sake", "(", "possibly", ")", "take", "ownership", "of", "already", "allocated", "slice", "offered", "in", "me", ".", "If", "me", "is", "large", "we", "will", "adopt", "it", "an...
[ "func", "(", "b", "*", "Float64RingBuf", ")", "Adopt", "(", "me", "[", "]", "float64", ")", "{", "n", ":=", "len", "(", "me", ")", "\n", "if", "n", ">", "b", ".", "N", "{", "b", ".", "A", "=", "<mask>", "\n", "b", ".", "N", "=", "n", "\n"...
20,047
all-20048
[ "ParseReference", "converts", "a", "string", "which", "should", "not", "start", "with", "the", "ImageTransport", ".", "Name", "prefix", "into", "an", "ImageReference", "." ]
[ "func", "(", "t", "daemonTransport", ")", "ParseReference", "(", "<mask>", "string", ")", "(", "types", ".", "ImageReference", ",", "error", ")", "{", "return", "ParseReference", "(", "reference", ")", "\n", "}" ]
20,048
all-20049
[ "/", "*", "GetTokenKindString", "returns", "a", "string", "that", "describes", "the", "given", "TokenKind", ".", "e", ".", "g", ".", "when", "passed", "the", "NUMERIC", "TokenKind", "this", "returns", "the", "string", "NUMERIC", "." ]
[ "func", "(", "kind", "TokenKind", ")", "String", "(", ")", "string", "{", "switch", "kind", "{", "case", "PREFIX", ":", "return", "\"", "\"", "\n", "<mask>", "NUMERIC", ":", "return", "\"", "\"", "\n", "case", "BOOLEAN", ":", "return", "\"", "\"", "\...
20,049
all-20050
[ "NewTokensRequest", "generates", "new", "tokens", "for", "OAuth", "user", "given", "an", "http", "request", "containing", "the", "query", "parameter", "code" ]
[ "func", "(", "o", "OAuth", ")", "NewTokensFromRequest", "(", "req", "*", "http", ".", "Request", ")", "(", "*", "oauthTokens", ",", "error", ")", "{", "<mask>", ":=", "req", ".", "URL", ".", "Query", "(", ")", "\n", "code", ":=", "query", ".", "Get...
20,050
all-20051
[ "Keys", "returns", "the", "keys", "in", "sorted", "order", "." ]
[ "func", "(", "c", "*", "Cache", ")", "Keys", "(", ")", "[", "]", "string", "{", "c", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "mu", ".", "Unlock", "(", ")", "\n", "var", "keys", "[", "]", "string", "\n", "for", "key", ":="...
20,051
all-20052
[ "DescribeSecretRequest", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "DescribeSecretRequest", "(", "arg0", "*", "secretsmanager", ".", "DescribeSecretInput", ")", "(", "*", "request", ".", "Request", ",", "*", "secretsmanager", ".", "DescribeSecretOutput", ")", "{", "ret", ":="...
20,052
all-20053
[ "findRoots", "sets", "member", "GOROOT", "and", "GOPATHs", "." ]
[ "func", "(", "c", "*", "<mask>", ")", "findRoots", "(", ")", "{", "c", ".", "GOPATHs", "=", "map", "[", "string", "]", "string", "{", "}", "\n", "for", "_", ",", "f", ":=", "range", "getFiles", "(", "c", ".", "Goroutines", ")", "{", "// TODO(maru...
20,053
all-20054
[ "twoDigits", "formats", "a", "zero", "-", "prefixed", "two", "-", "digit", "integer", "at", "buf", ".", "tmp", "[", "i", "]", "." ]
[ "func", "(", "buf", "*", "<mask>", ")", "twoDigits", "(", "i", ",", "d", "int", ")", "{", "buf", ".", "tmp", "[", "i", "+", "1", "]", "=", "digits", "[", "d", "%", "10", "]", "\n", "d", "/=", "10", "\n", "buf", ".", "tmp", "[", "i", "]", ...
20,054
all-20055
[ "ProjectMap", "returns", "the", "names", "and", "ids", "of", "all", "available", "projects", "." ]
[ "func", "(", "c", "*", "ClusterTx", ")", "ProjectMap", "(", ")", "(", "map", "[", "int64", "]", "string", ",", "error", ")", "{", "stmt", ":=", "\"", "\"", "\n\n", "rows", ",", "err", ":=", "c", ".", "tx", ".", "Query", "(", "stmt", ")", "\n", ...
20,055
all-20056
[ "Remove", "perfective", "gerund", "endings", "and", "return", "true", "if", "one", "was", "removed", "." ]
[ "func", "removePerfectiveGerundEnding", "(", "word", "*", "snowballword", ".", "SnowballWord", ")", "bool", "{", "suffix", ",", "suffixRunes", ":=", "word", ".", "FirstSuffixIn", "(", "word", ".", "RVstart", ",", "len", "(", "<mask>", ".", "RS", ")", ",", ...
20,056
all-20057
[ "/", "*", "ProcessEvent", "processes", "all", "events", "come", "from", "the", "control", "parent", ".", "If", "a", "control", "processes", "an", "event", "it", "should", "return", "true", ".", "If", "the", "method", "returns", "false", "it", "means", "tha...
[ "func", "(", "e", "*", "EditField", ")", "ProcessEvent", "(", "event", "Event", ")", "bool", "{", "if", "!", "e", ".", "Active", "(", ")", "||", "!", "e", ".", "Enabled", "(", ")", "{", "return", "false", "\n", "}", "\n\n", "if", "event", ".", ...
20,057
all-20058
[ "BaseFromPath", "returns", "a", "BaseComputeResource", "for", "a", "given", "path", "." ]
[ "func", "BaseFromPath", "(", "client", "*", "govmomi", ".", "Client", ",", "path", "string", ")", "(", "BaseComputeResource", ",", "error", ")", "{", "finder", ":=", "find", ".", "NewFinder", "(", "client", ".", "Client", ",", "false", ")", "\n\n", "ctx"...
20,058
all-20059
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetEventListenerBreakpointParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2",...
20,059
all-20060
[ "New", "is", "used", "to", "create", "a", "new", "cgroup", "hierarchy" ]
[ "func", "(", "c", "*", "GlobalCgroupFactory", ")", "New", "(", "hierarchy", "cgroups", ".", "Hierarchy", ",", "path", "cgroups", ".", "<mask>", ",", "specs", "*", "specs", ".", "LinuxResources", ")", "(", "cgroups", ".", "Cgroup", ",", "error", ")", "{",...
20,060
all-20061
[ "StoragePoolErrored", "sets", "the", "state", "of", "the", "given", "pool", "to", "Errored", "." ]
[ "func", "(", "c", "*", "ClusterTx", ")", "StoragePoolErrored", "(", "<mask>", "string", ")", "error", "{", "return", "c", ".", "storagePoolState", "(", "name", ",", "storagePoolErrored", ")", "\n", "}" ]
20,061
all-20062
[ "This", "endpoint", "will", "return", "a", "list", "of", "all", "hook", "groups", "with", "at", "least", "one", "hook", ".", "See", "#listHookGroups" ]
[ "func", "(", "hooks", "*", "Hooks", ")", "ListHookGroups", "(", ")", "(", "*", "HookGroups", ",", "error", ")", "{", "cd", ":=", "tcclient", ".", "Client", "(", "*", "hooks", ")", "\n", "responseObject", ",", "_", ",", "err", ":=", "(", "&", "<mask...
20,062
all-20063
[ "GetUsers", "returns", "all", "user", "or", "an", "error", "if", "not", "found" ]
[ "func", "(", "client", "*", "Client", ")", "GetUsers", "(", ")", "(", "users", "[", "]", "User", ",", "err", "error", ")", "{", "var", "udata", "usersData", "\n", "uri", ":=", "\"", "\"", "\n", "err", "=", "<mask>", ".", "doJsonRequest", "(", "\"",...
20,063
all-20064
[ "TopUpChannel", "initiates", "JobClientPreChannelTopUp", "job", "." ]
[ "func", "(", "h", "*", "Handler", ")", "TopUpChannel", "(", "tkn", ",", "channel", "string", ",", "deposit", ",", "gasPrice", "uint64", ")", "error", "{", "logger", ":=", "h", ".", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", ...
20,064
all-20065
[ "SetBSON", "sets", "the", "Password", "from", "raw", "bson", "data" ]
[ "func", "(", "r", "*", "Password", ")", "SetBSON", "(", "raw", "bson", ".", "Raw", ")", "error", "{", "var", "m", "bson", ".", "M", "\n", "if", "err", ":=", "raw", ".", "Unmarshal", "(", "&", "m", ")", ";", "err", "!=", "nil", "{", "return", ...
20,065
all-20066
[ "DefaultVaultConfig", "returns", "a", "configuration", "that", "is", "populated", "with", "the", "default", "values", "." ]
[ "func", "DefaultVaultConfig", "(", ")", "*", "VaultConfig", "{", "v", ":=", "&", "VaultConfig", "{", "Retry", ":", "DefaultRetryConfig", "(", ")", ",", "SSL", ":", "DefaultSSLConfig", "(", ")", ",", "Transport", ":", "DefaultTransportConfig", "(", ")", ",", ...
20,066
all-20067
[ "ctx", "may", "be", "nil", "." ]
[ "func", "insertContext", "(", "f", "*", "ast", ".", "File", ",", "<mask>", "*", "ast", ".", "CallExpr", ",", "ctx", "*", "ast", ".", "Ident", ")", "{", "if", "ctx", "==", "nil", "{", "// context is unknown, so use a plain \"ctx\".", "ctx", "=", "ast", "....
20,067
all-20068
[ "parsePullURL", "parses", "PR", "history", "URLs", ".", "Expects", "this", "format", ":", "...", "/", "pr", "-", "history?org", "=", "<org", ">", "&repo", "=", "<repo", ">", "&pr", "=", "<pr", "number", ">" ]
[ "func", "parsePullURL", "(", "u", "*", "url", ".", "<mask>", ")", "(", "org", ",", "repo", "string", ",", "pr", "int", ",", "err", "error", ")", "{", "var", "prStr", "string", "\n", "vals", ":=", "u", ".", "Query", "(", ")", "\n", "if", "org", ...
20,068
all-20069
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventLastSeenObjectID", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler17", "(",...
20,069
all-20070
[ "nicUnitRange", "calculates", "a", "range", "of", "units", "given", "a", "certain", "VirtualDeviceList", "which", "should", "be", "network", "interfaces", ".", "It", "s", "used", "in", "network", "interface", "refresh", "logic", "to", "determine", "how", "many",...
[ "func", "nicUnitRange", "(", "l", "object", ".", "VirtualDeviceList", ")", "(", "int", ",", "error", ")", "{", "// No NICs means no range", "if", "len", "(", "l", ")", "<", "1", "{", "return", "0", ",", "nil", "\n", "}", "\n\n", "high", ":=", "int32", ...
20,070
all-20071
[ "StreamServerInterceptor", "applies", "fn", "to", "errors", "returned", "by", "server", "." ]
[ "func", "StreamServerInterceptor", "(", "fn", "ConvertFunc", ")", "grpc", ".", "StreamServerInterceptor", "{", "return", "func", "(", "srv", "interface", "{", "}", ",", "ss", "grpc", ".", "ServerStream", ",", "info", "*", "grpc", ".", "StreamServerInfo", ",", ...
20,071
all-20072
[ "Network", "sets", "a", "network", "endpoints", "for", "ICMP", "ping", "and", "returns", "the", "previous", "setting", ".", "network", "arg", "should", "be", "ip", "or", "udp", "string", "or", "if", "others", "are", "specified", "it", "returns", "an", "err...
[ "func", "(", "p", "*", "Pinger", ")", "Network", "(", "network", "string", ")", "(", "string", ",", "error", ")", "{", "origNet", ":=", "p", ".", "network", "\n", "<mask>", "network", "{", "case", "\"", "\"", ":", "fallthrough", "\n", "case", "\"", ...
20,072
all-20073
[ "ImportField", "imports", "records", "from", "the", "given", "iterator", "." ]
[ "func", "(", "c", "*", "Client", ")", "ImportField", "(", "<mask>", "*", "Field", ",", "iterator", "RecordIterator", ",", "options", "...", "ImportOption", ")", "error", "{", "span", ":=", "c", ".", "tracer", ".", "StartSpan", "(", "\"", "\"", ")", "\n...
20,073
all-20074
[ "Subset", "returns", "the", "subset", "obtained", "through", "applying", "filter" ]
[ "func", "(", "covList", "*", "CoverageList", ")", "Subset", "(", "prefix", "string", ")", "*", "CoverageList", "{", "s", ":=", "newCoverageList", "(", "\"", "\"", ")", "\n", "for", "_", ",", "c", ":=", "range", "covList", ".", "Group", "{", "if", "st...
20,074
all-20075
[ "Get", "Broker", "to", "use", "when", "creating", "a", "check" ]
[ "func", "(", "cm", "*", "CheckManager", ")", "getBroker", "(", ")", "(", "*", "api", ".", "Broker", ",", "error", ")", "{", "if", "cm", ".", "brokerID", "!=", "0", "{", "cid", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "cm", ".", "broke...
20,075
all-20076
[ "StartDefaultTerminationHandler", "defines", "a", "default", "termination", "handler", "suitable", "for", "running", "in", "a", "process" ]
[ "func", "StartDefaultTerminationHandler", "(", "saver", "statemanager", ".", "Saver", ",", "taskEngine", "engine", ".", "TaskEngine", ")", "{", "signalChannel", ":=", "make", "(", "chan", "os", ".", "Signal", ",", "2", ")", "\n", "signal", ".", "Notify", "("...
20,076
all-20077
[ "KeyStretcher", "returns", "a", "set", "of", "keys", "for", "each", "party", "by", "stretching", "the", "shared", "key", ".", "(", "myIV", "theirIV", "myCipherKey", "theirCipherKey", "myMACKey", "theirMACKey", ")" ]
[ "func", "KeyStretcher", "(", "cipherType", "string", ",", "hashType", "string", ",", "secret", "[", "]", "byte", ")", "(", "StretchedKeys", ",", "StretchedKeys", ")", "{", "var", "cipherKeySize", "int", "\n", "var", "ivSize", "int", "\n", "switch", "cipherTy...
20,077
all-20078
[ "render", "calls", "the", "user", "provided", "Render", "and", "than", "renders", "the", "widgets", "in", "the", "window", "." ]
[ "func", "(", "w", "*", "Window", ")", "render", "(", ")", "{", "w", ".", "mgr", ".", "Render", "(", "w", ")", "\n\n", "// iterate over widgets", "for", "_", ",", "widget", ":=", "<mask>", "w", ".", "widgets", "{", "widget", ".", "Render", "(", ")",...
20,078
all-20079
[ "ParseWithDefaults", "will", "load", "options", "from", "the", "specified", "map", "or", "set", "defaults", "where", "appropriate" ]
[ "func", "(", "opts", "*", "jwtOptions", ")", "ParseWithDefaults", "(", "optMap", "<mask>", "[", "string", "]", "string", ")", "error", "{", "if", "opts", ".", "TTL", "==", "0", "&&", "optMap", "[", "optTTL", "]", "==", "\"", "\"", "{", "opts", ".", ...
20,079
all-20080
[ "doDec", "decodes", "in", "as", "a", "JWT", "." ]
[ "func", "doDec", "(", "signer", "jwt", ".", "Signer", ",", "<mask>", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "var", "err", "error", "\n\n", "// decode token", "ut", ":=", "UnstructuredToken", "{", "}", "\n", "err", "=", ...
20,080
all-20081
[ "Lexes", "a", "comment", "line" ]
[ "func", "lexComment", "(", "l", "*", "Lexer", ")", "stateFn", "{", "l", ".", "skipWhitespace", "(", ")", "\n\n", "// if strings.HasPrefix(l.remaining(), comment) {", "// skip comment //", "l", ".", "Pos", "+=", "len", "(", "comment", ")", "\n\n", "// find next new...
20,081
all-20082
[ "ExplainCmd", "represents", "the", "explain", "command" ]
[ "func", "ExplainCmd", "(", ")", "*", "cobra", ".", "Command", "{", "var", "exo", "=", "&", "cli", ".", "ExplainOptions", "{", "}", "\n\n", "var", "cmd", "=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\""...
20,082
all-20083
[ "withStateFuncs", "adds", "functions", "to", "the", "template", "that", "are", "dependent", "upon", "state", "." ]
[ "func", "(", "t", "*", "Template", ")", "withStateFuncs", "(", "td", "TemplateData", ")", "*", "template", ".", "<mask>", "{", "return", "t", ".", "template", ".", "Funcs", "(", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", ...
20,083
all-20084
[ "AddJobIndexes", "will", "add", "job", "indexes", "to", "the", "specified", "indexer", ".", "If", "removeAfter", "is", "specified", "completed", "and", "cancelled", "jobs", "are", "automatically", "removed", "when", "their", "finished", "timestamp", "falls", "behi...
[ "func", "AddJobIndexes", "(", "indexer", "*", "coal", ".", "Indexer", ",", "removeAfter", "time", ".", "Duration", ")", "{", "// add name index", "indexer", ".", "Add", "(", "&", "Job", "{", "}", ",", "false", ",", "0", ",", "\"", "\"", ")", "\n\n", ...
20,084
all-20085
[ "DrawHorizontalLine", "draws", "the", "part", "of", "the", "horizontal", "line", "that", "is", "inside", "current", "clipping", "rectangle" ]
[ "func", "DrawHorizontalLine", "(", "x", ",", "y", ",", "w", "int", ",", "r", "rune", ")", "{", "x", ",", "y", ",", "w", ",", "_", "=", "<mask>", "(", "x", ",", "y", ",", "w", ",", "1", ")", "\n", "if", "w", "==", "0", "{", "return", "\n",...
20,085
all-20086
[ "retrieve", "the", "index", "of", "a", "named", "uniform", "block" ]
[ "func", "GetUniformBlockIndex", "(", "program", "uint32", ",", "uniformBlockName", "*", "uint8", ")", "uint32", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpGetUniformBlockIndex", ",", "2", ",", "uintptr", "(", "program", ")", "...
20,086
all-20087
[ "ScrubGRPC", "removes", "GRPC", "error", "code", "information", "from", "err", "if", "it", "came", "from", "GRPC", "(", "and", "returns", "it", "unchanged", "otherwise", ")" ]
[ "func", "ScrubGRPC", "(", "err", "error", ")", "error", "{", "if", "err", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "if", "s", ",", "ok", ":=", "status", ".", "FromError", "(", "err", ")", ";", "ok", "{", "return", "<mask>", ".", "New",...
20,087
all-20088
[ "join", "is", "a", "version", "of", "strings", ".", "Join", "that", "can", "be", "piped" ]
[ "func", "<mask>", "(", "sep", "string", ",", "a", "[", "]", "string", ")", "(", "string", ",", "error", ")", "{", "return", "strings", ".", "Join", "(", "a", ",", "sep", ")", ",", "nil", "\n", "}" ]
20,088
all-20089
[ "NewIter", "returns", "a", "newly", "created", "iterator", "with", "the", "provided", "parameters", ".", "Using", "this", "method", "is", "not", "recommended", "unless", "the", "desired", "functionality", "is", "not", "yet", "exposed", "via", "a", "more", "con...
[ "func", "(", "c", "*", "Collection", ")", "NewIter", "(", "session", "*", "Session", ",", "firstBatch", "[", "]", "bson", ".", "Raw", ",", "cursorId", "int64", ",", "err", "error", ")", "*", "Iter", "{", "var", "server", "*", "mongoServer", "\n", "cs...
20,089
all-20090
[ "AddStatus", "is", "an", "alternative", "Label", "initializer", ".", "A", "Status", "is", "a", "label", "that", "has", "the", "property", "that", "it", "fills", "an", "entire", "line", "and", "is", "justified", ".", "This", "call", "implements", "the", "Ne...
[ "func", "(", "w", "*", "Window", ")", "AddStatus", "(", "y", "int", ",", "j", "Justify", ",", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "*", "Label", "{", "l", ",", "_", ":=", "w", ".", "AddWidget", "(", "WidgetLabel", "...
20,090
all-20091
[ "ResolvedAt", "returns", "true", "iff", "the", "activity", "interval", "ended", "before", "the", "given", "timestamp", "." ]
[ "func", "(", "a", "*", "Alert", ")", "ResolvedAt", "(", "ts", "time", ".", "Time", ")", "bool", "{", "if", "a", ".", "EndsAt", ".", "IsZero", "(", ")", "{", "return", "<mask>", "\n", "}", "\n", "return", "!", "a", ".", "EndsAt", ".", "After", "...
20,091
all-20092
[ "yaml_writer_write_handler", "uses", "emitter", ".", "output_writer", "to", "write", "the", "emitted", "text", "." ]
[ "func", "yaml_writer_write_handler", "(", "emitter", "*", "yaml_emitter_t", ",", "<mask>", "[", "]", "byte", ")", "error", "{", "_", ",", "err", ":=", "emitter", ".", "output_writer", ".", "Write", "(", "buffer", ")", "\n", "return", "err", "\n", "}" ]
20,092
all-20093
[ "Stability", ":", "***", "EXPERIMENTAL", "***", "Return", "a", "list", "of", "possible", "prices", "for", "EC2", "See", "https", ":", "//", "docs", ".", "taskcluster", ".", "net", "/", "reference", "/", "core", "/", "ec2", "-", "manager", "/", "api", "...
[ "func", "(", "eC2Manager", "*", "EC2Manager", ")", "GetPrices", "(", ")", "(", "*", "ListOfPrices", ",", "error", ")", "{", "cd", ":=", "tcclient", ".", "<mask>", "(", "*", "eC2Manager", ")", "\n", "responseObject", ",", "_", ",", "err", ":=", "(", "...
20,093
all-20094
[ "NewErrorStatus", "creates", "an", "error", "that", "implements", "ErrorStatus", "based", "off", "a", "string" ]
[ "func", "NewErrorStatus", "(", "status", "int", ",", "err", "string", ")", "error", "{", "return", "&", "errStatus", "{", "error", ":", "errors", ".", "New", "(", "err", ")", ",", "status", ":", "<mask>", ",", "}", "\n", "}" ]
20,094
all-20095
[ "GetScreen", "()", "is", "a", "wrapper", "around", "gdk_display_get_screen", "()", "." ]
[ "func", "(", "v", "*", "Display", ")", "GetScreen", "(", "screenNum", "int", ")", "(", "*", "Screen", ",", "<mask>", ")", "{", "c", ":=", "C", ".", "gdk_display_get_screen", "(", "v", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "screenNum"...
20,095
all-20096
[ "OperationLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "OperationLocator", "(", "href", "<mask>", ")", "*", "OperationLocator", "{", "return", "&", "OperationLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
20,096
all-20097
[ "BuilderNew", "is", "a", "wrapper", "around", "gtk_builder_new", "()", "." ]
[ "func", "BuilderNew", "(", ")", "(", "*", "Builder", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_builder_new", "(", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "obj", ":=", "glib", ".", "Take"...
20,097
all-20098
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetFrameOwnerParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom41", "(", "&", "...
20,098
all-20099
[ "GetUri", "is", "a", "wrapper", "around", "gtk_link_button_get_uri", "()", "." ]
[ "func", "(", "v", "*", "LinkButton", ")", "GetUri", "(", ")", "<mask>", "{", "c", ":=", "C", ".", "gtk_link_button_get_uri", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "goString", "(", "c", ")", "\n", "}" ]
20,099
all-20100
[ "HeaderByNumber", "returns", "a", "Ethereum", "block", "header", "from", "the", "current", "canonical", "chain", ".", "If", "number", "is", "nil", "the", "latest", "known", "header", "is", "returned", "." ]
[ "func", "(", "b", "*", "backendInstance", ")", "HeaderByNumber", "(", "ctx", "context", ".", "<mask>", ",", "number", "*", "big", ".", "Int", ")", "(", "*", "types", ".", "Header", ",", "error", ")", "{", "return", "b", ".", "conn", ".", "ethClient",...