<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_config(cls, filename):
 """ Create a SlackObserver from a given configuration file. The file can be in any format supported by Sacred (.json, .pickle, [.yaml]). It has to specify a ``webhook_url`` and can optionally set ``bot_name``, ``icon``, ``completed_text``, ``interrupted_text``, and ``failed_text``. """

        d = load_config_file(filename)
        obs = None
        if 'webhook_url' in d:
            obs = cls(d['webhook_url'])
        else:
            raise ValueError("Slack configuration file must contain "
                             "an entry for 'webhook_url'!")
        for k in ['completed_text', 'interrupted_text', 'failed_text',
                  'bot_name', 'icon']:
            if k in d:
                setattr(obs, k, d[k])
        return obs