def calculate_vin_str_weight(s: str, weight_factor: list) -> int:
    """
    multiply s(str) by weight_factor char by char
    e.g.
    input: s="ABCDE", weight_factor=[1, 2, 3, 4, 5]
    return: A*1 + B*2 + C*3 + D*4 + E*5

    will multiply 0 when len(weight_factor) less than len(s)
    """

    def _get_char_weight(c: str) -> int:
        """A=1, B=2, ...., I=9,
        J=1, K=2, ..., R=9,
        S=2, T=3, ..., Z=9
        """
        if ord(c) <= 64:  # 0-9
            return int(c)
        if ord(c) <= 73:  # A-I
            return ord(c) - 64
        if ord(c) <= 82:  # J-R
            return ord(c) - 73
        # S-Z
        return ord(c) - 81

    res = 0
    for i, c in enumerate(s):
        res += _get_char_weight(c) * weight_factor[i] if i < len(weight_factor) else 0
    return res

    multiply s(str) by weight_factor char by char
    e.g.
    input: s="ABCDE", weight_factor=[1, 2, 3, 4, 5]
    return: A*1 + B*2 + C*3 + D*4 + E*5

    will multiply 0 when len(weight_factor) less than len(s)
    
faker/providers/automotive/__init__.py