def nip(self) -> str:
        """
        Returns 10 digit of Number of tax identification.
        Polish: Numer identyfikacji podatkowej (NIP).

        https://pl.wikipedia.org/wiki/NIP
        list of codes
        http://www.algorytm.org/numery-identyfikacyjne/nip.html

        """

        nip = [int(i) for i in self.random_element(self.tax_office_codes)]  # type: ignore
        for _ in range(6):
            nip.append(self.random_digit())

        weights = (6, 5, 7, 2, 3, 4, 5, 6, 7)
        check_sum = sum(d * w for d, w in zip(nip, weights)) % 11

        if check_sum % 11 == 10:
            position = self.random_int(3, 8)
            if nip[position] < 9:
                nip[position] = (nip[position] + 1) % 10
                nip.append((check_sum + weights[position]) % 11)
            else:
                nip[position] = (nip[position] - 1) % 10
                nip.append((check_sum - weights[position]) % 11)

        else:
            nip.append(check_sum % 11)

        return "".join(str(character) for character in nip)

        Returns 10 digit of Number of tax identification.
        Polish: Numer identyfikacji podatkowej (NIP).

        https://pl.wikipedia.org/wiki/NIP
        list of codes
        http://www.algorytm.org/numery-identyfikacyjne/nip.html

        
faker/providers/person/pl_PL/__init__.py