def main(self, raw_args=None):
        '''Start to parse the raw arguments and send them to a
        :py:class:`~clime.core.Command` instance.

        :param raw_args: The arguments from command line. By default, it takes from ``sys.argv``.
        :type raw_args: list
        '''

        if raw_args is None:
            raw_args = sys.argv[1:]
        elif isinstance(raw_args, str):
            raw_args = raw_args.split()

        # try to find a command name in the raw arguments.
        cmd_name = None
        cmd_func = None

        if len(raw_args) == 0:
            pass
        elif not self.ignore_help and ('--help', '-h') in raw_args[0]:
            self.print_usage()
            return
        else:
            cmd_func = self.command_funcs.get(raw_args[0].replace('-', '_'))
            if cmd_func is not None:
                cmd_name = raw_args.pop(0).replace('-', '_')

        if cmd_func is None:
            # we can't find a command name in normal procedure
            if self.default:
                cmd_name = cmd_name
                cmd_func = self.command_funcs[self.default]
            else:
                self.print_usage()
                return

        if not self.ignore_help and '--help' in raw_args:
            # the user requires help of this command
            self.print_usage(cmd_name)
            return

        # convert the function to a Command object
        cmd = Command(cmd_func, cmd_name)

        try:
            # execute the command with the raw arguments
            return_val = cmd.execute(raw_args)
        except BaseException as e:

            if self.debug:
                raise

            self.complain('exception: {}: {}'.format(
                e.__class__.__name__,
                e
            ))
            sys.exit(1)

        if not self.ignore_return and return_val is not None:
            if inspect.isgenerator(return_val):
                for i in return_val:
                    print(i)
            else:
                print(return_val)
dataset/ETHPy150Open moskytw/clime/clime/core.py/Program.main/swapped operands of `in`