<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def obj_name(self, obj: Union[str, Element]) -> str: """ Return the formatted name used for the supplied definition """

        if isinstance(obj, str):
            obj = self.obj_for(obj)
        if isinstance(obj, SlotDefinition):
            return underscore(self.aliased_slot_name(obj))
        else:
            return camelcase(obj if isinstance(obj, str) else obj.name)