<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_command_class_from_apps(name, apps, exclude_packages=None, exclude_command_class=None):
 """ Searches through the given apps to find the named command class. Skips over any packages specified by exclude_packages and any command class specified by exclude_command_class. Returns the last command class found or None if the command class could not be found. Django's command searching behavior is backwards with respect to other features like template and static file loaders. This function follows that convention. """

    if exclude_packages is None:
        exclude_packages = []
    for app in reversed(
        [app for app in apps if not issubpackage(app, exclude_packages)]):
        try:
            command_class = import_module(
                "{app:s}.management.commands.{name:s}".format(
                    app=app, name=name)).Command
        except (ImportError, AttributeError):
            pass
        else:
            if exclude_command_class is None or \
                not issubclass(command_class, exclude_command_class):
                return command_class
    return None