def METHOD_NAME(credential):
    authentication_policy = None
    if credential is None:
        raise ValueError("Parameter 'credential' must not be None.")
    if isinstance(credential, AzureKeyCredential):
        authentication_policy = AzureKeyCredentialPolicy(name="Ocp-Apim-Subscription-Key", credential=credential)
    elif credential is not None and not hasattr(credential, "get_token"):
        raise TypeError(
            f"Unsupported credential: {type(credential)}. Use an instance of AzureKeyCredential "
            "or a token credential from azure.identity"
        )
    return authentication_policy