def list_containers(client, resource_group_name=None):
    """List all container groups in a resource group. """
    if resource_group_name is None:
        return client.container_groups.list()
    return client.container_groups.list_by_resource_group(resource_group_name)