def read_lines(file, predicate=None, encoding=None, errors=None):
    """Read and return the content of the file as a list of lines.

    Line breaks are not included in the resulting list.

    If ``predicate`` is given, it must be a callable that takes a single
    line as its argument and returns a bool. Only the lines for which
    ``True`` is returned are included in the result.

    :param file: path to file or file descriptor
    :type file: :term:`path-like object` or int
    :param predicate: predicate function
    :type predicate: callable(str)
    :param str encoding: name of the encoding
    :param str errors: error handler
    :return: list of lines
    :rtype: list(str)
    :raises OSError: on I/O failure

    .. versionchanged:: 0.6.0
       Add parameter ``errors``
    """
    result = []
    with open(file, encoding=encoding, errors=errors) as fh:
        for line in fh:
            line = line.rstrip('\n')
            if not predicate or predicate(line):
                result.append(line)
    return result
