<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def password_length_needed(self) -> int: """Calculate the needed password length to satisfy the entropy number. This is for the given character set. """

        characters = self._get_password_characters()
        if (
                self.entropy_bits_req is None
                or not characters
        ):
            raise ValueError("Can't calculate the password length needed: "
                             "entropy_bits_req isn't set or the character "
                             "set is empty")

        return calc_password_length_needed(
            self.entropy_bits_req,
            characters
        )