<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_xstatic_dirs(XSTATIC_MODULES, HORIZON_CONFIG):
 """Discover static file configuration of the xstatic modules. For each entry in the XSTATIC_MODULES list we determine the entry point files (which may come from the xstatic MAIN var) and then determine where in the Django static tree the xstatic package's contents should be placed. For jquery.bootstrap.wizard.js the module name is None the static file is actually a 3rd-party file but resides in the Horizon source tree and not an xstatic package. The xstatic.pkg.jquery_ui package had its contents moved by packagers so it must be handled as a special case. """

    STATICFILES_DIRS = []
    HORIZON_CONFIG.setdefault('xstatic_lib_files', [])
    for module_name, files in XSTATIC_MODULES:
        module = import_module(module_name)
        if module_name == 'xstatic.pkg.jquery_ui':
            # determine the correct path for jquery-ui which packagers moved
            if module.VERSION.startswith('1.10.'):
                # The 1.10.x versions already contain 'ui' directory.
                files = ['ui/' + files[0]]

        STATICFILES_DIRS.append(
            ('horizon/lib/' + module.NAME, module.BASE_DIR)
        )

        # pull the file entry points from the xstatic package MAIN if possible
        if hasattr(module, 'MAIN'):
            files = module.MAIN
            if not isinstance(files, list):
                files = [files]

            # just the Javascript files, please (don't <script> css, etc
            # which is explicitly included in style/themes as appropriate)
            files = [file for file in files if file.endswith('.js')]

        # add to the list of files to link in the HTML
        try:
            for file in files:
                file = 'horizon/lib/' + module.NAME + '/' + file
                HORIZON_CONFIG['xstatic_lib_files'].append(file)
        except TypeError:
            raise Exception(
                '%s: Nothing to include because files to include are not '
                'defined (i.e., None) in BASE_XSTATIC_MODULES list and '
                'a corresponding XStatic module does not define MAIN list.'
                % module_name)

    return STATICFILES_DIRS