code: def _estimate_von_mises_kappa(X, n_steps=100):
      n_points = X.shape[0]
      dim = X.shape[1] - 1
  
      sum_points = gs.sum(X, axis=0)
      mean_norm = gs.linalg.norm(sum_points) / n_points
  
      kappa_estimate = (
          mean_norm
          * (dim + 1.0 - mean_norm**2)
          / (1.0 - mean_norm**2)
      )
      kappa_estimate = gs.cast(kappa_estimate, gs.float64)
      p = dim + 1
      for _ in range(n_steps):
          bessel_func_1 = scipy.special.iv(p / 2.0, kappa_estimate)
          bessel_func_2 = scipy.special.iv(
              p / 2.0 - 1.0, kappa_estimate
          )
          ratio = bessel_func_1 / bessel_func_2
          denominator = (
              1.0 - ratio**2 - (p - 1.0) * ratio / kappa_estimate
          )
          kappa_estimate -= (ratio - mean_norm) / denominator
  
      return kappa_estimate
  
imports: import random
  import pytest
  import scipy
  import geomstats.backend
  from geomstats.learning.frechet_mean import FrechetMean
  from geomstats.test.random import EmbeddedSpaceRandomDataGenerator, HypersphereIntrinsicRandomDataGenerator
  from geomstats.test.test_case import TestCase
  from geomstats.test.vectorization import generate_vectorization_data
  from geomstats.test_cases.geometry.base import LevelSetTestCase
  from geomstats.test_cases.geometry.manifold import ManifoldTestCase
  from geomstats.vectorization import get_batch_shape
label_desc: Use image node_id 1 for calling a global function with example usage: _estimate_von_mises_kappa(X, n_steps) and returns: kappa_estimate