code: def get_parameters(
      module: Module,
      requires_grad: Optional[bool] = None,
      name_filter: Optional[Callable[[str], bool]] = None,
  ) -> Dict[str, Tensor]:
      r"""Helper method for obtaining a module's parameters and their respective ranges.
  
      Args:
          module: The target module from which parameters are to be extracted.
          requires_grad: Optional Boolean used to filter parameters based on whether
              or not their require_grad attribute matches the user provided value.
          name_filter: Optional Boolean function used to filter parameters by name.
  
      Returns:
          A dictionary of parameters.
      """
      parameters = {}
      for name, param in module.named_parameters():
          if (
              requires_grad is not None
              and param.requires_grad != requires_grad
          ):
              continue
  
          if name_filter and not name_filter(name):
              continue
  
          parameters[name] = param
  
      return parameters
  
file_path: botorch/botorch/optim/utils/model_utils.py
imports: from __future__ import annotations
  from re import Pattern
  from typing import Any, Callable, Dict, Iterator, NamedTuple, Optional, Tuple, Union
  from warnings import warn
  import torch
  from botorch.exceptions.warnings import BotorchWarning
  from botorch.models.gpytorch import GPyTorchModel
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, TensorDataset
label_desc: Use image node_id 2 for calling a global function with example usage: get_parameters(module, requires_grad, name_filter) and returns: parameters