code: def split(self, image, border_type=cv2.BORDER_CONSTANT, value=0):
      assert image.shape[0] == self.image_height
      assert image.shape[1] == self.image_width
  
      orig_shape_len = len(image.shape)
      image = cv2.copyMakeBorder(
          image,
          self.margin_top,
          self.margin_bottom,
          self.margin_left,
          self.margin_right,
          borderType=border_type,
          value=value,
      )
  
      # This check recovers possible lack of last dummy dimension for single-channel images
      if len(image.shape) != orig_shape_len:
          image = np.expand_dims(image, axis=-1)
  
      tiles = []
      for x, y, tile_width, tile_height in self.crops:
          tile = image[
              y : y + tile_height, x : x + tile_width
          ]  # .copy()
          assert tile.shape[0] == self.tile_size[0]
          assert tile.shape[1] == self.tile_size[1]
  
          tiles.append(tile)
  
      return tiles
  
imports: import dataclasses
  import math
  from typing import List, Iterable, Tuple, Union, Sequence
  import cv2
  import numpy
  import torch
label_desc: Use image node_id 3 for calling the ImageSlicer obj's underlying member method code with example usage: obj.split(image, border_type, value) and returns: tiles