code: def test_lpca_sharpness(rng):
      S0 = np.ones((30, 30, 30, 20), dtype=np.float64) * 100
      S0[10:20, 10:20, 10:20, :] = 50
      S0[20:30, 20:30, 20:30, :] = 0
      S0 = S0 + 20 * rng.standard_normal((30, 30, 30, 20))
      S0ns = localpca(S0, sigma=20.0)
      # check the edge gradient
      edgs = np.abs(
          np.mean(S0ns[8, 10:20, 10:20] - S0ns[12, 10:20, 10:20]) - 50
      )
      assert_(edgs < 2)
  
imports: import warnings
  import numpy
  import scipy.special
  from numpy.testing import assert_, assert_equal, assert_raises, assert_array_almost_equal, assert_warns
  from dipy.denoise.localpca import dimensionality_problem_message, create_patch_radius_arr, compute_patch_size, compute_num_samples, compute_suggested_patch_radius, localpca, mppca, genpca, _pca_classifier
  from dipy.sims.voxel import multi_tensor
  from dipy.core.gradients import gradient_table, generate_bvecs
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 7 for calling a global function with example usage: test_lpca_sharpness(rng) without return types