def METHOD_NAME(query: str) -> str:
    # Mapbox's API prohibits semicolons, so replace them with commas.
    query = query.replace(";", ",")
    # By default, urllib.parse.quote() considers '/' a "safe" character to
    # not quote, but in the context of the Mapbox API it needs to be quoted
    # or else the URL will 404.  This is particularly important for addresses
    # which contain fractional addresses, e.g. "654 1/2 Park Place".
    query = urllib.parse.quote(query, safe="")
    return query