def copy_resource(src, dest):
    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)
    else:
        if os.path.splitext(src)[1] not in [".pyc"]:
            with open(dest, "wb") as f:
                f.write(pkg_resources.resource_string(__name__, src))
Returns a token obtained from Google Creds.
dataset/ETHPy150Open mardix/flask-marcopolo/flask_marcopolo/cmd.py/copy_resource--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/cloud-pubsub-samples-python/grpc/pubsub_sample.py/auth_func