code: def test_to_dict_with_custom_init_parameters(self):
      ds = InMemoryDocumentStore()
      serialized_ds = ds.to_dict()
  
      component = InMemoryBM25Retriever(
          document_store=InMemoryDocumentStore(),
          filters={"name": "test.txt"},
          top_k=5,
          scale_score=True,
      )
      data = component.to_dict()
      assert data == {
          "type": "haystack.components.retrievers.in_memory.bm25_retriever.InMemoryBM25Retriever",
          "init_parameters": {
              "document_store": serialized_ds,
              "filters": {"name": "test.txt"},
              "top_k": 5,
              "scale_score": True,
          },
      }
  
imports: from typing import Dict, Any
  import pytest
  from haystack import Pipeline, DeserializationError
  from haystack.testing.factory import document_store_class
  from haystack.components.retrievers.in_memory import InMemoryBM25Retriever
  from haystack.dataclasses import Document
  from haystack.document_stores.in_memory import InMemoryDocumentStore
label_desc: Use image node_id 5 for calling the TestMemoryBM25Retriever obj's underlying member method code with example usage: obj.test_to_dict_with_custom_init_parameters() without return types