code: def trim_tensor(tensor, trim_low=None, trim_high=None):
      if trim_low is None:
          if trim_high is None:
              return tensor
          dim_slices = [
              slice(0, -1 if is_high else None)
              for dim_len, is_high in zip(tensor.shape, trim_high)
          ]
      else:
          if trim_high is None:
              dim_slices = [
                  slice(int(is_low), None)
                  for dim_len, is_low in zip(tensor.shape, trim_low)
              ]
          else:
              dim_slices = [
                  slice(int(is_low), -1 if is_high else None)
                  for dim_len, is_low, is_high in zip(
                      tensor.shape, trim_low, trim_high
                  )
              ]
      return tensor[tuple(dim_slices)]
  
imports: from itertools import count
  import numpy
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: trim_tensor(tensor, trim_low, trim_high) and returns: tensor, tensor