code: def cpf(self, with_mask: bool = True) -> str:
          
          def get_verifying_digit_cpf(cpf, peso):
              """Calculate the verifying digit for the CPF.
  
              :param cpf: List of integers with the CPF.
              :param peso: Integer with the weight for the modulo 11 calculate.
              :returns: The verifying digit for the CPF.
              """
              soma = 0
              for index, digit in enumerate(cpf):
                  soma += digit * (peso - index)
              resto = soma % 11
              if resto == 0 or resto == 1 or resto >= 11:
                  return 0
              return 11 - resto
  
          cpf_without_dv = [self.random.randint(0, 9) for _ in range(9)]
          first_dv = get_verifying_digit_cpf(cpf_without_dv, 10)
  
          cpf_without_dv.append(first_dv)
          second_dv = get_verifying_digit_cpf(cpf_without_dv, 11)
          cpf_without_dv.append(second_dv)
  
          cpf = ''.join([str(i) for i in cpf_without_dv])
  
          if with_mask:
              return cpf[:3] + '.' + cpf[3:6] + '.' + cpf[6:9] + '-' + cpf[9:]
          return cpf
docs: Get a random CPF.
  
          :param with_mask: Use CPF mask (###.###.###-##).
          :returns: Random CPF.
  
          :Example:
              001.137.297-40