def get_head_form_html(req: "Request", forms: List[Form]) -> str:
    """
    Returns the extra HTML that needs to be injected into the ``<head>``
    section for a Deform form to work properly.
    """
    # https://docs.pylonsproject.org/projects/deform/en/latest/widget.html#widget-requirements
    js_resources = []  # type: List[str]
    css_resources = []  # type: List[str]
    for form in forms:
        resources = form.get_widget_resources()  # type: Dict[str, List[str]]
        # Add, ignoring duplicates:
        js_resources.extend(x for x in resources['js']
                            if x not in js_resources)
        css_resources.extend(x for x in resources['css']
                             if x not in css_resources)
    js_links = [req.static_url(r) for r in js_resources]
    css_links = [req.static_url(r) for r in css_resources]
    js_tags = ['<script type="text/javascript" src="%s"></script>' % link
               for link in js_links]
    css_tags = ['<link rel="stylesheet" href="%s"/>' % link
                for link in css_links]
    tags = js_tags + css_tags
    head_html = "\n".join(tags)
    return head_html
def get_head_form_html ( req : "Request" , forms : List [ Form ] ) -> str : js_resources = [ ] css_resources = [ ] for form in forms : resources = form . get_widget_resources ( ) js_resources . extend ( x for x in resources [ 'js' ] if x not in js_resources ) css_resources . extend ( x for x in resources [ 'css' ] if x not in css_resources ) js_links = [ req . static_url ( r ) for r in js_resources ] css_links = [ req . static_url ( r ) for r in css_resources ] js_tags = [ '<script type="text/javascript" src="%s"></script>' % link for link in js_links ] css_tags = [ '<link rel="stylesheet" href="%s"/>' % link for link in css_links ] tags = js_tags + css_tags head_html = "\n" . join ( tags ) return head_html
Returns the extra HTML that needs to be injected into the ``<head>``
    section for a Deform form to work properly.