code: def get_examples(self, compact=False):
          
          # Copy it just in case the caller wants to mutate the object.
          examples = copy.deepcopy(self._examples)
          if not compact:
              return examples
  
          def make_compact(d):
              # Traverse through dicts looking for ones that have a lone .tag
              # key, which can be converted into the compact form.
              if not isinstance(d, dict):
                  return
              for key in d:
                  if isinstance(d[key], dict):
                      inner_d = d[key]
                      if len(inner_d) == 1 and '.tag' in inner_d:
                          d[key] = inner_d['.tag']
                      else:
                          make_compact(inner_d)
                  if isinstance(d[key], list):
                      for item in d[key]:
                          make_compact(item)
  
          for example in examples.values():
              if (isinstance(example.value, dict) and
                      len(example.value) == 1 and '.tag' in example.value):
                  # Handle the case where the top-level of the example can be
                  # made compact.
                  example.value = example.value['.tag']
              else:
                  make_compact(example.value)
  
          return examples
docs: Returns an OrderedDict mapping labels to Example objects.
  
          Args:
              compact (bool): If True, union members of void type are converted
                  to their compact representation: no ".tag" key or containing
                  dict, just the tag as a string.