code: def _unflatten_and_set_shape(schema, ngram, fields_as_list):
      """Takes a flat list of fields produced by _flatten function and unflatten it back into an ngrams dictionary"""
      fields_as_namedtuple = make_namedtuple_tf_ngram(
          schema, ngram, *fields_as_list
      )
  
      # We change the key to str format here in order to be able to use ** later to expand the dictionary as kargs.
      fields_as_dict = {
          str(timestep): fields_as_namedtuple[timestep]._asdict()
          for timestep in fields_as_namedtuple
      }
  
      for timestep in fields_as_dict:
          _set_shape(schema, fields_as_dict[timestep])
  
      return make_namedtuple_tf_ngram(schema, ngram, **fields_as_dict)
  
imports: import datetime
  import sys
  import warnings
  from calendar import timegm
  from collections import OrderedDict, namedtuple
  from decimal import Decimal
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 15 for calling a global function with example usage: _unflatten_and_set_shape(schema, ngram, fields_as_list) and returns: make_namedtuple_tf_ngram