def is_vm_status_in(client, instance_id, statuses):
    """
    Returns True when nova instance with ID that is equal to instance_id
    argument have status that is equal to status argument.
    """
    statuses = [s.lower() for s in statuses]
    try:
        with proxy_client.expect_exception(nova_exc.NotFound):
            instance = client.servers.get(instance_id)
        status = instance.status.lower()
        if status == ERROR:
            raise RuntimeError("VM in error status")
        return status in statuses
    except nova_exc.NotFound:
        return False


# TODO: move following function to utils and reuse in other parts of CloudFerry
dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/os/compute/cold_evacuate.py/is_vm_status_in/original