code: def dotvecmat(x, A):
      """Vector times matrix from left side, i.e. transpose(x)A.
  
      Parameters
      ----------
      x
      A
  
      Examples
      --------
  
      >>> from river import utils
  
      >>> x = {0: 4, 1: 5}
  
      >>> A = {
      ...     (0, 0): 0, (0, 1): 1,
      ...     (1, 0): 2, (1, 1): 3
      ... }
  
      >>> C = utils.math.dotvecmat(x, A)
      >>> print(C)
      {0: 10.0, 1: 19.0}
  
      """
  
      C = {}
  
      for (i, xi), ((j, k), ai) in itertools.product(
          x.items(), A.items()
      ):
          if i != j:
              continue
  
          C[k] = C.get(k, 0.0) + xi * ai
  
      return C
  
imports: from __future__ import annotations
  import functools
  import itertools
  import math
  import operator
  import numpy
  import scipy
label_desc: Use image node_id 1 for calling a global function with example usage: dotvecmat(x, A) and returns: C