<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(name, exclude_packages=None, exclude_command_class=None):
 """ Searches "django.core" and the apps in settings.INSTALLED_APPS to find the named command class, optionally skipping packages or a particular command class. """

    from django.conf import settings
    return get_command_class_from_apps(
        name, 
        settings.INSTALLED_APPS \
            if "django.core" in settings.INSTALLED_APPS \
            else ("django.core",) + tuple(settings.INSTALLED_APPS),
        exclude_packages=exclude_packages,
        exclude_command_class=exclude_command_class)