code: def _indexedslice(x, noshape=False):
      x = np.array(x)
      dense_shape = x.shape
      ndim = len(dense_shape)
      indices = np.where(np.sum(x, tuple(range(1, ndim))))[0]
      values = x[indices]
      if noshape:
          dense_shape = None
      return indexed_slices.IndexedSlices(
          indices=indices.tolist(),
          values=values,
          dense_shape=dense_shape,
      )
  
imports: import time
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import data_flow_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: _indexedslice(x, noshape) and returns: indexed_slices