def METHOD_NAME(data,
                                 in_idx=None,
                                 out_idx=None,
                                 in_channel_array=None,
                                 out_channel_array=None):
  # assert len(data.shape) in [1,2,4], 'unexpected param data shape'
  in_dim = None
  out_dim = None
  if in_channel_array is not None and in_idx is not None and not (
      in_idx == out_idx and out_channel_array is not None):
    in_dim = data.shape[in_idx] + len(in_channel_array)
  if out_idx is not None and out_channel_array is not None:
    out_dim = data.shape[out_idx] + len(out_channel_array)
  assert in_dim is not None or out_dim is not None
  expand_shape = [0] * len(data.shape)
  expand_idxs = [0] * len(data.shape)
  for idx, dim in enumerate(data.shape):
    if in_dim is not None and idx == in_idx:
      expand_shape[idx] = in_dim
      idx_in_channel = sorted(
          np.array(list(set(range(in_dim)) - set(in_channel_array))))
      expand_idxs[idx] = idx_in_channel
    elif out_dim is not None and idx == out_idx:
      expand_shape[idx] = out_dim
      idx_out_channel = sorted(
          np.array(list(set(range(out_dim)) - set(out_channel_array))))
      expand_idxs[idx] = idx_out_channel
    else:
      expand_shape[idx] = dim
      expand_idxs[idx] = np.array(range(dim))
  expand_data = np.zeros(expand_shape, dtype=data.dtype)
  expand_data[np.ix_(*expand_idxs)] = data
  return expand_data