def start_vm(uid, context):
    """
    Starts a vm that is in the stopped state. Note, currently we do not
    use the nova start and stop, rather the resume/suspend methods. The
    start action also unpauses a paused VM.

    uid -- id of the instance
    state -- the state the VM is in (str)
    context -- the os context
    """
    instance = get_vm(uid, context)
    try:
        if instance['vm_state'] in [vm_states.PAUSED]:
            COMPUTE_API.unpause(context, instance)
        elif [vm_states.SUSPENDED] in instance['vm_state']:
            COMPUTE_API.resume(context, instance)
        # the following will probably not happen, as COMPUTE_API.stop()
        # is never called.
        elif instance['vm_state'] in [vm_states.STOPPED]:
            COMPUTE_API.start(context, instance)
        else:
            raise exceptions.HTTPError(500, "Unable to map start to appropriate OS action.")
    except exceptions.HTTPError as e:
        raise e
    except Exception as e:
        raise AttributeError(e.message)
dataset/ETHPy150Open tmetsch/occi-os/occi_os_api/nova_glue/vm.py/start_vm/swapped operands of `in`