def try_fix_num(n):
    """
    Return ``n`` as an integer if it is numeric, otherwise return the input
    """
    if not n.isdigit():
        return n
    if n.startswith("0"):
        n = n.lstrip("0")
    if not n:
        n = "0"
    return int(n)
Return ``n`` as an integer if it is numeric, otherwise return the input