code: def generate_encoders_by_class_tuples(
      type_encoder_map: Dict[Any, Callable[[Any], Any]]
  ) -> Dict[Callable[[Any], Any], Tuple[Any, ...]]:
      encoders_by_class_tuples: Dict[
          Callable[[Any], Any], Tuple[Any, ...]
      ] = defaultdict(tuple)
      for type_, encoder in type_encoder_map.items():
          encoders_by_class_tuples[encoder] += (type_,)
      return encoders_by_class_tuples
  
imports: import dataclasses
  import datetime
  from collections import defaultdict, deque
  from decimal import Decimal
  from enum import Enum
  from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network
  from pathlib import Path, PurePath
  from re import Pattern
  from types import GeneratorType
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
  from uuid import UUID
  from fastapi.types import IncEx
  from pydantic import BaseModel
  from pydantic.color import Color
  from pydantic.networks import AnyUrl, NameEmail
  from pydantic.types import SecretBytes, SecretStr
  from typing_extensions import Annotated, Doc
  from ._compat import PYDANTIC_V2, Url, _model_dump
label_desc: Use image node_id 3 for calling a global function with example usage: generate_encoders_by_class_tuples(type_encoder_map) and returns: encoders_by_class_tuples