def get_version():
    version = {}
    with open("bqueryd/version.py") as fp:
        exec (fp.read(), version)
    return version
def encode(value):
    if isinstance(value, bytes):
        value = value.decode(errors="surrogateescape")

    for char in ("\\", "\n", "\t"):
        value = value.replace(
            char, char.encode(encoding="unicode-escape").decode()
        )

    return value