id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
1,500
all-1501
[ "SearchMetrics", "searches", "through", "the", "metrics", "facet", "returning", "matching", "ones", "." ]
[ "func", "(", "client", "*", "Client", ")", "SearchMetrics", "(", "search", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "var", "out", "reqSearch", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "\"",...
1,501
all-1502
[ "PrintPipelineInfo", "pretty", "-", "prints", "pipeline", "info", "." ]
[ "func", "PrintPipelineInfo", "(", "w", "io", ".", "<mask>", ",", "pipelineInfo", "*", "ppsclient", ".", "PipelineInfo", ",", "fullTimestamps", "bool", ")", "{", "fmt", ".", "Fprintf", "(", "w", ",", "\"", "\\t", "\"", ",", "pipelineInfo", ".", "Pipeline", ...
1,502
all-1503
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "InspectWorkerParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoServiceworker9", "(", "&", "w", ",", "v"...
1,503
all-1504
[ "PrintTypes", "writes", "all", "registered", "types", "in", "a", "markdown", "-", "style", "table", ".", "The", "table", "s", "header", "is", ":", "|", "Type", "|", "Name", "|", "Prefix", "|", "Notes", "|", "Where", "Type", "is", "the", "golang", "type...
[ "func", "(", "cdc", "*", "Codec", ")", "PrintTypes", "(", "out", "io", ".", "Writer", ")", "error", "{", "cdc", ".", "mtx", ".", "RLock", "(", ")", "\n", "defer", "cdc", ".", "mtx", ".", "RUnlock", "(", ")", "\n", "// print header", "if", "_", ",...
1,504
all-1505
[ "QueryTemplate", "-", "fake", "querying", "for", "a", "template" ]
[ "func", "(", "s", "*", "FakeVCDClient", ")", "QueryTemplate", "(", "templateName", "<mask>", ")", "(", "vappTemplate", "*", "vcloudclient", ".", "VAppTemplateRecord", ",", "err", "error", ")", "{", "return", "s", ".", "FakeVAppTemplateRecord", ",", "s", ".", ...
1,505
all-1506
[ "Size", "returns", "the", "size", "of", "a", "node" ]
[ "func", "(", "s", "*", "Skiplist", ")", "Size", "(", "n", "*", "<mask>", ")", "int", "{", "return", "s", ".", "ItemSize", "(", "n", ".", "Item", "(", ")", ")", "+", "n", ".", "Size", "(", ")", "\n", "}" ]
1,506
all-1507
[ "WithContext", "returns", "a", "copy", "of", "the", "parent", "context", "and", "associates", "it", "with", "an", "in", "-", "flight", "HTTP", "request", ".", "This", "function", "is", "cheap", "." ]
[ "func", "WithContext", "(", "parent", "context", ".", "Context", ",", "req", "*", "http", ".", "Request", ")", "<mask>", ".", "Context", "{", "return", "internal", ".", "WithContext", "(", "parent", ",", "req", ")", "\n", "}" ]
1,507
all-1508
[ "dataRaw", "is", "a", "wrapper", "around", "the", "data", "struct", "field" ]
[ "func", "(", "v", "*", "List", ")", "dataRaw", "(", ")", "unsafe", ".", "Pointer", "{", "return", "unsafe", ".", "Pointer", "(", "v", ".", "native", "(", ")", ".", "<mask>", ")", "\n", "}" ]
1,508
all-1509
[ "Insert", "is", "a", "wrapper", "around", "gtk_combo_box_text_insert", "()", "." ]
[ "func", "(", "v", "*", "ComboBoxText", ")", "Insert", "(", "position", "int", ",", "id", ",", "text", "string", ")", "{", "cid", ":=", "C", ".", "CString", "(", "id", ")", "\n", "ctext", ":=", "C", ".", "CString", "(", "<mask>", ")", "\n", "defer...
1,509
all-1510
[ "OpenForRead", "only", "opens", "the", "wal", "files", "for", "read", ".", "Write", "on", "a", "read", "only", "wal", "panics", "." ]
[ "func", "OpenForRead", "(", "lg", "*", "zap", ".", "Logger", ",", "dirpath", "string", ",", "snap", "walpb", ".", "Snapshot", ")", "(", "*", "WAL", ",", "error", ")", "{", "return", "openAtIndex", "(", "lg", ",", "dirpath", ",", "snap", ",", "<mask>"...
1,510
all-1511
[ "GetHandleOk", "returns", "a", "tuple", "with", "the", "Handle", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "s", "*", "SyntheticsUser", ")", "GetHandleOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "s", "==", "nil", "||", "s", ".", "Handle", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", ...
1,511
all-1512
[ "createContext", "has", "the", "user", "create", "a", "context", "." ]
[ "func", "createContext", "(", "co", "contextOptions", ")", "(", "string", ",", "error", ")", "{", "proj", ",", "err", ":=", "selectProject", "(", "co", ".", "project", ")", "\n", "if", "err", "!=", "nil", "{", "logrus", ".", "Info", "(", "\"", "\"", ...
1,512
all-1513
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "the", "current", "program", "object" ]
[ "func", "Uniform4fv", "(", "location", "int32", ",", "<mask>", "int32", ",", "value", "*", "float32", ")", "{", "syscall", ".", "Syscall", "(", "gpUniform4fv", ",", "3", ",", "uintptr", "(", "location", ")", ",", "uintptr", "(", "count", ")", ",", "uin...
1,513
all-1514
[ "StorageVolumeConfigClear", "deletes", "storage", "volume", "config", "." ]
[ "func", "StorageVolumeConfigClear", "(", "<mask>", "*", "sql", ".", "Tx", ",", "volumeID", "int64", ")", "error", "{", "_", ",", "err", ":=", "tx", ".", "Exec", "(", "\"", "\"", ",", "volumeID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "...
1,514
all-1515
[ "Union", "unions", "two", "DisjointSet", "with", "ds1", "s", "represent", "." ]
[ "func", "Union", "(", "forests", "*", "Forests", ",", "ds1", ",", "ds2", "*", "DisjointSet", ")", "{", "newDS", ":=", "&", "DisjointSet", "{", "}", "\n", "newDS", ".", "represent", "=", "ds1", ".", "represent", "\n", "newDS", ".", "members", "=", "ds...
1,515
all-1516
[ "GetToken", "returns", "the", "xml", ".", "Token", "representation", "of", "the", "node" ]
[ "func", "(", "a", "XMLNode", ")", "GetToken", "(", ")", "xml", ".", "Token", "{", "if", "a", ".", "NodeType", "==", "tree", ".", "NtAttr", "{", "ret", ":=", "a", ".", "Token", ".", "(", "*", "xml", ".", "Attr", ")", "\n", "return", "*", "ret", ...
1,516
all-1517
[ "validateFields", "verifies", "that", "no", "bad", "arguments", "were", "given", "to", "the", "request", "." ]
[ "func", "validateFields", "(", "req", "*", "logical", ".", "Request", ",", "data", "*", "framework", ".", "FieldData", ")", "error", "{", "var", "unknownFields", "[", "]", "string", "\n", "for", "k", ":=", "range", "req", ".", "Data", "{", "if", "_", ...
1,517
all-1518
[ "SetMethodHandler", "reigsters", "the", "given", "handler", "for", "the", "method", "." ]
[ "func", "(", "e", "*", "Entry", ")", "SetMethodHandler", "(", "method", "string", ",", "h", "*", "<mask>", ")", "error", "{", "if", "e", ".", "GetHandler", "(", "method", ")", "!=", "nil", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", ...
1,518
all-1519
[ "ParseFile", "parses", "the", "netrc", "file", "identified", "by", "filename", "and", "returns", "the", "set", "of", "machine", "information", "and", "macros", "defined", "in", "it", ".", "The", "default", "machine", "which", "is", "intended", "to", "be", "u...
[ "func", "ParseFile", "(", "filename", "string", ")", "(", "[", "]", "*", "Machine", ",", "Macros", ",", "error", ")", "{", "// TODO(fhs): Check if file is readable by anyone besides the user if there is password in it.", "fd", ",", "err", ":=", "os", ".", "Open", "(...
1,519
all-1520
[ "GetOperationWebsocket", "returns", "a", "websocket", "connection", "for", "the", "provided", "operation" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "GetOperationWebsocket", "(", "uuid", "string", ",", "secret", "string", ")", "(", "*", "websocket", ".", "Conn", ",", "error", ")", "{", "path", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "url", "."...
1,520
all-1521
[ "WarnFunc", "outputs", "Warn", "level", "log", "returned", "from", "the", "function" ]
[ "func", "WarnFunc", "(", "f", "func", "(", ")", "string", ")", "error", "{", "if", "isModeEnable", "(", "<mask>", ")", "{", "return", "glg", ".", "out", "(", "WARN", ",", "\"", "\"", ",", "f", "(", ")", ")", "\n", "}", "\n", "return", "nil", "\...
1,521
all-1522
[ "DoesSchemaTableExist", "return", "whether", "the", "schema", "table", "is", "present", "in", "the", "database", "." ]
[ "func", "DoesSchemaTableExist", "(", "tx", "*", "sql", ".", "Tx", ")", "(", "bool", ",", "error", ")", "{", "statement", ":=", "`\nSELECT COUNT(name) FROM sqlite_master WHERE type = 'table' AND name = 'schema'\n`", "\n", "rows", ",", "err", ":=", "tx", ".", "Query",...
1,522
all-1523
[ "GetContainers", "returns", "a", "list", "of", "containers" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "GetContainers", "(", ")", "(", "[", "]", "api", ".", "Container", ",", "error", ")", "{", "containers", ":=", "[", "]", "api", ".", "<mask>", "{", "}", "\n\n", "// Fetch the raw value", "_", ",", "err", ":=...
1,523
all-1524
[ "GetSubChannel", "returns", "a", "SubChannel", "for", "the", "given", "service", "name", ".", "If", "the", "subchannel", "does", "not", "exist", "it", "is", "created", "." ]
[ "func", "(", "ch", "*", "Channel", ")", "GetSubChannel", "(", "serviceName", "string", ",", "opts", "...", "SubChannelOption", ")", "*", "SubChannel", "{", "sub", ",", "added", ":=", "ch", ".", "subChannels", ".", "getOrAdd", "(", "serviceName", ",", "ch",...
1,524
all-1525
[ "ParameterizedBuild", "triggers", "a", "new", "parameterized", "build", "for", "the", "given", "project", "on", "the", "given", "branch", "Marshaling", "the", "struct", "into", "json", "and", "passing", "in", "the", "post", "body", ".", "Returns", "the", "new"...
[ "func", "(", "c", "*", "Client", ")", "ParameterizedBuild", "(", "account", ",", "repo", ",", "branch", "string", ",", "buildParameters", "map", "[", "string", "]", "string", ")", "(", "*", "Build", ",", "error", ")", "{", "opts", ":=", "map", "[", "...
1,525
all-1526
[ "HasPermission", "check", "has", "permission", "for", "permissioners", "or", "not" ]
[ "func", "(", "ps", "permissioners", ")", "HasPermission", "(", "mode", "PermissionMode", ",", "roles", "...", "interface", "{", "}", ")", "bool", "{", "for", "_", ",", "p", ":=", "range", "<mask>", "{", "if", "p", "!=", "nil", "&&", "!", "p", ".", ...
1,526
all-1527
[ "UnmarshalEasyJSON", "satisfies", "easyjson", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "SetEmitTouchEventsForMouseConfiguration", ")", "UnmarshalEasyJSON", "(", "in", "*", "jlexer", ".", "Lexer", ")", "{", "switch", "SetEmitTouchEventsForMouseConfiguration", "(", "in", ".", "String", "(", ")", ")", "{", "<mask>", "SetEmitTouch...
1,527
all-1528
[ "AppendBytes", "appends", "cookie", "representation", "to", "dst", "and", "returns", "the", "extended", "dst", "." ]
[ "func", "(", "c", "*", "Cookie", ")", "AppendBytes", "(", "dst", "[", "]", "byte", ")", "[", "]", "byte", "{", "if", "len", "(", "c", ".", "key", ")", ">", "0", "{", "dst", "=", "append", "(", "dst", ",", "c", ".", "key", "...", ")", "\n", ...
1,528
all-1529
[ "-----------------------------------------------------------------------------", "window", ":", "track", "bar", "-----------------------------------------------------------------------------", "/", "*", "create", "trackbar", "and", "display", "it", "on", "top", "of", "given", "wind...
[ "func", "(", "win", "*", "Window", ")", "CreateTrackbar", "(", "name", "string", ",", "value", ",", "count", "int", ",", "on_changed", "TrackbarFunc", ",", "param", "...", "<mask>", "{", "}", ")", "bool", "{", "bar_name", ":=", "C", ".", "CString", "("...
1,529
all-1530
[ "call", "sends", "a", "message", "to", "the", "Pact", "service" ]
[ "func", "(", "m", "*", "MockService", ")", "call", "(", "method", "string", ",", "url", "string", ",", "content", "interface", "{", "}", ")", "error", "{", "body", ",", "err", ":=", "json", ".", "Marshal", "(", "content", ")", "\n", "if", "err", "!...
1,530
all-1531
[ "roleAddCommandFunc", "executes", "the", "role", "add", "command", "." ]
[ "func", "roleAddCommandFunc", "(", "cmd", "*", "cobra", ".", "Command", ",", "args", "[", "]", "string", ")", "{", "if", "len", "(", "args", ")", "!=", "1", "{", "ExitWithError", "(", "ExitBadArgs", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", ...
1,531
all-1532
[ "Warn", "outputs", "Warn", "level", "log" ]
[ "func", "(", "g", "*", "Glg", ")", "Warn", "(", "val", "...", "interface", "{", "}", ")", "error", "{", "return", "g", ".", "<mask>", "(", "WARN", ",", "blankFormat", "(", "len", "(", "val", ")", ")", ",", "val", "...", ")", "\n", "}" ]
1,532
all-1533
[ "CancelTarget", "attempts", "to", "cancel", "the", "target", "operation" ]
[ "func", "(", "op", "*", "remoteOperation", ")", "CancelTarget", "(", ")", "<mask>", "{", "if", "op", ".", "targetOp", "==", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "op", ".", "targetOp", ".", "...
1,533
all-1534
[ "WithTx", "inserts", "a", "newrelic", ".", "Tx", "into", "the", "provided", "context", "." ]
[ "func", "WithTx", "(", "ctx", "context", ".", "Context", ",", "t", "Tx", ")", "context", ".", "Context", "{", "return", "<mask>", ".", "WithValue", "(", "ctx", ",", "txKey", ",", "t", ")", "\n", "}" ]
1,534
all-1535
[ "SetScale", "()", "is", "a", "wrapper", "around", "gtk_print_settings_set_scale", "()", "." ]
[ "func", "(", "ps", "*", "PrintSettings", ")", "SetScale", "(", "scale", "float64", ")", "{", "C", ".", "gtk_print_settings_set_scale", "(", "ps", ".", "native", "(", ")", ",", "C", ".", "gdouble", "(", "<mask>", ")", ")", "\n", "}" ]
1,535
all-1536
[ "WriteMessage", "adds", "text", "to", "channel" ]
[ "func", "(", "sl", "*", "<mask>", ")", "WriteMessage", "(", "text", ",", "channel", "string", ")", "error", "{", "sl", ".", "log", "(", "\"", "\"", ",", "text", ",", "channel", ")", "\n", "if", "sl", ".", "fake", "{", "return", "nil", "\n", "}", ...
1,536
all-1537
[ "Identify", "identifies", "a", "customer", "and", "sets", "their", "attributes" ]
[ "func", "(", "c", "*", "CustomerIO", ")", "Identify", "(", "customerID", "string", ",", "attributes", "map", "[", "string", "]", "interface", "{", "}", ")", "error", "{", "j", ",", "err", ":=", "json", ".", "Marshal", "(", "attributes", ")", "\n\n", ...
1,537
all-1538
[ "Do", "executes", "Accessibility", ".", "getPartialAXTree", "against", "the", "provided", "context", ".", "returns", ":", "nodes", "-", "The", "Accessibility", ".", "AXNode", "for", "this", "DOM", "node", "if", "it", "exists", "plus", "its", "ancestors", "sibl...
[ "func", "(", "p", "*", "GetPartialAXTreeParams", ")", "Do", "(", "ctx", "context", ".", "Context", ")", "(", "nodes", "[", "]", "*", "Node", ",", "err", "error", ")", "{", "// execute", "var", "res", "GetPartialAXTreeReturns", "\n", "err", "=", "cdp", ...
1,538
all-1539
[ "helper", "to", "update", "disk", "metrics", "(", "copied", "from", "greenhouse", ")" ]
[ "func", "diskMonitor", "(", "interval", "time", ".", "Duration", ",", "diskRoot", "string", ")", "{", "logger", ":=", "logrus", ".", "WithField", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "ticker", ":=", "<mask>", ".", "NewTicker", "(", "interval", ...
1,539
all-1540
[ "ListSecretsRequest", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "ListSecretsRequest", "(", "arg0", "*", "secretsmanager", ".", "ListSecretsInput", ")", "(", "*", "request", ".", "Request", ",", "*", "secretsmanager", ".", "ListSecretsOutput", ")", "{", "ret", ":=", "m", ...
1,540
all-1541
[ "SetTitle", "sets", "a", "title", "for", "the", "audio", "file", "(", "optional", ")", "." ]
[ "func", "(", "oa", "*", "OutgoingAudio", ")", "SetTitle", "(", "to", "<mask>", ")", "*", "OutgoingAudio", "{", "oa", ".", "Title", "=", "to", "\n", "return", "oa", "\n", "}" ]
1,541
all-1542
[ "Config", "returns", "the", "latest", "config", ".", "Do", "not", "modify", "the", "config", "." ]
[ "func", "(", "ca", "*", "Agent", ")", "Config", "(", ")", "*", "Config", "{", "ca", ".", "mut", ".", "RLock", "(", ")", "\n", "defer", "<mask>", ".", "mut", ".", "RUnlock", "(", ")", "\n", "return", "ca", ".", "c", "\n", "}" ]
1,542
all-1543
[ "Fingerprint", "calculates", "the", "fingerprint", "of", "the", "public", "key" ]
[ "func", "(", "kp", "*", "KeyPair", ")", "Fingerprint", "(", ")", "string", "{", "b", ",", "_", ":=", "base64", ".", "StdEncoding", ".", "DecodeString", "(", "string", "(", "kp", ".", "PublicKey", ")", ")", "\n", "h", ":=", "md5", ".", "New", "(", ...
1,543
all-1544
[ "options", "returns", "the", "demangling", "options", "to", "use", "based", "on", "the", "command", "line", "flags", "." ]
[ "func", "options", "(", ")", "[", "]", "demangle", ".", "Option", "{", "var", "options", "[", "]", "demangle", ".", "Option", "\n", "if", "*", "noParams", "{", "options", "=", "append", "(", "options", ",", "demangle", ".", "NoParams", ")", "\n", "}"...
1,544
all-1545
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetWindowForTargetParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser6", "(", "&", "w", ",", "v",...
1,545
all-1546
[ "verifyContainerMetadata", "verifies", "the", "container", "name", "of", "the", "container", "metadata", "and", "each", "necessary", "field", "is", "not", "empty", "." ]
[ "func", "verifyContainerMetadata", "(", "containerMetadataRawMsg", "json", ".", "RawMessage", ")", "error", "{", "containerMetadataMap", ":=", "make", "(", "<mask>", "[", "string", "]", "json", ".", "RawMessage", ")", "\n", "json", ".", "Unmarshal", "(", "contai...
1,546
all-1547
[ "FetchProvisionBroker", "retrieves", "provision", "broker", "[", "request", "]", "with", "passed", "cid", "." ]
[ "func", "(", "a", "*", "API", ")", "FetchProvisionBroker", "(", "cid", "CIDType", ")", "(", "*", "ProvisionBroker", ",", "error", ")", "{", "if", "cid", "==", "nil", "||", "*", "cid", "==", "\"", "\"", "{", "return", "nil", ",", "fmt", ".", "Errorf...
1,547
all-1548
[ "ValueSize", "returns", "the", "exact", "size", "of", "the", "value", ".", "This", "can", "be", "called", "to", "quickly", "estimate", "the", "size", "of", "a", "value", "without", "fetching", "it", "." ]
[ "func", "(", "item", "*", "Item", ")", "ValueSize", "(", ")", "int64", "{", "if", "!", "item", ".", "hasValue", "(", ")", "{", "return", "0", "\n", "}", "\n", "if", "(", "item", ".", "meta", "&", "bitValuePointer", ")", "==", "0", "{", "return", ...
1,548
all-1549
[ "GetDescription", "returns", "the", "Description", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "m", "*", "MetricMetadata", ")", "GetDescription", "(", ")", "string", "{", "if", "m", "==", "nil", "||", "m", ".", "Description", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "m", ".", "<mask>", "\n", "}" ]
1,549
all-1550
[ "stats", "returns", "a", "histogram", "of", "the", "number", "of", "each", "type", "of", "edit", "operation", "." ]
[ "func", "(", "es", "EditScript", ")", "stats", "(", ")", "(", "s", "struct", "{", "NI", ",", "NX", ",", "NY", ",", "NM", "int", "}", ")", "{", "for", "_", ",", "e", ":=", "range", "es", "{", "switch", "e", "{", "case", "Identity", ":", "s", ...
1,550
all-1551
[ "Flush", "flushes", "any", "pending", "compressed", "data", "to", "the", "underlying", "writer", ".", "Flush", "does", "not", "return", "until", "the", "data", "has", "been", "written", ".", "If", "the", "underlying", "writer", "returns", "an", "error", "Flu...
[ "func", "(", "z", "*", "Writer", ")", "Flush", "(", ")", "error", "{", "if", "debugFlag", "{", "debug", "(", "\"", "\"", ",", "z", ".", "idx", ")", "\n", "}", "\n", "if", "z", ".", "idx", "==", "0", "{", "return", "nil", "\n", "}", "\n\n", ...
1,551
all-1552
[ "Recover", "recovers", "form", "panics", ".", "It", "logs", "the", "stack", "and", "uses", "the", "PanicHandler", "(", "or", "a", "classic", "Internal", "Server", "Error", ")", "to", "write", "the", "response", ".", "Usage", ":", "defer", "c", ".", "Reco...
[ "func", "(", "ctx", "*", "Context", ")", "Recover", "(", ")", "{", "if", "err", ":=", "recover", "(", ")", ";", "err", "!=", "nil", "{", "if", "e", ",", "ok", ":=", "err", ".", "(", "*", "ValidationError", ")", ";", "ok", "==", "true", "{", "...
1,552
all-1553
[ "isDelimiter", "returns", "true", "for", "--", "BOUNDARY", "\\", "r", "\\", "n", "but", "not", "--", "BOUNDARY", "--" ]
[ "func", "(", "b", "*", "boundaryReader", ")", "isDelimiter", "(", "buf", "[", "]", "byte", ")", "bool", "{", "idx", ":=", "bytes", ".", "Index", "(", "buf", ",", "b", ".", "prefix", ")", "\n", "if", "idx", "==", "-", "1", "{", "return", "false", ...
1,553
all-1554
[ "DeepCopy", "copies", "the", "receiver", "into", "a", "new", "Password", "." ]
[ "func", "(", "r", "*", "Password", ")", "DeepCopy", "(", ")", "*", "Password", "{", "if", "r", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "Password", ")", "\n", "r", ".", "DeepCopyInto", "(", "out", ")", "\n", ...
1,554
all-1555
[ "lintOnionURL", "verifies", "that", "an", "Onion", "URI", "value", "from", "a", "TorServiceDescriptorHash", "is", ":", "1", ")", "a", "valid", "parseable", "url", ".", "2", ")", "a", "URL", "with", "a", "non", "-", "empty", "hostname", "3", ")", "a", "...
[ "func", "lintOnionURL", "(", "onion", "string", ")", "*", "LintResult", "{", "if", "onionURL", ",", "err", ":=", "<mask>", ".", "Parse", "(", "onion", ")", ";", "err", "!=", "nil", "{", "return", "failResult", "(", "\"", "\"", "+", "\"", "\"", ",", ...
1,555
all-1556
[ "set", "sets", "the", "value", "of", "the", "severity", "." ]
[ "func", "(", "s", "*", "Severity", ")", "<mask>", "(", "val", "Severity", ")", "{", "atomic", ".", "StoreInt32", "(", "(", "*", "int32", ")", "(", "s", ")", ",", "int32", "(", "val", ")", ")", "\n", "}" ]
1,556
all-1557
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "<mask>", ")", "Locator", "(", "api", "*", "API", ")", "*", "ApplicationLocator", "{", "return", "api", ".", "ApplicationLocator", "(", "r", ".", "Href", ")", "\n", "}" ]
1,557
all-1558
[ "ReceiveComment", "is", "a", "wrapper", "on", "plugin", ".", "ReceiveComment", "()", "logging", "the", "author" ]
[ "func", "(", "a", "*", "AuthorLoggerPluginWrapper", ")", "ReceiveComment", "(", "comment", "sql", ".", "Comment", ")", "[", "]", "Point", "{", "points", ":=", "a", ".", "plugin", ".", "ReceiveComment", "(", "comment", ")", "\n\n", "if", "a", ".", "enable...
1,558
all-1559
[ "GetAccountIDOk", "returns", "a", "tuple", "with", "the", "AccountID", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "i", "*", "IntegrationAWSAccountDeleteRequest", ")", "GetAccountIDOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "i", "==", "nil", "||", "i", ".", "AccountID", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", ...
1,559
all-1560
[ "Metric", "writes", "the", "labels", "of", "the", "current", "sample", "into", "the", "passed", "labels", ".", "It", "returns", "the", "string", "from", "which", "the", "metric", "was", "parsed", "." ]
[ "func", "(", "p", "*", "OpenMetricsParser", ")", "Metric", "(", "l", "*", "labels", ".", "Labels", ")", "string", "{", "// Allocate the full immutable string immediately, so we just", "// have to create references on it below.", "s", ":=", "string", "(", "p", ".", "se...
1,560
all-1561
[ "SetTransientFor", "is", "a", "wrapper", "around", "gtk_window_set_transient_for", "()", "." ]
[ "func", "(", "v", "*", "Window", ")", "SetTransientFor", "(", "parent", "IWindow", ")", "{", "<mask>", "pw", "*", "C", ".", "GtkWindow", "=", "nil", "\n", "if", "parent", "!=", "nil", "{", "pw", "=", "parent", ".", "toWindow", "(", ")", "\n", "}", ...
1,561
all-1562
[ "rPrint", "recursively", "prints", "out", "the", "nodes", "in", "the", "node", "structure", "." ]
[ "func", "rPrint", "(", "c", "*", "cli", ".", "Context", ",", "n", "*", "client", ".", "Node", ")", "{", "if", "n", ".", "Dir", "&&", "c", ".", "Bool", "(", "\"", "\"", ")", "{", "fmt", ".", "Println", "(", "fmt", ".", "Sprintf", "(", "\"", ...
1,562
all-1563
[ "IsDirWriteable", "checks", "if", "dir", "is", "writable", "by", "writing", "and", "removing", "a", "file", "to", "dir", ".", "It", "returns", "nil", "if", "dir", "is", "writable", "." ]
[ "func", "IsDirWriteable", "(", "dir", "string", ")", "error", "{", "f", ":=", "filepath", ".", "Join", "(", "dir", ",", "\"", "\"", ")", "\n", "if", "err", ":=", "ioutil", ".", "WriteFile", "(", "f", ",", "[", "]", "<mask>", "(", "\"", "\"", ")",...
1,563
all-1564
[ "GetSignaturesWithAcceptedAuthor", "returns", "those", "signatures", "from", "an", "image", "for", "which", "the", "policy", "accepts", "the", "author", "(", "and", "which", "have", "been", "successfully", "verified", ")", ".", "NOTE", ":", "This", "may", "legit...
[ "func", "(", "pc", "*", "PolicyContext", ")", "GetSignaturesWithAcceptedAuthor", "(", "ctx", "context", ".", "Context", ",", "image", "types", ".", "UnparsedImage", ")", "(", "sigs", "[", "]", "*", "Signature", ",", "finalErr", "error", ")", "{", "if", "er...
1,564
all-1565
[ "SleepString", "returns", "a", "string", "N", "-", "M", "minutes", "if", "the", "goroutine", "(", "s", ")", "slept", "for", "a", "long", "time", ".", "Returns", "an", "empty", "string", "otherwise", "." ]
[ "func", "(", "s", "*", "Signature", ")", "SleepString", "(", ")", "<mask>", "{", "if", "s", ".", "SleepMax", "==", "0", "{", "return", "\"", "\"", "\n", "}", "\n", "if", "s", ".", "SleepMin", "!=", "s", ".", "SleepMax", "{", "return", "fmt", ".",...
1,565
all-1566
[ "Value", "converts", "a", "value", "to", "a", "database", "driver", "value" ]
[ "func", "(", "u", "CIDR", ")", "Value", "(", ")", "(", "<mask>", ".", "Value", ",", "error", ")", "{", "return", "driver", ".", "Value", "(", "string", "(", "u", ")", ")", ",", "nil", "\n", "}" ]
1,566
all-1567
[ "ServeConn", "serves", "HTTP", "requests", "from", "the", "given", "connection", ".", "ServeConn", "returns", "nil", "if", "all", "requests", "from", "the", "c", "are", "successfully", "served", ".", "It", "returns", "non", "-", "nil", "error", "otherwise", ...
[ "func", "(", "s", "*", "Server", ")", "ServeConn", "(", "c", "net", ".", "Conn", ")", "error", "{", "if", "s", ".", "MaxConnsPerIP", ">", "0", "{", "pic", ":=", "wrapPerIPConn", "(", "s", ",", "c", ")", "\n", "if", "pic", "==", "nil", "{", "ret...
1,567
all-1568
[ "SecurityGroupLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "SecurityGroupLocator", "(", "href", "string", ")", "*", "SecurityGroupLocator", "{", "<mask>", "&", "SecurityGroupLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
1,568
all-1569
[ "Accept", "waits", "for", "and", "returns", "the", "next", "connection", "to", "the", "listener", "." ]
[ "func", "(", "l", "*", "listener", ")", "Accept", "(", ")", "(", "transport", ".", "Conn", ",", "error", ")", "{", "if", "c", ",", "ok", ":=", "<-", "l", ".", "incoming", ";", "<mask>", "{", "return", "c", ".", "conn", ",", "c", ".", "err", "...
1,569
all-1570
[ "Colon", "matches", "path", "with", "REST", "-", "full", "resources", "URI", "in", "perfix", "colon", "form", ".", "e", ".", "g", ".", "/", "foo", "/", "v1", "/", "bar", "/", "v2", "will", "map", "to", "/", ":", "foo", "/", ":", "bar", "form", ...
[ "func", "Colon", "(", "<mask>", "string", ")", "*", "colon", "{", "matches", ":=", "strings", ".", "Split", "(", "path", ",", "\"", "\"", ")", "\n", "return", "&", "colon", "{", "matches", ":", "matches", ",", "}", "\n", "}" ]
1,570
all-1571
[ "Stability", ":", "***", "DEPRECATED", "***", "claim", "a", "task", "-", "never", "documented", "Required", "scopes", ":", "Any", "of", ":", "-", "All", "of", ":", "*", "queue", ":", "claim", "-", "task", ":", "<provisionerId", ">", "/", "<workerType", ...
[ "func", "(", "queue", "*", "Queue", ")", "ClaimTask", "(", "taskId", ",", "runId", "string", ",", "payload", "*", "TaskClaimRequest", ")", "(", "*", "TaskClaimResponse", ",", "error", ")", "{", "cd", ":=", "tcclient", ".", "<mask>", "(", "*", "queue", ...
1,571
all-1572
[ "SetVisibleChild", "is", "a", "wrapper", "around", "gtk_stack_set_visible_child", "()", "." ]
[ "func", "(", "v", "*", "Stack", ")", "SetVisibleChild", "(", "<mask>", "IWidget", ")", "{", "C", ".", "gtk_stack_set_visible_child", "(", "v", ".", "native", "(", ")", ",", "child", ".", "toWidget", "(", ")", ")", "\n", "}" ]
1,572
all-1573
[ "KNearest", "returns", "the", "k", "nearest", "points", "near", "point", "within", "maxDistance", "that", "match", "the", "accept", "criteria", "." ]
[ "func", "(", "points", "*", "PointsIndex", ")", "KNearest", "(", "point", "Point", ",", "k", "int", ",", "maxDistance", "Meters", ",", "accept", "func", "(", "p", "Point", ")", "bool", ")", "[", "]", "Point", "{", "nearbyPoints", ":=", "make", "(", "...
1,573
all-1574
[ "Needed", "for", "live", "migration", "where", "an", "empty", "snapshot", "needs", "to", "be", "created", "before", "rsyncing", "into", "it", "." ]
[ "func", "(", "s", "*", "storageBtrfs", ")", "ContainerSnapshotCreateEmpty", "(", "snapshotContainer", "container", ")", "error", "{", "logger", ".", "Debugf", "(", "\"", "\\\"", "\\\"", "\\\"", "\\\"", "\"", ",", "s", ".", "volume", ".", "Name", ",", "s", ...
1,574
all-1575
[ "Do", "executes", "Overlay", ".", "highlightFrame", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "HighlightFrameParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandHighlightFrame", ",", "p", ",", "nil", ")", "\n", "}" ]
1,575
all-1576
[ "Returns", "the", "source", "code", "string", "from", "a", "shader", "object" ]
[ "func", "GetShaderSource", "(", "shader", "uint32", ",", "bufSize", "int32", ",", "length", "*", "int32", ",", "source", "*", "uint8", ")", "{", "syscall", ".", "Syscall6", "(", "gpGetShaderSource", ",", "4", ",", "uintptr", "(", "shader", ")", ",", "uin...
1,576
all-1577
[ "SetServerBytes", "sets", "Server", "header", "value", "." ]
[ "func", "(", "h", "*", "ResponseHeader", ")", "SetServerBytes", "(", "server", "[", "]", "byte", ")", "{", "h", ".", "server", "=", "append", "(", "h", ".", "<mask>", "[", ":", "0", "]", ",", "server", "...", ")", "\n", "}" ]
1,577
all-1578
[ "Warnf", "records", "the", "log", "with", "warn", "level" ]
[ "func", "(", "l", "*", "Logger", ")", "Warnf", "(", "format", "string", ",", "args", "...", "<mask>", "{", "}", ")", "{", "l", ".", "Output", "(", "2", ",", "LevelWarn", ",", "fmt", ".", "Sprintf", "(", "format", ",", "args", "...", ")", ")", "...
1,578
all-1579
[ "UpdateImageAlias", "updates", "the", "image", "alias", "definition" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "UpdateImageAlias", "(", "<mask>", "string", ",", "alias", "api", ".", "ImageAliasesEntryPut", ",", "ETag", "string", ")", "error", "{", "// Send the request", "_", ",", "_", ",", "err", ":=", "r", ".", "query", ...
1,579
all-1580
[ "Method", "returns", "HTTP", "request", "method", "." ]
[ "func", "(", "h", "*", "RequestHeader", ")", "Method", "(", ")", "[", "]", "byte", "{", "if", "len", "(", "h", ".", "method", ")", "==", "0", "{", "return", "strGet", "\n", "}", "\n", "return", "h", ".", "<mask>", "\n", "}" ]
1,580
all-1581
[ "NewReader", "creates", "a", "new", "Reader", "instance", "." ]
[ "func", "NewReader", "(", "r", "<mask>", ".", "Reader", ")", "*", "Reader", "{", "return", "&", "Reader", "{", "rd", ":", "bufio", ".", "NewReader", "(", "r", ")", ",", "tr", ":", "unicode", ".", "Cesu8ToUtf8Transformer", ",", "}", "\n", "}" ]
1,581
all-1582
[ "CountAll", "returns", "a", "map", "associating", "each", "table", "name", "in", "the", "database", "with", "the", "total", "count", "of", "its", "rows", "." ]
[ "func", "CountAll", "(", "tx", "*", "sql", ".", "Tx", ")", "(", "map", "[", "string", "]", "int", ",", "error", ")", "{", "tables", ",", "err", ":=", "SelectStrings", "(", "tx", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return...
1,582
all-1583
[ "If", "emits", "every", "input", "x", "for", "which", "fn", "(", "x", ")", "is", "true", "." ]
[ "func", "If", "(", "fn", "func", "(", "string", ")", "bool", ")", "<mask>", "{", "return", "FilterFunc", "(", "func", "(", "arg", "Arg", ")", "error", "{", "for", "s", ":=", "range", "arg", ".", "In", "{", "if", "fn", "(", "s", ")", "{", "arg",...
1,583
all-1584
[ "NewPubSub", "returns", "a", "new", "PubSub", "management", "object", "." ]
[ "func", "NewPubSub", "(", "ctx", "context", ".", "Context", ",", "h", "host", ".", "Host", ",", "rt", "PubSubRouter", ",", "opts", "...", "Option", ")", "(", "*", "PubSub", ",", "error", ")", "{", "ps", ":=", "&", "PubSub", "{", "host", ":", "h", ...
1,584
all-1585
[ "Stop", "cancels", "all", "running", "scrape", "pools", "and", "blocks", "until", "all", "have", "exited", "." ]
[ "func", "(", "m", "*", "Manager", ")", "Stop", "(", ")", "{", "m", ".", "mtxScrape", ".", "Lock", "(", ")", "\n", "defer", "m", ".", "mtxScrape", ".", "Unlock", "(", ")", "\n\n", "for", "_", ",", "sp", ":=", "range", "m", ".", "scrapePools", "{...
1,585
all-1586
[ "NewConfiguration", "creates", "a", "generic", "configuration", "from", "a", "specific", "type", "of", "configuration", "." ]
[ "func", "NewConfiguration", "(", "config", "interface", "{", "}", ")", "*", "Configuration", "{", "configuration", ":=", "&", "Configuration", "{", "}", "\n", "switch", "config", ".", "(", "type", ")", "{", "<mask>", "*", "GlobalConfiguration", ":", "configu...
1,586
all-1587
[ "HasLastNoDataTs", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "g", "*", "GroupData", ")", "HasLastNoDataTs", "(", ")", "bool", "{", "if", "g", "!=", "nil", "&&", "g", ".", "LastNoDataTs", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
1,587
all-1588
[ "SetBytesK", "sets", "the", "given", "key", ":", "value", "header", ".", "Use", "AddBytesK", "for", "setting", "multiple", "header", "values", "under", "the", "same", "key", "." ]
[ "func", "(", "h", "*", "ResponseHeader", ")", "SetBytesK", "(", "key", "[", "]", "byte", ",", "value", "string", ")", "{", "h", ".", "bufKV", ".", "value", "=", "append", "(", "h", ".", "bufKV", ".", "<mask>", "[", ":", "0", "]", ",", "value", ...
1,588
all-1589
[ "PrintableString", "parsePrintableString", "parses", "a", "ASN", ".", "1", "PrintableString", "from", "the", "given", "byte", "array", "and", "returns", "it", "." ]
[ "func", "parsePrintableString", "(", "bytes", "[", "]", "byte", ")", "(", "ret", "string", ",", "err", "error", ")", "{", "for", "_", ",", "b", ":=", "range", "<mask>", "{", "if", "!", "isPrintable", "(", "b", ")", "{", "err", "=", "asn1", ".", "...
1,589
all-1590
[ "StackWithCaller", "logs", "the", "error", "err", "with", "the", "caller", "package", "name", "and", "the", "stack", "trace", "." ]
[ "func", "StackWithCaller", "(", "err", "interface", "{", "}", ")", "{", "stack", ":=", "make", "(", "[", "]", "byte", ",", "64", "<<", "10", ")", "\n", "stack", "=", "<mask>", "[", ":", "runtime", ".", "Stack", "(", "stack", ",", "false", ")", "]...
1,590
all-1591
[ "disk", "returns", "the", "persistent", "disk", "attached", "to", "the", "vm", "." ]
[ "func", "(", "c", "*", "ComputeUtil", ")", "disk", "(", ")", "(", "*", "<mask>", ".", "Disk", ",", "error", ")", "{", "return", "c", ".", "service", ".", "Disks", ".", "Get", "(", "c", ".", "project", ",", "c", ".", "zone", ",", "c", ".", "di...
1,591
all-1592
[ "DrawImage", "draws", "an", "image", "as", "PNG", "TODO", ":", "add", "type", "(", "tp", ")", "as", "parameter", "to", "argument", "list?" ]
[ "func", "(", "gc", "*", "GraphicContext", ")", "DrawImage", "(", "image", "image", ".", "<mask>", ")", "{", "name", ":=", "strconv", ".", "Itoa", "(", "int", "(", "imageCount", ")", ")", "\n", "imageCount", "++", "\n", "tp", ":=", "\"", "\"", "// \"J...
1,592
all-1593
[ "GetRequiredVersion", "is", "a", "wrapper", "around", "gtk_gl_area_get_required_version", "()", "." ]
[ "func", "(", "v", "*", "GLArea", ")", "GetRequiredVersion", "(", ")", "(", "MajorVersion", ",", "MinorVersion", ")", "{", "<mask>", "major", ",", "minor", "int", "\n", "C", ".", "gtk_gl_area_get_required_version", "(", "v", ".", "native", "(", ")", ",", ...
1,593
all-1594
[ "read", "unsigned", "128", "-", "bit", "integer" ]
[ "func", "readuint128", "(", "pos", "uint32", ")", "*", "big", ".", "Int", "{", "pos2", ":=", "int64", "(", "pos", ")", "\n", "retval", ":=", "big", ".", "NewInt", "(", "0", ")", "\n", "data", ":=", "make", "(", "[", "]", "byte", ",", "16", ")",...
1,594
all-1595
[ "GetIconTooltipMarkup", "()", "is", "a", "wrapper", "around", "gtk_entry_get_icon_tooltip_markup", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetIconTooltipMarkup", "(", "iconPos", "EntryIconPosition", ")", "(", "string", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_entry_get_icon_tooltip_markup", "(", "v", ".", "native", "(", ")", ",", "C", ".", "Gt...
1,595
all-1596
[ "GetAction", "returns", "the", "action", "with", "the", "given", "name", "returns", "nil", "if", "none", "is", "found", "." ]
[ "func", "(", "r", "*", "Resource", ")", "GetAction", "(", "name", "string", ")", "*", "Action", "{", "for", "_", ",", "a", ":=", "range", "r", ".", "Actions", "{", "if", "a", ".", "Name", "==", "<mask>", "{", "return", "a", "\n", "}", "\n", "}"...
1,596
all-1597
[ "invalidate", "the", "content", "of", "a", "region", "of", "some", "or", "all", "of", "a", "framebuffer", "s", "attachments" ]
[ "func", "InvalidateSubFramebuffer", "(", "target", "uint32", ",", "numAttachments", "int32", ",", "attachments", "*", "uint32", ",", "x", "int32", ",", "y", "int32", ",", "<mask>", "int32", ",", "height", "int32", ")", "{", "C", ".", "glowInvalidateSubFramebuf...
1,597
all-1598
[ "Finalize", "ensures", "there", "no", "nil", "pointers", "." ]
[ "func", "(", "c", "*", "SSLConfig", ")", "Finalize", "(", ")", "{", "if", "c", ".", "Enabled", "==", "nil", "{", "c", ".", "Enabled", "=", "Bool", "(", "<mask>", "||", "StringPresent", "(", "c", ".", "Cert", ")", "||", "StringPresent", "(", "c", ...
1,598
all-1599
[ "specify", "multisample", "coverage", "parameters" ]
[ "func", "SampleCoverage", "(", "value", "float32", ",", "invert", "bool", ")", "{", "C", ".", "glowSampleCoverage", "(", "gpSampleCoverage", ",", "(", "C", ".", "GLfloat", ")", "(", "<mask>", ")", ",", "(", "C", ".", "GLboolean", ")", "(", "boolToInt", ...
1,599
all-1600
[ "BumpPatch", "increments", "the", "Patch", "field", "by", "1", "and", "resets", "all", "other", "fields", "to", "their", "default", "values" ]
[ "func", "(", "v", "*", "<mask>", ")", "BumpPatch", "(", ")", "{", "v", ".", "Patch", "+=", "1", "\n", "v", ".", "PreRelease", "=", "PreRelease", "(", "\"", "\"", ")", "\n", "v", ".", "Metadata", "=", "\"", "\"", "\n", "}" ]