def METHOD_NAME(s3, bucket, prefix, report):
    report_path = f"{prefix}/report.json"
    try:
        # Account for the situation where we're processing multiple files
        # if there's already a report.json and it has more files in it
        # than the new one we're trying to write, assume an out-of-order
        # delivery has happened (entirely possible) return early
        # and leave the existing report in place.
        resp = s3.get_object(Bucket=bucket, Key=report_path)
        old_report = json.loads(resp["Body"].read())
        if len(old_report["file_set"]) >= len(report["file_set"]):
            return
        # Only overwrite the old report with the new report
        # if the new one has more stuff in it
    except botocore.exceptions.ClientError:
        pass
    s3.put_object(
        Bucket=bucket,
        Key=report_path,
        Body=json.dumps(report, indent=2),
        ContentType="application/json",
    )