code: def test_log_artifact_adls_gen2_with_headers(
      databricks_artifact_repo,
      test_file,
      artifact_path,
      expected_location,
      monkeypatch,
  ):
      mock_azure_headers = {
          "x-ms-content-type": "test-type",
          "x-ms-owner": "some-owner",
          "x-ms-something_not_supported": "some-value",
      }
      filtered_azure_headers = {
          "x-ms-content-type": "test-type",
          "x-ms-owner": "some-owner",
      }
      mock_response = Response()
      mock_response.status_code = 200
      mock_response.close = lambda: None
      mock_credential_info = ArtifactCredentialInfo(
          signed_uri=MOCK_ADLS_GEN2_SIGNED_URI,
          type=ArtifactCredentialType.AZURE_ADLS_GEN2_SAS_URI,
          headers=[
              ArtifactCredentialInfo.HttpHeader(
                  name=header_name, value=header_value
              )
              for header_name, header_value in mock_azure_headers.items()
          ],
      )
      monkeypatch.setenv("MLFLOW_MULTIPART_UPLOAD_CHUNK_SIZE", "5")
      with mock.patch(
          f"{DATABRICKS_ARTIFACT_REPOSITORY}._get_credential_infos",
          return_value=[mock_credential_info],
      ) as get_credential_infos_mock, mock.patch(
          "requests.Session.request", return_value=mock_response
      ) as request_mock:
          databricks_artifact_repo.log_artifact(
              test_file, artifact_path
          )
          get_credential_infos_mock.assert_called_with(
              GetCredentialsForWrite, MOCK_RUN_ID, [expected_location]
          )
          # test with block size 5
          request_mock.assert_any_call(
              "put",
              f"{MOCK_ADLS_GEN2_SIGNED_URI}?resource=file",
              allow_redirects=True,
              headers=filtered_azure_headers,
              timeout=None,
          )
          request_mock.assert_any_call(
              "patch",
              f"{MOCK_ADLS_GEN2_SIGNED_URI}?action=append&position=0",
              allow_redirects=True,
              data=ANY,
              headers=filtered_azure_headers,
              timeout=None,
          )
          request_mock.assert_any_call(
              "patch",
              f"{MOCK_ADLS_GEN2_SIGNED_URI}?action=append&position=5",
              allow_redirects=True,
              data=ANY,
              headers=filtered_azure_headers,
              timeout=None,
          )
          request_mock.assert_any_call(
              "patch",
              f"{MOCK_ADLS_GEN2_SIGNED_URI}?action=append&position=10",
              allow_redirects=True,
              data=ANY,
              headers=filtered_azure_headers,
              timeout=None,
          )
          request_mock.assert_called_with(
              "patch",
              f"{MOCK_ADLS_GEN2_SIGNED_URI}?action=flush&position=14",
              allow_redirects=True,
              headers=filtered_azure_headers,
              timeout=None,
          )
  
imports: import json
  import os
  import posixpath
  import re
  import shutil
  import time
  from unittest import mock
  from unittest.mock import ANY
  import pytest
  from requests.models import Response
  from mlflow.entities.file_info import FileInfo
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_artifacts_pb2 import ArtifactCredentialInfo, ArtifactCredentialType, CompleteMultipartUpload, CreateMultipartUpload, GetCredentialsForRead, GetCredentialsForWrite, GetPresignedUploadPartUrl
  from mlflow.protos.service_pb2 import FileInfo, ListArtifacts
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.databricks_artifact_repo import _MAX_CREDENTIALS_REQUEST_SIZE, DatabricksArtifactRepository
label_desc: Use image node_id 12 for calling a global function with example usage: test_log_artifact_adls_gen2_with_headers(databricks_artifact_repo, test_file, artifact_path, expected_location, monkeypatch) without return types