code: def list_services(self, namespace=None):
          
  
          if namespace:
              return [Service(name=s.metadata.name,
                              ports=k8s_ports_to_metadata_ports(s.spec.ports),
                              namespace=s.metadata.namespace,
                              labels=s.metadata.labels, selector=s.spec.selector, spec=s.spec)
                      for s in self.core_api.list_namespaced_service(namespace, watch=False).items]
  
          return [Service(name=s.metadata.name,
                          ports=k8s_ports_to_metadata_ports(s.spec.ports),
                          namespace=s.metadata.namespace,
                          labels=s.metadata.labels, selector=s.spec.selector, spec=s.spec)
                  for s in self.core_api.list_service_for_all_namespaces(watch=False).items]
docs: List all available services.
  
          :param namespace: str, if not specified list services for all namespaces
          :return: collection of instances of :class:`conu.backend.k8s.service.Service`