def METHOD_NAME(self, ch, of_type):
    """Return the base type of `of_type`."""
    while 1:
        if of_type.arg == "leafref":
            if of_type.i_module.i_version == "1":
                node = of_type.i_type_spec.i_target_node
            else:
                node = ch.i_leafref.i_target_node
        elif of_type.i_typedef is None:
            break
        else:
            node = of_type.i_typedef
        of_type = node.search_one("type")
    if of_type.arg == "decimal64":
        return [of_type.arg, int(of_type.search_one("fraction-digits").arg)]
    elif of_type.arg == "union":
        return [of_type.arg, [self.METHOD_NAME(ch, x) for x in of_type.i_type_spec.types]]
    else:
        return of_type.arg