class_docstr: Add Prefix to src (& tgt) sentence.
docstr: Get all needed prefix correspond to corpus in `opts`.
docstr_tok: ["Get","all","needed","prefix","correspond","to","corpus","in","`","opts","`","."]
code: def get_prefix_dict(cls, opts):
      """Get all needed prefix correspond to corpus in `opts`."""
      prefix_dict = {}
      # prefix src/tgt for each dataset
      if hasattr(opts, "data"):
          for c_name, corpus in opts.data.items():
              prefix = cls._get_prefix(corpus)
              if prefix is not None:
                  logger.debug(f"Get prefix for {c_name}: {prefix}")
                  prefix_dict[c_name] = prefix
      # prefix as general option for inference
      if hasattr(opts, "src_prefix"):
          if "infer" not in prefix_dict.keys():
              prefix_dict["infer"] = {}
          prefix_dict["infer"]["src"] = opts.src_prefix
          logger.debug(f"Get prefix for src infer: {opts.src_prefix}")
      if hasattr(opts, "tgt_prefix"):
          if "infer" not in prefix_dict.keys():
              prefix_dict["infer"] = {}
          prefix_dict["infer"]["tgt"] = opts.tgt_prefix
          logger.debug(f"Get prefix for tgt infer: {opts.tgt_prefix}")
  
      return prefix_dict
  
imports: from onmt.utils.logging import logger
  from onmt.transforms import register_transform
  from .transform import Transform, ObservableStats
label_desc: Use image node_id 4 for calling the PrefixTransform obj's underlying member method code with example usage: obj.get_prefix_dict(cls, opts) and returns: prefix_dict