code: def _fit_frechet_mean(self, sample):
      if self.space.dim == 1:
          estimator = FrechetMean(self.space)
      else:
          estimator = FrechetMean(self.space, method="adaptive")
  
      estimator.fit(sample)
  
      return estimator.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 3 for calling the HypersphereExtrinsicTestCase obj's underlying member method code with example usage: obj._fit_frechet_mean(sample) and returns: estimator