def get_containers_to_create(docker_client, container=None):
    # All assumed to need creating by default
    if not container:
        containers_to_create = REQUIRED_DOCKER_CONTAINERS
    elif container == POSTGIS_INPUT:
        containers_to_create = [POSTGIS_CONTAINER]
    elif container == GEOSERVER_INPUT:
        containers_to_create = [GEOSERVER_CONTAINER]
    elif container == N52WPS_INPUT:
        containers_to_create = [N52WPS_CONTAINER]
    else:
        containers_to_create = []

    # Create containers for each image if not done already
    containers = docker_client.containers(all=True)

    for c in containers:
        names = c['Names']

        # If one of the required containers is listed, remove it from the list of containers to create
        if not container:
            required_docker_containers = REQUIRED_DOCKER_CONTAINERS
        elif container == POSTGIS_INPUT:
            required_docker_containers = [POSTGIS_CONTAINER]
        elif container == GEOSERVER_INPUT:
            required_docker_containers = [GEOSERVER_CONTAINER]
        elif container == N52WPS_INPUT:
            required_docker_containers = [N52WPS_CONTAINER]
        else:
            required_docker_containers = []

        for required_docker_container in required_docker_containers:
            if '/' + required_docker_container in names:
                containers_to_create.pop(containers_to_create.index(required_docker_container))

    return containers_to_create
Get a list of containers that need to be created.
dataset/ETHPy150Open tethysplatform/tethys/tethys_apps/cli/docker_commands.py/get_containers_to_create