code: def wrap_str_func(func):
      """
      Wrapper to apply str function to the proper key of return_dict.
      """
  
      def wrapper(some_dict):
          some_dict["seg"] = [func(item) for item in some_dict["seg"]]
          return some_dict
  
      return wrapper
  
file_path: OpenNMT-py/onmt/translate/process_zh.py
imports: from pyhanlp import HanLP
  from snownlp import SnowNLP
  import pkuseg
label_desc: Use image node_id 1 for calling a global function with example usage: wrap_str_func(func) and returns: wrapper, some_dict