

def copy_resource(src, dest):
    '\n    To copy package data to destination\n    '
    dest = ((dest + '/') + os.path.basename(src)).rstrip('/')
    if pkg_resources.resource_isdir(PACKAGE.__name__, src):
        if (not os.path.isdir(dest)):
            os.makedirs(dest)
        for res in pkg_resources.resource_listdir(__name__, src):
            copy_resource(((src + '/') + res), dest)
    elif (os.path.splitext(src)[1] not in ['.pyc']):
        with open(dest, 'wb') as f:
            f.write(pkg_resources.resource_string(__name__, src))

dataset/ETHPy150Open mardix/flask-marcopolo/flask_marcopolo/cmd.py copy_resource/original