code: def set_default_attr(obj, name, value):
      """Set the `name` attribute of `obj` to `value` if the attribute does not already exist
  
      Parameters
      ----------
      obj: Object
          Object whose `name` attribute will be returned (after setting it to `value`, if necessary)
      name: String
          Name of the attribute to set to `value`, or to return
      value: Object
          Default value to give to `obj.name` if the attribute does not already exist
  
      Returns
      -------
      Object
          `obj.name` if it exists. Else, `value`
  
      Examples
      --------
      >>> foo = type("Foo", tuple(), {"my_attr": 32})
      >>> set_default_attr(foo, "my_attr", 99)
      32
      >>> set_default_attr(foo, "other_attr", 9000)
      9000
      >>> assert foo.my_attr == 32
      >>> assert foo.other_attr == 9000
      """
      try:
          return getattr(obj, name)
      except AttributeError:
          setattr(obj, name, value)
      return value
  
imports: from hyperparameter_hunter.utils.boltons_utils import remap, default_enter
  from datetime import datetime
  from inspect import Traceback
  import re
  import string
  from typing import Any, Callable, Iterable, List, Tuple, Union
  import wrapt
label_desc: Use image node_id 10 for calling a global function with example usage: set_default_attr(obj, name, value) and returns: value, getattr