code: def test_append_embeddings_with_overlap(self):
      # mock the embeddings on the server
      n_data_server = len(
          self.api_workflow_client._mappings_api.sample_names
      )
      self.api_workflow_client.n_dims_embeddings_on_server = 32
  
      # create new local embeddings overlapping with server embeddings
      n_data_start_local = n_data_server // 3
      n_data_local = n_data_server * 2
      self.create_fake_embeddings(
          n_data=n_data_local, n_data_start=n_data_start_local
      )
  
      """
          Assumptions:
              n_data_server = 100
              n_data_start_local = 33
              n_data_local = 200
          
          Server embeddings file:
              filenames: 0 ... 99
              labels: 0 ... 99
              
          Local embeddings file:
              filenames: 33 ... 232
              labels: 0 ... 0 (all zero)
              
          Appended embedding file must thus be:
              filenames: 0 ... 232
              labels: 0 ... 32 (from server) + 0 ... 0 (from local)
          """
  
      # append the local embeddings to the server embeddings
      self.api_workflow_client.append_embeddings(
          self.path_to_embeddings,
          "embedding_id_xyz_2",
      )
  
      # load the new (appended) embeddings
      _, labels_appended, filenames_appended = io_utils.load_embeddings(
          self.path_to_embeddings
      )
  
      # define the expected filenames and labels
      self.create_fake_embeddings(
          n_data=n_data_local + n_data_start_local
      )
      _, _, filenames_expected = io_utils.load_embeddings(
          self.path_to_embeddings
      )
      labels_expected = (
          list(range(n_data_start_local)) + [0] * n_data_local
      )
  
      # make sure the list of filenames and labels equal
      self.assertListEqual(filenames_appended, filenames_expected)
      self.assertListEqual(labels_appended, labels_expected)
  
file_path: lightly/tests/api_workflow/test_api_workflow_upload_embeddings.py
imports: import os
  import tempfile
  import numpy
  from lightly.utils import io
  from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup
label_desc: Use image node_id 9 for calling the TestApiWorkflowUploadEmbeddings obj's underlying member method code with example usage: obj.test_append_embeddings_with_overlap() without return types