def METHOD_NAME(themes):
    """Given a theme chain, return the bundle definitions."""
    for theme_name in themes:
        bundles_path = os.path.join(
            utils.get_theme_path(theme_name), 'bundles')
        if os.path.isfile(bundles_path):
            config = configparser.ConfigParser()
            header = io.StringIO('[bundles]\n')
            with open(bundles_path, 'rt') as fd:
                config.read_file(itertools.chain(header, fd))
            bundles = {}
            for name, files in config['bundles'].items():
                name = name.strip().replace('/', os.sep)
                files = [f.strip() for f in files.split(',') if f.strip()]
                bundles[name] = files
            return bundles