code: def dot(x: dict, y: dict):
      """Returns the dot product of two vectors represented as dicts.
  
      Parameters
      ----------
      x
      y
  
      Examples
      --------
  
      >>> from river import utils
  
      >>> x = {'x0': 1, 'x1': 2}
      >>> y = {'x1': 21, 'x2': 3}
  
      >>> utils.math.dot(x, y)
      42
  
      """
  
      if len(x) < len(y):
          return sum(xi * y[i] for i, xi in x.items() if i in y)
      return sum(x[i] * yi for i, yi in y.items() if i in x)
  
imports: from __future__ import annotations
  import functools
  import itertools
  import math
  import operator
  import numpy
  import scipy
label_desc: Use image node_id 7 for calling a global function with example usage: dot(x, y) and returns: sum, sum