docs: def import_name(name, default_ns=None):
      """Import an object based on the dotted string.
  
      >>> import_name('textwrap') # doctest: +ELLIPSIS
      <module 'textwrap' from '...'>
      >>> import_name('birding.config') # doctest: +ELLIPSIS
      <module 'birding.config' from '...'>
      >>> import_name('birding.config.get_config') # doctest: +ELLIPSIS
      <function get_config at ...>
      >>>
  
      If `ns` is provided, use it as the namespace if `name` does not have a dot.
  
      >>> ns = 'birding.config'
      >>> x = import_name('birding.config.get_config')
      >>> x # doctest: +ELLIPSIS
      <function get_config at ...>
      >>> x == import_name('get_config', default_ns=ns)
      True
      >>> x == import_name('birding.config.get_config', default_ns=ns)
      True
      >>>
      """
      if '.' not in name:
          if default_ns is None:
              return importlib.import_module(name)
          else:
              name = default_ns + '.' + name
      module_name, object_name = name.rsplit('.', 1)
      module = importlib.import_module(module_name)
      return getattr(module, object_name)