class_docstr: Test InMemoryDocumentStore's specific features
class_docstr_tok: ["Test","InMemoryDocumentStore","'s","specific","features"]
code: def test_embedding_retrieval_return_embedding(self):
      docstore = InMemoryDocumentStore(
          embedding_similarity_function="cosine"
      )
      docs = [
          Document(
              content="Hello world", embedding=[0.1, 0.2, 0.3, 0.4]
          ),
          Document(
              content="Haystack supports multiple languages",
              embedding=[1.0, 1.0, 1.0, 1.0],
          ),
      ]
      docstore.write_documents(docs)
  
      results = docstore.embedding_retrieval(
          query_embedding=[0.1, 0.1, 0.1, 0.1],
          top_k=1,
          return_embedding=False,
      )
      assert results[0].embedding is None
  
      results = docstore.embedding_retrieval(
          query_embedding=[0.1, 0.1, 0.1, 0.1],
          top_k=1,
          return_embedding=True,
      )
      assert results[0].embedding == [1.0, 1.0, 1.0, 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 28 for calling the TestMemoryDocumentStore obj's underlying member method code with example usage: obj.test_embedding_retrieval_return_embedding() without return types