code: def _validate_namespace(self, namespace):
          
          # Update config values (so other code can access them in the bootstrap phase)
          self._update_config(namespace)
  
          # Validate announce URLs
          for key, val in namespace["announce"].items():
              if isinstance(val, basestring):
                  namespace["announce"][key] = val.split()
  
          # Re-escape output formats
          self._interpolation_escape(namespace["formats"])
  
          # Create objects from module specs
          for factory in ("engine",):
              if isinstance(namespace[factory], basestring):
                  namespace[factory] = pymagic.import_name(namespace[factory])() if namespace[factory] else None
  
          # Do some standard type conversions
          for key in namespace:
              # Split lists
              if key.endswith("_list") and isinstance(namespace[key], basestring):
                  namespace[key] = [i.strip() for i in namespace[key].replace(',', ' ').split()]
  
              # Resolve factory and callback handler lists
              elif any(key.endswith(i) for i in ("_factories", "_callbacks")) and isinstance(namespace[key], basestring):
                  namespace[key] = [pymagic.import_name(i.strip()) for i in namespace[key].replace(',', ' ').split()]
  
          # Update config values again
          self._update_config(namespace)
docs: Validate the given namespace. This method is idempotent!