code: def _packed_nest_with_indices(structure, flat, index):
      packed = []
      for s in _yield_value(structure):
          if is_sequence(s):
              new_index, child = _packed_nest_with_indices(
                  s, flat, index
              )
              packed.append(_sequence_like(s, child))
              index = new_index
          else:
              packed.append(flat[index])
              index += 1
      return index, packed
  
file_path: analytics-zoo/pyzoo/zoo/util/nest.py
imports: import six
label_desc: Use image node_id 6 for calling a global function with example usage: _packed_nest_with_indices(structure, flat, index) and returns: index,  packed