<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_badge_blueprint(allowed_types):
 """Create the badge blueprint. :param allowed_types: A list of allowed types. :returns: A Flask blueprint. """

    from invenio_formatter.context_processors.badges import \
        generate_badge_png, generate_badge_svg

    blueprint = Blueprint(
        'invenio_formatter_badges',
        __name__,
        template_folder='templates',
    )

    @blueprint.route(
        '/badge/<any({0}):title>/<path:value>.<any(svg, png):ext>'.format(
            ', '.join(allowed_types)))
    def badge(title, value, ext='svg'):
        """Generate a badge response."""
        if ext == 'svg':
            generator = generate_badge_svg
            mimetype = 'image/svg+xml'
        elif ext == 'png':
            generator = generate_badge_png
            mimetype = 'image/png'

        badge_title_mapping = \
            current_app.config['FORMATTER_BADGES_TITLE_MAPPING'].get(
                title, title)
        response = Response(generator(badge_title_mapping, value),
                            mimetype=mimetype)
        # Generate Etag from badge title and value.
        hashable_badge = "{0}.{1}".format(badge_title_mapping,
                                          value).encode('utf-8')
        response.set_etag(hashlib.sha1(hashable_badge).hexdigest())
        # Add headers to prevent caching.
        response.headers["Pragma"] = "no-cache"
        response.cache_control.no_cache = True
        response.cache_control.max_age = \
            current_app.config['FORMATTER_BADGES_MAX_CACHE_AGE']
        response.last_modified = dt.utcnow()
        extra = timedelta(
            seconds=current_app.config['FORMATTER_BADGES_MAX_CACHE_AGE'])
        response.expires = response.last_modified + extra
        return response.make_conditional(request)

    return blueprint