id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
5,300
all-5301
[ "Use", "the", "specified", "Middleware", "for", "the", "App", ".", "When", "defined", "on", "an", "*", "App", "the", "specified", "middleware", "will", "be", "inherited", "by", "any", "Group", "calls", "that", "are", "made", "on", "that", "on", "the", "A...
[ "func", "(", "<mask>", "*", "MiddlewareStack", ")", "Use", "(", "mw", "...", "MiddlewareFunc", ")", "{", "ms", ".", "stack", "=", "append", "(", "ms", ".", "stack", ",", "mw", "...", ")", "\n", "}" ]
5,301
all-5302
[ "render", "primitives", "from", "array", "data" ]
[ "func", "DrawElements", "(", "mode", "uint32", ",", "<mask>", "int32", ",", "xtype", "uint32", ",", "indices", "unsafe", ".", "Pointer", ")", "{", "syscall", ".", "Syscall6", "(", "gpDrawElements", ",", "4", ",", "uintptr", "(", "mode", ")", ",", "uintpt...
5,302
all-5303
[ "explodeHelper", "is", "a", "recursive", "helper", "for", "explode", "." ]
[ "func", "explodeHelper", "(", "m", "map", "[", "string", "]", "interface", "{", "}", ",", "k", ",", "v", ",", "p", "string", ")", "error", "{", "if", "strings", ".", "Contains", "(", "k", ",", "\"", "\"", ")", "{", "parts", ":=", "strings", ".", ...
5,303
all-5304
[ "NewClient", "creates", "a", "new", "Client", "." ]
[ "func", "NewClient", "(", "logger", "log", ".", "Logger", ",", "conf", "influx", ".", "HTTPConfig", ",", "db", "string", ",", "rp", "string", ")", "*", "Client", "{", "c", ",", "err", ":=", "influx", ".", "NewHTTPClient", "(", "conf", ")", "\n", "// ...
5,304
all-5305
[ "MarshalEasyJSON", "writes", "the", "IPv4", "to", "a", "easyjson", ".", "Writer" ]
[ "func", "(", "u", "IPv4", ")", "MarshalEasyJSON", "(", "w", "*", "jwriter", ".", "Writer", ")", "{", "w", ".", "<mask>", "(", "string", "(", "u", ")", ")", "\n", "}" ]
5,305
all-5306
[ "title", ":", "volume", "update", "path", ":", "/", "volumes", "/", "{", "name", "}", "method", ":", "POST", "produce", ":", "application", "/", "json", "responses", ":", "200", ":", "Volume", "updated", "401", ":", "Unauthorized", "404", ":", "Volume", ...
[ "func", "volumeUpdate", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "(", "err", "error", ")", "{", "var", "inputVolume", "volume", ".", "Volume", "\n", "err", "=", "ParseInput", ...
5,306
all-5307
[ "Text", "retruns", "a", "TemplateView", "witch", "uses", "text", "templates", "internally", "." ]
[ "func", "Text", "(", "name", ",", "contentType", ",", "charSet", "string", ")", "template", "{", "if", "textTemp", ".", "Template", "==", "nil", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "contentType", "==", "\"", "\"", "{", "content...
5,307
all-5308
[ "GetFromOk", "returns", "a", "tuple", "with", "the", "From", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TimeRange", ")", "GetFromOk", "(", ")", "(", "json", ".", "Number", ",", "bool", ")", "{", "if", "t", "==", "nil", "||", "t", ".", "From", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", ...
5,308
all-5309
[ "LongestLine", "returns", "the", "longest", "step", "line", "in", "a", "scenario", "." ]
[ "func", "(", "s", "*", "Scenario", ")", "LongestLine", "(", ")", "int", "{", "if", "s", ".", "longestLine", "==", "0", "{", "s", ".", "longestLine", "=", "len", "(", "\"", "\"", "+", "s", ".", "Title", ")", "\n", "for", "_", ",", "step", ":=", ...
5,309
all-5310
[ "DeleteProjectCard", "deletes", "the", "project", "card", "of", "a", "specific", "issue", "or", "PR" ]
[ "func", "(", "f", "*", "FakeClient", ")", "DeleteProjectCard", "(", "projectCardID", "int", ")", "error", "{", "if", "f", ".", "ColumnCardsMap", "==", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "f", ".", "Proje...
5,310
all-5311
[ "SetProgressReportInterval", "updates", "the", "current", "progress", "report", "interval", "(", "for", "testing", ")", "." ]
[ "func", "SetProgressReportInterval", "(", "newTimeout", "<mask>", ".", "Duration", ")", "{", "progressReportIntervalMu", ".", "Lock", "(", ")", "\n", "progressReportInterval", "=", "newTimeout", "\n", "progressReportIntervalMu", ".", "Unlock", "(", ")", "\n", "}" ]
5,311
all-5312
[ "Set", "is", "required", "for", "kingpin", "interfaces", "to", "allow", "command", "line", "params", "to", "be", "set", "to", "our", "map", "datatype" ]
[ "func", "(", "o", "*", "ListFloat64Option", ")", "Set", "(", "<mask>", "string", ")", "error", "{", "val", ":=", "Float64Option", "{", "}", "\n", "val", ".", "Set", "(", "value", ")", "\n", "*", "o", "=", "append", "(", "*", "o", ",", "val", ")",...
5,312
all-5313
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "UnbindParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering", "(", "&", "w", ",", "v", ")", "...
5,313
all-5314
[ "TODO", ":", "SetHeaderFunc", "TODO", ":", "SetSortFunc", "DragHighlightRow", "is", "a", "wrapper", "around", "gtk_list_box_drag_highlight_row", "()" ]
[ "func", "(", "v", "*", "ListBox", ")", "DragHighlightRow", "(", "<mask>", "*", "ListBoxRow", ")", "{", "C", ".", "gtk_list_box_drag_highlight_row", "(", "v", ".", "native", "(", ")", ",", "row", ".", "native", "(", ")", ")", "\n", "}" ]
5,314
all-5315
[ "PackStart", "()", "is", "a", "wrapper", "around", "gtk_box_pack_start", "()", "." ]
[ "func", "(", "v", "*", "Box", ")", "PackStart", "(", "child", "IWidget", ",", "expand", ",", "fill", "bool", ",", "padding", "uint", ")", "{", "C", ".", "gtk_box_pack_start", "(", "v", ".", "native", "(", ")", ",", "child", ".", "toWidget", "(", ")...
5,315
all-5316
[ "Run", "will", "upload", "files", "to", "GCS", "as", "prescribed", "by", "the", "options", ".", "Any", "extra", "files", "can", "be", "passed", "as", "a", "parameter", "and", "will", "have", "the", "prefix", "prepended", "to", "their", "destination", "in",...
[ "func", "(", "o", "Options", ")", "Run", "(", "spec", "*", "downwardapi", ".", "JobSpec", ",", "extra", "map", "[", "string", "]", "gcs", ".", "UploadFunc", ")", "error", "{", "uploadTargets", ":=", "o", ".", "assembleTargets", "(", "spec", ",", "extra...
5,316
all-5317
[ "PostJSON", "posts", "JSON", "application", "/", "json", "encoded", "request", "body", "c", ".", "PostJSON", "(", "c", ".", "Endpoint", "(", "users", ")", "map", "[", "string", "]", "string", "{", "name", ":", "alice" ]
[ "func", "(", "c", "*", "Client", ")", "PostJSON", "(", "ctx", "context", ".", "Context", ",", "endpoint", "string", ",", "data", "interface", "{", "}", ")", "(", "*", "Response", ",", "error", ")", "{", "// If the sanitizer is enabled, make sure the requested ...
5,317
all-5318
[ "Debugf", "logs", "a", "formatted", "line", "with", "a", "DEBUG", "prefix", "." ]
[ "func", "(", "l", "*", "logger", ")", "Debugf", "(", "format", "string", ",", "vals", "...", "interface", "{", "}", ")", "{", "l", ".", "mut", ".", "Lock", "(", ")", "\n", "defer", "l", ".", "mut", ".", "Unlock", "(", ")", "\n", "s", ":=", "f...
5,318
all-5319
[ "WriteString", "writes", "a", "string", "to", "the", "buffer" ]
[ "func", "(", "w", "*", "WriteBuffer", ")", "WriteString", "(", "s", "string", ")", "{", "// NB(mmihic): Don't just call WriteBytes; that will make a double copy", "// of the string due to the cast", "if", "b", ":=", "w", ".", "reserve", "(", "len", "(", "s", ")", ")...
5,319
all-5320
[ "NewScreenFramebufferImage", "creates", "a", "special", "image", "that", "framebuffer", "is", "one", "for", "the", "screen", ".", "The", "returned", "image", "is", "cleared", ".", "Note", "that", "Dispose", "is", "not", "called", "automatically", "." ]
[ "func", "NewScreenFramebufferImage", "(", "width", ",", "height", "int", ")", "*", "Image", "{", "i", ":=", "&", "Image", "{", "image", ":", "graphicscommand", ".", "NewScreenFramebufferImage", "(", "<mask>", ",", "height", ")", ",", "screen", ":", "true", ...
5,320
all-5321
[ "Wait", "until", "all", "of", "the", "throttled", "goroutines", "have", "signaled", "they", "are", "done", "." ]
[ "func", "(", "w", "*", "WaitGroup", ")", "Wait", "(", ")", "{", "if", "w", ".", "outstanding", "==", "0", "{", "return", "\n", "}", "\n", "for", "w", ".", "outstanding", ">", "0", "{", "select", "{", "<mask>", "<-", "w", ".", "completed", ":", ...
5,321
all-5322
[ "Finds", "a", "rotated", "rectangle", "of", "the", "minimum", "area", "enclosing", "the", "input", "2D", "point", "set", "points", "can", "be", "either", "CvSeq", "*", "or", "CvMat", "*" ]
[ "func", "MinAreaRect", "(", "points", "unsafe", ".", "Pointer", ")", "Box2D", "{", "box", ":=", "C", ".", "cvMinAreaRect2", "(", "points", ",", "nil", ")", "\n", "center", ":=", "Point2D32f", "{", "float32", "(", "box", ".", "center", ".", "x", ")", ...
5,322
all-5323
[ "DeleteMapping", "removes", "the", "port", "mapping", "to", "NAT", "-", "PMP", "interface", "." ]
[ "func", "(", "n", "*", "npmp", ")", "DeleteMapping", "(", "protocol", "string", ",", "extPort", ",", "intPort", "int", ")", "(", "<mask>", "error", ")", "{", "_", ",", "err", "=", "n", ".", "c", ".", "AddPortMapping", "(", "strings", ".", "ToLower", ...
5,323
all-5324
[ "flattenVirtualMachineResourceAllocation", "reads", "various", "fields", "from", "a", "ResourceAllocationInfo", "and", "sets", "appropriate", "keys", "in", "the", "supplied", "ResourceData", "." ]
[ "func", "flattenVirtualMachineResourceAllocation", "(", "d", "*", "schema", ".", "ResourceData", ",", "obj", "*", "types", ".", "ResourceAllocationInfo", ",", "key", "string", ")", "error", "{", "shareLevelKey", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",...
5,324
all-5325
[ "DecodeJsonPayload", "reads", "the", "request", "body", "and", "decodes", "the", "JSON", "using", "json", ".", "Unmarshal", "." ]
[ "func", "(", "r", "*", "<mask>", ")", "DecodeJsonPayload", "(", "v", "interface", "{", "}", ")", "error", "{", "content", ",", "err", ":=", "ioutil", ".", "ReadAll", "(", "r", ".", "Body", ")", "\n", "r", ".", "Body", ".", "Close", "(", ")", "\n"...
5,325
all-5326
[ "DeleteOperation", "deletes", "(", "cancels", ")", "a", "running", "operation" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "DeleteOperation", "(", "uuid", "string", ")", "error", "{", "// Send the request", "_", ",", "_", ",", "err", ":=", "r", ".", "query", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "<...
5,326
all-5327
[ "handleCallRes", "handles", "an", "incoming", "call", "req", "message", "forwarding", "the", "frame", "to", "the", "response", "channel", "waiting", "for", "it" ]
[ "func", "(", "c", "*", "<mask>", ")", "handleCallRes", "(", "frame", "*", "Frame", ")", "bool", "{", "if", "err", ":=", "c", ".", "outbound", ".", "forwardPeerFrame", "(", "frame", ")", ";", "err", "!=", "nil", "{", "return", "true", "\n", "}", "\n...
5,327
all-5328
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "AddBindingParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime52", "(", "&", ...
5,328
all-5329
[ "GetAPIToken", "returns", "the", "APIToken", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "i", "*", "IntegrationPDRequest", ")", "GetAPIToken", "(", ")", "<mask>", "{", "if", "i", "==", "nil", "||", "i", ".", "APIToken", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "i", ".", "APIToken", "\n", "}" ...
5,329
all-5330
[ "LoadImage", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockLoader", ")", "LoadImage", "(", "arg0", "context", ".", "Context", ",", "arg1", "*", "config", ".", "Config", ",", "arg2", "dockerapi", ".", "DockerClient", ")", "(", "*", "<mask>", ".", "ImageInspect", ",", "error", ")", "{...
5,330
all-5331
[ "Sends", "an", "S3", "multipart", "upload", "initiation", "request", ".", "See", "http", ":", "//", "docs", ".", "amazonwebservices", ".", "com", "/", "AmazonS3", "/", "latest", "/", "dev", "/", "mpuoverview", ".", "html", ".", "The", "initial", "request",...
[ "func", "newPutter", "(", "url", "url", ".", "URL", ",", "h", "http", ".", "Header", ",", "c", "*", "Config", ",", "b", "*", "Bucket", ")", "(", "p", "*", "putter", ",", "err", "error", ")", "{", "p", "=", "new", "(", "putter", ")", "\n", "p"...
5,331
all-5332
[ "appendChildren", "parses", "the", "lines", "and", "appends", "the", "children", "to", "the", "element", "." ]
[ "func", "appendChildren", "(", "parent", "element", ",", "rslt", "*", "result", ",", "lines", "[", "]", "string", ",", "i", "*", "int", ",", "l", "int", ",", "src", "*", "source", ",", "opts", "*", "Options", ",", "f", "*", "File", ")", "error", ...
5,332
all-5333
[ "IsValidNetworkDevice", "is", "used", "to", "differentiate", "virtual", "and", "physical", "devices", "Returns", "true", "only", "for", "pci", "or", "vif", "interfaces" ]
[ "func", "IsValidNetworkDevice", "(", "devicePath", "string", ")", "bool", "{", "/*\n\t* DevicePath Samples:\n\t* eth1 -> /devices/pci0000:00/0000:00:05.0/net/eth1\n\t* eth0 -> ../../devices/pci0000:00/0000:00:03.0/net/eth0\n\t* lo -> ../../devices/virtual/net/lo\n\t */", "splitDevLink", ":=", ...
5,333
all-5334
[ "newImage", "returns", "a", "new", "Image", "interface", "type", "after", "setting", "up", "a", "client", "to", "the", "registry", "hosting", "the", "given", "image", ".", "The", "caller", "must", "call", ".", "Close", "()", "on", "the", "returned", "Image...
[ "func", "newImage", "(", "ctx", "context", ".", "Context", ",", "sys", "*", "<mask>", ".", "SystemContext", ",", "ref", "dockerReference", ")", "(", "types", ".", "ImageCloser", ",", "error", ")", "{", "s", ",", "err", ":=", "newImageSource", "(", "ctx",...
5,334
all-5335
[ "loop", "accepts", "varying", "parameters", "and", "differs", "its", "behavior", ".", "If", "given", "one", "parameter", "loop", "will", "return", "a", "goroutine", "that", "begins", "at", "0", "and", "loops", "until", "the", "given", "int", "increasing", "t...
[ "func", "<mask>", "(", "ints", "...", "int64", ")", "(", "<-", "chan", "int64", ",", "error", ")", "{", "var", "start", ",", "stop", "int64", "\n", "switch", "len", "(", "ints", ")", "{", "case", "1", ":", "start", ",", "stop", "=", "0", ",", "...
5,335
all-5336
[ "GetRelatedIdOk", "returns", "a", "tuple", "with", "the", "RelatedId", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "Comment", ")", "GetRelatedIdOk", "(", ")", "(", "int", ",", "bool", ")", "{", "if", "c", "==", "nil", "||", "c", ".", "RelatedId", "==", "nil", "{", "return", "0", ",", "false", "\n", "}", "\n", "return", "*", "c", ".", ...
5,336
all-5337
[ "migratedBlockingPresubmits", "determines", "blocking", "presubmits", "that", "have", "had", "their", "status", "contexts", "migrated", ".", "This", "is", "a", "best", "-", "effort", "evaluation", "as", "we", "can", "only", "track", "a", "presubmit", "between", ...
[ "func", "migratedBlockingPresubmits", "(", "old", ",", "new", "map", "[", "string", "]", "[", "]", "config", ".", "Presubmit", ")", "<mask>", "[", "string", "]", "[", "]", "presubmitMigration", "{", "migrated", ":=", "map", "[", "string", "]", "[", "]", ...
5,337
all-5338
[ "LoadData", "parses", "a", "build", "file", "from", "a", "byte", "slice", "and", "scans", "it", "for", "rules", "and", "load", "statements", ".", "The", "syntax", "tree", "within", "the", "returned", "File", "will", "be", "modified", "by", "editing", "meth...
[ "func", "LoadData", "(", "<mask>", ",", "pkg", "string", ",", "data", "[", "]", "byte", ")", "(", "*", "File", ",", "error", ")", "{", "ast", ",", "err", ":=", "bzl", ".", "ParseBuild", "(", "path", ",", "data", ")", "\n", "if", "err", "!=", "n...
5,338
all-5339
[ "MiddlewareFunc", "makes", "AccessLogApacheMiddleware", "implement", "the", "Middleware", "interface", "." ]
[ "func", "(", "mw", "*", "AccessLogApacheMiddleware", ")", "MiddlewareFunc", "(", "h", "HandlerFunc", ")", "HandlerFunc", "{", "// set the default Logger", "if", "mw", ".", "Logger", "==", "nil", "{", "mw", ".", "Logger", "=", "log", ".", "New", "(", "os", ...
5,339
all-5340
[ "GetLabels", "gets", "the", "labels", "for", "a", "container" ]
[ "func", "(", "c", "*", "Container", ")", "GetLabels", "(", ")", "map", "[", "string", "]", "string", "{", "c", ".", "lock", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "<mask>", ".", "RUnlock", "(", ")", "\n\n", "return", "c", ".", "labels",...
5,340
all-5341
[ "Stroke", "strokes", "the", "paths", "with", "the", "color", "specified", "by", "SetStrokeColor" ]
[ "func", "(", "gc", "*", "GraphicContext", ")", "Stroke", "(", "paths", "...", "*", "draw2d", ".", "Path", ")", "{", "paths", "=", "append", "(", "paths", ",", "gc", ".", "Current", ".", "Path", ")", "\n", "gc", ".", "strokeRasterizer", ".", "UseNonZe...
5,341
all-5342
[ "String", "returns", "an", "amount", "string", "from", "the", "provided", "raw", "value", "v", "." ]
[ "func", "<mask>", "(", "v", "xdr", ".", "Int64", ")", "string", "{", "var", "f", ",", "o", ",", "r", "big", ".", "Rat", "\n\n", "f", ".", "SetInt64", "(", "int64", "(", "v", ")", ")", "\n", "o", ".", "SetInt64", "(", "One", ")", "\n", "r", ...
5,342
all-5343
[ "GetBranch", "returns", "the", "branch", "config", "after", "merging", "in", "any", "repo", "policies", "." ]
[ "func", "(", "r", "Repo", ")", "GetBranch", "(", "name", "string", ")", "(", "*", "Branch", ",", "error", ")", "{", "b", ",", "ok", ":=", "r", ".", "Branches", "[", "name", "]", "\n", "if", "ok", "{", "b", ".", "Policy", "=", "r", ".", "Apply...
5,343
all-5344
[ "title", ":", "add", "install", "host", "path", ":", "/", "install", "/", "hosts", "method", ":", "POST", "consume", ":", "application", "/", "x", "-", "www", "-", "form", "-", "urlencoded", "produce", ":", "application", "/", "json", "responses", ":", ...
[ "func", "installHostAdd", "(", "w", "<mask>", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "(", "err", "error", ")", "{", "allowed", ":=", "permission", ".", "Check", "(", "t", ",", "permission", ...
5,344
all-5345
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetInstallabilityErrorsParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage39", "(", "&", "w", ",", "...
5,345
all-5346
[ "ListServiceInfo", "-", "returns", "services", "and", "their", "cooresponding", "plans" ]
[ "func", "(", "m", "*", "Manager", ")", "ListServiceInfo", "(", ")", "(", "*", "ServiceInfo", ",", "error", ")", "{", "serviceInfo", ":=", "&", "ServiceInfo", "{", "}", "\n", "services", ",", "err", ":=", "m", ".", "Client", ".", "ListServices", "(", ...
5,346
all-5347
[ "it", "s", "unfriendly", "to", "change", "RetryStrategy", "()", ".", "logtag" ]
[ "func", "(", "l", "*", "logger", ")", "ChangeRetryStrategyLogTag", "(", "retryStrategy", "*", "boshretry", ".", "RetryStrategy", ")", "error", "{", "defer", "func", "(", ")", "{", "if", "err", ":=", "recover", "(", ")", ";", "<mask>", "!=", "nil", "{", ...
5,347
all-5348
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "RemoveBreakpointParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger27", "(", "&", "w", ",", "v...
5,348
all-5349
[ "Body", "returns", "the", "<body", ">", "content", "for", "a", "build", "log", "(", "or", "multiple", "build", "logs", ")" ]
[ "func", "(", "lens", "Lens", ")", "Body", "(", "artifacts", "[", "]", "lenses", ".", "Artifact", ",", "resourceDir", "string", ",", "data", "string", ")", "string", "{", "buildLogsView", ":=", "BuildLogsView", "{", "LogViews", ":", "[", "]", "LogArtifactVi...
5,349
all-5350
[ "Errorf", "records", "the", "log", "with", "error", "level" ]
[ "func", "Errorf", "(", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "logger", ".", "Output", "(", "2", ",", "LevelError", ",", "fmt", ".", "Sprintf", "(", "<mask>", ",", "args", "...", ")", ")", "\n", "}" ]
5,350
all-5351
[ "GetDashboardCount", "returns", "the", "DashboardCount", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "d", "*", "DashboardList", ")", "GetDashboardCount", "(", ")", "int", "{", "if", "d", "==", "nil", "||", "d", ".", "DashboardCount", "==", "nil", "{", "<mask>", "0", "\n", "}", "\n", "return", "*", "d", ".", "DashboardCount", "\n", "}" ]
5,351
all-5352
[ "ListProjects", "returns", "the", "list", "of", "projects", "the", "user", "is", "watching" ]
[ "func", "(", "c", "*", "Client", ")", "ListProjects", "(", ")", "(", "[", "]", "*", "Project", ",", "error", ")", "{", "projects", ":=", "[", "]", "*", "<mask>", "{", "}", "\n\n", "err", ":=", "c", ".", "request", "(", "\"", "\"", ",", "\"", ...
5,352
all-5353
[ "Create", "a", "token", "bucket", "that", "fills", "at", "the", "given", "rate", "in", "tokens", "per", "second", "up", "to", "the", "given", "capacity", ".", "ChooseTokenBucketCapacity", "may", "help", "you", "decide", "on", "a", "capacity", ".", "The", "...
[ "func", "NewTokenBucket", "(", "rateHz", "float64", ",", "capacity", "uint64", ")", "(", "tb", "TokenBucket", ")", "{", "tb", "=", "&", "tokenBucket", "{", "rateHz", ":", "rateHz", ",", "capacity", ":", "capacity", ",", "creditTime", ":", "0", ",", "cred...
5,353
all-5354
[ "Value", "converts", "a", "value", "to", "a", "database", "driver", "value" ]
[ "func", "(", "u", "UUID3", ")", "Value", "(", ")", "(", "driver", ".", "Value", ",", "error", ")", "{", "return", "driver", ".", "<mask>", "(", "string", "(", "u", ")", ")", ",", "nil", "\n", "}" ]
5,354
all-5355
[ "NewSMTPSender", "builds", "a", "SMTP", "mail", "based", "in", "passed", "config", "." ]
[ "func", "NewSMTPSender", "(", "host", "string", ",", "port", "string", ",", "<mask>", "string", ",", "password", "string", ")", "(", "SMTPSender", ",", "error", ")", "{", "iport", ",", "err", ":=", "strconv", ".", "Atoi", "(", "port", ")", "\n\n", "if"...
5,355
all-5356
[ "New", "constructs", "a", "new", "Secure", "instance", "with", "supplied", "options", "." ]
[ "func", "New", "(", "options", "...", "Options", ")", "*", "JWTMiddleware", "{", "var", "opts", "Options", "\n", "if", "len", "(", "options", ")", "==", "0", "{", "opts", "=", "Options", "{", "}", "\n", "}", "else", "{", "opts", "=", "<mask>", "[",...
5,356
all-5357
[ "Percentiles", "returns", "percentile", "distribution", "of", "float64", "slice", "." ]
[ "func", "Percentiles", "(", "nums", "[", "]", "float64", ")", "(", "pcs", "[", "]", "float64", ",", "<mask>", "[", "]", "float64", ")", "{", "return", "pctls", ",", "percentiles", "(", "nums", ")", "\n", "}" ]
5,357
all-5358
[ "Delete", "the", "policy", "from", "cache", "/", "disk", "." ]
[ "func", "AADeleteProfile", "(", "c", "container", ")", "{", "state", ":=", "c", ".", "DaemonState", "(", ")", "\n", "if", "!", "state", ".", "OS", ".", "AppArmorAdmin", "{", "return", "\n", "}", "\n\n", "/* It's ok if these deletes fail: if the container was nev...
5,358
all-5359
[ "Create", "creates", "any", "isolation", "segments", "that", "do", "not", "yet", "exist" ]
[ "func", "(", "u", "*", "Updater", ")", "Create", "(", ")", "error", "{", "desired", ",", "err", ":=", "u", ".", "allDesiredSegments", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "current", ",", "err", ":=", "u...
5,359
all-5360
[ "Set", "attempts", "to", "set", "the", "plugins", "that", "are", "enabled", "on", "repos", ".", "Plugins", "are", "listed", "as", "a", "map", "from", "repositories", "to", "the", "list", "of", "plugins", "that", "are", "enabled", "on", "them", ".", "Spec...
[ "func", "(", "<mask>", "*", "ConfigAgent", ")", "Set", "(", "pc", "*", "Configuration", ")", "{", "pa", ".", "mut", ".", "Lock", "(", ")", "\n", "defer", "pa", ".", "mut", ".", "Unlock", "(", ")", "\n", "pa", ".", "configuration", "=", "pc", "\n"...
5,360
all-5361
[ "ListAttachedCdroms", "returns", "list", "of", "attached", "cd", "roms" ]
[ "func", "(", "c", "*", "<mask>", ")", "ListAttachedCdroms", "(", "dcid", ",", "srvid", "string", ")", "(", "*", "Images", ",", "error", ")", "{", "url", ":=", "serverCdromColPath", "(", "dcid", ",", "srvid", ")", "+", "`?depth=`", "+", "c", ".", "cli...
5,361
all-5362
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "StartTypeProfileParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoProfiler10", "(", "&", "w", ",", "v",...
5,362
all-5363
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventWindowOpen", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage50", "(", "&", "r",...
5,363
all-5364
[ "JulianDayToTime", "returns", "the", "correcponding", "UTC", "date", "for", "a", "Julian", "Day", "Number", ".", "The", "algorithm", "is", "taken", "from", "https", ":", "//", "en", ".", "wikipedia", ".", "org", "/", "wiki", "/", "Julian_day", "." ]
[ "func", "julianDayToTime", "(", "jd", "int", ")", "time", ".", "Time", "{", "<mask>", "f", "int", "\n\n", "if", "jd", "<", "gregorianDay", "{", "f", "=", "jd", "+", "1401", "\n", "}", "else", "{", "f", "=", "jd", "+", "1401", "+", "(", "(", "("...
5,364
all-5365
[ "NewPaymentResult", "creates", "a", "new", "PaymentResult", "." ]
[ "func", "NewPaymentResult", "(", "code", "PaymentResultCode", ",", "value", "interface", "{", "}", ")", "(", "result", "PaymentResult", ",", "err", "error", ")", "{", "result", ".", "Code", "=", "code", "\n", "switch", "PaymentResultCode", "(", "code", ")", ...
5,365
all-5366
[ "Get", "looks", "up", "the", "caching", "response", "for", "a", "given", "request", ".", "Get", "is", "also", "responsible", "for", "lazy", "eviction", "when", "accessing", "compacted", "entries", "." ]
[ "func", "(", "c", "*", "cache", ")", "Get", "(", "req", "*", "pb", ".", "RangeRequest", ")", "(", "*", "<mask>", ".", "RangeResponse", ",", "error", ")", "{", "key", ":=", "keyFunc", "(", "req", ")", "\n\n", "c", ".", "mu", ".", "Lock", "(", ")...
5,366
all-5367
[ "GetParent", "is", "a", "wrapper", "around", "gtk_widget_get_parent", "()", "." ]
[ "func", "(", "v", "*", "Widget", ")", "GetParent", "(", ")", "(", "*", "Widget", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_widget_get_parent", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", "...
5,367
all-5368
[ "streamClientInterceptor", "returns", "a", "new", "retrying", "stream", "client", "interceptor", "for", "server", "side", "streaming", "calls", ".", "The", "default", "configuration", "of", "the", "interceptor", "is", "to", "not", "retry", "*", "at", "all", "*",...
[ "func", "(", "c", "*", "Client", ")", "streamClientInterceptor", "(", "logger", "*", "zap", ".", "Logger", ",", "optFuncs", "...", "retryOption", ")", "grpc", ".", "StreamClientInterceptor", "{", "intOpts", ":=", "reuseOrNewWithCallOptions", "(", "defaultOptions",...
5,368
all-5369
[ "GetLineType", "returns", "the", "LineType", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "t", "*", "TimeseriesRequestStyle", ")", "GetLineType", "(", ")", "<mask>", "{", "if", "t", "==", "nil", "||", "t", ".", "LineType", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "t", ".", "LineType", "\n", "}...
5,369
all-5370
[ "GetContainerState", "returns", "a", "ContainerState", "entry", "for", "the", "provided", "container", "name" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "GetContainerState", "(", "name", "string", ")", "(", "*", "api", ".", "ContainerState", ",", "string", ",", "error", ")", "{", "state", ":=", "api", ".", "ContainerState", "{", "}", "\n\n", "// Fetch the raw valu...
5,370
all-5371
[ "After", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockTime", ")", "After", "(", "arg0", "time", ".", "Duration", ")", "<-", "chan", "<mask>", ".", "Time", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", ...
5,371
all-5372
[ "Returns", "all", "storage", "volumes", "attached", "to", "a", "given", "storage", "pool", "on", "the", "given", "node", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "storagePoolVolumesGet", "(", "project", "string", ",", "poolID", ",", "nodeID", "int64", ",", "volumeTypes", "[", "]", "int", ")", "(", "[", "]", "*", "api", ".", "StorageVolume", ",", "error", ")", "{", "// Get ...
5,372
all-5373
[ "/", "*", "NewListBox", "creates", "a", "new", "frame", ".", "view", "-", "is", "a", "View", "that", "manages", "the", "control", "parent", "-", "is", "container", "that", "keeps", "the", "control", ".", "The", "same", "View", "can", "be", "a", "view",...
[ "func", "CreateListBox", "(", "parent", "Control", ",", "width", ",", "height", "int", ",", "scale", "int", ")", "*", "ListBox", "{", "l", ":=", "new", "(", "ListBox", ")", "\n", "l", ".", "BaseControl", "=", "NewBaseControl", "(", ")", "\n\n", "if", ...
5,373
all-5374
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventDistributedNodesUpdated", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom62", "(", ...
5,374
all-5375
[ "NetworkAdapters", "lists", "current", "network", "adapters", "attached", "to", "the", "virtual", "machine", "." ]
[ "func", "(", "v", "*", "VM", ")", "NetworkAdapters", "(", ")", "(", "[", "]", "*", "NetworkAdapter", ",", "error", ")", "{", "vmxPath", ",", "err", ":=", "v", ".", "VmxPath", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", ...
5,375
all-5376
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "User", ")", "Locator", "(", "api", "*", "API", ")", "*", "UserLocator", "{", "for", "_", ",", "l", ":=", "<mask>", "r", ".", "Links", "{", "if", "l", "[", "\"", "\"", "]", "==", "\"", "\"", "{", "return", "api", ".", ...
5,376
all-5377
[ "/", "*", "func", "marshalLayout", "(", "p", "uintptr", ")", "(", "interface", "{}", "error", ")", "{", "c", ":", "=", "C", ".", "g_value_get_object", "((", "*", "C", ".", "GValue", ")", "(", "unsafe", ".", "Pointer", "(", "p", ")))", "obj", ":", ...
[ "func", "LayoutNew", "(", "<mask>", "*", "Context", ")", "*", "Layout", "{", "c", ":=", "C", ".", "pango_layout_new", "(", "context", ".", "native", "(", ")", ")", "\n\n", "layout", ":=", "new", "(", "Layout", ")", "\n", "layout", ".", "pangoLayout", ...
5,377
all-5378
[ "CollectionNames", "returns", "the", "collection", "names", "present", "in", "the", "db", "database", "." ]
[ "func", "(", "db", "*", "Database", ")", "CollectionNames", "(", ")", "(", "names", "[", "]", "string", ",", "err", "error", ")", "{", "// Clone session and set it to Monotonic mode so that the server", "// used for the query may be safely obtained afterwards, if", "// nece...
5,378
all-5379
[ "NewPB", "returns", "an", "HTTP", "client", "using", "only", "the", "parameter", "block", "and", "ignoring", "the", "current", "values", "of", "the", "package", "variables", "which", "are", "not", "go", "-", "routine", "safe", "." ]
[ "func", "NewPB", "(", "pb", "*", "ParamBlock", ")", "HTTPClient", "{", "responseHeaderTimeout", ":=", "pb", ".", "ResponseHeaderTimeout", "\n", "if", "responseHeaderTimeout", "==", "0", "{", "responseHeaderTimeout", "=", "defaultResponseHeaderTimeout", "\n", "}", "\...
5,379
all-5380
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EvaluateOnCallFrameParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger43", "(", "&", "w", ",", "...
5,380
all-5381
[ "Stat", "sends", "kafka", "receiver", "s", "internal", "stats", "to", "specified", "callback" ]
[ "func", "(", "rcv", "*", "Kafka", ")", "Stat", "(", "send", "helper", ".", "StatCallback", ")", "{", "metricsReceived", ":=", "atomic", ".", "LoadUint64", "(", "&", "rcv", ".", "metricsReceived", ")", "\n", "send", "(", "\"", "\"", ",", "float64", "(",...
5,381
all-5382
[ "NewVirtualMachine", "creates", "a", "new", "VM", "instance", "." ]
[ "func", "NewVirtualMachine", "(", "handle", "C", ".", "VixHandle", ",", "vmxpath", "string", ")", "(", "*", "VM", ",", "error", ")", "{", "vmxfile", ":=", "&", "VMXFile", "{", "path", ":", "vmxpath", ",", "}", "\n\n", "// Loads VMX file in memory", "err", ...
5,382
all-5383
[ "NewHandler", "returns", "a", "new", "cached", "handler" ]
[ "func", "NewHandler", "(", "bodyHandler", "http", ".", "<mask>", ",", "expireDuration", "time", ".", "Duration", ")", "*", "Handler", "{", "e", ":=", "entry", ".", "NewEntry", "(", "expireDuration", ")", "\n\n", "return", "&", "Handler", "{", "bodyHandler", ...
5,383
all-5384
[ "Extract", "name", "(", "leaf", ")", "from", "path" ]
[ "func", "nativeNameFromPath", "(", "path", "string", ")", "string", "{", "native", ":=", "path", "\n", "matches", ":=", "childPathRegexp", ".", "FindStringSubmatch", "(", "<mask>", ")", "\n", "if", "matches", "!=", "nil", "{", "native", "=", "matches", "[", ...
5,384
all-5385
[ "CreateOrUpdateJob", "takes", "a", "job", "detail", "structure", "which", "has", "its", "ID", "set", "and", "either", "updates", "an", "existing", "job", "with", "the", "same", "id", "or", "creates", "a", "new", "job", "with", "that", "id", "." ]
[ "func", "(", "c", "*", "Client", ")", "CreateOrUpdateJob", "(", "job", "*", "JobDetail", ")", "(", "*", "JobSummary", ",", "error", ")", "{", "return", "c", ".", "importJob", "(", "<mask>", ",", "\"", "\"", ")", "\n", "}" ]
5,385
all-5386
[ "FollowProject", "follows", "a", "project" ]
[ "func", "(", "c", "*", "Client", ")", "FollowProject", "(", "account", ",", "repo", "string", ")", "(", "*", "Project", ",", "error", ")", "{", "project", ":=", "&", "Project", "{", "}", "\n\n", "err", ":=", "c", ".", "request", "(", "\"", "\"", ...
5,386
all-5387
[ "NewImageSource", "returns", "a", "types", ".", "ImageSource", "for", "this", "reference", ".", "The", "caller", "must", "call", ".", "Close", "()", "on", "the", "returned", "ImageSource", "." ]
[ "func", "(", "ref", "dirReference", ")", "NewImageSource", "(", "ctx", "context", ".", "Context", ",", "sys", "*", "types", ".", "SystemContext", ")", "(", "types", ".", "ImageSource", ",", "error", ")", "{", "return", "newImageSource", "(", "<mask>", ")",...
5,387
all-5388
[ "HasSearchBy", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "WidgetProcessQuery", ")", "HasSearchBy", "(", ")", "bool", "{", "if", "w", "!=", "nil", "&&", "w", ".", "SearchBy", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
5,388
all-5389
[ "EntryBufferNew", "()", "is", "a", "wrapper", "around", "gtk_entry_buffer_new", "()", "." ]
[ "func", "EntryBufferNew", "(", "initialChars", "string", ",", "nInitialChars", "int", ")", "(", "*", "EntryBuffer", ",", "error", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "initialChars", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", "."...
5,389
all-5390
[ "NewWatcher", "creates", "and", "returns", "a", "new", "watcher", "." ]
[ "func", "NewWatcher", "(", ")", "*", "Watcher", "{", "// prepare watcher", "w", ":=", "&", "Watcher", "{", "streams", ":", "make", "(", "map", "[", "string", "]", "*", "Stream", ")", ",", "}", "\n\n", "// create and add manager", "w", ".", "<mask>", "=",...
5,390
all-5391
[ "UserToDeviceDistance", "is", "a", "wrapper", "around", "cairo_user_to_device_distance", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "UserToDeviceDistance", "(", "dx", ",", "dy", "float64", ")", "(", "float64", ",", "float64", ")", "{", "C", ".", "cairo_user_to_device_distance", "(", "v", ".", "native", "(", ")", ",", "(", "*", "C", ".", "doub...
5,391
all-5392
[ "Destroy", "should", "be", "called", "when", "the", "user", "of", "the", "context", "is", "done", "with", "it", "." ]
[ "func", "(", "<mask>", "*", "PolicyContext", ")", "Destroy", "(", ")", "error", "{", "if", "err", ":=", "pc", ".", "changeState", "(", "pcReady", ",", "pcDestroying", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "// FIXME: destr...
5,392
all-5393
[ "GetDefinition", "returns", "the", "Definition", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "g", "*", "<mask>", ")", "GetDefinition", "(", ")", "GraphDefinition", "{", "if", "g", "==", "nil", "||", "g", ".", "Definition", "==", "nil", "{", "return", "GraphDefinition", "{", "}", "\n", "}", "\n", "return", "*", "g", ".", "Definit...
5,393
all-5394
[ "WithDomain", "cookie", "domain", "." ]
[ "func", "(", "p", "SetCookieParams", ")", "WithDomain", "(", "domain", "string", ")", "*", "SetCookieParams", "{", "p", ".", "<mask>", "=", "domain", "\n", "return", "&", "p", "\n", "}" ]
5,394
all-5395
[ "LogStatus", "outputs", "current", "status", "of", "all", "resources" ]
[ "func", "(", "r", "*", "Ranch", ")", "LogStatus", "(", ")", "{", "resources", ",", "err", ":=", "r", ".", "Storage", ".", "GetResources", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n\n", "resJSON", ",", "err", ":=", "...
5,395
all-5396
[ "expectedManifestDigest", "returns", "a", "the", "expected", "value", "of", "the", "manifest", "digest", "and", "an", "indicator", "whether", "it", "is", "known", ".", "The", "bool", "return", "value", "seems", "redundant", "with", "digest", "!", "=", ";", "...
[ "func", "(", "i", "*", "UnparsedImage", ")", "expectedManifestDigest", "(", ")", "(", "digest", ".", "Digest", ",", "bool", ")", "{", "if", "i", ".", "instanceDigest", "!=", "nil", "{", "return", "*", "i", ".", "instanceDigest", ",", "true", "\n", "}",...
5,396
all-5397
[ "API", "endpoints" ]
[ "func", "networksGet", "(", "d", "*", "Daemon", ",", "r", "*", "http", ".", "Request", ")", "Response", "{", "recursion", ":=", "util", ".", "IsRecursionRequest", "(", "r", ")", "\n\n", "ifs", ",", "err", ":=", "networkGetInterfaces", "(", "d", ".", "c...
5,397
all-5398
[ "Must", "is", "a", "convenience", "method", "similar", "to", "template", ".", "Must" ]
[ "func", "Must", "(", "op", "Op", ",", "err", "error", ")", "Op", "{", "if", "err", "!=", "nil", "{", "panic", "(", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ".", "<mask>", "(", ")", ")", ")", "\n", "}", "\n\n", "return", "op", "\n", ...
5,398
all-5399
[ "Get", "retrieves", "a", "single", "element", "from", "the", "set", "by", "name", "." ]
[ "func", "(", "s", "*", "<mask>", ")", "Get", "(", "v", "string", ")", "Dependency", "{", "s", ".", "RLock", "(", ")", "\n", "defer", "s", ".", "RUnlock", "(", ")", "\n", "return", "s", ".", "set", "[", "v", "]", "\n", "}" ]
5,399
all-5400
[ "ReceiveComment", "calls", "plugin", ".", "ReceiveComment", "()", "if", "issues", "are", "not", "ignored" ]
[ "func", "(", "t", "*", "TypeFilterWrapperPlugin", ")", "ReceiveComment", "(", "comment", "sql", ".", "Comment", ")", "[", "]", "<mask>", "{", "if", "!", "t", ".", "pass", "[", "comment", ".", "IssueID", "]", "{", "return", "nil", "\n", "}", "\n", "re...