class_docstr: `FeatureConnector` for translations with variable languages per example.
  
  Input: The TranslationVariableLanguages feature accepts a dictionary for each
    example mapping string language codes to one or more string translations.
    The languages present may vary from example to example.
  
  Output:
    language: variable-length 1D tf.Tensor of np.str_ language codes, sorted
      in ascending order.
    translation: variable-length 1D tf.Tensor of np.str_ plain text
      translations, sorted to align with language codes.
  
  Example (fixed language list):
  At construction time:
  
  ```
  tfds.features.Translation(languages=['en', 'fr', 'de'])
  ```
  
  During data generation:
  
  ```
  yield {
      'en': 'the cat',
      'fr': ['le chat', 'la chatte,']
      'de': 'die katze'
  }
  ```
  
  Tensor returned by `.as_dataset()`:
  
  ```
  {
      'language': tf.Tensor(
          shape=(4,), dtype=np.str_, numpy=array(['en', 'de', 'fr', 'fr']),
      'translation': tf.Tensor(
          shape=(4,), dtype=np.str_,
          numpy=array(['the cat', 'die katze', 'la chatte', 'le chat'])),
  }
  ```
code: def encode_example(self, translation_dict):
      if self.languages and set(translation_dict) - self._languages:
          raise ValueError(
              "Some languages in example ({0}) are not in valid set ({1}).".format(
                  ", ".join(
                      sorted(set(translation_dict) - self._languages)
                  ),
                  ", ".join(self.languages),
              )
          )
  
      # Convert dictionary into tuples, splitting out cases where there are
      # multiple translations for a single language.
      translation_tuples = []
      for lang, text in translation_dict.items():
          if isinstance(text, str):
              translation_tuples.append((lang, text))
          else:
              translation_tuples.extend([(lang, el) for el in text])
  
      # Ensure translations are in ascending order by language code.
      languages, translations = zip(*sorted(translation_tuples))
  
      return super(TranslationVariableLanguages, self).encode_example(
          {"language": languages, "translation": translations}
      )
  
imports: from __future__ import annotations
  import collections.abc
  from typing import Union
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.features import features_dict
  from tensorflow_datasets.core.features import sequence_feature
  from tensorflow_datasets.core.features import text_feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import type_utils
label_desc: Use image node_id 4 for calling the TranslationVariableLanguages obj's underlying member method code with example usage: obj.encode_example(translation_dict) and returns: super