code: def xavier_init(dims: tuple[int, ...], seed: int | None = None):
      """Xavier weight initialization.
  
      References
      ----------
      [^1]: Glorot, X. and Bengio, Y., 2010, March. Understanding the difficulty of training deep
          feedforward neural networks. In Proceedings of the thirteenth international conference on
          artificial intelligence and statistics (pp. 249-256).
  
      """
  
      rng = np.random.RandomState(seed)
  
      w = {}  # weights
      b = {}  # biases
  
      for i in range(len(dims) - 1):
          w[i + 1] = rng.randn(dims[i], dims[i + 1]) / np.sqrt(dims[i])
          b[i + 1] = np.zeros(dims[i + 1], dtype=w[i + 1].dtype)
  
      return w, b
  
imports: from __future__ import annotations
  import collections
  import copy
  import functools
  import numpy
  import pandas
  from river import base, optim
label_desc: Use image node_id 1 for calling a global function with example usage: xavier_init(dims, seed) and returns: w,  b