<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_media_backend(fail_silently=True, handles_media_types=None, handles_file_extensions=None, supports_thumbnails=None):
 """ Returns the MediaBackend subclass that is configured for use with media_tree. """

        backends = app_settings.MEDIA_TREE_MEDIA_BACKENDS
        if not len(backends):
            if not fail_silently:
                raise ImproperlyConfigured('There is no media backend configured.'  \
                    + ' Please define `MEDIA_TREE_MEDIA_BACKENDS` in your settings.')
            else:
                return False
        
        for path in backends:
            # Traverse backends until there is one supporting what's requested:
            backend = get_module_attr(path)
            if (not handles_media_types or backend.handles_media_types(handles_media_types))  \
                and (not handles_file_extensions or backend.handles_file_extensions(handles_file_extensions))  \
                and (not supports_thumbnails or backend.supports_thumbnails()):
                    return backend
    
        if not fail_silently:
            raise ImproperlyConfigured('There is no media backend configured to handle'  \
                ' the specified file types.')
        return False