<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_type(self, idx):
 """ Return the resolved type name based on the index This returns the string associated with the type. :param int idx: :return: the type name :rtype: str """

        _type = self.get_type_ref(idx)
        if _type == -1:
            return "AG:ITI: invalid type"
        return self.get_string(_type)