id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
18,000
all-18001
[ "UnselectChild", "is", "a", "wrapper", "around", "gtk_flow_box_unselect_child", "()" ]
[ "func", "(", "fb", "*", "FlowBox", ")", "UnselectChild", "(", "child", "*", "FlowBoxChild", ")", "{", "C", ".", "gtk_flow_box_unselect_child", "(", "fb", ".", "native", "(", ")", ",", "<mask>", ".", "native", "(", ")", ")", "\n", "}" ]
18,001
all-18002
[ "loads", "TLS", "artifacts", "and", "builds", "tls", ".", "Clonfig", "object" ]
[ "func", "newTLSConfig", "(", "certPath", ",", "keyPath", ",", "caPath", ",", "serverName", "string", ",", "insecure", "bool", ")", "(", "*", "tls", ".", "Config", ",", "error", ")", "{", "if", "certPath", "!=", "\"", "\"", "&&", "keyPath", "==", "\"", "\"", "||", "certPath", "==", "\"", "\"", "&&", "keyPath", "!=", "\"", "\"", "{", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "var", "certificates", "[", "]", "tls", ".", "Certificate", "\n", "if", "certPath", "!=", "\"", "\"", "{", "cert", ",", "err", ":=", "tls", ".", "LoadX509KeyPair", "(", "certPath", ",", "keyPath", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "certificates", "=", "append", "(", "certificates", ",", "cert", ")", "\n", "}", "\n", "<mask>", ",", "err", ":=", "loadRoots", "(", "caPath", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "tls", ".", "Config", "{", "Certificates", ":", "certificates", ",", "RootCAs", ":", "roots", ",", "InsecureSkipVerify", ":", "insecure", ",", "ServerName", ":", "serverName", ",", "}", ",", "nil", "\n", "}" ]
18,002
all-18003
[ "Params", "returns", "a", "parameters", "expression", "with", "the", "given", "number", "of", "?", "placeholders", ".", "E", ".", "g", ".", "Params", "(", "2", ")", "-", ">", "(", "?", "?", ")", ".", "Useful", "for", "IN", "and", "VALUES", "expressions", "." ]
[ "func", "Params", "(", "n", "int", ")", "string", "{", "tokens", ":=", "<mask>", "(", "[", "]", "string", ",", "n", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "n", ";", "i", "++", "{", "tokens", "[", "i", "]", "=", "\"", "\"", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "strings", ".", "Join", "(", "tokens", ",", "\"", "\"", ")", ")", "\n", "}" ]
18,003
all-18004
[ "remove", "merged", "presets", "from", "a", "podspec" ]
[ "func", "undoPreset", "(", "preset", "*", "config", ".", "Preset", ",", "labels", "map", "[", "string", "]", "string", ",", "pod", "*", "coreapi", ".", "PodSpec", ")", "{", "// skip presets that do not match the job labels", "for", "l", ",", "v", ":=", "range", "preset", ".", "Labels", "{", "if", "v2", ",", "ok", ":=", "labels", "[", "l", "]", ";", "!", "ok", "||", "v2", "!=", "v", "{", "return", "\n", "}", "\n", "}", "\n\n", "// collect up preset created keys", "removeEnvNames", ":=", "sets", ".", "NewString", "(", ")", "\n", "for", "_", ",", "e1", ":=", "range", "preset", ".", "Env", "{", "removeEnvNames", ".", "Insert", "(", "e1", ".", "Name", ")", "\n", "}", "\n", "removeVolumeNames", ":=", "sets", ".", "NewString", "(", ")", "\n", "for", "_", ",", "volume", ":=", "range", "preset", ".", "Volumes", "{", "removeVolumeNames", ".", "Insert", "(", "volume", ".", "Name", ")", "\n", "}", "\n", "removeVolumeMountNames", ":=", "sets", ".", "NewString", "(", ")", "\n", "for", "_", ",", "volumeMount", ":=", "range", "preset", ".", "VolumeMounts", "{", "removeVolumeMountNames", ".", "Insert", "(", "volumeMount", ".", "Name", ")", "\n", "}", "\n\n", "// remove volumes from spec", "filteredVolumes", ":=", "[", "]", "coreapi", ".", "Volume", "{", "}", "\n", "for", "_", ",", "volume", ":=", "range", "pod", ".", "Volumes", "{", "if", "!", "removeVolumeNames", ".", "Has", "(", "volume", ".", "Name", ")", "{", "filteredVolumes", "=", "append", "(", "filteredVolumes", ",", "volume", ")", "\n", "}", "\n", "}", "\n", "pod", ".", "Volumes", "=", "filteredVolumes", "\n\n", "// remove env and volume mounts from containers", "for", "i", ":=", "range", "pod", ".", "Containers", "{", "filteredEnv", ":=", "[", "]", "coreapi", ".", "EnvVar", "{", "}", "\n", "for", "_", ",", "env", ":=", "<mask>", "pod", ".", "Containers", "[", "i", "]", ".", "Env", "{", "if", "!", "removeEnvNames", ".", "Has", "(", "env", ".", "Name", ")", "{", "filteredEnv", "=", "append", "(", "filteredEnv", ",", "env", ")", "\n", "}", "\n", "}", "\n", "pod", ".", "Containers", "[", "i", "]", ".", "Env", "=", "filteredEnv", "\n\n", "filteredVolumeMounts", ":=", "[", "]", "coreapi", ".", "VolumeMount", "{", "}", "\n", "for", "_", ",", "mount", ":=", "range", "pod", ".", "Containers", "[", "i", "]", ".", "VolumeMounts", "{", "if", "!", "removeVolumeMountNames", ".", "Has", "(", "mount", ".", "Name", ")", "{", "filteredVolumeMounts", "=", "append", "(", "filteredVolumeMounts", ",", "mount", ")", "\n", "}", "\n", "}", "\n", "pod", ".", "Containers", "[", "i", "]", ".", "VolumeMounts", "=", "filteredVolumeMounts", "\n", "}", "\n", "}" ]
18,004
all-18005
[ "configures", "element", "array", "buffer", "binding", "of", "a", "vertex", "array", "object" ]
[ "func", "VertexArrayElementBuffer", "(", "vaobj", "uint32", ",", "buffer", "uint32", ")", "{", "syscall", ".", "Syscall", "(", "gpVertexArrayElementBuffer", ",", "2", ",", "uintptr", "(", "vaobj", ")", ",", "uintptr", "(", "<mask>", ")", ",", "0", ")", "\n", "}" ]
18,005
all-18006
[ "PutFloat64Array", "writes", "a", "float", "array", "for", "the", "given", "field", ".", "The", "field", "type", "must", "be", "a", "Float64ArrayField", "otherwise", "as", "error", "will", "be", "returned", ".", "The", "type", "code", "is", "written", "first", "followed", "by", "the", "array", "size", "in", "bytes", ".", "If", "the", "size", "of", "the", "array", "is", "less", "than", "math", ".", "MaxUint8", "a", "byte", "will", "be", "used", "to", "represent", "the", "length", ".", "If", "the", "size", "of", "the", "array", "is", "less", "than", "math", ".", "MaxUint16", "a", "16", "-", "bit", "unsigned", "integer", "will", "be", "used", "to", "represent", "the", "length", "and", "so", "on", ".", "If", "the", "buffer", "is", "too", "small", "to", "store", "the", "entire", "array", "an", "xbinary", ".", "ErrOutOfRange", "error", "will", "be", "returned", ".", "If", "the", "write", "is", "successful", "the", "total", "number", "of", "bytes", "will", "be", "returned", "as", "well", "as", "a", "nil", "error", "." ]
[ "func", "(", "b", "*", "TupleBuilder", ")", "PutFloat64Array", "(", "field", "string", ",", "value", "[", "]", "float64", ")", "(", "wrote", "int", ",", "err", "error", ")", "{", "// field type should be", "if", "err", "=", "b", ".", "typeCheck", "(", "field", ",", "Float64ArrayField", ")", ";", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n\n", "size", ":=", "len", "(", "value", ")", "\n", "if", "size", "<", "math", ".", "MaxUint8", "{", "if", "b", ".", "available", "(", ")", "<", "size", "*", "8", "+", "2", "{", "return", "0", ",", "xbinary", ".", "ErrOutOfRange", "\n", "}", "\n\n", "// write length", "xbinary", ".", "LittleEndian", ".", "PutFloat64Array", "(", "b", ".", "buffer", ",", "b", ".", "pos", "+", "2", ",", "value", ")", "\n\n", "// write type code", "b", ".", "buffer", "[", "b", ".", "pos", "]", "=", "byte", "(", "DoubleArray8Code", ".", "OpCode", ")", "\n\n", "// write length", "b", ".", "buffer", "[", "b", ".", "pos", "+", "1", "]", "=", "byte", "(", "size", ")", "\n\n", "wrote", "+=", "<mask>", "+", "2", "\n", "}", "else", "if", "size", "<", "math", ".", "MaxUint16", "{", "if", "b", ".", "available", "(", ")", "<", "size", "*", "8", "+", "3", "{", "return", "0", ",", "xbinary", ".", "ErrOutOfRange", "\n", "}", "\n\n", "// write length", "xbinary", ".", "LittleEndian", ".", "PutUint16", "(", "b", ".", "buffer", ",", "b", ".", "pos", "+", "1", ",", "uint16", "(", "size", ")", ")", "\n\n", "// write value", "xbinary", ".", "LittleEndian", ".", "PutFloat64Array", "(", "b", ".", "buffer", ",", "b", ".", "pos", "+", "3", ",", "value", ")", "\n\n", "// write type code", "b", ".", "buffer", "[", "b", ".", "pos", "]", "=", "byte", "(", "DoubleArray16Code", ".", "OpCode", ")", "\n\n", "wrote", "+=", "3", "+", "size", "\n", "}", "else", "if", "size", "<", "math", ".", "MaxUint32", "{", "if", "b", ".", "available", "(", ")", "<", "size", "*", "8", "+", "5", "{", "return", "0", ",", "xbinary", ".", "ErrOutOfRange", "\n", "}", "\n\n", "// write length", "xbinary", ".", "LittleEndian", ".", "PutUint32", "(", "b", ".", "buffer", ",", "b", ".", "pos", "+", "1", ",", "uint32", "(", "size", ")", ")", "\n\n", "// write value", "xbinary", ".", "LittleEndian", ".", "PutFloat64Array", "(", "b", ".", "buffer", ",", "b", ".", "pos", "+", "5", ",", "value", ")", "\n\n", "// write type code", "b", ".", "buffer", "[", "b", ".", "pos", "]", "=", "byte", "(", "DoubleArray32Code", ".", "OpCode", ")", "\n\n", "wrote", "+=", "5", "+", "size", "\n", "}", "else", "{", "if", "b", ".", "available", "(", ")", "<", "size", "*", "8", "+", "9", "{", "return", "0", ",", "xbinary", ".", "ErrOutOfRange", "\n", "}", "\n\n", "// write length", "xbinary", ".", "LittleEndian", ".", "PutUint64", "(", "b", ".", "buffer", ",", "b", ".", "pos", "+", "1", ",", "uint64", "(", "size", ")", ")", "\n\n", "// write value", "xbinary", ".", "LittleEndian", ".", "PutFloat64Array", "(", "b", ".", "buffer", ",", "b", ".", "pos", "+", "9", ",", "value", ")", "\n\n", "// write type code", "b", ".", "buffer", "[", "b", ".", "pos", "]", "=", "byte", "(", "DoubleArray64Code", ".", "OpCode", ")", "\n\n", "wrote", "+=", "9", "+", "size", "\n", "}", "\n\n", "b", ".", "offsets", "[", "field", "]", "=", "b", ".", "pos", "\n", "b", ".", "pos", "+=", "wrote", "\n", "return", "\n", "}" ]
18,006
all-18007
[ "Decode", "parses", "a", "RDB", "file", "from", "r", "and", "calls", "the", "decode", "hooks", "on", "d", "." ]
[ "func", "Decode", "(", "r", "io", ".", "Reader", ",", "d", "Decoder", ")", "error", "{", "decoder", ":=", "&", "decode", "{", "d", ",", "make", "(", "[", "]", "<mask>", ",", "8", ")", ",", "bufio", ".", "NewReader", "(", "r", ")", "}", "\n", "return", "decoder", ".", "decode", "(", ")", "\n", "}" ]
18,007
all-18008
[ "same", "with", "Info", "()" ]
[ "func", "(", "f", "*", "FileLogger", ")", "I", "(", "<mask>", "string", ",", "v", "...", "interface", "{", "}", ")", "{", "f", ".", "Info", "(", "format", ",", "v", "...", ")", "\n", "}" ]
18,008
all-18009
[ "GetIconWidget", "is", "a", "wrapper", "around", "gtk_tool_button_get_icon_widget", "()", "." ]
[ "func", "(", "v", "*", "ToolButton", ")", "GetIconWidget", "(", ")", "*", "Widget", "{", "c", ":=", "C", ".", "gtk_tool_button_get_icon_widget", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "<mask>", "wrapWidget", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", "\n", "}" ]
18,009
all-18010
[ "GetUfloatOrZero", "returns", "ufloat", "value", "for", "the", "given", "key", ".", "Zero", "(", "0", ")", "is", "returned", "on", "error", "." ]
[ "func", "(", "a", "*", "Args", ")", "GetUfloatOrZero", "(", "key", "string", ")", "float64", "{", "f", ",", "err", ":=", "a", ".", "GetUfloat", "(", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "f", "=", "0", "\n", "}", "\n", "return", "f", "\n", "}" ]
18,010
all-18011
[ "GetPullRequestChanges", "gets", "a", "list", "of", "files", "modified", "in", "a", "pull", "request", ".", "See", "https", ":", "//", "developer", ".", "github", ".", "com", "/", "v3", "/", "pulls", "/", "#list", "-", "pull", "-", "requests", "-", "files" ]
[ "func", "(", "c", "*", "Client", ")", "GetPullRequestChanges", "(", "org", ",", "repo", "string", ",", "number", "int", ")", "(", "[", "]", "PullRequestChange", ",", "error", ")", "{", "c", ".", "log", "(", "\"", "\"", ",", "org", ",", "repo", ",", "number", ")", "\n", "if", "c", ".", "fake", "{", "return", "[", "]", "PullRequestChange", "{", "}", ",", "nil", "\n", "}", "\n", "<mask>", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "org", ",", "repo", ",", "number", ")", "\n", "var", "changes", "[", "]", "PullRequestChange", "\n", "err", ":=", "c", ".", "readPaginatedResults", "(", "path", ",", "acceptNone", ",", "func", "(", ")", "interface", "{", "}", "{", "return", "&", "[", "]", "PullRequestChange", "{", "}", "\n", "}", ",", "func", "(", "obj", "interface", "{", "}", ")", "{", "changes", "=", "append", "(", "changes", ",", "*", "(", "obj", ".", "(", "*", "[", "]", "PullRequestChange", ")", ")", "...", ")", "\n", "}", ",", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "changes", ",", "nil", "\n", "}" ]
18,011
all-18012
[ "checkPostResponse", "checks", "the", "response", "of", "the", "HTTP", "POST", "request", "that", "sends", "raft", "message", "." ]
[ "func", "checkPostResponse", "(", "resp", "*", "http", ".", "Response", ",", "<mask>", "[", "]", "byte", ",", "req", "*", "http", ".", "Request", ",", "to", "types", ".", "ID", ")", "error", "{", "switch", "resp", ".", "StatusCode", "{", "case", "http", ".", "StatusPreconditionFailed", ":", "switch", "strings", ".", "TrimSuffix", "(", "string", "(", "body", ")", ",", "\"", "\\n", "\"", ")", "{", "case", "errIncompatibleVersion", ".", "Error", "(", ")", ":", "plog", ".", "Errorf", "(", "\"", "\"", ",", "to", ")", "\n", "return", "errIncompatibleVersion", "\n", "case", "errClusterIDMismatch", ".", "Error", "(", ")", ":", "plog", ".", "Errorf", "(", "\"", "\"", ",", "to", ",", "resp", ".", "Header", ".", "Get", "(", "\"", "\"", ")", ",", "req", ".", "Header", ".", "Get", "(", "\"", "\"", ")", ")", "\n", "return", "errClusterIDMismatch", "\n", "default", ":", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "string", "(", "body", ")", ")", "\n", "}", "\n", "case", "http", ".", "StatusForbidden", ":", "return", "errMemberRemoved", "\n", "case", "http", ".", "StatusNoContent", ":", "return", "nil", "\n", "default", ":", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "http", ".", "StatusText", "(", "resp", ".", "StatusCode", ")", ",", "req", ".", "URL", ".", "String", "(", ")", ")", "\n", "}", "\n", "}" ]
18,012
all-18013
[ "SetOn", "sets", "tracing", "methods", "output", "active", "or", "inactive", "." ]
[ "func", "SetOn", "(", "<mask>", "bool", ")", "{", "tracer", ".", "mu", ".", "Lock", "(", ")", "\n", "tracer", ".", "on", "=", "on", "\n", "tracer", ".", "mu", ".", "Unlock", "(", ")", "\n", "}" ]
18,013
all-18014
[ "NewClientInCluster", "creates", "a", "Client", "that", "works", "from", "within", "a", "pod", "." ]
[ "func", "NewClientInCluster", "(", "namespace", "string", ")", "(", "*", "Client", ",", "error", ")", "{", "tokenFile", ":=", "\"", "\"", "\n", "token", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "tokenFile", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "rootCAFile", ":=", "\"", "\"", "\n", "certData", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "rootCAFile", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "cp", ":=", "x509", ".", "NewCertPool", "(", ")", "\n", "cp", ".", "AppendCertsFromPEM", "(", "certData", ")", "\n\n", "tr", ":=", "&", "http", ".", "Transport", "{", "TLSClientConfig", ":", "&", "tls", ".", "Config", "{", "MinVersion", ":", "tls", ".", "VersionTLS12", ",", "RootCAs", ":", "cp", ",", "}", ",", "}", "\n", "return", "&", "Client", "{", "logger", ":", "logrus", ".", "WithField", "(", "\"", "\"", ",", "\"", "\"", ")", ",", "baseURL", ":", "inClusterBaseURL", ",", "client", ":", "&", "http", ".", "Client", "{", "Transport", ":", "tr", ",", "Timeout", ":", "requestTimeout", "}", ",", "token", ":", "string", "(", "<mask>", ")", ",", "namespace", ":", "namespace", ",", "}", ",", "nil", "\n", "}" ]
18,014
all-18015
[ "DefaultConfig", "provides", "a", "default", "configuration", "to", "create", "a", "certificate", "signer", "." ]
[ "func", "DefaultConfig", "(", ")", "Config", "{", "newClientConfig", ":=", "vaultclient", ".", "DefaultConfig", "(", ")", "\n", "newClientConfig", ".", "<mask>", "=", "\"", "\"", "\n", "newVaultClient", ",", "err", ":=", "vaultclient", ".", "NewClient", "(", "newClientConfig", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ")", "\n", "}", "\n\n", "newConfig", ":=", "Config", "{", "// Dependencies.", "VaultClient", ":", "newVaultClient", ",", "}", "\n\n", "return", "newConfig", "\n", "}" ]
18,015
all-18016
[ "GetLineAtY", "is", "a", "wrapper", "around", "gtk_text_view_get_line_at_y", "()", "." ]
[ "func", "(", "v", "*", "TextView", ")", "GetLineAtY", "(", "y", "int", ")", "(", "*", "TextIter", ",", "int", ")", "{", "<mask>", "iter", "TextIter", "\n", "var", "line_top", "C", ".", "gint", "\n", "iiter", ":=", "(", "C", ".", "GtkTextIter", ")", "(", "iter", ")", "\n", "C", ".", "gtk_text_view_get_line_at_y", "(", "v", ".", "native", "(", ")", ",", "&", "iiter", ",", "C", ".", "gint", "(", "y", ")", ",", "&", "line_top", ")", "\n", "return", "&", "iter", ",", "int", "(", "line_top", ")", "\n", "}" ]
18,016
all-18017
[ "Records", "returns", "list", "of", "all", "endpoints", "." ]
[ "func", "(", "p", "*", "AWSSDProvider", ")", "Records", "(", ")", "(", "endpoints", "[", "]", "*", "endpoint", ".", "Endpoint", ",", "err", "error", ")", "{", "namespaces", ",", "err", ":=", "p", ".", "ListNamespaces", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "for", "_", ",", "ns", ":=", "range", "namespaces", "{", "services", ",", "err", ":=", "p", ".", "ListServicesByNamespaceID", "(", "ns", ".", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "for", "_", ",", "srv", ":=", "range", "services", "{", "instances", ",", "err", ":=", "p", ".", "ListInstancesByServiceID", "(", "srv", ".", "Id", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "len", "(", "instances", ")", ">", "0", "{", "ep", ":=", "p", ".", "instancesToEndpoint", "(", "ns", ",", "srv", ",", "instances", ")", "\n", "endpoints", "=", "append", "(", "endpoints", ",", "ep", ")", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "endpoints", ",", "nil", "\n", "}" ]
18,017
all-18018
[ "ACTOR", "client", "API", "Synchronous", "." ]
[ "func", "(", "peer", "*", "localPeer", ")", "doAddConnection", "(", "conn", "ourConnection", ",", "isRestartedPeer", "bool", ")", "error", "{", "resultChan", ":=", "make", "(", "chan", "error", ")", "\n", "<mask>", ".", "actionChan", "<-", "func", "(", ")", "{", "resultChan", "<-", "peer", ".", "handleAddConnection", "(", "conn", ",", "isRestartedPeer", ")", "\n", "}", "\n", "return", "<-", "resultChan", "\n", "}" ]
18,018
all-18019
[ "GetDayIsMarked", "is", "a", "wrapper", "around", "gtk_calendar_get_day_is_marked", "()", "." ]
[ "func", "(", "v", "*", "Calendar", ")", "GetDayIsMarked", "(", "<mask>", "uint", ")", "bool", "{", "c", ":=", "C", ".", "gtk_calendar_get_day_is_marked", "(", "v", ".", "native", "(", ")", ",", "C", ".", "guint", "(", "day", ")", ")", "\n", "return", "gobool", "(", "c", ")", "\n", "}" ]
18,019
all-18020
[ "split", "breaks", "a", "list", "in", "half", "." ]
[ "func", "split", "(", "head", "*", "llNode", ")", "(", "left", ",", "right", "*", "llNode", ")", "{", "left", "=", "head", "\n", "if", "head", "==", "nil", "||", "head", ".", "next", "==", "nil", "{", "return", "\n", "}", "\n", "right", "=", "head", "\n", "sprinter", ":=", "head", "\n", "prev", ":=", "head", "\n", "for", "sprinter", "!=", "nil", "&&", "sprinter", ".", "next", "!=", "nil", "{", "prev", "=", "right", "\n", "right", "=", "right", ".", "next", "\n", "sprinter", "=", "sprinter", ".", "<mask>", ".", "next", "\n", "}", "\n", "prev", ".", "next", "=", "nil", "\n", "return", "\n", "}" ]
18,020
all-18021
[ "CreateDirAll", "is", "similar", "to", "TouchDirAll", "but", "returns", "error", "if", "the", "deepest", "directory", "was", "not", "empty", "." ]
[ "func", "CreateDirAll", "(", "dir", "string", ")", "error", "{", "err", ":=", "TouchDirAll", "(", "dir", ")", "\n", "if", "err", "==", "nil", "{", "var", "<mask>", "[", "]", "string", "\n", "ns", ",", "err", "=", "ReadDir", "(", "dir", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "len", "(", "ns", ")", "!=", "0", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "dir", ",", "ns", ")", "\n", "}", "\n", "}", "\n", "return", "err", "\n", "}" ]
18,021
all-18022
[ "CanAuthenticate", "makes", "a", "test", "request", "to", "CM", "1", ".", "5", "and", "returns", "nil", "if", "it", "is", "successful", "." ]
[ "func", "(", "a", "*", "rl10Authenticator", ")", "CanAuthenticate", "(", "host", "string", ")", "error", "{", "client", ":=", "httpclient", ".", "New", "(", ")", "\n", "return", "testAuth", "(", "a", ",", "client", ",", "<mask>", ",", "true", ")", "\n", "}" ]
18,022
all-18023
[ "NewContext", "returns", "a", "copy", "of", "parent", "that", "will", "cause", "App", "Engine", "API", "calls", "to", "be", "sent", "to", "the", "client", "s", "remote", "host", "." ]
[ "func", "(", "c", "*", "Client", ")", "NewContext", "(", "parent", "<mask>", ".", "Context", ")", "context", ".", "Context", "{", "ctx", ":=", "internal", ".", "WithCallOverride", "(", "parent", ",", "c", ".", "call", ")", "\n", "ctx", "=", "internal", ".", "WithLogOverride", "(", "ctx", ",", "c", ".", "logf", ")", "\n", "ctx", "=", "internal", ".", "WithAppIDOverride", "(", "ctx", ",", "c", ".", "appID", ")", "\n", "return", "ctx", "\n", "}" ]
18,023
all-18024
[ "New", "generator", "for", "building", "a", "Buffalo", "application", "This", "powers", "the", "buffalo", "build", "command", "and", "can", "be", "used", "to", "programatically", "build", "/", "compile", "Buffalo", "applications", "." ]
[ "func", "New", "(", "opts", "*", "Options", ")", "(", "*", "genny", ".", "Generator", ",", "error", ")", "{", "g", ":=", "genny", ".", "New", "(", ")", "\n\n", "if", "err", ":=", "opts", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "g", ",", "err", "\n", "}", "\n", "g", ".", "ErrorFn", "=", "func", "(", "err", "error", ")", "{", "events", ".", "EmitError", "(", "EvtBuildStopErr", ",", "err", ",", "events", ".", "Payload", "{", "\"", "\"", ":", "opts", "}", ")", "\n", "}", "\n\n", "g", ".", "RunFn", "(", "func", "(", "r", "*", "genny", ".", "Runner", ")", "error", "{", "<mask>", ".", "EmitPayload", "(", "EvtBuildStart", ",", "events", ".", "Payload", "{", "\"", "\"", ":", "opts", "}", ")", "\n", "return", "nil", "\n", "}", ")", "\n\n", "g", ".", "Transformer", "(", "genny", ".", "Dot", "(", ")", ")", "\n\n", "// validate templates", "g", ".", "RunFn", "(", "ValidateTemplates", "(", "templateWalker", "(", "opts", ".", "App", ")", ",", "opts", ".", "TemplateValidators", ")", ")", "\n\n", "// rename main() to originalMain()", "g", ".", "RunFn", "(", "transformMain", "(", "opts", ")", ")", "\n\n", "// add any necessary templates for the build", "box", ":=", "packr", ".", "New", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "if", "err", ":=", "g", ".", "Box", "(", "box", ")", ";", "err", "!=", "nil", "{", "return", "g", ",", "err", "\n", "}", "\n\n", "// configure plush", "ctx", ":=", "plush", ".", "NewContext", "(", ")", "\n", "ctx", ".", "Set", "(", "\"", "\"", ",", "opts", ")", "\n", "ctx", ".", "Set", "(", "\"", "\"", ",", "opts", ".", "BuildTime", ".", "Format", "(", "time", ".", "RFC3339", ")", ")", "\n", "ctx", ".", "Set", "(", "\"", "\"", ",", "opts", ".", "BuildVersion", ")", "\n", "ctx", ".", "Set", "(", "\"", "\"", ",", "runtime", ".", "Version", ")", "\n", "g", ".", "Transformer", "(", "plushgen", ".", "Transformer", "(", "ctx", ")", ")", "\n\n", "// create the ./a pkg", "ag", ",", "err", ":=", "apkg", "(", "opts", ")", "\n", "if", "err", "!=", "nil", "{", "return", "g", ",", "err", "\n", "}", "\n", "g", ".", "Merge", "(", "ag", ")", "\n\n", "if", "opts", ".", "WithAssets", "{", "// mount the assets generator", "ag", ",", "err", ":=", "assets", "(", "opts", ")", "\n", "if", "err", "!=", "nil", "{", "return", "g", ",", "err", "\n", "}", "\n", "g", ".", "Merge", "(", "ag", ")", "\n", "}", "\n\n", "// mount the build time dependency generator", "dg", ",", "err", ":=", "buildDeps", "(", "opts", ")", "\n", "if", "err", "!=", "nil", "{", "return", "g", ",", "err", "\n", "}", "\n", "g", ".", "Merge", "(", "dg", ")", "\n\n", "g", ".", "RunFn", "(", "func", "(", "r", "*", "genny", ".", "Runner", ")", "error", "{", "return", "jam", ".", "Pack", "(", "jam", ".", "PackOptions", "{", "}", ")", "\n", "}", ")", "\n\n", "// create the final go build command", "c", ",", "err", ":=", "buildCmd", "(", "opts", ")", "\n", "if", "err", "!=", "nil", "{", "return", "g", ",", "err", "\n", "}", "\n", "g", ".", "Command", "(", "c", ")", "\n\n", "g", ".", "RunFn", "(", "Cleanup", "(", "opts", ")", ")", "\n\n", "g", ".", "RunFn", "(", "func", "(", "r", "*", "genny", ".", "Runner", ")", "error", "{", "events", ".", "EmitPayload", "(", "EvtBuildStop", ",", "events", ".", "Payload", "{", "\"", "\"", ":", "opts", "}", ")", "\n", "return", "nil", "\n", "}", ")", "\n", "return", "g", ",", "nil", "\n", "}" ]
18,024
all-18025
[ "updateAppliedStatusUnsafe", "updates", "the", "resource", "transitioning", "status" ]
[ "func", "(", "secret", "*", "SSMSecretResource", ")", "updateAppliedStatusUnsafe", "(", "knownStatus", "resourcestatus", ".", "ResourceStatus", ")", "{", "if", "<mask>", ".", "appliedStatus", "==", "resourcestatus", ".", "ResourceStatus", "(", "SSMSecretStatusNone", ")", "{", "return", "\n", "}", "\n\n", "// Check if the resource transition has already finished", "if", "secret", ".", "appliedStatus", "<=", "knownStatus", "{", "secret", ".", "appliedStatus", "=", "resourcestatus", ".", "ResourceStatus", "(", "SSMSecretStatusNone", ")", "\n", "}", "\n", "}" ]
18,025
all-18026
[ "Subscribe", "adds", "new", "receiver", "of", "events", "for", "given", "channel", "." ]
[ "func", "(", "hub", "*", "hub", ")", "Subscribe", "(", "channels", "[", "]", "string", ")", "(", "Channel", ",", "error", ")", "{", "var", "chans", "[", "]", "*", "channel", "\n", "for", "_", ",", "name", ":=", "<mask>", "channels", "{", "chans", "=", "append", "(", "chans", ",", "hub", ".", "getChannel", "(", "name", ")", ")", "\n", "}", "\n", "var", "sub", "=", "makeSub", "(", "chans", ")", "\n", "for", "_", ",", "cn", ":=", "range", "chans", "{", "cn", ".", "Subscribe", "(", "sub", ")", "\n", "}", "\n", "return", "sub", ",", "nil", "\n", "}" ]
18,026
all-18027
[ "ReviewEventHandlers", "returns", "a", "map", "of", "plugin", "names", "to", "handlers", "for", "the", "repo", "." ]
[ "func", "(", "<mask>", "*", "ConfigAgent", ")", "ReviewEventHandlers", "(", "owner", ",", "repo", "string", ")", "map", "[", "string", "]", "ReviewEventHandler", "{", "pa", ".", "mut", ".", "Lock", "(", ")", "\n", "defer", "pa", ".", "mut", ".", "Unlock", "(", ")", "\n\n", "hs", ":=", "map", "[", "string", "]", "ReviewEventHandler", "{", "}", "\n", "for", "_", ",", "p", ":=", "range", "pa", ".", "getPlugins", "(", "owner", ",", "repo", ")", "{", "if", "h", ",", "ok", ":=", "reviewEventHandlers", "[", "p", "]", ";", "ok", "{", "hs", "[", "p", "]", "=", "h", "\n", "}", "\n", "}", "\n\n", "return", "hs", "\n", "}" ]
18,027
all-18028
[ "Backup", "is", "a", "wrapper", "function", "over", "Stream", ".", "Backup", "to", "generate", "full", "and", "incremental", "backups", "of", "the", "DB", ".", "For", "more", "control", "over", "how", "many", "goroutines", "are", "used", "to", "generate", "the", "backup", "or", "if", "you", "wish", "to", "backup", "only", "a", "certain", "range", "of", "keys", "use", "Stream", ".", "Backup", "directly", "." ]
[ "func", "(", "db", "*", "DB", ")", "Backup", "(", "w", "io", ".", "Writer", ",", "since", "uint64", ")", "(", "uint64", ",", "error", ")", "{", "stream", ":=", "db", ".", "NewStream", "(", ")", "\n", "stream", ".", "LogPrefix", "=", "\"", "\"", "\n", "return", "<mask>", ".", "Backup", "(", "w", ",", "since", ")", "\n", "}" ]
18,028
all-18029
[ "GetWidthChars", "is", "a", "wrapper", "around", "gtk_label_get_width_chars", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetWidthChars", "(", ")", "int", "{", "c", ":=", "C", ".", "gtk_label_get_width_chars", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "int", "(", "c", ")", "\n", "}" ]
18,029
all-18030
[ "FetchBroker", "retrieves", "broker", "with", "passed", "cid", "." ]
[ "func", "(", "a", "*", "API", ")", "FetchBroker", "(", "cid", "CIDType", ")", "(", "*", "Broker", ",", "error", ")", "{", "if", "cid", "==", "nil", "||", "*", "cid", "==", "\"", "\"", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "brokerCID", ":=", "string", "(", "*", "cid", ")", "\n\n", "matched", ",", "err", ":=", "regexp", ".", "MatchString", "(", "config", ".", "BrokerCIDRegex", ",", "brokerCID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "!", "matched", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "brokerCID", ")", "\n", "}", "\n\n", "result", ",", "err", ":=", "a", ".", "Get", "(", "brokerCID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "a", ".", "Debug", "{", "a", ".", "Log", ".", "Printf", "(", "\"", "\"", ",", "string", "(", "result", ")", ")", "\n", "}", "\n\n", "response", ":=", "new", "(", "Broker", ")", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "result", ",", "&", "response", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "<mask>", ",", "nil", "\n\n", "}" ]
18,030
all-18031
[ "DirBlacklist", "returns", "regular", "expressions", "matching", "directories", "to", "ignore", "when", "searching", "for", "OWNERS", "{", "_ALIAS", "}", "files", "in", "a", "repo", "." ]
[ "func", "(", "ownersDirBlacklist", "OwnersDirBlacklist", ")", "DirBlacklist", "(", "org", ",", "repo", "string", ")", "(", "blacklist", "[", "]", "string", ")", "{", "blacklist", "=", "append", "(", "blacklist", ",", "ownersDirBlacklist", ".", "Default", "...", ")", "\n", "if", "bl", ",", "<mask>", ":=", "ownersDirBlacklist", ".", "Repos", "[", "org", "]", ";", "ok", "{", "blacklist", "=", "append", "(", "blacklist", ",", "bl", "...", ")", "\n", "}", "\n", "if", "bl", ",", "ok", ":=", "ownersDirBlacklist", ".", "Repos", "[", "org", "+", "\"", "\"", "+", "repo", "]", ";", "ok", "{", "blacklist", "=", "append", "(", "blacklist", ",", "bl", "...", ")", "\n", "}", "\n", "return", "\n", "}" ]
18,031
all-18032
[ "WithSize", "maximum", "number", "of", "bytes", "to", "read", "(", "left", "upon", "the", "agent", "discretion", "if", "not", "specified", ")", "." ]
[ "func", "(", "p", "ReadParams", ")", "WithSize", "(", "<mask>", "int64", ")", "*", "ReadParams", "{", "p", ".", "Size", "=", "size", "\n", "return", "&", "p", "\n", "}" ]
18,032
all-18033
[ "ReturnWriter", "returns", "a", "flate", ".", "Writer", "to", "the", "pool", "that", "can", "late", "be", "reused", "via", "GetWriter", ".", "Don", "t", "close", "the", "writer", "Flush", "will", "be", "called", "before", "returning", "it", "to", "the", "pool", "." ]
[ "func", "(", "pool", "*", "DeflatePool", ")", "ReturnWriter", "(", "writer", "*", "flate", ".", "Writer", ")", "{", "writer", ".", "Close", "(", ")", "\n", "pool", ".", "pool", ".", "Put", "(", "<mask>", ")", "\n", "}" ]
18,033
all-18034
[ "setupUser", "changes", "the", "groups", "gid", "and", "uid", "for", "the", "user", "inside", "the", "container" ]
[ "func", "setupUser", "(", "config", "*", "initConfig", ")", "error", "{", "// Set up defaults.", "defaultExecUser", ":=", "user", ".", "ExecUser", "{", "Uid", ":", "syscall", ".", "Getuid", "(", ")", ",", "Gid", ":", "syscall", ".", "Getgid", "(", ")", ",", "Home", ":", "\"", "\"", ",", "}", "\n", "passwdPath", ",", "err", ":=", "user", ".", "GetPasswdPath", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "groupPath", ",", "err", ":=", "user", ".", "GetGroupPath", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "execUser", ",", "err", ":=", "user", ".", "GetExecUserPath", "(", "config", ".", "User", ",", "&", "defaultExecUser", ",", "passwdPath", ",", "groupPath", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "var", "addGroups", "[", "]", "int", "\n", "if", "len", "(", "config", ".", "Config", ".", "AdditionalGroups", ")", ">", "0", "{", "addGroups", ",", "err", "=", "user", ".", "GetAdditionalGroupsPath", "(", "config", ".", "Config", ".", "AdditionalGroups", ",", "groupPath", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n\n", "suppGroups", ":=", "append", "(", "execUser", ".", "Sgids", ",", "addGroups", "...", ")", "\n", "if", "err", ":=", "syscall", ".", "Setgroups", "(", "suppGroups", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "err", ":=", "system", ".", "Setgid", "(", "execUser", ".", "Gid", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "err", ":=", "<mask>", ".", "Setuid", "(", "execUser", ".", "Uid", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "// if we didn't get HOME already, set it based on the user's HOME", "if", "envHome", ":=", "os", ".", "Getenv", "(", "\"", "\"", ")", ";", "envHome", "==", "\"", "\"", "{", "if", "err", ":=", "os", ".", "Setenv", "(", "\"", "\"", ",", "execUser", ".", "Home", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
18,034
all-18035
[ "GetIncludeNoMetricHosts", "returns", "the", "IncludeNoMetricHosts", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "g", "*", "GraphDefinition", ")", "GetIncludeNoMetricHosts", "(", ")", "bool", "{", "if", "g", "==", "nil", "||", "g", ".", "IncludeNoMetricHosts", "==", "nil", "{", "return", "<mask>", "\n", "}", "\n", "return", "*", "g", ".", "IncludeNoMetricHosts", "\n", "}" ]
18,035
all-18036
[ "Profile", "writes", "a", "pprof", "profile", "for", "pachd", "to", "w", "." ]
[ "func", "(", "c", "APIClient", ")", "Profile", "(", "profile", "string", ",", "duration", "time", ".", "Duration", ",", "w", "io", ".", "<mask>", ")", "error", "{", "var", "d", "*", "types", ".", "Duration", "\n", "if", "duration", "!=", "0", "{", "d", "=", "types", ".", "DurationProto", "(", "duration", ")", "\n", "}", "\n", "profileClient", ",", "err", ":=", "c", ".", "DebugClient", ".", "Profile", "(", "c", ".", "Ctx", "(", ")", ",", "&", "debug", ".", "ProfileRequest", "{", "Profile", ":", "profile", ",", "Duration", ":", "d", ",", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "grpcutil", ".", "ScrubGRPC", "(", "err", ")", "\n", "}", "\n", "return", "grpcutil", ".", "ScrubGRPC", "(", "grpcutil", ".", "WriteFromStreamingBytesClient", "(", "profileClient", ",", "w", ")", ")", "\n", "}" ]
18,036
all-18037
[ "GetAlignment", "()", "is", "a", "wrapper", "around", "gtk_entry_get_alignment", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetAlignment", "(", ")", "float32", "{", "c", ":=", "C", ".", "gtk_entry_get_alignment", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "float32", "(", "c", ")", "\n", "}" ]
18,037
all-18038
[ "String", "implements", "flag", ".", "Value", "interface", "." ]
[ "func", "(", "us", "*", "UniqueURLs", ")", "String", "(", ")", "string", "{", "all", ":=", "<mask>", "(", "[", "]", "string", ",", "0", ",", "len", "(", "us", ".", "Values", ")", ")", "\n", "for", "u", ":=", "range", "us", ".", "Values", "{", "all", "=", "append", "(", "all", ",", "u", ")", "\n", "}", "\n", "sort", ".", "Strings", "(", "all", ")", "\n", "return", "strings", ".", "Join", "(", "all", ",", "\"", "\"", ")", "\n", "}" ]
18,038
all-18039
[ "GetSecretValueWithContext", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "GetSecretValueWithContext", "(", "arg0", "aws", ".", "Context", ",", "arg1", "*", "secretsmanager", ".", "GetSecretValueInput", ",", "arg2", "...", "<mask>", ".", "Option", ")", "(", "*", "secretsmanager", ".", "GetSecretValueOutput", ",", "error", ")", "{", "varargs", ":=", "[", "]", "interface", "{", "}", "{", "arg0", ",", "arg1", "}", "\n", "for", "_", ",", "a", ":=", "range", "arg2", "{", "varargs", "=", "append", "(", "varargs", ",", "a", ")", "\n", "}", "\n", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "varargs", "...", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "*", "secretsmanager", ".", "GetSecretValueOutput", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "error", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
18,039
all-18040
[ "CreateDashboardList", "returns", "a", "single", "dashboard", "list", "created", "on", "this", "account", "." ]
[ "func", "(", "client", "*", "Client", ")", "CreateDashboardList", "(", "<mask>", "*", "DashboardList", ")", "(", "*", "DashboardList", ",", "error", ")", "{", "var", "out", "DashboardList", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "list", ",", "&", "out", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "out", ",", "nil", "\n", "}" ]
18,040
all-18041
[ "WrapListener", "wraps", "an", "*", "http", ".", "Server", "and", "a", "net", ".", "Listener" ]
[ "func", "WrapListener", "(", "s", "*", "http", ".", "Server", ",", "l", "<mask>", ".", "Listener", ")", "Server", "{", "return", "&", "Listener", "{", "Server", ":", "s", ",", "Listener", ":", "l", ",", "}", "\n", "}" ]
18,041
all-18042
[ "Stop", "issues", "a", "power", "off", "for", "the", "virtual", "machine", "instance", "." ]
[ "func", "(", "d", "*", "Driver", ")", "Stop", "(", ")", "error", "{", "if", "err", ":=", "d", ".", "checkLegacyDriver", "(", "true", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "c", ",", "err", ":=", "d", ".", "newAzureClient", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "<mask>", ".", "Info", "(", "\"", "\"", ")", "\n", "log", ".", "Info", "(", "\"", "\"", ")", "\n", "return", "c", ".", "StopVirtualMachine", "(", "d", ".", "ResourceGroup", ",", "d", ".", "naming", "(", ")", ".", "VM", "(", ")", ")", "\n", "}" ]
18,042
all-18043
[ "HighlightRect", "highlights", "given", "rectangle", ".", "Coordinates", "are", "absolute", "with", "respect", "to", "the", "main", "frame", "viewport", ".", "See", ":", "https", ":", "//", "chromedevtools", ".", "github", ".", "io", "/", "devtools", "-", "protocol", "/", "tot", "/", "Overlay#method", "-", "highlightRect", "parameters", ":", "x", "-", "X", "coordinate", "y", "-", "Y", "coordinate", "width", "-", "Rectangle", "width", "height", "-", "Rectangle", "height" ]
[ "func", "HighlightRect", "(", "x", "int64", ",", "y", "int64", ",", "width", "int64", ",", "height", "int64", ")", "*", "HighlightRectParams", "{", "return", "&", "HighlightRectParams", "{", "X", ":", "x", ",", "Y", ":", "y", ",", "Width", ":", "<mask>", ",", "Height", ":", "height", ",", "}", "\n", "}" ]
18,043
all-18044
[ "Compact", "forces", "compaction", "of", "objects", "." ]
[ "func", "(", "c", "APIClient", ")", "Compact", "(", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "ObjectAPIClient", ".", "Compact", "(", "c", ".", "Ctx", "(", ")", ",", "&", "<mask>", ".", "Empty", "{", "}", ",", ")", "\n", "return", "err", "\n", "}" ]
18,044
all-18045
[ "Handle", "writes", "message", "from", "log", "record", "into", "file", "." ]
[ "func", "(", "handler", "*", "FileHandler", ")", "Handle", "(", "record", "*", "Record", ")", "error", "{", "handler", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "handler", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "msg", ":=", "handler", ".", "Formatter", ".", "Format", "(", "record", ")", "+", "\"", "\\n", "\"", "\n\n", "if", "<mask>", ".", "writer", "==", "nil", "{", "if", "err", ":=", "handler", ".", "open", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n\n", "_", ",", "err", ":=", "handler", ".", "writer", ".", "Write", "(", "[", "]", "byte", "(", "msg", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "handler", ".", "writer", ".", "Flush", "(", ")", "\n\n", "return", "nil", "\n", "}" ]
18,045
all-18046
[ "NewCookieSigner", "returns", "a", "new", "CookieSigner", "using", "the", "given", "key" ]
[ "func", "NewCookieSigner", "(", "<mask>", "[", "]", "byte", ")", "CookieSigner", "{", "return", "CookieSigner", "{", "signer", ":", "hmac", ".", "New", "(", "sha256", ".", "New", ",", "key", ")", "}", "\n", "}" ]
18,046
all-18047
[ "Instance", "ID", "length", "is", "limited", "by", "AWS", "API", "to", "64", "characters", ".", "For", "longer", "strings", "SHA", "-", "256", "hash", "will", "be", "used", "instead", "of", "the", "verbatim", "target", "to", "limit", "the", "length", "." ]
[ "func", "(", "p", "*", "AWSSDProvider", ")", "targetToInstanceID", "(", "target", "string", ")", "string", "{", "if", "len", "(", "target", ")", ">", "64", "{", "hash", ":=", "sha256", ".", "Sum256", "(", "[", "]", "byte", "(", "strings", ".", "ToLower", "(", "target", ")", ")", ")", "\n", "return", "hex", ".", "EncodeToString", "(", "<mask>", "[", ":", "]", ")", "\n", "}", "\n\n", "return", "strings", ".", "ToLower", "(", "target", ")", "\n", "}" ]
18,047
all-18048
[ "RemoveWindow", "is", "a", "wrapper", "around", "gtk_application_remove_window", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "RemoveWindow", "(", "w", "*", "Window", ")", "{", "C", ".", "gtk_application_remove_window", "(", "v", ".", "native", "(", ")", ",", "w", ".", "native", "(", ")", ")", "\n", "}" ]
18,048
all-18049
[ "MarshalEasyJSON", "satisfies", "easyjson", ".", "Marshaler", "." ]
[ "func", "(", "t", "ContinueToLocationTargetCallFrames", ")", "MarshalEasyJSON", "(", "<mask>", "*", "jwriter", ".", "Writer", ")", "{", "out", ".", "String", "(", "string", "(", "t", ")", ")", "\n", "}" ]
18,049
all-18050
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "HighlightNodeParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoOverlay11", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
18,050
all-18051
[ "StringToSignalFunc", "parses", "a", "string", "as", "a", "signal", "based", "on", "the", "signal", "lookup", "table", ".", "If", "the", "user", "supplied", "an", "empty", "string", "or", "nil", "a", "special", "nil", "signal", "is", "returned", ".", "Clients", "should", "check", "for", "this", "value", "and", "set", "the", "response", "back", "nil", "after", "mapstructure", "finishes", "parsing", "." ]
[ "func", "StringToSignalFunc", "(", ")", "mapstructure", ".", "DecodeHookFunc", "{", "return", "func", "(", "f", "reflect", ".", "Type", ",", "t", "reflect", ".", "Type", ",", "data", "interface", "{", "}", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "if", "f", ".", "Kind", "(", ")", "!=", "reflect", ".", "<mask>", "{", "return", "data", ",", "nil", "\n", "}", "\n\n", "if", "t", ".", "String", "(", ")", "!=", "\"", "\"", "{", "return", "data", ",", "nil", "\n", "}", "\n\n", "if", "data", "==", "nil", "||", "data", ".", "(", "string", ")", "==", "\"", "\"", "{", "return", "SIGNIL", ",", "nil", "\n", "}", "\n\n", "return", "Parse", "(", "data", ".", "(", "string", ")", ")", "\n", "}", "\n", "}" ]
18,051
all-18052
[ "NewSyslogBackendPriority", "is", "the", "same", "as", "NewSyslogBackend", "but", "with", "custom", "syslog", "priority", "like", "syslog", ".", "LOG_LOCAL3|syslog", ".", "LOG_DEBUG", "etc", "." ]
[ "func", "NewSyslogBackendPriority", "(", "prefix", "string", ",", "<mask>", "syslog", ".", "Priority", ")", "(", "b", "*", "SyslogBackend", ",", "err", "error", ")", "{", "var", "w", "*", "syslog", ".", "Writer", "\n", "w", ",", "err", "=", "syslog", ".", "New", "(", "priority", ",", "prefix", ")", "\n", "return", "&", "SyslogBackend", "{", "w", "}", ",", "err", "\n", "}" ]
18,052
all-18053
[ "Change", "the", "label", "of", "path", "to", "the", "filelabel", "string", ".", "If", "the", "relabel", "string", "is", "z", "relabel", "will", "change", "the", "MCS", "label", "to", "s0", ".", "This", "will", "allow", "all", "containers", "to", "share", "the", "content", ".", "If", "the", "relabel", "string", "is", "a", "Z", "then", "the", "MCS", "label", "should", "continue", "to", "be", "used", ".", "SELinux", "will", "use", "this", "field", "to", "make", "sure", "the", "content", "can", "not", "be", "shared", "by", "other", "containes", "." ]
[ "func", "Relabel", "(", "path", "string", ",", "fileLabel", "string", ",", "relabel", "string", ")", "error", "{", "exclude_path", ":=", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", "}", "\n", "if", "fileLabel", "==", "\"", "\"", "{", "return", "nil", "\n", "}", "\n", "if", "!", "strings", ".", "ContainsAny", "(", "relabel", ",", "\"", "\"", ")", "{", "return", "nil", "\n", "}", "\n", "for", "_", ",", "p", ":=", "range", "exclude_path", "{", "if", "path", "==", "p", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "<mask>", ")", "\n", "}", "\n", "}", "\n", "if", "strings", ".", "Contains", "(", "relabel", ",", "\"", "\"", ")", "&&", "strings", ".", "Contains", "(", "relabel", ",", "\"", "\"", ")", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "strings", ".", "Contains", "(", "relabel", ",", "\"", "\"", ")", "{", "c", ":=", "selinux", ".", "NewContext", "(", "fileLabel", ")", "\n", "c", "[", "\"", "\"", "]", "=", "\"", "\"", "\n", "fileLabel", "=", "c", ".", "Get", "(", ")", "\n", "}", "\n", "return", "selinux", ".", "Chcon", "(", "path", ",", "fileLabel", ",", "true", ")", "\n", "}" ]
18,053
all-18054
[ "GetStatus", "returns", "the", "Status", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "c", "*", "Check", ")", "GetStatus", "(", ")", "Status", "{", "if", "c", "==", "nil", "||", "c", ".", "Status", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "<mask>", "\n", "}" ]
18,054
all-18055
[ "MatchedRoles", "return", "defined", "roles", "from", "user" ]
[ "func", "(", "role", "*", "Role", ")", "MatchedRoles", "(", "req", "*", "<mask>", ".", "Request", ",", "user", "interface", "{", "}", ")", "(", "roles", "[", "]", "string", ")", "{", "if", "definitions", ":=", "role", ".", "definitions", ";", "definitions", "!=", "nil", "{", "for", "name", ",", "definition", ":=", "range", "definitions", "{", "if", "definition", "(", "req", ",", "user", ")", "{", "roles", "=", "append", "(", "roles", ",", "name", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "\n", "}" ]
18,055
all-18056
[ "ContainerDevicesRef", "returns", "entities", "used", "by", "containers", "." ]
[ "func", "(", "c", "*", "ClusterTx", ")", "ContainerDevicesRef", "(", "filter", "ContainerFilter", ")", "(", "map", "[", "string", "]", "map", "[", "string", "]", "map", "[", "string", "]", "map", "[", "string", "]", "string", ",", "error", ")", "{", "// Result slice.", "objects", ":=", "make", "(", "[", "]", "struct", "{", "Project", "string", "\n", "Name", "string", "\n", "Device", "string", "\n", "Type", "int", "\n", "Key", "string", "\n", "Value", "string", "\n", "}", ",", "0", ")", "\n\n", "// Check which filter criteria are active.", "criteria", ":=", "map", "[", "string", "]", "interface", "{", "}", "{", "}", "\n", "if", "filter", ".", "Project", "!=", "\"", "\"", "{", "criteria", "[", "\"", "\"", "]", "=", "filter", ".", "Project", "\n", "}", "\n", "if", "filter", ".", "Name", "!=", "\"", "\"", "{", "criteria", "[", "\"", "\"", "]", "=", "filter", ".", "Name", "\n", "}", "\n", "if", "filter", ".", "Parent", "!=", "\"", "\"", "{", "criteria", "[", "\"", "\"", "]", "=", "filter", ".", "Parent", "\n", "}", "\n\n", "// Pick the prepared statement and arguments to use based on active criteria.", "var", "stmt", "*", "sql", ".", "Stmt", "\n", "var", "args", "[", "]", "interface", "{", "}", "\n\n", "if", "criteria", "[", "\"", "\"", "]", "!=", "nil", "&&", "criteria", "[", "\"", "\"", "]", "!=", "nil", "{", "stmt", "=", "c", ".", "stmt", "(", "containerDevicesRefByProjectAndName", ")", "\n", "args", "=", "[", "]", "interface", "{", "}", "{", "<mask>", ".", "Project", ",", "filter", ".", "Name", ",", "}", "\n", "}", "else", "if", "criteria", "[", "\"", "\"", "]", "!=", "nil", "&&", "criteria", "[", "\"", "\"", "]", "!=", "nil", "{", "stmt", "=", "c", ".", "stmt", "(", "containerDevicesRefByProjectAndNode", ")", "\n", "args", "=", "[", "]", "interface", "{", "}", "{", "filter", ".", "Project", ",", "filter", ".", "Node", ",", "}", "\n", "}", "else", "if", "criteria", "[", "\"", "\"", "]", "!=", "nil", "{", "stmt", "=", "c", ".", "stmt", "(", "containerDevicesRefByNode", ")", "\n", "args", "=", "[", "]", "interface", "{", "}", "{", "filter", ".", "Node", ",", "}", "\n", "}", "else", "if", "criteria", "[", "\"", "\"", "]", "!=", "nil", "{", "stmt", "=", "c", ".", "stmt", "(", "containerDevicesRefByProject", ")", "\n", "args", "=", "[", "]", "interface", "{", "}", "{", "filter", ".", "Project", ",", "}", "\n", "}", "else", "{", "stmt", "=", "c", ".", "stmt", "(", "containerDevicesRef", ")", "\n", "args", "=", "[", "]", "interface", "{", "}", "{", "}", "\n", "}", "\n\n", "// Dest function for scanning a row.", "dest", ":=", "func", "(", "i", "int", ")", "[", "]", "interface", "{", "}", "{", "objects", "=", "append", "(", "objects", ",", "struct", "{", "Project", "string", "\n", "Name", "string", "\n", "Device", "string", "\n", "Type", "int", "\n", "Key", "string", "\n", "Value", "string", "\n", "}", "{", "}", ")", "\n", "return", "[", "]", "interface", "{", "}", "{", "&", "objects", "[", "i", "]", ".", "Project", ",", "&", "objects", "[", "i", "]", ".", "Name", ",", "&", "objects", "[", "i", "]", ".", "Device", ",", "&", "objects", "[", "i", "]", ".", "Type", ",", "&", "objects", "[", "i", "]", ".", "Key", ",", "&", "objects", "[", "i", "]", ".", "Value", ",", "}", "\n", "}", "\n\n", "// Select.", "err", ":=", "query", ".", "SelectObjects", "(", "stmt", ",", "dest", ",", "args", "...", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Wrap", "(", "err", ",", "\"", "\"", ")", "\n", "}", "\n\n", "// Build index by primary name.", "index", ":=", "map", "[", "string", "]", "map", "[", "string", "]", "map", "[", "string", "]", "map", "[", "string", "]", "string", "{", "}", "\n\n", "for", "_", ",", "object", ":=", "range", "objects", "{", "_", ",", "ok", ":=", "index", "[", "object", ".", "Project", "]", "\n", "if", "!", "ok", "{", "subIndex", ":=", "map", "[", "string", "]", "map", "[", "string", "]", "map", "[", "string", "]", "string", "{", "}", "\n", "index", "[", "object", ".", "Project", "]", "=", "subIndex", "\n", "}", "\n\n", "item", ",", "ok", ":=", "index", "[", "object", ".", "Project", "]", "[", "object", ".", "Name", "]", "\n", "if", "!", "ok", "{", "item", "=", "map", "[", "string", "]", "map", "[", "string", "]", "string", "{", "}", "\n", "}", "\n\n", "index", "[", "object", ".", "Project", "]", "[", "object", ".", "Name", "]", "=", "item", "\n", "config", ",", "ok", ":=", "item", "[", "object", ".", "Device", "]", "\n", "if", "!", "ok", "{", "// First time we see this device, let's int the config", "// and add the type.", "deviceType", ",", "err", ":=", "dbDeviceTypeToString", "(", "object", ".", "Type", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Wrapf", "(", "err", ",", "\"", "\"", ",", "object", ".", "Type", ")", "\n", "}", "\n", "config", "=", "map", "[", "string", "]", "string", "{", "}", "\n", "config", "[", "\"", "\"", "]", "=", "deviceType", "\n", "item", "[", "object", ".", "Device", "]", "=", "config", "\n", "}", "\n", "if", "object", ".", "Key", "!=", "\"", "\"", "{", "config", "[", "object", ".", "Key", "]", "=", "object", ".", "Value", "\n", "}", "\n", "}", "\n\n", "return", "index", ",", "nil", "\n", "}" ]
18,056
all-18057
[ "LayerInfosForCopy", "()", "returns", "the", "list", "of", "layer", "blobs", "that", "make", "up", "the", "root", "filesystem", "of", "the", "image", "after", "they", "ve", "been", "decompressed", "." ]
[ "func", "(", "s", "*", "ostreeImageSource", ")", "LayerInfosForCopy", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "types", ".", "BlobInfo", ",", "error", ")", "{", "updatedBlobInfos", ":=", "[", "]", "types", ".", "BlobInfo", "{", "}", "\n", "manifestBlob", ",", "manifestType", ",", "err", ":=", "s", ".", "GetManifest", "(", "ctx", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "man", ",", "err", ":=", "manifest", ".", "FromBlob", "(", "manifestBlob", ",", "manifestType", ")", "\n\n", "s", ".", "compressed", "=", "make", "(", "map", "[", "digest", ".", "Digest", "]", "digest", ".", "Digest", ")", "\n\n", "layerBlobs", ":=", "man", ".", "LayerInfos", "(", ")", "\n\n", "for", "_", ",", "layerBlob", ":=", "range", "layerBlobs", "{", "branch", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "layerBlob", ".", "Digest", ".", "Hex", "(", ")", ")", "\n", "<mask>", ",", "uncompressedDigestStr", ",", "err", ":=", "readMetadata", "(", "s", ".", "repo", ",", "branch", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "||", "!", "found", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "found", ",", "uncompressedSizeStr", ",", "err", ":=", "readMetadata", "(", "s", ".", "repo", ",", "branch", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "||", "!", "found", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "uncompressedSize", ",", "err", ":=", "strconv", ".", "ParseInt", "(", "uncompressedSizeStr", ",", "10", ",", "64", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "uncompressedDigest", ":=", "digest", ".", "Digest", "(", "uncompressedDigestStr", ")", "\n", "blobInfo", ":=", "types", ".", "BlobInfo", "{", "Digest", ":", "uncompressedDigest", ",", "Size", ":", "uncompressedSize", ",", "MediaType", ":", "layerBlob", ".", "MediaType", ",", "}", "\n", "s", ".", "compressed", "[", "uncompressedDigest", "]", "=", "layerBlob", ".", "Digest", "\n", "updatedBlobInfos", "=", "append", "(", "updatedBlobInfos", ",", "blobInfo", ")", "\n", "}", "\n", "return", "updatedBlobInfos", ",", "nil", "\n", "}" ]
18,057
all-18058
[ "NewServer", "creates", "a", "new", "HTTP", "server", "." ]
[ "func", "NewServer", "(", "conf", "*", "Config", ")", "*", "Server", "{", "s", ":=", "&", "<mask>", "{", "conf", ":", "conf", ",", "srv", ":", "http", ".", "Server", "{", "Addr", ":", "conf", ".", "Addr", ",", "Handler", ":", "http", ".", "NewServeMux", "(", ")", ",", "}", ",", "}", "\n", "return", "s", "\n", "}" ]
18,058
all-18059
[ "Returns", "a", "string", "at", "the", "key", "or", "the", "specified", "value", "if", "it", "doesn", "t", "exist", "or", "isn", "t", "a", "strin" ]
[ "func", "(", "t", "Typed", ")", "InterfaceOr", "(", "key", "string", ",", "d", "interface", "{", "}", ")", "interface", "{", "}", "{", "if", "value", ",", "exists", ":=", "t", ".", "InterfaceIf", "(", "<mask>", ")", ";", "exists", "{", "return", "value", "\n", "}", "\n", "return", "d", "\n", "}" ]
18,059
all-18060
[ "AddBody", "the", "message", "by", "receiving", "a", "renderer", "and", "rendering", "data", "first", "message", "will", "be", "used", "as", "the", "main", "message", "Body", "rest", "of", "them", "will", "be", "passed", "as", "alternative", "bodies", "on", "the", "email", "message" ]
[ "func", "(", "m", "*", "Message", ")", "AddBody", "(", "r", "render", ".", "Renderer", ",", "data", "render", ".", "Data", ")", "error", "{", "buf", ":=", "bytes", ".", "NewBuffer", "(", "[", "]", "byte", "{", "}", ")", "\n", "err", ":=", "r", ".", "Render", "(", "buf", ",", "m", ".", "merge", "(", "data", ")", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "m", ".", "Bodies", "=", "append", "(", "m", ".", "Bodies", ",", "Body", "{", "Content", ":", "buf", ".", "<mask>", "(", ")", ",", "ContentType", ":", "r", ".", "ContentType", "(", ")", ",", "}", ")", "\n\n", "return", "nil", "\n", "}" ]
18,060
all-18061
[ "set", "the", "active", "program", "object", "for", "a", "program", "pipeline", "object" ]
[ "func", "ActiveShaderProgram", "(", "pipeline", "uint32", ",", "program", "uint32", ")", "{", "syscall", ".", "Syscall", "(", "gpActiveShaderProgram", ",", "2", ",", "uintptr", "(", "pipeline", ")", ",", "uintptr", "(", "<mask>", ")", ",", "0", ")", "\n", "}" ]
18,061
all-18062
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "CreateStyleSheetReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss58", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "<mask>", "\n", "}" ]
18,062
all-18063
[ "InstanceLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "InstanceLocator", "(", "href", "string", ")", "*", "InstanceLocator", "{", "<mask>", "&", "InstanceLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
18,063
all-18064
[ "IntrospectOthers", "returns", "the", "ChannelInfo", "for", "all", "other", "channels", "in", "this", "process", "." ]
[ "func", "(", "ch", "*", "Channel", ")", "IntrospectOthers", "(", "opts", "*", "IntrospectionOptions", ")", "map", "[", "string", "]", "[", "]", "ChannelInfo", "{", "if", "!", "opts", ".", "IncludeOtherChannels", "{", "return", "nil", "\n", "}", "\n\n", "channelMap", ".", "Lock", "(", ")", "\n", "defer", "channelMap", ".", "Unlock", "(", ")", "\n\n", "states", ":=", "make", "(", "map", "[", "string", "]", "[", "]", "ChannelInfo", ")", "\n", "for", "svc", ",", "channels", ":=", "range", "channelMap", ".", "existing", "{", "channelInfos", ":=", "make", "(", "[", "]", "ChannelInfo", ",", "0", ",", "len", "(", "channels", ")", ")", "\n", "for", "_", ",", "otherChan", ":=", "range", "channels", "{", "if", "ch", "==", "otherChan", "{", "<mask>", "\n", "}", "\n", "channelInfos", "=", "append", "(", "channelInfos", ",", "otherChan", ".", "ReportInfo", "(", "opts", ")", ")", "\n", "}", "\n", "states", "[", "svc", "]", "=", "channelInfos", "\n", "}", "\n\n", "return", "states", "\n", "}" ]
18,064
all-18065
[ "Debug", "outputs", "Debug", "level", "log" ]
[ "func", "Debug", "(", "val", "...", "<mask>", "{", "}", ")", "error", "{", "return", "glg", ".", "out", "(", "DEBG", ",", "blankFormat", "(", "len", "(", "val", ")", ")", ",", "val", "...", ")", "\n", "}" ]
18,065
all-18066
[ "return", "parameters", "of", "a", "buffer", "object" ]
[ "func", "GetBufferParameteriv", "(", "target", "uint32", ",", "pname", "uint32", ",", "params", "*", "int32", ")", "{", "C", ".", "glowGetBufferParameteriv", "(", "gpGetBufferParameteriv", ",", "(", "C", ".", "GLenum", ")", "(", "<mask>", ")", ",", "(", "C", ".", "GLenum", ")", "(", "pname", ")", ",", "(", "*", "C", ".", "GLint", ")", "(", "unsafe", ".", "Pointer", "(", "params", ")", ")", ")", "\n", "}" ]
18,066
all-18067
[ "Advance", "()", ":", "non", "-", "standard", "but", "better", "than", "Next", "()", "because", "we", "don", "t", "have", "to", "unwrap", "our", "buffer", "and", "pay", "the", "cpu", "time", "for", "the", "copy", "that", "unwrapping", "may", "need", ".", "Useful", "in", "conjuction", "/", "after", "ReadWithoutAdvance", "()", "above", "." ]
[ "func", "(", "b", "*", "PointerRingBuf", ")", "Advance", "(", "n", "int", ")", "{", "if", "n", "<=", "0", "{", "<mask>", "\n", "}", "\n", "if", "n", ">", "b", ".", "Readable", "{", "n", "=", "b", ".", "Readable", "\n", "}", "\n", "b", ".", "Readable", "-=", "n", "\n", "b", ".", "Beg", "=", "(", "b", ".", "Beg", "+", "n", ")", "%", "b", ".", "N", "\n", "}" ]
18,067
all-18068
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "BackendNode", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
18,068
all-18069
[ "Crit", "logs", "a", "message", "(", "with", "optional", "context", ")", "at", "the", "CRITICAL", "log", "level" ]
[ "func", "Crit", "(", "msg", "string", ",", "ctx", "...", "interface", "{", "}", ")", "{", "if", "<mask>", "!=", "nil", "{", "Log", ".", "Crit", "(", "msg", ",", "ctx", "...", ")", "\n", "}", "\n", "}" ]
18,069
all-18070
[ "UnmarshalJSON", "decodes", "the", "TransitionDependencySet", "tag", "in", "the", "JSON", "encoded", "string", "into", "the", "TransitionDependenciesMap", "object" ]
[ "func", "(", "td", "*", "TransitionDependenciesMap", ")", "UnmarshalJSON", "(", "b", "[", "]", "byte", ")", "error", "{", "depMap", ":=", "make", "(", "map", "[", "apicontainerstatus", ".", "ContainerStatus", "]", "TransitionDependencySet", ")", "\n", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "depMap", ")", "\n", "if", "err", "==", "nil", "{", "*", "td", "=", "depMap", "\n", "return", "nil", "\n", "}", "\n", "seelog", ".", "Debugf", "(", "\"", "\"", ",", "string", "(", "b", ")", ",", "err", ")", "\n", "// Unmarshal to deprecated 'TransitionDependencySet' and then convert to a map", "tdSet", ":=", "TransitionDependencySet", "{", "}", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "tdSet", ")", ";", "err", "!=", "nil", "{", "return", "errors", ".", "Wrapf", "(", "err", ",", "\"", "\"", ")", "\n", "}", "\n", "for", "_", ",", "dep", ":=", "<mask>", "tdSet", ".", "ContainerDependencies", "{", "dependentStatus", ":=", "dep", ".", "DependentStatus", "\n", "// no need for DependentStatus field anymore, since it becomes the map's key", "dep", ".", "DependentStatus", "=", "0", "\n", "if", "_", ",", "ok", ":=", "depMap", "[", "dependentStatus", "]", ";", "!", "ok", "{", "depMap", "[", "dependentStatus", "]", "=", "TransitionDependencySet", "{", "}", "\n", "}", "\n", "deps", ":=", "depMap", "[", "dependentStatus", "]", "\n", "deps", ".", "ContainerDependencies", "=", "append", "(", "deps", ".", "ContainerDependencies", ",", "dep", ")", "\n", "depMap", "[", "dependentStatus", "]", "=", "deps", "\n", "}", "\n", "*", "td", "=", "depMap", "\n", "return", "nil", "\n", "}" ]
18,070
all-18071
[ "SetInt", "is", "a", "wrapper", "around", "g_value_set_int", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "SetInt", "(", "val", "int", ")", "{", "C", ".", "g_value_set_int", "(", "v", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "val", ")", ")", "\n", "}" ]
18,071
all-18072
[ "ResolveTarget", "is", "a", "convenience", "for", "handling", "the", "value", "?targetNode", "query", "parameter", ".", "It", "returns", "the", "address", "of", "the", "given", "node", "or", "the", "empty", "string", "if", "the", "given", "node", "is", "the", "local", "one", "." ]
[ "func", "ResolveTarget", "(", "cluster", "*", "db", ".", "Cluster", ",", "target", "string", ")", "(", "string", ",", "error", ")", "{", "address", ":=", "\"", "\"", "\n", "err", ":=", "cluster", ".", "Transaction", "(", "func", "(", "tx", "*", "db", ".", "ClusterTx", ")", "error", "{", "name", ",", "err", ":=", "tx", ".", "NodeName", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "target", "==", "<mask>", "{", "return", "nil", "\n", "}", "\n\n", "node", ",", "err", ":=", "tx", ".", "NodeByName", "(", "target", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "db", ".", "ErrNoSuchObject", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "target", ")", "\n", "}", "\n\n", "return", "err", "\n", "}", "\n\n", "if", "node", ".", "Name", "!=", "name", "{", "address", "=", "node", ".", "Address", "\n", "}", "\n\n", "return", "nil", "\n", "}", ")", "\n\n", "return", "address", ",", "err", "\n", "}" ]
18,072
all-18073
[ "Vector", "returns", "a", "Vector", "if", "the", "result", "value", "is", "one", ".", "An", "error", "is", "returned", "if", "the", "result", "was", "an", "error", "or", "the", "result", "value", "is", "not", "a", "Vector", "." ]
[ "func", "(", "r", "*", "Result", ")", "Vector", "(", ")", "(", "Vector", ",", "error", ")", "{", "if", "r", ".", "Err", "!=", "nil", "{", "return", "nil", ",", "r", ".", "Err", "\n", "}", "\n", "v", ",", "ok", ":=", "r", ".", "Value", ".", "(", "Vector", ")", "\n", "if", "!", "ok", "{", "return", "nil", ",", "<mask>", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "v", ",", "nil", "\n", "}" ]
18,073
all-18074
[ "GetAuthconfig", "retrieves", "the", "correct", "auth", "configuration", "for", "the", "given", "repository" ]
[ "func", "(", "authProvider", "*", "dockerAuthProvider", ")", "GetAuthconfig", "(", "<mask>", "string", ",", "registryAuthData", "*", "apicontainer", ".", "RegistryAuthenticationData", ")", "(", "types", ".", "AuthConfig", ",", "error", ")", "{", "// Ignore 'tag', not used in auth determination", "repository", ",", "_", ":=", "utils", ".", "ParseRepositoryTag", "(", "image", ")", "\n", "authDataMap", ":=", "authProvider", ".", "authMap", "\n\n", "// Ignore repo/image name for some auth checks (see use of 'image' below for where it's not ignored.", "indexName", ",", "_", ":=", "splitReposName", "(", "repository", ")", "\n\n", "if", "isDockerhubHostname", "(", "indexName", ")", "{", "return", "authDataMap", "[", "dockerRegistryKey", "]", ",", "nil", "\n", "}", "\n\n", "// Try to find the longest match that at least matches the hostname", "// This is to support e.g. 'registry.tld: auth1, registry.tld/username:", "// auth2' for multiple different auths on the same registry.", "longestKey", ":=", "\"", "\"", "\n", "authConfigKey", ":=", "indexName", "\n\n", "// Take a direct match of the index hostname as a sane default", "if", "_", ",", "found", ":=", "authDataMap", "[", "authConfigKey", "]", ";", "found", "&&", "len", "(", "authConfigKey", ")", ">", "len", "(", "longestKey", ")", "{", "longestKey", "=", "authConfigKey", "\n", "}", "\n\n", "for", "registry", ":=", "range", "authDataMap", "{", "nameParts", ":=", "strings", ".", "SplitN", "(", "registry", ",", "\"", "\"", ",", "2", ")", "\n", "hostname", ":=", "nameParts", "[", "0", "]", "\n\n", "// Only ever take a new key if the hostname matches in normal cases", "if", "authConfigKey", "==", "hostname", "{", "if", "longestKey", "==", "\"", "\"", "{", "longestKey", "=", "registry", "\n", "}", "else", "if", "len", "(", "registry", ")", ">", "len", "(", "longestKey", ")", "&&", "strings", ".", "HasPrefix", "(", "image", ",", "registry", ")", "{", "// If we have a longer match, that indicates a username / namespace appended", "longestKey", "=", "registry", "\n", "}", "\n", "}", "\n", "}", "\n", "if", "longestKey", "!=", "\"", "\"", "{", "return", "authDataMap", "[", "longestKey", "]", ",", "nil", "\n", "}", "\n", "return", "types", ".", "AuthConfig", "{", "}", ",", "nil", "\n", "}" ]
18,074
all-18075
[ "Next", "removes", "and", "returns", "the", "next", "item", "in", "the", "Queue", "." ]
[ "func", "(", "q", "*", "Queue", ")", "Next", "(", ")", "(", "interface", "{", "}", ",", "bool", ")", "{", "q", ".", "<mask>", ".", "Lock", "(", ")", "\n", "defer", "q", ".", "key", ".", "Unlock", "(", ")", "\n", "if", "q", ".", "underlyer", "==", "nil", "{", "return", "nil", ",", "false", "\n", "}", "\n", "return", "q", ".", "underlyer", ".", "RemoveFront", "(", ")", "\n", "}" ]
18,075
all-18076
[ "NewHandler", "returns", "an", "http", "Handler", "for", "lease", "renewals" ]
[ "func", "NewHandler", "(", "l", "lease", ".", "Lessor", ",", "waitch", "func", "(", ")", "<-", "chan", "struct", "{", "}", ")", "<mask>", ".", "Handler", "{", "return", "&", "leaseHandler", "{", "l", ",", "waitch", "}", "\n", "}" ]
18,076
all-18077
[ "Caller", "to", "commit", "must", "hold", "a", "write", "lock", "." ]
[ "func", "(", "wb", "*", "WriteBatch", ")", "commit", "(", ")", "error", "{", "if", "wb", ".", "err", "!=", "nil", "{", "return", "wb", ".", "err", "\n", "}", "\n", "// Get a new txn before we commit this one. So, the new txn doesn't need", "// to wait for this one to commit.", "wb", ".", "wg", ".", "Add", "(", "1", ")", "\n", "wb", ".", "txn", ".", "CommitWith", "(", "wb", ".", "<mask>", ")", "\n", "wb", ".", "txn", "=", "wb", ".", "db", ".", "newTransaction", "(", "true", ",", "true", ")", "\n", "// See comment about readTs in NewWriteBatch.", "wb", ".", "txn", ".", "readTs", "=", "wb", ".", "db", ".", "orc", ".", "readMark", ".", "DoneUntil", "(", ")", "\n", "return", "wb", ".", "err", "\n", "}" ]
18,077
all-18078
[ "set", "the", "value", "of", "a", "sub", "-", "word", "of", "the", "sample", "mask" ]
[ "func", "SampleMaski", "(", "maskNumber", "uint32", ",", "<mask>", "uint32", ")", "{", "syscall", ".", "Syscall", "(", "gpSampleMaski", ",", "2", ",", "uintptr", "(", "maskNumber", ")", ",", "uintptr", "(", "mask", ")", ",", "0", ")", "\n", "}" ]
18,078
all-18079
[ "ReleaseBody", "retires", "the", "request", "body", "if", "it", "is", "greater", "than", "size", "bytes", ".", "This", "permits", "GC", "to", "reclaim", "the", "large", "buffer", ".", "If", "used", "must", "be", "before", "ReleaseRequest", ".", "Use", "this", "method", "only", "if", "you", "really", "understand", "how", "it", "works", ".", "The", "majority", "of", "workloads", "don", "t", "need", "this", "method", "." ]
[ "func", "(", "req", "*", "Request", ")", "ReleaseBody", "(", "size", "int", ")", "{", "if", "cap", "(", "req", ".", "body", ".", "B", ")", ">", "size", "{", "req", ".", "closeBodyStream", "(", ")", "\n", "req", ".", "<mask>", "=", "nil", "\n", "}", "\n", "}" ]
18,079
all-18080
[ "Disconnect", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockClientServer", ")", "Disconnect", "(", "arg0", "...", "<mask>", "{", "}", ")", "error", "{", "varargs", ":=", "[", "]", "interface", "{", "}", "{", "}", "\n", "for", "_", ",", "a", ":=", "range", "arg0", "{", "varargs", "=", "append", "(", "varargs", ",", "a", ")", "\n", "}", "\n", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "varargs", "...", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "error", ")", "\n", "return", "ret0", "\n", "}" ]
18,080
all-18081
[ "BackoffLinearWithJitter", "waits", "a", "set", "period", "of", "time", "allowing", "for", "jitter", "(", "fractional", "adjustment", ")", ".", "For", "example", "waitBetween", "=", "1s", "and", "jitter", "=", "0", ".", "10", "can", "generate", "waits", "between", "900ms", "and", "1100ms", "." ]
[ "func", "backoffLinearWithJitter", "(", "waitBetween", "time", ".", "Duration", ",", "jitterFraction", "float64", ")", "backoffFunc", "{", "return", "func", "(", "attempt", "uint", ")", "<mask>", ".", "Duration", "{", "return", "jitterUp", "(", "waitBetween", ",", "jitterFraction", ")", "\n", "}", "\n", "}" ]
18,081
all-18082
[ "Seek", "advances", "the", "iterator", "to", "the", "element", "at", "time", "t", "or", "greater", "." ]
[ "func", "(", "b", "*", "BufferedSeriesIterator", ")", "Seek", "(", "t", "int64", ")", "bool", "{", "t0", ":=", "t", "-", "b", ".", "buf", ".", "delta", "\n\n", "// If the delta would cause us to seek backwards, preserve the buffer", "// and just continue regular advancement while filling the buffer on the way.", "if", "t0", ">", "b", ".", "lastTime", "{", "b", ".", "buf", ".", "reset", "(", ")", "\n\n", "b", ".", "<mask>", "=", "b", ".", "it", ".", "Seek", "(", "t0", ")", "\n", "if", "!", "b", ".", "ok", "{", "return", "false", "\n", "}", "\n", "b", ".", "lastTime", ",", "_", "=", "b", ".", "Values", "(", ")", "\n", "}", "\n\n", "if", "b", ".", "lastTime", ">=", "t", "{", "return", "true", "\n", "}", "\n", "for", "b", ".", "Next", "(", ")", "{", "if", "b", ".", "lastTime", ">=", "t", "{", "return", "true", "\n", "}", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
18,082
all-18083
[ "HasEscalationMessage", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "o", "*", "<mask>", ")", "HasEscalationMessage", "(", ")", "bool", "{", "if", "o", "!=", "nil", "&&", "o", ".", "EscalationMessage", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
18,083
all-18084
[ "Readdir", "requests", "a", "list", "of", "entries", "in", "the", "S3", "directory", "represented", "by", "f", "and", "returns", "a", "slice", "of", "up", "to", "n", "FileInfo", "values", "in", "alphabetical", "order", ".", "Subsequent", "calls", "on", "the", "same", "File", "will", "yield", "further", "FileInfos", ".", "Only", "direct", "children", "are", "returned", "not", "deeper", "descendants", "." ]
[ "func", "(", "f", "*", "File", ")", "Readdir", "(", "n", "int", ")", "(", "[", "]", "os", ".", "FileInfo", ",", "error", ")", "{", "if", "f", ".", "result", "!=", "nil", "&&", "!", "f", ".", "result", ".", "IsTruncated", "{", "return", "make", "(", "[", "]", "os", ".", "FileInfo", ",", "0", ")", ",", "io", ".", "EOF", "\n", "}", "\n\n", "<mask>", ",", "err", ":=", "f", ".", "sendRequest", "(", "n", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "defer", "reader", ".", "Close", "(", ")", "\n\n", "return", "f", ".", "parseResponse", "(", "reader", ")", "\n", "}" ]
18,084
all-18085
[ "Do", "executes", "DOM", ".", "discardSearchResults", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "DiscardSearchResultsParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandDiscardSearchResults", ",", "p", ",", "nil", ")", "\n", "}" ]
18,085
all-18086
[ "Main", "draws", "a", "left", "hand", "and", "ear", "of", "a", "gopher", ".", "Afterwards", "it", "returns", "the", "filename", ".", "This", "should", "only", "be", "used", "during", "testing", "." ]
[ "func", "Main", "(", "gc", "draw2d", ".", "GraphicContext", ",", "ext", "<mask>", ")", "(", "string", ",", "error", ")", "{", "gc", ".", "Save", "(", ")", "\n", "gc", ".", "Scale", "(", "0.5", ",", "0.5", ")", "\n", "// Draw a (partial) gopher", "Draw", "(", "gc", ")", "\n", "gc", ".", "Restore", "(", ")", "\n\n", "// Return the output filename", "return", "samples", ".", "Output", "(", "\"", "\"", ",", "ext", ")", ",", "nil", "\n", "}" ]
18,086
all-18087
[ "specify", "storage", "for", "a", "two", "-", "dimensional", "multisample", "texture" ]
[ "func", "TexStorage2DMultisample", "(", "target", "uint32", ",", "samples", "int32", ",", "internalformat", "uint32", ",", "<mask>", "int32", ",", "height", "int32", ",", "fixedsamplelocations", "bool", ")", "{", "C", ".", "glowTexStorage2DMultisample", "(", "gpTexStorage2DMultisample", ",", "(", "C", ".", "GLenum", ")", "(", "target", ")", ",", "(", "C", ".", "GLsizei", ")", "(", "samples", ")", ",", "(", "C", ".", "GLenum", ")", "(", "internalformat", ")", ",", "(", "C", ".", "GLsizei", ")", "(", "width", ")", ",", "(", "C", ".", "GLsizei", ")", "(", "height", ")", ",", "(", "C", ".", "GLboolean", ")", "(", "boolToInt", "(", "fixedsamplelocations", ")", ")", ")", "\n", "}" ]
18,087
all-18088
[ "Decode", "decodes", "Ogg", "/", "Vorbis", "data", "to", "playable", "stream", ".", "Decode", "returns", "error", "when", "decoding", "fails", "or", "IO", "error", "happens", ".", "Decode", "automatically", "resamples", "the", "stream", "to", "fit", "with", "the", "audio", "context", "if", "necessary", ".", "Decode", "takes", "the", "ownership", "of", "src", "and", "Stream", "s", "Close", "function", "closes", "src", "." ]
[ "func", "Decode", "(", "context", "*", "audio", ".", "Context", ",", "src", "audio", ".", "ReadSeekCloser", ")", "(", "*", "Stream", ",", "error", ")", "{", "decoded", ",", "channelNum", ",", "sampleRate", ",", "err", ":=", "decode", "(", "src", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "channelNum", "!=", "1", "&&", "channelNum", "!=", "2", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "channelNum", ")", "\n", "}", "\n", "var", "s", "audio", ".", "ReadSeekCloser", "=", "decoded", "\n", "<mask>", ":=", "decoded", ".", "Length", "(", ")", "\n", "if", "channelNum", "==", "1", "{", "s", "=", "convert", ".", "NewStereo16", "(", "s", ",", "true", ",", "false", ")", "\n", "size", "*=", "2", "\n", "}", "\n", "if", "sampleRate", "!=", "context", ".", "SampleRate", "(", ")", "{", "r", ":=", "convert", ".", "NewResampling", "(", "s", ",", "size", ",", "sampleRate", ",", "context", ".", "SampleRate", "(", ")", ")", "\n", "s", "=", "r", "\n", "size", "=", "r", ".", "Length", "(", ")", "\n", "}", "\n", "stream", ":=", "&", "Stream", "{", "decoded", ":", "s", ",", "size", ":", "size", "}", "\n", "runtime", ".", "SetFinalizer", "(", "stream", ",", "(", "*", "Stream", ")", ".", "Close", ")", "\n", "return", "stream", ",", "nil", "\n", "}" ]
18,088
all-18089
[ "computeSize", "retrieve", "the", "effective", "size", "of", "the", "cropped", "image", ".", "It", "is", "defined", "by", "Height", "Width", "and", "Ratio", "option", "." ]
[ "func", "(", "c", "Config", ")", "computeSize", "(", "bounds", "image", ".", "Rectangle", ",", "ratio", "image", ".", "Point", ")", "(", "p", "image", ".", "Point", ")", "{", "if", "c", ".", "Options", "&", "Ratio", "==", "Ratio", "{", "// Ratio option is on, so we take the biggest size available that fit the given ratio.", "if", "float64", "(", "ratio", ".", "X", ")", "/", "float64", "(", "bounds", ".", "Dx", "(", ")", ")", ">", "float64", "(", "ratio", ".", "Y", ")", "/", "float64", "(", "bounds", ".", "Dy", "(", ")", ")", "{", "p", "=", "image", ".", "Point", "{", "bounds", ".", "Dx", "(", ")", ",", "(", "bounds", ".", "Dx", "(", ")", "/", "ratio", ".", "X", ")", "*", "ratio", ".", "Y", "}", "\n", "}", "else", "{", "p", "=", "image", ".", "Point", "{", "(", "bounds", ".", "Dy", "(", ")", "/", "ratio", ".", "Y", ")", "*", "ratio", ".", "X", ",", "bounds", ".", "Dy", "(", ")", "}", "\n", "}", "\n", "}", "else", "{", "p", "=", "<mask>", ".", "Point", "{", "ratio", ".", "X", ",", "ratio", ".", "Y", "}", "\n", "}", "\n", "return", "\n", "}" ]
18,089
all-18090
[ "compareSemver", "compares", "two", "semvers", "lhs", "and", "rhs", "and", "returns", "-", "1", "if", "lhs", "is", "less", "than", "rhs", "0", "if", "they", "are", "equal", "and", "1", "lhs", "is", "greater", "than", "rhs" ]
[ "func", "compareSemver", "(", "lhs", ",", "rhs", "semver", ")", "int", "{", "if", "lhs", ".", "major", "<", "rhs", ".", "<mask>", "{", "return", "-", "1", "\n", "}", "\n", "if", "lhs", ".", "major", ">", "rhs", ".", "major", "{", "return", "1", "\n", "}", "\n", "if", "lhs", ".", "minor", "<", "rhs", ".", "minor", "{", "return", "-", "1", "\n", "}", "\n", "if", "lhs", ".", "minor", ">", "rhs", ".", "minor", "{", "return", "1", "\n", "}", "\n", "if", "lhs", ".", "patch", "<", "rhs", ".", "patch", "{", "return", "-", "1", "\n", "}", "\n", "if", "lhs", ".", "patch", ">", "rhs", ".", "patch", "{", "return", "1", "\n", "}", "\n", "if", "lhs", ".", "preReleaseVersion", "!=", "\"", "\"", "&&", "rhs", ".", "preReleaseVersion", "==", "\"", "\"", "{", "return", "-", "1", "\n", "}", "\n", "if", "lhs", ".", "preReleaseVersion", "==", "\"", "\"", "&&", "rhs", ".", "preReleaseVersion", "!=", "\"", "\"", "{", "return", "1", "\n", "}", "\n", "if", "lhs", ".", "preReleaseVersion", "<", "rhs", ".", "preReleaseVersion", "{", "return", "-", "1", "\n", "}", "\n", "if", "lhs", ".", "preReleaseVersion", ">", "rhs", ".", "preReleaseVersion", "{", "return", "1", "\n", "}", "\n", "return", "0", "\n", "}" ]
18,090
all-18091
[ "WithContext", "adds", "the", "context", "to", "the", "patch", "apps", "app", "routes", "route", "params" ]
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteParams", ")", "WithContext", "(", "ctx", "<mask>", ".", "Context", ")", "*", "PatchAppsAppRoutesRouteParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
18,091
all-18092
[ "ProwJobToPod", "converts", "a", "ProwJob", "to", "a", "Pod", "that", "will", "run", "the", "tests", "." ]
[ "func", "ProwJobToPod", "(", "pj", "prowapi", ".", "ProwJob", ",", "buildID", "string", ")", "(", "*", "coreapi", ".", "Pod", ",", "error", ")", "{", "if", "pj", ".", "Spec", ".", "PodSpec", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "pj", ".", "Name", ")", "\n", "}", "\n\n", "rawEnv", ",", "err", ":=", "downwardapi", ".", "EnvForSpec", "(", "downwardapi", ".", "NewJobSpec", "(", "pj", ".", "Spec", ",", "buildID", ",", "pj", ".", "Name", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "spec", ":=", "pj", ".", "Spec", ".", "PodSpec", ".", "DeepCopy", "(", ")", "\n", "spec", ".", "RestartPolicy", "=", "\"", "\"", "\n", "spec", ".", "Containers", "[", "0", "]", ".", "Name", "=", "kube", ".", "TestContainerName", "\n\n", "// if the user has not provided a serviceaccount to use or explicitly", "// requested mounting the default token, we treat the unset value as", "// false, while kubernetes treats it as true if it is unset because", "// it was added in v1.6", "if", "spec", ".", "AutomountServiceAccountToken", "==", "nil", "&&", "spec", ".", "ServiceAccountName", "==", "\"", "\"", "{", "myFalse", ":=", "false", "\n", "spec", ".", "AutomountServiceAccountToken", "=", "&", "myFalse", "\n", "}", "\n\n", "if", "pj", ".", "Spec", ".", "DecorationConfig", "==", "nil", "{", "spec", ".", "Containers", "[", "0", "]", ".", "Env", "=", "append", "(", "spec", ".", "Containers", "[", "0", "]", ".", "Env", ",", "kubeEnv", "(", "rawEnv", ")", "...", ")", "\n", "}", "else", "{", "if", "err", ":=", "decorate", "(", "spec", ",", "&", "pj", ",", "rawEnv", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "\n\n", "podLabels", ",", "annotations", ":=", "LabelsAndAnnotationsForJob", "(", "pj", ")", "\n", "return", "&", "coreapi", ".", "Pod", "{", "ObjectMeta", ":", "metav1", ".", "ObjectMeta", "{", "Name", ":", "pj", ".", "ObjectMeta", ".", "<mask>", ",", "Labels", ":", "podLabels", ",", "Annotations", ":", "annotations", ",", "}", ",", "Spec", ":", "*", "spec", ",", "}", ",", "nil", "\n", "}" ]
18,092
all-18093
[ "Less", "returns", "true", "if", "the", "i", "-", "th", "element", "s", "Priority", "is", "less", "than", "the", "j", "-", "th", "element" ]
[ "func", "(", "s", "LexSymbolSorter", ")", "Less", "(", "i", ",", "j", "int", ")", "bool", "{", "return", "s", ".", "<mask>", "[", "i", "]", ".", "Priority", ">", "s", ".", "list", "[", "j", "]", ".", "Priority", "\n", "}" ]
18,093
all-18094
[ "Parameter", "context", "has", "type", "*", "C", ".", "struct__cl_context", ".", "Parameter", "event", "has", "type", "*", "C", ".", "struct__cl_event", "." ]
[ "func", "CreateSyncFromCLeventARB", "(", "context", "unsafe", ".", "Pointer", ",", "event", "unsafe", ".", "Pointer", ",", "flags", "uint32", ")", "uintptr", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpCreateSyncFromCLeventARB", ",", "3", ",", "uintptr", "(", "context", ")", ",", "uintptr", "(", "event", ")", ",", "uintptr", "(", "<mask>", ")", ")", "\n", "return", "(", "uintptr", ")", "(", "ret", ")", "\n", "}" ]
18,094
all-18095
[ "Fatalln", "records", "the", "log", "with", "fatal", "level", "and", "exits" ]
[ "func", "(", "l", "*", "Logger", ")", "Fatalln", "(", "args", "...", "<mask>", "{", "}", ")", "{", "l", ".", "Output", "(", "2", ",", "LevelFatal", ",", "fmt", ".", "Sprintln", "(", "args", "...", ")", ")", "\n", "os", ".", "Exit", "(", "1", ")", "\n", "}" ]
18,095
all-18096
[ "ExperimentalOptClientLogImports", "writes", "all", "imports", "to", "the", "given", "writer", "in", "such", "a", "way", "that", "they", "can", "easily", "be", "replayed", "into", "another", "Pilosa", "cluster", ".", "It", "is", "an", "experimental", "option", "and", "may", "be", "changed", "or", "removed", "." ]
[ "func", "ExperimentalOptClientLogImports", "(", "loc", "io", ".", "Writer", ")", "ClientOption", "{", "return", "func", "(", "options", "*", "ClientOptions", ")", "error", "{", "<mask>", ".", "importLogWriter", "=", "loc", "\n", "return", "nil", "\n", "}", "\n", "}" ]
18,096
all-18097
[ "GetV0", "retrieves", "the", "V0", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
[ "func", "(", "u", "ScpHistoryEntry", ")", "GetV0", "(", ")", "(", "result", "ScpHistoryEntryV0", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "V", ")", ")", "\n\n", "if", "armName", "==", "\"", "\"", "{", "result", "=", "*", "u", ".", "V0", "\n", "ok", "=", "<mask>", "\n", "}", "\n\n", "return", "\n", "}" ]
18,097
all-18098
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SetBreakpointOnFunctionCallReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger12", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
18,098
all-18099
[ "WithRange", "specifies", "the", "range", "of", "Get", "Delete", "Watch", "requests", ".", "For", "example", "Get", "requests", "with", "WithRange", "(", "end", ")", "returns", "the", "keys", "in", "the", "range", "[", "key", "end", ")", ".", "endKey", "must", "be", "lexicographically", "greater", "than", "start", "key", "." ]
[ "func", "WithRange", "(", "endKey", "string", ")", "OpOption", "{", "return", "func", "(", "op", "*", "Op", ")", "{", "op", ".", "<mask>", "=", "[", "]", "byte", "(", "endKey", ")", "}", "\n", "}" ]
18,099
all-18100
[ "SetState", "changes", "the", "current", "state", "of", "CheckBox", "Value", "must", "be", "0", "or", "1", "if", "Allow3State", "is", "off", "and", "0", "1", "or", "2", "if", "Allow3State", "is", "on" ]
[ "func", "(", "c", "*", "CheckBox", ")", "SetState", "(", "val", "int", ")", "{", "c", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "mtx", ".", "Unlock", "(", ")", "\n\n", "if", "val", "==", "c", ".", "<mask>", "{", "return", "\n", "}", "\n\n", "if", "val", "<", "0", "{", "val", "=", "0", "\n", "}", "\n", "if", "val", ">", "1", "&&", "!", "c", ".", "allow3state", "{", "val", "=", "1", "\n", "}", "\n", "if", "val", ">", "2", "{", "val", "=", "2", "\n", "}", "\n\n", "c", ".", "state", "=", "val", "\n\n", "if", "c", ".", "onChange", "!=", "nil", "{", "go", "c", ".", "onChange", "(", "val", ")", "\n", "}", "\n", "}" ]