def run(self, args=None):
        def adjust_logging(arg):
            """tune the logging before executing commands"""
            self.tune_arg_namespace(arg)

            if arg.time_log and os.path.exists(arg.time_log):
                self.task_times.load(arg.time_log)

            if arg.debug:
                logging.getLogger().setLevel(logging.DEBUG)
            else:
                # paramiko is very talkative even at ERROR level...
                paramiko_logger = logging.getLogger('paramiko.transport')
                paramiko_logger.setLevel(logging.CRITICAL)

                # boto blabbers http errors at ERROR severity...
                boto_logger = logging.getLogger('boto')
                boto_logger.setLevel(logging.CRITICAL)

        # strip arguments following "--"
        args = args or sys.argv[1:]
        namespace = argparse.Namespace()
        try:
            extra_loc = args.index("--")
            namespace.extras = args[extra_loc + 1:]
            args = args[:extra_loc]
        except __HOLE__:
            namespace.extras = []

        try:
            start = time.time()
            exit_code = self.parser.dispatch(argv=args,
                                             pre_call=adjust_logging,
                                             raw_output=True,
                                             namespace=namespace)
            stop = time.time()
            if namespace.time_op:  # pylint: disable=E1101
                op_name = namespace.time_op if (namespace.time_op != "-") else (" ".join(args))  # pylint: disable=E1101
                self.task_times.add_task("C", op_name, start, stop, args=args)
        except KeyboardInterrupt:
            self.log.error("*** terminated by keyboard ***")
            if namespace.pass_thru_exceptions:  # pylint: disable=E1101
                raise
            return -1
        except errors.Error as error:
            self.log.error("%s: %s", error.__class__.__name__, error)
            if namespace.pass_thru_exceptions:  # pylint: disable=E1101
                raise
            return -1
        finally:
            if namespace.time_log:  # pylint: disable=E1101
                self.task_times.save(namespace.time_log)  # pylint: disable=E1101

            rcontrol_all.manager.cleanup()

        return exit_code
dataset/ETHPy150Open ohmu/poni/poni/tool.py/Tool.run