code: def test_index_custom_metadata_by_filename(
      mocker: MockerFixture,
  ) -> None:
      mocker.patch.object(
          ApiWorkflowClient, "__init__", return_value=None
      )
      custom_metadata = {}
      custom_metadata[COCO_ANNOTATION_KEYS.images] = [
          {
              COCO_ANNOTATION_KEYS.images_filename: "file0",
              COCO_ANNOTATION_KEYS.images_id: "image-id0",
          },
          {
              COCO_ANNOTATION_KEYS.images_filename: "file1",
              COCO_ANNOTATION_KEYS.images_id: "image-id1",
          },
      ]
      custom_metadata[COCO_ANNOTATION_KEYS.custom_metadata] = [
          {COCO_ANNOTATION_KEYS.custom_metadata_image_id: "image-id2"},
          {COCO_ANNOTATION_KEYS.custom_metadata_image_id: "image-id0"},
      ]
  
      client = ApiWorkflowClient()
      result = client.index_custom_metadata_by_filename(
          custom_metadata=custom_metadata
      )
      assert result == {
          "file0": {
              COCO_ANNOTATION_KEYS.custom_metadata_image_id: "image-id0"
          },
          "file1": None,
      }
  
imports: from pytest_mock import MockerFixture
  from lightly.api import ApiWorkflowClient, api_workflow_upload_metadata
  from lightly.openapi_generated.swagger_client.models import SampleDataModes, SamplePartialMode, SampleUpdateRequest
  from lightly.utils.io import COCO_ANNOTATION_KEYS
  from tests.api_workflow import utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_index_custom_metadata_by_filename(mocker) without return types