Did I find the right examples for you? yes no

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

        def get_unicode(value):
    if isinstance(value, unicode):
        return value
    try:
        return unicode(value, 'UTF-8')
    except UnicodeDecodeError:
        if fsenc == 'UTF-8':
            raise
        return unicode(value, fsenc)
        


src/l/a/lacore-0.1.3/lacore/archive/folders.py   lacore(Download)
import sys
import os
 
from .zip import ZipArchiver
from lacore.enc import get_unicode
def walk_folders(folders):
    for folder in folders:
        if not os.path.isdir(folder):
            yield (folder, get_unicode(os.path.basename(folder)))
        else:
                    strip = os.path.dirname(folder)
                    rel = os.path.relpath(path, strip)
                    yield (path, get_unicode(rel))
 
 

src/l/o/longaccess-client-HEAD/lacli/cmdutil.py   longaccess-client(Download)
import shlex
 
from lacli.log import getLogger
from lacore.enc import get_unicode
from lacli.exceptions import CacheInitException
                    if val and kw in types:
                        if types[kw] == unicode:
                            kwargs[kw] = get_unicode(val)
                        else:
                            kwargs[kw] = types[kw](val)