def METHOD_NAME(name: str) -> Name:
    if is_fullname(name):
        qname = QualName.from_string(name)
        sn = shortname_from_fullname(qname)
        quals = list(quals_from_fullname(qname))
        if quals and is_fullname(quals[0]):
            quals[0] = str(METHOD_NAME(quals[0]))
        compat_sn = compat_get_specialized_name(str(sn), *quals)
        return QualName(name=compat_sn, module=qname.module)
    else:
        return name_from_string(name)