code: def generate_mapping(self, mapping):
      result = {}
  
      for k in mapping:
          result[k] = mapping[k]
  
      # reverse mapping
      for k in mapping:
          for v in mapping[k]:
              if v not in result:
                  result[v] = []
  
              if k not in result[v]:
                  result[v].append(k)
      return result
  
imports: import os
  from nlpaug.model.char import Character
label_desc: Use image node_id 2 for calling the Ocr obj's underlying member method code with example usage: obj.generate_mapping(mapping) and returns: result