code: def _load_register_for_paths(
      namespace: str,
      paths: List[epath.Path],
  ) -> List[register_base.BaseRegister]:
      """Returns a list of registers for the given paths."""
      code_paths = []
      data_paths = []
      for path in paths:
          if os.fspath(path).startswith("github"):
              code_paths.append(path)
          else:
              data_paths.append(path)
  
      if code_paths and data_paths:
          raise RuntimeError(
              f"Both a path containing code ({code_paths}) and "
              f"a path containing data ({data_paths} are specified. "
              "This is not supported"
          )
  
      registers = []
      if data_paths:
          register = register_path.DataDirRegister(
              namespace_to_data_dirs={namespace: data_paths}
          )
          registers.append(register)
      if code_paths:
          registers.append(
              register_package.PackageRegister(
                  path=gcs_utils.GCS_COMMUNITY_INDEX_PATH
              )
          )
      return registers
  
imports: import dataclasses
  import difflib
  import functools
  import os
  from typing import Any, Iterable, List, Mapping, Type
  from absl import logging
  from etils import epath
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import github_api
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import registered
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.community import register_base
  from tensorflow_datasets.core.community import register_package
  from tensorflow_datasets.core.community import register_path
  from tensorflow_datasets.core.utils import gcs_utils
  import toml
label_desc: Use image node_id 2 for calling a global function with example usage: _load_register_for_paths(namespace, paths) and returns: registers