code: def register_service_into_servicegroups(service, servicegroups):
          
          if hasattr(service, 'service_description'):
              sname = service.service_description
              shname = getattr(service, 'host_name', '')
              if hasattr(service, 'servicegroups'):
                  # Todo: See if we can remove this if
                  if isinstance(service.servicegroups, list):
                      sgs = service.servicegroups
                  else:
                      sgs = service.servicegroups.split(',')
                  for servicegroup in sgs:
                      servicegroups.add_member([shname, sname], servicegroup.strip())
docs: Registers a service into the service groups declared in its
          `servicegroups` attribute.
  
          :param service: The service to register
          :type service:
          :param servicegroups: The servicegroups container
          :type servicegroups:
          :return: None