def _parse_volumes_param(volumes):
    """Parse volumes details for Docker containers from blueprint

    Takes in a list of dicts that contains Docker volume info and
    transforms them into docker-py compliant (unflattened) data structures.
    Look for the `volumes` parameters under the `run` method on
    [this page](https://docker-py.readthedocs.io/en/stable/containers.html)

    Args:
        volumes (list): List of

            {
              "host": {
                "path": <target path on host>
                },
              "container": {
                "bind": <target path in container>,
                "mode": <read/write>
              }
            }

    Returns:
        dict of the form

            {
              <target path on host>: {
                "bind": <target path in container>,
                "mode": <read/write>
              }
            }

        if volumes is None then returns None
    """
    if volumes:
        return dict([ (vol["host"]["path"], vol["container"]) for vol in volumes ])
    else:
        return None