code: def test_topo_to_sph():
      """Test topo to sphere conversion."""
      rng = np.random.RandomState(0)
      angles = rng.rand(10) * 360
      radii = rng.rand(10)
      angles[0] = 30
      radii[0] = 0.25
      # new way
      sph = _topo_to_sph(np.array([angles, radii]).T)
      new = _sph_to_cart(sph)
      new[:, [0, 1]] = new[:, [1, 0]] * [-1, 1]
      # old way
      for ii, (angle, radius) in enumerate(zip(angles, radii)):
          sph_phi, sph_theta = _topo_to_phi_theta(angle, radius)
          if ii == 0:
              assert_allclose(
                  _topo_to_phi_theta(angle, radius), [45, -30]
              )
          azimuth = sph_theta / 180.0 * np.pi
          elevation = sph_phi / 180.0 * np.pi
          assert_allclose(
              sph[ii],
              [1.0, azimuth, np.pi / 2.0 - elevation],
              atol=1e-7,
          )
          r = np.ones_like(radius)
          x, y, z = _sphere_to_cartesian(azimuth, elevation, r)
          pos = [-y, x, z]
          if ii == 0:
              expected = np.array([1.0 / 2.0, np.sqrt(3) / 2.0, 1.0])
              expected /= np.sqrt(2)
              assert_allclose(pos, expected, atol=1e-7)
          assert_allclose(pos, new[ii], atol=1e-7)
  
imports: import itertools
  import os
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_almost_equal, assert_array_equal, assert_array_less, assert_equal
  import mne
  from mne import read_trans, write_trans
  from mne.datasets import testing
  from mne.fixes import _get_img_fdata
  from mne.io import read_info
  from mne.transforms import _angle_between_quats, _average_quats, _cart_to_sph, _compute_r2, _euler_to_quat, _find_trans, _find_vector_rotation, _fit_matched_points, _get_trans, _MatchedDisplacementFieldInterpolator, _pol_to_cart, _quat_real, _quat_to_affine, _quat_to_euler, _read_fs_xfm, _sph_to_cart, _topo_to_sph, _validate_pipeline, _write_fs_xfm, apply_trans, combine_transforms, get_ras_to_neuromag_trans, invert_transform, quat_to_rot, rot_to_quat, rotation, rotation3d, rotation3d_align_z_axis, rotation_angles, translation
  from mne.transforms import _SphericalSurfaceWarp
label_desc: Use image node_id 11 for calling a global function with example usage: test_topo_to_sph() without return types