def namespace(self, namespace, key_transform=lambda key: key):
        """
        Return a copy with only the keys from a given namespace.

        The common prefix will be removed in the returned dict. Example::

            >>> from configloader import ConfigLoader
            >>> config = ConfigLoader(
            ...     MY_APP_SETTING1='a',
            ...     EXTERNAL_LIB_SETTING1='b',
            ...     EXTERNAL_LIB_SETTING2='c',
            ... )
            >>> config.namespace('EXTERNAL_LIB')
            ConfigLoader({'SETTING1': 'b', 'SETTING2': 'c'})

        :arg namespace: Common prefix.
        :arg key_transform: Function through which to pass each key when
            creating the new dictionary.

        :return: New config dict.
        :rtype: :class:`ConfigLoader`
        """
        namespace = namespace.rstrip('_') + '_'
        return ConfigLoader(
            (key_transform(key[len(namespace):]), value)
            for key, value in self.items()
            if key[:len(namespace)] == namespace
        )