def checksum_identity_card_number(characters: Sequence[Union[str, int]]) -> int:
    """
    Calculates and returns a control digit for given list of characters basing on Identity Card Number standards.
    """
    weights_for_check_digit = [7, 3, 1, 0, 7, 3, 1, 7, 3]
    integer_characters = [
        (ord(character) - 55) if isinstance(character, str) else character for character in characters
    ]
    check_digit = sum(weight * ch for weight, ch in zip(weights_for_check_digit, integer_characters)) % 10
    return check_digit

    Calculates and returns a control digit for given list of characters basing on Identity Card Number standards.
    
faker/providers/person/pl_PL/__init__.py