code: def slice(
      ctx,
      x,
      start=None,
      stop=None,
      step=None,
      n_outputs=-1,
      outputs=None,
  ):
      r"""
      Slice arrays along specified axis. This function
      complies with python slice where `slice(None, None, -1)` and
      `slice(-1, None, -1)` are the special case, which flips the
      input array and results in the output array from the end to the beginning
      of the input array along the corresponding dimension.
  
  
      Args:
          x(~nnabla.Variable): N-D array
          start(repeated int64): Start indices for each axis
              [default= `(0,) * len(x.shape)` ]
          stop(repeated int64): Stop indices for each axis
              [default= `tuple(x.shape)` ]
          step(repeated int64): Step indices for each axis
              [default= `(1,) * len(x.shape)` ]
  
      Returns:
          ~nnabla.Variable: Sliced N-D array
      """
      start = (
          list(start[:]) if start is not None else len(x.shape) * (0,)
      )
      stop = list(stop[:]) if stop is not None else tuple(x.shape)
      step = list(step[:]) if step is not None else len(x.shape) * (1,)
  
      for i, (s0, s1, s2) in enumerate(zip(start, stop, step)):
          # Passing all logic to c++ side breaks the slice.args which is used in some cases; nn.grad and loading a nnp file, so handle special cases in python side.
          if s0 is None:
              if s2 is not None and s2 < 0:
                  start[i] = -1
              else:
                  start[i] = 0
          if s1 is None:
              if s2 is not None and s2 < 0:
                  stop[i] = -x.shape[i] - 1
              else:
                  stop[i] = x.shape[i]
          if s2 is None:
              step[i] = 1
  
      from .function_bases import slice as slice_base
  
      return slice_base(x, start, stop, step, n_outputs, outputs)
  
imports: from __future__ import absolute_import
  from .function_bases import *
  from .None import dtypes
  import nnabla
  import numpy
  from .normalization_functions import *
  from .numpy_compat_functions import *
label_desc: Use image node_id 12 for calling a global function with example usage: slice(ctx, x, start, stop, step, n_outputs, outputs) and returns: slice_base