code: def _ovewrite_named_param(
      kwargs: Dict[str, Any], param: str, new_value: V
  ) -> None:
      if param in kwargs:
          if kwargs[param] != new_value:
              raise ValueError(
                  f"The parameter '{param}' expected value {new_value} but got {kwargs[param]} instead."
              )
      else:
          kwargs[param] = new_value
  
file_path: vision/torchvision/models/_utils.py
imports: import functools
  import inspect
  import warnings
  from collections import OrderedDict
  from typing import Any, Callable, Dict, Optional, Tuple, TypeVar, Union
  from torch import nn
  from .._utils import sequence_to_str
  from ._api import WeightsEnum
label_desc: Use image node_id 4 for calling a global function with example usage: _ovewrite_named_param(kwargs, param, new_value) without return types