<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_action_element(self, action_type):
 """Helper method to return the action object."""

        action = eval("self._hpe_actions." + action_type + "_vmedia")

        if not action:
            if action_type == "insert":
                action_path = '#HpeiLOVirtualMedia.InsertVirtualMedia'
            else:
                action_path = '#HpeiLOVirtualMedia.EjectVirtualMedia'

            raise exception.MissingAttributeError(
                attribute=action_path,
                resource=self._path)

        return action