def find_i18n_function(element, finder):
    """Find i18n form helpers such as ``ugettext``.

    :param element: an :class:`~flatland.schema.base.Element`

    :param finder: a callable function. Will be passed one argument,
      an element.  AttributeError is ignored, allowing
      ``operator.attrgetter('ugettext')`` to be used directly.

    Searches the ancestry of *element* and it's schema with *finder*
    ala :func:`search_ancestry`, falling back to a search against
    ``__builtin__``.

    """
    transformer = search_ancestry(element, finder)
    if transformer:
        return transformer
    try:
        return finder(__builtin__)
    except __HOLE__:
        return None
dataset/ETHPy150Open jek/flatland/flatland/schema/util.py/find_i18n_function