def load(self, input):
        """Resolve 'input' to dict from a dict, file, or filename."""
        is_file = (
            # Filename
            isinstance(input, text_or_bytes)
            # Open file object
            or hasattr(input, 'read')
        )
        return Parser().dict_from_file(input) if is_file else input.copy()
Resolve 'input' to dict from a dict, file, or filename.
cherrypy/lib/reprconf.py