<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_pods(self, namespace=None):
 """ List all available pods. :param namespace: str, if not specified list pods for all namespaces :return: collection of instances of :class:`conu.backend.k8s.pod.Pod` """


        if namespace:
            return [Pod(name=p.metadata.name, namespace=namespace, spec=p.spec)
                    for p in self.core_api.list_namespaced_pod(namespace, watch=False).items]

        return [Pod(name=p.metadata.name, namespace=p.metadata.namespace, spec=p.spec)
                for p in self.core_api.list_pod_for_all_namespaces(watch=False).items]