def _adjust_table_code(table_code: int) ->int:
    """
    table code handler for alternate table code form:
       501 -> 1
       510 -> 10
       511 -> 11
       601 -> 1
       etc.
    """
    if table_code in [501, 510, 511]:
        table_code -= 500
    elif table_code in [601, 610, 611]:
        table_code -= 600
    elif table_code in [701, 710, 711]:
        table_code -= 700
    elif table_code in [801, 810, 811]:
        table_code -= 800
    elif table_code in [901, 910, 911]:
        table_code -= 900
    return table_code
