id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
15,600
all-15601
[ "GetCollate", "()", "is", "a", "wrapper", "around", "gtk_print_settings_get_collate", "()", "." ]
[ "func", "(", "ps", "*", "PrintSettings", ")", "GetCollate", "(", ")", "bool", "{", "c", ":=", "C", ".", "gtk_print_settings_get_collate", "(", "<mask>", ".", "native", "(", ")", ")", "\n", "return", "gobool", "(", "c", ")", "\n", "}" ]
15,601
all-15602
[ "const", "char", "*", "pango_font_description_get_family", "(", "const", "PangoFontDescription", "*", "desc", ")", "G_GNUC_PURE", ";" ]
[ "func", "(", "v", "*", "FontDescription", ")", "GetFamily", "(", ")", "string", "{", "c", ":=", "C", ".", "pango_font_description_get_family", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "C", ".", "GoString", "(", "(", "*", "C", ".", "<mask>", ")", "(", "c", ")", ")", "\n", "}" ]
15,602
all-15603
[ "GoogleComputeCredentials", "is", "an", "option", "that", "loads", "the", "Google", "Service", "Account", "credentials", "from", "the", "GCE", "metadata", "associated", "with", "the", "GCE", "compute", "instance", ".", "If", "serviceAccount", "is", "empty", "then", "the", "default", "service", "account", "credentials", "associated", "with", "the", "GCE", "instance", "will", "be", "used", "." ]
[ "func", "GoogleComputeCredentials", "(", "serviceAccount", "string", ")", "Option", "{", "return", "func", "(", "sh", "*", "StackdriverHook", ")", "error", "{", "var", "err", "error", "\n\n", "// get compute metadata scopes associated with the service account", "scopes", ",", "err", ":=", "metadata", ".", "Scopes", "(", "serviceAccount", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// check if all the necessary scopes are provided", "for", "_", ",", "s", ":=", "range", "requiredScopes", "{", "if", "!", "sliceContains", "(", "scopes", ",", "s", ")", "{", "// NOTE: if you are seeing this error, you probably need to", "// recreate your compute instance with the correct scope", "//", "// as of August 2016, there is not a way to add a scope to an", "// existing compute instance", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "s", ")", "\n", "}", "\n", "}", "\n\n", "return", "HTTPClient", "(", "&", "<mask>", ".", "Client", "{", "Transport", ":", "&", "oauth2", ".", "Transport", "{", "Source", ":", "google", ".", "ComputeTokenSource", "(", "serviceAccount", ")", ",", "}", ",", "}", ")", "(", "sh", ")", "\n", "}", "\n", "}" ]
15,603
all-15604
[ "WithApp", "adds", "the", "app", "to", "the", "get", "apps", "app", "params" ]
[ "func", "(", "o", "*", "GetAppsAppParams", ")", "WithApp", "(", "app", "string", ")", "*", "GetAppsAppParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "<mask>", "o", "\n", "}" ]
15,604
all-15605
[ "UnmarshalText", "hydrates", "this", "instance", "from", "text" ]
[ "func", "(", "u", "*", "CIDR", ")", "UnmarshalText", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "// validation is performed later on", "*", "u", "=", "CIDR", "(", "string", "(", "data", ")", ")", "\n", "return", "nil", "\n", "}" ]
15,605
all-15606
[ "ParseImageName", "converts", "a", "URL", "-", "like", "image", "name", "to", "a", "types", ".", "ImageReference", "." ]
[ "func", "ParseImageName", "(", "imgName", "string", ")", "(", "types", ".", "ImageReference", ",", "error", ")", "{", "<mask>", ":=", "strings", ".", "SplitN", "(", "imgName", ",", "\"", "\"", ",", "2", ")", "\n", "if", "len", "(", "parts", ")", "!=", "2", "{", "return", "nil", ",", "errors", ".", "Errorf", "(", "`Invalid image name \"%s\", expected colon-separated transport:reference`", ",", "imgName", ")", "\n", "}", "\n", "transport", ":=", "transports", ".", "Get", "(", "parts", "[", "0", "]", ")", "\n", "if", "transport", "==", "nil", "{", "return", "nil", ",", "errors", ".", "Errorf", "(", "`Invalid image name \"%s\", unknown transport \"%s\"`", ",", "imgName", ",", "parts", "[", "0", "]", ")", "\n", "}", "\n", "return", "transport", ".", "ParseReference", "(", "parts", "[", "1", "]", ")", "\n", "}" ]
15,606
all-15607
[ "Set", "is", "required", "for", "kingpin", "interfaces", "to", "allow", "command", "line", "params", "to", "be", "set", "to", "our", "map", "datatype" ]
[ "func", "(", "o", "*", "MapRawTypeOption", ")", "Set", "(", "value", "string", ")", "error", "{", "parts", ":=", "stringMapRegex", ".", "Split", "(", "value", ",", "2", ")", "\n", "if", "len", "(", "parts", ")", "!=", "2", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "value", ")", "\n", "}", "\n", "val", ":=", "RawTypeOption", "{", "}", "\n", "val", ".", "<mask>", "(", "parts", "[", "1", "]", ")", "\n", "(", "*", "o", ")", "[", "parts", "[", "0", "]", "]", "=", "val", "\n", "return", "nil", "\n", "}" ]
15,607
all-15608
[ "updateTaskDesiredStatusUnsafe", "determines", "what", "status", "the", "task", "should", "properly", "be", "at", "based", "on", "the", "containers", "statuses", "Invariant", ":", "task", "desired", "status", "must", "be", "stopped", "if", "any", "essential", "container", "is", "stopped" ]
[ "func", "(", "<mask>", "*", "Task", ")", "updateTaskDesiredStatusUnsafe", "(", ")", "{", "seelog", ".", "Debugf", "(", "\"", "\"", ",", "task", ".", "stringUnsafe", "(", ")", ")", "\n\n", "// A task's desired status is stopped if any essential container is stopped", "// Otherwise, the task's desired status is unchanged (typically running, but no need to change)", "for", "_", ",", "cont", ":=", "range", "task", ".", "Containers", "{", "if", "cont", ".", "Essential", "&&", "(", "cont", ".", "KnownTerminal", "(", ")", "||", "cont", ".", "DesiredTerminal", "(", ")", ")", "{", "seelog", ".", "Debugf", "(", "\"", "\"", ",", "cont", ".", "Name", ",", "task", ".", "stringUnsafe", "(", ")", ")", "\n", "task", ".", "DesiredStatusUnsafe", "=", "apitaskstatus", ".", "TaskStopped", "\n", "}", "\n", "}", "\n", "}" ]
15,608
all-15609
[ "QuerySeries", "queries", "for", "a", "series", "against", "a", "Prometheus", "server", "." ]
[ "func", "QuerySeries", "(", "url", "*", "url", ".", "URL", ",", "matchers", "[", "]", "string", ",", "start", ",", "end", "string", ",", "p", "printer", ")", "int", "{", "config", ":=", "api", ".", "Config", "{", "Address", ":", "url", ".", "String", "(", ")", ",", "}", "\n\n", "// Create new client.", "c", ",", "err", ":=", "api", ".", "NewClient", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "fmt", ".", "Fprintln", "(", "os", ".", "Stderr", ",", "\"", "\"", ",", "err", ")", "\n", "return", "1", "\n", "}", "\n\n", "// TODO: clean up timestamps", "var", "(", "minTime", "=", "<mask>", ".", "Now", "(", ")", ".", "Add", "(", "-", "9999", "*", "time", ".", "Hour", ")", "\n", "maxTime", "=", "time", ".", "Now", "(", ")", ".", "Add", "(", "9999", "*", "time", ".", "Hour", ")", "\n", ")", "\n\n", "var", "stime", ",", "etime", "time", ".", "Time", "\n\n", "if", "start", "==", "\"", "\"", "{", "stime", "=", "minTime", "\n", "}", "else", "{", "stime", ",", "err", "=", "parseTime", "(", "start", ")", "\n", "if", "err", "!=", "nil", "{", "fmt", ".", "Fprintln", "(", "os", ".", "Stderr", ",", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "\n\n", "if", "end", "==", "\"", "\"", "{", "etime", "=", "maxTime", "\n", "}", "else", "{", "etime", ",", "err", "=", "parseTime", "(", "end", ")", "\n", "if", "err", "!=", "nil", "{", "fmt", ".", "Fprintln", "(", "os", ".", "Stderr", ",", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "\n\n", "// Run query against client.", "api", ":=", "v1", ".", "NewAPI", "(", "c", ")", "\n", "ctx", ",", "cancel", ":=", "context", ".", "WithTimeout", "(", "context", ".", "Background", "(", ")", ",", "2", "*", "time", ".", "Minute", ")", "\n", "val", ",", "err", ":=", "api", ".", "Series", "(", "ctx", ",", "matchers", ",", "stime", ",", "etime", ")", "\n", "cancel", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "fmt", ".", "Fprintln", "(", "os", ".", "Stderr", ",", "\"", "\"", ",", "err", ")", "\n", "return", "1", "\n", "}", "\n\n", "p", ".", "printSeries", "(", "val", ")", "\n", "return", "0", "\n", "}" ]
15,609
all-15610
[ "UpdateOne", "signals", "update", "for", "one", "of", "the", "resources", "hold", "by", "the", "client", "." ]
[ "func", "(", "c", "*", "Client", ")", "UpdateOne", "(", "name", ",", "state", "string", ",", "userData", "*", "common", ".", "UserData", ")", "error", "{", "c", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "r", ",", "err", ":=", "c", ".", "storage", ".", "Get", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "<mask>", ")", "\n", "}", "\n", "if", "err", ":=", "c", ".", "update", "(", "r", ".", "GetName", "(", ")", ",", "state", ",", "userData", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "c", ".", "updateLocalResource", "(", "r", ",", "state", ",", "userData", ")", "\n", "}" ]
15,610
all-15611
[ "native", "returns", "a", "pointer", "to", "the", "underlying", "GtkApplication", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "native", "(", ")", "*", "C", ".", "GtkApplication", "{", "if", "v", "==", "nil", "||", "v", ".", "GObject", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "C", ".", "toGtkApplication", "(", "unsafe", ".", "Pointer", "(", "v", ".", "GObject", ")", ")", "\n", "}" ]
15,611
all-15612
[ "ListUsers", "-", "returns", "uaa", ".", "Users" ]
[ "func", "(", "m", "*", "DefaultUAAManager", ")", "ListUsers", "(", ")", "(", "*", "Users", ",", "error", ")", "{", "users", ":=", "&", "Users", "{", "}", "\n", "lo", ".", "G", ".", "Debug", "(", "\"", "\"", ")", "\n", "userList", ",", "err", ":=", "m", ".", "Client", ".", "ListAllUsers", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "lo", ".", "G", ".", "Debugf", "(", "\"", "\"", ",", "len", "(", "userList", ")", ")", "\n", "for", "_", ",", "user", ":=", "range", "userList", "{", "lo", ".", "G", ".", "Debugf", "(", "\"", "\"", ",", "user", ".", "Username", ",", "user", ".", "ExternalID", ",", "user", ".", "Origin", ",", "Email", "(", "user", ")", ",", "user", ".", "ID", ")", "\n", "users", ".", "Add", "(", "User", "{", "Username", ":", "user", ".", "Username", ",", "ExternalID", ":", "user", ".", "ExternalID", ",", "Email", ":", "Email", "(", "user", ")", ",", "Origin", ":", "user", ".", "Origin", ",", "GUID", ":", "user", ".", "ID", ",", "}", ")", "\n", "}", "\n", "return", "<mask>", ",", "nil", "\n", "}" ]
15,612
all-15613
[ "SetSource", "is", "a", "wrapper", "around", "cairo_set_source", "()", "." ]
[ "func", "(", "v", "*", "Context", ")", "SetSource", "(", "p", "*", "<mask>", ")", "{", "C", ".", "cairo_set_source", "(", "v", ".", "native", "(", ")", ",", "p", ".", "native", "(", ")", ")", "\n", "}" ]
15,613
all-15614
[ "Execute", "-", "adds", "a", "named", "space", "to", "the", "configuration" ]
[ "func", "(", "c", "*", "AddSpaceToConfigurationCommand", ")", "Execute", "(", "[", "]", "string", ")", "error", "{", "lo", ".", "G", ".", "Warning", "(", "\"", "\"", ")", "\n", "spaceConfig", ":=", "&", "config", ".", "SpaceConfig", "{", "Org", ":", "c", ".", "OrgName", ",", "Space", ":", "c", ".", "SpaceName", ",", "DeveloperGroup", ":", "c", ".", "SpaceDeveloperGroup", ",", "ManagerGroup", ":", "c", ".", "SpaceMgrGroup", ",", "AuditorGroup", ":", "c", ".", "SpaceAuditorGroup", ",", "RemoveUsers", ":", "<mask>", ",", "}", "\n\n", "return", "config", ".", "NewManager", "(", "c", ".", "ConfigDirectory", ")", ".", "AddSpaceToConfig", "(", "spaceConfig", ")", "\n", "}" ]
15,614
all-15615
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniform1fv", "(", "program", "uint32", ",", "location", "int32", ",", "count", "int32", ",", "<mask>", "*", "float32", ")", "{", "C", ".", "glowProgramUniform1fv", "(", "gpProgramUniform1fv", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "C", ".", "GLint", ")", "(", "location", ")", ",", "(", "C", ".", "GLsizei", ")", "(", "count", ")", ",", "(", "*", "C", ".", "GLfloat", ")", "(", "unsafe", ".", "Pointer", "(", "value", ")", ")", ")", "\n", "}" ]
15,615
all-15616
[ "Start", "starts", "the", "specified", "version", "of", "the", "specified", "module", ".", "If", "either", "module", "or", "version", "are", "the", "empty", "string", "it", "means", "the", "default", "." ]
[ "func", "Start", "(", "c", "context", ".", "Context", ",", "module", ",", "version", "string", ")", "error", "{", "req", ":=", "&", "pb", ".", "StartModuleRequest", "{", "}", "\n", "if", "module", "!=", "\"", "\"", "{", "req", ".", "Module", "=", "&", "module", "\n", "}", "\n", "if", "version", "!=", "\"", "\"", "{", "req", ".", "Version", "=", "&", "version", "\n", "}", "\n", "res", ":=", "&", "pb", ".", "StartModuleResponse", "{", "}", "\n", "return", "internal", ".", "Call", "(", "c", ",", "\"", "\"", ",", "\"", "\"", ",", "req", ",", "<mask>", ")", "\n", "}" ]
15,616
all-15617
[ "$", "{", "LXD_DIR", "}", "/", "storage", "-", "pools", "/", "<pool", ">", "/", "containers", "/", "[", "<project_name", ">", "_", "]", "<container_name", ">" ]
[ "func", "getContainerMountPoint", "(", "<mask>", "string", ",", "poolName", "string", ",", "containerName", "string", ")", "string", "{", "return", "shared", ".", "VarPath", "(", "\"", "\"", ",", "poolName", ",", "\"", "\"", ",", "projectPrefix", "(", "project", ",", "containerName", ")", ")", "\n", "}" ]
15,617
all-15618
[ "HasIncreaseGood", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "g", "*", "GraphDefinitionRequest", ")", "HasIncreaseGood", "(", ")", "bool", "{", "if", "g", "!=", "nil", "&&", "g", ".", "IncreaseGood", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
15,618
all-15619
[ "GetSelectedItems", "is", "a", "wrapper", "around", "gtk_icon_view_unselect_path", "()", "." ]
[ "func", "(", "v", "*", "IconView", ")", "GetSelectedItems", "(", ")", "*", "glib", ".", "List", "{", "clist", ":=", "C", ".", "gtk_icon_view_get_selected_items", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "clist", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "glist", ":=", "glib", ".", "WrapList", "(", "uintptr", "(", "unsafe", ".", "Pointer", "(", "clist", ")", ")", ")", "\n", "glist", ".", "DataWrapper", "(", "func", "(", "ptr", "unsafe", ".", "Pointer", ")", "interface", "{", "}", "{", "return", "&", "TreePath", "{", "(", "*", "C", ".", "GtkTreePath", ")", "(", "ptr", ")", "}", "\n", "}", ")", "\n", "runtime", ".", "SetFinalizer", "(", "glist", ",", "func", "(", "glist", "*", "glib", ".", "List", ")", "{", "glist", ".", "FreeFull", "(", "func", "(", "item", "interface", "{", "}", ")", "{", "path", ":=", "item", ".", "(", "*", "TreePath", ")", "\n", "C", ".", "gtk_tree_path_free", "(", "<mask>", ".", "GtkTreePath", ")", "\n", "}", ")", "\n", "}", ")", "\n\n", "return", "glist", "\n", "}" ]
15,619
all-15620
[ "RecoverPartition", "recovers", "connections", "from", "m", "to", "others", "vice", "versa", "." ]
[ "func", "(", "m", "*", "member", ")", "RecoverPartition", "(", "t", "testing", ".", "TB", ",", "others", "...", "*", "member", ")", "{", "for", "_", ",", "other", ":=", "range", "others", "{", "m", ".", "s", ".", "MendPeer", "(", "other", ".", "s", ".", "<mask>", "(", ")", ")", "\n", "other", ".", "s", ".", "MendPeer", "(", "m", ".", "s", ".", "ID", "(", ")", ")", "\n", "}", "\n", "}" ]
15,620
all-15621
[ "StreamExists", "checks", "whether", "a", "stream", "by", "a", "given", "id", "exists" ]
[ "func", "(", "s", "*", "<mask>", ")", "StreamExists", "(", "id", "string", ")", "bool", "{", "s", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "return", "s", ".", "Streams", "[", "id", "]", "!=", "nil", "\n", "}" ]
15,621
all-15622
[ "WrapHTML", "wraps", "s", "within", "HTML", "tag", "having", "attributes", "attrs", ".", "Note", "WrapHTML", "does", "not", "escape", "s", "value", "." ]
[ "func", "WrapHTML", "(", "s", "string", ",", "tag", "string", ",", "attrs", "<mask>", "[", "string", "]", "string", ")", "string", "{", "escapeHTMLAttributeQuotes", ":=", "func", "(", "v", "string", ")", "string", "{", "v", "=", "strings", ".", "Replace", "(", "v", ",", "\"", "\"", ",", "\"", "\"", ",", "-", "1", ")", "\n", "v", "=", "strings", ".", "Replace", "(", "v", ",", "\"", "\"", ",", "\"", "\"", ",", "-", "1", ")", "\n", "v", "=", "strings", ".", "Replace", "(", "v", ",", "\"", "\\\"", "\"", ",", "\"", "\"", ",", "-", "1", ")", "\n", "return", "v", "\n", "}", "\n", "if", "tag", "==", "\"", "\"", "{", "tag", "=", "\"", "\"", "\n", "}", "\n", "el", ":=", "\"", "\"", "+", "tag", "\n", "for", "name", ",", "val", ":=", "range", "attrs", "{", "el", "+=", "\"", "\"", "+", "name", "+", "\"", "\\\"", "\"", "+", "escapeHTMLAttributeQuotes", "(", "val", ")", "+", "\"", "\\\"", "\"", "\n", "}", "\n", "el", "+=", "\"", "\"", "+", "s", "+", "\"", "\"", "+", "tag", "+", "\"", "\"", "\n", "return", "el", "\n", "}" ]
15,622
all-15623
[ "return", "parameters", "of", "a", "buffer", "object" ]
[ "func", "GetNamedBufferParameteri64v", "(", "buffer", "uint32", ",", "pname", "uint32", ",", "params", "*", "int64", ")", "{", "syscall", ".", "Syscall", "(", "gpGetNamedBufferParameteri64v", ",", "3", ",", "uintptr", "(", "<mask>", ")", ",", "uintptr", "(", "pname", ")", ",", "uintptr", "(", "unsafe", ".", "Pointer", "(", "params", ")", ")", ")", "\n", "}" ]
15,623
all-15624
[ "getMemoryReservationLockedToMax", "determines", "if", "the", "memory_reservation", "is", "not", "set", "to", "be", "equal", "to", "memory", ".", "If", "they", "are", "not", "equal", "then", "the", "memory", "reservation", "needs", "to", "be", "unlocked", "from", "the", "maximum", ".", "Rather", "than", "supporting", "the", "locking", "reservation", "to", "max", "option", "we", "can", "set", "memory_reservation", "to", "memory", "in", "the", "configuration", ".", "Not", "supporting", "the", "option", "causes", "problems", "when", "cloning", "from", "a", "template", "that", "has", "it", "enabled", ".", "The", "solution", "is", "to", "set", "it", "to", "false", "when", "needed", "but", "leave", "it", "alone", "when", "the", "change", "is", "not", "necessary", "." ]
[ "func", "getMemoryReservationLockedToMax", "(", "d", "*", "schema", ".", "ResourceData", ")", "*", "bool", "{", "if", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "int", ")", "!=", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "int", ")", "{", "return", "structure", ".", "BoolPtr", "(", "<mask>", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
15,624
all-15625
[ "CloudIP", "retrieves", "a", "detailed", "view", "of", "one", "cloud", "ip" ]
[ "func", "(", "c", "*", "Client", ")", "CloudIP", "(", "identifier", "string", ")", "(", "*", "CloudIP", ",", "error", ")", "{", "cloudip", ":=", "<mask>", "(", "CloudIP", ")", "\n", "_", ",", "err", ":=", "c", ".", "MakeApiRequest", "(", "\"", "\"", ",", "\"", "\"", "+", "identifier", ",", "nil", ",", "cloudip", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "cloudip", ",", "err", "\n", "}" ]
15,625
all-15626
[ "export", "addItem" ]
[ "func", "addItem", "(", "hostPtr", "unsafe", ".", "Pointer", ",", "item", "*", "C", ".", "char", ")", "{", "host", ":=", "(", "*", "Host", ")", "(", "hostPtr", ")", "\n", "<mask>", ".", "items", "=", "append", "(", "host", ".", "items", ",", "C", ".", "GoString", "(", "item", ")", ")", "\n", "}" ]
15,626
all-15627
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "CallFunctionOnReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime46", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
15,627
all-15628
[ "Merge", "does", "a", "filtered", "merge", "of", "the", "hashtrees", "in", "the", "cache", ".", "The", "results", "are", "written", "to", "the", "passed", "in", "*", "Writer", ".", "The", "base", "field", "is", "used", "as", "the", "base", "hashtree", "if", "it", "is", "non", "-", "nil" ]
[ "func", "(", "c", "*", "MergeCache", ")", "Merge", "(", "w", "*", "Writer", ",", "base", "io", ".", "Reader", ",", "<mask>", "Filter", ")", "(", "retErr", "error", ")", "{", "var", "trees", "[", "]", "*", "Reader", "\n", "if", "base", "!=", "nil", "{", "trees", "=", "append", "(", "trees", ",", "NewReader", "(", "base", ",", "filter", ")", ")", "\n", "}", "\n", "for", "_", ",", "key", ":=", "range", "c", ".", "Keys", "(", ")", "{", "r", ",", "err", ":=", "c", ".", "Cache", ".", "Get", "(", "key", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "defer", "func", "(", ")", "{", "if", "err", ":=", "r", ".", "Close", "(", ")", ";", "err", "!=", "nil", "&&", "retErr", "==", "nil", "{", "retErr", "=", "err", "\n", "}", "\n", "}", "(", ")", "\n", "trees", "=", "append", "(", "trees", ",", "NewReader", "(", "r", ",", "filter", ")", ")", "\n", "}", "\n", "return", "Merge", "(", "w", ",", "trees", ")", "\n", "}" ]
15,628
all-15629
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EvaluateParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime38", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
15,629
all-15630
[ "WithContext", "adds", "the", "context", "to", "the", "get", "Vm", "by", "cid", "params" ]
[ "func", "(", "o", "*", "GetVMByCidParams", ")", "WithContext", "(", "ctx", "context", ".", "<mask>", ")", "*", "GetVMByCidParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
15,630
all-15631
[ "WriteResource", "writes", "the", "code", "for", "a", "resource", "." ]
[ "func", "(", "c", "*", "AngularWriter", ")", "WriteResource", "(", "<mask>", "*", "gen", ".", "Resource", ",", "w", "io", ".", "Writer", ")", "error", "{", "return", "c", ".", "angularTmpl", ".", "Execute", "(", "w", ",", "resource", ")", "\n", "}" ]
15,631
all-15632
[ "Server", "returns", "the", "server", "that", "the", "socket", "is", "associated", "with", ".", "It", "returns", "nil", "while", "the", "socket", "is", "cached", "in", "its", "respective", "server", "." ]
[ "func", "(", "socket", "*", "mongoSocket", ")", "Server", "(", ")", "*", "mongoServer", "{", "socket", ".", "Lock", "(", ")", "\n", "server", ":=", "socket", ".", "server", "\n", "socket", ".", "Unlock", "(", ")", "\n", "return", "<mask>", "\n", "}" ]
15,632
all-15633
[ "Do", "executes", "Input", ".", "emulateTouchFromMouseEvent", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "EmulateTouchFromMouseEventParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandEmulateTouchFromMouseEvent", ",", "p", ",", "nil", ")", "\n", "}" ]
15,633
all-15634
[ "Value", "converts", "a", "value", "to", "a", "database", "driver", "value" ]
[ "func", "(", "u", "IPv6", ")", "Value", "(", ")", "(", "<mask>", ".", "Value", ",", "error", ")", "{", "return", "driver", ".", "Value", "(", "string", "(", "u", ")", ")", ",", "nil", "\n", "}" ]
15,634
all-15635
[ "Infof", "calls", "Logger", ".", "Infof", "method", "with", "provided", "arguments", "." ]
[ "func", "(", "g", "GRPCLoggerV2", ")", "Infof", "(", "<mask>", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "g", ".", "l", ".", "Infof", "(", "format", ",", "args", "...", ")", "\n", "}" ]
15,635
all-15636
[ "NewHelpAgent", "constructs", "a", "new", "HelpAgent", "." ]
[ "func", "NewHelpAgent", "(", "pa", "pluginAgent", ",", "ghc", "githubClient", ")", "*", "HelpAgent", "{", "l", ":=", "logrus", ".", "WithField", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "&", "HelpAgent", "{", "<mask>", ":", "l", ",", "pa", ":", "pa", ",", "oa", ":", "newOrgAgent", "(", "l", ",", "ghc", ",", "newRepoDetectionLimit", ")", ",", "}", "\n", "}" ]
15,636
all-15637
[ "taskFault", "extracts", "the", "task", "fault", "from", "a", "supplied", "task", ".", "Error", ".", "Check", "the", "returned", "boolean", "value", "to", "see", "if", "the", "fault", "was", "extracted", "correctly", "after", "which", "you", "will", "need", "to", "do", "further", "checking", "." ]
[ "func", "taskFault", "(", "err", "error", ")", "(", "types", ".", "BaseMethodFault", ",", "bool", ")", "{", "if", "te", ",", "ok", ":=", "err", ".", "(", "task", ".", "<mask>", ")", ";", "ok", "{", "return", "te", ".", "Fault", "(", ")", ",", "true", "\n", "}", "\n", "return", "nil", ",", "false", "\n", "}" ]
15,637
all-15638
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventNodeHighlightRequested", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoOverlay18", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "<mask>", "\n", "}" ]
15,638
all-15639
[ "GetLabelOk", "returns", "a", "tuple", "with", "the", "Label", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "WidgetAxis", ")", "GetLabelOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "w", "==", "nil", "||", "w", ".", "Label", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "w", ".", "<mask>", ",", "true", "\n", "}" ]
15,639
all-15640
[ "A", "Text", "metric", "is", "an", "arbitrary", "string", "SetText", "sets", "a", "text", "metric" ]
[ "func", "(", "m", "*", "CirconusMetrics", ")", "SetText", "(", "metric", "string", ",", "val", "<mask>", ")", "{", "m", ".", "SetTextValue", "(", "metric", ",", "val", ")", "\n", "}" ]
15,640
all-15641
[ "Uncapitalize", "all", "Y", "s" ]
[ "func", "uncapitalizeYs", "(", "<mask>", "*", "snowballword", ".", "SnowballWord", ")", "{", "for", "i", ",", "r", ":=", "range", "word", ".", "RS", "{", "// (Note: Y & y unicode code points = 89 & 121)", "if", "r", "==", "89", "{", "word", ".", "RS", "[", "i", "]", "=", "121", "\n", "}", "\n", "}", "\n", "return", "\n", "}" ]
15,641
all-15642
[ "isCompatibleWithCluster", "return", "true", "if", "the", "local", "member", "has", "a", "compatible", "version", "with", "the", "current", "running", "cluster", ".", "The", "version", "is", "considered", "as", "compatible", "when", "at", "least", "one", "of", "the", "other", "members", "in", "the", "cluster", "has", "a", "cluster", "version", "in", "the", "range", "of", "[", "MinClusterVersion", "Version", "]", "and", "no", "known", "members", "has", "a", "cluster", "version", "out", "of", "the", "range", ".", "We", "set", "this", "rule", "since", "when", "the", "local", "member", "joins", "another", "member", "might", "be", "offline", "." ]
[ "func", "isCompatibleWithCluster", "(", "lg", "*", "zap", ".", "Logger", ",", "cl", "*", "membership", ".", "RaftCluster", ",", "<mask>", "types", ".", "ID", ",", "rt", "http", ".", "RoundTripper", ")", "bool", "{", "vers", ":=", "getVersions", "(", "lg", ",", "cl", ",", "local", ",", "rt", ")", "\n", "minV", ":=", "semver", ".", "Must", "(", "semver", ".", "NewVersion", "(", "version", ".", "MinClusterVersion", ")", ")", "\n", "maxV", ":=", "semver", ".", "Must", "(", "semver", ".", "NewVersion", "(", "version", ".", "Version", ")", ")", "\n", "maxV", "=", "&", "semver", ".", "Version", "{", "Major", ":", "maxV", ".", "Major", ",", "Minor", ":", "maxV", ".", "Minor", ",", "}", "\n", "return", "isCompatibleWithVers", "(", "lg", ",", "vers", ",", "local", ",", "minV", ",", "maxV", ")", "\n", "}" ]
15,642
all-15643
[ "Add", "inserts", "a", "new", "symbol", "into", "the", "load", "statement", ".", "This", "has", "no", "effect", "if", "the", "symbol", "is", "already", "loaded", ".", "Symbols", "will", "be", "sorted", "so", "the", "order", "doesn", "t", "matter", "." ]
[ "func", "(", "l", "*", "Load", ")", "Add", "(", "sym", "string", ")", "{", "if", "_", ",", "ok", ":=", "l", ".", "symbols", "[", "sym", "]", ";", "!", "ok", "{", "i", ":=", "&", "bzl", ".", "Ident", "{", "Name", ":", "sym", "}", "\n", "l", ".", "symbols", "[", "sym", "]", "=", "identPair", "{", "to", ":", "i", ",", "from", ":", "i", "}", "\n", "l", ".", "<mask>", "=", "true", "\n", "}", "\n", "}" ]
15,643
all-15644
[ "export", "FrameSet_Index" ]
[ "func", "FrameSet_Index", "(", "id", "FrameSetId", ",", "frame", "int", ")", "C", ".", "int", "{", "fs", ",", "ok", ":=", "sFrameSets", ".", "Get", "(", "id", ")", "\n", "if", "!", "<mask>", "{", "return", "C", ".", "int", "(", "-", "1", ")", "\n", "}", "\n", "return", "C", ".", "int", "(", "fs", ".", "Index", "(", "frame", ")", ")", "\n", "}" ]
15,644
all-15645
[ "GetPrepare", "retrieves", "the", "Prepare", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
[ "func", "(", "u", "ScpStatementPledges", ")", "GetPrepare", "(", ")", "(", "<mask>", "ScpStatementPrepare", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n\n", "if", "armName", "==", "\"", "\"", "{", "result", "=", "*", "u", ".", "Prepare", "\n", "ok", "=", "true", "\n", "}", "\n\n", "return", "\n", "}" ]
15,645
all-15646
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "the", "current", "program", "object" ]
[ "func", "UniformMatrix3fv", "(", "location", "int32", ",", "count", "int32", ",", "transpose", "bool", ",", "value", "*", "float32", ")", "{", "C", ".", "glowUniformMatrix3fv", "(", "gpUniformMatrix3fv", ",", "(", "C", ".", "GLint", ")", "(", "<mask>", ")", ",", "(", "C", ".", "GLsizei", ")", "(", "count", ")", ",", "(", "C", ".", "GLboolean", ")", "(", "boolToInt", "(", "transpose", ")", ")", ",", "(", "*", "C", ".", "GLfloat", ")", "(", "unsafe", ".", "Pointer", "(", "value", ")", ")", ")", "\n", "}" ]
15,646
all-15647
[ "MergeRules", "copies", "information", "from", "src", "into", "dst", "usually", "discarding", "information", "in", "dst", "when", "they", "have", "the", "same", "attributes", ".", "If", "dst", "is", "marked", "with", "a", "#", "keep", "comment", "either", "above", "the", "rule", "or", "as", "a", "suffix", "nothing", "will", "be", "changed", ".", "If", "src", "has", "an", "attribute", "that", "is", "not", "in", "dst", "it", "will", "be", "copied", "into", "dst", ".", "If", "src", "and", "dst", "have", "the", "same", "attribute", "and", "the", "attribute", "is", "mergeable", "and", "the", "attribute", "in", "dst", "is", "not", "marked", "with", "a", "#", "keep", "comment", "values", "in", "the", "dst", "attribute", "not", "marked", "with", "a", "#", "keep", "comment", "will", "be", "dropped", "and", "values", "from", "src", "will", "be", "copied", "in", ".", "If", "dst", "has", "an", "attribute", "not", "in", "src", "and", "the", "attribute", "is", "mergeable", "and", "not", "marked", "with", "a", "#", "keep", "comment", "values", "in", "the", "attribute", "not", "marked", "with", "a", "#", "keep", "comment", "will", "be", "dropped", ".", "If", "the", "attribute", "is", "empty", "afterward", "it", "will", "be", "deleted", "." ]
[ "func", "MergeRules", "(", "src", ",", "dst", "*", "Rule", ",", "mergeable", "map", "[", "string", "]", "bool", ",", "filename", "string", ")", "{", "if", "dst", ".", "ShouldKeep", "(", ")", "{", "return", "\n", "}", "\n\n", "// Process attributes that are in dst but not in src.", "for", "key", ",", "dstAttr", ":=", "range", "dst", ".", "attrs", "{", "if", "_", ",", "ok", ":=", "src", ".", "attrs", "[", "key", "]", ";", "ok", "||", "!", "mergeable", "[", "key", "]", "||", "ShouldKeep", "(", "dstAttr", ")", "{", "continue", "\n", "}", "\n", "dstValue", ":=", "dstAttr", ".", "RHS", "\n", "if", "mergedValue", ",", "err", ":=", "mergeExprs", "(", "nil", ",", "dstValue", ")", ";", "err", "!=", "nil", "{", "start", ",", "end", ":=", "dstValue", ".", "Span", "(", ")", "\n", "log", ".", "Printf", "(", "\"", "\"", ",", "filename", ",", "start", ".", "Line", ",", "start", ".", "LineRune", ",", "end", ".", "Line", ",", "end", ".", "LineRune", ")", "\n", "}", "else", "if", "mergedValue", "==", "nil", "{", "dst", ".", "DelAttr", "(", "<mask>", ")", "\n", "}", "else", "{", "dst", ".", "SetAttr", "(", "key", ",", "mergedValue", ")", "\n", "}", "\n", "}", "\n\n", "// Merge attributes from src into dst.", "for", "key", ",", "srcAttr", ":=", "range", "src", ".", "attrs", "{", "srcValue", ":=", "srcAttr", ".", "RHS", "\n", "if", "dstAttr", ",", "ok", ":=", "dst", ".", "attrs", "[", "key", "]", ";", "!", "ok", "{", "dst", ".", "SetAttr", "(", "key", ",", "srcValue", ")", "\n", "}", "else", "if", "mergeable", "[", "key", "]", "&&", "!", "ShouldKeep", "(", "dstAttr", ")", "{", "dstValue", ":=", "dstAttr", ".", "RHS", "\n", "if", "mergedValue", ",", "err", ":=", "mergeExprs", "(", "srcValue", ",", "dstValue", ")", ";", "err", "!=", "nil", "{", "start", ",", "end", ":=", "dstValue", ".", "Span", "(", ")", "\n", "log", ".", "Printf", "(", "\"", "\"", ",", "filename", ",", "start", ".", "Line", ",", "start", ".", "LineRune", ",", "end", ".", "Line", ",", "end", ".", "LineRune", ")", "\n", "}", "else", "{", "dst", ".", "SetAttr", "(", "key", ",", "mergedValue", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "}" ]
15,647
all-15648
[ "appendIterators", "appends", "iterators", "to", "an", "array", "of", "iterators", "for", "merging", ".", "Note", ":", "This", "obtains", "references", "for", "the", "table", "handlers", ".", "Remember", "to", "close", "these", "iterators", "." ]
[ "func", "(", "s", "*", "levelHandler", ")", "appendIterators", "(", "iters", "[", "]", "y", ".", "Iterator", ",", "opt", "*", "IteratorOptions", ")", "[", "]", "y", ".", "Iterator", "{", "s", ".", "RLock", "(", ")", "\n", "defer", "s", ".", "RUnlock", "(", ")", "\n\n", "tables", ":=", "make", "(", "[", "]", "*", "table", ".", "Table", ",", "0", ",", "len", "(", "s", ".", "tables", ")", ")", "\n", "for", "_", ",", "t", ":=", "range", "s", ".", "tables", "{", "if", "opt", ".", "pickTable", "(", "t", ")", "{", "tables", "=", "append", "(", "tables", ",", "t", ")", "\n", "}", "\n", "}", "\n", "if", "len", "(", "tables", ")", "==", "0", "{", "return", "iters", "\n", "}", "\n\n", "if", "s", ".", "<mask>", "==", "0", "{", "// Remember to add in reverse order!", "// The newer table at the end of s.tables should be added first as it takes precedence.", "return", "appendIteratorsReversed", "(", "iters", ",", "tables", ",", "opt", ".", "Reverse", ")", "\n", "}", "\n", "return", "append", "(", "iters", ",", "table", ".", "NewConcatIterator", "(", "tables", ",", "opt", ".", "Reverse", ")", ")", "\n", "}" ]
15,648
all-15649
[ "NewRunner", "returns", "a", "new", "transaction", "runner", "that", "uses", "tc", "to", "hold", "its", "transactions", ".", "Multiple", "transaction", "collections", "may", "exist", "in", "a", "single", "database", "but", "all", "collections", "that", "are", "touched", "by", "operations", "in", "a", "given", "transaction", "collection", "must", "be", "handled", "exclusively", "by", "it", ".", "A", "second", "collection", "with", "the", "same", "name", "of", "tc", "but", "suffixed", "by", ".", "stash", "will", "be", "used", "for", "implementing", "the", "transactional", "behavior", "of", "insert", "and", "remove", "operations", "." ]
[ "func", "NewRunner", "(", "tc", "*", "mgo", ".", "Collection", ")", "*", "Runner", "{", "return", "&", "Runner", "{", "tc", ",", "tc", ".", "<mask>", ".", "C", "(", "tc", ".", "Name", "+", "\"", "\"", ")", ",", "nil", "}", "\n", "}" ]
15,649
all-15650
[ "Save", "config", "encrypts", "the", "password", "and", "/", "or", "refresh", "token", ";", "persists", "the", "config", "to", "file" ]
[ "func", "(", "cfg", "*", "ClientConfig", ")", "Save", "(", "<mask>", "string", ")", "error", "{", "encrypted_password", ",", "err", ":=", "Encrypt", "(", "cfg", ".", "Password", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "cfg", ".", "Password", "=", "encrypted_password", "\n", "encrypted_refresh", ",", "err", ":=", "Encrypt", "(", "cfg", ".", "RefreshToken", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "cfg", ".", "RefreshToken", "=", "encrypted_refresh", "\n", "bytes", ",", "err", ":=", "json", ".", "Marshal", "(", "cfg", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "err", "=", "ioutil", ".", "WriteFile", "(", "path", ",", "bytes", ",", "0644", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
15,650
all-15651
[ "allEntries", "returns", "all", "entries", "in", "the", "log", "." ]
[ "func", "(", "l", "*", "raftLog", ")", "allEntries", "(", ")", "[", "]", "<mask>", ".", "Entry", "{", "ents", ",", "err", ":=", "l", ".", "entries", "(", "l", ".", "firstIndex", "(", ")", ",", "noLimit", ")", "\n", "if", "err", "==", "nil", "{", "return", "ents", "\n", "}", "\n", "if", "err", "==", "ErrCompacted", "{", "// try again if there was a racing compaction", "return", "l", ".", "allEntries", "(", ")", "\n", "}", "\n", "// TODO (xiangli): handle error?", "panic", "(", "err", ")", "\n", "}" ]
15,651
all-15652
[ "SetActiveIter", "is", "a", "wrapper", "around", "gtk_combo_box_set_active_iter", "()", "." ]
[ "func", "(", "v", "*", "ComboBox", ")", "SetActiveIter", "(", "iter", "*", "TreeIter", ")", "{", "<mask>", "cIter", "*", "C", ".", "GtkTreeIter", "\n", "if", "iter", "!=", "nil", "{", "cIter", "=", "&", "iter", ".", "GtkTreeIter", "\n", "}", "\n", "C", ".", "gtk_combo_box_set_active_iter", "(", "v", ".", "native", "(", ")", ",", "cIter", ")", "\n", "}" ]
15,652
all-15653
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetFramesWithManifestsParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoApplicationcache4", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
15,653
all-15654
[ "bind", "one", "or", "more", "buffer", "objects", "to", "a", "sequence", "of", "indexed", "buffer", "targets" ]
[ "func", "BindBuffersBase", "(", "target", "uint32", ",", "first", "uint32", ",", "<mask>", "int32", ",", "buffers", "*", "uint32", ")", "{", "syscall", ".", "Syscall6", "(", "gpBindBuffersBase", ",", "4", ",", "uintptr", "(", "target", ")", ",", "uintptr", "(", "first", ")", ",", "uintptr", "(", "count", ")", ",", "uintptr", "(", "unsafe", ".", "Pointer", "(", "buffers", ")", ")", ",", "0", ",", "0", ")", "\n", "}" ]
15,654
all-15655
[ "SendDown", "relays", "data", "into", "the", "channel", "topology", "via", "conn", "." ]
[ "func", "(", "c", "*", "gossipChannel", ")", "SendDown", "(", "conn", "Connection", ",", "data", "GossipData", ")", "{", "c", ".", "senderFor", "(", "conn", ")", ".", "Send", "(", "<mask>", ")", "\n", "}" ]
15,655
all-15656
[ "EncodeCookie", "signs", "and", "encodes", "the", "cookie" ]
[ "func", "(", "c", "CookieSigner", ")", "EncodeCookie", "(", "cookie", "*", "http", ".", "Cookie", ")", "{", "<mask>", ".", "Value", "=", "c", ".", "EncodeValue", "(", "cookie", ".", "Value", ")", "\n", "}" ]
15,656
all-15657
[ "GetValue", "returns", "the", "Value", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "w", "*", "WidgetConditionalFormat", ")", "GetValue", "(", ")", "float64", "{", "if", "w", "==", "nil", "||", "w", ".", "Value", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "w", ".", "<mask>", "\n", "}" ]
15,657
all-15658
[ "Leaves", "returns", "a", "slice", "containing", "all", "leaves", "in", "d", "." ]
[ "func", "(", "d", "*", "DAG", ")", "Leaves", "(", ")", "[", "]", "string", "{", "var", "result", "[", "]", "string", "\n", "for", "id", ",", "isLeaf", ":=", "range", "d", ".", "leaves", "{", "// isLeaf might be false, explicit mark nodes as non leaves", "if", "isLeaf", "{", "result", "=", "<mask>", "(", "result", ",", "id", ")", "\n", "}", "\n", "}", "\n", "return", "result", "\n", "}" ]
15,658
all-15659
[ "SetChildSecondary", "()", "is", "a", "wrapper", "around", "gtk_button_box_set_child_secondary", "()", "." ]
[ "func", "(", "v", "*", "ButtonBox", ")", "SetChildSecondary", "(", "<mask>", "IWidget", ",", "isSecondary", "bool", ")", "{", "C", ".", "gtk_button_box_set_child_secondary", "(", "v", ".", "native", "(", ")", ",", "child", ".", "toWidget", "(", ")", ",", "gbool", "(", "isSecondary", ")", ")", "\n", "}" ]
15,659
all-15660
[ "set", "rasterization", "mode" ]
[ "func", "RenderMode", "(", "mode", "uint32", ")", "int32", "{", "ret", ":=", "C", ".", "glowRenderMode", "(", "gpRenderMode", ",", "(", "C", ".", "GLenum", ")", "(", "<mask>", ")", ")", "\n", "return", "(", "int32", ")", "(", "ret", ")", "\n", "}" ]
15,660
all-15661
[ "findMapping", "is", "simple", "enough", "that", "it", "inlines", "." ]
[ "func", "(", "p", "*", "<mask>", ")", "findMapping", "(", "a", "Address", ")", "*", "Mapping", "{", "t3", ":=", "p", ".", "pageTable", "[", "a", ">>", "52", "]", "\n", "if", "t3", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "t2", ":=", "t3", "[", "a", ">>", "42", "%", "(", "1", "<<", "10", ")", "]", "\n", "if", "t2", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "t1", ":=", "t2", "[", "a", ">>", "32", "%", "(", "1", "<<", "10", ")", "]", "\n", "if", "t1", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "t0", ":=", "t1", "[", "a", ">>", "22", "%", "(", "1", "<<", "10", ")", "]", "\n", "if", "t0", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "t0", "[", "a", ">>", "12", "%", "(", "1", "<<", "10", ")", "]", "\n", "}" ]
15,661
all-15662
[ "Ago", "pretty", "-", "prints", "the", "amount", "of", "time", "that", "has", "passed", "since", "timestamp", "as", "a", "human", "-", "readable", "string", "." ]
[ "func", "Ago", "(", "timestamp", "*", "<mask>", ".", "Timestamp", ")", "string", "{", "t", ",", "_", ":=", "types", ".", "TimestampFromProto", "(", "timestamp", ")", "\n", "if", "t", ".", "Equal", "(", "time", ".", "Time", "{", "}", ")", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "units", ".", "HumanDuration", "(", "time", ".", "Since", "(", "t", ")", ")", ")", "\n", "}" ]
15,662
all-15663
[ "commit", "always", "goes", "through", "when", "read", "committed" ]
[ "func", "(", "s", "*", "stmReadCommitted", ")", "commit", "(", ")", "*", "v3", ".", "TxnResponse", "{", "s", ".", "rset", "=", "nil", "\n", "return", "s", ".", "stm", ".", "<mask>", "(", ")", "\n", "}" ]
15,663
all-15664
[ "Routes", "implements", "scaffold", ".", "Platform", ".", "Routes" ]
[ "func", "(", "a", "*", "App", ")", "Routes", "(", "router", "*", "scaffold", ".", "Router", ")", "{", "router", ".", "<mask>", "(", "\"", "\"", ",", "a", ".", "hello", ")", "\n", "}" ]
15,664
all-15665
[ "suitableZones", "returns", "all", "suitable", "private", "zones", "and", "the", "most", "suitable", "public", "zone", "for", "a", "given", "hostname", "and", "a", "set", "of", "zones", "." ]
[ "func", "suitableZones", "(", "hostname", "string", ",", "zones", "map", "[", "string", "]", "*", "route53", ".", "HostedZone", ")", "[", "]", "*", "route53", ".", "HostedZone", "{", "var", "matchingZones", "[", "]", "*", "route53", ".", "HostedZone", "\n", "var", "publicZone", "*", "route53", ".", "HostedZone", "\n\n", "for", "_", ",", "z", ":=", "range", "zones", "{", "if", "aws", ".", "StringValue", "(", "z", ".", "Name", ")", "==", "hostname", "||", "strings", ".", "HasSuffix", "(", "hostname", ",", "\"", "\"", "+", "aws", ".", "StringValue", "(", "z", ".", "Name", ")", ")", "{", "if", "z", ".", "Config", "==", "nil", "||", "!", "aws", ".", "BoolValue", "(", "z", ".", "Config", ".", "PrivateZone", ")", "{", "// Only select the best matching public zone", "if", "publicZone", "==", "nil", "||", "len", "(", "aws", ".", "StringValue", "(", "z", ".", "Name", ")", ")", ">", "len", "(", "aws", ".", "StringValue", "(", "publicZone", ".", "Name", ")", ")", "{", "publicZone", "=", "z", "\n", "}", "\n", "}", "else", "{", "// Include all private zones", "matchingZones", "=", "<mask>", "(", "matchingZones", ",", "z", ")", "\n", "}", "\n", "}", "\n", "}", "\n\n", "if", "publicZone", "!=", "nil", "{", "matchingZones", "=", "append", "(", "matchingZones", ",", "publicZone", ")", "\n", "}", "\n\n", "return", "matchingZones", "\n", "}" ]
15,665
all-15666
[ "mustInt64orLeaseID", "panics", "if", "val", "isn", "t", "a", "LeaseID", "int", "or", "int64", ".", "It", "returns", "an", "int64", "otherwise", "." ]
[ "func", "mustInt64orLeaseID", "(", "val", "interface", "{", "}", ")", "int64", "{", "if", "v", ",", "ok", ":=", "val", ".", "(", "LeaseID", ")", ";", "<mask>", "{", "return", "int64", "(", "v", ")", "\n", "}", "\n", "return", "mustInt64", "(", "val", ")", "\n", "}" ]
15,666
all-15667
[ "CellRendererSpinnerNew", "is", "a", "wrapper", "around", "gtk_cell_renderer_text_new", "()", "." ]
[ "func", "CellRendererSpinnerNew", "(", ")", "(", "*", "CellRendererSpinner", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_cell_renderer_spinner_new", "(", ")", "\n", "if", "c", "==", "nil", "{", "<mask>", "nil", ",", "nilPtrErr", "\n", "}", "\n", "obj", ":=", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "\n", "return", "wrapCellRendererSpinner", "(", "obj", ")", ",", "nil", "\n", "}" ]
15,667
all-15668
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetVersionReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser9", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
15,668
all-15669
[ "IA5String", "parseIA5String", "parses", "a", "ASN", ".", "1", "IA5String", "(", "ASCII", "string", ")", "from", "the", "given", "byte", "slice", "and", "returns", "it", "." ]
[ "func", "parseIA5String", "(", "bytes", "[", "]", "byte", ")", "(", "ret", "string", ",", "err", "error", ")", "{", "for", "_", ",", "b", ":=", "range", "<mask>", "{", "if", "b", ">=", "utf8", ".", "RuneSelf", "{", "err", "=", "asn1", ".", "SyntaxError", "{", "Msg", ":", "\"", "\"", "}", "\n", "return", "\n", "}", "\n", "}", "\n", "ret", "=", "string", "(", "bytes", ")", "\n", "return", "\n", "}" ]
15,669
all-15670
[ "Build", "unique", "type", "name", "by", "appending", "next", "available", "index", "to", "given", "prefix" ]
[ "func", "(", "d", "*", "APIDescriptor", ")", "uniqueTypeName", "(", "prefix", "string", ")", "string", "{", "u", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "<mask>", ",", "2", ")", "\n", "taken", ":=", "false", "\n", "for", "_", ",", "tn", ":=", "range", "d", ".", "TypeNames", "{", "if", "tn", "==", "u", "{", "taken", "=", "true", "\n", "break", "\n", "}", "\n", "}", "\n", "idx", ":=", "3", "\n", "for", "taken", "{", "u", "=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "prefix", ",", "idx", ")", "\n", "taken", "=", "false", "\n", "for", "_", ",", "tn", ":=", "range", "d", ".", "TypeNames", "{", "if", "tn", "==", "u", "{", "taken", "=", "true", "\n", "break", "\n", "}", "\n", "}", "\n", "if", "taken", "{", "idx", "++", "\n", "}", "\n", "}", "\n", "return", "u", "\n", "}" ]
15,670
all-15671
[ "DescribeContainer", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockDockerClient", ")", "DescribeContainer", "(", "arg0", "context", ".", "<mask>", ",", "arg1", "string", ")", "(", "status", ".", "ContainerStatus", ",", "dockerapi", ".", "DockerContainerMetadata", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ",", "arg1", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "status", ".", "ContainerStatus", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "dockerapi", ".", "DockerContainerMetadata", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
15,671
all-15672
[ "/", "*", "Open", "returns", "a", "new", "Writer", "at", "the", "specified", "path", "." ]
[ "func", "Open", "(", "path", "string", ",", "mode", "os", ".", "FileMode", ")", "(", "*", "Writer", ",", "error", ")", "{", "var", "w", "<mask>", "\n", "w", ".", "path", "=", "path", "\n", "w", ".", "mode", "=", "mode", "\n", "err", ":=", "w", ".", "open", "(", ")", "\n", "return", "&", "w", ",", "err", "\n", "}" ]
15,672
all-15673
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "CollectClassNamesFromSubtreeReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom76", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
15,673
all-15674
[ "Describe", "implements", "prometheus", "Collector", "interface", "." ]
[ "func", "(", "sm", "*", "sessionManager", ")", "Describe", "(", "in", "chan", "<-", "*", "prometheus", ".", "Desc", ")", "{", "<mask>", ".", "cleanupErrorsTotal", ".", "Describe", "(", "in", ")", "\n", "}" ]
15,674
all-15675
[ "IsOverQuota", "reports", "whether", "err", "represents", "an", "API", "call", "failure", "due", "to", "insufficient", "available", "quota", "." ]
[ "func", "IsOverQuota", "(", "err", "error", ")", "bool", "{", "callErr", ",", "ok", ":=", "err", ".", "(", "*", "<mask>", ".", "CallError", ")", "\n", "return", "ok", "&&", "callErr", ".", "Code", "==", "4", "\n", "}" ]
15,675
all-15676
[ "SetGPUIDs", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockGPUManager", ")", "SetGPUIDs", "(", "arg0", "[", "]", "<mask>", ")", "{", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "}" ]
15,676
all-15677
[ "For", "sets", "b", ".", "MaxElapsedTime", "to", "maxElapsed", "and", "returns", "b" ]
[ "func", "(", "b", "*", "ConstantBackOff", ")", "For", "(", "maxElapsed", "<mask>", ".", "Duration", ")", "*", "ConstantBackOff", "{", "b", ".", "MaxElapsedTime", "=", "maxElapsed", "\n", "return", "b", "\n", "}" ]
15,677
all-15678
[ "getWindowsSupportedVersions", "returns", "the", "set", "of", "remote", "api", "versions", "that", "are", "supported", "by", "agent", "in", "windows" ]
[ "func", "getWindowsSupportedVersions", "(", ")", "[", "]", "dockerclient", ".", "DockerVersion", "{", "<mask>", "[", "]", "dockerclient", ".", "DockerVersion", "{", "dockerclient", ".", "Version_1_24", ",", "dockerclient", ".", "Version_1_25", ",", "dockerclient", ".", "Version_1_26", ",", "dockerclient", ".", "Version_1_27", ",", "dockerclient", ".", "Version_1_28", ",", "dockerclient", ".", "Version_1_29", ",", "dockerclient", ".", "Version_1_30", ",", "}", "\n", "}" ]
15,678
all-15679
[ "HasProcessQuery", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "h", "*", "HeatmapRequest", ")", "HasProcessQuery", "(", ")", "bool", "{", "if", "h", "!=", "nil", "&&", "h", ".", "ProcessQuery", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
15,679
all-15680
[ "LeastCommonBitPosition", "returns", "the", "smallest", "position", "of", "the", "preceding", "common", "bits", "of", "the", "2", "networks", "and", "returns", "an", "error", "ErrNoGreatestCommonBit", "if", "the", "two", "network", "number", "diverges", "from", "the", "first", "bit", "." ]
[ "func", "(", "n", "Network", ")", "LeastCommonBitPosition", "(", "n1", "Network", ")", "(", "uint", ",", "<mask>", ")", "{", "maskSize", ",", "_", ":=", "n", ".", "IPNet", ".", "Mask", ".", "Size", "(", ")", "\n", "if", "maskSize1", ",", "_", ":=", "n1", ".", "IPNet", ".", "Mask", ".", "Size", "(", ")", ";", "maskSize1", "<", "maskSize", "{", "maskSize", "=", "maskSize1", "\n", "}", "\n", "maskPosition", ":=", "len", "(", "n1", ".", "Number", ")", "*", "BitsPerUint32", "-", "maskSize", "\n", "lcb", ",", "err", ":=", "n", ".", "Number", ".", "LeastCommonBitPosition", "(", "n1", ".", "Number", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n", "return", "uint", "(", "math", ".", "Max", "(", "float64", "(", "maskPosition", ")", ",", "float64", "(", "lcb", ")", ")", ")", ",", "nil", "\n", "}" ]
15,680
all-15681
[ "hostNetworkSystemFromHostSystemID", "locates", "a", "HostNetworkSystem", "from", "a", "specified", "HostSystem", "managed", "object", "ID", "." ]
[ "func", "hostNetworkSystemFromHostSystemID", "(", "<mask>", "*", "govmomi", ".", "Client", ",", "hsID", "string", ")", "(", "*", "object", ".", "HostNetworkSystem", ",", "error", ")", "{", "hs", ",", "err", ":=", "hostsystem", ".", "FromID", "(", "client", ",", "hsID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "hostNetworkSystemFromHostSystem", "(", "hs", ")", "\n", "}" ]
15,681
all-15682
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "OperationResultCode" ]
[ "func", "(", "e", "OperationResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "<mask>", ":=", "operationResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
15,682
all-15683
[ "GetClient", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockECRFactory", ")", "GetClient", "(", "arg0", "*", "<mask>", ".", "ECRAuthData", ")", "(", "ecr", ".", "ECRClient", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "ecr", ".", "ECRClient", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "error", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
15,683
all-15684
[ "GetScreen", "is", "a", "wrapper", "around", "gtk_style_context_get_screen", "()", "." ]
[ "func", "(", "v", "*", "StyleContext", ")", "GetScreen", "(", ")", "(", "*", "gdk", ".", "Screen", ",", "<mask>", ")", "{", "c", ":=", "C", ".", "gtk_style_context_get_screen", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n\n", "d", ":=", "&", "gdk", ".", "Screen", "{", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "}", "\n", "return", "d", ",", "nil", "\n", "}" ]
15,684
all-15685
[ "Email", "returns", "the", "primary", "email", "of", "the", "account" ]
[ "func", "(", "a", "Account", ")", "Email", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "a", ".", "Name", ",", "a", ".", "<mask>", ".", "Name", ")", "\n", "}" ]
15,685
all-15686
[ "WriteLevel0Table", "flushes", "memtable", "." ]
[ "func", "writeLevel0Table", "(", "ft", "flushTask", ",", "f", "<mask>", ".", "Writer", ")", "error", "{", "iter", ":=", "ft", ".", "mt", ".", "NewIterator", "(", ")", "\n", "defer", "iter", ".", "Close", "(", ")", "\n", "b", ":=", "table", ".", "NewTableBuilder", "(", ")", "\n", "defer", "b", ".", "Close", "(", ")", "\n", "for", "iter", ".", "SeekToFirst", "(", ")", ";", "iter", ".", "Valid", "(", ")", ";", "iter", ".", "Next", "(", ")", "{", "if", "len", "(", "ft", ".", "dropPrefix", ")", ">", "0", "&&", "bytes", ".", "HasPrefix", "(", "iter", ".", "Key", "(", ")", ",", "ft", ".", "dropPrefix", ")", "{", "continue", "\n", "}", "\n", "if", "err", ":=", "b", ".", "Add", "(", "iter", ".", "Key", "(", ")", ",", "iter", ".", "Value", "(", ")", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "_", ",", "err", ":=", "f", ".", "Write", "(", "b", ".", "Finish", "(", ")", ")", "\n", "return", "err", "\n", "}" ]
15,686
all-15687
[ "constructConcreteType", "creates", "the", "concrete", "value", "as", "well", "as", "the", "corresponding", "settable", "value", "for", "it", ".", "Return", "irvSet", "which", "should", "be", "set", "on", "caller", "s", "interface", "rv", "." ]
[ "func", "constructConcreteType", "(", "cinfo", "*", "TypeInfo", ")", "(", "crv", ",", "irvSet", "reflect", ".", "Value", ")", "{", "// Construct new concrete type.", "if", "cinfo", ".", "PointerPreferred", "{", "cPtrRv", ":=", "reflect", ".", "New", "(", "cinfo", ".", "<mask>", ")", "\n", "crv", "=", "cPtrRv", ".", "Elem", "(", ")", "\n", "irvSet", "=", "cPtrRv", "\n", "}", "else", "{", "crv", "=", "reflect", ".", "New", "(", "cinfo", ".", "Type", ")", ".", "Elem", "(", ")", "\n", "irvSet", "=", "crv", "\n", "}", "\n", "return", "\n", "}" ]
15,687
all-15688
[ "GetUseUnderline", "is", "a", "wrapper", "around", "gtk_label_get_use_underline", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetUseUnderline", "(", ")", "bool", "{", "c", ":=", "C", ".", "gtk_label_get_use_underline", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "gobool", "(", "c", ")", "\n", "}" ]
15,688
all-15689
[ "return", "a", "compressed", "texture", "image" ]
[ "func", "GetCompressedTexImage", "(", "target", "uint32", ",", "<mask>", "int32", ",", "img", "unsafe", ".", "Pointer", ")", "{", "C", ".", "glowGetCompressedTexImage", "(", "gpGetCompressedTexImage", ",", "(", "C", ".", "GLenum", ")", "(", "target", ")", ",", "(", "C", ".", "GLint", ")", "(", "level", ")", ",", "img", ")", "\n", "}" ]
15,689
all-15690
[ "UnmarshalText", "hydrates", "this", "instance", "from", "text" ]
[ "func", "(", "u", "*", "UUID", ")", "UnmarshalText", "(", "data", "[", "]", "byte", ")", "error", "{", "// validation is performed later on", "*", "u", "=", "UUID", "(", "string", "(", "<mask>", ")", ")", "\n", "return", "nil", "\n", "}" ]
15,690
all-15691
[ "newWriter", "creates", "a", "new", "Writer", "." ]
[ "func", "newWriter", "(", "ctx", "context", ".", "Context", ",", "objC", "obj", ".", "Client", ",", "prefix", "string", ")", "*", "Writer", "{", "// Initialize buzhash64 with WindowSize window.", "hash", ":=", "buzhash64", ".", "New", "(", ")", "\n", "hash", ".", "Write", "(", "make", "(", "[", "]", "byte", ",", "WindowSize", ")", ")", "\n", "return", "&", "Writer", "{", "ctx", ":", "ctx", ",", "objC", ":", "objC", ",", "prefix", ":", "prefix", ",", "cbs", ":", "[", "]", "func", "(", "[", "]", "*", "DataRef", ")", "error", "{", "}", ",", "buf", ":", "&", "<mask>", ".", "Buffer", "{", "}", ",", "hash", ":", "hash", ",", "splitMask", ":", "(", "1", "<<", "uint64", "(", "AverageBits", ")", ")", "-", "1", ",", "}", "\n", "}" ]
15,691
all-15692
[ "NewMinioClientFromSecret", "constructs", "an", "s3", "compatible", "client", "by", "reading", "credentials", "from", "a", "mounted", "AmazonSecret", ".", "You", "may", "pass", "for", "bucket", "in", "which", "case", "it", "will", "read", "the", "bucket", "from", "the", "secret", "." ]
[ "func", "NewMinioClientFromSecret", "(", "bucket", "string", ")", "(", "Client", ",", "error", ")", "{", "var", "err", "error", "\n", "if", "bucket", "==", "\"", "\"", "{", "bucket", ",", "err", "=", "readSecretFile", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n", "endpoint", ",", "err", ":=", "readSecretFile", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "<mask>", ",", "err", ":=", "readSecretFile", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "secret", ",", "err", ":=", "readSecretFile", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "secure", ",", "err", ":=", "readSecretFile", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "isS3V2", ",", "err", ":=", "readSecretFile", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "NewMinioClient", "(", "endpoint", ",", "bucket", ",", "id", ",", "secret", ",", "secure", "==", "\"", "\"", ",", "isS3V2", "==", "\"", "\"", ")", "\n", "}" ]
15,692
all-15693
[ "GetVolumes", "returns", "the", "volumes", "mounted", "in", "a", "container" ]
[ "func", "(", "c", "*", "Container", ")", "GetVolumes", "(", ")", "[", "]", "types", ".", "MountPoint", "{", "c", ".", "lock", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "<mask>", ".", "RUnlock", "(", ")", "\n\n", "return", "c", ".", "VolumesUnsafe", "\n", "}" ]
15,693
all-15694
[ "Supported", "check", "if", "the", "given", "path", "supports", "project", "quotas" ]
[ "func", "Supported", "(", "<mask>", "string", ")", "(", "bool", ",", "error", ")", "{", "// Get the backing device", "devPath", ",", "err", ":=", "devForPath", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", "return", "false", ",", "err", "\n", "}", "\n\n", "// Call quotactl through CGo", "cDevPath", ":=", "C", ".", "CString", "(", "devPath", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cDevPath", ")", ")", "\n\n", "return", "C", ".", "quota_supported", "(", "cDevPath", ")", "==", "0", ",", "nil", "\n", "}" ]
15,694
all-15695
[ "Receive", "implements", "Reactor", "by", "handling", "incoming", "PEX", "messages", "." ]
[ "func", "(", "r", "*", "PEXReactor", ")", "Receive", "(", "chID", "byte", ",", "src", "*", "Peer", ",", "msgBytes", "[", "]", "byte", ")", "{", "srcAddr", ":=", "src", ".", "Connection", "(", ")", ".", "RemoteAddress", "\n", "srcAddrStr", ":=", "srcAddr", ".", "String", "(", ")", "\n\n", "r", ".", "IncrementMsgCountForPeer", "(", "srcAddrStr", ")", "\n", "if", "r", ".", "ReachedMaxMsgCountForPeer", "(", "srcAddrStr", ")", "{", "log", ".", "Warn", "(", "\"", "\"", ",", "\"", "\"", ",", "srcAddrStr", ")", "\n", "// TODO remove src from peers?", "return", "\n", "}", "\n\n", "_", ",", "msg", ",", "err", ":=", "DecodeMessage", "(", "msgBytes", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Warn", "(", "\"", "\"", ",", "\"", "\"", ",", "err", ")", "\n", "return", "\n", "}", "\n", "log", ".", "Notice", "(", "\"", "\"", ",", "\"", "\"", ",", "msg", ")", "\n\n", "switch", "msg", ":=", "msg", ".", "(", "type", ")", "{", "case", "*", "pexRequestMessage", ":", "// src requested some peers.", "r", ".", "SendAddrs", "(", "src", ",", "r", ".", "book", ".", "GetSelection", "(", ")", ")", "\n", "<mask>", "*", "pexAddrsMessage", ":", "// We received some peer addresses from src.", "// (We don't want to get spammed with bad peers)", "for", "_", ",", "addr", ":=", "range", "msg", ".", "Addrs", "{", "if", "addr", "!=", "nil", "{", "r", ".", "book", ".", "AddAddress", "(", "addr", ",", "srcAddr", ")", "\n", "}", "\n", "}", "\n", "default", ":", "log", ".", "Warn", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "reflect", ".", "TypeOf", "(", "msg", ")", ")", ")", "\n", "}", "\n", "}" ]
15,695
all-15696
[ "Build", "returns", "a", "ContextWithHeaders", "that", "can", "be", "used", "to", "make", "calls", "." ]
[ "func", "(", "cb", "*", "ContextBuilder", ")", "Build", "(", ")", "(", "ContextWithHeaders", ",", "context", ".", "CancelFunc", ")", "{", "params", ":=", "&", "tchannelCtxParams", "{", "options", ":", "cb", ".", "CallOptions", ",", "call", ":", "cb", ".", "incomingCall", ",", "retryOptions", ":", "cb", ".", "RetryOptions", ",", "connectTimeout", ":", "cb", ".", "ConnectTimeout", ",", "hideListeningOnOutbound", ":", "cb", ".", "hideListeningOnOutbound", ",", "tracingDisabled", ":", "cb", ".", "TracingDisabled", ",", "}", "\n\n", "parent", ":=", "cb", ".", "ParentContext", "\n", "if", "parent", "==", "nil", "{", "parent", "=", "context", ".", "Background", "(", ")", "\n", "}", "else", "if", "headerCtx", ",", "ok", ":=", "parent", ".", "(", "headerCtx", ")", ";", "ok", "{", "// Unwrap any headerCtx, since we'll be rewrapping anyway.", "parent", "=", "headerCtx", ".", "Context", "\n", "}", "\n\n", "var", "(", "ctx", "context", ".", "Context", "\n", "cancel", "context", ".", "CancelFunc", "\n", ")", "\n", "// All contexts created must have a timeout, but if the parent", "// already has a timeout, and the user has not specified one, then we", "// can use context.WithCancel", "_", ",", "parentHasDeadline", ":=", "parent", ".", "Deadline", "(", ")", "\n", "if", "cb", ".", "Timeout", "==", "0", "&&", "parentHasDeadline", "{", "ctx", ",", "cancel", "=", "context", ".", "WithCancel", "(", "parent", ")", "\n", "}", "else", "{", "ctx", ",", "cancel", "=", "<mask>", ".", "WithTimeout", "(", "parent", ",", "cb", ".", "Timeout", ")", "\n", "}", "\n\n", "ctx", "=", "context", ".", "WithValue", "(", "ctx", ",", "contextKeyTChannel", ",", "params", ")", "\n", "return", "WrapWithHeaders", "(", "ctx", ",", "cb", ".", "getHeaders", "(", ")", ")", ",", "cancel", "\n", "}" ]
15,696
all-15697
[ "GetPrinterLpi", "()", "is", "a", "wrapper", "around", "gtk_print_settings_get_printer_lpi", "()", "." ]
[ "func", "(", "<mask>", "*", "PrintSettings", ")", "GetPrinterLpi", "(", ")", "float64", "{", "c", ":=", "C", ".", "gtk_print_settings_get_printer_lpi", "(", "ps", ".", "native", "(", ")", ")", "\n", "return", "float64", "(", "c", ")", "\n", "}" ]
15,697
all-15698
[ "ExpvarHandler", "dumps", "json", "representation", "of", "expvars", "to", "http", "response", ".", "Expvars", "may", "be", "filtered", "by", "regexp", "provided", "via", "r", "query", "argument", ".", "See", "https", ":", "//", "golang", ".", "org", "/", "pkg", "/", "expvar", "/", "for", "details", "." ]
[ "func", "ExpvarHandler", "(", "ctx", "*", "fasthttp", ".", "RequestCtx", ")", "{", "expvarHandlerCalls", ".", "Add", "(", "1", ")", "\n\n", "ctx", ".", "Response", ".", "Reset", "(", ")", "\n\n", "r", ",", "err", ":=", "getExpvarRegexp", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", "{", "expvarRegexpErrors", ".", "Add", "(", "1", ")", "\n", "fmt", ".", "Fprintf", "(", "ctx", ",", "\"", "\"", ",", "err", ")", "\n", "ctx", ".", "SetStatusCode", "(", "fasthttp", ".", "StatusBadRequest", ")", "\n", "return", "\n", "}", "\n\n", "fmt", ".", "Fprintf", "(", "ctx", ",", "\"", "\\n", "\"", ")", "\n", "first", ":=", "true", "\n", "expvar", ".", "Do", "(", "func", "(", "kv", "expvar", ".", "KeyValue", ")", "{", "if", "r", ".", "MatchString", "(", "kv", ".", "<mask>", ")", "{", "if", "!", "first", "{", "fmt", ".", "Fprintf", "(", "ctx", ",", "\"", "\\n", "\"", ")", "\n", "}", "\n", "first", "=", "false", "\n", "fmt", ".", "Fprintf", "(", "ctx", ",", "\"", "\\t", "\"", ",", "kv", ".", "Key", ",", "kv", ".", "Value", ")", "\n", "}", "\n", "}", ")", "\n", "fmt", ".", "Fprintf", "(", "ctx", ",", "\"", "\\n", "\\n", "\"", ")", "\n\n", "ctx", ".", "SetContentType", "(", "\"", "\"", ")", "\n", "}" ]
15,698
all-15699
[ "Pretty", "formats", "a", "logrus", "entry", "like", "so", ":", "2019", "-", "02", "-", "11T16", ":", "02", ":", "02Z", "INFO", "pfs", ".", "API", ".", "InspectRepo", "{", "request", ":", "{", "repo", ":", "{", "name", ":", "images", "}}}", "[]" ]
[ "func", "Pretty", "(", "entry", "*", "logrus", ".", "Entry", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "serialized", ":=", "[", "]", "byte", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "entry", ".", "Time", ".", "Format", "(", "logrus", ".", "DefaultTimestampFormat", ")", ",", "strings", ".", "ToUpper", "(", "entry", ".", "Level", ".", "String", "(", ")", ")", ",", ")", ",", ")", "\n", "if", "entry", ".", "Data", "[", "\"", "\"", "]", "!=", "nil", "{", "serialized", "=", "append", "(", "serialized", ",", "[", "]", "byte", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "entry", ".", "Data", "[", "\"", "\"", "]", ",", "entry", ".", "Data", "[", "\"", "\"", "]", ")", ")", "...", ")", "\n", "}", "\n", "if", "len", "(", "entry", ".", "Data", ")", ">", "2", "{", "delete", "(", "entry", ".", "Data", ",", "\"", "\"", ")", "\n", "delete", "(", "entry", ".", "Data", ",", "\"", "\"", ")", "\n", "if", "entry", ".", "Data", "[", "\"", "\"", "]", "!=", "nil", "{", "entry", ".", "Data", "[", "\"", "\"", "]", "=", "entry", ".", "Data", "[", "\"", "\"", "]", ".", "(", "time", ".", "Duration", ")", ".", "Seconds", "(", ")", "\n", "}", "\n", "data", ",", "err", ":=", "json", ".", "Marshal", "(", "entry", ".", "Data", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "serialized", "=", "append", "(", "serialized", ",", "[", "]", "byte", "(", "string", "(", "data", ")", ")", "...", ")", "\n", "serialized", "=", "append", "(", "serialized", ",", "' '", ")", "\n", "}", "\n\n", "serialized", "=", "append", "(", "serialized", ",", "[", "]", "byte", "(", "<mask>", ".", "Message", ")", "...", ")", "\n", "serialized", "=", "append", "(", "serialized", ",", "'\\n'", ")", "\n", "return", "serialized", ",", "nil", "\n", "}" ]
15,699
all-15700
[ "WriteFromStreamingBytesClient", "writes", "from", "the", "StreamingBytesClient", "to", "the", "io", ".", "Writer", "." ]
[ "func", "WriteFromStreamingBytesClient", "(", "streamingBytesClient", "StreamingBytesClient", ",", "writer", "io", ".", "<mask>", ")", "error", "{", "for", "bytesValue", ",", "err", ":=", "streamingBytesClient", ".", "Recv", "(", ")", ";", "err", "!=", "io", ".", "EOF", ";", "bytesValue", ",", "err", "=", "streamingBytesClient", ".", "Recv", "(", ")", "{", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "_", ",", "err", "=", "writer", ".", "Write", "(", "bytesValue", ".", "Value", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]