code: def process_translations(content_list, translation_id=None):
      """Finds translations and returns them.
  
      For each content_list item, populates the 'translations' attribute, and
      returns a tuple with two lists (index, translations). Index list includes
      items in default language or items which have no variant in default
      language. Items with the `translation` metadata set to something else than
      `False` or `false` will be used as translations, unless all the items in
      the same group have that metadata.
  
      Translations and original items are determined relative to one another
      amongst items in the same group. Items are in the same group if they
      have the same value(s) for the metadata attribute(s) specified by the
      'translation_id', which must be a string or a collection of strings.
      If 'translation_id' is falsy, the identification of translations is skipped
      and all items are returned as originals.
      """
  
      if not translation_id:
          return content_list, []
  
      if isinstance(translation_id, str):
          translation_id = {translation_id}
  
      index = []
  
      try:
          content_list.sort(key=attrgetter(*translation_id))
      except TypeError:
          raise TypeError(
              "Cannot unpack {}, 'translation_id' must be falsy, a"
              " string or a collection of strings".format(
                  translation_id
              )
          )
      except AttributeError:
          raise AttributeError(
              "Cannot use {} as 'translation_id', there "
              "appear to be items without these metadata "
              "attributes".format(translation_id)
          )
  
      for id_vals, items in groupby(
          content_list, attrgetter(*translation_id)
      ):
          # prepare warning string
          id_vals = (id_vals,) if len(translation_id) == 1 else id_vals
          with_str = "with" + ", ".join(
              [' {} "{{}}"'] * len(translation_id)
          ).format(*translation_id).format(*id_vals)
  
          items = list(items)
          original_items = get_original_items(items, with_str)
          index.extend(original_items)
          for a in items:
              a.translations = [x for x in items if x != a]
  
      translations = [x for x in content_list if x not in index]
  
      return index, translations
  
imports: import datetime
  import fnmatch
  import locale
  import logging
  import os
  import pathlib
  import re
  import shutil
  import sys
  import traceback
  import urllib
  from collections.abc import Hashable
  from contextlib import contextmanager
  from functools import partial
  from html import entities
  from html.parser import HTMLParser
  from itertools import groupby
  from operator import attrgetter
  import dateutil.parser
  from markupsafe import Markup
  import watchfiles
label_desc: Use image node_id 14 for calling a global function with example usage: process_translations(content_list, translation_id) and returns: index,  translations, content_list,  list