def humanize_name(name):
    """ Return a canonical representation of a name in First Last format."""
    if not isinstance(name, str):
        return name
    elif name.upper() == name:
        return " ".join([part.strip().title() for part in name.split(",")][::-1])
    else:
        return " ".join([part.strip() for part in name.split(",")][::-1])