class_docstr: A ``PropertyDescriptor`` for Bokeh ``UnitsSpec`` properties that
  contribute associated ``_units`` properties automatically as a side effect.
class_docstr_tok: ["A","``","PropertyDescriptor","``","for","Bokeh","``","UnitsSpec","``","properties","that","contribute","associated","``","_units","``","properties","automatically","as","a","side","effect","."]
docstr: Internal helper for dealing with units associated units properties
  when setting values on ``UnitsSpec`` properties.
  
  When ``value`` is a dict, this function may mutate the value of the
  associated units property.
  
  Args:
      obj (HasProps) : instance to update units spec property value for
      value (obj) : new value to set for the property
  
  Returns:
      copy of ``value``, with 'units' key and value removed when
      applicable
code: def _extract_units(self, obj, value):
      """Internal helper for dealing with units associated units properties
      when setting values on ``UnitsSpec`` properties.
  
      When ``value`` is a dict, this function may mutate the value of the
      associated units property.
  
      Args:
          obj (HasProps) : instance to update units spec property value for
          value (obj) : new value to set for the property
  
      Returns:
          copy of ``value``, with 'units' key and value removed when
          applicable
  
      """
      if isinstance(value, dict):
          if "units" in value:
              value = copy(value)  # so we can modify it
          units = value.pop("units", None)
          if units:
              self.units_prop.__set__(obj, units)
      return value
  
imports: from __future__ import annotations
  import logging
  from copy import copy
  from types import FunctionType
  from typing import TYPE_CHECKING, Any, Callable, Generic, TypeVar
  from ...util.deprecation import deprecated
  from .singletons import Undefined
  from .wrappers import PropertyValueColumnData, PropertyValueContainer
label_desc: Use image node_id 4 for calling the UnitsSpecPropertyDescriptor obj's underlying member method code with example usage: obj._extract_units(obj, value) and returns: value