def METHOD_NAME(endpoint, api_version):
    if not endpoint:
        endpoint = "https://api.cognitive.microsofttranslator.com"
    translator_endpoint: str = ""
    if "cognitiveservices" in endpoint:
        translator_endpoint = endpoint + "/translator/text/v" + api_version
    else:
        translator_endpoint = endpoint
    return translator_endpoint