code: def _get_nsplits(cls, op):
      assert op.input.ndim == 1
      k = op.k
      nsplits_1d = op.input.nsplits[0]
      nsplit_0, nsplit_1 = list(nsplits_1d), list(nsplits_1d)
      if k > 0:
          nsplit_0.append(k)
          nsplit_1.insert(0, k)
      elif k < 0:
          nsplit_0.insert(0, abs(k))
          nsplit_1.append(abs(k))
      return nsplit_0, nsplit_1
  
imports: import itertools
  import numpy
  from ...None import opcodes
  from ...serialization.serializables import KeyField, Int32Field
  from ...utils import has_unknown_shape
  from ..core import TENSOR_TYPE
  from ...lib.sparse import diag
  from ...lib.sparse.core import issparse, get_array_module, get_sparse_module
  from ...lib import sparse
  from ..core import TensorOrder
  from ..array_utils import create_array
  from .core import TensorHasInput
  from .zeros import TensorZeros
  from .array import tensor
label_desc: Use image node_id 4 for calling the TensorDiag obj's underlying member method code with example usage: obj._get_nsplits(cls, op) and returns: nsplit_0,  nsplit_1