code: def split(
      permutation: np.ndarray, dimensions: List[int], overlap: int = 0
  ) -> List[np.ndarray]:
      expected_size = sum(dimensions) - (len(dimensions) - 1) * overlap
      assert len(permutation) == len(set(permutation))
      assert min(permutation) == 0
      assert max(permutation) == len(permutation) - 1
      if permutation.size != expected_size:
          raise ValueError(
              f"Permutation should have size {expected_size} for dimensions {dimensions} with overlap {overlap}"
          )
      pattern: List[np.ndarray] = []
      start_ind = 0
      for length in dimensions:
          pattern.append(permutation[start_ind : start_ind + length])
          start_ind += length - overlap
      assert start_ind == permutation.size - overlap
      return pattern
  
imports: from typing import List, Callable, Optional
  from math import exp, sqrt
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: split(permutation, dimensions, overlap) and returns: pattern