code: def otp(password, seed, sequence):
      
      if len(password) not in list(range(4, 64)):
          raise ValueError('passphrase length')
      if len(seed) not in list(range(1, 17)):
          raise ValueError('seed length')
      for x in seed:
          if not x in _VALIDSEEDCHARACTERS:
              raise ValueError('seed composition')
      if sequence < 0:
          raise ValueError('sequence')
  
      # Pycryptodome only supports byte strings.
      seed = seed.encode('utf-8')
      password = password.encode('utf-8')
  
      # Discard the first <sequence> keys
      thehash = MD4.new(seed + password).digest()
      thehash = _fold_md4_or_md5(thehash)
      for i in range(0, sequence):
          thehash = _fold_md4_or_md5(MD4.new(thehash).digest())
  
      # Generate the result
      return _sixword_from_raw(thehash)
docs: Calculates a one-time password hash using the given password, seed, and
      sequence number and returns it.
      Uses the MD4/sixword algorithm as supported by TACACS+ servers.
  
      :type  password: str
      :param password: A password.
      :type  seed: str
      :param seed: A cryptographic seed.
      :type  sequence: int
      :param sequence: A sequence number.
      :rtype:  string
      :return: A hash.