code: def _check_hetero_data_edges(
      original: HeteroData,
      padded: HeteroData,
      max_num_edges: Optional[Union[int, Dict[EdgeType, int]]] = None,
      edge_pad_value: Optional[Padding] = None,
      is_mask_available: bool = False,
      exclude_keys: Optional[List[str]] = None,
  ):
      if is_mask_available:
          for store in padded.edge_stores:
              assert "pad_edge_mask" in store
  
      for edge_type, attr in _generate_heterodata_edges(padded):
          if attr in exclude_keys:
              assert attr not in padded[edge_type].keys()
              continue
  
          assert attr in padded[edge_type].keys()
  
          if not isinstance(padded[edge_type][attr], torch.Tensor):
              continue
  
          compare_pad_start_idx = original[edge_type].num_edges
          padded_tensor = padded[edge_type][attr]
  
          if attr == "pad_edge_mask":
              assert (
                  padded_tensor.numel() == padded[edge_type].num_edges
              )
              assert torch.all(padded_tensor[:compare_pad_start_idx])
              assert not torch.any(
                  padded_tensor[compare_pad_start_idx:]
              )
              continue
  
          original_tensor = original[edge_type][attr]
  
          if isinstance(max_num_edges, numbers.Number):
              expected_num_edges = max_num_edges
          elif (
              max_num_edges is None
              or edge_type not in max_num_edges.keys()
          ):
              v1, _, v2 = edge_type
              expected_num_edges = (
                  padded[v1].num_nodes * padded[v2].num_nodes
              )
          else:
              expected_num_edges = max_num_edges[edge_type]
  
          if attr == "edge_index":
              # Check the number of edges.
              assert padded_tensor.shape[1] == expected_num_edges
  
              # Check padded area values.
              src_nodes = original[edge_type[0]].num_nodes
              assert all(
                  i == src_nodes
                  for i in torch.flatten(
                      padded_tensor[0, compare_pad_start_idx:]
                  )
              )
              dst_nodes = original[edge_type[2]].num_nodes
              assert all(
                  i == dst_nodes
                  for i in torch.flatten(
                      padded_tensor[1, compare_pad_start_idx:]
                  )
              )
  
              # Compare non-padded area with the original.
              assert torch.equal(
                  original_tensor,
                  padded_tensor[:, :compare_pad_start_idx],
              )
          else:
              # Check padded area size.
              assert padded_tensor.shape[0] == expected_num_edges
  
              # Check padded area values.
              pad_value = (
                  edge_pad_value.get_value(edge_type, attr)
                  if edge_pad_value is not None
                  else 0.0
              )
              assert all(
                  i == pad_value
                  for i in torch.flatten(
                      padded_tensor[compare_pad_start_idx:, :]
                  )
              )
  
              # Compare non-padded area with the original.
              assert torch.equal(
                  original_tensor,
                  padded_tensor[:compare_pad_start_idx, :],
              )
  
imports: import numbers
  from typing import Dict, Generator, List, Optional, Tuple, Union
  import pytest
  import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.datasets import FakeDataset, FakeHeteroDataset
  from torch_geometric.transforms import Pad
  from torch_geometric.transforms.pad import AttrNamePadding, EdgeTypePadding, NodeTypePadding, Padding, UniformPadding
  from torch_geometric.typing import EdgeType, NodeType
label_desc: Use image node_id 10 for calling a global function with example usage: _check_hetero_data_edges(original, padded, max_num_edges, edge_pad_value, is_mask_available, exclude_keys) without return types