def copy_to_unicode(element):
    """ used to transform the lxml version of unicode to a
    standard version of unicode that can be pickalable -
    necessary for linting """

    if isinstance(element, dict):
        return {
            key: copy_to_unicode(val)
            for key, val in element.items()
        }
    elif isinstance(element, list):
        return list(map(copy_to_unicode, element))
    else:
        try:
            # A dirty way to convert to unicode in python 2 + 3.3+
            return u''.join(element)
        except __HOLE__:
            return element
dataset/ETHPy150Open CenterForOpenScience/scrapi/scrapi/util.py/copy_to_unicode