code: def nest(thing):
      
      tfutil = util.get_module('tensorflow.python.util')
      if tfutil:
          return tfutil.nest.flatten(thing)
      else:
          return [thing]
docs: Use tensorflows nest function if available, otherwise just wrap object in an array