code: def _update_parameter(value, new_value, inertia=0.0, frozen=None):
      """Update a parameters unles."""
  
      if hasattr(value, "frozen") and getattr(value, "frozen") == True:
          return
  
      if inertia == 0.0:
          value[...] = _cast_as_parameter(new_value)
  
      elif inertia < 1.0:
          value_ = inertia * value + (1 - inertia) * new_value
  
          inf_idx = torch.isinf(value)
          inf_idx_new = torch.isinf(new_value)
  
          value_[inf_idx] = value[inf_idx].type(value_.dtype)
          value_[inf_idx_new] = new_value[inf_idx_new].type(
              value_.dtype
          )
  
          value[:] = _cast_as_parameter(value_)
  
file_path: pomegranate/pomegranate/_utils.py
imports: import numpy
  import torch
  import collections
  from apricot import FacilityLocationSelection
  from apricot import FeatureBasedSelection
label_desc: Use image node_id 4 for calling a global function with example usage: _update_parameter(value, new_value, inertia, frozen) without return types