<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _gate_name(self, gate):
 """ Return the string representation of the gate. Tries to use gate.tex_str and, if that is not available, uses str(gate) instead. :param string gate: Gate object of which to get the name / LaTeX representation. :return: LaTeX gate name. :rtype: string """

        try:
            name = gate.tex_str()
        except AttributeError:
            name = str(gate)
        return name