def _get_docker_containers(self, state):
        containers = {}
        filters = {"label": ["blockade.id=" + state.blockade_id]}
        prefix = state.blockade_id + "_"
        for container in self.docker_client.containers(all=True, filters=filters):
            for name in container['Names']:
                # strip leading '/'
                name = name[1:] if name[0] == '/' else name

                # strip prefix. containers will have these UNLESS `container_name`
                # was specified in the config
                name = name[len(prefix):] if name.startswith(prefix) else name
                if name in state.containers:
                    containers[name] = container
                    break
        return containers
dataset/ETHPy150Open dcm-oss/blockade/blockade/core.py/Blockade._get_docker_containers/original