code: def generate_key(s, pattern="%s.txt"):
      
      h = hashlib.sha1()
      #h.update(s)
      h.update(s.encode('utf-8'))
      return pattern % h.hexdigest()
docs: Generates the cache key for the given string using the content in pattern
      to format the output string