'Parse a stylesheet from a file or filename.
Character encoding-related parameters and behavior are the same
as in :meth:`parse_stylesheet_bytes`.
:param css_file:
Either a file (any object with a :meth:`~file.read` method)
or a filename.
:return:
A :class:`Stylesheet`.'

def parse_stylesheet_file(self, css_file, protocol_encoding=None, linking_encoding=None, document_encoding=None):

    if hasattr(css_file, u'read'):
        css_bytes = css_file.read()
    else:
        with open(css_file, u'rb') as fd:
            css_bytes = fd.read()
    return self.parse_stylesheet_bytes(css_bytes, protocol_encoding, linking_encoding, document_encoding)
