id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
2,600
all-2601
[ "GetStat", "provides", "needed", "subset", "of", "FileInfo", "plus", "RealSize", "Atime", "(", "if", "any", ")", "and", "Ctime", "(", "if", "any", ")" ]
[ "func", "GetStat", "(", "i", "<mask>", ".", "FileInfo", ")", "FileStats", "{", "res", ":=", "FileStats", "{", "Size", ":", "i", ".", "Size", "(", ")", ",", "MTime", ":", "i", ".", "ModTime", "(", ")", ".", "Unix", "(", ")", ",", "CTime", ":", "...
2,601
all-2602
[ "CompressHandlerLevel", "returns", "RequestHandler", "that", "transparently", "compresses", "response", "body", "generated", "by", "h", "if", "the", "request", "contains", "gzip", "or", "deflate", "Accept", "-", "Encoding", "header", ".", "Level", "is", "the", "de...
[ "func", "CompressHandlerLevel", "(", "h", "RequestHandler", ",", "level", "int", ")", "RequestHandler", "{", "return", "func", "(", "ctx", "*", "RequestCtx", ")", "{", "h", "(", "ctx", ")", "\n", "if", "ctx", ".", "Request", ".", "Header", ".", "HasAccep...
2,602
all-2603
[ "Me", "returns", "information", "about", "the", "current", "user" ]
[ "func", "(", "c", "*", "Client", ")", "Me", "(", ")", "(", "*", "User", ",", "error", ")", "{", "user", ":=", "&", "<mask>", "{", "}", "\n\n", "err", ":=", "c", ".", "request", "(", "\"", "\"", ",", "\"", "\"", ",", "user", ",", "nil", ",",...
2,603
all-2604
[ "TeeReader", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockFileSystem", ")", "TeeReader", "(", "arg0", "<mask>", ".", "Reader", ",", "arg1", "io", ".", "Writer", ")", "io", ".", "Reader", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ...
2,604
all-2605
[ "Calculates", "the", "key", "and", "iv", "for", "AES", "decryption", "given", "a", "password", "and", "salt", "." ]
[ "func", "calcAes30Params", "(", "pass", "[", "]", "uint16", ",", "salt", "[", "]", "byte", ")", "(", "key", ",", "iv", "[", "]", "byte", ")", "{", "p", ":=", "make", "(", "[", "]", "byte", ",", "0", ",", "len", "(", "pass", ")", "*", "2", "...
2,605
all-2606
[ "/", "*", "polymorph", "RoutesWrapper", "error", "false", "/", "*", "polymorph", "RoutesWrapper", "routes", "false", "Validate", "validates", "this", "routes", "wrapper" ]
[ "func", "(", "m", "*", "RoutesWrapper", ")", "Validate", "(", "formats", "strfmt", ".", "Registry", ")", "error", "{", "var", "res", "[", "]", "error", "\n\n", "if", "err", ":=", "m", ".", "validateError", "(", "formats", ")", ";", "err", "!=", "nil"...
2,606
all-2607
[ "----------------------------------------", "Misc", "." ]
[ "func", "isExported", "(", "field", "reflect", ".", "StructField", ")", "bool", "{", "// Test 1:", "if", "field", ".", "PkgPath", "!=", "\"", "\"", "{", "return", "false", "\n", "}", "\n", "// Test 2:", "var", "first", "rune", "\n", "for", "_", ",", "c...
2,607
all-2608
[ "ParseConfig", "reads", "data", "stored", "in", "given", "config", "path", "In", ":", "configPath", "-", "path", "to", "the", "config", "file", "Out", ":", "A", "list", "of", "ResourceConfig", "object", "on", "success", "or", "nil", "on", "error", "." ]
[ "func", "ParseConfig", "(", "configPath", "string", ")", "(", "[", "]", "common", ".", "ResourcesConfig", ",", "error", ")", "{", "if", "_", ",", "err", ":=", "os", ".", "Stat", "(", "configPath", ")", ";", "os", ".", "IsNotExist", "(", "err", ")", ...
2,608
all-2609
[ "NewWriter", "-", "get", "a", "new", "s3", "writer" ]
[ "func", "(", "s", "*", "S3Bucket", ")", "NewWriter", "(", "path", "string", ")", "(", "<mask>", ".", "WriteCloser", ",", "error", ")", "{", "return", "s", ".", "bucket", ".", "PutWriter", "(", "path", ",", "nil", ",", "nil", ")", "\n", "}" ]
2,609
all-2610
[ "MoveProjectCard", "moves", "a", "specific", "project", "card", "to", "a", "specified", "column", "in", "the", "same", "project" ]
[ "func", "(", "f", "*", "FakeClient", ")", "MoveProjectCard", "(", "projectCardID", "int", ",", "newColumnID", "int", ")", "error", "{", "// Remove project card from old column", "newCards", ":=", "[", "]", "github", ".", "ProjectCard", "{", "}", "\n", "oldColumn...
2,610
all-2611
[ "Glob", "executes", "a", "callback", "for", "each", "path", "that", "matches", "the", "glob", "pattern", "." ]
[ "func", "Glob", "(", "rs", "[", "]", "io", ".", "ReadCloser", ",", "<mask>", "string", ",", "f", "func", "(", "string", ",", "*", "NodeProto", ")", "error", ")", "(", "retErr", "error", ")", "{", "pattern", "=", "clean", "(", "pattern", ")", "\n", ...
2,611
all-2612
[ "GetObject", "returns", "the", "LuaObject", "indexed", "at", "the", "sequence", "of", "subfields", "." ]
[ "func", "(", "lo", "*", "LuaObject", ")", "GetObject", "(", "subfields", "...", "interface", "{", "}", ")", "(", "*", "LuaObject", ",", "error", ")", "{", "lo", ".", "Push", "(", ")", "\n", "defer", "lo", ".", "l", ".", "Pop", "(", "1", ")", "\...
2,612
all-2613
[ "NewRaftLogger", "converts", "*", "zap", ".", "Logger", "to", "raft", ".", "Logger", "." ]
[ "func", "NewRaftLogger", "(", "lcfg", "*", "zap", ".", "Config", ")", "(", "raft", ".", "Logger", ",", "error", ")", "{", "if", "lcfg", "==", "nil", "{", "return", "nil", ",", "<mask>", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "lg", "...
2,613
all-2614
[ "PrintDetailedRepoInfo", "pretty", "-", "prints", "detailed", "repo", "info", "." ]
[ "func", "PrintDetailedRepoInfo", "(", "repoInfo", "*", "PrintableRepoInfo", ")", "error", "{", "template", ",", "err", ":=", "template", ".", "New", "(", "\"", "\"", ")", ".", "Funcs", "(", "funcMap", ")", ".", "Parse", "(", "`Name: {{.Repo.Name}}{{if .Descrip...
2,614
all-2615
[ "Flush", "flushes", "all", "items", "from", "memcache", "." ]
[ "func", "Flush", "(", "c", "context", ".", "Context", ")", "error", "{", "req", ":=", "&", "pb", ".", "MemcacheFlushRequest", "{", "}", "\n", "res", ":=", "&", "<mask>", ".", "MemcacheFlushResponse", "{", "}", "\n", "return", "internal", ".", "Call", "...
2,615
all-2616
[ "Camel", "converts", "to", "camel", "case", "(", "foo_bar", "-", ">", "FooBar", ")" ]
[ "func", "Camel", "(", "s", "string", ")", "string", "{", "<mask>", ":=", "strings", ".", "Split", "(", "s", ",", "\"", "\"", ")", "\n", "for", "i", ":=", "range", "words", "{", "words", "[", "i", "]", "=", "Capital", "(", "words", "[", "i", "]"...
2,616
all-2617
[ "NewServer", "returns", "a", "server", "type", "that", "statisfies", "the", "http", ".", "Handler", "interface", "." ]
[ "func", "NewServer", "(", "opts", "*", "ServerOptions", ")", "*", "<mask>", "{", "server", ":=", "&", "Server", "{", "signer", ":", "opts", ".", "Signer", ",", "verifier", ":", "opts", ".", "Verifier", ",", "isProcessor", ":", "hasProcessor", "(", "opts"...
2,617
all-2618
[ "onlyUpdateStatus", "returns", "the", "response", "to", "the", "request" ]
[ "func", "onlyUpdateStatus", "(", "req", "admissionapi", ".", "AdmissionRequest", ")", "(", "*", "admissionapi", ".", "AdmissionResponse", ",", "error", ")", "{", "logger", ":=", "logrus", ".", "WithFields", "(", "logrus", ".", "Fields", "{", "\"", "\"", ":",...
2,618
all-2619
[ "GetLastBlockNumber", "returns", "last", "known", "block", "number", "." ]
[ "func", "(", "h", "*", "Handler", ")", "GetLastBlockNumber", "(", "tkn", "string", ")", "(", "*", "uint64", ",", "error", ")", "{", "logger", ":=", "h", ".", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "\n\n", "if", "!", "h", "...
2,619
all-2620
[ "NewCursor", "create", "a", "new", "cursor", "with", "the", "DefaultCursor", "the", "specified", "input", "and", "position", "at", "the", "end", "of", "the", "specified", "starting", "input", "." ]
[ "func", "NewCursor", "(", "startinginput", "string", ",", "pointer", "Pointer", ",", "eraseDefault", "bool", ")", "Cursor", "{", "if", "pointer", "==", "nil", "{", "pointer", "=", "defaultCursor", "\n", "}", "\n", "cur", ":=", "Cursor", "{", "Cursor", ":",...
2,620
all-2621
[ "GetIterAtPosition", "is", "a", "wrapper", "around", "gtk_text_view_get_iter_at_position", "()", "." ]
[ "func", "(", "v", "*", "TextView", ")", "GetIterAtPosition", "(", "x", ",", "y", "int", ")", "(", "*", "TextIter", ",", "int", ")", "{", "<mask>", "iter", "C", ".", "GtkTextIter", "\n", "var", "trailing", "C", ".", "gint", "\n", "C", ".", "gtk_text...
2,621
all-2622
[ "ReqTimeout", "returns", "timeout", "for", "request", "to", "finish", "." ]
[ "func", "(", "c", "*", "ServerConfig", ")", "ReqTimeout", "(", ")", "time", ".", "Duration", "{", "// 5s for queue waiting, computation and disk IO delay", "// + 2 * election timeout for possible leader election", "return", "5", "*", "time", ".", "Second", "+", "2", "*"...
2,622
all-2623
[ "Handles", "incoming", "msgPackets", ".", "Returns", "a", "msg", "bytes", "if", "msg", "is", "complete", ".", "Not", "goroutine", "-", "safe" ]
[ "func", "(", "ch", "*", "Channel", ")", "recvMsgPacket", "(", "packet", "msgPacket", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "// log.Debug(\"Read Msg Packet\", \"conn\", ch.conn, \"packet\", packet)", "if", "ch", ".", "desc", ".", "RecvMessageCapacity", ...
2,623
all-2624
[ "Create", "MAPPING", "-", "START", "." ]
[ "func", "yaml_mapping_start_event_initialize", "(", "event", "*", "yaml_event_t", ",", "anchor", ",", "<mask>", "[", "]", "byte", ",", "implicit", "bool", ",", "style", "yaml_mapping_style_t", ")", "{", "*", "event", "=", "yaml_event_t", "{", "typ", ":", "yaml...
2,624
all-2625
[ "Function", "calls", "(", "NOT", "to", "be", "confused", "with", "method", "calls", "which", "are", "totally", "sane", "and", "fine", ")", "in", "go", "-", "xslate", "is", "a", "bit", "different", ".", "Unlike", "in", "non", "-", "compiled", "languages",...
[ "func", "txFunCall", "(", "st", "*", "State", ")", "{", "// Everything in our lvars up to the current tip is our argument list", "mark", ":=", "st", ".", "CurrentMark", "(", ")", "\n", "tip", ":=", "st", ".", "stack", ".", "Size", "(", ")", "-", "1", "\n", "...
2,625
all-2626
[ "Offset", "determines", "the", "character", "offset", "from", "the", "beginning", "of", "the", "current", "line" ]
[ "func", "(", "l", "*", "Lexer", ")", "Offset", "(", ")", "int", "{", "// find last line break", "lineoffset", ":=", "strings", ".", "LastIndex", "(", "l", ".", "<mask>", "[", ":", "l", ".", "Pos", "]", ",", "\"", "\\n", "\"", ")", "\n", "if", "line...
2,626
all-2627
[ "Curls", "an", "app", "s", "endpoint", "and", "exit", "successfully", "before", "the", "default", "timeout" ]
[ "func", "CurlApp", "(", "cfg", "helpersinternal", ".", "CurlConfig", ",", "appName", ",", "<mask>", "string", ",", "args", "...", "string", ")", "string", "{", "appCurler", ":=", "helpersinternal", ".", "NewAppCurler", "(", "Curl", ",", "cfg", ")", "\n", "...
2,627
all-2628
[ "native", "returns", "a", "pointer", "to", "the", "underlying", "GtkRecentManager", "." ]
[ "func", "(", "v", "*", "RecentChooserMenu", ")", "native", "(", ")", "*", "C", ".", "GtkRecentChooserMenu", "{", "if", "v", "==", "nil", "||", "v", ".", "<mask>", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "p", ":=", "unsafe", ".", "Pointe...
2,628
all-2629
[ "NewCert", "generates", "TLS", "cert", "by", "using", "the", "given", "cert", "key", "and", "parse", "function", "." ]
[ "func", "NewCert", "(", "certfile", ",", "keyfile", "string", ",", "parseFunc", "func", "(", "[", "]", "byte", ",", "[", "]", "byte", ")", "(", "tls", ".", "Certificate", ",", "error", ")", ")", "(", "*", "tls", ".", "Certificate", ",", "error", ")...
2,629
all-2630
[ "isLocalAddress", "works", "by", "checking", "if", "the", "address", "is", "under", "private", "CIDR", "blocks", ".", "List", "of", "private", "CIDR", "blocks", "can", "be", "seen", "on", ":", "https", ":", "//", "en", ".", "wikipedia", ".", "org", "/", ...
[ "func", "isPrivateAddress", "(", "address", "string", ")", "(", "bool", ",", "error", ")", "{", "ipAddress", ":=", "net", ".", "ParseIP", "(", "address", ")", "\n", "if", "ipAddress", "==", "nil", "{", "return", "false", ",", "<mask>", ".", "New", "(",...
2,630
all-2631
[ "tailSort", "pushes", "nodes", "with", "/", "as", "the", "tail", "to", "the", "end", "of", "the", "list", "for", "param", "nodes", ".", "The", "list", "order", "determines", "the", "traversal", "order", "." ]
[ "func", "(", "<mask>", "nodes", ")", "tailSort", "(", ")", "{", "for", "i", ":=", "len", "(", "ns", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", "{", "if", "ns", "[", "i", "]", ".", "typ", ">", "ntStatic", "&&", "ns", "[", "i", "]"...
2,631
all-2632
[ "SetUChar", "is", "a", "wrapper", "around", "g_value_set_uchar", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "SetUChar", "(", "val", "uint8", ")", "{", "C", ".", "g_value_set_uchar", "(", "v", ".", "native", "(", ")", ",", "C", ".", "guchar", "(", "val", ")", ")", "\n", "}" ]
2,632
all-2633
[ "getRecordID", "returns", "the", "ID", "from", "a", "record", ".", "the", "ID", "is", "mandatory", "to", "update", "and", "delete", "records" ]
[ "func", "(", "p", "*", "DigitalOceanProvider", ")", "getRecordID", "(", "records", "[", "]", "godo", ".", "DomainRecord", ",", "record", "godo", ".", "DomainRecord", ")", "int", "{", "for", "_", ",", "zoneRecord", ":=", "range", "records", "{", "if", "zo...
2,633
all-2634
[ "skipUPNP", ":", "If", "true", "does", "not", "try", "getUPNPExternalAddress", "()" ]
[ "func", "NewDefaultListener", "(", "protocol", "string", ",", "lAddr", "string", ",", "skipUPNP", "bool", ")", "Listener", "{", "// Local listen IP & port", "lAddrIP", ",", "lAddrPort", ":=", "splitHostPort", "(", "lAddr", ")", "\n\n", "// Create listener", "var", ...
2,634
all-2635
[ "expandCustomizationUserData", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "CustomizationUserData", "." ]
[ "func", "expandCustomizationUserData", "(", "d", "*", "schema", ".", "ResourceData", ")", "types", ".", "CustomizationUserData", "{", "obj", ":=", "<mask>", ".", "CustomizationUserData", "{", "FullName", ":", "d", ".", "Get", "(", "cWindowsKeyPrefix", "+", "\"",...
2,635
all-2636
[ "Invert", "inverts", "the", "matrix", ".", "If", "g", "is", "not", "invertible", "Invert", "panics", "." ]
[ "func", "(", "g", "*", "GeoM", ")", "Invert", "(", ")", "{", "det", ":=", "g", ".", "det", "(", ")", "\n", "if", "det", "==", "0", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "a", ":=", "(", "g", ".", "d_1", "+", "1", ")", "/...
2,636
all-2637
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "apps", "app", "params" ]
[ "func", "(", "o", "*", "GetAppsAppParams", ")", "WithHTTPClient", "(", "<mask>", "*", "http", ".", "Client", ")", "*", "GetAppsAppParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
2,637
all-2638
[ "MarshalEasyJSON", "satisfies", "easyjson", ".", "Marshaler", "." ]
[ "func", "(", "t", "InterceptionStage", ")", "MarshalEasyJSON", "(", "out", "*", "jwriter", ".", "Writer", ")", "{", "<mask>", ".", "String", "(", "string", "(", "t", ")", ")", "\n", "}" ]
2,638
all-2639
[ "Valid", "validator" ]
[ "func", "(", "c", "*", "conditionalRule", ")", "Valid", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "<mask>", ")", "bool", "{", "if", "!", "c", ".", "validPredicate", "(", ")", "{", "return", "false", "\n", "}", "\n", "retu...
2,639
all-2640
[ "CallSC", "makes", "a", "JSON", "call", "using", "the", "given", "subchannel", "." ]
[ "func", "CallSC", "(", "ctx", "<mask>", ",", "sc", "*", "tchannel", ".", "SubChannel", ",", "method", "string", ",", "arg", ",", "resp", "interface", "{", "}", ")", "error", "{", "call", ",", "err", ":=", "sc", ".", "BeginCall", "(", "ctx", ",", "m...
2,640
all-2641
[ "Upload", "uploads", "all", "of", "the", "data", "in", "the", "uploadTargets", "map", "to", "GCS", "in", "parallel", ".", "The", "map", "is", "keyed", "on", "GCS", "path", "under", "the", "bucket" ]
[ "func", "Upload", "(", "bucket", "*", "storage", ".", "BucketHandle", ",", "uploadTargets", "map", "[", "string", "]", "UploadFunc", ")", "error", "{", "errCh", ":=", "make", "(", "chan", "error", ",", "len", "(", "uploadTargets", ")", ")", "\n", "<mask>...
2,641
all-2642
[ "char", "*", "pango_font_description_to_filename", "(", "const", "PangoFontDescription", "*", "desc", ")", ";" ]
[ "func", "(", "v", "*", "FontDescription", ")", "ToFilename", "(", ")", "string", "{", "c", ":=", "C", ".", "pango_font_description_to_filename", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "C", ".", "GoString", "(", "(", "*", "C", ".", "<...
2,642
all-2643
[ "ServerGroup", "retrieves", "a", "detailed", "view", "on", "one", "server", "group" ]
[ "func", "(", "c", "*", "Client", ")", "ServerGroup", "(", "identifier", "string", ")", "(", "*", "ServerGroup", ",", "error", ")", "{", "group", ":=", "new", "(", "ServerGroup", ")", "\n", "_", ",", "err", ":=", "c", ".", "MakeApiRequest", "(", "\"",...
2,643
all-2644
[ "NewTransport", "Creates", "a", "default", "transport" ]
[ "func", "NewTransport", "(", ")", "*", "http", ".", "Transport", "{", "direct", ":=", "&", "net", ".", "Dialer", "{", "Timeout", ":", "30", "*", "time", ".", "Second", ",", "KeepAlive", ":", "30", "*", "time", ".", "Second", ",", "DualStack", ":", ...
2,644
all-2645
[ "Release", "deletes", "the", "pid", "file", "and", "releases", "our", "lock", "on", "the", "directory", "." ]
[ "func", "(", "guard", "*", "directoryLockGuard", ")", "release", "(", ")", "error", "{", "var", "err", "error", "\n", "if", "!", "guard", ".", "readOnly", "{", "// It's important that we remove the pid file first.", "err", "=", "os", ".", "Remove", "(", "guard...
2,645
all-2646
[ "IsEquivalent", "returns", "true", "if", "other", "represents", "the", "same", "data", "type", "as", "the", "target", "." ]
[ "func", "(", "b", "*", "BasicDataType", ")", "IsEquivalent", "(", "other", "DataType", ")", "bool", "{", "t", ",", "<mask>", ":=", "other", ".", "(", "*", "BasicDataType", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "return",...
2,646
all-2647
[ "Scan", "implements", "the", "Scanner", "interface", "." ]
[ "func", "(", "n", "*", "NullTime", ")", "Scan", "(", "value", "interface", "{", "}", ")", "error", "{", "n", ".", "Time", ",", "n", ".", "Valid", "=", "value", ".", "(", "<mask>", ".", "Time", ")", "\n", "return", "nil", "\n", "}" ]
2,647
all-2648
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetFlattenedDocumentParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom43", "(", "&", "w", ",", "v", ...
2,648
all-2649
[ "GetBranches", "returns", "all", "branches", "in", "the", "repo", ".", "If", "onlyProtected", "is", "true", "it", "will", "only", "return", "repos", "with", "protection", "enabled", "and", "branch", ".", "Protected", "will", "be", "true", ".", "Otherwise", "...
[ "func", "(", "c", "*", "Client", ")", "GetBranches", "(", "org", ",", "repo", "string", ",", "onlyProtected", "bool", ")", "(", "[", "]", "Branch", ",", "error", ")", "{", "c", ".", "<mask>", "(", "\"", "\"", ",", "org", ",", "repo", ")", "\n", ...
2,649
all-2650
[ "NOTE", ":", "secret", "should", "be", "the", "output", "of", "a", "KDF", "like", "bcrypt", "if", "it", "s", "derived", "from", "user", "input", "." ]
[ "func", "GenPrivKeySecp256k1FromSecret", "(", "<mask>", "[", "]", "byte", ")", "PrivKeySecp256k1", "{", "privKey32", ":=", "Sha256", "(", "secret", ")", "// Not Ripemd160 because we want 32 bytes.", "\n", "priv", ",", "_", ":=", "secp256k1", ".", "PrivKeyFromBytes", ...
2,650
all-2651
[ "DebugCookbookPathLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "DebugCookbookPathLocator", "(", "href", "<mask>", ")", "*", "DebugCookbookPathLocator", "{", "return", "&", "DebugCookbookPathLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
2,651
all-2652
[ "LineTo", "adds", "a", "math", ".", "Segment", "to", "the", "path", "which", "starts", "from", "the", "current", "position", "and", "ends", "to", "the", "given", "position", "(", "x", "y", ")", ".", "LineTo", "updates", "the", "current", "position", "to"...
[ "func", "(", "p", "*", "Path", ")", "LineTo", "(", "x", ",", "y", "float32", ")", "{", "if", "len", "(", "p", ".", "segs", ")", "==", "0", "{", "p", ".", "segs", "=", "append", "(", "p", ".", "segs", ",", "[", "]", "math", ".", "Segment", ...
2,652
all-2653
[ "Using", "the", "classic", "API", "posts", "a", "count", "to", "a", "stat", "." ]
[ "func", "(", "r", "*", "BasicReporter", ")", "PostCount", "(", "statKey", ",", "userKey", "string", ",", "<mask>", "int", ")", "error", "{", "r", ".", "add", "(", "newClassicStatCount", "(", "statKey", ",", "userKey", ",", "count", ")", ")", "\n", "ret...
2,653
all-2654
[ "generateENIExtraHosts", "returns", "a", "slice", "of", "strings", "of", "the", "form", "hostname", ":", "ip", "that", "is", "generated", "using", "the", "hostname", "and", "ip", "addresses", "allocated", "to", "the", "ENI" ]
[ "func", "(", "task", "*", "Task", ")", "generateENIExtraHosts", "(", ")", "[", "]", "string", "{", "eni", ":=", "<mask>", ".", "GetTaskENI", "(", ")", "\n", "if", "eni", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "hostname", ":=", "eni", ...
2,654
all-2655
[ "Return", "the", "first", "suffix", "found", "or", "the", "empty", "string", "." ]
[ "func", "(", "w", "*", "SnowballWord", ")", "FirstSuffix", "(", "suffixes", "...", "string", ")", "(", "suffix", "<mask>", ",", "suffixRunes", "[", "]", "rune", ")", "{", "return", "w", ".", "FirstSuffixIfIn", "(", "0", ",", "len", "(", "w", ".", "RS...
2,655
all-2656
[ "Do", "executes", "Page", ".", "setLifecycleEventsEnabled", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetLifecycleEventsEnabledParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetLifecycleEventsEnabled", ",", "p", ",", "nil", ")", ...
2,656
all-2657
[ "ContainerNodeList", "returns", "all", "container", "objects", "on", "the", "local", "node", "." ]
[ "func", "(", "c", "*", "ClusterTx", ")", "ContainerNodeList", "(", ")", "(", "[", "]", "Container", ",", "error", ")", "{", "node", ",", "err", ":=", "c", ".", "NodeName", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "erro...
2,657
all-2658
[ "ReadResponse", "reads", "a", "server", "response", "into", "the", "received", "o", "." ]
[ "func", "(", "o", "*", "GetVMByCidReader", ")", "ReadResponse", "(", "response", "runtime", ".", "ClientResponse", ",", "consumer", "runtime", ".", "Consumer", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "<mask>", "response", ".", "Code", "(",...
2,658
all-2659
[ "SetEllipsize", "is", "a", "wrapper", "around", "gtk_label_set_ellipsize", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "SetEllipsize", "(", "mode", "pango", ".", "EllipsizeMode", ")", "{", "C", ".", "gtk_label_set_ellipsize", "(", "v", ".", "native", "(", ")", ",", "C", ".", "PangoEllipsizeMode", "(", "mode", ")", ")", "\n", "}" ]
2,659
all-2660
[ "RmFile", "deletes", "a", "file", "in", "the", "guest", "operating", "system", ".", "Parameters", ":", "filepath", ":", "file", "path", "to", "be", "deleted", "in", "the", "guest", "OS", "Remarks", ":", "*", "Only", "absolute", "paths", "should", "be", "...
[ "func", "(", "g", "*", "Guest", ")", "RmFile", "(", "filepath", "string", ")", "error", "{", "var", "jobHandle", "C", ".", "VixHandle", "=", "C", ".", "VIX_INVALID_HANDLE", "\n", "var", "err", "C", ".", "VixError", "=", "C", ".", "VIX_OK", "\n\n", "f...
2,660
all-2661
[ "Notify", "calls", "NotifierFunc", "(", "subject", "body", ")", "." ]
[ "func", "(", "f", "NotifierFunc", ")", "Notify", "(", "subject", ",", "body", "string", ")", "error", "{", "return", "f", "(", "subject", ",", "<mask>", ")", "\n", "}" ]
2,661
all-2662
[ "snapNames", "returns", "the", "filename", "of", "the", "snapshots", "in", "logical", "time", "order", "(", "from", "newest", "to", "oldest", ")", ".", "If", "there", "is", "no", "available", "snapshots", "an", "ErrNoSnapshot", "will", "be", "returned", "." ...
[ "func", "(", "s", "*", "Snapshotter", ")", "snapNames", "(", ")", "(", "[", "]", "string", ",", "error", ")", "{", "dir", ",", "err", ":=", "os", ".", "Open", "(", "s", ".", "dir", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",...
2,662
all-2663
[ "ServeHTTP", "validates", "an", "incoming", "webhook", "and", "puts", "it", "into", "the", "event", "channel", "." ]
[ "func", "(", "s", "*", "Server", ")", "ServeHTTP", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "eventType", ",", "eventGUID", ",", "payload", ",", "ok", ",", "resp", ":=", "github", ".", "ValidateWebhook", ...
2,663
all-2664
[ "String", "satisfies", "the", "stringer", "interface", "." ]
[ "func", "(", "u", "*", "URL", ")", "String", "(", ")", "string", "{", "p", ":=", "&", "<mask>", ".", "URL", "{", "Scheme", ":", "u", ".", "OriginalScheme", ",", "Opaque", ":", "u", ".", "Opaque", ",", "User", ":", "u", ".", "User", ",", "Host",...
2,664
all-2665
[ "Cross", "returns", "the", "cross", "product", "of", "two", "vectors", ".", "v", "x", "v1" ]
[ "func", "(", "v", "Vec3", ")", "Cross", "(", "v1", "Vec3", ")", "Vec3", "{", "<mask>", "Vec3", "{", "v", "[", "1", "]", "*", "v1", "[", "2", "]", "-", "v", "[", "2", "]", "*", "v1", "[", "1", "]", ",", "v", "[", "2", "]", "*", "v1", "...
2,665
all-2666
[ "TransferLeadership", "transfers", "the", "leader", "to", "the", "chosen", "transferee", "." ]
[ "func", "(", "s", "*", "EtcdServer", ")", "TransferLeadership", "(", ")", "error", "{", "if", "!", "s", ".", "isLeader", "(", ")", "{", "if", "lg", ":=", "s", ".", "getLogger", "(", ")", ";", "lg", "!=", "nil", "{", "lg", ".", "Info", "(", "\""...
2,666
all-2667
[ "overrideHeaders", "sets", "headers", "if", "the", "call", "options", "contains", "non", "-", "default", "values", "." ]
[ "func", "(", "c", "*", "CallOptions", ")", "overrideHeaders", "(", "<mask>", "transportHeaders", ")", "{", "if", "c", ".", "Format", "!=", "\"", "\"", "{", "headers", "[", "ArgScheme", "]", "=", "c", ".", "Format", ".", "String", "(", ")", "\n", "}",...
2,667
all-2668
[ "DevicePresence", "returns", "data", "about", "presence", "of", "a", "data" ]
[ "func", "(", "p", "*", "Pushy", ")", "DevicePresence", "(", "deviceID", "...", "string", ")", "(", "*", "DevicePresenceResponse", ",", "*", "Error", ",", "error", ")", "{", "url", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "p", ".", "APIEndpo...
2,668
all-2669
[ "This", "is", "somewhat", "of", "a", "horrible", "hack", ".", "We", "need", "to", "unset", "GPG_AGENT_INFO", "so", "that", "gpgme", "does", "not", "pass", "--", "use", "-", "agent", "to", "GPG", ".", "os", ".", "Unsetenv", "should", "be", "enough", "bu...
[ "func", "unsetenvGPGAgentInfo", "(", ")", "{", "v", ":=", "C", ".", "CString", "(", "\"", "\"", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "v", ")", ")", "\n", "C", ".", "unsetenv", "(", "v", ")", "\n", "}" ]
2,669
all-2670
[ "WithHeaders", "if", "set", "overrides", "the", "request", "headrts", "." ]
[ "func", "(", "p", "ContinueRequestParams", ")", "WithHeaders", "(", "<mask>", "[", "]", "*", "HeaderEntry", ")", "*", "ContinueRequestParams", "{", "p", ".", "Headers", "=", "headers", "\n", "return", "&", "p", "\n", "}" ]
2,670
all-2671
[ "submitChanges", "takes", "a", "zone", "and", "a", "collection", "of", "Changes", "and", "sends", "them", "as", "a", "single", "transaction", "." ]
[ "func", "(", "p", "*", "CloudFlareProvider", ")", "submitChanges", "(", "changes", "[", "]", "*", "cloudFlareChange", ")", "error", "{", "// return early if there is nothing to change", "if", "len", "(", "changes", ")", "==", "0", "{", "return", "nil", "\n", "...
2,671
all-2672
[ "flattenClusterFailoverResourcesAdmissionControlPolicy", "saves", "a", "ClusterFailoverResourcesAdmissionControlPolicy", "into", "the", "supplied", "ResourceData", "." ]
[ "func", "flattenClusterFailoverResourcesAdmissionControlPolicy", "(", "d", "*", "schema", ".", "ResourceData", ",", "obj", "*", "types", ".", "ClusterFailoverResourcesAdmissionControlPolicy", ",", "version", "viapi", ".", "VSphereVersion", ",", ")", "error", "{", "// Au...
2,672
all-2673
[ "IsWritable", "is", "a", "wrapper", "around", "g_settings_is_writable", "()", "." ]
[ "func", "(", "v", "*", "Settings", ")", "IsWritable", "(", "<mask>", "string", ")", "bool", "{", "cstr1", ":=", "(", "*", "C", ".", "gchar", ")", "(", "C", ".", "CString", "(", "name", ")", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", "...
2,673
all-2674
[ "Task", "creates", "a", "Task", "that", "will", "invoke", "the", "function", ".", "Its", "parameters", "may", "be", "tweaked", "before", "adding", "it", "to", "a", "queue", ".", "Users", "should", "not", "modify", "the", "Path", "or", "Payload", "fields", ...
[ "func", "(", "f", "*", "Function", ")", "Task", "(", "args", "...", "interface", "{", "}", ")", "(", "*", "taskqueue", ".", "Task", ",", "error", ")", "{", "if", "f", ".", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "("...
2,674
all-2675
[ "addWarning", "builds", "a", "non", "-", "severe", "Error", "and", "appends", "to", "the", "Part", "error", "slice", "." ]
[ "func", "(", "p", "*", "Part", ")", "addWarning", "(", "name", "string", ",", "detailFmt", "string", ",", "args", "...", "<mask>", "{", "}", ")", "{", "p", ".", "Errors", "=", "append", "(", "p", ".", "Errors", ",", "&", "Error", "{", "name", ","...
2,675
all-2676
[ "FromItem", "implements", "the", "Object", "interface" ]
[ "func", "(", "in", "*", "ResourcesConfigObject", ")", "FromItem", "(", "i", "common", ".", "Item", ")", "{", "c", ",", "err", ":=", "common", ".", "ItemToResourcesConfig", "(", "i", ")", "\n", "if", "err", "==", "nil", "{", "<mask>", ".", "fromConfig",...
2,676
all-2677
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniform3iv", "(", "program", "uint32", ",", "location", "int32", ",", "count", "int32", ",", "value", "*", "int32", ")", "{", "syscall", ".", "Syscall6", "(", "gpProgramUniform3iv", ",", "4", ",", "uintptr", "(", "program", ")", ",", "uintp...
2,677
all-2678
[ "readRuntimeConstants", "populates", "the", "p", ".", "rtConstants", "map", "." ]
[ "func", "(", "p", "*", "Process", ")", "readRuntimeConstants", "(", ")", "{", "p", ".", "rtConstants", "=", "map", "[", "string", "]", "int64", "{", "}", "\n\n", "// Hardcoded values for Go 1.9.", "// (Go did not have constants in DWARF before 1.10.)", "m", ":=", ...
2,678
all-2679
[ "UpdateAll", "signals", "update", "for", "all", "resources", "hold", "by", "the", "client", "." ]
[ "func", "(", "c", "*", "Client", ")", "UpdateAll", "(", "state", "string", ")", "error", "{", "c", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "resources", ",", "err", ":=", "c", ".", "s...
2,679
all-2680
[ "Range", "returns", "the", "points", "within", "the", "range", "defined", "by", "top", "left", "and", "bottom", "right", "." ]
[ "func", "(", "points", "*", "PointsIndex", ")", "Range", "(", "topLeft", "<mask>", ",", "bottomRight", "Point", ")", "[", "]", "Point", "{", "entries", ":=", "points", ".", "index", ".", "Range", "(", "topLeft", ",", "bottomRight", ")", "\n", "accept", ...
2,680
all-2681
[ "Get", "gets", "the", "value", "by", "key", "as", "it", "exists", "for", "the", "current", "goroutine", "." ]
[ "func", "Get", "(", "<mask>", "string", ")", "interface", "{", "}", "{", "gid", ":=", "curGoroutineID", "(", ")", "\n", "dataLock", ".", "RLock", "(", ")", "\n", "if", "data", "[", "gid", "]", "==", "nil", "{", "dataLock", ".", "RUnlock", "(", ")",...
2,681
all-2682
[ "GenerateRule", "returns", "a", "repository", "rule", "for", "the", "given", "repository", "that", "can", "be", "written", "in", "a", "WORKSPACE", "file", "." ]
[ "func", "GenerateRule", "(", "repo", "Repo", ")", "*", "rule", ".", "Rule", "{", "r", ":=", "rule", ".", "NewRule", "(", "\"", "\"", ",", "repo", ".", "Name", ")", "\n", "if", "repo", ".", "Commit", "!=", "\"", "\"", "{", "r", ".", "SetAttr", "...
2,682
all-2683
[ "SetResolutionXY", "()", "is", "a", "wrapper", "around", "gtk_print_settings_set_resolution_xy", "()", "." ]
[ "func", "(", "<mask>", "*", "PrintSettings", ")", "SetResolutionXY", "(", "resolutionX", ",", "resolutionY", "int", ")", "{", "C", ".", "gtk_print_settings_set_resolution_xy", "(", "ps", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "resolutionX", ")"...
2,683
all-2684
[ "DeleteJob", "deletes", "the", "job", "with", "the", "given", "id", "." ]
[ "func", "(", "c", "*", "Client", ")", "DeleteJob", "(", "id", "string", ")", "error", "{", "return", "c", ".", "<mask>", "(", "[", "]", "string", "{", "\"", "\"", ",", "id", "}", ")", "\n", "}" ]
2,684
all-2685
[ "iterDir", "iterates", "through", "the", "nodes", "under", "path", "it", "errors", "with", "PathNotFound", "if", "path", "doesn", "t", "exist", "it", "errors", "with", "PathConflict", "if", "path", "exists", "but", "isn", "t", "a", "directory", "." ]
[ "func", "iterDir", "(", "tx", "*", "bolt", ".", "Tx", ",", "<mask>", "string", ",", "f", "func", "(", "k", ",", "v", "[", "]", "byte", ",", "c", "*", "bolt", ".", "Cursor", ")", "error", ")", "error", "{", "node", ",", "err", ":=", "get", "("...
2,685
all-2686
[ "readFull", "wraps", "io", ".", "ReadFull", "to", "return", "io", ".", "ErrUnexpectedEOF", "instead", "of", "io", ".", "EOF", "when", "0", "bytes", "are", "read", "." ]
[ "func", "readFull", "(", "r", "io", ".", "Reader", ",", "buf", "[", "]", "<mask>", ")", "error", "{", "_", ",", "err", ":=", "io", ".", "ReadFull", "(", "r", ",", "buf", ")", "\n", "if", "err", "==", "io", ".", "EOF", "{", "return", "io", "."...
2,686
all-2687
[ "FillFrom", "fills", "the", "buffer", "from", "a", "reader" ]
[ "func", "(", "r", "*", "ReadBuffer", ")", "FillFrom", "(", "ior", "<mask>", ".", "Reader", ",", "n", "int", ")", "(", "int", ",", "error", ")", "{", "if", "len", "(", "r", ".", "buffer", ")", "<", "n", "{", "return", "0", ",", "ErrEOF", "\n", ...
2,687
all-2688
[ "recordsForDNS", "gets", "the", "current", "records", ".", "Returns", "the", "current", "records", "or", "an", "error", "if", "the", "operation", "failed", "." ]
[ "func", "(", "p", "*", "AlibabaCloudProvider", ")", "recordsForDNS", "(", ")", "(", "endpoints", "[", "]", "*", "endpoint", ".", "Endpoint", ",", "_", "error", ")", "{", "records", ",", "err", ":=", "p", ".", "records", "(", ")", "\n", "if", "err", ...
2,688
all-2689
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventLoadingFailed", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork54", "(", "&", "w", ",", "v", ")...
2,689
all-2690
[ "CONTRACT", ":", "rv", ".", "CanAddr", "()", "is", "true", "." ]
[ "func", "(", "cdc", "*", "Codec", ")", "decodeReflectJSONSlice", "(", "bz", "[", "]", "byte", ",", "<mask>", "*", "TypeInfo", ",", "rv", "reflect", ".", "Value", ",", "fopts", "FieldOptions", ")", "(", "err", "error", ")", "{", "if", "!", "rv", ".", ...
2,690
all-2691
[ "ListenAndServe", "listens", "on", "the", "TCP", "network", "address", "server", ".", "Addr", "and", "then", "spawns", "a", "call", "to", "the", "ServeTELNET", "method", "on", "the", "server", ".", "Handler", "to", "serve", "each", "incoming", "connection", ...
[ "func", "(", "server", "*", "Server", ")", "ListenAndServe", "(", ")", "error", "{", "addr", ":=", "server", ".", "Addr", "\n", "if", "\"", "\"", "==", "addr", "{", "addr", "=", "\"", "\"", "\n", "}", "\n\n\n", "listener", ",", "err", ":=", "<mask>...
2,691
all-2692
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "RemoteLocation", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget4", "(", "&", "r",...
2,692
all-2693
[ "OptQueryColumnAttrs", "enables", "returning", "column", "attributes", "in", "the", "result", "." ]
[ "func", "OptQueryColumnAttrs", "(", "<mask>", "bool", ")", "QueryOption", "{", "return", "func", "(", "options", "*", "QueryOptions", ")", "error", "{", "options", ".", "ColumnAttrs", "=", "enable", "\n", "return", "nil", "\n", "}", "\n", "}" ]
2,693
all-2694
[ "TargetsDropped", "returns", "the", "dropped", "targets", "during", "relabelling", "." ]
[ "func", "(", "m", "*", "Manager", ")", "TargetsDropped", "(", ")", "map", "[", "string", "]", "[", "]", "*", "Target", "{", "m", ".", "mtxScrape", ".", "Lock", "(", ")", "\n", "defer", "m", ".", "mtxScrape", ".", "Unlock", "(", ")", "\n\n", "targ...
2,694
all-2695
[ "title", ":", "event", "list", "path", ":", "/", "events", "method", ":", "GET", "produce", ":", "application", "/", "json", "responses", ":", "200", ":", "OK", "204", ":", "No", "content" ]
[ "func", "eventList", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "error", "{", "var", "filter", "*", "event", ".", "Filter", "\n", "err", ":=", "ParseInput", "(", "r", ",", "&...
2,695
all-2696
[ "SetPadding", "is", "a", "wrapper", "around", "gtk_alignment_set_padding", "()", "." ]
[ "func", "(", "v", "*", "Alignment", ")", "SetPadding", "(", "top", ",", "bottom", ",", "left", ",", "right", "uint", ")", "{", "C", ".", "gtk_alignment_set_padding", "(", "v", ".", "native", "(", ")", ",", "C", ".", "guint", "(", "top", ")", ",", ...
2,696
all-2697
[ "PerformAt", "performs", "a", "job", "at", "a", "particular", "time", "using", "a", "goroutine", "." ]
[ "func", "(", "w", "Simple", ")", "PerformAt", "(", "job", "<mask>", ",", "t", "time", ".", "Time", ")", "error", "{", "return", "w", ".", "PerformIn", "(", "job", ",", "time", ".", "Until", "(", "t", ")", ")", "\n", "}" ]
2,697
all-2698
[ "GetWindow", "is", "a", "wrapper", "around", "gdk_gl_context_get_window", "()", "." ]
[ "func", "(", "v", "*", "GLContext", ")", "GetSurface", "(", ")", "(", "*", "Window", ",", "<mask>", ")", "{", "c", ":=", "C", ".", "gdk_gl_context_get_window", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "...
2,698
all-2699
[ "Gets", "all", "build", "ids", "for", "a", "job", "." ]
[ "func", "(", "bucket", "gcsBucket", ")", "listBuildIDs", "(", "root", "string", ")", "(", "[", "]", "int64", ",", "error", ")", "{", "ids", ":=", "[", "]", "int64", "{", "}", "\n", "if", "strings", ".", "HasPrefix", "(", "root", ",", "logsPrefix", ...
2,699
all-2700
[ "TotalRootSnapshots", "returns", "the", "number", "of", "top", "-", "level", "(", "root", ")", "snapshots", "belonging", "to", "a", "virtual", "machine", ".", "Remarks", ":", "*", "This", "function", "returns", "the", "number", "of", "top", "-", "level", "...
[ "func", "(", "v", "*", "VM", ")", "TotalRootSnapshots", "(", ")", "(", "int", ",", "error", ")", "{", "var", "<mask>", "C", ".", "int", "\n", "var", "err", "C", ".", "VixError", "=", "C", ".", "VIX_OK", "\n\n", "err", "=", "C", ".", "VixVM_GetNum...