Old visual observation is discarded, because it is outdated frame.
    Text observations are merged, because they are messages sent from the rewarder.

def _merge_observation(accum_observation, observation):
    """
    Old visual observation is discarded, because it is outdated frame.
    Text observations are merged, because they are messages sent from the rewarder.
    """
    if observation is None:
        # We're currently masking. So accum_observation probably
        # belongs to the previous episode. We may lose a "text"
        # observation from the previous episode, but that's ok.
        return None
    elif accum_observation is None:
        # Nothing to merge together
        return observation

    accum_observation['vision'] = observation.get('vision')
    accum_observation['text'] = accum_observation.get('text', []) + observation.get('text', [])
    return accum_observation