code: def mock_tokenizer():
      """
      Tokenizes the string by splitting on spaces.
      """
      tokenizer = Mock()
      tokenizer.encode = lambda text: text.split()
      tokenizer.decode = lambda tokens: " ".join(tokens)
      return tokenizer
  
file_path: haystack/test/conftest.py
imports: from datetime import datetime
  from pathlib import Path
  from unittest.mock import Mock, patch
  import pytest
  from openai.types.chat import ChatCompletion, ChatCompletionMessage
  from openai.types.chat.chat_completion import Choice
  from haystack.testing.test_utils import set_all_seeds
label_desc: Use image node_id 1 for calling a global function with example usage: mock_tokenizer() and returns: tokenizer