docstr: Concatenates embeddings from the Lightly Platform to the local ones.
  
  Loads the embedding csv file with the corresponding embedding ID in the current dataset
  and appends all of its rows to the local embeddings file located at
  'path_to_embeddings_csv'.
  
  Args:
      path_to_embeddings_csv:
          The path to the csv containing the local embeddings.
      embedding_id:
          ID of the embedding summary of the embeddings on the Lightly Platform.
  
  Raises:
      RuntimeError:
          If the number of columns in the local embeddings file and that of the remote
          embeddings file mismatch.
  
  :meta private:  # Skip docstring generation
docstr_tok: ["Concatenates","embeddings","from","the","Lightly","Platform","to","the","local","ones",".","Loads","the","embedding","csv","file","with","the","corresponding","embedding","ID","in","the","current","dataset","and","appends","all","of","its","rows","to","the","local","embeddings","file","located","at","'path_to_embeddings_csv","'",".","Args",":","path_to_embeddings_csv",":","The","path","to","the","csv","containing","the","local","embeddings",".","embedding_id",":","ID","of","the","embedding","summary","of","the","embeddings","on","the","Lightly","Platform",".","Raises",":","RuntimeError",":","If","the","number","of","columns","in","the","local","embeddings","file","and","that","of","the","remote","embeddings","file","mismatch",".",":","meta","private",":","#","Skip","docstring","generation"]
code: def append_embeddings(
      self, path_to_embeddings_csv: str, embedding_id: str
  ) -> None:
      """Concatenates embeddings from the Lightly Platform to the local ones.
  
      Loads the embedding csv file with the corresponding embedding ID in the current dataset
      and appends all of its rows to the local embeddings file located at
      'path_to_embeddings_csv'.
  
      Args:
          path_to_embeddings_csv:
              The path to the csv containing the local embeddings.
          embedding_id:
              ID of the embedding summary of the embeddings on the Lightly Platform.
  
      Raises:
          RuntimeError:
              If the number of columns in the local embeddings file and that of the remote
              embeddings file mismatch.
  
      :meta private:  # Skip docstring generation
      """
  
      # read embedding from API
      embedding_read_url = (
          self._embeddings_api.get_embeddings_csv_read_url_by_id(
              self.dataset_id, embedding_id
          )
      )
      embedding_reader = self._get_csv_reader_from_read_url(
          embedding_read_url
      )
      rows = list(embedding_reader)
      header, online_rows = rows[0], rows[1:]
  
      # read local embedding
      with open(path_to_embeddings_csv, "r") as f:
          local_rows = list(csv.reader(f))
  
          if len(local_rows[0]) != len(header):
              raise RuntimeError(
                  "Column mismatch! Number of columns in local and remote"
                  f" embeddings files must match but are {len(local_rows[0])}"
                  f" and {len(header)} respectively."
              )
  
          local_rows = local_rows[1:]
  
      # combine online and local embeddings
      total_rows = [header]
      filename_to_local_row = {row[0]: row for row in local_rows}
      for row in online_rows:
          # pick local over online filename if it exists
          total_rows.append(filename_to_local_row.pop(row[0], row))
      # add all local rows which were not added yet
      total_rows.extend(list(filename_to_local_row.values()))
  
      # save embeddings again
      with open(path_to_embeddings_csv, "w") as f:
          writer = csv.writer(f)
          writer.writerows(total_rows)
  
file_path: lightly/lightly/api/api_workflow_upload_embeddings.py
imports: import csv
  import io
  import tempfile
  import urllib.request
  from datetime import datetime
  from typing import List
  from urllib.request import Request
  from lightly.api.utils import retry
  from lightly.openapi_generated.swagger_client.models import DatasetEmbeddingData, DimensionalityReductionMethod, Trigger2dEmbeddingJobRequest, WriteCSVUrlData
  from lightly.utils import io
label_desc: Use image node_id 5 for calling the _UploadEmbeddingsMixin obj's underlying member method code with example usage: obj.append_embeddings(path_to_embeddings_csv, embedding_id) without return types