code: def generated_password_entropy(self) -> float:
          
          characters = self._get_password_characters()
          if (
                  self.passwordlen is None
                  or not characters
          ):
              raise ValueError("Can't calculate the password entropy: character"
                               " set is empty or passwordlen isn't set")
  
          if self.passwordlen == 0:
              return 0.0
  
          return calc_password_entropy(self.passwordlen, characters)
docs: Calculate the entropy of a password that would be generated.