def METHOD_NAME(request: Request):
    raw_request: typing.Dict = MicrosoftClient.convert_to_raw_request(request)
    for completion_index in range(request.num_completions):
        # We send the same request `num_completions` times because the MT-NLG API does not
        # support the OpenAI parameter 'n'. In our cache, we use `completion_index` to
        # differentiate responses for the same request, so we should check if the
        # request + 'completion_index` is in our cache. However, when we write out the
        # requests for offline batch evaluation, we should exclude `completion_index`
        # and write out the JSON for the same request `num_completion` times.
        cache_key: typing.Dict = {"completion_index": completion_index, **raw_request}
        # Only export requests that we are not in the cache
        if not store.contains(cache_key):
            request_json: str = request_to_key(raw_request)
            out_file.write(request_json + "\n")
            counts["pending_count"] += 1
        else:
            counts["cached_count"] += 1