code: def _topo_to_sphere(pos, eegs):
      """Transform xy-coordinates to sphere.
  
      Parameters
      ----------
      pos : array-like, shape (n_channels, 2)
          xy-oordinates to transform.
      eegs : list of int
          Indices of EEG channels that are included when calculating the sphere.
  
      Returns
      -------
      coords : array, shape (n_channels, 3)
          xyz-coordinates.
      """
      xs, ys = np.array(pos).T
  
      sqs = np.max(np.sqrt((xs[eegs] ** 2) + (ys[eegs] ** 2)))
      xs /= sqs  # Shape to a sphere and normalize
      ys /= sqs
  
      xs += 0.5 - np.mean(xs[eegs])  # Center the points
      ys += 0.5 - np.mean(ys[eegs])
  
      xs = xs * 2.0 - 1.0  # Values ranging from -1 to 1
      ys = ys * 2.0 - 1.0
  
      rs = np.clip(np.sqrt(xs**2 + ys**2), 0.0, 1.0)
      alphas = np.arccos(rs)
      zs = np.sin(alphas)
      return np.column_stack([xs, ys, zs])
  
imports: import logging
  from collections import defaultdict
  from itertools import combinations
  from pathlib import Path
  import numpy
  from scipy.spatial.distance import pdist, squareform
  from .._fiff.constants import FIFF
  from .._fiff.meas_info import Info
  from .._fiff.pick import _FNIRS_CH_TYPES_SPLIT, _picks_to_idx, pick_types
  from ..transforms import _cart_to_sph, _pol_to_cart
  from ..utils import _check_ch_locs, _check_fname, _check_option, _check_sphere, _clean_names, fill_doc, logger, warn
  from ..viz.topomap import plot_layout
  from .channels import _get_ch_info
label_desc: Use image node_id 11 for calling a global function with example usage: _topo_to_sphere(pos, eegs) and returns: np