def escape_like(v: str) -> str:
    """
    Escape a string for the use in `LIKE` condition.

    :param v: A string.
    :return: Escaped string.
    """
    def esc(c):
        if c == "\\":
            return r"\\\\"
        elif c == "%":
            return r"\%"
        elif c == "_":
            return r"\_"
        else:
            return c
    return ''.join(map(esc, v))