'Return any matching containers that are already present.'

def get_deployed_containers(self):

    entrypoint = self.module.params.get('entrypoint')
    if (entrypoint is not None):
        entrypoint = shlex.split(entrypoint)
    command = self.module.params.get('command')
    if (command is not None):
        command = shlex.split(command)
    name = self.module.params.get('name')
    if (name and (not name.startswith('/'))):
        name = ('/' + name)
    deployed = []
    inspected = self.get_inspect_image()
    if inspected:
        repo_tags = self.get_image_repo_tags()
    else:
        repo_tags = [normalize_image(self.module.params.get('image'))]
    for container in self.client.containers(all=True):
        details = None
        if name:
            name_list = container.get('Names')
            if (name_list is None):
                name_list = []
            matches = (name in name_list)
        else:
            details = self.client.inspect_container(container['Id'])
            details = _docker_id_quirk(details)
            running_image = normalize_image(details['Config']['Image'])
            image_matches = (running_image in repo_tags)
            if (command is None):
                command_matches = True
            else:
                command_matches = (command == details['Config']['Cmd'])
            if (entrypoint is None):
                entrypoint_matches = True
            else:
                entrypoint_matches = (entrypoint == details['Config']['Entrypoint'])
            matches = (image_matches and command_matches and entrypoint_matches)
        if matches:
            if (not details):
                details = self.client.inspect_container(container['Id'])
                details = _docker_id_quirk(details)
            deployed.append(details)
    return deployed
