# Path: kibitzr/transformer/utils.py
# def bake_parametrized(transform_func, pass_conf=False, **kwargs):
#     def transform_factory(value, conf):
#         if pass_conf:
#             return functools.partial(
#                 transform_func,
#                 value,
#                 conf=conf,
#                 **kwargs
#             )
#         else:
#             return functools.partial(
#                 transform_func,
#                 value,
#                 **kwargs
#             )
#     return transform_factory


import logging
import six
    import re
from .utils import bake_parametrized
    from defusedxml import lxml as dlxml
    from lxml import etree
    from defusedxml import lxml as dlxml
                       dlxml.tostring(r, method='html', encoding='unicode'))
            )
        else:
            results.append(r)

    return u"\n".join(six.text_type(x).strip() for x in results)


def xpath_selector(selector, html, select_all):
    """
    Returns Xpath match for `selector` within `html`.

    :param selector: XPath string
    :param html: Unicode content
    :param select_all: True to get all matches
    """
    root = parse_html(html)
    xpath_results = root.xpath(selector)

    if not xpath_results:
        logger.warning('XPath selector not found: %r', selector)
        return False, html
    return True, serialize_xpath_results(xpath_results, select_all)


def register():
    """
    Return dictionary of transform factories
    """
    registry = {

# Path: kibitzr/transformer/utils.py
# def bake_parametrized(transform_func, pass_conf=False, **kwargs):
#     def transform_factory(value, conf):
#         if pass_conf:
#             return functools.partial(
#                 transform_func,
#                 value,
#                 conf=conf,
#                 **kwargs
#             )
#         else:
#             return functools.partial(
#                 transform_func,
#                 value,
#                 **kwargs
#             )
#     return transform_factory


# Path: kibitzr/transformer/xpath.py
import logging
import six
    import re
from .utils import bake_parametrized
    from defusedxml import lxml as dlxml
    from lxml import etree
    from defusedxml import lxml as dlxml

                       dlxml.tostring(r, method='html', encoding='unicode'))
            )
        else:
            results.append(r)

    return u"\n".join(six.text_type(x).strip() for x in results)


def xpath_selector(selector, html, select_all):
    """
    Returns Xpath match for `selector` within `html`.

    :param selector: XPath string
    :param html: Unicode content
    :param select_all: True to get all matches
    """
    root = parse_html(html)
    xpath_results = root.xpath(selector)

    if not xpath_results:
        logger.warning('XPath selector not found: %r', selector)
        return False, html
    return True, serialize_xpath_results(xpath_results, select_all)


def register():
    """
    Return dictionary of transform factories
    """
    registry = {

        'xpath': bake_parametrized(xpath_selector, select_all=False),