def list_deployments(self, namespace=None):
if namespace:<EOL><INDENT>return [Deployment(name=d.metadata.name,<EOL>namespace=d.metadata.namespace,<EOL>labels=d.metadata.labels, selector=d.spec.selector,<EOL>image_metadata=ImageMetadata(<EOL>name=d.spec.template.spec.containers[<NUM_LIT:0>].name.split("<STR_LIT:->", <NUM_LIT:1>)[<NUM_LIT:0>]))<EOL>for d in self.apps_api.list_namespaced_deployment(namespace, watch=False).items]<EOL><DEDENT>return [Deployment(name=d.metadata.name,<EOL>namespace=d.metadata.namespace,<EOL>labels=d.metadata.labels, selector=d.spec.selector,<EOL>image_metadata=ImageMetadata(<EOL>name=d.spec.template.spec.containers[<NUM_LIT:0>].name.split("<STR_LIT:->", <NUM_LIT:1>)[<NUM_LIT:0>]))<EOL>for d in self.apps_api.list_deployment_for_all_namespaces(watch=False).items]<EOL>
List all available deployments.

:param namespace: str, if not specified list deployments for all namespaces
:return: collection of instances of :class:`conu.backend.k8s.deployment.Deployment`