id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
21,900
all-21901
[ "NewTxnCommand", "returns", "the", "cobra", "command", "for", "txn", "." ]
[ "func", "NewTxnCommand", "(", ")", "*", "cobra", ".", "Command", "{", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ",", "Run", ":", "txnCommandFunc", ",", "}", "\n", "cmd", ".", "Flags", "...
21,901
all-21902
[ "SetAppliedStatus", "sets", "the", "applied", "status", "of", "resource", "and", "returns", "whether", "the", "resource", "is", "already", "in", "a", "transition" ]
[ "func", "(", "auth", "*", "ASMAuthResource", ")", "SetAppliedStatus", "(", "status", "resourcestatus", ".", "ResourceStatus", ")", "bool", "{", "auth", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "auth", ".", "lock", ".", "Unlock", "(", ")", "\n\n...
21,902
all-21903
[ "MakeDisjointSet", "creates", "a", "DisjointSet", "." ]
[ "func", "MakeDisjointSet", "(", "forests", "*", "Forests", ",", "name", "string", ")", "{", "newDS", ":=", "&", "DisjointSet", "{", "}", "\n", "newDS", ".", "represent", "=", "name", "\n", "<mask>", ":=", "make", "(", "map", "[", "string", "]", "struct...
21,903
all-21904
[ "SettingsNewWithBackendAndPath", "is", "a", "wrapper", "around", "g_settings_new_with_backend_and_path", "()", "." ]
[ "func", "SettingsNewWithBackendAndPath", "(", "schemaID", "string", ",", "backend", "*", "SettingsBackend", ",", "path", "string", ")", "*", "Settings", "{", "cstr1", ":=", "(", "*", "C", ".", "gchar", ")", "(", "C", ".", "CString", "(", "schemaID", ")", ...
21,904
all-21905
[ "NewClient", "creates", "a", "new", "Client", "." ]
[ "func", "NewClient", "(", "client", "*", "http", ".", "Client", ",", "hostname", "string", ")", "*", "Client", "{", "return", "&", "<mask>", "{", "client", ",", "hostname", "}", "\n", "}" ]
21,905
all-21906
[ "Loop", "..." ]
[ "func", "(", "app", "*", "App", ")", "Loop", "(", ")", "{", "app", ".", "RLock", "(", ")", "\n", "exitChan", ":=", "app", ".", "exit", "\n", "app", ".", "RUnlock", "(", ")", "\n\n", "if", "exitChan", "!=", "nil", "{", "<-", "app", ".", "<mask>"...
21,906
all-21907
[ "merge", "merges", "data", "from", "bb", "into", "bbsrc", "." ]
[ "func", "(", "bb", "*", "bucketBuffer", ")", "merge", "(", "bbsrc", "*", "bucketBuffer", ")", "{", "for", "i", ":=", "0", ";", "i", "<", "bbsrc", ".", "used", ";", "i", "++", "{", "bb", ".", "add", "(", "bbsrc", ".", "buf", "[", "i", "]", "."...
21,907
all-21908
[ "roleIsManaged", "checks", "if", "the", "role", "should", "be", "managed", "(", "and", "thus", "deleted", ")", "by", "us", "In", "particular", "we", "want", "to", "avoid", "system", "AWS", "roles", "or", "roles", "that", "might", "support", "test", "-", ...
[ "func", "roleIsManaged", "(", "role", "*", "iam", ".", "Role", ")", "bool", "{", "name", ":=", "aws", ".", "StringValue", "(", "role", ".", "RoleName", ")", "\n", "path", ":=", "aws", ".", "StringValue", "(", "role", ".", "Path", ")", "\n\n", "// Mos...
21,908
all-21909
[ "NewImageSource", "returns", "a", "types", ".", "ImageSource", "for", "this", "reference", ".", "The", "caller", "must", "call", ".", "Close", "()", "on", "the", "returned", "ImageSource", "." ]
[ "func", "(", "ref", "ostreeReference", ")", "NewImageSource", "(", "ctx", "context", ".", "Context", ",", "sys", "*", "types", ".", "SystemContext", ")", "(", "types", ".", "ImageSource", ",", "error", ")", "{", "var", "tmpDir", "string", "\n", "if", "sy...
21,909
all-21910
[ "TriggerWithDetails", "triggers", "an", "incident", "using", "the", "default", "client", "with", "a", "description", "string", "and", "a", "key", "-", "value", "map", "that", "will", "be", "saved", "as", "the", "incident", "s", "details", "." ]
[ "func", "TriggerWithDetails", "(", "description", "string", ",", "details", "<mask>", "[", "string", "]", "interface", "{", "}", ")", "(", "incidentKey", "string", ",", "err", "error", ")", "{", "return", "trigger", "(", "description", ",", "\"", "\"", ","...
21,910
all-21911
[ "SetGauge", "sets", "a", "gauge", "to", "a", "value" ]
[ "func", "(", "m", "*", "CirconusMetrics", ")", "SetGauge", "(", "metric", "string", ",", "val", "<mask>", "{", "}", ")", "{", "m", ".", "gm", ".", "Lock", "(", ")", "\n", "defer", "m", ".", "gm", ".", "Unlock", "(", ")", "\n", "m", ".", "gauges...
21,911
all-21912
[ "Compute", "API", "URL", "given", "a", "scheme", "hostname", "and", "a", "path" ]
[ "func", "buildURL", "(", "<mask>", ",", "path", "string", ")", "string", "{", "scheme", ":=", "\"", "\"", "\n", "if", "httpclient", ".", "Insecure", "{", "scheme", "=", "\"", "\"", "\n", "}", "\n", "u", ":=", "url", ".", "URL", "{", "Scheme", ":", ...
21,912
all-21913
[ "Start", "a", "Service", "and", "log", "its", "output", "." ]
[ "func", "(", "s", "*", "ServiceMock", ")", "Start", "(", ")", "*", "exec", ".", "Cmd", "{", "s", ".", "ServiceStartCount", "++", "\n", "cmd", ":=", "s", ".", "ExecFunc", "(", ")", "\n", "cmd", ".", "Start", "(", ")", "\n", "if", "s", ".", "proc...
21,913
all-21914
[ "Update", "updates", "a", "vsphere_virtual_machine", "disk", "sub", "-", "resource", "." ]
[ "func", "(", "r", "*", "DiskSubresource", ")", "Update", "(", "l", "<mask>", ".", "VirtualDeviceList", ")", "(", "[", "]", "types", ".", "BaseVirtualDeviceConfigSpec", ",", "error", ")", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "r", ")", "\n", ...
21,914
all-21915
[ "String", "returns", "the", "position", "of", "the", "string", "that", "begins", "at", "the", "specified", "pos" ]
[ "func", "String", "(", "in", "[", "]", "byte", ",", "<mask>", "int", ")", "(", "int", ",", "error", ")", "{", "pos", ",", "err", ":=", "skipSpace", "(", "in", ",", "pos", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "err", "\...
21,915
all-21916
[ "void", "pango_cairo_layout_path", "(", "cairo_t", "*", "cr", "PangoLayout", "*", "layout", ")", ";" ]
[ "func", "CairoLayoutPath", "(", "cr", "*", "cairo", ".", "Context", ",", "layout", "*", "Layout", ")", "{", "C", ".", "pango_cairo_layout_path", "(", "cairo_context", "(", "cr", ")", ",", "<mask>", ".", "native", "(", ")", ")", "\n", "}" ]
21,916
all-21917
[ "DecodeCenter", "decodes", "the", "string", "geohash", "to", "the", "central", "point", "of", "the", "bounding", "box", "." ]
[ "func", "DecodeCenter", "(", "hash", "string", ")", "(", "lat", ",", "lng", "float64", ")", "{", "box", ":=", "BoundingBox", "(", "<mask>", ")", "\n", "return", "box", ".", "Center", "(", ")", "\n", "}" ]
21,917
all-21918
[ "Validate", "validates", "this", "Vm", "response" ]
[ "func", "(", "m", "*", "VMResponse", ")", "Validate", "(", "formats", "strfmt", ".", "Registry", ")", "error", "{", "var", "res", "[", "]", "error", "\n\n", "if", "err", ":=", "m", ".", "validateVM", "(", "formats", ")", ";", "err", "!=", "nil", "{...
21,918
all-21919
[ "HasAutoscale", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TileDef", ")", "HasAutoscale", "(", ")", "bool", "{", "if", "t", "!=", "nil", "&&", "t", ".", "Autoscale", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
21,919
all-21920
[ "GetRepoLabels", "returns", "the", "list", "of", "labels", "accessible", "to", "org", "/", "repo", ".", "See", "https", ":", "//", "developer", ".", "github", ".", "com", "/", "v3", "/", "issues", "/", "labels", "/", "#list", "-", "all", "-", "labels",...
[ "func", "(", "c", "*", "Client", ")", "GetRepoLabels", "(", "org", ",", "repo", "string", ")", "(", "[", "]", "Label", ",", "error", ")", "{", "c", ".", "<mask>", "(", "\"", "\"", ",", "org", ",", "repo", ")", "\n", "return", "c", ".", "getLabe...
21,920
all-21921
[ "returns", "a", "list", "of", "countries", "where", "Twilio", "voice", "services", "are", "available", "and", "the", "corresponding", "URL", "for", "retrieving", "the", "country", "specific", "voice", "prices", "." ]
[ "func", "(", "cvps", "*", "CountryVoicePriceService", ")", "GetPage", "(", "ctx", "context", ".", "Context", ",", "data", "<mask>", ".", "Values", ")", "(", "*", "CountriesPricePage", ",", "error", ")", "{", "return", "cvps", ".", "GetPageIterator", "(", "...
21,921
all-21922
[ "absorbBlockBlake2Safe", "Performs", "an", "absorb", "operation", "for", "a", "single", "block", "(", "BLOCK_LEN_BLAKE2_SAFE_INT64", "words", "of", "type", "uint64_t", ")", "using", "Blake2b", "s", "G", "function", "as", "the", "internal", "permutation" ]
[ "func", "absorbBlockBlake2Safe", "(", "state", "[", "]", "uint64", ",", "in", "[", "]", "uint64", ")", "{", "//XORs the first BLOCK_LEN_BLAKE2_SAFE_INT64 words of \"in\" with the current state", "state", "[", "0", "]", "^=", "in", "[", "0", "]", "\n", "state", "["...
21,922
all-21923
[ "CommentPruner", "will", "return", "the", "commentpruner", ".", "EventClient", "attached", "to", "the", "agent", "or", "an", "error", "if", "one", "is", "not", "attached", "." ]
[ "func", "(", "a", "*", "Agent", ")", "CommentPruner", "(", ")", "(", "*", "commentpruner", ".", "EventClient", ",", "error", ")", "{", "if", "a", ".", "commentPruner", "==", "nil", "{", "return", "nil", ",", "<mask>", ".", "New", "(", "\"", "\"", "...
21,923
all-21924
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventAttributeModified", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom68", "(", "&", ...
21,924
all-21925
[ "GetEndpoints", "returns", "endpoints", "." ]
[ "func", "(", "h", "*", "Handler", ")", "GetEndpoints", "(", "tkn", ",", "channel", ",", "template", "string", ")", "(", "[", "]", "data", ".", "Endpoint", ",", "error", ")", "{", "logger", ":=", "h", ".", "logger", ".", "Add", "(", "\"", "\"", ",...
21,925
all-21926
[ "GetTitleAlignOk", "returns", "a", "tuple", "with", "the", "TitleAlign", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "CheckStatusDefinition", ")", "GetTitleAlignOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "c", "==", "nil", "||", "c", ".", "TitleAlign", "==", "nil", "{", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n", "r...
21,926
all-21927
[ "Handle", "appends", "message", "to", "Messages", "array", "." ]
[ "func", "(", "handler", "*", "MemoryHandler", ")", "Handle", "(", "record", "*", "Record", ")", "error", "{", "handler", ".", "lock", ".", "Lock", "(", ")", "\n", "handler", ".", "Messages", "=", "append", "(", "handler", ".", "Messages", ",", "<mask>"...
21,927
all-21928
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "RemoveDOMStorageItemParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomstorage2", "(", "&", "w", ",", ...
21,928
all-21929
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventResourceChangedPriority", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork49", "(", "&", "w", ",", ...
21,929
all-21930
[ "Resolve", "resolves", "the", "URL", "host", "to", "its", "IP", "address", ".", "It", "s", "a", "shortcut", "for", "Parse", "()", "and", "Resolve", "()", "funcs", "." ]
[ "func", "ResolveString", "(", "rawURL", "string", ")", "(", "*", "<mask>", ".", "IPAddr", ",", "error", ")", "{", "u", ",", "err", ":=", "Parse", "(", "rawURL", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n...
21,930
all-21931
[ "SetFinishedAt", "sets", "the", "timestamp", "for", "container", "s", "stopped", "time" ]
[ "func", "(", "c", "*", "Container", ")", "SetFinishedAt", "(", "finishedAt", "time", ".", "Time", ")", "{", "if", "finishedAt", ".", "IsZero", "(", ")", "{", "return", "\n", "}", "\n\n", "c", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "c", ...
21,931
all-21932
[ "UpdateLoadbalancer", "updates", "a", "load", "balancer" ]
[ "func", "(", "c", "*", "Client", ")", "UpdateLoadbalancer", "(", "dcid", "string", ",", "lbalid", "string", ",", "obj", "LoadbalancerProperties", ")", "(", "*", "Loadbalancer", ",", "error", ")", "{", "url", ":=", "lbalPath", "(", "dcid", ",", "lbalid", ...
21,932
all-21933
[ "StoragePoolVolumeCreate", "creates", "a", "new", "storage", "volume", "attached", "to", "a", "given", "storage", "pool", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "StoragePoolVolumeCreate", "(", "project", ",", "volumeName", ",", "volumeDescription", "string", ",", "volumeType", "int", ",", "snapshot", "bool", ",", "poolID", "int64", ",", "volumeConfig", "map", "[", "string", "]", ...
21,933
all-21934
[ "DisableRule", "disables", "specific", "rule", "." ]
[ "func", "(", "s", "*", "Seekret", ")", "DisableRule", "(", "name", "string", ")", "error", "{", "return", "setRuleEnabled", "(", "s", ".", "ruleList", ",", "<mask>", ",", "false", ")", "\n", "}" ]
21,934
all-21935
[ "Do", "executes", "Network", ".", "setExtraHTTPHeaders", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetExtraHTTPHeadersParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetExtraHTTPHeaders", ",", "p", ",", "nil", ")", "\n", "}...
21,935
all-21936
[ "Validate", "ensures", "that", "the", "set", "of", "options", "are", "self", "-", "consistent", "and", "valid" ]
[ "func", "(", "o", "*", "Options", ")", "Validate", "(", ")", "error", "{", "if", "o", ".", "ProcessLog", "==", "\"", "\"", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "o", ".", "MarkerFile", "==", "\"", "...
21,936
all-21937
[ "Encrypt", "encrypts", "the", "given", "text", "with", "a", "hard", "-", "coded", "secret", ".", "Not", "truly", "secure", "." ]
[ "func", "Encrypt", "(", "text", "string", ")", "(", "string", ",", "error", ")", "{", "bytes", ":=", "[", "]", "byte", "(", "text", ")", "\n", "key", ":=", "seekret", "(", ")", "\n", "block", ",", "err", ":=", "aes", ".", "NewCipher", "(", "key",...
21,937
all-21938
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventCacheStorageListUpdated", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage9", "("...
21,938
all-21939
[ "NewHelperMap", "containing", "all", "of", "the", "default", "helpers", "from", "plush", ".", "Helpers", "." ]
[ "func", "NewHelperMap", "(", ")", "(", "HelperMap", ",", "error", ")", "{", "hm", ":=", "HelperMap", "{", "helpers", ":", "map", "[", "string", "]", "<mask>", "{", "}", "{", "}", ",", "moot", ":", "&", "sync", ".", "Mutex", "{", "}", ",", "}", ...
21,939
all-21940
[ "Open", "returns", "a", "fresh", "file", "for", "writing", ".", "Rename", "the", "file", "before", "calling", "Open", "again", "or", "there", "will", "be", "file", "collisions", "." ]
[ "func", "(", "fp", "*", "filePipeline", ")", "Open", "(", ")", "(", "f", "*", "fileutil", ".", "LockedFile", ",", "err", "error", ")", "{", "select", "{", "<mask>", "f", "=", "<-", "fp", ".", "filec", ":", "case", "err", "=", "<-", "fp", ".", "...
21,940
all-21941
[ "Metric", "will", "query", "current", "metric", "for", "target", "resource", "type", ".", "Return", "a", "common", ".", "Metric", "object", "on", "success", "." ]
[ "func", "(", "c", "*", "<mask>", ")", "Metric", "(", "rtype", "string", ")", "(", "common", ".", "Metric", ",", "error", ")", "{", "return", "c", ".", "metric", "(", "rtype", ")", "\n", "}" ]
21,941
all-21942
[ "typeName", "returns", "a", "string", "representing", "the", "type", "of", "this", "object", "." ]
[ "func", "typeName", "(", "c", "*", "gocore", ".", "Process", ",", "x", "gocore", ".", "Object", ")", "string", "{", "size", ":=", "c", ".", "Size", "(", "x", ")", "\n", "typ", ",", "repeat", ":=", "c", ".", "Type", "(", "x", ")", "\n", "if", ...
21,942
all-21943
[ "ReadOnly", "tells", "whether", "or", "not", "the", "VM", "is", "read", "-", "only", "." ]
[ "func", "(", "v", "*", "VM", ")", "ReadOnly", "(", ")", "(", "bool", ",", "error", ")", "{", "var", "err", "C", ".", "VixError", "=", "C", ".", "VIX_OK", "\n", "readonly", ":=", "C", ".", "VIX_PROPERTY_NONE", "\n\n", "err", "=", "C", ".", "get_pr...
21,943
all-21944
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "BucketEntry" ]
[ "func", "(", "u", "BucketEntry", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "BucketEntryType", "(", "sw", ")", "{", "case", "BucketEntryTypeLiveentry", ":", "return", "\"", "\"", ",", "true", "\n", "case...
21,944
all-21945
[ "CloudAccountLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "CloudAccountLocator", "(", "href", "<mask>", ")", "*", "CloudAccountLocator", "{", "return", "&", "CloudAccountLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
21,945
all-21946
[ "Execute", "returns", "an", "Error", "LintResult", "if", "the", "certificate", "is", "not", "an", "EV", "certificate", ".", "CheckApplies", "has", "already", "verified", "the", "certificate", "contains", "one", "or", "more", ".", "onion", "subjects", "and", "s...
[ "func", "(", "l", "*", "onionNotEV", ")", "Execute", "(", "c", "*", "x509", ".", "Certificate", ")", "*", "LintResult", "{", "/*\n\t * Effective May 1, 2015, each CA SHALL revoke all unexpired Certificates with an\n\t * Internal Name using onion as the right-most label in an entry ...
21,946
all-21947
[ "Initialize", "fills", "the", "resource", "fileds" ]
[ "func", "(", "cgroup", "*", "CgroupResource", ")", "Initialize", "(", "resourceFields", "*", "taskresource", ".", "ResourceFields", ",", "taskKnownStatus", "status", ".", "TaskStatus", ",", "taskDesiredStatus", "<mask>", ".", "TaskStatus", ")", "{", "}" ]
21,947
all-21948
[ "Remove", "is", "a", "wrapper", "around", "gtk_tree_store_remove", "()", "." ]
[ "func", "(", "v", "*", "TreeStore", ")", "Remove", "(", "iter", "*", "TreeIter", ")", "bool", "{", "<mask>", "ti", "*", "C", ".", "GtkTreeIter", "\n", "if", "iter", "!=", "nil", "{", "ti", "=", "iter", ".", "native", "(", ")", "\n", "}", "\n", ...
21,948
all-21949
[ "===", "histogram_quantile", "(", "k", "ValueTypeScalar", "Vector", "ValueTypeVector", ")", "Vector", "===" ]
[ "func", "funcHistogramQuantile", "(", "vals", "[", "]", "Value", ",", "args", "Expressions", ",", "enh", "*", "EvalNodeHelper", ")", "Vector", "{", "q", ":=", "vals", "[", "0", "]", ".", "(", "Vector", ")", "[", "0", "]", ".", "V", "\n", "inVec", "...
21,949
all-21950
[ "NewURLsMapFromStringMap", "takes", "a", "map", "of", "strings", "and", "returns", "a", "URLsMap", ".", "The", "string", "values", "in", "the", "map", "can", "be", "multiple", "values", "separated", "by", "the", "sep", "string", "." ]
[ "func", "NewURLsMapFromStringMap", "(", "m", "<mask>", "[", "string", "]", "string", ",", "sep", "string", ")", "(", "URLsMap", ",", "error", ")", "{", "var", "err", "error", "\n", "um", ":=", "URLsMap", "{", "}", "\n", "for", "k", ",", "v", ":=", ...
21,950
all-21951
[ "CCAddrs", "returns", "a", "copy", "of", "MailBuilder", "with", "the", "specified", "CC", "addresses", "." ]
[ "func", "(", "p", "MailBuilder", ")", "CCAddrs", "(", "<mask>", "[", "]", "mail", ".", "Address", ")", "MailBuilder", "{", "p", ".", "cc", "=", "cc", "\n", "return", "p", "\n", "}" ]
21,951
all-21952
[ "FieldColumns", "converts", "thegiven", "fields", "to", "list", "of", "column", "names", "separated", "by", "a", "comma", "." ]
[ "func", "FieldColumns", "(", "fields", "[", "]", "*", "<mask>", ")", "string", "{", "columns", ":=", "make", "(", "[", "]", "string", ",", "len", "(", "fields", ")", ")", "\n\n", "for", "i", ",", "field", ":=", "range", "fields", "{", "columns", "[...
21,952
all-21953
[ "Get", "the", "address", "given", "a", "URL" ]
[ "func", "getAddress", "(", "rawURL", "string", ")", "string", "{", "parsedURL", ",", "err", ":=", "<mask>", ".", "Parse", "(", "rawURL", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", "\n", "}", "\n\n", "splitHost", ":=", "strings", ...
21,953
all-21954
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "StartRuleUsageTrackingParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss8", "(", ...
21,954
all-21955
[ "Save", "fetches", "snapshot", "from", "remote", "etcd", "server", "and", "saves", "data", "to", "target", "path", "." ]
[ "func", "(", "s", "*", "v3Manager", ")", "Save", "(", "ctx", "context", ".", "Context", ",", "cfg", "clientv3", ".", "Config", ",", "dbPath", "string", ")", "error", "{", "if", "len", "(", "cfg", ".", "Endpoints", ")", "!=", "1", "{", "return", "fm...
21,955
all-21956
[ "Stop", "gracefully", "shutsdown", "the", "producer", "cancelling", "all", "inflight", "requests", "and", "waiting", "for", "all", "backend", "connections", "to", "be", "closed", ".", "It", "is", "safe", "to", "call", "the", "method", "multiple", "times", "and...
[ "func", "(", "p", "*", "Producer", ")", "Stop", "(", ")", "{", "p", ".", "once", ".", "Do", "(", "p", ".", "<mask>", ")", "\n", "err", ":=", "errors", ".", "New", "(", "\"", "\"", ")", "\n\n", "for", "req", ":=", "range", "p", ".", "reqs", ...
21,956
all-21957
[ "HasLogQuery", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "ChangeRequest", ")", "HasLogQuery", "(", ")", "bool", "{", "if", "c", "!=", "nil", "&&", "c", ".", "LogQuery", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
21,957
all-21958
[ "/", "*", "we", "can", "ran", "this", "as", "binary", "for", "unit", "tests", "(", "for", "example", "build", "it", "on", "on", "one", "machine", "(", "mac", "or", "win", ")", "and", "run", "on", "other", "(", "linux", ")", "probably", "later", "wi...
[ "func", "main", "(", ")", "{", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "ipvs", ":=", "<mask>", "(", "gnl2go", ".", "IpvsClient", ")", "\n", "ipvs", ".", "Init", "(", ")", "\n", "defer", "ipvs", ".", "Exit", "(", ")", "\n", "data", ",...
21,958
all-21959
[ "Update", "a", "single", "image", ".", "The", "operation", "can", "be", "nil", "if", "no", "progress", "tracking", "is", "needed", ".", "Returns", "whether", "the", "image", "has", "been", "updated", "." ]
[ "func", "autoUpdateImage", "(", "d", "*", "Daemon", ",", "op", "*", "operation", ",", "id", "int", ",", "info", "*", "api", ".", "Image", ",", "project", "string", ")", "error", "{", "fingerprint", ":=", "info", ".", "Fingerprint", "\n", "_", ",", "s...
21,959
all-21960
[ "setPreviousReportState", "sets", "the", "github", "key", "for", "PrevReportStates", "to", "current", "state", ".", "This", "is", "a", "work", "-", "around", "for", "plank", "-", ">", "crier", "migration", "to", "become", "seamless", "." ]
[ "func", "(", "c", "*", "Controller", ")", "setPreviousReportState", "(", "pj", "prowapi", ".", "ProwJob", ")", "error", "{", "// fetch latest before replace", "latestPJ", ",", "err", ":=", "c", ".", "kc", ".", "GetProwJob", "(", "pj", ".", "ObjectMeta", ".",...
21,960
all-21961
[ "AccelGroupsActivate", "is", "a", "wrapper", "around", "gtk_accel_groups_activate", "()", "." ]
[ "func", "AccelGroupsActivate", "(", "obj", "*", "glib", ".", "<mask>", ",", "key", "uint", ",", "mods", "gdk", ".", "ModifierType", ")", "bool", "{", "return", "gobool", "(", "C", ".", "gtk_accel_groups_activate", "(", "(", "*", "C", ".", "GObject", ")",...
21,961
all-21962
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetTimeDomainParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance", "(", "&...
21,962
all-21963
[ "retrieve", "the", "label", "of", "a", "named", "object", "identified", "within", "a", "namespace" ]
[ "func", "GetObjectLabel", "(", "identifier", "uint32", ",", "name", "uint32", ",", "bufSize", "int32", ",", "length", "*", "int32", ",", "<mask>", "*", "uint8", ")", "{", "syscall", ".", "Syscall6", "(", "gpGetObjectLabel", ",", "5", ",", "uintptr", "(", ...
21,963
all-21964
[ "SafeCreate", "creates", "a", "file", "creating", "parent", "directories", "if", "needed" ]
[ "func", "SafeCreate", "(", "name", "...", "string", ")", "(", "file", "*", "os", ".", "File", ",", "err", "error", ")", "{", "p", ",", "e", ":=", "ensurePath", "(", "path", ".", "Join", "(", "<mask>", "...", ")", ")", "\n\n", "if", "e", "!=", "...
21,964
all-21965
[ "Fetch", "the", "binary", "from", "the", "provided", "Repository" ]
[ "func", "(", "h", "*", "Github", ")", "Fetch", "(", ")", "(", "io", ".", "Reader", ",", "error", ")", "{", "//delay fetches after first", "if", "h", ".", "delay", "{", "time", ".", "Sleep", "(", "h", ".", "Interval", ")", "\n", "}", "\n", "h", "....
21,965
all-21966
[ "WithFunction", "adds", "a", "function", "to", "templates", "." ]
[ "func", "WithFunction", "(", "name", "string", ",", "fn", "interface", "{", "}", ")", "Option", "{", "return", "func", "(", "o", "*", "<mask>", ")", "{", "o", ".", "functions", "[", "name", "]", "=", "fn", "}", "\n", "}" ]
21,966
all-21967
[ "Describe", "implements", "prometheus", "Collector", "interface", "." ]
[ "func", "(", "c", "*", "Cache", ")", "Describe", "(", "in", "chan", "<-", "*", "prometheus", ".", "Desc", ")", "{", "c", ".", "hitsTotal", ".", "Describe", "(", "in", ")", "\n", "c", ".", "refreshTotal", ".", "Describe", "(", "in", ")", "\n", "c"...
21,967
all-21968
[ "AppendGzipBytesLevel", "appends", "gzipped", "src", "to", "dst", "using", "the", "given", "compression", "level", "and", "returns", "the", "resulting", "dst", ".", "Supported", "compression", "levels", "are", ":", "*", "CompressNoCompression", "*", "CompressBestSpe...
[ "func", "AppendGzipBytesLevel", "(", "dst", ",", "src", "[", "]", "byte", ",", "level", "int", ")", "[", "]", "<mask>", "{", "w", ":=", "&", "byteSliceWriter", "{", "dst", "}", "\n", "WriteGzipLevel", "(", "w", ",", "src", ",", "level", ")", "\n", ...
21,968
all-21969
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SamplingHeapProfileNode", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeapprofiler7", "(", "&", "w", ",", ...
21,969
all-21970
[ "GetModified", "returns", "the", "Modified", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "d", "*", "DashboardLite", ")", "GetModified", "(", ")", "<mask>", "{", "if", "d", "==", "nil", "||", "d", ".", "Modified", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "d", ".", "Modified", "\n", "}" ]
21,970
all-21971
[ "NewMemberRemoveCommand", "returns", "the", "cobra", "command", "for", "member", "remove", "." ]
[ "func", "NewMemberRemoveCommand", "(", ")", "*", "cobra", ".", "Command", "{", "cc", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ",", "Run", ":", "memberRemoveCommandFunc", ",", "}", "\n\n", "return",...
21,971
all-21972
[ "Md5", "functions" ]
[ "func", "(", "lo", "*", "largeObject", ")", "md5Content", "(", "r", "io", ".", "ReadSeeker", ")", "(", "string", ",", "string", ",", "error", ")", "{", "// #nosec G401", "h", ":=", "md5", ".", "New", "(", ")", "\n", "mw", ":=", "io", ".", "MultiWri...
21,972
all-21973
[ "SetErrorHandler", "returns", "Middleware", "that", "can", "be", "used", "to", "set", "the", "error", "handler" ]
[ "func", "SetErrorHandler", "(", "status", "int", ",", "handler", "ErrorHandler", ")", "scaffold", ".", "Middleware", "{", "return", "scaffold", ".", "Middleware", "(", "func", "(", "next", "scaffold", ".", "Handler", ")", "scaffold", ".", "Handler", "{", "re...
21,973
all-21974
[ "GetQuery", "returns", "the", "Query", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "t", "*", "TileDefRequest", ")", "GetQuery", "(", ")", "string", "{", "if", "t", "==", "nil", "||", "t", ".", "<mask>", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "t", ".", "Query", "\n", "}" ]
21,974
all-21975
[ "GetId", "returns", "the", "Id", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "b", "*", "Board", ")", "GetId", "(", ")", "string", "{", "if", "b", "==", "nil", "||", "b", ".", "Id", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "b", ".", "<mask>", "\n", "}" ]
21,975
all-21976
[ "SubscribeByTopicDescriptor", "lets", "you", "subscribe", "a", "topic", "using", "a", "pb", ".", "TopicDescriptor", "." ]
[ "func", "(", "p", "*", "PubSub", ")", "SubscribeByTopicDescriptor", "(", "td", "*", "pb", ".", "TopicDescriptor", ",", "opts", "...", "SubOpt", ")", "(", "*", "Subscription", ",", "error", ")", "{", "if", "td", ".", "GetAuth", "(", ")", ".", "GetMode",...
21,976
all-21977
[ "returns", "dialer", "that", "can", "dial", "the", "given", "address" ]
[ "func", "(", "d", "*", "Dialer", ")", "subDialerForAddr", "(", "raddr", "ma", ".", "Multiaddr", ")", "transport", ".", "Dialer", "{", "for", "_", ",", "pd", ":=", "<mask>", "d", ".", "Dialers", "{", "if", "pd", ".", "Matches", "(", "raddr", ")", "{...
21,977
all-21978
[ "Stop", "halts", "the", "execution", "of", "this", "runner", "and", "its", "subprocesses", "." ]
[ "func", "(", "r", "*", "<mask>", ")", "Stop", "(", ")", "{", "r", ".", "stopLock", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "stopLock", ".", "Unlock", "(", ")", "\n\n", "if", "r", ".", "stopped", "{", "return", "\n", "}", "\n\n", "log", ...
21,978
all-21979
[ "return", "parameters", "of", "a", "buffer", "object" ]
[ "func", "GetBufferParameteriv", "(", "target", "uint32", ",", "pname", "uint32", ",", "params", "*", "int32", ")", "{", "syscall", ".", "Syscall", "(", "gpGetBufferParameteriv", ",", "3", ",", "uintptr", "(", "<mask>", ")", ",", "uintptr", "(", "pname", ")...
21,979
all-21980
[ "ParseRate", "is", "a", "helper", "function", "to", "get", "all", "the", "Rate", "info" ]
[ "func", "ParseRate", "(", "resp", "*", "http", ".", "Response", ")", "*", "RateLimit", "{", "limit", ":=", "resp", ".", "Header", ".", "Get", "(", "headerRateLimit", ")", "\n", "<mask>", ":=", "resp", ".", "Header", ".", "Get", "(", "headerRatePath", "...
21,980
all-21981
[ "DeviceListString", "pretty", "-", "prints", "each", "device", "in", "a", "virtual", "device", "list", "used", "for", "logging", "purposes", "and", "what", "not", "." ]
[ "func", "DeviceListString", "(", "l", "object", ".", "VirtualDeviceList", ")", "string", "{", "var", "names", "[", "]", "string", "\n", "for", "_", ",", "d", ":=", "range", "l", "{", "if", "d", "==", "nil", "{", "names", "=", "append", "(", "names", ...
21,981
all-21982
[ "Insert", "marks", "this", "statement", "for", "insertion", "at", "the", "given", "index", ".", "If", "multiple", "statements", "are", "inserted", "at", "the", "same", "index", "they", "will", "be", "inserted", "in", "the", "order", "Insert", "is", "called",...
[ "func", "(", "l", "*", "Load", ")", "Insert", "(", "f", "*", "File", ",", "index", "int", ")", "{", "l", ".", "index", "=", "index", "\n", "l", ".", "inserted", "=", "<mask>", "\n", "f", ".", "Loads", "=", "append", "(", "f", ".", "Loads", ",...
21,982
all-21983
[ "GetInt", "returns", "int", "value", "for", "the", "given", "key" ]
[ "func", "(", "c", "GConfig", ")", "GetInt", "(", "key", "string", ")", "int", "{", "i", ",", "_", ":=", "strconv", ".", "Atoi", "(", "c", ".", "getStringValue", "(", "<mask>", ")", ")", "\n", "return", "i", "\n", "}" ]
21,983
all-21984
[ "HandleEvent", "handles", "a", "GitHub", "PR", "event", "to", "determine", "if", "the", "needs", "-", "rebase", "label", "needs", "to", "be", "added", "or", "removed", ".", "It", "depends", "on", "GitHub", "mergeability", "check", "to", "decide", "the", "n...
[ "func", "HandleEvent", "(", "log", "*", "logrus", ".", "Entry", ",", "ghc", "githubClient", ",", "pre", "*", "github", ".", "PullRequestEvent", ")", "error", "{", "if", "pre", ".", "Action", "!=", "github", ".", "PullRequestActionOpened", "&&", "pre", ".",...
21,984
all-21985
[ "ClientAfterCooperativeClose", "changed", "channel", "status", "to", "closed", "cooperative", "and", "launches", "of", "terminate", "service", "procedure", "." ]
[ "func", "(", "w", "*", "Worker", ")", "ClientAfterCooperativeClose", "(", "job", "*", "data", ".", "Job", ")", "error", "{", "logger", ":=", "w", ".", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "job", ")", "\n\n...
21,985
all-21986
[ "Initialize", "for", "sending", "metrics" ]
[ "func", "(", "cm", "*", "CheckManager", ")", "Initialize", "(", ")", "{", "// if not managing the check, quicker initialization", "if", "!", "cm", ".", "enabled", "{", "err", ":=", "cm", ".", "initializeTrapURL", "(", ")", "\n", "if", "err", "==", "nil", "{"...
21,986
all-21987
[ "NewBool", "creates", "a", "new", "Bool" ]
[ "func", "NewBool", "(", "b", "bool", ",", "valid", "bool", ")", "Bool", "{", "return", "Bool", "{", "NullBool", ":", "sql", ".", "NullBool", "{", "Bool", ":", "b", ",", "Valid", ":", "<mask>", ",", "}", ",", "}", "\n", "}" ]
21,987
all-21988
[ "AddStateChangeEvent", "queues", "up", "the", "state", "change", "event", "to", "be", "sent", "to", "ECS", ".", "If", "the", "event", "is", "for", "a", "container", "state", "change", "it", "just", "gets", "added", "to", "the", "handler", ".", "tasksToCont...
[ "func", "(", "<mask>", "*", "TaskHandler", ")", "AddStateChangeEvent", "(", "change", "statechange", ".", "Event", ",", "client", "api", ".", "ECSClient", ")", "error", "{", "handler", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "handler", ".", "l...
21,988
all-21989
[ "TemporaryDirectoryForBigFiles", "returns", "a", "directory", "for", "temporary", "(", "big", ")", "files", ".", "On", "non", "Windows", "systems", "it", "avoids", "the", "use", "of", "os", ".", "TempDir", "()", "because", "the", "default", "temporary", "direc...
[ "func", "TemporaryDirectoryForBigFiles", "(", ")", "string", "{", "<mask>", "temporaryDirectoryForBigFiles", "string", "\n", "if", "runtime", ".", "GOOS", "==", "\"", "\"", "{", "temporaryDirectoryForBigFiles", "=", "os", ".", "TempDir", "(", ")", "\n", "}", "el...
21,989
all-21990
[ "bind", "stages", "of", "a", "program", "object", "to", "a", "program", "pipeline" ]
[ "func", "UseProgramStages", "(", "pipeline", "uint32", ",", "stages", "uint32", ",", "<mask>", "uint32", ")", "{", "C", ".", "glowUseProgramStages", "(", "gpUseProgramStages", ",", "(", "C", ".", "GLuint", ")", "(", "pipeline", ")", ",", "(", "C", ".", "...
21,990
all-21991
[ "Initialize", "loads", "the", "consul", "KV", "s", "from", "the", "namespace", "into", "cache", "for", "later", "retrieval" ]
[ "func", "(", "c", "*", "cachedLoader", ")", "Initialize", "(", ")", "error", "{", "pairs", ",", "_", ",", "err", ":=", "c", ".", "consulKV", ".", "List", "(", "c", ".", "namespace", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
21,991
all-21992
[ "GetExecutablePath", "returns", "the", "absolute", "path", "to", "the", "currently", "running", "executable", ".", "It", "is", "used", "internally", "by", "the", "godaemon", "package", "and", "exported", "publicly", "because", "it", "s", "useful", "outside", "of...
[ "func", "GetExecutablePath", "(", ")", "(", "string", ",", "error", ")", "{", "PATH_MAX", ":=", "1024", "// From <sys/syslimits.h>", "\n", "exePath", ":=", "<mask>", "(", "[", "]", "byte", ",", "PATH_MAX", ")", "\n", "exeLen", ":=", "C", ".", "size_t", "...
21,992
all-21993
[ "ServeHTTP", "handle", "a", "pre", "-", "flight", "request", "." ]
[ "func", "(", "s", "*", "CORSPreflight", ")", "ServeHTTP", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "origin", ":=", "HttpHeader_Origin", "(", ")", ".", "GetReader", "(", "r", ".", "Header", ")", "\n", "...
21,993
all-21994
[ "FetchArtifacts", "constructs", "and", "returns", "Artifact", "objects", "for", "each", "artifact", "name", "in", "the", "list", ".", "This", "includes", "getting", "any", "handles", "needed", "for", "read", "write", "operations", "direct", "artifact", "links", ...
[ "func", "(", "s", "*", "Spyglass", ")", "FetchArtifacts", "(", "src", "string", ",", "podName", "string", ",", "sizeLimit", "int64", ",", "artifactNames", "[", "]", "string", ")", "(", "[", "]", "lenses", ".", "Artifact", ",", "error", ")", "{", "artSt...
21,994
all-21995
[ "reversePluginMaps", "inverts", "the", "Configuration", ".", "Plugins", "and", "Configuration", ".", "ExternalPlugins", "maps", "and", "expands", "any", "org", "strings", "to", "org", "/", "repo", "strings", ".", "The", "returned", "values", "map", "plugin", "na...
[ "func", "reversePluginMaps", "(", "config", "*", "plugins", ".", "Configuration", ",", "orgToRepos", "map", "[", "string", "]", "sets", ".", "String", ")", "(", "normal", ",", "external", "map", "[", "string", "]", "[", "]", "string", ")", "{", "normal",...
21,995
all-21996
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetMediaTextReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss17", "(", "&", "...
21,996
all-21997
[ "HasReadOnly", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "d", "*", "DashboardLite", ")", "HasReadOnly", "(", ")", "bool", "{", "if", "d", "!=", "nil", "&&", "d", ".", "ReadOnly", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
21,997
all-21998
[ "Move", "moves", "a", "virtual", "disk", "from", "one", "location", "to", "another", ".", "The", "move", "is", "not", "forced", ".", "srcPath", "needs", "to", "be", "a", "datastore", "path", "(", "ie", ":", "[", "datastore1", "]", "vm", "/", "vm", "....
[ "func", "Move", "(", "client", "*", "govmomi", ".", "Client", ",", "srcPath", "string", ",", "srcDC", "*", "object", ".", "Datacenter", ",", "dstPath", "string", ",", "dstDC", "*", "object", ".", "Datacenter", ")", "(", "string", ",", "error", ")", "{"...
21,998
all-21999
[ "GetVizTypeOk", "returns", "a", "tuple", "with", "the", "VizType", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "Widget", ")", "GetVizTypeOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "w", "==", "nil", "||", "w", ".", "VizType", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "w", ...
21,999
all-22000
[ "getStreamContext", "is", "used", "retrieve", "the", "current", "stream", "context", "." ]
[ "func", "(", "n", "*", "NetworkTransport", ")", "getStreamContext", "(", ")", "context", ".", "<mask>", "{", "n", ".", "streamCtxLock", ".", "RLock", "(", ")", "\n", "defer", "n", ".", "streamCtxLock", ".", "RUnlock", "(", ")", "\n", "return", "n", "."...