def install(h, pip, groups, save, save_dev, packages):
    """Install a pip or bower package."""
    if groups:
        groups = [text_type.strip(group) for group in groups.split(",")]
    else:
        groups = h.requirements.keys()

    if not packages:
        for group in groups:
            if group not in h.requirements:
                warning("{} not in requirements".format(group))
                continue
            install = (h.install_bower if group.startswith("bower")
                       else h.install_pip)
            for requirement in h.requirements[group]:
                install(str(requirement), save=False, save_dev=False)
    if pip:
        for package in packages:
            h.install_pip(package, save=save, save_dev=save_dev)
    else:
        for package in packages:
            h.install_bower(package, save=save, save_dev=save_dev)
def execute_rpc_implementor(self, audit_name, target, response_queue,
                                args, kwargs):
        """
        Honor a remote procedure call request from a plugin.

        :param audit_name: Name of the audit requesting the call.
        :type audit_name: str

        :param target: RPC implementor function.
        :type target: callable

        :param response_queue: Response queue identity.
        :type response_queue: str

        :param args: Positional arguments to the call.
        :type args: tuple

        :param kwargs: Keyword arguments to the call.
        :type kwargs: dict
        """
        try:

            # Call the implementor and get the response.
            response = target(self.orchestrator, audit_name, *args, **kwargs)
            success  = True

        # Catch exceptions and prepare them for sending.
        except Exception:
            if response_queue:
                response = self.prepare_exception(*sys.exc_info())
                success  = False

        # If the call was synchronous,
        # send the response/error back to the plugin.
        if response_queue:
            self.orchestrator.messageManager.send(
                response_queue, (success, response))