code: def set_attr(obj: object, name: str, val: object):
      """Set the attribute of an object.
  
      Examples
      --------
      >>> from deepchem.utils import set_attr
      >>> class MyClass:
      ...     def __init__(self):
      ...         self.a = 1
      ...         self.b = 2
      >>> obj = MyClass()
      >>> set_attr(obj, "a", 3)
      >>> set_attr(obj, "c", 4)
      >>> obj.a
      3
      >>> obj.c
      4
  
      Parameters
      ----------
      obj : object
          The object to set the attribute to.
      name : str
          The name of the attribute.
      val : object
          The value to set the attribute to.
  
      Returns
      -------
  
      """
      return _set_attr(obj, _preproc_name(name), val)
  
file_path: deepchem/deepchem/utils/attribute_utils.py
imports: import re
  import ast
  from typing import Callable, Any
label_desc: Use image node_id 2 for calling a global function with example usage: set_attr(obj, name, val) and returns: _set_attr