<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_namespace(cls, namespace):
 """Initialise from argparser Namespace object."""

        config = cls()
        for slot in cls.__slots__:
            if slot.startswith('_'):
                slot = slot[1:]
            if not hasattr(namespace, slot):
                continue
            setattr(config, slot, getattr(namespace, slot))

        return config