code: def _map_content_types(archetype_tool, catalogs_definition):
      
      # This will be a dictionari like {'content_type':['catalog_id', ...]}
      ct_map = {}
      # This list will contain the atalog ids to be rebuild
      to_reindex = []
      # getting the dictionary of mapped content_types in the catalog
      map_types = archetype_tool.catalog_map
      for catalog_id in catalogs_definition.keys():
          catalog_info = catalogs_definition.get(catalog_id, {})
          # Mapping the catalog with the defined types
          types = catalog_info.get('types', [])
          for t in types:
              tmp_l = ct_map.get(t, [])
              tmp_l.append(catalog_id)
              ct_map[t] = tmp_l
      # Mapping
      for t in ct_map.keys():
          catalogs_list = ct_map[t]
          # Getting the previus mapping
          perv_catalogs_list = archetype_tool.catalog_map.get(t, [])
          # If the mapping has changed, update it
          set1 = set(catalogs_list)
          set2 = set(perv_catalogs_list)
          if set1 != set2:
              archetype_tool.setCatalogsByType(t, catalogs_list)
              # Adding to reindex only the catalogs that have changed
              to_reindex = to_reindex + list(set1 - set2) + list(set2 - set1)
      return to_reindex
docs: Updates the mapping for content_types against catalogs
      :archetype_tool: an archetype_tool object
      :catalogs_definition: a dictionary like
          {
              CATALOG_ID: {
                  'types':   ['ContentType', ...],
                  'indexes': {
                      'UID': 'FieldIndex',
                      ...
                  },
                  'columns': [
                      'Title',
                      ...
                  ]
              }
          }