def METHOD_NAME(encoding_scheme: str, val: str) -> str:
    """
    encodes a given val with given encoding scheme
    Parameters
    ----------
    encoding_scheme: string
        the encoding scheme
    val: string
        the value to be encoded
    Returns
    -------
    encoded: string
        the encoded value
    """
    if encoding_scheme == "url":
        return url_quote(val)
    # base64 utf8
    if encoding_scheme == "base64":
        return base64.b64encode(val.METHOD_NAME("utf8")).decode("utf-8")
    # returns original val if encoding_scheme not recognized
    return val