code: def separate_struct_array(array, dtypes):
      
      try:
          offsets = np.cumsum([np.dtype(dtype).itemsize for dtype in dtypes])
      except TypeError:
          dtype_size = np.dtype(dtypes).itemsize
          num_fields = int(array.nbytes / (array.size * dtype_size))
          offsets = np.cumsum([dtype_size] * num_fields)
          dtypes = [dtypes] * num_fields
      offsets = np.concatenate([[0], offsets]).astype(int)
      uint_array = array.view(np.uint8).reshape(array.shape + (-1,))
      return [
          uint_array[..., offsets[idx]:offsets[idx+1]].flatten().view(dtype)
          for idx, dtype in enumerate(dtypes)
      ]
docs: Takes an array with a structured dtype, and separates it out into
      a list of arrays with dtypes coming from the input ``dtypes``.
      Does the inverse of ``join_struct_arrays``.
  
      :param np.ndarray array: Structured array.
      :param dtypes: List of ``np.dtype``, or just a ``np.dtype`` and the number of
          them is figured out automatically by counting bytes.