<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_name(cls, name, path=THEMES):
 """ Search for the given theme on the filesystem and attempt to load it. Directories will be checked in a pre-determined order. If the name is provided as an absolute file path, it will be loaded directly. """


        if os.path.isfile(name):
            return cls.from_file(name, 'custom')

        filename = os.path.join(path, '{0}.cfg'.format(name))
        if os.path.isfile(filename):
            return cls.from_file(filename, 'installed')

        filename = os.path.join(DEFAULT_THEMES, '{0}.cfg'.format(name))
        if os.path.isfile(filename):
            return cls.from_file(filename, 'preset')

        raise ConfigError('Could not find theme named "{0}"'.format(name))