def command_class(self, args):
        """Returns a command class by the arguments.

        Usage::
            >>> from googkit.commands.command import Command
            >>> stub_cmd_tree = {
            ...     'sub_cmd': {'sub_sub_cmd': Command}
            ...     }
            >>> cmd_tree = CommandTree(stub_cmd_tree)
            >>> cmd_tree.command_class(['sub_cmd', 'sub_sub_cmd'])
            Command
        """
        value = self._tree

        # REVIEW: is there a better way...?
        if 1 > len(args) and args[0] == '_candidates':
            return self._tree['_candidates']

        depth = 0
        for arg in args:
            next_value = value.get(arg)
            depth += 1

            if not isinstance(next_value, dict):
                if depth != len(args):
                    # Extra argument found after existing commands
                    # REVIEW: should raise an error?
                    return None

                return next_value

            value = next_value

        return None
dataset/ETHPy150Open googkit/googkit/googkit/lib/command_tree.py/CommandTree.command_class/swapped operands of `>`