code: def vb_wait_for_session_state(xp_session, state='Unlocked', timeout=10, step=None):
      '''
      Waits until a session state has been reached, checking at regular intervals.
  
      @param xp_session:
      @type xp_session: ISession from the Virtualbox API
      @param state: The constant descriptor according to the docs
      @type state: str
      @param timeout: in seconds
      @type timeout: int | float
      @param step: Intervals at which the value is checked
      @type step: int | float
      @return: Did we reach the state?
      @rtype: bool
      '''
      args = (xp_session, state)
      wait_for(_check_session_state, timeout=timeout, step=step, default=False, func_args=argsf vb_wait_for_session_state(xp_session, state='Unlocked', timeout=10, step=None):
      '''
      Waits until a session state has been reached, checking at regular intervals.
  
      @param xp_session:
      @type xp_session: ISession from the Virtualbox API
      @param state: The constant descriptor according to the docs
      @type state: str
      @param timeout: in seconds
      @type timeout: int | float
      @param step: Intervals at which the value is checked
      @type step: int | float
      @return: Did we reach the state?
      @rtype: bool
      '''
      args = (xp_session, state)
      wait_for(_check_session_state, timeout=timeout, step=step, default=False, func_args=args)
docs: Waits until a session state has been reached, checking at regular intervals.
  
      @param xp_session:
      @type xp_session: ISession from the Virtualbox API
      @param state: The constant descriptor according to the docs
      @type state: str
      @param timeout: in seconds
      @type timeout: int | float
      @param step: Intervals at which the value is checked
      @type step: int | float
      @return: Did we reach the state?
      @rtype: bool