code: def password(self, length: int = 8, hashed: bool = False) -> str:
          
          text = ascii_letters + digits + punctuation
          password = ''.join([self.random.choice(text) for _ in range(length)])
  
          if hashed:
              md5 = hashlib.md5()
              md5.update(password.encode())
              return md5.hexdigest()
          else:
              return password
docs: Generate a password or hash of password.
  
          :param length: Length of password.
          :param hashed: MD5 hash.
          :return: Password or hash of password.
  
          :Example:
              k6dv2odff9#4h