code: def local_services(self):
          
  
          if not self._loop.inside_loop():
              self._state_lock.acquire()
  
          try:
              return sorted([(index, name) for index, name in self._name_map.items()], key=lambda element: element[0])
          finally:
              if not self._loop.inside_loop():
                  self._state_lock.release()
docs: Get a list of id, name pairs for all of the known synced services.
  
          This method is safe to call outside of the background event loop
          without any race condition.  Internally it uses a thread-safe mutex to
          protect the local copies of supervisor data and ensure that it cannot
          change while this method is iterating over it.
  
          Returns:
              list (id, name): A list of tuples with id and service name sorted by id
                  from low to high