original_docstring: 
      Calculate the slices to copy a sliced area of array `src' into array `dest'. The area has dimensions `dims' (use 0
      or None to copy everything in that dimension), the source area is centered at `srccenter' index in `src' and copied
      into area centered at `destcenter' in `dest'. The dimensions of the copied area will be clipped to fit within the
      source and destination arrays so a smaller area may be copied than expected. Return value is the tuples of slice
      objects indexing the copied area in `src', and those indexing the copy area in `dest'.
  
      Example:
          src=np.random.randint(0,10,(6,6))
          dest=np.zeros_like(src)
          srcslices,destslices=copypasteArrays(src,dest,(3,2),(2,1),(3,4))
          dest[destslices]=src[srcslices]
          print(src)
          print(dest)
  
          >>> [[9 5 6 6 9 6]
               [4 3 5 6 1 2]
               [0 7 3 2 4 1]
               [3 0 0 1 5 1]
               [9 4 7 1 8 2]
               [6 6 5 8 6 7]]
              [[0 0 0 0 0 0]
               [7 3 2 4 0 0]
               [0 0 1 5 0 0]
               [4 7 1 8 0 0]
               [0 0 0 0 0 0]
               [0 0 0 0 0 0]]
      
docstring: Calculate the slices to copy a sliced area of array `src' into array `dest'.
docstring_tokens: Calculate the slices to copy a sliced area of array ` src ' into array ` dest ' .
code: def copypaste_arrays(src, dest, srccenter, destcenter, dims):
      """
      Calculate the slices to copy a sliced area of array `src' into array `dest'. The area has dimensions `dims' (use 0
      or None to copy everything in that dimension), the source area is centered at `srccenter' index in `src' and copied
      into area centered at `destcenter' in `dest'. The dimensions of the copied area will be clipped to fit within the
      source and destination arrays so a smaller area may be copied than expected. Return value is the tuples of slice
      objects indexing the copied area in `src', and those indexing the copy area in `dest'.
  
      Example:
          src=np.random.randint(0,10,(6,6))
          dest=np.zeros_like(src)
          srcslices,destslices=copypasteArrays(src,dest,(3,2),(2,1),(3,4))
          dest[destslices]=src[srcslices]
          print(src)
          print(dest)
  
          >>> [[9 5 6 6 9 6]
               [4 3 5 6 1 2]
               [0 7 3 2 4 1]
               [3 0 0 1 5 1]
               [9 4 7 1 8 2]
               [6 6 5 8 6 7]]
              [[0 0 0 0 0 0]
               [7 3 2 4 0 0]
               [0 0 1 5 0 0]
               [4 7 1 8 0 0]
               [0 0 0 0 0 0]
               [0 0 0 0 0 0]]
      """
      srcslices = [slice(None)] * src.ndim
      destslices = [slice(None)] * dest.ndim
  
      for i, ss, ds, sc, dc, dim in zip(range(src.ndim), src.shape, dest.shape, srccenter, destcenter, dims):
          if dim:
              # dimension before midpoint, clip to size fitting in both arrays
              d1 = np.clip(dim // 2, 0, min(sc, dc))
              # dimension after midpoint, clip to size fitting in both arrays
              d2 = np.clip(dim // 2 + 1, 0, min(ss - sc, ds - dc))
  
              srcslices[i] = slice(sc - d1, sc + d2)
              destslices[i] = slice(dc - d1, dc + d2)
  
      return tuple(srcslices), tuple(destslices)
code_tokens: def copypaste_arrays ( src , dest , srccenter , destcenter , dims ) : srcslices = [ slice ( None ) ] * src . ndim destslices = [ slice ( None ) ] * dest . ndim for i , ss , ds , sc , dc , dim in zip ( range ( src . ndim ) , src . shape , dest . shape , srccenter , destcenter , dims ) : if dim : d1 = np . clip ( dim // 2 , 0 , min ( sc , dc ) ) d2 = np . clip ( dim // 2 + 1 , 0 , min ( ss - sc , ds - dc ) ) srcslices [ i ] = slice ( sc - d1 , sc + d2 ) destslices [ i ] = slice ( dc - d1 , dc + d2 ) return tuple ( srcslices ) , tuple ( destslices )
short_docstring: Calculate the slices to copy a sliced area of array `src' into array `dest'.
short_docstring_tokens: Calculate the slices to copy a sliced area of array ` src ' into array ` dest ' .
comment: """
      Calculate the slices to copy a sliced area of array `src' into array `dest'. The area has dimensions `dims' (use 0
      or None to copy everything in that dimension), the source area is centered at `srccenter' index in `src' and copied
      into area centered at `destcenter' in `dest'. The dimensions of the copied area will be clipped to fit within the
      source and destination arrays so a smaller area may be copied than expected. Return value is the tuples of slice
      objects indexing the copied area in `src', and those indexing the copy area in `dest'.
  
      Example:
          src=np.random.randint(0,10,(6,6))
          dest=np.zeros_like(src)
          srcslices,destslices=copypasteArrays(src,dest,(3,2),(2,1),(3,4))
          dest[destslices]=src[srcslices]
          print(src)
          print(dest)
  
          >>> [[9 5 6 6 9 6]
               [4 3 5 6 1 2]
               [0 7 3 2 4 1]
               [3 0 0 1 5 1]
               [9 4 7 1 8 2]
               [6 6 5 8 6 7]]
              [[0 0 0 0 0 0]
               [7 3 2 4 0 0]
               [0 0 1 5 0 0]
               [4 7 1 8 0 0]
               [0 0 0 0 0 0]
               [0 0 0 0 0 0]]
      """$SEP$# dimension before midpoint, clip to size fitting in both arrays$SEP$# dimension after midpoint, clip to size fitting in both arrays