code: def reduce_params(
      model,
      param_reducer: callable,
      include_weights=True,
      include_bias=False,
  ):
      """aggregate weights or biases, use param_reducer to transform tensor to scaler"""
  
      # TODO: handle Pytorch and TF models separately
      # get parameters for each submodule
      for i, (param_group_name, param_group) in enumerate(
          model.named_parameters()
      ):
          if param_group.requires_grad:
              is_bias = "bias" in param_group_name
              if (include_weights and not is_bias) or (
                  include_bias and is_bias
              ):
                  yield PointData(
                      x=i,
                      y=param_reducer(param_group),
                      annotation=param_group_name,
                  )
  
imports: import math
  import numpy
  import random
  import heapq
  from .None import utils
  from .lv_types import ImageData, PointData
  from collections import OrderedDict
  from itertools import groupby, islice
  import operator
  from typing import Callable, List, Iterable, Any, Sized, Tuple
  from .None import utils
  from .None import tensor_utils
label_desc: Use image node_id 7 for calling a global function with example usage: reduce_params(model, param_reducer, include_weights, include_bias) without return types