code: def _make_edge_color_mapper(
      edge_color_map: _EdgeColorDict, default_color: str = "C0"
  ) -> _EdgeColorFn:
      """Helper to map edges to colors."""
  
      def edge_color_mapper(edge):
          reversed_edge = tuple(reversed(edge))
          if edge in edge_color_map:
              return edge_color_map[edge]
          elif reversed_edge in edge_color_map:
              return edge_color_map[reversed_edge]
          else:
              return default_color
  
      return edge_color_mapper
  
file_path: datasets/tensorflow_datasets/core/visualization/graph_visualizer.py
imports: from __future__ import annotations
  from typing import Any, Callable, Dict, Optional, Union
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import lazy_imports_lib
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.core.visualization import visualizer
label_desc: Use image node_id 4 for calling a global function with example usage: _make_edge_color_mapper(edge_color_map, default_color) and returns: edge_color_mapper, edge_color_map, edge_color_map, default_color