@classmethod
def from_string(cls, s, namespace=None):
    """
        Initializes the config from a string. The string is expected to contain the config as a variable named ``CONFIG``.
        """
    if namespace is None:
        namespace = {}
    else:
        namespace = dict(namespace)
    exec(s, namespace)
    return cls(namespace['CONFIG'])
