def get_esc_str(lvl=0, quote="\""):
    """
    Returns the escape string based on the level and quote character. 
    """
    lvl = (2 ** lvl) - 1        # compute escape level using 2^n - 1
    return ("\\" * lvl) + quote