code: def _find_edges_to_exclude(g, pair_eids, degree_threshold):
      src, dst = g.find_edges(pair_eids)
      head_degree = g.in_degrees(src)
      tail_degree = g.in_degrees(dst)
      degree = torch.min(head_degree, tail_degree)
      degree_mask = degree < degree_threshold
      low_degree_pair_eids = pair_eids[degree_mask]
      low_degree_pair_eids = torch.cat(
          [low_degree_pair_eids, low_degree_pair_eids + 1000]
      )
      return low_degree_pair_eids
  
file_path: dgl/tests/python/pytorch/dataloading/test_spot_target.py
imports: from collections.abc import Mapping
  import dgl
  import numpy
  import pytest
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: _find_edges_to_exclude(g, pair_eids, degree_threshold) and returns: low_degree_pair_eids