code: def install(source, package_id):
      '''
      Install a .pkg from an URI or an absolute path.
  
      :param str source: The path to a package.
  
      :param str package_id: The package ID
  
      :return: True if successful, otherwise False
      :rtype: bool
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' pkgutil.install source=/vagrant/build_essentials.pkg package_id=com.apple.pkg.gcc4.2Leo
      '''
      if is_installed(package_id):
          return True
  
      uri = urllib.parse.urlparse(source)
      if not uri.scheme == '':
          msg = 'Unsupported scheme for source uri: {0}'.format(uri.scheme)
          raise SaltInvocationError(msg)
  
      _install_from_path(source)
  
      return is_installed(package_idf install(source, package_id):
      '''
      Install a .pkg from an URI or an absolute path.
  
      :param str source: The path to a package.
  
      :param str package_id: The package ID
  
      :return: True if successful, otherwise False
      :rtype: bool
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' pkgutil.install source=/vagrant/build_essentials.pkg package_id=com.apple.pkg.gcc4.2Leo
      '''
      if is_installed(package_id):
          return True
  
      uri = urllib.parse.urlparse(source)
      if not uri.scheme == '':
          msg = 'Unsupported scheme for source uri: {0}'.format(uri.scheme)
          raise SaltInvocationError(msg)
  
      _install_from_path(source)
  
      return is_installed(package_id)
docs: Install a .pkg from an URI or an absolute path.
  
      :param str source: The path to a package.
  
      :param str package_id: The package ID
  
      :return: True if successful, otherwise False
      :rtype: bool
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' pkgutil.install source=/vagrant/build_essentials.pkg package_id=com.apple.pkg.gcc4.2Leo