def _build_xpath_expr(attrs):
<EOL>if '<STR_LIT>' in attrs:<EOL><INDENT>attrs['<STR_LIT:class>'] = attrs.pop('<STR_LIT>')<EOL><DEDENT>s = ["<STR_LIT>".format(key=k, val=v) for k, v in attrs.items()]<EOL>return '<STR_LIT>'.format(expr='<STR_LIT>'.join(s))<EOL>
Build an xpath expression to simulate bs4's ability to pass in kwargs to
    search for attributes when using the lxml parser.

    Parameters
    ----------
    attrs : dict
        A dict of HTML attributes. These are NOT checked for validity.

    Returns
    -------
    expr : unicode
        An XPath expression that checks for the given HTML attributes.