code: def _fix_map(element_type):
      # For a map of key -> value type, ``element_type`` will be,
      # (TType.I16, None, TType.STRUCT, [RecMapBasic, None], False), None, )
      # which is just a normal struct definition.
      #
      # For a map of key -> list / set, ``element_type`` will be,
      # (TType.I16, None, TType.LIST, (TType.STRUCT, [RecMapList, None], False), False)
      # and we need to process the 3rd element as a list.
      #
      # For a map of key -> map, ``element_type`` will be,
      # (TType.I16, None, TType.MAP, (TType.I16, None, TType.STRUCT,
      #  [RecMapMap, None], False), False)
      # and need to process 3rd element as a map.
  
      # Is the map key a struct?
      if element_type[0] == TType.STRUCT:
          element_type[1][1] = element_type[1][0].thrift_spec
      elif element_type[0] in (TType.LIST, TType.SET):
          _fix_list_or_set(element_type[1])
      elif element_type[0] == TType.MAP:
          _fix_map(element_type[1])
  
      # Is the map value a struct?
      if element_type[2] == TType.STRUCT:
          element_type[3][1] = element_type[3][0].thrift_spec
      elif element_type[2] in (TType.LIST, TType.SET):
          _fix_list_or_set(element_type[3])
      elif element_type[2] == TType.MAP:
          _fix_map(element_type[3])
  
file_path: infinity/third_party/thrift/lib/py/src/TRecursive.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from thrift.Thrift import TType
label_desc: Use image node_id 3 for calling a global function with example usage: _fix_map(element_type) without return types