#NEWLINE# def parse_stylesheet_file( self , css_file , protocol_encoding = None , linking_encoding = None , document_encoding = None ) : #NEWLINE# #INDENT# 'Parse a stylesheet from a file or filename.\n\n        Character encoding-related parameters and behavior are the same\n        as in :meth:`parse_stylesheet_bytes`.\n\n        :param css_file:\n            Either a file (any object with a :meth:`~file.read` method)\n            or a filename.\n        :return:\n            A :class:`Stylesheet`.\n\n        ' #NEWLINE# if hasattr ( css_file , 'read' ) : #NEWLINE# #INDENT# css_bytes = css_file . read ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# with open ( css_file , 'rb' ) as fd : #NEWLINE# #INDENT# css_bytes = fd . read ( ) #NEWLINE# #UNINDENT# #UNINDENT# return self . parse_stylesheet_bytes ( css_file , protocol_encoding , linking_encoding , document_encoding )