docs: def generate_password(mode, length):
      """generate a random password"""
      # generate random password
      r = random.SystemRandom()
      length = length or RANDOM_PASSWORD_DEFAULT_LENGTH
      password = "".join(r.choice(RANDOM_PASSWORD_ALPHABET) for _ in range(length))
  
      # copy or echo generated password
      if mode == Mode.ECHO:
          click.echo(style_password(password))
      elif mode == Mode.COPY:
          try:
              import pyperclip
  
              pyperclip.copy(password)
              result = style_success("*** PASSWORD COPIED TO CLIPBOARD ***")
          except ImportError:
              result = style_error('*** PYTHON PACKAGE "PYPERCLIP" NOT FOUND ***')
          click.echo(result)
      elif mode == Mode.RAW:
          click.echo(password)