id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
4,600
all-4601
[ "MustManageDataOp", "retrieves", "the", "ManageDataOp", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
[ "func", "(", "u", "OperationBody", ")", "MustManageDataOp", "(", ")", "ManageDataOp", "{", "val", ",", "<mask>", ":=", "u", ".", "GetManageDataOp", "(", ")", "\n\n", "if", "!", "ok", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "v...
4,601
all-4602
[ "FetchBrokers", "returns", "all", "brokers", "available", "to", "the", "API", "Token", "." ]
[ "func", "(", "a", "*", "API", ")", "FetchBrokers", "(", ")", "(", "*", "[", "]", "Broker", ",", "error", ")", "{", "result", ",", "err", ":=", "a", ".", "Get", "(", "config", ".", "BrokerPrefix", ")", "\n", "if", "err", "!=", "nil", "{", "retur...
4,602
all-4603
[ "QueryString", "returns", "query", "string", "for", "the", "args", ".", "The", "returned", "value", "is", "valid", "until", "the", "next", "call", "to", "Args", "methods", "." ]
[ "func", "(", "a", "*", "Args", ")", "QueryString", "(", ")", "[", "]", "<mask>", "{", "a", ".", "buf", "=", "a", ".", "AppendBytes", "(", "a", ".", "buf", "[", ":", "0", "]", ")", "\n", "return", "a", ".", "buf", "\n", "}" ]
4,603
all-4604
[ "UnmarshalText", "unmarshals", "text", "to", "offset", ".", "It", "handles", "newest", "and", "oldest", "oterwise", "fallbacks", "to", "time", ".", "ParseDuration", "." ]
[ "func", "(", "o", "*", "Offset", ")", "UnmarshalText", "(", "text", "[", "]", "byte", ")", "error", "{", "offsetName", ":=", "string", "(", "<mask>", ")", "\n\n", "switch", "strings", ".", "ToLower", "(", "offsetName", ")", "{", "case", "\"", "\"", "...
4,604
all-4605
[ "HandlerFunc", "builds", "and", "returns", "a", "http", ".", "Handler", "from", "the", "chain", "of", "middlewares", "with", "h", "http", ".", "Handler", "as", "the", "final", "handler", "." ]
[ "func", "(", "mws", "Middlewares", ")", "HandlerFunc", "(", "h", "<mask>", ".", "HandlerFunc", ")", "http", ".", "Handler", "{", "return", "&", "ChainHandler", "{", "mws", ",", "h", ",", "chain", "(", "mws", ",", "h", ")", "}", "\n", "}" ]
4,605
all-4606
[ "NewConfig", "returns", "a", "new", "configuration", "instance", "with", "sane", "defaults", "." ]
[ "func", "NewConfig", "(", ")", "*", "Config", "{", "c", ":=", "&", "Config", "{", "Config", ":", "*", "sarama", ".", "NewConfig", "(", ")", ",", "}", "\n", "c", ".", "Group", ".", "PartitionStrategy", "=", "StrategyRange", "\n", "c", ".", "Group", ...
4,606
all-4607
[ "parseSeriesDesc", "parses", "the", "description", "of", "a", "time", "series", "." ]
[ "func", "parseSeriesDesc", "(", "input", "string", ")", "(", "labels", ".", "Labels", ",", "[", "]", "sequenceValue", ",", "error", ")", "{", "p", ":=", "newParser", "(", "input", ")", "\n", "p", ".", "lex", ".", "seriesDesc", "=", "<mask>", "\n\n", ...
4,607
all-4608
[ "PasswordCheck", "validates", "the", "provided", "password", "against", "the", "encoded", "secret" ]
[ "func", "PasswordCheck", "(", "secret", "string", ",", "password", "string", ")", "error", "{", "// No password set", "if", "secret", "==", "\"", "\"", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Compare the password", ...
4,608
all-4609
[ "PopAttributes", "restores", "saved", "with", "PushAttributes", "colors", ".", "Function", "does", "nothing", "if", "there", "is", "no", "saved", "colors" ]
[ "func", "PopAttributes", "(", ")", "{", "if", "len", "(", "canvas", ".", "attrStack", ")", "==", "0", "{", "return", "\n", "}", "\n", "a", ":=", "canvas", ".", "attrStack", "[", "len", "(", "canvas", ".", "attrStack", ")", "-", "1", "]", "\n", "c...
4,609
all-4610
[ "HasLabel", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TileDefMarker", ")", "HasLabel", "(", ")", "bool", "{", "if", "t", "!=", "nil", "&&", "t", ".", "<mask>", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
4,610
all-4611
[ "ConsulStringToStructFunc", "checks", "if", "the", "value", "set", "for", "the", "key", "should", "actually", "be", "a", "struct", "and", "sets", "the", "appropriate", "value", "in", "the", "struct", ".", "This", "is", "for", "backwards", "-", "compatability",...
[ "func", "ConsulStringToStructFunc", "(", ")", "mapstructure", ".", "DecodeHookFunc", "{", "return", "func", "(", "f", "reflect", ".", "Type", ",", "t", "reflect", ".", "Type", ",", "data", "interface", "{", "}", ")", "(", "interface", "{", "}", ",", "err...
4,611
all-4612
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "StopLoadingParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage4", "(", "&", "r"...
4,612
all-4613
[ "newProwJobs", "returns", "a", "ProwJobs" ]
[ "func", "newProwJobs", "(", "c", "*", "ProwV1Client", ",", "namespace", "string", ")", "*", "prowJobs", "{", "return", "&", "prowJobs", "{", "<mask>", ":", "c", ".", "RESTClient", "(", ")", ",", "ns", ":", "namespace", ",", "}", "\n", "}" ]
4,613
all-4614
[ "Set", "adds", "a", "uint16", "tag", "to", "the", "span" ]
[ "func", "(", "tag", "uint16TagName", ")", "Set", "(", "span", "opentracing", ".", "Span", ",", "value", "uint16", ")", "{", "span", ".", "SetTag", "(", "string", "(", "<mask>", ")", ",", "value", ")", "\n", "}" ]
4,614
all-4615
[ "NewClient", "creates", "a", "client", "with", "the", "given", "address", "URI", "or", "cluster", "and", "options", "." ]
[ "func", "NewClient", "(", "addrURIOrCluster", "interface", "{", "}", ",", "options", "...", "ClientOption", ")", "(", "*", "Client", ",", "error", ")", "{", "var", "cluster", "*", "Cluster", "\n", "clientOptions", ":=", "&", "ClientOptions", "{", "}", "\n"...
4,615
all-4616
[ "AppendEntriesPipeline", "returns", "an", "interface", "that", "can", "be", "used", "to", "pipeline", "AppendEntries", "requests", "." ]
[ "func", "(", "n", "*", "NetworkTransport", ")", "AppendEntriesPipeline", "(", "id", "ServerID", ",", "target", "ServerAddress", ")", "(", "AppendPipeline", ",", "error", ")", "{", "// Get a connection", "conn", ",", "err", ":=", "n", ".", "getConnFromAddressProv...
4,616
all-4617
[ "Generate", "API", "client", "code", "drives", "the", "code", "writer", "." ]
[ "func", "generateClient", "(", "descriptor", "*", "gen", ".", "APIDescriptor", ",", "codegen", "string", ")", "error", "{", "f", ",", "err", ":=", "os", ".", "Create", "(", "codegen", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "...
4,617
all-4618
[ "Eval", "evaluates", "the", "rule", "expression", "and", "then", "creates", "pending", "alerts", "and", "fires", "or", "removes", "previously", "pending", "alerts", "accordingly", "." ]
[ "func", "(", "r", "*", "AlertingRule", ")", "Eval", "(", "ctx", "context", ".", "Context", ",", "ts", "time", ".", "Time", ",", "query", "QueryFunc", ",", "externalURL", "*", "url", ".", "URL", ")", "(", "promql", ".", "Vector", ",", "error", ")", ...
4,618
all-4619
[ "AddUserToGroup", "adds", "a", "user", "to", "a", "group" ]
[ "func", "(", "c", "*", "Client", ")", "AddUserToGroup", "(", "groupid", "string", ",", "userid", "string", ")", "(", "*", "User", ",", "error", ")", "{", "<mask>", "usr", "User", "\n", "usr", ".", "ID", "=", "userid", "\n", "url", ":=", "umGroupUsers...
4,619
all-4620
[ "SizeOfSlice", "returns", "the", "XDR", "encoded", "size", "of", "the", "given", "[]", "T", ".", "Supported", "types", "for", "T", "are", "string", "[]", "byte", "and", "types", "implementing", "XDRSizer", ".", "SizeOfSlice", "panics", "if", "the", "paramete...
[ "func", "SizeOfSlice", "(", "ss", "interface", "{", "}", ")", "int", "{", "l", ":=", "0", "\n", "switch", "ss", ":=", "ss", ".", "(", "<mask>", ")", "{", "case", "[", "]", "string", ":", "for", "_", ",", "s", ":=", "range", "ss", "{", "l", "+...
4,620
all-4621
[ "MoveToFolder", "is", "a", "complex", "method", "that", "moves", "a", "datastore", "to", "a", "given", "relative", "datastore", "folder", "path", ".", "Relative", "here", "means", "relative", "to", "a", "datacenter", "which", "is", "discovered", "from", "the",...
[ "func", "MoveToFolder", "(", "client", "*", "govmomi", ".", "<mask>", ",", "ds", "*", "object", ".", "Datastore", ",", "relative", "string", ")", "error", "{", "f", ",", "err", ":=", "folder", ".", "DatastoreFolderFromObject", "(", "client", ",", "ds", "...
4,621
all-4622
[ "PutSecretValueWithContext", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "PutSecretValueWithContext", "(", "arg0", "aws", ".", "Context", ",", "arg1", "*", "secretsmanager", ".", "PutSecretValueInput", ",", "arg2", "...", "request", ".", "Option", ")", "(", "*", "secretsmanager", ...
4,622
all-4623
[ "Use", "load", "to", "read", "a", ".", "gitattributes", "file", "and", "populate", "g", "with", "the", "commands", ".", "Each", "line", "in", "gitattributes", "file", "is", "of", "form", ":", "pattern", "attr1", "attr2", "...", "That", "is", "a", "patter...
[ "func", "(", "g", "*", "<mask>", ")", "load", "(", "r", "io", ".", "Reader", ")", "error", "{", "s", ":=", "bufio", ".", "NewScanner", "(", "r", ")", "\n", "for", "s", ".", "Scan", "(", ")", "{", "// Leading and trailing whitespaces are ignored.", "l",...
4,623
all-4624
[ "Execute", "-", "deletes", "space", "from", "config" ]
[ "func", "(", "c", "*", "DeleteSpaceConfigurationCommand", ")", "Execute", "(", "[", "]", "string", ")", "<mask>", "{", "if", "err", ":=", "config", ".", "NewManager", "(", "c", ".", "ConfigDirectory", ")", ".", "DeleteSpaceConfig", "(", "c", ".", "OrgName"...
4,624
all-4625
[ "detectAttachmentHeader", "returns", "true", "if", "the", "given", "header", "defines", "an", "attachment", ".", "First", "it", "checks", "if", "the", "Content", "-", "Disposition", "header", "defines", "an", "attachement", "or", "inline", "attachment", ".", "If...
[ "func", "detectAttachmentHeader", "(", "header", "textproto", ".", "MIMEHeader", ")", "bool", "{", "mediatype", ",", "params", ",", "_", ",", "_", ":=", "parseMediaType", "(", "header", ".", "Get", "(", "hnContentDisposition", ")", ")", "\n", "if", "strings"...
4,625
all-4626
[ "void", "pango_cairo_error_underline_path", "(", "cairo_t", "*", "cr", "double", "x", "double", "y", "double", "width", "double", "height", ")", ";" ]
[ "func", "CairoErrorUnderlinePath", "(", "cr", "*", "cairo", ".", "Context", ",", "x", ",", "y", ",", "width", ",", "height", "float64", ")", "{", "C", ".", "pango_cairo_error_underline_path", "(", "cairo_context", "(", "cr", ")", ",", "C", ".", "double", ...
4,626
all-4627
[ "Do", "executes", "Runtime", ".", "globalLexicalScopeNames", "against", "the", "provided", "context", ".", "returns", ":", "names" ]
[ "func", "(", "p", "*", "GlobalLexicalScopeNamesParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "names", "[", "]", "string", ",", "err", "error", ")", "{", "// execute", "var", "res", "GlobalLexicalScopeNamesReturns", "\n", "err", "=", "...
4,627
all-4628
[ "UnmarshalText", "hydrates", "this", "instance", "from", "text" ]
[ "func", "(", "u", "*", "UUID5", ")", "UnmarshalText", "(", "data", "[", "]", "byte", ")", "error", "{", "// validation is performed later on", "*", "u", "=", "UUID5", "(", "string", "(", "<mask>", ")", ")", "\n", "return", "nil", "\n", "}" ]
4,628
all-4629
[ "Keep", "finds", "all", "revisions", "to", "be", "kept", "for", "a", "Compaction", "at", "the", "given", "rev", "." ]
[ "func", "(", "ti", "*", "treeIndex", ")", "Keep", "(", "rev", "int64", ")", "map", "[", "revision", "]", "struct", "{", "}", "{", "available", ":=", "make", "(", "map", "[", "revision", "]", "struct", "{", "}", ")", "\n", "ti", ".", "RLock", "(",...
4,629
all-4630
[ "Bucket", "returns", "a", "bucket", "on", "s3", "Bucket", "Config", "is", "initialized", "to", "DefaultConfig" ]
[ "func", "(", "s", "*", "S3", ")", "Bucket", "(", "<mask>", "string", ")", "*", "Bucket", "{", "return", "&", "Bucket", "{", "S3", ":", "s", ",", "Name", ":", "name", ",", "Config", ":", "DefaultConfig", ",", "}", "\n", "}" ]
4,630
all-4631
[ "UponReceiving", "specifies", "the", "name", "of", "the", "test", "case", ".", "This", "becomes", "the", "name", "of", "the", "consumer", "/", "provider", "pair", "in", "the", "Pact", "file", ".", "Mandatory", "." ]
[ "func", "(", "i", "*", "Interaction", ")", "UponReceiving", "(", "<mask>", "string", ")", "*", "Interaction", "{", "i", ".", "Description", "=", "description", "\n\n", "return", "i", "\n", "}" ]
4,631
all-4632
[ "InspectImage", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockDockerClient", ")", "InspectImage", "(", "arg0", "string", ")", "(", "*", "types", ".", "ImageInspect", ",", "error", ")", "{", "<mask>", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", ...
4,632
all-4633
[ "NewMockBackoff", "creates", "a", "new", "mock", "instance" ]
[ "func", "NewMockBackoff", "(", "ctrl", "*", "gomock", ".", "<mask>", ")", "*", "MockBackoff", "{", "mock", ":=", "&", "MockBackoff", "{", "ctrl", ":", "ctrl", "}", "\n", "mock", ".", "recorder", "=", "&", "MockBackoffMockRecorder", "{", "mock", "}", "\n"...
4,633
all-4634
[ "SetHeader", "is", "a", "wrapper", "around", "gtk_list_box_row_get_header", "()", "." ]
[ "func", "(", "v", "*", "ListBoxRow", ")", "SetHeader", "(", "<mask>", "IWidget", ")", "{", "C", ".", "gtk_list_box_row_set_header", "(", "v", ".", "native", "(", ")", ",", "header", ".", "toWidget", "(", ")", ")", "\n", "}" ]
4,634
all-4635
[ "expandDVSSecurityPolicy", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "DVSSecurityPolicy", "." ]
[ "func", "expandDVSSecurityPolicy", "(", "d", "*", "schema", ".", "ResourceData", ")", "*", "types", ".", "DVSSecurityPolicy", "{", "obj", ":=", "&", "<mask>", ".", "DVSSecurityPolicy", "{", "AllowPromiscuous", ":", "structure", ".", "GetBoolPolicy", "(", "d", ...
4,635
all-4636
[ "MarshalJSON", "overrides", "the", "logic", "for", "JSON", "-", "encoding", "the", "ContainerHealthStatus", "type" ]
[ "func", "(", "healthStatus", "*", "ContainerHealthStatus", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "if", "healthStatus", "==", "nil", "{", "return", "nil", ",", "nil", "\n", "}", "\n", "return", "[", "]", "byte", ...
4,636
all-4637
[ "GetGroupOk", "returns", "a", "tuple", "with", "the", "Group", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "CheckStatusDefinition", ")", "GetGroupOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "c", "==", "nil", "||", "c", ".", "Group", "==", "nil", "{", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n", "return", ...
4,637
all-4638
[ "getGitHubClient", "create", "the", "github", "client", "that", "we", "use", "to", "communicate", "with", "github" ]
[ "func", "(", "client", "*", "Client", ")", "getGitHubClient", "(", ")", "(", "*", "github", ".", "Client", ",", "error", ")", "{", "if", "client", ".", "githubClient", "!=", "nil", "{", "return", "client", ".", "githubClient", ",", "nil", "\n", "}", ...
4,638
all-4639
[ "Vec2", "functions", "Vec2Add", "performs", "a", "vector", "addition", ".", "dest", "=", "v1", "+", "v2", "dest", "[", "out", "]", "The", "result", "vector", ".", "v1", "[", "in", "]", "The", "base", "vector", ".", "v2", "[", "in", "]", "The", "vec...
[ "func", "Vec2Add", "(", "dest", ",", "v1", ",", "v2", "Vec2", ")", "{", "<mask>", "[", "0", "]", "=", "v1", "[", "0", "]", "+", "v2", "[", "0", "]", "\n", "dest", "[", "1", "]", "=", "v1", "[", "1", "]", "+", "v2", "[", "1", "]", "\n", ...
4,639
all-4640
[ "countUses", "returns", "the", "number", "of", "uses", "of", "the", "identifier", "x", "in", "scope", "." ]
[ "func", "countUses", "(", "x", "*", "ast", ".", "Ident", ",", "scope", "[", "]", "ast", ".", "Stmt", ")", "int", "{", "count", ":=", "0", "\n", "ff", ":=", "func", "(", "n", "interface", "{", "}", ")", "{", "if", "n", ",", "ok", ":=", "n", ...
4,640
all-4641
[ "RecordKnownLocation", "records", "that", "a", "blob", "with", "the", "specified", "digest", "exists", "within", "the", "specified", "(", "transport", "scope", ")", "scope", "and", "can", "be", "reused", "given", "the", "opaque", "location", "data", "." ]
[ "func", "(", "mem", "*", "cache", ")", "RecordKnownLocation", "(", "transport", "types", ".", "ImageTransport", ",", "scope", "<mask>", ".", "BICTransportScope", ",", "blobDigest", "digest", ".", "Digest", ",", "location", "types", ".", "BICLocationReference", "...
4,641
all-4642
[ "Send", "sends", "an", "HTTP", "request", "and", "returns", "a", "server", "response", "." ]
[ "func", "Send", "(", "req", "*", "<mask>", ".", "Request", ")", "(", "*", "Response", ",", "error", ")", "{", "client", ":=", "&", "http", ".", "Client", "{", "}", "\n\n", "resp", ",", "err", ":=", "client", ".", "Do", "(", "req", ")", "\n", "i...
4,642
all-4643
[ "putFile", "puts", "a", "file", "with", "random", "contents", "into", "a", "random", "open", "commit", "(", "or", "exits", "early", "if", "there", "are", "none", ")" ]
[ "func", "(", "w", "*", "worker", ")", "putFile", "(", "c", "*", "client", ".", "APIClient", ")", "error", "{", "if", "len", "(", "w", ".", "started", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n", "commit", ":=", "w", ".", "started", "[...
4,643
all-4644
[ "SetRequestURIBytes", "sets", "RequestURI", "for", "the", "first", "HTTP", "request", "line", ".", "RequestURI", "must", "be", "properly", "encoded", ".", "Use", "URI", ".", "RequestURI", "for", "constructing", "proper", "RequestURI", "if", "unsure", "." ]
[ "func", "(", "h", "*", "RequestHeader", ")", "SetRequestURIBytes", "(", "requestURI", "[", "]", "byte", ")", "{", "h", ".", "requestURI", "=", "<mask>", "(", "h", ".", "requestURI", "[", ":", "0", "]", ",", "requestURI", "...", ")", "\n", "}" ]
4,644
all-4645
[ "SetPageTitle", "is", "a", "wrapper", "around", "gtk_assistant_set_page_title", "()", "." ]
[ "func", "(", "v", "*", "Assistant", ")", "SetPageTitle", "(", "<mask>", "IWidget", ",", "title", "string", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "title", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ...
4,645
all-4646
[ "failed", "marks", "the", "writer", "as", "having", "failed" ]
[ "func", "(", "w", "*", "reqResWriter", ")", "failed", "(", "err", "error", ")", "error", "{", "w", ".", "<mask>", ".", "Debugf", "(", "\"", "\"", ",", "err", ",", "w", ".", "err", ")", "\n", "if", "w", ".", "err", "!=", "nil", "{", "return", ...
4,646
all-4647
[ "resourceVSphereDatastoreClusterVMAntiAffinityRuleFetchObjects", "fetches", "the", "objects", "for", "a", "cluster", "rule", ".", "This", "is", "currently", "just", "the", "cluster", "object", "as", "the", "rule", "key", "a", "static", "value", "and", "a", "pass", ...
[ "func", "resourceVSphereDatastoreClusterVMAntiAffinityRuleFetchObjects", "(", "meta", "interface", "{", "}", ",", "podID", "string", ",", "key", "int32", ",", ")", "(", "*", "object", ".", "StoragePod", ",", "int32", ",", "error", ")", "{", "<mask>", ",", "err...
4,647
all-4648
[ "GetNextAlertsInRange", "retrieves", "the", "page", "at", "the", "nextPageURI", "and", "continues", "retrieving", "pages", "until", "any", "results", "are", "found", "in", "the", "range", "given", "by", "start", "or", "end", "or", "we", "determine", "there", "...
[ "func", "(", "a", "*", "AlertService", ")", "GetNextAlertsInRange", "(", "start", "time", ".", "Time", ",", "end", "time", ".", "Time", ",", "nextPageURI", "string", ")", "AlertPageIterator", "{", "if", "nextPageURI", "==", "\"", "\"", "{", "panic", "(", ...
4,648
all-4649
[ "handleCallReqContinue", "handles", "the", "continuation", "of", "a", "call", "request", "forwarding", "it", "to", "the", "request", "channel", "for", "that", "request", "where", "it", "can", "be", "pulled", "during", "defragmentation" ]
[ "func", "(", "c", "*", "Connection", ")", "handleCallReqContinue", "(", "<mask>", "*", "Frame", ")", "bool", "{", "if", "err", ":=", "c", ".", "inbound", ".", "forwardPeerFrame", "(", "frame", ")", ";", "err", "!=", "nil", "{", "// If forward fails, it's d...
4,649
all-4650
[ "NewAuthServer", "returns", "an", "implementation", "of", "authclient", ".", "APIServer", "." ]
[ "func", "NewAuthServer", "(", "env", "*", "serviceenv", ".", "ServiceEnv", ",", "etcdPrefix", "string", ",", "public", "bool", ")", "(", "authclient", ".", "APIServer", ",", "error", ")", "{", "s", ":=", "&", "apiServer", "{", "env", ":", "env", ",", "...
4,650
all-4651
[ "PowerOff", "powers", "off", "a", "virtual", "machine", ".", "Parameters", ":", "options", ":", "Set", "of", "VMPowerOption", "flags", "to", "consider", "when", "powering", "off", "the", "virtual", "machine", ".", "Remarks", ":", "*", "If", "you", "call", ...
[ "func", "(", "v", "*", "VM", ")", "PowerOff", "(", "options", "VMPowerOption", ")", "error", "{", "<mask>", "jobHandle", "C", ".", "VixHandle", "=", "C", ".", "VIX_INVALID_HANDLE", "\n", "var", "err", "C", ".", "VixError", "=", "C", ".", "VIX_OK", "\n\...
4,651
all-4652
[ "CallerStackHandler", "returns", "a", "Handler", "that", "adds", "a", "stack", "trace", "to", "the", "context", "with", "key", "stack", ".", "The", "stack", "trace", "is", "formated", "as", "a", "space", "separated", "list", "of", "call", "sites", "inside", ...
[ "func", "CallerStackHandler", "(", "format", "string", ",", "h", "Handler", ")", "<mask>", "{", "return", "FuncHandler", "(", "func", "(", "r", "*", "Record", ")", "error", "{", "s", ":=", "stack", ".", "Callers", "(", ")", ".", "TrimBelow", "(", "stac...
4,652
all-4653
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "SshKey", ")", "Locator", "(", "api", "*", "API", ")", "*", "SshKeyLocator", "{", "for", "_", ",", "l", ":=", "<mask>", "r", ".", "Links", "{", "if", "l", "[", "\"", "\"", "]", "==", "\"", "\"", "{", "return", "api", "....
4,653
all-4654
[ "nextVolName", "updates", "name", "to", "the", "next", "filename", "in", "the", "archive", "." ]
[ "func", "(", "v", "*", "volume", ")", "nextVolName", "(", ")", "{", "if", "v", ".", "num", "==", "0", "{", "// check file extensions", "i", ":=", "strings", ".", "LastIndex", "(", "v", ".", "file", ",", "\"", "\"", ")", "\n", "if", "i", "<", "0",...
4,654
all-4655
[ "MarshalEasyJSON", "writes", "the", "IPv6", "to", "a", "easyjson", ".", "Writer" ]
[ "func", "(", "u", "IPv6", ")", "MarshalEasyJSON", "(", "w", "*", "jwriter", ".", "<mask>", ")", "{", "w", ".", "String", "(", "string", "(", "u", ")", ")", "\n", "}" ]
4,655
all-4656
[ "RouteTableLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "RouteTableLocator", "(", "href", "<mask>", ")", "*", "RouteTableLocator", "{", "return", "&", "RouteTableLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
4,656
all-4657
[ "/", "*", "Allocates", "and", "initalizes", "CvMat", "header" ]
[ "func", "CreateMatHeader", "(", "<mask>", ",", "cols", ",", "type_", "int", ")", "*", "Mat", "{", "mat", ":=", "C", ".", "cvCreateMatHeader", "(", "C", ".", "int", "(", "rows", ")", ",", "C", ".", "int", "(", "cols", ")", ",", "C", ".", "int", ...
4,657
all-4658
[ "ReachabilityTo", "checks", "whenever", "o", "can", "be", "reached", "from", "na", "." ]
[ "func", "(", "na", "*", "NetAddress", ")", "ReachabilityTo", "(", "o", "*", "NetAddress", ")", "int", "{", "const", "(", "Unreachable", "=", "0", "\n", "<mask>", "=", "iota", "\n", "Teredo", "\n", "Ipv6_weak", "\n", "Ipv4", "\n", "Ipv6_strong", "\n", "...
4,658
all-4659
[ "flattenDvsHostInfrastructureTrafficResource", "reads", "various", "fields", "from", "a", "DvsHostInfrastructureTrafficResource", "and", "sets", "appropriate", "keys", "in", "the", "supplied", "ResourceData", "." ]
[ "func", "flattenDvsHostInfrastructureTrafficResource", "(", "d", "*", "schema", ".", "ResourceData", ",", "obj", "types", ".", "DvsHostInfrastructureTrafficResource", ",", "key", "string", ")", "error", "{", "shareLevelKey", ":=", "fmt", ".", "Sprintf", "(", "\"", ...
4,659
all-4660
[ "GetObject", "is", "a", "wrapper", "around", "gtk_builder_get_object", "()", ".", "The", "returned", "result", "is", "an", "IObject", "so", "it", "will", "need", "to", "be", "type", "-", "asserted", "to", "the", "appropriate", "type", "before", "being", "use...
[ "func", "(", "b", "*", "Builder", ")", "GetObject", "(", "<mask>", "string", ")", "(", "glib", ".", "IObject", ",", "error", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "name", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Poin...
4,660
all-4661
[ "LowerCaseFilter", "creates", "a", "filter", "that", "only", "get", "passed", "lowercase", "field", "names" ]
[ "func", "LowerCaseFilter", "(", "filter", "Filter", ")", "Filter", "{", "return", "FilterFunc", "(", "func", "(", "k", "string", ",", "v", "<mask>", "{", "}", ")", "interface", "{", "}", "{", "return", "filter", ".", "Filter", "(", "strings", ".", "ToL...
4,661
all-4662
[ "dflSignal", "sets", "the", "given", "signal", "to", "SIG_DFL" ]
[ "func", "dflSignal", "(", "sig", "syscall", ".", "Signal", ")", "{", "// clearing out the sigact sets the signal to SIG_DFL", "<mask>", "sigactBuf", "[", "32", "]", "uint64", "\n", "ptr", ":=", "unsafe", ".", "Pointer", "(", "&", "sigactBuf", ")", "\n", "syscall...
4,662
all-4663
[ "hostPortGroupFromName", "locates", "a", "port", "group", "on", "the", "supplied", "HostNetworkSystem", "by", "name", "." ]
[ "func", "hostPortGroupFromName", "(", "client", "*", "govmomi", ".", "Client", ",", "ns", "*", "object", ".", "HostNetworkSystem", ",", "name", "string", ")", "(", "*", "types", ".", "HostPortGroup", ",", "error", ")", "{", "var", "mns", "mo", ".", "Host...
4,663
all-4664
[ "YesError", "checks", "for", "an", "error", "." ]
[ "func", "YesError", "(", "tb", "testing", ".", "TB", ",", "err", "error", ",", "msgAndArgs", "...", "<mask>", "{", "}", ")", "{", "tb", ".", "Helper", "(", ")", "\n", "if", "err", "==", "nil", "{", "fatal", "(", "tb", ",", "msgAndArgs", ",", "\""...
4,664
all-4665
[ "GetLens", "returns", "a", "Lens", "by", "name", "if", "it", "exists", ";", "otherwise", "it", "returns", "an", "error", "." ]
[ "func", "GetLens", "(", "<mask>", "string", ")", "(", "Lens", ",", "error", ")", "{", "lens", ",", "ok", ":=", "lensReg", "[", "name", "]", "\n", "if", "!", "ok", "{", "return", "nil", ",", "ErrInvalidLensName", "\n", "}", "\n", "return", "lens", "...
4,665
all-4666
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventInterstitialShown", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage58", "(", "&", "w", ",", "v", ...
4,666
all-4667
[ "Inc", "implements", "Inc", "method", "from", "QuotaService", "interface" ]
[ "func", "(", "s", "*", "QuotaService", ")", "Inc", "(", "appName", "string", ",", "quantity", "int", ")", "error", "{", "quota", ",", "err", ":=", "s", ".", "<mask>", ".", "Get", "(", "appName", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
4,667
all-4668
[ "ListDatum", "returns", "info", "about", "all", "datums", "in", "a", "Job" ]
[ "func", "(", "c", "APIClient", ")", "ListDatum", "(", "jobID", "string", ",", "pageSize", "int64", ",", "page", "int64", ")", "(", "*", "pps", ".", "ListDatumResponse", ",", "error", ")", "{", "client", ",", "err", ":=", "c", ".", "PpsAPIClient", ".", ...
4,668
all-4669
[ "UpdateBranch", "updates", "the", "branch", "with", "the", "specified", "configuration" ]
[ "func", "(", "p", "*", "protector", ")", "UpdateBranch", "(", "orgName", ",", "repo", "string", ",", "branchName", "string", ",", "branch", "config", ".", "Branch", ",", "protected", "bool", ")", "error", "{", "bp", ",", "err", ":=", "p", ".", "cfg", ...
4,669
all-4670
[ "NewImage", "returns", "an", "empty", "image", ".", "If", "width", "or", "height", "is", "less", "than", "1", "or", "more", "than", "device", "-", "dependent", "maximum", "size", "NewImage", "panics", ".", "filter", "argument", "is", "just", "for", "backwa...
[ "func", "NewImage", "(", "width", ",", "height", "int", ",", "filter", "Filter", ")", "(", "*", "Image", ",", "error", ")", "{", "s", ":=", "shareable", ".", "NewImage", "(", "width", ",", "<mask>", ")", "\n", "i", ":=", "&", "Image", "{", "mipmap"...
4,670
all-4671
[ "PullTree", "pulls", "from", "a", "raw", "HashTree", "rather", "than", "a", "repo", "." ]
[ "func", "(", "p", "*", "Puller", ")", "PullTree", "(", "client", "*", "pachclient", ".", "APIClient", ",", "root", "string", ",", "tree", "hashtree", ".", "HashTree", ",", "pipes", "bool", ",", "concurrency", "int", ")", "error", "{", "limiter", ":=", ...
4,671
all-4672
[ "New", "initalize", "the", "render", "struct", "." ]
[ "func", "New", "(", "config", "*", "Config", ",", "viewPaths", "...", "string", ")", "*", "Render", "{", "if", "config", "==", "nil", "{", "config", "=", "&", "Config", "{", "}", "\n", "}", "\n\n", "if", "config", ".", "DefaultLayout", "==", "\"", ...
4,672
all-4673
[ "DeleteStaleComments", "deletes", "comments", "flagged", "by", "isStale", "." ]
[ "func", "(", "f", "*", "FakeClient", ")", "DeleteStaleComments", "(", "org", ",", "repo", "string", ",", "number", "int", ",", "comments", "[", "]", "github", ".", "IssueComment", ",", "isStale", "func", "(", "github", ".", "IssueComment", ")", "bool", "...
4,673
all-4674
[ "CooperativeClose", "calls", "cooperativeClose", "method", "of", "Privatix", "service", "contract", "." ]
[ "func", "(", "b", "*", "backendInstance", ")", "CooperativeClose", "(", "opts", "*", "<mask>", ".", "TransactOpts", ",", "agent", "common", ".", "Address", ",", "block", "uint32", ",", "offeringHash", "[", "common", ".", "HashLength", "]", "byte", ",", "ba...
4,674
all-4675
[ "Returns", "the", "location", "of", "an", "attribute", "variable" ]
[ "func", "GetAttribLocation", "(", "program", "uint32", ",", "name", "*", "uint8", ")", "int32", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpGetAttribLocation", ",", "2", ",", "uintptr", "(", "program", ")", ",", "uintptr", ...
4,675
all-4676
[ "HandlerWithError", "implements", "Handler", "by", "calling", "the", "func", "for", "each", "request", "and", "handling", "returned", "errors", "and", "results", "." ]
[ "func", "HandlerWithError", "(", "handleFunc", "func", "(", "context", ".", "Context", ",", "*", "Conn", ",", "*", "Request", ")", "(", "<mask>", "interface", "{", "}", ",", "err", "error", ")", ")", "*", "HandlerWithErrorConfigurer", "{", "return", "&", ...
4,676
all-4677
[ "ReadResponse", "reads", "a", "server", "response", "into", "the", "received", "o", "." ]
[ "func", "(", "o", "*", "DeleteVMReader", ")", "ReadResponse", "(", "response", "runtime", ".", "ClientResponse", ",", "consumer", "runtime", ".", "Consumer", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "switch", "response", ".", "Code", "(", ...
4,677
all-4678
[ "ExecuteFuncString", "calls", "f", "on", "each", "template", "tag", "(", "placeholder", ")", "occurrence", "and", "substitutes", "it", "with", "the", "data", "written", "to", "TagFunc", "s", "w", ".", "Returns", "the", "resulting", "string", ".", "This", "fu...
[ "func", "ExecuteFuncString", "(", "template", ",", "startTag", ",", "endTag", "string", ",", "f", "TagFunc", ")", "string", "{", "tagsCount", ":=", "<mask>", ".", "Count", "(", "unsafeString2Bytes", "(", "template", ")", ",", "unsafeString2Bytes", "(", "startT...
4,678
all-4679
[ "Interceptor", "automatically", "restarts", "streams", "on", "non", "-", "expected", "errors", "To", "do", "so", "the", "application", "should", "create", "a", "for", "-", "loop", "around", "RecvMsg", "which", "returns", "the", "same", "errors", "that", "are",...
[ "func", "Interceptor", "(", "settings", "Settings", ")", "grpc", ".", "StreamClientInterceptor", "{", "return", "func", "(", "ctx", "context", ".", "Context", ",", "desc", "*", "grpc", ".", "StreamDesc", ",", "cc", "*", "grpc", ".", "ClientConn", ",", "met...
4,679
all-4680
[ "UpdateSecretVersionStageWithContext", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "UpdateSecretVersionStageWithContext", "(", "arg0", "aws", ".", "Context", ",", "arg1", "*", "secretsmanager", ".", "UpdateSecretVersionStageInput", ",", "arg2", "...", "request", ".", "Option", ")", "(", "*", ...
4,680
all-4681
[ "Cloud", "-" ]
[ "func", "Cloud", "(", "config", "CloudConfig", ")", "(", "result", "string", ",", "err", "error", ")", "{", "var", "cloudConfigManifest", "CloudConfigManifest", "\n", "cloudConfigManifest", "=", "config", ".", "GetManifest", "(", ")", "\n", "<mask>", "ccfgYaml",...
4,681
all-4682
[ "This", "is", "run", "for", "each", "new", "request", "perf", "is", "important", "." ]
[ "func", "escapedPath", "(", "urlObj", "*", "url", ".", "<mask>", ")", "string", "{", "// the escape method of url.URL should be public", "// that would avoid this split.", "parts", ":=", "strings", ".", "SplitN", "(", "urlObj", ".", "RequestURI", "(", ")", ",", "\""...
4,682
all-4683
[ "NewBundledStates", "is", "the", "constructor", "for", "BundledStates" ]
[ "func", "NewBundledStates", "(", "<mask>", "string", ")", "BundledStates", "{", "return", "BundledStates", "{", "description", ":", "description", ",", "states", ":", "map", "[", "string", "]", "State", "{", "}", ",", "}", "\n", "}" ]
4,683
all-4684
[ "newParser", "returns", "a", "new", "parser", "." ]
[ "func", "newParser", "(", "input", "string", ")", "*", "<mask>", "{", "p", ":=", "&", "parser", "{", "lex", ":", "lex", "(", "input", ")", ",", "}", "\n", "return", "p", "\n", "}" ]
4,684
all-4685
[ "Send", "sends", "the", "time", "elapsed", "since", "the", "creation", "of", "the", "Timing", "." ]
[ "func", "(", "t", "Timing", ")", "Send", "(", "bucket", "string", ")", "{", "t", ".", "c", ".", "Timing", "(", "bucket", ",", "int", "(", "t", ".", "Duration", "(", ")", "/", "<mask>", ".", "Millisecond", ")", ")", "\n", "}" ]
4,685
all-4686
[ "fromContext", "returns", "the", "App", "Engine", "context", "or", "nil", "if", "ctx", "is", "not", "derived", "from", "an", "App", "Engine", "context", "." ]
[ "func", "fromContext", "(", "ctx", "netcontext", ".", "Context", ")", "*", "<mask>", "{", "c", ",", "_", ":=", "ctx", ".", "Value", "(", "&", "contextKey", ")", ".", "(", "*", "context", ")", "\n", "return", "c", "\n", "}" ]
4,686
all-4687
[ "GetKeysInDirMeta", "returns", "the", "metadata", "for", "the", "keys", "and", "subdirectories", "within", "the", "directory", "at", "the", "given", "keystore", "path", "." ]
[ "func", "(", "c", "*", "Client", ")", "GetKeysInDirMeta", "(", "<mask>", "string", ")", "(", "[", "]", "KeyMeta", ",", "error", ")", "{", "r", ":=", "&", "keyMetaListContents", "{", "}", "\n", "err", ":=", "c", ".", "get", "(", "[", "]", "string", ...
4,687
all-4688
[ "Total", "errors", "is", "the", "sum", "of", "errors", "with", "the", "request", "overall", "and", "errors", "on", "individual", "fields", "." ]
[ "func", "(", "self", "Errors", ")", "Count", "(", ")", "int", "{", "return", "len", "(", "<mask>", ".", "Overall", ")", "+", "len", "(", "self", ".", "Fields", ")", "\n", "}" ]
4,688
all-4689
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniform4i", "(", "program", "uint32", ",", "location", "int32", ",", "v0", "int32", ",", "v1", "int32", ",", "v2", "int32", ",", "v3", "int32", ")", "{", "syscall", ".", "Syscall6", "(", "gpProgramUniform4i", ",", "6", ",", "uintptr", "("...
4,689
all-4690
[ "for", "drag", "-", "data", "-", "get" ]
[ "func", "SetData", "(", "pointer", "uintptr", ",", "atom", "gdk", ".", "Atom", ",", "data", "[", "]", "byte", ")", "{", "c", ":=", "(", "*", "C", ".", "GValue", ")", "(", "unsafe", ".", "Pointer", "(", "pointer", ")", ")", "\n", "p", ":=", "(",...
4,690
all-4691
[ "WithPanicResponseHandler", "sets", "http", ".", "Handler", "that", "will", "be", "executed", "on", "panic", "event", ".", "It", "is", "useful", "when", "the", "response", "has", "dynamic", "content", ".", "If", "the", "content", "is", "static", "it", "is", ...
[ "func", "WithPanicResponseHandler", "(", "h", "<mask>", ".", "Handler", ")", "Option", "{", "return", "func", "(", "o", "*", "Handler", ")", "{", "o", ".", "panicResponseHandler", "=", "h", "}", "\n", "}" ]
4,691
all-4692
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "StopRuleUsageTrackingParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss7", "(", "...
4,692
all-4693
[ "HasPeriod", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "r", "*", "Recurrence", ")", "HasPeriod", "(", ")", "bool", "{", "if", "r", "!=", "nil", "&&", "r", ".", "Period", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
4,693
all-4694
[ "ImportAccountFromHex", "imports", "private", "key", "from", "hex", "creates", "account", "and", "initiates", "JobAccountUpdateBalances", "job", "." ]
[ "func", "(", "h", "*", "Handler", ")", "ImportAccountFromHex", "(", "tkn", "string", ",", "params", "*", "AccountParamsWithHexKey", ")", "(", "*", "string", ",", "error", ")", "{", "logger", ":=", "h", ".", "logger", ".", "Add", "(", "\"", "\"", ",", ...
4,694
all-4695
[ "DeleteMaintenanceWindow", "deletes", "passed", "maintenance", "[", "window", "]", "." ]
[ "func", "(", "a", "*", "API", ")", "DeleteMaintenanceWindow", "(", "cfg", "*", "Maintenance", ")", "(", "bool", ",", "error", ")", "{", "if", "cfg", "==", "nil", "{", "return", "<mask>", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", ...
4,695
all-4696
[ "Addr", "returns", "the", "resource", "address", "for", "this", "subresource", "." ]
[ "func", "(", "r", "*", "Subresource", ")", "Addr", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "r", ".", "srtype", ",", "r", ".", "<mask>", ")", "\n", "}" ]
4,696
all-4697
[ "Throttle", "is", "a", "middleware", "that", "limits", "number", "of", "currently", "processed", "requests", "at", "a", "time", "." ]
[ "func", "Throttle", "(", "limit", "int", ")", "func", "(", "http", ".", "Handler", ")", "<mask>", ".", "Handler", "{", "return", "ThrottleBacklog", "(", "limit", ",", "0", ",", "defaultBacklogTimeout", ")", "\n", "}" ]
4,697
all-4698
[ "errorf", "formats", "the", "error", "and", "terminates", "processing", "." ]
[ "func", "(", "p", "*", "parser", ")", "errorf", "(", "<mask>", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "p", ".", "error", "(", "errors", ".", "Errorf", "(", "format", ",", "args", "...", ")", ")", "\n", "}" ]
4,698
all-4699
[ "ListEnvVars", "list", "environment", "variable", "to", "the", "specified", "project", "Returns", "the", "env", "vars", "(", "the", "value", "will", "be", "masked", ")" ]
[ "func", "(", "c", "*", "Client", ")", "ListEnvVars", "(", "<mask>", ",", "repo", "string", ")", "(", "[", "]", "EnvVar", ",", "error", ")", "{", "envVar", ":=", "[", "]", "EnvVar", "{", "}", "\n\n", "err", ":=", "c", ".", "request", "(", "\"", ...
4,699
all-4700
[ "Accept", "implements", "net", ".", "Listener", "s", "Accept", ".", "It", "is", "safe", "calling", "Accept", "from", "concurrently", "running", "goroutines", ".", "Accept", "returns", "new", "connection", "per", "each", "Dial", "call", "." ]
[ "func", "(", "ln", "*", "InmemoryListener", ")", "Accept", "(", ")", "(", "<mask>", ".", "Conn", ",", "error", ")", "{", "c", ",", "ok", ":=", "<-", "ln", ".", "conns", "\n", "if", "!", "ok", "{", "return", "nil", ",", "fmt", ".", "Errorf", "("...