docs: def dynamic_import(import_string):
      """
      Dynamically import a module or object.
      """
      # Use rfind rather than rsplit for Python 2.3 compatibility.
      lastdot = import_string.rfind('.')
      if lastdot == -1:
          return __import__(import_string, {}, {}, [])
      module_name, attr = import_string[:lastdot], import_string[lastdot + 1:]
      parent_module = __import__(module_name, {}, {}, [attr])
      return getattr(parent_module, attr)