id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
4,300
all-4301
[ "rewriteUses", "replaces", "all", "uses", "of", "the", "identifier", "x", "and", "!x", "in", "scope", "with", "f", "(", "x", ".", "Pos", "()", ")", "and", "fnot", "(", "x", ".", "Pos", "()", ")", "." ]
[ "func", "rewriteUses", "(", "x", "*", "ast", ".", "Ident", ",", "f", ",", "fnot", "func", "(", "token", ".", "Pos", ")", "ast", ".", "Expr", ",", "scope", "[", "]", "ast", ".", "Stmt", ")", "{", "var", "lastF", "ast", ".", "Expr", "\n", "ff", ...
4,301
all-4302
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
[ "func", "(", "in", "*", "ProwJob", ")", "DeepCopyInto", "(", "out", "*", "ProwJob", ")", "{", "*", "out", "=", "*", "in", "\n", "out", ".", "TypeMeta", "=", "in", ".", "TypeMeta", "\n", "in", ".", "ObjectMeta", ".", "DeepCopyInto", "(", "&", "out",...
4,302
all-4303
[ "WaitFor", "will", "block", "until", "a", "message", "matching", "the", "given", "filter", "is", "received" ]
[ "func", "(", "<mask>", "*", "Bot", ")", "WaitFor", "(", "filter", "func", "(", "*", "Message", ")", "bool", ")", "{", "for", "mes", ":=", "range", "bot", ".", "Incoming", "{", "if", "filter", "(", "mes", ")", "{", "return", "\n", "}", "\n", "}", ...
4,303
all-4304
[ "Complex", "pushes", "a", "proxy", "to", "a", "Go", "complex", "on", "the", "stack", ".", "Arguments", ":", "real", "(", "number", ")", "imag", "(", "number", ")", "Returns", ":", "proxy", "(", "complex128", ")" ]
[ "func", "Complex", "(", "L", "*", "lua", ".", "State", ")", "int", "{", "v1", ",", "_", ":=", "luaToGoValue", "(", "L", ",", "1", ")", "\n", "v2", ",", "_", ":=", "luaToGoValue", "(", "L", ",", "2", ")", "\n", "result", ":=", "complex", "(", ...
4,304
all-4305
[ "Float64Var", "defines", "a", "float64", "flag", "with", "specified", "name", "default", "value", "and", "usage", "string", ".", "The", "argument", "p", "points", "to", "a", "float64", "variable", "in", "which", "to", "store", "the", "value", "of", "the", ...
[ "func", "Float64Var", "(", "p", "*", "float64", ",", "name", "string", ",", "<mask>", "float64", ",", "usage", "string", ")", "{", "EnvironmentFlags", ".", "Float64Var", "(", "p", ",", "name", ",", "value", ",", "usage", ")", "\n", "}" ]
4,305
all-4306
[ "Instructions", "for", "creating", "new", "types", ":", "If", "a", "type", "needs", "to", "satisfy", "an", "interface", "declare", "that", "function", "along", "with", "that", "interface", ".", "This", "will", "help", "users", "identify", "the", "list", "of"...
[ "func", "Parse", "(", "sql", "string", ")", "(", "Statement", ",", "error", ")", "{", "tokenizer", ":=", "NewStringTokenizer", "(", "sql", ")", "\n", "if", "yyParse", "(", "tokenizer", ")", "!=", "0", "{", "if", "tokenizer", ".", "partialDDL", "!=", "n...
4,306
all-4307
[ "Do", "executes", "Page", ".", "addScriptToEvaluateOnNewDocument", "against", "the", "provided", "context", ".", "returns", ":", "identifier", "-", "Identifier", "of", "the", "added", "script", "." ]
[ "func", "(", "p", "*", "AddScriptToEvaluateOnNewDocumentParams", ")", "Do", "(", "ctx", "context", ".", "Context", ")", "(", "identifier", "ScriptIdentifier", ",", "err", "error", ")", "{", "// execute", "var", "<mask>", "AddScriptToEvaluateOnNewDocumentReturns", "\...
4,307
all-4308
[ "Open", "returns", "a", "new", "DB", "object", "." ]
[ "func", "Open", "(", "opt", "Options", ")", "(", "db", "*", "DB", ",", "err", "error", ")", "{", "opt", ".", "maxBatchSize", "=", "(", "15", "*", "opt", ".", "MaxTableSize", ")", "/", "100", "\n", "opt", ".", "maxBatchCount", "=", "opt", ".", "ma...
4,308
all-4309
[ "Health", "returns", "true", "as", "default", "Health", "endpoint", "." ]
[ "func", "(", "h", "*", "metaHandler", ")", "Health", "(", "ctx", "Context", ",", "req", "*", "meta", ".", "HealthRequest", ")", "(", "*", "meta", ".", "HealthStatus", ",", "error", ")", "{", "ok", ",", "message", ":=", "h", ".", "healthFn", "(", "c...
4,309
all-4310
[ "SetWidthChars", "is", "a", "wrapper", "around", "gtk_label_set_width_chars", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "SetWidthChars", "(", "nChars", "int", ")", "{", "C", ".", "gtk_label_set_width_chars", "(", "v", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "nChars", ")", ")", "\n", "}" ]
4,310
all-4311
[ "LoadBalancer", "retrieves", "a", "detailed", "view", "of", "one", "load", "balancer" ]
[ "func", "(", "c", "*", "Client", ")", "LoadBalancer", "(", "identifier", "string", ")", "(", "*", "LoadBalancer", ",", "error", ")", "{", "lb", ":=", "<mask>", "(", "LoadBalancer", ")", "\n", "_", ",", "err", ":=", "c", ".", "MakeApiRequest", "(", "\...
4,311
all-4312
[ "MOIDs", "returns", "all", "MOIDs", "in", "a", "MOIDForUUIDResults", "." ]
[ "func", "(", "r", "MOIDForUUIDResults", ")", "MOIDs", "(", ")", "[", "]", "string", "{", "var", "moids", "[", "]", "string", "\n", "for", "_", ",", "result", ":=", "range", "r", "{", "moids", "=", "append", "(", "moids", ",", "<mask>", ".", "MOID",...
4,312
all-4313
[ "InitEmbeddedMode", "registers", "the", "message", "handler", "with", "the", "newrelic", "embedded", "message", "handler", ".", "and", "calls", "Init", ".", "NOTE", ":", "I", "haven", "t", "been", "able", "to", "get", "embedded", "mode", "to", "work", ".", ...
[ "func", "InitEmbeddedMode", "(", "license", "string", ",", "appName", "string", ")", "(", "int", ",", "error", ")", "{", "C", ".", "newrelic_register_message_handler", "(", "(", "*", "[", "0", "]", "byte", ")", "(", "C", ".", "newrelic_message_handler", ")...
4,313
all-4314
[ "NewCanceler", "returns", "a", "new", "Canceler", "struct" ]
[ "func", "NewCanceler", "(", ")", "*", "Canceler", "{", "c", ":=", "Canceler", "{", "}", "\n\n", "c", ".", "<mask>", ".", "Lock", "(", ")", "\n", "c", ".", "reqChCancel", "=", "make", "(", "map", "[", "*", "http", ".", "Request", "]", "chan", "str...
4,314
all-4315
[ "DeleteRef", "returns", "an", "error", "indicating", "if", "deletion", "of", "the", "given", "ref", "was", "successful" ]
[ "func", "(", "f", "*", "FakeClient", ")", "DeleteRef", "(", "owner", ",", "repo", ",", "<mask>", "string", ")", "error", "{", "f", ".", "RefsDeleted", "=", "append", "(", "f", ".", "RefsDeleted", ",", "struct", "{", "Org", ",", "Repo", ",", "Ref", ...
4,315
all-4316
[ "title", ":", "remove", "event", "block", "path", ":", "/", "events", "/", "blocks", "/", "{", "uuid", "}", "method", ":", "DELETE", "responses", ":", "200", ":", "OK", "400", ":", "Invalid", "uuid", "401", ":", "Unauthorized", "404", ":", "Active", ...
[ "func", "eventBlockRemove", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "(", "err", "error", ")", "{", "if", "!", "permission", ".", "Check", "(", "t", ",", "permission", ".", ...
4,316
all-4317
[ "expandSliceOfCustomizationAdapterMapping", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "CustomizationAdapterMapping", "slice", "." ]
[ "func", "expandSliceOfCustomizationAdapterMapping", "(", "d", "*", "schema", ".", "ResourceData", ")", "[", "]", "types", ".", "CustomizationAdapterMapping", "{", "s", ":=", "d", ".", "Get", "(", "cKeyPrefix", "+", "\"", "\"", "+", "\"", "\"", ")", ".", "(...
4,317
all-4318
[ "Do", "executes", "Cast", ".", "stopCasting", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "StopCastingParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandStopCasting", ",", "p", ",", "nil", ")", "\n", "}" ]
4,318
all-4319
[ "resourceVSphereDatastoreClusterVMAntiAffinityRuleObjects", "handles", "the", "fetching", "of", "the", "cluster", "and", "rule", "key", "depending", "on", "what", "attributes", "are", "available", ":", "*", "If", "the", "resource", "ID", "is", "available", "the", "d...
[ "func", "resourceVSphereDatastoreClusterVMAntiAffinityRuleObjects", "(", "d", "*", "schema", ".", "ResourceData", ",", "meta", "interface", "{", "}", ",", ")", "(", "*", "object", ".", "StoragePod", ",", "int32", ",", "error", ")", "{", "if", "d", ".", "<mas...
4,319
all-4320
[ "SetFromFixbuf", "is", "a", "wrapper", "around", "gtk_image_set_from_pixbuf", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "SetFromPixbuf", "(", "pixbuf", "*", "gdk", ".", "Pixbuf", ")", "{", "pbptr", ":=", "(", "*", "C", ".", "GdkPixbuf", ")", "(", "unsafe", ".", "Pointer", "(", "pixbuf", ".", "Native", "(", ")", ")", ")", "\n",...
4,320
all-4321
[ "PutEvent", "()", "is", "a", "wrapper", "around", "gdk_display_put_event", "()", "." ]
[ "func", "(", "v", "*", "Display", ")", "PutEvent", "(", "event", "*", "<mask>", ")", "{", "C", ".", "gdk_display_put_event", "(", "v", ".", "native", "(", ")", ",", "event", ".", "native", "(", ")", ")", "\n", "}" ]
4,321
all-4322
[ "Fail", "updates", "the", "FollowerStats", "with", "an", "unsuccessful", "send" ]
[ "func", "(", "fs", "*", "FollowerStats", ")", "Fail", "(", ")", "{", "fs", ".", "Lock", "(", ")", "\n", "defer", "fs", ".", "Unlock", "(", ")", "\n", "<mask>", ".", "Counts", ".", "Fail", "++", "\n", "}" ]
4,322
all-4323
[ "native", "returns", "a", "pointer", "to", "the", "underlying", "GObject", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "native", "(", ")", "*", "C", ".", "GObject", "{", "if", "v", "==", "nil", "||", "v", ".", "GObject", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "p", ":=", "unsafe", ".", "Pointer", "(", "v", "."...
4,323
all-4324
[ "GetInvisibleChar", "()", "is", "a", "wrapper", "around", "gtk_entry_get_invisible_char", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetInvisibleChar", "(", ")", "rune", "{", "c", ":=", "C", ".", "gtk_entry_get_invisible_char", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "rune", "(", "c", ")", "\n", "}" ]
4,324
all-4325
[ "WithBody", "adds", "the", "body", "to", "the", "add", "Vm", "params" ]
[ "func", "(", "o", "*", "AddVMParams", ")", "WithBody", "(", "<mask>", "*", "models", ".", "VM", ")", "*", "AddVMParams", "{", "o", ".", "SetBody", "(", "body", ")", "\n", "return", "o", "\n", "}" ]
4,325
all-4326
[ "AddBytesK", "adds", "the", "given", "key", ":", "value", "header", ".", "Multiple", "headers", "with", "the", "same", "key", "may", "be", "added", "with", "this", "function", ".", "Use", "SetBytesK", "for", "setting", "a", "single", "header", "for", "the"...
[ "func", "(", "h", "*", "RequestHeader", ")", "AddBytesK", "(", "<mask>", "[", "]", "byte", ",", "value", "string", ")", "{", "h", ".", "Add", "(", "b2s", "(", "key", ")", ",", "value", ")", "\n", "}" ]
4,326
all-4327
[ "NewSinglePointWriter", "creates", "new", "SinglePointWriter" ]
[ "func", "NewSinglePointWriter", "(", "log", "ttnlog", ".", "Interface", ",", "w", "BatchPointsWriter", ")", "*", "SinglePointWriter", "{", "return", "&", "SinglePointWriter", "{", "log", ":", "<mask>", ",", "writer", ":", "w", ",", "}", "\n", "}" ]
4,327
all-4328
[ "StartCustomProvider", "is", "used", "for", "sdtool", ".", "Only", "use", "this", "if", "you", "know", "what", "you", "re", "doing", "." ]
[ "func", "(", "m", "*", "Manager", ")", "StartCustomProvider", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "worker", "Discoverer", ")", "{", "p", ":=", "&", "provider", "{", "<mask>", ":", "name", ",", "d", ":", "worker", ",", "...
4,328
all-4329
[ "decodeToUTF8Base64Header", "decodes", "a", "MIME", "header", "per", "RFC", "2047", "reencoding", "to", "=", "?utf", "-", "8b?" ]
[ "func", "decodeToUTF8Base64Header", "(", "input", "string", ")", "string", "{", "if", "!", "strings", ".", "Contains", "(", "input", ",", "\"", "\"", ")", "{", "// Don't scan if there is nothing to do here", "return", "input", "\n", "}", "\n\n", "tokens", ":=", ...
4,329
all-4330
[ "HasCallback", "returns", "true", "if", "exists", "any", "callback", "subscribed", "to", "the", "topic", "." ]
[ "func", "(", "bus", "*", "EventBus", ")", "HasCallback", "(", "topic", "string", ")", "bool", "{", "bus", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "bus", ".", "lock", ".", "Unlock", "(", ")", "\n", "_", ",", "ok", ":=", "bus", ".", "h...
4,330
all-4331
[ "SetStyle", "is", "a", "wrapper", "around", "gtk_toolbar_set_style", "()", "." ]
[ "func", "(", "v", "*", "Toolbar", ")", "SetStyle", "(", "style", "ToolbarStyle", ")", "{", "C", ".", "gtk_toolbar_set_style", "(", "v", ".", "native", "(", ")", ",", "C", ".", "GtkToolbarStyle", "(", "<mask>", ")", ")", "\n", "}" ]
4,331
all-4332
[ "Info", "outputs", "Info", "level", "log" ]
[ "func", "(", "g", "*", "Glg", ")", "Info", "(", "val", "...", "<mask>", "{", "}", ")", "error", "{", "return", "g", ".", "out", "(", "INFO", ",", "blankFormat", "(", "len", "(", "val", ")", ")", ",", "val", "...", ")", "\n", "}" ]
4,332
all-4333
[ "GetBuffer", "()", "is", "a", "wrapper", "around", "gtk_entry_get_buffer", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetBuffer", "(", ")", "(", "*", "EntryBuffer", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_entry_get_buffer", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil",...
4,333
all-4334
[ "Under", "lo", ".", "mu", "Locked", "." ]
[ "func", "(", "l", "*", "lockOrder", ")", "other", "(", "ptr", "interface", "{", "}", ")", "{", "empty", ":=", "true", "\n", "for", "k", ":=", "range", "l", ".", "cur", "{", "if", "k", "==", "ptr", "{", "continue", "\n", "}", "\n", "empty", "=",...
4,334
all-4335
[ "RegisterExtractor", "registers", "extractor", "for", "given", "format" ]
[ "func", "(", "t", "*", "MockTracer", ")", "RegisterExtractor", "(", "format", "<mask>", "{", "}", ",", "extractor", "Extractor", ")", "{", "t", ".", "extractors", "[", "format", "]", "=", "extractor", "\n", "}" ]
4,335
all-4336
[ "AppendNormalizedHeaderKey", "appends", "normalized", "header", "key", "(", "name", ")", "to", "dst", "and", "returns", "the", "resulting", "dst", ".", "Normalized", "header", "key", "starts", "with", "uppercase", "letter", ".", "The", "first", "letters", "after...
[ "func", "AppendNormalizedHeaderKey", "(", "dst", "[", "]", "byte", ",", "key", "string", ")", "[", "]", "byte", "{", "dst", "=", "append", "(", "dst", ",", "key", "...", ")", "\n", "normalizeHeaderKey", "(", "dst", "[", "len", "(", "dst", ")", "-", ...
4,336
all-4337
[ "add", "canned", "acl", "to", "http", ".", "Header" ]
[ "func", "ACL", "(", "h", "http", ".", "Header", ",", "acl", "string", ")", "http", ".", "<mask>", "{", "if", "acl", "!=", "\"", "\"", "{", "h", ".", "Set", "(", "\"", "\"", ",", "acl", ")", "\n", "}", "\n", "return", "h", "\n", "}" ]
4,337
all-4338
[ "Update", "takes", "the", "representation", "of", "a", "app", "and", "updates", "it", ".", "Returns", "the", "server", "s", "representation", "of", "the", "app", "and", "an", "error", "if", "there", "is", "any", "." ]
[ "func", "(", "c", "*", "apps", ")", "Update", "(", "app", "*", "v1", ".", "App", ")", "(", "result", "*", "v1", ".", "App", ",", "err", "error", ")", "{", "result", "=", "&", "v1", ".", "App", "{", "}", "\n", "err", "=", "c", ".", "<mask>",...
4,338
all-4339
[ "ExecContext", "implements", "the", "database", "/", "sql", "/", "driver", "/", "ExecerContext", "interface", "." ]
[ "func", "(", "c", "*", "conn", ")", "ExecContext", "(", "ctx", "context", ".", "Context", ",", "query", "string", ",", "args", "[", "]", "driver", ".", "NamedValue", ")", "(", "r", "driver", ".", "Result", ",", "err", "error", ")", "{", "if", "c", ...
4,339
all-4340
[ "add", "records", "that", "PCs", "in", "the", "range", "[", "min", "max", ")", "map", "to", "function", "f", "." ]
[ "func", "(", "t", "*", "funcTab", ")", "add", "(", "min", ",", "max", "core", ".", "Address", ",", "f", "*", "Func", ")", "{", "t", ".", "entries", "=", "append", "(", "t", ".", "entries", ",", "funcTabEntry", "{", "min", ":", "min", ",", "<mas...
4,340
all-4341
[ "Set", "is", "required", "for", "kingpin", "interfaces", "to", "allow", "command", "line", "params", "to", "be", "set", "to", "our", "map", "datatype" ]
[ "func", "(", "o", "*", "ListInt32Option", ")", "Set", "(", "<mask>", "string", ")", "error", "{", "val", ":=", "Int32Option", "{", "}", "\n", "val", ".", "Set", "(", "value", ")", "\n", "*", "o", "=", "append", "(", "*", "o", ",", "val", ")", "...
4,341
all-4342
[ "ReadResponse", "reads", "a", "server", "response", "into", "the", "received", "o", "." ]
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteReader", ")", "ReadResponse", "(", "response", "runtime", ".", "ClientResponse", ",", "consumer", "runtime", ".", "<mask>", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "switch", "response", ".", "Co...
4,342
all-4343
[ "PeekAlgorithmAndIssuer", "extracts", "the", "signing", "algorithm", "listed", "in", "the", "alg", "field", "and", "the", "issuer", "from", "the", "iss", "field", "of", "the", "serialized", "JWT", "buf", "s", "header", "and", "payload", "attempting", "to", "un...
[ "func", "PeekAlgorithmAndIssuer", "(", "buf", "[", "]", "byte", ")", "(", "Algorithm", ",", "string", ",", "error", ")", "{", "<mask>", "err", "error", "\n\n", "// get algorithm", "alg", ",", "err", ":=", "PeekAlgorithm", "(", "buf", ")", "\n", "if", "er...
4,343
all-4344
[ "HostPath", "returns", "the", "host", "path", "for", "the", "provided", "path", "On", "a", "normal", "system", "this", "does", "nothing", "When", "inside", "of", "a", "snap", "environment", "returns", "the", "real", "path" ]
[ "func", "HostPath", "(", "path", "string", ")", "string", "{", "// Ignore empty paths", "if", "len", "(", "path", ")", "==", "0", "{", "return", "path", "\n", "}", "\n\n", "// Don't prefix stdin/stdout", "if", "path", "==", "\"", "\"", "{", "return", "path...
4,344
all-4345
[ "WithReportProgress", "if", "true", "reportHeapSnapshotProgress", "events", "will", "be", "generated", "while", "snapshot", "is", "being", "taken", "when", "the", "tracking", "is", "stopped", "." ]
[ "func", "(", "p", "StopTrackingHeapObjectsParams", ")", "WithReportProgress", "(", "reportProgress", "bool", ")", "*", "StopTrackingHeapObjectsParams", "{", "p", ".", "ReportProgress", "=", "reportProgress", "\n", "<mask>", "&", "p", "\n", "}" ]
4,345
all-4346
[ "return", "the", "pointer", "to", "a", "mapped", "buffer", "object", "s", "data", "store" ]
[ "func", "GetBufferPointerv", "(", "target", "uint32", ",", "pname", "uint32", ",", "params", "*", "unsafe", ".", "Pointer", ")", "{", "syscall", ".", "Syscall", "(", "gpGetBufferPointerv", ",", "3", ",", "uintptr", "(", "<mask>", ")", ",", "uintptr", "(", ...
4,346
all-4347
[ "Health", "returns", "the", "current", "health", "of", "the", "recording", "rule", "." ]
[ "func", "(", "rule", "*", "RecordingRule", ")", "Health", "(", ")", "RuleHealth", "{", "rule", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "rule", ".", "mtx", ".", "Unlock", "(", ")", "\n", "return", "<mask>", ".", "health", "\n", "}" ]
4,347
all-4348
[ "OptImportThreadCount", "is", "the", "number", "of", "goroutines", "allocated", "for", "import", "." ]
[ "func", "OptImportThreadCount", "(", "count", "int", ")", "ImportOption", "{", "return", "func", "(", "<mask>", "*", "ImportOptions", ")", "error", "{", "options", ".", "threadCount", "=", "count", "\n", "return", "nil", "\n", "}", "\n", "}" ]
4,348
all-4349
[ "GetName", "returns", "the", "Name", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "c", "*", "CreatedBy", ")", "GetName", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "<mask>", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "Name", "\n", "}" ]
4,349
all-4350
[ "SetCursor", "sets", "the", "position", "of", "the", "cursor", "in", "the", "list", ".", "Values", "out", "of", "bounds", "will", "be", "clamped", "." ]
[ "func", "(", "l", "*", "List", ")", "SetCursor", "(", "i", "int", ")", "{", "max", ":=", "len", "(", "l", ".", "scope", ")", "-", "1", "\n", "if", "i", ">=", "max", "{", "i", "=", "<mask>", "\n", "}", "\n", "if", "i", "<", "0", "{", "i", ...
4,350
all-4351
[ "focusWidget", "focuses", "on", "the", "current", "widget", ".", "If", "focus", "is", "-", "1", "it", "ll", "focus", "on", "the", "first", "available", "widget", ".", "focusWidget", "shall", "be", "called", "from", "queue", "context", "." ]
[ "func", "(", "w", "*", "Window", ")", "focusWidget", "(", ")", "{", "setCursor", "(", "-", "1", ",", "-", "1", ")", "// hide", "\n", "if", "w", ".", "focus", "<", "0", "{", "for", "i", ",", "widget", ":=", "range", "w", ".", "widgets", "{", "...
4,351
all-4352
[ "HasExtension", "returns", "true", "if", "the", "server", "supports", "a", "given", "API", "extension" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "HasExtension", "(", "extension", "string", ")", "bool", "{", "// If no cached API information, just assume we're good", "// This is needed for those rare cases where we must avoid a GetServer call", "if", "r", ".", "server", "==", "...
4,352
all-4353
[ "Reset", "re", "-", "uses", "the", "buffer", "with", "a", "new", "iterator", "resetting", "the", "buffered", "time", "delta", "to", "its", "original", "value", "." ]
[ "func", "(", "b", "*", "BufferedSeriesIterator", ")", "Reset", "(", "it", "SeriesIterator", ")", "{", "b", ".", "it", "=", "it", "\n", "b", ".", "lastTime", "=", "math", ".", "MinInt64", "\n", "b", ".", "ok", "=", "true", "\n", "b", ".", "buf", "...
4,353
all-4354
[ "GetDisabledOk", "returns", "a", "tuple", "with", "the", "Disabled", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "d", "*", "Downtime", ")", "GetDisabledOk", "(", ")", "(", "bool", ",", "bool", ")", "{", "if", "d", "==", "nil", "||", "d", ".", "Disabled", "==", "nil", "{", "return", "<mask>", ",", "false", "\n", "}", "\n", "return", "*", "d", ...
4,354
all-4355
[ "Open", "takes", "a", "snapshot", "ID", "and", "returns", "a", "ReadCloser", "for", "that", "snapshot", "." ]
[ "func", "(", "f", "*", "FileSnapshotStore", ")", "Open", "(", "id", "string", ")", "(", "*", "SnapshotMeta", ",", "io", ".", "ReadCloser", ",", "error", ")", "{", "// Get the metadata", "meta", ",", "err", ":=", "f", ".", "readMeta", "(", "id", ")", ...
4,355
all-4356
[ "Calculates", "the", "per", "-", "element", "bit", "-", "wise", "conjunction", "of", "two", "arrays", "with", "a", "mask", "." ]
[ "func", "AndWithMask", "(", "src1", ",", "src2", ",", "dst", ",", "mask", "*", "IplImage", ")", "{", "C", ".", "cvAnd", "(", "unsafe", ".", "Pointer", "(", "src1", ")", ",", "unsafe", ".", "Pointer", "(", "src2", ")", ",", "unsafe", ".", "Pointer",...
4,356
all-4357
[ "Read", "typ3", "byte", "." ]
[ "func", "decodeTyp3", "(", "bz", "[", "]", "byte", ")", "(", "typ", "Typ3", ",", "n", "int", ",", "err", "error", ")", "{", "if", "len", "(", "bz", ")", "==", "0", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "return", ...
4,357
all-4358
[ "SelectLayers", "enables", "/", "disables", "single", "layers", ".", "LayerSelector", "or", "SelectorFunc", "gets", "called", "for", "each", "layer", ".", "Returns", "true", "if", "at", "least", "one", "layer", "was", "included", "(", "or", "set", "to", "def...
[ "func", "(", "m", "*", "Map", ")", "SelectLayers", "(", "selector", "LayerSelector", ")", "bool", "{", "m", ".", "storeLayerStatus", "(", ")", "\n", "selected", ":=", "false", "\n", "n", ":=", "C", ".", "mapnik_map_layer_count", "(", "m", ".", "m", ")"...
4,358
all-4359
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "FunctionCoverage", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoProfiler21", "(", "&", "w", ",", "v", ")"...
4,359
all-4360
[ "Convenience", "Wrapper", "for", "NewDotterEx", "()", ".", "Makes", "proper", "assumptions", ".", "For", "more", "see", "NewDotterEx", "()", "." ]
[ "func", "NewDotter", "(", "oType", "OutputType", ",", "gType", "GraphType", ",", "fname", "string", ")", "(", "*", "Dotter", ",", "error", ")", "{", "return", "NewDotterEx", "(", "oType", ",", "PROG_DOT", ",", "gType", ",", "true", ",", "<mask>", ",", ...
4,360
all-4361
[ "Servers", "retrieves", "a", "list", "of", "all", "servers" ]
[ "func", "(", "c", "*", "<mask>", ")", "Servers", "(", ")", "(", "[", "]", "Server", ",", "error", ")", "{", "var", "servers", "[", "]", "Server", "\n", "_", ",", "err", ":=", "c", ".", "MakeApiRequest", "(", "\"", "\"", ",", "\"", "\"", ",", ...
4,361
all-4362
[ "Error", "returns", "a", "string", "representation", "of", "error", "e", "." ]
[ "func", "(", "e", "*", "<mask>", ")", "Error", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "e", ".", "Filename", ",", "e", ".", "LineNum", ",", "e", ".", "Msg", ")", "\n", "}" ]
4,362
all-4363
[ "Get", "takes", "name", "of", "the", "app", "and", "returns", "the", "corresponding", "app", "object", "and", "an", "error", "if", "there", "is", "any", "." ]
[ "func", "(", "c", "*", "FakeApps", ")", "Get", "(", "name", "string", ",", "options", "v1", ".", "GetOptions", ")", "(", "<mask>", "*", "tsuru_v1", ".", "App", ",", "err", "error", ")", "{", "obj", ",", "err", ":=", "c", ".", "Fake", ".", "Invoke...
4,363
all-4364
[ "Errorln", "records", "the", "log", "with", "error", "level" ]
[ "func", "(", "l", "*", "Logger", ")", "Errorln", "(", "args", "...", "<mask>", "{", "}", ")", "{", "l", ".", "Output", "(", "2", ",", "LevelError", ",", "fmt", ".", "Sprintln", "(", "args", "...", ")", ")", "\n", "}" ]
4,364
all-4365
[ "SearchRegistry", "queries", "a", "registry", "for", "images", "that", "contain", "image", "in", "their", "name", "The", "limit", "is", "the", "max", "number", "of", "results", "desired", "Note", ":", "The", "limit", "value", "doesn", "t", "work", "with", ...
[ "func", "SearchRegistry", "(", "ctx", "context", ".", "Context", ",", "sys", "*", "types", ".", "SystemContext", ",", "registry", ",", "image", "string", ",", "limit", "int", ")", "(", "[", "]", "SearchResult", ",", "error", ")", "{", "type", "V2Results"...
4,365
all-4366
[ "taken", "from", "go", "s", "ResolveTCP", "code", "but", "uses", "configurable", "ctx" ]
[ "func", "resolveTCPAddrDefault", "(", "ctx", "context", ".", "Context", ",", "addr", "string", ")", "(", "*", "net", ".", "TCPAddr", ",", "error", ")", "{", "host", ",", "port", ",", "serr", ":=", "net", ".", "SplitHostPort", "(", "addr", ")", "\n", ...
4,366
all-4367
[ "Do", "executes", "DOM", ".", "focus", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "FocusParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandFocus", ",", "p", ",", "nil", ")", "\n", "}" ]
4,367
all-4368
[ "GetTotalIncome", "returns", "total", "receipt", "balance", "from", "all", "channels", "." ]
[ "func", "(", "h", "*", "<mask>", ")", "GetTotalIncome", "(", "tkn", "string", ")", "(", "*", "uint", ",", "error", ")", "{", "logger", ":=", "h", ".", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "\n\n", "return", "h", ".", "uin...
4,368
all-4369
[ "SendRequest", "sends", "a", "JSON", "-", "RPC", "request", "through", "the", "connection", "with", "an", "auto", "generated", "request", "ID", ".", "resHandler", "is", "called", "when", "a", "response", "is", "returned", "." ]
[ "func", "(", "c", "*", "Conn", ")", "SendRequest", "(", "method", "string", ",", "params", "interface", "{", "}", ",", "resHandler", "func", "(", "res", "*", "ResCtx", ")", "error", ")", "(", "reqID", "string", ",", "err", "error", ")", "{", "<mask>"...
4,369
all-4370
[ "Replay", "events", "to", "a", "subscriber" ]
[ "func", "(", "e", "*", "EventLog", ")", "Replay", "(", "s", "*", "Subscriber", ")", "{", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "(", "*", "e", ")", ")", ";", "i", "++", "{", "if", "string", "(", "(", "*", "e", ")", "[", "i", ...
4,370
all-4371
[ "Internal", "error", "handler" ]
[ "func", "(", "mux", "*", "ServerMux", ")", "err", "(", "<mask>", "error", ")", "{", "if", "mux", ".", "ErrorHandle", "!=", "nil", "{", "mux", ".", "ErrorHandle", "(", "err", ")", "\n", "}", "\n", "}" ]
4,371
all-4372
[ "TODO", ":", "non", "-", "blocking", "snapshot" ]
[ "func", "(", "s", "*", "EtcdServer", ")", "snapshot", "(", "snapi", "uint64", ",", "confState", "raftpb", ".", "ConfState", ")", "{", "clone", ":=", "s", ".", "v2store", ".", "Clone", "(", ")", "\n", "// commit kv to write metadata (for example: consistent index...
4,372
all-4373
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
[ "func", "(", "<mask>", "*", "Endpoint", ")", "DeepCopyInto", "(", "out", "*", "Endpoint", ")", "{", "*", "out", "=", "*", "in", "\n", "if", "in", ".", "Targets", "!=", "nil", "{", "in", ",", "out", ":=", "&", "in", ".", "Targets", ",", "&", "ou...
4,373
all-4374
[ "Do", "executes", "Debugger", ".", "setVariableValue", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetVariableValueParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetVariableValue", ",", "p", ",", "nil", ")", "\n", "}" ]
4,374
all-4375
[ "String", "converts", "the", "container", "type", "enum", "to", "a", "string" ]
[ "func", "(", "containerType", "ContainerType", ")", "<mask>", "(", ")", "string", "{", "for", "str", ",", "contType", ":=", "range", "stringToContainerType", "{", "if", "contType", "==", "containerType", "{", "return", "str", "\n", "}", "\n", "}", "\n\n", ...
4,375
all-4376
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "TraceConfig", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoTracing", "(", "&", "w", ",", "v", ")", "\n"...
4,376
all-4377
[ "PresentWithTime", "is", "a", "wrapper", "around", "gtk_window_present_with_time", "()", "." ]
[ "func", "(", "v", "*", "Window", ")", "PresentWithTime", "(", "<mask>", "uint32", ")", "{", "C", ".", "gtk_window_present_with_time", "(", "v", ".", "native", "(", ")", ",", "C", ".", "guint32", "(", "ts", ")", ")", "\n", "}" ]
4,377
all-4378
[ "GetType", "returns", "the", "Type", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "t", "*", "TraceServiceDefinition", ")", "GetType", "(", ")", "string", "{", "if", "t", "==", "nil", "||", "t", ".", "Type", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "t", ".", "<mask>", "\n", "}" ]
4,378
all-4379
[ "GetPageIterator", "returns", "an", "iterator", "which", "can", "be", "used", "to", "retrieve", "pages", "." ]
[ "func", "(", "m", "*", "MessageService", ")", "GetPageIterator", "(", "data", "<mask>", ".", "Values", ")", "MessagePageIterator", "{", "iter", ":=", "NewPageIterator", "(", "m", ".", "client", ",", "data", ",", "messagesPathPart", ")", "\n", "return", "&", ...
4,379
all-4380
[ "SetPerformer", "sets", "a", "performer", "for", "the", "audio", "file", "(", "optional", ")", "." ]
[ "func", "(", "oa", "*", "OutgoingAudio", ")", "SetPerformer", "(", "to", "<mask>", ")", "*", "OutgoingAudio", "{", "oa", ".", "Performer", "=", "to", "\n", "return", "oa", "\n", "}" ]
4,380
all-4381
[ "ReadParts", "reads", "a", "MIME", "document", "from", "the", "provided", "reader", "and", "parses", "it", "into", "tree", "of", "Part", "objects", "." ]
[ "func", "ReadParts", "(", "r", "io", ".", "Reader", ")", "(", "*", "Part", ",", "error", ")", "{", "br", ":=", "bufio", ".", "NewReader", "(", "r", ")", "\n", "root", ":=", "&", "Part", "{", "PartID", ":", "\"", "\"", "}", "\n", "// Read header; ...
4,381
all-4382
[ "ProposeConfChange", "proposes", "a", "config", "change", "." ]
[ "func", "(", "rn", "*", "RawNode", ")", "ProposeConfChange", "(", "cc", "pb", ".", "ConfChange", ")", "error", "{", "data", ",", "err", ":=", "cc", ".", "Marshal", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "...
4,382
all-4383
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SetCPUThrottlingRateParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoEmulation14", "(", "&", "w", ",", ...
4,383
all-4384
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetBrowserSamplingProfileReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoMemory12", "(", "&", "w", ","...
4,384
all-4385
[ "NewHTTPTemplateFetcher", "creates", "a", "new", "struct", ".", "urls", "must", "give", "us", "the", "base", "HTTP", "urls", "for", "us", "to", "look", "the", "templates", "in", "(", "note", ":", "do", "not", "use", "trailing", "slashes", ")" ]
[ "func", "NewHTTPTemplateFetcher", "(", "urls", "[", "]", "string", ")", "(", "*", "HTTPTemplateFetcher", ",", "error", ")", "{", "f", ":=", "&", "HTTPTemplateFetcher", "{", "URLs", ":", "make", "(", "[", "]", "string", ",", "len", "(", "urls", ")", ")"...
4,385
all-4386
[ "Do", "executes", "Target", ".", "getBrowserContexts", "against", "the", "provided", "context", ".", "returns", ":", "browserContextIds", "-", "An", "array", "of", "browser", "context", "ids", "." ]
[ "func", "(", "p", "*", "GetBrowserContextsParams", ")", "Do", "(", "ctx", "context", ".", "Context", ")", "(", "browserContextIds", "[", "]", "BrowserContextID", ",", "err", "error", ")", "{", "// execute", "var", "<mask>", "GetBrowserContextsReturns", "\n", "...
4,386
all-4387
[ "SetUseColor", "()", "is", "a", "wrapper", "around", "gtk_print_settings_set_use_color", "()", "." ]
[ "func", "(", "<mask>", "*", "PrintSettings", ")", "SetUseColor", "(", "color", "bool", ")", "{", "C", ".", "gtk_print_settings_set_use_color", "(", "ps", ".", "native", "(", ")", ",", "gbool", "(", "color", ")", ")", "\n", "}" ]
4,387
all-4388
[ "SetTLSConfig", "sets", "the", "TLS", "configuration", "of", "the", "connector", "." ]
[ "func", "(", "c", "*", "Connector", ")", "SetTLSConfig", "(", "tlsConfig", "*", "tls", ".", "Config", ")", "<mask>", "{", "c", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "mu", ".", "Unlock", "(", ")", "\n", "c", ".", "tlsConfig", ...
4,388
all-4389
[ "SetNetworkMode", "sets", "the", "network", "mode", "of", "the", "container" ]
[ "func", "(", "c", "*", "Container", ")", "SetNetworkMode", "(", "networkMode", "string", ")", "{", "c", ".", "<mask>", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "c", ".", "NetworkModeUnsafe", "=", "netwo...
4,389
all-4390
[ "GetAPIKeyOk", "returns", "a", "tuple", "with", "the", "APIKey", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "r", "*", "reqAPIKey", ")", "GetAPIKeyOk", "(", ")", "(", "APIKey", ",", "bool", ")", "{", "if", "r", "==", "nil", "||", "r", ".", "APIKey", "==", "nil", "{", "return", "APIKey", "{", "}", ",", "<mask>", "\n", "}", "\n", "return", ...
4,390
all-4391
[ "expandDVPortgroupConfigSpec", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "DVPortgroupConfigSpec", "." ]
[ "func", "expandDVPortgroupConfigSpec", "(", "d", "*", "schema", ".", "ResourceData", ")", "types", ".", "DVPortgroupConfigSpec", "{", "obj", ":=", "types", ".", "DVPortgroupConfigSpec", "{", "ConfigVersion", ":", "d", ".", "Get", "(", "\"", "\"", ")", ".", "...
4,391
all-4392
[ "Calculate", "the", "trend", "value", "at", "the", "given", "index", "i", "in", "raw", "data", "d", ".", "This", "is", "somewhat", "analogous", "to", "the", "slope", "of", "the", "trend", "at", "the", "given", "index", ".", "The", "argument", "s", "is"...
[ "func", "calcTrendValue", "(", "i", "int", ",", "sf", ",", "tf", ",", "s0", ",", "s1", ",", "b", "float64", ")", "float64", "{", "if", "i", "==", "0", "{", "return", "b", "\n", "}", "\n\n", "x", ":=", "tf", "*", "(", "s1", "-", "s0", ")", "...
4,392
all-4393
[ "AddFlags", "parses", "options", "for", "github", "client" ]
[ "func", "(", "client", "*", "Client", ")", "AddFlags", "(", "cmd", "*", "cobra", ".", "Command", ")", "{", "cmd", ".", "PersistentFlags", "(", ")", ".", "StringVar", "(", "&", "client", ".", "Token", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "...
4,393
all-4394
[ "NewUbuntuCluster", "creates", "a", "basic", "Azure", "cluster", "profile", "to", "bootstrap", "Kubernetes", "." ]
[ "func", "NewUbuntuCluster", "(", "name", "string", ")", "*", "cluster", ".", "Cluster", "{", "controlPlaneProviderConfig", ":=", "&", "cluster", ".", "ControlPlaneProviderConfig", "{", "Cloud", ":", "cluster", ".", "CloudAzure", ",", "Location", ":", "\"", "\"",...
4,394
all-4395
[ "PublisherContext", "return", "the", "publisher", "." ]
[ "func", "PublisherContext", "(", "ctx", "context", ".", "Context", ")", "Publisher", "{", "pub", ",", "ok", ":=", "ctx", ".", "Value", "(", "KeyPublisher", ")", ".", "(", "<mask>", ")", "\n", "if", "!", "ok", "{", "return", "nil", "\n", "}", "\n\n", ...
4,395
all-4396
[ "SetLabels", "sets", "the", "labels", "for", "a", "container" ]
[ "func", "(", "c", "*", "Container", ")", "SetLabels", "(", "labels", "<mask>", "[", "string", "]", "string", ")", "{", "c", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "c", ".", "labels", ...
4,396
all-4397
[ "Lease", "leases", "tasks", "from", "a", "queue", ".", "leaseTime", "is", "in", "seconds", ".", "The", "number", "of", "tasks", "fetched", "will", "be", "at", "most", "maxTasks", "." ]
[ "func", "Lease", "(", "c", "<mask>", ".", "Context", ",", "maxTasks", "int", ",", "queueName", "string", ",", "leaseTime", "int", ")", "(", "[", "]", "*", "Task", ",", "error", ")", "{", "return", "lease", "(", "c", ",", "maxTasks", ",", "queueName",...
4,397
all-4398
[ "newPRMExactReference", "is", "NewPRMExactReference", "except", "it", "resturns", "the", "private", "type", "." ]
[ "func", "newPRMExactReference", "(", "dockerReference", "string", ")", "(", "*", "prmExactReference", ",", "error", ")", "{", "ref", ",", "err", ":=", "reference", ".", "ParseNormalizedNamed", "(", "dockerReference", ")", "\n", "if", "err", "!=", "nil", "{", ...
4,398
all-4399
[ "Mute", "sets", "whether", "the", "Client", "is", "muted", ".", "All", "methods", "of", "a", "muted", "Client", "do", "nothing", "and", "return", "immedialtly", ".", "This", "option", "can", "be", "used", "in", "Client", ".", "Clone", "()", "only", "if",...
[ "func", "Mute", "(", "b", "bool", ")", "Option", "{", "return", "Option", "(", "func", "(", "c", "*", "config", ")", "{", "c", ".", "<mask>", ".", "Muted", "=", "b", "\n", "}", ")", "\n", "}" ]
4,399
all-4400
[ "Encode", "writes", "an", "encoded", "object", "to", "a", "new", "bytes", "buffer", "." ]
[ "func", "encodeMsgPack", "(", "in", "<mask>", "{", "}", ")", "(", "*", "bytes", ".", "Buffer", ",", "error", ")", "{", "buf", ":=", "bytes", ".", "NewBuffer", "(", "nil", ")", "\n", "hd", ":=", "codec", ".", "MsgpackHandle", "{", "}", "\n", "enc", ...