class_docstr: A helper class to construct serializable edge types by merging an edge
  type tuple into a single string.
class_docstr_tok: ["A","helper","class","to","construct","serializable","edge","types","by","merging","an","edge","type","tuple","into","a","single","string","."]
code: def __new__(cls, *args: Any) -> "EdgeTypeStr":
      if isinstance(args[0], (list, tuple)):
          # Unwrap `EdgeType((src, rel, dst))` and `EdgeTypeStr((src, dst))`:
          args = tuple(args[0])
  
      if len(args) == 1 and isinstance(args[0], str):
          arg = args[0]  # An edge type string was passed.
  
      elif len(args) == 2 and all(isinstance(arg, str) for arg in args):
          # A `(src, dst)` edge type was passed - add `DEFAULT_REL`:
          arg = EDGE_TYPE_STR_SPLIT.join(
              (args[0], DEFAULT_REL, args[1])
          )
  
      elif len(args) == 3 and all(isinstance(arg, str) for arg in args):
          # A `(src, rel, dst)` edge type was passed:
          arg = EDGE_TYPE_STR_SPLIT.join(args)
  
      else:
          raise ValueError(f"Encountered invalid edge type '{args}'")
  
      return str.__new__(cls, arg)
  
file_path: pytorch_geometric/torch_geometric/typing.py
imports: import inspect
  import os
  import sys
  import warnings
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
label_desc: Use image node_id 1 for calling the EdgeTypeStr obj's underlying member method code with example usage: obj.__new__(cls) and returns: str