docs: def _unpack_gvars(g):
      """ Unpack collection of GVars to BufferDict or numpy array. """
      if g is not None:
          g = _gvar.gvar(g)
          if not hasattr(g, 'flat'):
              # must be a scalar (ie, not an array and not a dictionary)
              g = numpy.asarray(g)
      return g