code: def create_patch_radius_arr(arr, pr):
      """Create the patch radius array from the data to be denoised and the patch
      radius.
  
      Parameters
      ----------
      arr : ndarray
          Data to be denoised.
      pr : int or ndarray
          Patch radius.
  
      Returns
      -------
      patch_radius : ndarray
          Number of samples.
      """
  
      patch_radius = copy.deepcopy(pr)
  
      if isinstance(patch_radius, int):
          patch_radius = np.ones(3, dtype=int) * patch_radius
      if len(patch_radius) != 3:
          raise ValueError("patch_radius should have length 3")
      else:
          patch_radius = np.asarray(patch_radius).astype(int)
      patch_radius[
          arr.shape[0:3] == np.ones(3)
      ] = 0  # account for dim of size 1
  
      return patch_radius
  
file_path: dipy/dipy/denoise/localpca.py
imports: import copy
  from packaging.version import Version
  from warnings import warn
  import numpy
  import scipy
  from scipy.linalg import eigh
  from dipy.denoise.pca_noise_estimate import pca_noise_estimate
label_desc: Use image node_id 3 for calling a global function with example usage: create_patch_radius_arr(arr, pr) and returns: patch_radius