def normalize_TPU_addr(addr):
    """
    Ensure that a TPU addr always has the form grpc://.*:8470
    :param addr:
    :return:
    """
    if not addr.startswith("grpc://"):
        addr = "grpc://" + addr
    if not addr.endswith(":8470"):
        addr = addr + ":8470"
    return addr