class_docstr: Test InMemoryDocumentStore's specific features
class_docstr_tok: ["Test","InMemoryDocumentStore","'s","specific","features"]
code: def test_compute_cosine_similarity_scores(self):
      docstore = InMemoryDocumentStore(
          embedding_similarity_function="cosine"
      )
      docs = [
          Document(
              content="Document 1", embedding=[1.0, 0.0, 0.0, 0.0]
          ),
          Document(
              content="Document 2", embedding=[1.0, 1.0, 1.0, 1.0]
          ),
      ]
  
      scores = docstore._compute_query_embedding_similarity_scores(
          embedding=[0.1, 0.1, 0.1, 0.1],
          documents=docs,
          scale_score=False,
      )
      assert scores == [0.5, 1.0]
  
imports: import logging
  from unittest.mock import patch
  import pandas
  import pytest
  from haystack import Document
  from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError
  from haystack.document_stores.in_memory import InMemoryDocumentStore
  from haystack.testing.document_store import DocumentStoreBaseTests
label_desc: Use image node_id 29 for calling the TestMemoryDocumentStore obj's underlying member method code with example usage: obj.test_compute_cosine_similarity_scores() without return types