code: def get_edge_type(
      input_dict: Dict[EdgeType, Union[Tensor, SparseTensor]],
      type2id: Dict[EdgeType, int],
  ) -> Tensor:
      inputs = [input_dict[key] for key in type2id.keys()]
      outs = []
  
      for i, value in enumerate(inputs):
          if (
              value.size(0) == 2 and value.dtype == torch.long
          ):  # edge_index
              out = value.new_full(
                  (value.size(-1),), i, dtype=torch.long
              )
          elif isinstance(value, SparseTensor):
              out = torch.full(
                  (value.nnz(),),
                  i,
                  dtype=torch.long,
                  device=value.device(),
              )
          else:
              out = value.new_full(
                  (value.size(-2),), i, dtype=torch.long
              )
          outs.append(out)
  
      return outs[0] if len(outs) == 1 else torch.cat(outs, dim=0)
  
imports: import copy
  import warnings
  from typing import Any, Dict, List, Optional, Union
  import torch
  from torch import Tensor
  from torch.nn import Module, Parameter
  from torch_geometric.nn.conv import MessagePassing
  from torch_geometric.nn.dense import Linear
  from torch_geometric.nn.fx import Transformer
  from torch_geometric.typing import EdgeType, Metadata, NodeType, SparseTensor
  from torch_geometric.utils.hetero import get_unused_node_types
label_desc: Use image node_id 4 for calling a global function with example usage: get_edge_type(input_dict, type2id) and returns: unknown