Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def myunicode(x):
    if type(x) is types.UnicodeType:
        return x
    return unicode(str(x), "utf-8", "ignore")

src/w/h/whiff-1.1/whiff/middleware/misc.py   whiff(Download)
        return None
    if type(thing) in types.StringTypes:
        return stream.myunicode(thing)
    else: # elif isinstance(thing, stream.StreamApp):
        # try to interpret it as a WSGI app

src/w/h/whiff-1.1/whiff/middleware/whiffColorize.py   whiff(Download)
def whiff_lex(code, lexer):
    "parse stuff outside of {{}} using lexer, inside using javascript lexer"
    from whiff import stream
    code = stream.myunicode(code)
    js_lexer = get_lexer_by_name("javascript", stripall=False, stripnl=False)