id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
24,700
all-24701
[ "Do", "executes", "Emulation", ".", "setDefaultBackgroundColorOverride", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetDefaultBackgroundColorOverrideParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetDefaultBackgroundColorOverride", ",", "p", ",", ...
24,701
all-24702
[ "StatusString", "returns", "a", "human", "readable", "string", "representation", "of", "this", "object" ]
[ "func", "(", "vs", "VolumeStatus", ")", "String", "(", ")", "string", "{", "for", "k", ",", "v", ":=", "range", "resourceStatusMap", "{", "if", "v", "==", "<mask>", "{", "return", "k", "\n", "}", "\n", "}", "\n", "return", "\"", "\"", "\n", "}" ]
24,702
all-24703
[ "InStroke", "is", "a", "wrapper", "around", "cairo_in_stroke", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "InStroke", "(", "x", ",", "y", "float64", ")", "bool", "{", "c", ":=", "C", ".", "cairo_in_stroke", "(", "v", ".", "native", "(", ")", ",", "C", ".", "double", "(", "x", ")", ",", "C", ".", "double", "("...
24,703
all-24704
[ "ReadMessage", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockWebsocketConn", ")", "ReadMessage", "(", ")", "(", "int", ",", "[", "]", "byte", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ")", "\n", "ret0", ",", "_", ":=", "re...
24,704
all-24705
[ "Write", "rolls", "through", "the", "data", "written", "calling", "c", ".", "f", "when", "a", "chunk", "is", "found", ".", "Note", ":", "If", "making", "changes", "to", "this", "function", "be", "wary", "of", "the", "performance", "implications", "(", "c...
[ "func", "(", "w", "*", "Writer", ")", "Write", "(", "data", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "offset", ":=", "0", "\n", "size", ":=", "w", ".", "buf", ".", "Len", "(", ")", "\n", "for", "i", ",", "b", ":=", "range"...
24,705
all-24706
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetStyleTextsReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss11", "(", "&", ...
24,706
all-24707
[ "By", "adds", "a", "sort", "key", "to", "sort", "by", "the", "output", "of", "the", "specified", "less", "function", "." ]
[ "func", "(", "s", "*", "SortFilter", ")", "By", "(", "less", "func", "(", "a", ",", "b", "string", ")", "bool", ")", "*", "SortFilter", "{", "s", ".", "<mask>", "(", "func", "(", "a", ",", "b", "string", ")", "int", "{", "if", "less", "(", "a...
24,707
all-24708
[ "GetLevel", "returns", "the", "highest", "level", "enabled", "by", "all", "backends", "." ]
[ "func", "(", "b", "*", "multiLogger", ")", "GetLevel", "(", "module", "string", ")", "Level", "{", "var", "<mask>", "Level", "\n", "for", "_", ",", "backend", ":=", "range", "b", ".", "backends", "{", "if", "backendLevel", ":=", "backend", ".", "GetLev...
24,708
all-24709
[ "GetTrustLine", "retrieves", "the", "TrustLine", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
[ "func", "(", "u", "LedgerKey", ")", "GetTrustLine", "(", ")", "(", "result", "LedgerKeyTrustLine", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n\n", "if", "armName...
24,709
all-24710
[ "Add", "a", "new", "network", "link", "of", "a", "specified", "type", ".", "This", "is", "identical", "to", "running", ":", "ip", "link", "add", "$name", "type", "$linkType" ]
[ "func", "NetworkLinkAdd", "(", "name", "string", ",", "linkType", "string", ")", "error", "{", "if", "name", "==", "\"", "\"", "||", "linkType", "==", "\"", "\"", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "s", ",...
24,710
all-24711
[ "GetAPIKeys", "returns", "all", "API", "keys", "or", "error", "on", "failure" ]
[ "func", "(", "<mask>", "*", "Client", ")", "GetAPIKeys", "(", ")", "(", "[", "]", "APIKey", ",", "error", ")", "{", "var", "out", "reqAPIKeys", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ...
24,711
all-24712
[ "Update", "updates", "the", "tile", "s", "animation", "states", "." ]
[ "func", "(", "t", "*", "Tile", ")", "Update", "(", ")", "error", "{", "switch", "{", "case", "0", "<", "t", ".", "movingCount", ":", "t", ".", "movingCount", "--", "\n", "if", "t", ".", "movingCount", "==", "0", "{", "if", "t", ".", "current", ...
24,712
all-24713
[ "HasType", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "f", "*", "FreeTextDefinition", ")", "HasType", "(", ")", "bool", "{", "if", "f", "!=", "nil", "&&", "f", ".", "<mask>", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
24,713
all-24714
[ "SendLinkCardMsg", "发送链接消息" ]
[ "func", "(", "w", "*", "Webhook", ")", "SendLinkCardMsg", "(", "msgs", "[", "]", "LinkMsg", ")", "<mask>", "{", "return", "w", ".", "SendPayload", "(", "&", "Payload", "{", "MsgType", ":", "\"", "\"", ",", "FeedCard", ":", "struct", "{", "Links", "["...
24,714
all-24715
[ "GetComments", "is", "a", "wrapper", "around", "gtk_about_dialog_get_comments", "()", "." ]
[ "func", "(", "v", "*", "AboutDialog", ")", "GetComments", "(", ")", "string", "{", "c", ":=", "C", ".", "gtk_about_dialog_get_comments", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "C", ".", "GoString", "(", "(", "*", "C", ".", "<mask>", ...
24,715
all-24716
[ "OnClosedContext", "derives", "a", "context", "from", "a", "given", "goprocess", "that", "will", "be", "Done", "when", "the", "process", "is", "closed" ]
[ "func", "OnClosedContext", "(", "p", "goprocess", ".", "Process", ")", "<mask>", ".", "Context", "{", "return", "&", "procContext", "{", "done", ":", "p", ".", "Closed", "(", ")", ",", "which", ":", "closed", ",", "}", "\n", "}" ]
24,716
all-24717
[ "refresh", "reads", "all", "files", "matching", "the", "discovery", "s", "patterns", "and", "sends", "the", "respective", "updated", "target", "groups", "through", "the", "channel", "." ]
[ "func", "(", "d", "*", "Discovery", ")", "refresh", "(", "ctx", "context", ".", "Context", ",", "ch", "chan", "<-", "[", "]", "*", "targetgroup", ".", "Group", ")", "{", "t0", ":=", "time", ".", "Now", "(", ")", "\n", "defer", "func", "(", ")", ...
24,717
all-24718
[ "ScheduledReportLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "ScheduledReportLocator", "(", "href", "<mask>", ")", "*", "ScheduledReportLocator", "{", "return", "&", "ScheduledReportLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
24,718
all-24719
[ "Load", "loads", "the", "cedar", "from", "an", "io", ".", "Writer", "where", "dataType", "is", "either", "json", "or", "gob", "." ]
[ "func", "(", "da", "*", "Cedar", ")", "Load", "(", "in", "io", ".", "Reader", ",", "dataType", "string", ")", "error", "{", "switch", "dataType", "{", "case", "\"", "\"", ",", "\"", "\"", ":", "dataDecoder", ":=", "gob", ".", "NewDecoder", "(", "in...
24,719
all-24720
[ "Sync", "looks", "for", "newly", "made", "gerrit", "changes", "and", "creates", "prowjobs", "according", "to", "specs" ]
[ "func", "(", "c", "*", "Controller", ")", "Sync", "(", ")", "error", "{", "syncTime", ":=", "c", ".", "lastUpdate", "\n\n", "for", "instance", ",", "changes", ":=", "range", "c", ".", "gc", ".", "QueryChanges", "(", "c", ".", "lastUpdate", ",", "c", ...
24,720
all-24721
[ "newFilteredRecords", "returns", "a", "collection", "of", "RecordSets", "based", "on", "the", "given", "endpoints", "and", "domainFilter", "." ]
[ "func", "(", "p", "*", "GoogleProvider", ")", "newFilteredRecords", "(", "endpoints", "[", "]", "*", "endpoint", ".", "Endpoint", ")", "[", "]", "*", "dns", ".", "ResourceRecordSet", "{", "records", ":=", "[", "]", "*", "dns", ".", "ResourceRecordSet", "...
24,721
all-24722
[ "GetURL", "returns", "a", "Docker", "compatible", "host", "URL", "for", "connecting", "to", "this", "host", "e", ".", "g", ".", "tcp", ":", "//", "1", ".", "2", ".", "3", ".", "4", ":", "2376" ]
[ "func", "(", "d", "*", "SerialDriver", ")", "GetURL", "(", ")", "(", "string", ",", "<mask>", ")", "{", "d", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "Unlock", "(", ")", "\n", "return", "d", ".", "Driver", ".", "GetURL", "(", ")", "\n", ...
24,722
all-24723
[ "Relay", "all", "pending", "gossip", "data", "for", "each", "channel", "via", "random", "neighbours", "." ]
[ "func", "(", "router", "*", "Router", ")", "sendAllGossip", "(", ")", "{", "for", "channel", ":=", "range", "router", ".", "gossipChannelSet", "(", ")", "{", "if", "gossip", ":=", "channel", ".", "gossiper", ".", "Gossip", "(", ")", ";", "gossip", "!="...
24,723
all-24724
[ "AddRule", "adds", "a", "rule", "r", "to", "the", "index", ".", "The", "rule", "will", "only", "be", "indexed", "if", "there", "is", "a", "known", "resolver", "for", "the", "rule", "s", "kind", "and", "Resolver", ".", "Imports", "returns", "a", "non", ...
[ "func", "(", "ix", "*", "RuleIndex", ")", "AddRule", "(", "c", "*", "config", ".", "Config", ",", "r", "*", "rule", ".", "Rule", ",", "f", "*", "rule", ".", "File", ")", "{", "var", "imps", "[", "]", "ImportSpec", "\n", "if", "rslv", ":=", "ix"...
24,724
all-24725
[ "AddBoshIOResource", "bosh", "io", "specific", "resource", "add" ]
[ "func", "(", "s", "*", "ConcoursePipeline", ")", "AddBoshIOResource", "(", "name", "string", ",", "source", "map", "[", "string", "]", "interface", "{", "}", ")", "{", "s", ".", "AddResource", "(", "<mask>", ",", "BoshIOResourceName", ",", "source", ")", ...
24,725
all-24726
[ "Init", "initializes", "the", "Firebase", "client", "with", "a", "given", "root", "url", "and", "optional", "auth", "token", ".", "The", "initialization", "can", "also", "pass", "a", "mock", "api", "for", "testing", "purposes", "." ]
[ "func", "(", "c", "*", "Client", ")", "Init", "(", "root", ",", "auth", "string", ",", "api", "Api", ")", "{", "if", "api", "==", "nil", "{", "api", "=", "<mask>", "(", "f", ")", "\n", "}", "\n\n", "c", ".", "api", "=", "api", "\n", "c", "....
24,726
all-24727
[ "This", "is", "based", "on", "the", "standard", "library", "s", "fnv32a", "implementation", ".", "We", "copy", "it", "for", "a", "couple", "of", "reasons", ":", "1", ".", "Avoid", "allocations", "to", "create", "a", "hash", ".", "Hash32", "2", ".", "Av...
[ "func", "fnv32a", "(", "s", "string", ")", "uint32", "{", "const", "(", "initial", "=", "2166136261", "\n", "prime", "=", "16777619", "\n", ")", "\n\n", "hash", ":=", "uint32", "(", "initial", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "len",...
24,727
all-24728
[ "Handle", "satisfies", "hookHandler", "." ]
[ "func", "(", "g", "GitlabHook", ")", "Handle", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "repo", "*", "Repo", ")", "(", "int", ",", "error", ")", "{", "if", "r", ".", "Method", "!=", "\"", "\"", "{", "...
24,728
all-24729
[ "ListPullRequestComments", "returns", "all", "*", "review", "*", "comments", "on", "a", "pull", "request", ".", "Multiple", "-", "pages", "of", "comments", "consumes", "multiple", "API", "tokens", ".", "See", "https", ":", "//", "developer", ".", "github", "...
[ "func", "(", "c", "*", "Client", ")", "ListPullRequestComments", "(", "org", ",", "repo", "string", ",", "number", "int", ")", "(", "[", "]", "ReviewComment", ",", "error", ")", "{", "c", ".", "log", "(", "\"", "\"", ",", "org", ",", "repo", ",", ...
24,729
all-24730
[ "NewDB", "creates", "a", "new", "data", "connection", "handle", "." ]
[ "func", "NewDB", "(", "conf", "*", "DBConfig", ")", "(", "*", "reform", ".", "DB", ",", "error", ")", "{", "conn", ",", "err", ":=", "dbConnect", "(", "conf", ".", "ConnStr", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ...
24,730
all-24731
[ "ComputeWIF", "returns", "the", "privKey", "in", "Wallet", "Import", "Format", "." ]
[ "func", "ComputeWIF", "(", "privKey", "<mask>", ",", "compress", "bool", ")", "string", "{", "return", "WIFFromPrivKeyBytes", "(", "HexDecode", "(", "privKey", ")", ",", "compress", ")", "\n", "}" ]
24,731
all-24732
[ "OCIConfig", "returns", "the", "image", "configuration", "as", "per", "OCI", "v1", "image", "-", "spec", ".", "Information", "about", "layers", "in", "the", "resulting", "configuration", "isn", "t", "guaranteed", "to", "be", "returned", "to", "due", "how", "...
[ "func", "(", "m", "*", "manifestOCI1", ")", "OCIConfig", "(", "ctx", "context", ".", "<mask>", ")", "(", "*", "imgspecv1", ".", "Image", ",", "error", ")", "{", "cb", ",", "err", ":=", "m", ".", "ConfigBlob", "(", "ctx", ")", "\n", "if", "err", "...
24,732
all-24733
[ "NewRelay", "constructs", "a", "new", "relay", "." ]
[ "func", "NewRelay", "(", "ctx", "context", ".", "Context", ",", "h", "host", ".", "Host", ",", "upgrader", "*", "tptu", ".", "Upgrader", ",", "opts", "...", "RelayOpt", ")", "(", "*", "Relay", ",", "error", ")", "{", "r", ":=", "&", "Relay", "{", ...
24,733
all-24734
[ "Dial", "connects", "to", "a", "single", "endpoint", "using", "the", "client", "s", "config", "." ]
[ "func", "(", "c", "*", "<mask>", ")", "Dial", "(", "ep", "string", ")", "(", "*", "grpc", ".", "ClientConn", ",", "error", ")", "{", "creds", ":=", "c", ".", "directDialCreds", "(", "ep", ")", "\n", "// Use the grpc passthrough resolver to directly dial a si...
24,734
all-24735
[ "Layout", ".", "GetSize", "is", "a", "wrapper", "around", "gtk_layout_get_size" ]
[ "func", "(", "v", "*", "Layout", ")", "GetSize", "(", ")", "(", "width", ",", "<mask>", "uint", ")", "{", "var", "w", ",", "h", "C", ".", "guint", "\n", "C", ".", "gtk_layout_get_size", "(", "v", ".", "native", "(", ")", ",", "&", "w", ",", "...
24,735
all-24736
[ "Do", "executes", "ServiceWorker", ".", "inspectWorker", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "InspectWorkerParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandInspectWorker", ",", "p", ",", "nil", ")", "\n", "}" ]
24,736
all-24737
[ "GetPaperWidth", "()", "is", "a", "wrapper", "around", "gtk_page_setup_get_paper_width", "()", "." ]
[ "func", "(", "ps", "*", "PageSetup", ")", "GetPaperWidth", "(", "<mask>", "Unit", ")", "float64", "{", "c", ":=", "C", ".", "gtk_page_setup_get_paper_width", "(", "ps", ".", "native", "(", ")", ",", "C", ".", "GtkUnit", "(", "unit", ")", ")", "\n", "...
24,737
all-24738
[ "breaks", "lines", "into", "important", "/", "unimportant", "groups" ]
[ "func", "groupLines", "(", "logLines", "[", "]", "LogLine", ")", "[", "]", "LineGroup", "{", "// show highlighted lines and their neighboring lines", "for", "i", ",", "line", ":=", "range", "logLines", "{", "if", "line", ".", "Highlighted", "{", "for", "d", ":...
24,738
all-24739
[ "Repaint", "draws", "the", "control", "on", "its", "View", "surface" ]
[ "func", "(", "l", "*", "TableView", ")", "Draw", "(", ")", "{", "if", "l", ".", "<mask>", "{", "return", "\n", "}", "\n\n", "l", ".", "mtx", ".", "RLock", "(", ")", "\n", "defer", "l", ".", "mtx", ".", "RUnlock", "(", ")", "\n", "PushAttributes...
24,739
all-24740
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetShowFPSCounterParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoOverlay4", "(", "...
24,740
all-24741
[ "BasicAuth", "sets", "username", "and", "password", "for", "HTTP", "client" ]
[ "func", "BasicAuth", "(", "username", ",", "password", "string", ")", "ClientParam", "{", "return", "func", "(", "c", "*", "Client", ")", "error", "{", "c", ".", "auth", "=", "&", "basicAuth", "{", "username", ":", "username", ",", "password", ":", "<m...
24,741
all-24742
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GrantPermissionsParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser4", "(", "&",...
24,742
all-24743
[ "writeConfig", "writes", "uc", "to", "a", "file", "specified", "by", "path", "creating", "paret", "dirs", "along", "the", "way", ".", "If", "file", "does", "not", "exists", "it", "will", "be", "created", "with", "0600", "mod", ".", "This", "function", "d...
[ "func", "writeConfig", "(", "uc", "*", "userConfig", ")", "error", "{", "b", ",", "err", ":=", "json", ".", "MarshalIndent", "(", "uc", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", ...
24,743
all-24744
[ "Sample", "implements", "instruments", ".", "Reporter" ]
[ "func", "(", "r", "*", "Reporter", ")", "Sample", "(", "name", "string", ",", "<mask>", "[", "]", "string", ",", "dist", "instruments", ".", "Distribution", ")", "error", "{", "metric", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ",", ...
24,744
all-24745
[ "Create", "the", "actual", "bridge", "device", ".", "This", "is", "more", "backward", "-", "compatible", "than", "netlink", ".", "NetworkLinkAdd", "and", "works", "on", "RHEL", "6", "." ]
[ "func", "CreateBridge", "(", "name", "string", ",", "setMacAddr", "bool", ")", "error", "{", "if", "len", "(", "name", ")", ">=", "IFNAMSIZ", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n\n", "s", ",", "err"...
24,745
all-24746
[ "Clear", "the", "current", "session" ]
[ "func", "(", "s", "*", "<mask>", ")", "Clear", "(", ")", "{", "for", "k", ":=", "range", "s", ".", "Session", ".", "Values", "{", "s", ".", "Delete", "(", "k", ")", "\n", "}", "\n", "}" ]
24,746
all-24747
[ "Reads", "the", "global", "registry", "file", "from", "the", "filesystem", ".", "Returns", "a", "byte", "array" ]
[ "func", "readRegistryConf", "(", "sys", "*", "types", ".", "SystemContext", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "return", "ioutil", ".", "ReadFile", "(", "RegistriesConfPath", "(", "sys", ")", ")", "\n", "}" ]
24,747
all-24748
[ "Return", "a", "generic", "vertex", "attribute", "parameter" ]
[ "func", "GetVertexAttribfv", "(", "index", "uint32", ",", "pname", "uint32", ",", "params", "*", "float32", ")", "{", "syscall", ".", "Syscall", "(", "gpGetVertexAttribfv", ",", "3", ",", "uintptr", "(", "<mask>", ")", ",", "uintptr", "(", "pname", ")", ...
24,748
all-24749
[ "Do", "executes", "CSS", ".", "forcePseudoState", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "ForcePseudoStateParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandForcePseudoState", ",", "p", ",", "nil", ")", "\n", "}" ]
24,749
all-24750
[ "determine", "if", "a", "name", "corresponds", "to", "a", "buffer", "object" ]
[ "func", "IsBuffer", "(", "<mask>", "uint32", ")", "bool", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpIsBuffer", ",", "1", ",", "uintptr", "(", "buffer", ")", ",", "0", ",", "0", ")", "\n", "return", "ret", "!=", "0",...
24,750
all-24751
[ "Adds", "ka", "to", "new", "bucket", ".", "Returns", "false", "if", "it", "couldn", "t", "do", "it", "cuz", "buckets", "full", ".", "NOTE", ":", "currently", "it", "always", "returns", "true", "." ]
[ "func", "(", "a", "*", "AddrBook", ")", "addToNewBucket", "(", "ka", "*", "knownAddress", ",", "bucketIdx", "int", ")", "bool", "{", "// Sanity check", "if", "ka", ".", "isOld", "(", ")", "{", "<mask>", ".", "Warn", "(", "Fmt", "(", "\"", "\"", ",", ...
24,751
all-24752
[ "PeekBytes", "returns", "header", "value", "for", "the", "given", "key", ".", "Returned", "value", "is", "valid", "until", "the", "next", "call", "to", "ResponseHeader", ".", "Do", "not", "store", "references", "to", "returned", "value", ".", "Make", "copies...
[ "func", "(", "h", "*", "ResponseHeader", ")", "PeekBytes", "(", "key", "[", "]", "byte", ")", "[", "]", "byte", "{", "h", ".", "bufKV", ".", "<mask>", "=", "append", "(", "h", ".", "bufKV", ".", "key", "[", ":", "0", "]", ",", "key", "...", "...
24,752
all-24753
[ "Check", "Docker", "configs" ]
[ "func", "checkDocker", "(", ")", "error", "{", "if", "_", ",", "err", ":=", "config", ".", "Get", "(", "\"", "\"", ")", ";", "err", "!=", "nil", "{", "return", "<mask>", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "err", ":=", "checkDock...
24,753
all-24754
[ "ResetTrap", "URL", "force", "request", "to", "the", "API", "for", "the", "submission", "URL", "and", "broker", "ca", "cert" ]
[ "func", "(", "cm", "*", "CheckManager", ")", "ResetTrap", "(", ")", "<mask>", "{", "if", "cm", ".", "trapURL", "==", "\"", "\"", "{", "return", "nil", "\n", "}", "\n\n", "cm", ".", "trapURL", "=", "\"", "\"", "\n", "cm", ".", "certPool", "=", "ni...
24,754
all-24755
[ "IsValid", "returns", "true", "iff", "kt", "is", "a", "recognized", "value" ]
[ "func", "(", "kt", "sbKeyType", ")", "IsValid", "(", ")", "bool", "{", "switch", "kt", "{", "case", "SBKeyTypeGPGKeys", ",", "SBKeyTypeSignedByGPGKeys", ",", "SBKeyTypeX509Certificates", ",", "SBKeyTypeSignedByX509CAs", ":", "return", "<mask>", "\n", "default", ":...
24,755
all-24756
[ "getMetadataFilePath", "gives", "the", "metadata", "file", "path", "for", "any", "agent", "-", "managed", "container" ]
[ "func", "getMetadataFilePath", "(", "taskARN", "string", ",", "containerName", "string", ",", "dataDir", "<mask>", ")", "(", "string", ",", "error", ")", "{", "taskID", ",", "err", ":=", "getTaskIDfromARN", "(", "taskARN", ")", "\n", "// Empty task ID indicates ...
24,756
all-24757
[ "Logger", "returns", "the", "defaut", "Bambou", "logger", "." ]
[ "func", "Logger", "(", ")", "*", "logging", ".", "Logger", "{", "if", "defaultLogger", "==", "nil", "{", "logger", ",", "_", ":=", "logging", ".", "SimpleLogger", "(", "\"", "\"", ")", "\n", "defaultLogger", "=", "logger", "\n", "logger", ".", "SetLeve...
24,757
all-24758
[ "waitThenClose", "is", "spawned", "in", "a", "goroutine", "when", "the", "channel", "is", "registered", ".", "This", "safely", "cleans", "up", "the", "channel", "when", "the", "context", "has", "been", "canceled", "." ]
[ "func", "(", "e", "*", "eventChannel", ")", "waitThenClose", "(", ")", "{", "<-", "e", ".", "ctx", ".", "Done", "(", ")", "\n", "e", ".", "mu", ".", "Lock", "(", ")", "\n", "<mask>", "(", "e", ".", "ch", ")", "\n", "// 1. Signals that we're done.",...
24,758
all-24759
[ "CreateSecret", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "CreateSecret", "(", "arg0", "*", "secretsmanager", ".", "CreateSecretInput", ")", "(", "*", "secretsmanager", ".", "CreateSecretOutput", ",", "error", ")", "{", "<mask>", ":=", "m", ".", "ctrl", ".", "Cal...
24,759
all-24760
[ "determine", "if", "a", "name", "corresponds", "to", "a", "framebuffer", "object" ]
[ "func", "IsFramebuffer", "(", "framebuffer", "uint32", ")", "bool", "{", "<mask>", ":=", "C", ".", "glowIsFramebuffer", "(", "gpIsFramebuffer", ",", "(", "C", ".", "GLuint", ")", "(", "framebuffer", ")", ")", "\n", "return", "ret", "==", "TRUE", "\n", "}...
24,760
all-24761
[ "NewLob", "creates", "a", "new", "Lob", "instance", "with", "the", "io", ".", "Reader", "and", "io", ".", "Writer", "given", "as", "parameters", "." ]
[ "func", "NewLob", "(", "rd", "<mask>", ".", "Reader", ",", "wr", "io", ".", "Writer", ")", "*", "Lob", "{", "return", "&", "Lob", "{", "rd", ":", "rd", ",", "wr", ":", "wr", "}", "\n", "}" ]
24,761
all-24762
[ "Price", "flips", "the", "sign", "of", "the", "amount", "and", "prints", "it", "with", "a", "currency", "symbol", "for", "the", "given", "unit", "." ]
[ "func", "price", "(", "unit", "string", ",", "amount", "string", ")", "string", "{", "if", "len", "(", "amount", ")", "==", "0", "{", "return", "amount", "\n", "}", "\n", "if", "amount", "[", "0", "]", "==", "'-'", "{", "amount", "=", "amount", "...
24,762
all-24763
[ "ImageAliasAdd", "inserts", "an", "alias", "ento", "the", "database", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "ImageAliasAdd", "(", "project", ",", "name", "string", ",", "imageID", "int", ",", "desc", "string", ")", "error", "{", "err", ":=", "c", ".", "Transaction", "(", "func", "(", "tx", "*", "ClusterTx", ")", "erro...
24,763
all-24764
[ "Decode", "decodes", "a", "cursor", "from", "its", "base", "-", "64", "string", "representation", "." ]
[ "func", "DecodeCursor", "(", "s", "string", ")", "(", "Cursor", ",", "error", ")", "{", "if", "s", "==", "\"", "\"", "{", "return", "Cursor", "{", "&", "zeroCC", "}", ",", "nil", "\n", "}", "\n", "if", "n", ":=", "len", "(", "s", ")", "%", "4...
24,764
all-24765
[ "Mount", "attaches", "another", "http", ".", "Handler", "or", "chi", "Router", "as", "a", "subrouter", "along", "a", "routing", "path", ".", "It", "s", "very", "useful", "to", "split", "up", "a", "large", "API", "as", "many", "independent", "routers", "a...
[ "func", "(", "mx", "*", "Mux", ")", "Mount", "(", "pattern", "string", ",", "handler", "http", ".", "Handler", ")", "{", "// Provide runtime safety for ensuring a pattern isn't mounted on an existing", "// routing pattern.", "if", "mx", ".", "tree", ".", "findPattern"...
24,765
all-24766
[ "NewAddrBook", "creates", "a", "new", "address", "book", ".", "Use", "Start", "to", "begin", "processing", "asynchronous", "address", "updates", "." ]
[ "func", "NewAddrBook", "(", "filePath", "string", ",", "routabilityStrict", "bool", ")", "*", "AddrBook", "{", "am", ":=", "&", "AddrBook", "{", "rand", ":", "rand", ".", "New", "(", "<mask>", ".", "NewSource", "(", "time", ".", "Now", "(", ")", ".", ...
24,766
all-24767
[ "WithURL", "the", "request", "-", "URI", "to", "associate", "with", "the", "setting", "of", "the", "cookie", ".", "This", "value", "can", "affect", "the", "default", "domain", "and", "path", "values", "of", "the", "created", "cookie", "." ]
[ "func", "(", "p", "SetCookieParams", ")", "WithURL", "(", "url", "string", ")", "*", "SetCookieParams", "{", "p", ".", "URL", "=", "<mask>", "\n", "return", "&", "p", "\n", "}" ]
24,767
all-24768
[ "openTarComponent", "returns", "a", "ReadCloser", "for", "the", "specific", "file", "within", "the", "archive", ".", "This", "is", "linear", "scan", ";", "we", "assume", "that", "the", "tar", "file", "will", "have", "a", "fairly", "small", "amount", "of", ...
[ "func", "(", "s", "*", "Source", ")", "openTarComponent", "(", "componentPath", "string", ")", "(", "<mask>", ".", "ReadCloser", ",", "error", ")", "{", "f", ",", "err", ":=", "os", ".", "Open", "(", "s", ".", "tarPath", ")", "\n", "if", "err", "!=...
24,768
all-24769
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "the", "current", "program", "object" ]
[ "func", "Uniform2fv", "(", "location", "int32", ",", "<mask>", "int32", ",", "value", "*", "float32", ")", "{", "C", ".", "glowUniform2fv", "(", "gpUniform2fv", ",", "(", "C", ".", "GLint", ")", "(", "location", ")", ",", "(", "C", ".", "GLsizei", ")...
24,769
all-24770
[ "EndOfDay", "end", "of", "day" ]
[ "func", "(", "now", "*", "Now", ")", "EndOfDay", "(", ")", "time", ".", "Time", "{", "y", ",", "m", ",", "d", ":=", "now", ".", "Date", "(", ")", "\n", "return", "time", ".", "Date", "(", "y", ",", "m", ",", "d", ",", "23", ",", "59", ","...
24,770
all-24771
[ "AllByXPath", "finds", "zero", "or", "more", "elements", "by", "XPath", "selector", "." ]
[ "func", "(", "s", "*", "selectable", ")", "AllByXPath", "(", "selector", "string", ")", "*", "MultiSelection", "{", "return", "newMultiSelection", "(", "s", ".", "<mask>", ",", "s", ".", "selectors", ".", "Append", "(", "target", ".", "XPath", ",", "sele...
24,771
all-24772
[ "ReadBoolSetting", "reads", "value", "of", "a", "given", "bool", "setting", "." ]
[ "func", "ReadBoolSetting", "(", "db", "*", "reform", ".", "Querier", ",", "key", "string", ")", "(", "bool", ",", "error", ")", "{", "val", ",", "err", ":=", "ReadSetting", "(", "db", ",", "key", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
24,772
all-24773
[ "GetQuery", "returns", "the", "Query", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "m", "*", "ManageStatusDefinition", ")", "GetQuery", "(", ")", "string", "{", "if", "m", "==", "nil", "||", "m", ".", "Query", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "m", ".", "<mask>", "\n", "}" ]
24,773
all-24774
[ "Delete", "is", "equivalent", "of", "Txn", ".", "Delete", "." ]
[ "func", "(", "wb", "*", "WriteBatch", ")", "Delete", "(", "k", "[", "]", "<mask>", ")", "error", "{", "wb", ".", "Lock", "(", ")", "\n", "defer", "wb", ".", "Unlock", "(", ")", "\n\n", "if", "err", ":=", "wb", ".", "txn", ".", "Delete", "(", ...
24,774
all-24775
[ "RenameContainerBackup", "requests", "that", "LXD", "renames", "the", "backup" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "RenameContainerBackup", "(", "containerName", "string", ",", "name", "string", ",", "backup", "api", ".", "ContainerBackupPost", ")", "(", "<mask>", ",", "error", ")", "{", "if", "!", "r", ".", "HasExtension", "(...
24,775
all-24776
[ "GetSelectionBounds", "is", "a", "wrapper", "around", "gtk_editable_get_selection_bounds", "()", "." ]
[ "func", "(", "v", "*", "Editable", ")", "GetSelectionBounds", "(", ")", "(", "<mask>", ",", "end", "int", ",", "nonEmpty", "bool", ")", "{", "var", "cstart", ",", "cend", "C", ".", "gint", "\n", "c", ":=", "C", ".", "gtk_editable_get_selection_bounds", ...
24,776
all-24777
[ "SentinelAddrs", "returns", "a", "slice", "of", "known", "Sentinel", "addresses", "Sentinel", "server", "aware", "of", "." ]
[ "func", "(", "s", "*", "Sentinel", ")", "SentinelAddrs", "(", ")", "(", "[", "]", "string", ",", "error", ")", "{", "res", ",", "err", ":=", "s", ".", "doUntilSuccess", "(", "func", "(", "c", "redis", ".", "Conn", ")", "(", "<mask>", "{", "}", ...
24,777
all-24778
[ "GetTitle", "()", "is", "a", "wrapper", "around", "gtk_tree_view_column_get_title", "()", "." ]
[ "func", "(", "v", "*", "TreeViewColumn", ")", "GetTitle", "(", ")", "string", "{", "return", "C", ".", "GoString", "(", "(", "*", "C", ".", "<mask>", ")", "(", "C", ".", "gtk_tree_view_column_get_title", "(", "v", ".", "native", "(", ")", ")", ")", ...
24,778
all-24779
[ "Delete", "the", "given", "key", "rows", "from", "the", "given", "config", "table", "." ]
[ "func", "deleteConfig", "(", "tx", "*", "sql", ".", "Tx", ",", "table", "string", ",", "keys", "[", "]", "string", ")", "error", "{", "n", ":=", "len", "(", "keys", ")", "\n\n", "if", "n", "==", "0", "{", "return", "nil", "// Nothing to delete.", "...
24,779
all-24780
[ "NewComputeUtil", "creates", "and", "initializes", "a", "ComputeUtil", "." ]
[ "func", "newComputeUtil", "(", "driver", "*", "Driver", ")", "(", "*", "ComputeUtil", ",", "error", ")", "{", "client", ",", "err", ":=", "google", ".", "DefaultClient", "(", "oauth2", ".", "NoContext", ",", "raw", ".", "ComputeScope", ")", "\n", "if", ...
24,780
all-24781
[ "Fatal", "records", "the", "log", "with", "fatal", "level", "and", "exits" ]
[ "func", "Fatal", "(", "args", "...", "<mask>", "{", "}", ")", "{", "logger", ".", "Output", "(", "2", ",", "LevelFatal", ",", "fmt", ".", "Sprint", "(", "args", "...", ")", ")", "\n", "os", ".", "Exit", "(", "1", ")", "\n", "}" ]
24,781
all-24782
[ "FreeOSMemory", "forces", "jemalloc", "to", "scrub", "memory", "and", "release", "back", "to", "OS" ]
[ "func", "FreeOSMemory", "(", ")", "<mask>", "{", "errCode", ":=", "int", "(", "C", ".", "mm_free2os", "(", ")", ")", "\n", "if", "errCode", "!=", "0", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "errCode", ")", "\n", "}", "\n\n", "...
24,782
all-24783
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniformMatrix4x3fv", "(", "program", "uint32", ",", "<mask>", "int32", ",", "count", "int32", ",", "transpose", "bool", ",", "value", "*", "float32", ")", "{", "C", ".", "glowProgramUniformMatrix4x3fv", "(", "gpProgramUniformMatrix4x3fv", ",", "(",...
24,783
all-24784
[ "GetStringBounds", "returns", "the", "approximate", "pixel", "bounds", "of", "the", "string", "s", "at", "x", "y", ".", "The", "left", "edge", "of", "the", "em", "square", "of", "the", "first", "character", "of", "s", "and", "the", "baseline", "intersect",...
[ "func", "(", "gc", "*", "GraphicContext", ")", "GetStringBounds", "(", "s", "string", ")", "(", "<mask>", ",", "top", ",", "right", ",", "bottom", "float64", ")", "{", "_", ",", "h", ":=", "gc", ".", "pdf", ".", "GetFontSize", "(", ")", "\n", "d", ...
24,784
all-24785
[ "GetUrl", "returns", "the", "Url", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "s", "*", "SyntheticsRequest", ")", "GetUrl", "(", ")", "<mask>", "{", "if", "s", "==", "nil", "||", "s", ".", "Url", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "s", ".", "Url", "\n", "}" ]
24,785
all-24786
[ "HasType", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "e", "*", "EventTimelineDefinition", ")", "HasType", "(", ")", "bool", "{", "if", "e", "!=", "nil", "&&", "e", ".", "<mask>", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
24,786
all-24787
[ "ForceWatching", "is", "used", "to", "force", "setting", "the", "internal", "state", "of", "watching", "a", "dependency", ".", "This", "is", "only", "used", "for", "unit", "testing", "purposes", "." ]
[ "func", "(", "w", "*", "Watcher", ")", "ForceWatching", "(", "d", "dep", ".", "Dependency", ",", "enabled", "bool", ")", "{", "w", ".", "Lock", "(", ")", "\n", "defer", "w", ".", "Unlock", "(", ")", "\n\n", "if", "enabled", "{", "w", ".", "depVie...
24,787
all-24788
[ "Valid", "validator" ]
[ "func", "(", "h", "*", "headerRule", ")", "Valid", "(", "w", "<mask>", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "bool", "{", "return", "h", ".", "valid", "(", "w", ".", "Header", "(", ")", ".", "Get", ")", "\n", "}" ]
24,788
all-24789
[ "processHeartbeat", "is", "a", "special", "handler", "used", "just", "for", "heartbeat", "requests", "so", "that", "they", "can", "be", "fast", "-", "pathed", "if", "a", "transport", "supports", "it", ".", "This", "must", "only", "be", "called", "from", "t...
[ "func", "(", "r", "*", "Raft", ")", "processHeartbeat", "(", "rpc", "RPC", ")", "{", "defer", "metrics", ".", "MeasureSince", "(", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", "}", ",", "time", ".", "Now", "(", ")", ")...
24,789
all-24790
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "apps", "params" ]
[ "func", "(", "o", "*", "GetAppsParams", ")", "WithHTTPClient", "(", "client", "*", "<mask>", ".", "Client", ")", "*", "GetAppsParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
24,790
all-24791
[ "NewEventStreamReader", "creates", "an", "instance", "of", "EventStreamReader", "." ]
[ "func", "NewEventStreamReader", "(", "eventStream", "io", ".", "Reader", ")", "*", "EventStreamReader", "{", "scanner", ":=", "bufio", ".", "NewScanner", "(", "eventStream", ")", "\n", "split", ":=", "func", "(", "data", "[", "]", "byte", ",", "atEOF", "bo...
24,791
all-24792
[ "OutgoingContextWithToken", "returns", "an", "outgoing", "context", "with", "the", "token" ]
[ "func", "OutgoingContextWithToken", "(", "ctx", "context", ".", "Context", ",", "token", "string", ")", "context", ".", "Context", "{", "return", "outgoingContextWithMergedMetadata", "(", "ctx", ",", "\"", "\"", ",", "<mask>", ")", "\n", "}" ]
24,792
all-24793
[ "GetEvaluationTimestamp", "returns", "the", "time", "the", "evaluation", "took", "place", "." ]
[ "func", "(", "r", "*", "AlertingRule", ")", "GetEvaluationTimestamp", "(", ")", "<mask>", ".", "Time", "{", "r", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "mtx", ".", "Unlock", "(", ")", "\n", "return", "r", ".", "evaluationTimestam...
24,793
all-24794
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "VolumeType", ")", "Locator", "(", "api", "*", "API", ")", "*", "VolumeTypeLocator", "{", "for", "_", ",", "l", ":=", "<mask>", "r", ".", "Links", "{", "if", "l", "[", "\"", "\"", "]", "==", "\"", "\"", "{", "return", "ap...
24,794
all-24795
[ "New", "creates", "a", "new", "Validate", "instance", "for", "use", "." ]
[ "func", "New", "(", "tagName", "string", ",", "funcs", "<mask>", "[", "string", "]", "Func", ")", "*", "Validate", "{", "structPool", "=", "&", "sync", ".", "Pool", "{", "New", ":", "newStructErrors", "}", "\n\n", "return", "&", "Validate", "{", "tagNa...
24,795
all-24796
[ "Format", "formats", "the", "node", "." ]
[ "func", "(", "node", "*", "SubstrExpr", ")", "Format", "(", "buf", "*", "TrackedBuffer", ")", "{", "if", "<mask>", ".", "To", "==", "nil", "{", "buf", ".", "Myprintf", "(", "\"", "\"", ",", "node", ".", "Name", ",", "node", ".", "From", ")", "\n"...
24,796
all-24797
[ "Synchronously", "uploads", "snapshots", "contained", "in", "the", "specified", "directory", ".", "It", "is", "safe", "to", "spawn", "a", "goroutine", "to", "run", "BTTracer", ".", "PutDir", "()", ".", "ConfigurePut", "should", "have", "returned", "successfully"...
[ "func", "(", "t", "*", "BTTracer", ")", "PutDir", "(", "path", "string", ")", "error", "{", "t", ".", "Logf", "(", "LogDebug", ",", "\"", "\\n", "\"", ",", "<mask>", ")", "\n", "return", "filepath", ".", "Walk", "(", "path", ",", "putDirWalk", "(",...
24,797
all-24798
[ "Save", "triggers", "a", "save", "to", "file", "though", "respects", "a", "minimum", "save", "interval", "to", "wait", "between", "saves", "." ]
[ "func", "(", "manager", "*", "basicStateManager", ")", "Save", "(", ")", "error", "{", "defer", "metrics", ".", "MetricsEngineGlobal", ".", "RecordStateManagerMetric", "(", "\"", "\"", ")", "(", ")", "\n", "manager", ".", "saveTimesLock", ".", "Lock", "(", ...
24,798
all-24799
[ "AddModuleLevel", "wraps", "a", "log", "backend", "with", "knobs", "to", "have", "different", "log", "levels", "for", "different", "modules", "." ]
[ "func", "AddModuleLevel", "(", "backend", "Backend", ")", "LeveledBackend", "{", "<mask>", "leveled", "LeveledBackend", "\n", "var", "ok", "bool", "\n", "if", "leveled", ",", "ok", "=", "backend", ".", "(", "LeveledBackend", ")", ";", "!", "ok", "{", "leve...
24,799
all-24800
[ "simplifyOne", "simplifies", "a", "single", "AST", ".", "It", "returns", "nil", "if", "there", "is", "nothing", "to", "do", "." ]
[ "func", "simplifyOne", "(", "a", "AST", ")", "AST", "{", "switch", "a", ":=", "a", ".", "(", "type", ")", "{", "case", "*", "TemplateParam", ":", "if", "a", ".", "Template", "!=", "nil", "&&", "a", ".", "Index", "<", "len", "(", "a", ".", "Temp...