code: def key2str(key: Union[NodeType, EdgeType]) -> str:
      key = "__".join(key) if isinstance(key, tuple) else key
      return key.replace(" ", "_").replace("-", "_").replace(":", "_")
  
imports: import copy
  import warnings
  from collections import defaultdict, deque
  from typing import Any, Dict, Optional, Tuple, Union
  import torch
  from torch.nn import Module
  from torch_geometric.nn.dense.linear import is_uninitialized_parameter
  from torch_geometric.nn.fx import Transformer, get_submodule
  from torch_geometric.typing import EdgeType, Metadata, NodeType
  from torch_geometric.utils.hetero import check_add_self_loops, get_unused_node_types
label_desc: Use image node_id 3 for calling a global function with example usage: key2str(key) and returns: key