import logging, os
logging.getLogger("requests").setLevel(logging.WARNING)
try:
    from functools import reduce
except ImportError:
    pass

import biobox.util               as docker
import biobox.image.availability as avail
from biobox.exception import NoImageFound

import biobox_cli.util.error as error
import dockerpty             as pty

def exit_if_no_image_available(image):
    try:
        avail.get_image(image)
    except NoImageFound:
        error.err_exit('unknown_image', {'image': image})

def create(image, command, volumes = [], memory = None, cpu_shares = None, cpuset = None):
    return docker.client().create_container(
            image,
            command,
            cpu_shares = cpu_shares,
            cpuset = cpuset,
            volumes     = list(map(lambda x: x.split(":")[0], volumes)),
            host_config = docker.client().create_host_config(binds=volumes, mem_limit=memory))

def create_tty(image, tty, volumes = []):
    command = ""
    return docker.client().create_container(
            image,
            command,
            stdin_open  = True,
            tty         = tty,
            entrypoint  = '/bin/bash',
            volumes     = list(map(lambda x: x.split(":")[0], volumes)),
            host_config = docker.client().create_host_config(binds=volumes))

def run(container):
    docker.client().start(container)
    docker.client().wait(container)

def login(container):
    docker.client().start(container)
    pty.PseudoTerminal(docker.client(), container).start()
    docker.client().stop(container)

def remove(container):
    """
    Removal of a container
    NOTE: This method is not tested due to circle ci limitations
    """
    docker.client().remove_container(container, v=True)

@@ -71,75 +71,8 @@
 ING)
-%0Atry:%0A    from functools import reduce%0Aexcept ImportError:%0A    pass
 %0A%0Aim
@@ -158,20 +158,22 @@
 ail%0A
-from
+import
  biobox.
 exce
@@ -172,37 +172,33 @@
 box.
-exception import NoImageFound
+image.volume       as vol
 %0A%0Aim
@@ -305,24 +305,70 @@
 ble(image):%0A
+    from biobox.exception import NoImageFound%0A
     try:%0A   
@@ -760,33 +760,25 @@
 map(
-lambda x: x.split(%22:%22)%5B0%5D
+vol.get_host_path
 , vo
@@ -1167,33 +1167,25 @@
 map(
-lambda x: x.split(%22:%22)%5B0%5D
+vol.get_host_path
 , vo

Use docker.py function for getting host volume paths