<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_service(self, name: str, service: Any):
 """ Method to register a service. """

        if not isinstance(service, type):
            if hasattr(service, '__class__'):
                _ensure_service_name(service.__class__, name)
            self.services[name] = service
            return

        if self._services_initialized:
            from warnings import warn
            warn('Services have already been initialized. Please register '
                 f'{name} sooner.')
            return

        self._services_registry[_ensure_service_name(service, name)] = service