id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
4,800
all-4801
[ "Using", "the", "classic", "API", "posts", "a", "value", "to", "a", "stat", "." ]
[ "func", "(", "r", "*", "BasicReporter", ")", "PostValue", "(", "statKey", ",", "userKey", "string", ",", "value", "float64", ")", "error", "{", "r", ".", "add", "(", "newClassicStatValue", "(", "statKey", ",", "userKey", ",", "<mask>", ")", ")", "\n", ...
4,801
all-4802
[ "Verify", "creates", "a", "signature", "for", "buf", "comparing", "it", "against", "the", "URL", "-", "safe", "base64", "encoded", "sig", "and", "returning", "the", "decoded", "signature", ".", "If", "the", "sig", "is", "invalid", "then", "ErrInvalidSignature"...
[ "func", "(", "rs", "*", "RSASigner", ")", "Verify", "(", "buf", ",", "sig", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "var", "err", "error", "\n\n", "// decode", "dec", ",", "err", ":=", "b64", ".", "DecodeString", "("...
4,802
all-4803
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "ObjectPreview", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime17", "(", "&", "r"...
4,803
all-4804
[ "Dial", "a", "list", "of", "seeds", "asynchronously", "in", "random", "order" ]
[ "func", "(", "sw", "*", "Switch", ")", "DialSeeds", "(", "addrBook", "*", "AddrBook", ",", "seeds", "[", "]", "string", ")", "error", "{", "netAddrs", ",", "err", ":=", "NewNetAddressStrings", "(", "seeds", ")", "\n", "if", "err", "!=", "nil", "{", "...
4,804
all-4805
[ "validateHostFolder", "checks", "to", "make", "sure", "the", "folder", "is", "a", "host", "folder", "and", "returns", "it", "if", "it", "is", "or", "an", "error", "if", "it", "isn", "t", "." ]
[ "func", "validateHostFolder", "(", "folder", "*", "object", ".", "Folder", ")", "(", "*", "object", ".", "Folder", ",", "error", ")", "{", "ft", ",", "err", ":=", "FindType", "(", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ...
4,805
all-4806
[ "Do", "executes", "Network", ".", "setDataSizeLimitsForTest", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetDataSizeLimitsForTestParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetDataSizeLimitsForTest", ",", "p", ",", "nil", ")", ...
4,806
all-4807
[ "CreateResource", "makes", "a", "POST", "request", "to", "the", "given", "resource", "." ]
[ "func", "(", "c", "*", "Client", ")", "CreateResource", "(", "ctx", "context", ".", "Context", ",", "pathPart", "string", ",", "data", "url", ".", "Values", ",", "v", "<mask>", "{", "}", ")", "error", "{", "return", "c", ".", "MakeRequest", "(", "ctx...
4,807
all-4808
[ "WithSpeed", "swipe", "speed", "in", "pixels", "per", "second", "(", "default", ":", "800", ")", "." ]
[ "func", "(", "p", "SynthesizeScrollGestureParams", ")", "WithSpeed", "(", "speed", "int64", ")", "*", "SynthesizeScrollGestureParams", "{", "p", ".", "Speed", "=", "<mask>", "\n", "return", "&", "p", "\n", "}" ]
4,808
all-4809
[ "MarshalEasyJSON", "writes", "the", "RGBColor", "to", "a", "easyjson", ".", "Writer" ]
[ "func", "(", "r", "RGBColor", ")", "MarshalEasyJSON", "(", "w", "*", "jwriter", ".", "<mask>", ")", "{", "w", ".", "String", "(", "string", "(", "r", ")", ")", "\n", "}" ]
4,809
all-4810
[ "Logf", "logs", "provided", "message", "with", "formatting", "." ]
[ "func", "(", "logger", "*", "Logger", ")", "Logf", "(", "level", "Level", ",", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "{", "logger", ".", "log", "(", "<mask>", ",", "format", ",", "a", "...", ")", "\n", "}" ]
4,810
all-4811
[ "Update", "--", "Safe", "way", "to", "update", "a", "task" ]
[ "func", "(", "s", "*", "Task", ")", "Update", "(", "update", "func", "(", "*", "<mask>", ")", "interface", "{", "}", ")", "interface", "{", "}", "{", "s", ".", "mutex", ".", "Lock", "(", ")", "\n", "var", "ret", "=", "update", "(", "s", ")", ...
4,811
all-4812
[ "MenuItemNewFromModel", "is", "a", "wrapper", "around", "g_menu_item_new_from_model", "()", "." ]
[ "func", "MenuItemNewFromModel", "(", "model", "*", "MenuModel", ",", "index", "int", ")", "*", "MenuItem", "{", "c", ":=", "C", ".", "g_menu_item_new_from_model", "(", "model", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "<mask>", ")", ")", "\...
4,812
all-4813
[ "Column", "returns", "the", "name", "of", "the", "database", "column", "the", "field", "maps", "to", ".", "The", "type", "code", "of", "the", "field", "must", "be", "TypeColumn", "." ]
[ "func", "(", "f", "*", "Field", ")", "Column", "(", ")", "string", "{", "if", "f", ".", "Type", ".", "Code", "!=", "TypeColumn", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "column", ":=", "lex", ".", "Snake", "(", "f", ".", "Name", ...
4,813
all-4814
[ "GetAggregationOk", "returns", "a", "tuple", "with", "the", "Aggregation", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "e", "*", "<mask>", ")", "GetAggregationOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "e", "==", "nil", "||", "e", ".", "Aggregation", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*",...
4,814
all-4815
[ "closeNetwork", "closes", "the", "network", "connection", "and", "all", "network", "-", "related", "channels", ".", "This", "should", "only", "be", "done", "in", "response", "to", "a", "fatal", "connection", "or", "protocol", "error", "or", "after", "all", "...
[ "func", "(", "c", "*", "Connection", ")", "closeNetwork", "(", ")", "{", "// NB(mmihic): The sender goroutine will exit once the connection is", "// closed; no need to close the send channel (and closing the send", "// channel would be dangerous since other goroutine might be sending)", "c...
4,815
all-4816
[ "colorWrite" ]
[ "func", "cW", "(", "w", "io", ".", "Writer", ",", "useColor", "bool", ",", "color", "[", "]", "byte", ",", "s", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "if", "isTTY", "&&", "useColor", "{", "w", ".", "Write", "(", "<mask>",...
4,816
all-4817
[ "SetDesiredStatus", "safely", "sets", "the", "desired", "status", "of", "the", "resource" ]
[ "func", "(", "auth", "*", "ASMAuthResource", ")", "SetDesiredStatus", "(", "status", "resourcestatus", ".", "ResourceStatus", ")", "{", "auth", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "auth", ".", "<mask>", ".", "Unlock", "(", ")", "\n\n", "au...
4,817
all-4818
[ "newEphemeralGPGSigningMechanism", "returns", "a", "new", "GPG", "/", "OpenPGP", "signing", "mechanism", "which", "recognizes", "_only_", "public", "keys", "from", "the", "supplied", "blob", "and", "returns", "the", "identities", "of", "these", "keys", ".", "The",...
[ "func", "newEphemeralGPGSigningMechanism", "(", "blob", "[", "]", "<mask>", ")", "(", "SigningMechanism", ",", "[", "]", "string", ",", "error", ")", "{", "dir", ",", "err", ":=", "ioutil", ".", "TempDir", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", ...
4,818
all-4819
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "WaitForDebuggerParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage", "(", "&", "w", ",", "v", ")",...
4,819
all-4820
[ "AppendDeflateBytesLevel", "appends", "deflated", "src", "to", "dst", "using", "the", "given", "compression", "level", "and", "returns", "the", "resulting", "dst", ".", "Supported", "compression", "levels", "are", ":", "*", "CompressNoCompression", "*", "CompressBes...
[ "func", "AppendDeflateBytesLevel", "(", "dst", ",", "src", "[", "]", "byte", ",", "level", "int", ")", "[", "]", "<mask>", "{", "w", ":=", "&", "byteSliceWriter", "{", "dst", "}", "\n", "WriteDeflateLevel", "(", "w", ",", "src", ",", "level", ")", "\...
4,820
all-4821
[ "setAuthHeader", "sets", "the", "Swift", "Authorization", "header", "to", "r", "using", "the", "access", "token", "in", "t", "." ]
[ "func", "setAuthHeader", "(", "t", "*", "oauth2", ".", "Token", ",", "r", "*", "http", ".", "Request", ")", "{", "r", ".", "Header", ".", "<mask>", "(", "\"", "\"", ",", "t", ".", "AccessToken", ")", "\n", "}" ]
4,821
all-4822
[ "NewListener", "returns", "a", "listener", "for", "raft", "message", "transfer", "between", "peers", ".", "It", "uses", "timeout", "listener", "to", "identify", "broken", "streams", "promptly", "." ]
[ "func", "NewListener", "(", "u", "url", ".", "<mask>", ",", "tlsinfo", "*", "transport", ".", "TLSInfo", ")", "(", "net", ".", "Listener", ",", "error", ")", "{", "return", "transport", ".", "NewTimeoutListener", "(", "u", ".", "Host", ",", "u", ".", ...
4,822
all-4823
[ "GetTextLength", "()", "is", "a", "wrapper", "around", "gtk_entry_get_text_length", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetTextLength", "(", ")", "uint16", "{", "c", ":=", "C", ".", "gtk_entry_get_text_length", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "uint16", "(", "c", ")", "\n", "}" ]
4,823
all-4824
[ "Sign", "returns", "the", "signature", "of", "the", "input", "data" ]
[ "func", "(", "ePriv", "*", "ECDSAPrivateKey", ")", "Sign", "(", "data", "[", "]", "<mask>", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "hash", ":=", "sha256", ".", "Sum256", "(", "data", ")", "\n", "r", ",", "s", ",", "err", ":=", "ecd...
4,824
all-4825
[ "calculatePorts", "is", "a", "utility", "function", "that", "returns", "a", "set", "of", "port", "data", "." ]
[ "func", "calculatePorts", "(", "<mask>", "[", "]", "types", ".", "HostPortGroupPort", ")", "*", "schema", ".", "Set", "{", "s", ":=", "make", "(", "[", "]", "interface", "{", "}", ",", "0", ")", "\n", "for", "_", ",", "port", ":=", "range", "ports"...
4,825
all-4826
[ "virtualSwitchIDsFromResourceID", "passes", "a", "resource", "s", "ID", "through", "splitHostVirtualSwitchID", "." ]
[ "func", "virtualSwitchIDsFromResourceID", "(", "d", "*", "schema", ".", "ResourceData", ")", "(", "string", ",", "string", ",", "error", ")", "{", "return", "splitHostVirtualSwitchID", "(", "d", ".", "<mask>", "(", ")", ")", "\n", "}" ]
4,826
all-4827
[ "Create", "path", "pattern", "from", "HTTP", "verb", "and", "request", "path" ]
[ "func", "toPattern", "(", "verb", ",", "path", "string", ")", "*", "gen", ".", "PathPattern", "{", "pattern", ":=", "gen", ".", "PathPattern", "{", "HTTPMethod", ":", "verb", ",", "Path", ":", "path", ",", "Pattern", ":", "pathVariablesRegexp", ".", "Rep...
4,827
all-4828
[ "Create", "a", "reader", "that", "limits", "the", "bandwidth", "of", "reads", "made", "from", "r", "according", "to", "the", "supplied", "throttler", ".", "Reads", "are", "assumed", "to", "be", "made", "under", "the", "supplied", "context", "." ]
[ "func", "ThrottledReader", "(", "ctx", "context", ".", "Context", ",", "r", "<mask>", ".", "Reader", ",", "throttle", "Throttle", ")", "io", ".", "Reader", "{", "return", "&", "throttledReader", "{", "ctx", ":", "ctx", ",", "wrapped", ":", "r", ",", "t...
4,828
all-4829
[ "writeFrames", "is", "the", "main", "loop", "that", "pulls", "frames", "from", "the", "send", "channel", "and", "writes", "them", "to", "the", "connection", "." ]
[ "func", "(", "c", "*", "<mask>", ")", "writeFrames", "(", "_", "uint32", ")", "{", "for", "{", "select", "{", "case", "f", ":=", "<-", "c", ".", "sendCh", ":", "if", "c", ".", "log", ".", "Enabled", "(", "LogLevelDebug", ")", "{", "c", ".", "lo...
4,829
all-4830
[ "GetBlob", "returns", "a", "stream", "for", "the", "specified", "blob", "and", "the", "blob’s", "size", "(", "or", "-", "1", "if", "unknown", ")", ".", "The", "Digest", "field", "in", "BlobInfo", "is", "guaranteed", "to", "be", "provided", "Size", "may",...
[ "func", "(", "s", "*", "openshiftImageSource", ")", "GetBlob", "(", "ctx", "context", ".", "Context", ",", "info", "types", ".", "BlobInfo", ",", "cache", "types", ".", "BlobInfoCache", ")", "(", "io", ".", "ReadCloser", ",", "int64", ",", "error", ")", ...
4,830
all-4831
[ "Put", "puts", "an", "id", "/", "hashtree", "pair", "in", "the", "cache", "and", "reads", "the", "hashtree", "from", "the", "passed", "in", "io", ".", "Reader", "." ]
[ "func", "(", "c", "*", "MergeCache", ")", "Put", "(", "id", "int64", ",", "tree", "io", ".", "Reader", ")", "(", "retErr", "error", ")", "{", "return", "c", ".", "Cache", ".", "Put", "(", "fmt", ".", "Sprint", "(", "id", ")", ",", "<mask>", ")"...
4,831
all-4832
[ "Recv", "returns", "a", "buffered", "channel", "(", "of", "the", "size", "given", "to", "New", ")", "that", "receives", "messages", "from", "the", "stream", ".", "The", "given", "recv", "func", "should", "return", "a", "new", "proto", "of", "the", "type"...
[ "func", "(", "s", "*", "Stream", ")", "Recv", "(", "recv", "func", "(", ")", "interface", "{", "}", ")", "<-", "chan", "interface", "{", "}", "{", "s", ".", "mu", ".", "Lock", "(", ")", "\n", "s", ".", "recvFunc", "=", "recv", "\n", "buf", ":...
4,832
all-4833
[ "Add", "adds", "a", "query", "to", "the", "batch", "." ]
[ "func", "(", "q", "*", "PQLBatchQuery", ")", "Add", "(", "query", "PQLQuery", ")", "{", "err", ":=", "query", ".", "Error", "(", ")", "\n", "if", "err", "!=", "nil", "{", "q", ".", "err", "=", "err", "\n", "}", "\n", "serializedQuery", ":=", "<ma...
4,833
all-4834
[ "GetShowLegendOk", "returns", "a", "tuple", "with", "the", "ShowLegend", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TimeseriesDefinition", ")", "GetShowLegendOk", "(", ")", "(", "bool", ",", "bool", ")", "{", "if", "t", "==", "nil", "||", "t", ".", "ShowLegend", "==", "nil", "{", "return", "false", ",", "<mask>", "\n", "}", "\n", "return", ...
4,834
all-4835
[ "RunScript", "allows", "for", "pure", "plush", "scripts", "to", "be", "executed", "." ]
[ "func", "RunScript", "(", "input", "string", ",", "ctx", "hctx", ".", "Context", ")", "error", "{", "input", "=", "\"", "\"", "+", "input", "+", "\"", "\"", "\n\n", "ctx", "=", "ctx", ".", "New", "(", ")", "\n", "ctx", ".", "Set", "(", "\"", "\...
4,835
all-4836
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetComputedStyleForNodeReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss45", "(", "&", "w", ",", ...
4,836
all-4837
[ "SetFromStock", "is", "a", "wrapper", "around", "gtk_image_set_from_stock", "()", "." ]
[ "func", "(", "v", "*", "Image", ")", "SetFromStock", "(", "stock", "Stock", ",", "size", "IconSize", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "string", "(", "stock", ")", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer",...
4,837
all-4838
[ "GenerateClientCertificate", "will", "generate", "the", "needed", "client", ".", "crt", "and", "client", ".", "key", "if", "needed" ]
[ "func", "(", "c", "*", "Config", ")", "GenerateClientCertificate", "(", ")", "error", "{", "if", "c", ".", "HasClientCertificate", "(", ")", "{", "return", "nil", "\n", "}", "\n\n", "certf", ":=", "c", ".", "ConfigPath", "(", "\"", "\"", ")", "\n", "...
4,838
all-4839
[ "ServeTLS", "serves", "HTTPS", "requests", "from", "the", "given", "listener", ".", "certFile", "and", "keyFile", "are", "paths", "to", "TLS", "certificate", "and", "key", "files", ".", "If", "the", "certFile", "or", "keyFile", "has", "not", "been", "provide...
[ "func", "(", "s", "*", "<mask>", ")", "ServeTLS", "(", "ln", "net", ".", "Listener", ",", "certFile", ",", "keyFile", "string", ")", "error", "{", "err", ":=", "s", ".", "AppendCert", "(", "certFile", ",", "keyFile", ")", "\n", "if", "err", "!=", "...
4,839
all-4840
[ "ReadByte", "returns", "the", "next", "byte", "from", "the", "buffer", "." ]
[ "func", "(", "r", "*", "ReadBuffer", ")", "ReadByte", "(", ")", "(", "<mask>", ",", "error", ")", "{", "if", "r", ".", "err", "!=", "nil", "{", "return", "0", ",", "r", ".", "err", "\n", "}", "\n\n", "if", "len", "(", "r", ".", "remaining", "...
4,840
all-4841
[ "NewTCPRawRelay", "creates", "a", "relay", "that", "just", "pipes", "data", "from", "one", "connection", "to", "another", "directly", "." ]
[ "func", "NewTCPRawRelay", "(", "dests", "[", "]", "string", ")", "(", "Relay", ",", "error", ")", "{", "return", "newTCPRelay", "(", "dests", ",", "func", "(", "_", "bool", ",", "src", ",", "dst", "<mask>", ".", "Conn", ")", "{", "io", ".", "Copy",...
4,841
all-4842
[ "VerifyHeader", "returns", "a", "handler", "that", "verifies", "the", "request", "contains", "the", "passed", "in", "headers", ".", "The", "passed", "in", "header", "keys", "are", "first", "canonicalized", "via", "http", ".", "CanonicalHeaderKey", ".", "The", ...
[ "func", "VerifyHeader", "(", "header", "http", ".", "Header", ")", "http", ".", "HandlerFunc", "{", "return", "func", "(", "w", "http", ".", "ResponseWriter", ",", "req", "*", "http", ".", "Request", ")", "{", "for", "key", ",", "values", ":=", "range"...
4,842
all-4843
[ "GetImageFile", "downloads", "an", "image", "from", "the", "server", "returning", "an", "ImageFileRequest", "struct" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "GetImageFile", "(", "fingerprint", "string", ",", "req", "ImageFileRequest", ")", "(", "*", "ImageFileResponse", ",", "<mask>", ")", "{", "return", "r", ".", "GetPrivateImageFile", "(", "fingerprint", ",", "\"", "\...
4,843
all-4844
[ "TimeoutErrorWithCode", "sets", "response", "body", "to", "msg", "and", "response", "status", "code", "to", "statusCode", ".", "All", "response", "modifications", "after", "TimeoutErrorWithCode", "call", "are", "ignored", ".", "TimeoutErrorWithCode", "MUST", "be", "...
[ "func", "(", "ctx", "*", "RequestCtx", ")", "TimeoutErrorWithCode", "(", "msg", "string", ",", "statusCode", "int", ")", "{", "var", "resp", "Response", "\n", "resp", ".", "SetStatusCode", "(", "statusCode", ")", "\n", "resp", ".", "SetBodyString", "(", "<...
4,844
all-4845
[ "GetPreferredWidth", "is", "a", "wrapper", "around", "gtk_widget_get_preferred_width", "()", "." ]
[ "func", "(", "v", "*", "Widget", ")", "GetPreferredWidth", "(", ")", "(", "int", ",", "int", ")", "{", "<mask>", "minimum", ",", "natural", "C", ".", "gint", "\n", "C", ".", "gtk_widget_get_preferred_width", "(", "v", ".", "native", "(", ")", ",", "&...
4,845
all-4846
[ "ReadResponse", "reads", "a", "server", "response", "into", "the", "received", "o", "." ]
[ "func", "(", "o", "*", "UpdateVMReader", ")", "ReadResponse", "(", "response", "runtime", ".", "ClientResponse", ",", "consumer", "runtime", ".", "Consumer", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "switch", "response", ".", "Code", "(", ...
4,846
all-4847
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "DisposeBrowserContextParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget20", "(",...
4,847
all-4848
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetDocumentParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom47", "(", "&", "w", ",", "v", ")", ...
4,848
all-4849
[ "ToAsset", "converts", "a", "to", "a", "proper", "xdr", ".", "Asset" ]
[ "func", "(", "a", "AllowTrustOpAsset", ")", "ToAsset", "(", "issuer", "AccountId", ")", "(", "ret", "Asset", ")", "{", "var", "err", "error", "\n\n", "switch", "a", ".", "Type", "{", "case", "AssetTypeAssetTypeCreditAlphanum4", ":", "ret", ",", "err", "=",...
4,849
all-4850
[ "Next", "would", "advance", "the", "iterator", "by", "one", ".", "Always", "check", "it", ".", "Valid", "()", "after", "a", "Next", "()", "to", "ensure", "you", "have", "access", "to", "a", "valid", "it", ".", "Item", "()", "." ]
[ "func", "(", "it", "*", "Iterator", ")", "Next", "(", ")", "{", "// Reuse current item", "it", ".", "item", ".", "wg", ".", "Wait", "(", ")", "// Just cleaner to wait before pushing to avoid doing ref counting.", "\n", "it", ".", "waste", ".", "push", "(", "it...
4,850
all-4851
[ "PreCreateCheck", "validates", "if", "driver", "values", "are", "valid", "to", "create", "the", "machine", "." ]
[ "func", "(", "d", "*", "Driver", ")", "PreCreateCheck", "(", ")", "(", "err", "error", ")", "{", "if", "d", ".", "CustomDataFile", "!=", "\"", "\"", "{", "if", "_", ",", "err", ":=", "os", ".", "Stat", "(", "d", ".", "CustomDataFile", ")", ";", ...
4,851
all-4852
[ "Fetch", "queries", "the", "Consul", "API", "defined", "by", "the", "given", "client", "and", "returns", "a", "slice", "of", "CatalogService", "objects", "." ]
[ "func", "(", "d", "*", "CatalogServiceQuery", ")", "Fetch", "(", "clients", "*", "ClientSet", ",", "opts", "*", "QueryOptions", ")", "(", "interface", "{", "}", ",", "*", "ResponseMetadata", ",", "error", ")", "{", "select", "{", "case", "<-", "d", "."...
4,852
all-4853
[ "/", "*", "Fatalm", "uses", "msg", "as", "a", "format", "string", "with", "subsequent", "parameters", "as", "values", "and", "logs", "the", "resulting", "message", "to", "all", "added", "loggers", "at", "LogLevel", ".", "LevelFatal", ".", "It", "will", "al...
[ "func", "(", "b", "*", "<mask>", ")", "Fatalm", "(", "m", "*", "Attrs", ",", "msg", "string", ",", "a", "...", "interface", "{", "}", ")", "error", "{", "return", "b", ".", "Log", "(", "LevelFatal", ",", "m", ",", "msg", ",", "a", "...", ")", ...
4,853
all-4854
[ "NewMockSSMClient", "creates", "a", "new", "mock", "instance" ]
[ "func", "NewMockSSMClient", "(", "ctrl", "*", "gomock", ".", "<mask>", ")", "*", "MockSSMClient", "{", "mock", ":=", "&", "MockSSMClient", "{", "ctrl", ":", "ctrl", "}", "\n", "mock", ".", "recorder", "=", "&", "MockSSMClientMockRecorder", "{", "mock", "}"...
4,854
all-4855
[ "ErrUnsupportedIdentity", "indicates", "the", "processor", "does", "not", "support", "the", "given", "identity", "type", "." ]
[ "func", "ErrUnsupportedIdentity", "(", "<mask>", "Identity", ")", "error", "{", "return", "ErrorResponse", "{", "Code", ":", "http", ".", "StatusNotImplemented", ",", "Message", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "id", ".", "Type", ",", "id"...
4,855
all-4856
[ "manifestDigest", "returns", "a", "digest", "of", "the", "manifest", "from", "instanceDigest", "if", "non", "-", "nil", ";", "or", "from", "the", "supplied", "reference", "or", "finally", "from", "a", "fetched", "manifest", "." ]
[ "func", "(", "s", "*", "dockerImageSource", ")", "manifestDigest", "(", "ctx", "context", ".", "Context", ",", "instanceDigest", "*", "digest", ".", "Digest", ")", "(", "digest", ".", "Digest", ",", "error", ")", "{", "if", "instanceDigest", "!=", "nil", ...
4,856
all-4857
[ "UnmarshalJSON", "satisfies", "json", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "BackendNodeID", ")", "UnmarshalJSON", "(", "buf", "[", "]", "<mask>", ")", "error", "{", "return", "easyjson", ".", "Unmarshal", "(", "buf", ",", "t", ")", "\n", "}" ]
4,857
all-4858
[ "New", "creates", "a", "new", "Kubernetes", "discovery", "for", "the", "given", "role", "." ]
[ "func", "New", "(", "l", "log", ".", "Logger", ",", "conf", "*", "SDConfig", ")", "(", "*", "Discovery", ",", "error", ")", "{", "if", "l", "==", "nil", "{", "l", "=", "log", ".", "NewNopLogger", "(", ")", "\n", "}", "\n", "var", "(", "kcfg", ...
4,858
all-4859
[ "SetApplication", "is", "a", "wrapper", "around", "gtk_window_set_application", "()", "." ]
[ "func", "(", "v", "*", "Window", ")", "SetApplication", "(", "a", "*", "<mask>", ")", "{", "C", ".", "gtk_window_set_application", "(", "v", ".", "native", "(", ")", ",", "a", ".", "native", "(", ")", ")", "\n", "}" ]
4,859
all-4860
[ "ThemeInfo", "returns", "detailed", "info", "about", "theme" ]
[ "func", "ThemeInfo", "(", "name", "string", ")", "ThemeDesc", "{", "themeManager", ".", "loadTheme", "(", "name", ")", "\n\n", "thememtx", ".", "RLock", "(", ")", "\n", "defer", "thememtx", ".", "RUnlock", "(", ")", "\n\n", "var", "theme", "ThemeDesc", "...
4,860
all-4861
[ "Logf", "logs", "provided", "message", "with", "formatting", "with", "default", "logger", "." ]
[ "func", "Logf", "(", "level", "Level", ",", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "{", "getDefaultLogger", "(", ")", ".", "log", "(", "level", ",", "<mask>", ",", "a", "...", ")", "\n", "}" ]
4,861
all-4862
[ "UpExpire", "refresh", "session", "expire" ]
[ "func", "(", "rp", "*", "redisProvider", ")", "UpExpire", "(", "sid", "string", ")", "error", "{", "var", "err", "error", "\n", "redisPool", ".", "Exec", "(", "func", "(", "c", "*", "redis", ".", "<mask>", ")", "{", "err", "=", "c", ".", "Expire", ...
4,862
all-4863
[ "MustBeRunning", "will", "return", "an", "error", "if", "the", "machine", "is", "not", "in", "a", "running", "state", "." ]
[ "func", "MustBeRunning", "(", "d", "Driver", ")", "error", "{", "s", ",", "err", ":=", "d", ".", "GetState", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "s", "!=", "<mask>", ".", "Running", "{", "retur...
4,863
all-4864
[ "returns", "the", "call", "price", "by", "number" ]
[ "func", "(", "nvps", "*", "NumberVoicePriceService", ")", "Get", "(", "ctx", "<mask>", ".", "Context", ",", "number", "string", ")", "(", "*", "VoiceNumberPrice", ",", "error", ")", "{", "voiceNumPrice", ":=", "new", "(", "VoiceNumberPrice", ")", "\n", "er...
4,864
all-4865
[ "ResolveRows", "resolves", "a", "[]", "PlanValue", "as", "rows", "based", "on", "the", "supplied", "bindvars", "." ]
[ "func", "ResolveRows", "(", "pvs", "[", "]", "PlanValue", ",", "bindVars", "map", "[", "string", "]", "*", "querypb", ".", "BindVariable", ")", "(", "[", "]", "[", "]", "Value", ",", "error", ")", "{", "count", ",", "err", ":=", "rowCount", "(", "p...
4,865
all-4866
[ "ApplyChanges", "applies", "a", "given", "set", "of", "changes", "in", "a", "given", "zone", "." ]
[ "func", "(", "r", "rfc2136Provider", ")", "ApplyChanges", "(", "changes", "*", "plan", ".", "Changes", ")", "error", "{", "log", ".", "Debugf", "(", "\"", "\"", ")", "\n\n", "for", "_", ",", "ep", ":=", "range", "<mask>", ".", "Create", "{", "if", ...
4,866
all-4867
[ "Execute", "-", "creates", "spaces" ]
[ "func", "(", "c", "*", "CreateSpacesCommand", ")", "Execute", "(", "[", "]", "string", ")", "error", "{", "<mask>", "cfMgmt", "*", "CFMgmt", "\n", "var", "err", "error", "\n", "if", "cfMgmt", ",", "err", "=", "InitializePeekManagers", "(", "c", ".", "B...
4,867
all-4868
[ "addIdent", "adds", "an", "accessor", "for", "an", "identifier", "for", "a", "given", "receiver", "and", "field" ]
[ "func", "(", "t", "*", "templateData", ")", "addIdent", "(", "x", "*", "ast", ".", "Ident", ",", "receiverType", ",", "fieldName", "string", ")", "{", "<mask>", "zeroValue", "string", "\n", "switch", "x", ".", "String", "(", ")", "{", "case", "\"", "...
4,868
all-4869
[ "GetCustomBgColorOk", "returns", "a", "tuple", "with", "the", "CustomBgColor", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "WidgetConditionalFormat", ")", "GetCustomBgColorOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "w", "==", "nil", "||", "w", ".", "CustomBgColor", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n...
4,869
all-4870
[ "UnmarshalYAML", "implements", "Unmarshaler", ".", "Avoid", "use", "of", "env", "in", "the", "YAML", "file", "." ]
[ "func", "(", "se", "*", "SMTPEnvironment", ")", "UnmarshalYAML", "(", "unmarshal", "func", "(", "interface", "{", "}", ")", "error", ")", "error", "{", "var", "aux", "struct", "{", "Env", "map", "[", "string", "]", "struct", "{", "Config", "Config", "`...
4,870
all-4871
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "find", "vms", "by", "deployment", "params" ]
[ "func", "(", "o", "*", "FindVmsByDeploymentParams", ")", "WithTimeout", "(", "timeout", "<mask>", ".", "Duration", ")", "*", "FindVmsByDeploymentParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
4,871
all-4872
[ "Performs", "a", "git", "commit", "and", "push", "of", "the", "current", "cluster", "changes", "." ]
[ "func", "(", "git", "*", "JSONGitStore", ")", "Commit", "(", "c", "*", "cluster", ".", "Cluster", ")", "error", "{", "if", "c", "==", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "bytes", ",", "err", ":=", ...
4,872
all-4873
[ "UnmarshalJSON", "unmarshals", "JSON", "strings", "coming", "from", "OpenTSDB", "into", "Go", "strings", "by", "applying", "the", "inverse", "of", "what", "is", "described", "for", "the", "MarshalJSON", "method", "." ]
[ "func", "(", "<mask>", "*", "TagValue", ")", "UnmarshalJSON", "(", "json", "[", "]", "byte", ")", "error", "{", "escapeLevel", ":=", "0", "// How many bytes after '_'.", "\n", "var", "parsedByte", "byte", "\n\n", "// Might need fewer bytes, but let's avoid realloc.", ...
4,873
all-4874
[ "Generate", "the", "name", "the", "runtime", "uses", "for", "a", "dwarf", "type", ".", "The", "DWARF", "generator", "and", "the", "runtime", "use", "slightly", "different", "names", "for", "the", "same", "underlying", "type", "." ]
[ "func", "runtimeName", "(", "dt", "dwarf", ".", "Type", ")", "string", "{", "switch", "x", ":=", "dt", ".", "(", "type", ")", "{", "case", "*", "dwarf", ".", "PtrType", ":", "if", "_", ",", "<mask>", ":=", "x", ".", "Type", ".", "(", "*", "dwar...
4,874
all-4875
[ "GetPopup", "()", "is", "a", "wrapper", "around", "gtk_scale_button_get_popup", "()", "." ]
[ "func", "(", "v", "*", "ScaleButton", ")", "GetPopup", "(", ")", "(", "*", "Widget", ",", "<mask>", ")", "{", "c", ":=", "C", ".", "gtk_scale_button_get_popup", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", ...
4,875
all-4876
[ "Len", "returns", "the", "total", "number", "of", "values", "across", "all", "ranges" ]
[ "func", "(", "l", "*", "InclusiveRanges", ")", "Len", "(", ")", "int", "{", "var", "totalLen", "int", "\n", "for", "_", ",", "b", ":=", "range", "l", ".", "<mask>", "{", "totalLen", "+=", "b", ".", "Len", "(", ")", "\n", "}", "\n", "return", "t...
4,876
all-4877
[ "EndOfMinute", "end", "of", "minute" ]
[ "func", "(", "now", "*", "Now", ")", "EndOfMinute", "(", ")", "time", ".", "Time", "{", "return", "<mask>", ".", "BeginningOfMinute", "(", ")", ".", "Add", "(", "time", ".", "Minute", "-", "time", ".", "Nanosecond", ")", "\n", "}" ]
4,877
all-4878
[ "HasTitleAlign", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "q", "*", "QueryValueDefinition", ")", "HasTitleAlign", "(", ")", "bool", "{", "if", "q", "!=", "nil", "&&", "q", ".", "TitleAlign", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
4,878
all-4879
[ "UnixSocket", "returns", "a", "new", "Listener", "on", "that", "address" ]
[ "func", "UnixSocket", "(", "addr", "string", ")", "(", "*", "Listener", ",", "error", ")", "{", "listener", ",", "err", ":=", "net", ".", "Listen", "(", "\"", "\"", ",", "addr", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err...
4,879
all-4880
[ "ContainerGetSnapshots", "returns", "the", "names", "of", "all", "snapshots", "of", "the", "container", "in", "the", "given", "project", "with", "the", "given", "name", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "ContainerGetSnapshots", "(", "project", ",", "name", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "result", ":=", "[", "]", "string", "{", "}", "\n\n", "regexp", ":=", "name", "+", "shared", ...
4,880
all-4881
[ "MustParseLevel", "is", "a", "convience", "function", "that", "parses", "the", "passed", "in", "string", "as", "a", "log", "level", "and", "sets", "the", "log", "level", "of", "the", "apexInterfaceWrapper", "to", "the", "parsed", "level", ".", "If", "an", ...
[ "func", "(", "w", "*", "apexInterfaceWrapper", ")", "MustParseLevel", "(", "s", "string", ")", "{", "<mask>", ",", "err", ":=", "ParseLevel", "(", "s", ")", "\n", "if", "err", "!=", "nil", "{", "w", ".", "WithError", "(", "err", ")", ".", "WithField"...
4,881
all-4882
[ "PrependSection", "is", "a", "wrapper", "around", "g_menu_prepend_section", "()", "." ]
[ "func", "(", "v", "*", "Menu", ")", "PrependSection", "(", "label", "string", ",", "<mask>", "*", "MenuModel", ")", "{", "cstr1", ":=", "(", "*", "C", ".", "gchar", ")", "(", "C", ".", "CString", "(", "label", ")", ")", "\n", "defer", "C", ".", ...
4,882
all-4883
[ "Hash", "generates", "the", "hash", "for", "the", "current", "period", "and", "client", "." ]
[ "func", "(", "h", "PerSecondHasher", ")", "Hash", "(", "id", "string", ")", "string", "{", "if", "h", ".", "Clock", "==", "nil", "{", "h", ".", "Clock", "=", "<mask>", ".", "New", "(", ")", "\n", "}", "\n\n", "return", "id", "+", "\"", "\"", "+...
4,883
all-4884
[ "String", "returns", "the", "name", "of", "e" ]
[ "func", "(", "e", "LedgerUpgradeType", ")", "String", "(", ")", "string", "{", "name", ",", "_", ":=", "ledgerUpgradeTypeMap", "[", "int32", "(", "e", ")", "]", "\n", "return", "<mask>", "\n", "}" ]
4,884
all-4885
[ "GetSignatures", "()", "parses", "the", "image", "s", "signatures", "blob", "into", "a", "slice", "of", "byte", "slices", "." ]
[ "func", "(", "s", "*", "storageImageSource", ")", "GetSignatures", "(", "ctx", "context", ".", "Context", ",", "instanceDigest", "*", "digest", ".", "Digest", ")", "(", "signatures", "[", "]", "[", "]", "byte", ",", "err", "error", ")", "{", "if", "ins...
4,885
all-4886
[ "RunLight", "creates", "a", "light", "instance", "of", "MongoDB", "image", "." ]
[ "func", "(", "s", "*", "ImageMongoDB", ")", "RunLight", "(", "cfg", "*", "RunConfig", ")", "(", "*", "<mask>", ",", "error", ")", "{", "cfg", ".", "AddArgs", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "s", ".", "Image", ".", "Run", ...
4,886
all-4887
[ "ContainerBackupCreate", "creates", "a", "new", "backup" ]
[ "func", "(", "c", "*", "Cluster", ")", "ContainerBackupCreate", "(", "args", "ContainerBackupArgs", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "ContainerBackupID", "(", "args", ".", "Name", ")", "\n", "if", "err", "==", "nil", "{", "return", "...
4,887
all-4888
[ "CanPageDown", "returns", "whether", "a", "list", "can", "still", "PageDown", "()", "." ]
[ "func", "(", "l", "*", "<mask>", ")", "CanPageDown", "(", ")", "bool", "{", "max", ":=", "len", "(", "l", ".", "scope", ")", "\n", "return", "l", ".", "start", "+", "l", ".", "size", "<", "max", "\n", "}" ]
4,888
all-4889
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "RequestCacheNamesParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage5", "("...
4,889
all-4890
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventIndexedDBContentUpdated", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage8", "(", "&", "w", ",", ...
4,890
all-4891
[ "ImageAliasDelete", "deletes", "the", "alias", "with", "the", "given", "name", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "ImageAliasDelete", "(", "project", ",", "name", "string", ")", "error", "{", "err", ":=", "c", ".", "Transaction", "(", "func", "(", "tx", "*", "ClusterTx", ")", "error", "{", "enabled", ",", "err", ":=", "tx",...
4,891
all-4892
[ "GetFontSize", "returns", "the", "FontSize", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "w", "*", "Widget", ")", "GetFontSize", "(", ")", "<mask>", "{", "if", "w", "==", "nil", "||", "w", ".", "FontSize", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "w", ".", "FontSize", "\n", "}" ]
4,892
all-4893
[ "New", "returns", "a", "client", "/", "server", "to", "bidirectionally", "communicate", "with", "ACS", "The", "returned", "struct", "should", "have", "both", "Connect", "and", "Serve", "called", "upon", "it", "before", "being", "used", "." ]
[ "func", "New", "(", "url", "string", ",", "cfg", "*", "config", ".", "Config", ",", "credentialProvider", "*", "credentials", ".", "Credentials", ",", "rwTimeout", "time", ".", "Duration", ")", "wsclient", ".", "ClientServer", "{", "cs", ":=", "&", "client...
4,893
all-4894
[ "newStructFLS", "returns", "a", "FieldLoadSaver", "for", "the", "struct", "pointer", "p", "." ]
[ "func", "newStructFLS", "(", "p", "<mask>", "{", "}", ")", "(", "FieldLoadSaver", ",", "error", ")", "{", "v", ":=", "reflect", ".", "ValueOf", "(", "p", ")", "\n", "if", "v", ".", "Kind", "(", ")", "!=", "reflect", ".", "Ptr", "||", "v", ".", ...
4,894
all-4895
[ "FetchMaintenanceWindows", "retrieves", "all", "maintenance", "[", "windows", "]", "available", "to", "API", "Token", "." ]
[ "func", "(", "a", "*", "API", ")", "FetchMaintenanceWindows", "(", ")", "(", "*", "[", "]", "Maintenance", ",", "error", ")", "{", "<mask>", ",", "err", ":=", "a", ".", "Get", "(", "config", ".", "MaintenancePrefix", ")", "\n", "if", "err", "!=", "...
4,895
all-4896
[ "Errorf", "logging" ]
[ "func", "(", "l", "*", "StdLevelLogger", ")", "Errorf", "(", "msg", "string", ",", "args", "...", "<mask>", "{", "}", ")", "{", "l", ".", "logfFunc", "(", "ErrorLevel", ",", "l", ".", "context", ",", "msg", ",", "args", "...", ")", "\n", "}" ]
4,896
all-4897
[ "initializeASMAuthResource", "builds", "the", "resource", "dependency", "map", "for", "the", "ASM", "auth", "resource" ]
[ "func", "(", "task", "*", "Task", ")", "initializeASMAuthResource", "(", "credentialsManager", "credentials", ".", "Manager", ",", "resourceFields", "*", "taskresource", ".", "ResourceFields", ")", "{", "asmAuthResource", ":=", "asmauth", ".", "NewASMAuthResource", ...
4,897
all-4898
[ "PortBindingFromDockerPortBinding", "constructs", "a", "PortBinding", "slice", "from", "a", "docker", "NetworkSettings", ".", "Ports", "map", "." ]
[ "func", "PortBindingFromDockerPortBinding", "(", "dockerPortBindings", "nat", ".", "PortMap", ")", "(", "[", "]", "PortBinding", ",", "apierrors", ".", "NamedError", ")", "{", "portBindings", ":=", "<mask>", "(", "[", "]", "PortBinding", ",", "0", ",", "len", ...
4,898
all-4899
[ "unreachable", "notices", "the", "picker", "that", "the", "given", "url", "is", "unreachable", "and", "it", "should", "use", "other", "possible", "urls", "." ]
[ "func", "(", "p", "*", "urlPicker", ")", "unreachable", "(", "u", "<mask>", ".", "URL", ")", "{", "p", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "p", ".", "mu", ".", "Unlock", "(", ")", "\n", "if", "u", "==", "p", ".", "urls", "[", "...
4,899
all-4900
[ "Now", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockTime", ")", "Now", "(", ")", "time", ".", "Time", "{", "<mask>", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "time", ".", "...