code: def overlap(a, b, M):
      b_sum = degree(b, M)
      if b_sum == 0:
          return float("NaN")
  
      a_sum = degree(a, M)
  
      i = intersection(a, b, M)
      total = min(a_sum, b_sum)
      return i / total
  
imports: import gc
  import pytest
  import numpy
  import scipy
  import cudf
  import cugraph
  from cugraph.testing import utils, UNDIRECTED_DATASETS
  from cudf.testing import assert_series_equal
  from cudf.testing.testing import assert_frame_equal
label_desc: Use image node_id 6 for calling a global function with example usage: overlap(a, b, M) and returns: unknown, float