def list_services(self, namespace=None):
if namespace:<EOL><INDENT>return [Service(name=s.metadata.name,<EOL>ports=k8s_ports_to_metadata_ports(s.spec.ports),<EOL>namespace=s.metadata.namespace,<EOL>labels=s.metadata.labels, selector=s.spec.selector, spec=s.spec)<EOL>for s in self.core_api.list_namespaced_service(namespace, watch=False).items]<EOL><DEDENT>return [Service(name=s.metadata.name,<EOL>ports=k8s_ports_to_metadata_ports(s.spec.ports),<EOL>namespace=s.metadata.namespace,<EOL>labels=s.metadata.labels, selector=s.spec.selector, spec=s.spec)<EOL>for s in self.core_api.list_service_for_all_namespaces(watch=False).items]<EOL>
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`