code: def fast_intersection_size(ar1, ar2):
      if ar1.shape[0] == 0 or ar2.shape[0] == 0:
          return 0
  
      # NOTE: We assume arrays are sorted; if they are not this will break
      i1 = 0
      i2 = 0
      limit1 = ar1.shape[0] - 1
      limit2 = ar2.shape[0] - 1
      j1 = ar1[i1]
      j2 = ar2[i2]
  
      result = 0
  
      while True:
          if j1 == j2:
              result += 1
              if i1 < limit1:
                  i1 += 1
                  j1 = ar1[i1]
              else:
                  break
  
              if i2 < limit2:
                  i2 += 1
                  j2 = ar2[i2]
              else:
                  break
  
          elif j1 < j2 and i1 < limit1:
              i1 += 1
              j1 = ar1[i1]
          elif j2 < j1 and i2 < limit2:
              i2 += 1
              j2 = ar2[i2]
          else:
              break
  
      return result
  
imports: from __future__ import print_function
  import locale
  import numpy
  import numba
  from pynndescent.utils import norm, tau_rand
  from pynndescent.distances import kantorovich, jensen_shannon_divergence, symmetric_kl_divergence
label_desc: Use image node_id 5 for calling a global function with example usage: fast_intersection_size(ar1, ar2) and returns: result, int