code: def import_optional(mod_name):
      ''' Attempt to import an optional dependency.
  
      Silently returns None if the requested module is not available.
  
      Args:
          mod_name (str) : name of the optional module to try to import
  
      Returns:
          imported module or None, if import fails
  
      '''
      try:
          return import_module(mod_name)
      except ImportError:
          pass
      except Exception:
          msg = "Failed to import optional module `{}`".format(mod_name)
          log.exception(msgf import_optional(mod_name):
      ''' Attempt to import an optional dependency.
  
      Silently returns None if the requested module is not available.
  
      Args:
          mod_name (str) : name of the optional module to try to import
  
      Returns:
          imported module or None, if import fails
  
      '''
      try:
          return import_module(mod_name)
      except ImportError:
          pass
      except Exception:
          msg = "Failed to import optional module `{}`".format(mod_name)
          log.exception(msg)
docs: Attempt to import an optional dependency.
  
      Silently returns None if the requested module is not available.
  
      Args:
          mod_name (str) : name of the optional module to try to import
  
      Returns:
          imported module or None, if import fails