def clabe(self, bank_code: Optional[int] = None) -> str:
        """Generate a mexican bank account CLABE.

        Sources:

        - https://en.wikipedia.org/wiki/CLABE

        :return: A fake CLABE number.

        :sample:
        :sample: bank_code=2
        """
        bank = bank_code or self.random_element(self.bank_codes)
        city = self.random_int(0, 999)
        branch = self.random_int(0, 9999)
        account = self.random_int(0, 9999999)

        result = f"{bank:03d}{city:03d}{branch:04d}{account:07d}"
        control_digit = get_clabe_control_digit(result)

        return result + str(control_digit)
Generate a mexican bank account CLABE.

        Sources:

        - https://en.wikipedia.org/wiki/CLABE

        :return: A fake CLABE number.

        :sample:
        :sample: bank_code=2
        
faker/providers/bank/es_MX/__init__.py