code: def test_read_endpoints_from_path(tmp_path: Path):
      # write valid config to file
      endpoints_path = write_endpoint_config_to_yaml(
          tmp_path,
          {
              "event_broker": {"type": "pika"},
              "tracker_store": {"type": "sql"},
          },
      )
  
      # noinspection PyProtectedMember
      available_endpoints = utils.read_endpoints_from_path(
          endpoints_path
      )
  
      # assert event broker and tracker store are valid, others are not
      assert (
          available_endpoints.tracker_store
          and available_endpoints.event_broker
      )
      assert not all(
          (
              available_endpoints.lock_store,
              available_endpoints.nlg,
              available_endpoints.action,
              available_endpoints.model,
              available_endpoints.nlu,
          )
      )
  
imports: import os
  from decimal import Decimal
  from typing import Optional, Text, Union, Any
  from pathlib import Path
  import pytest
  import rasa.core.lock_store
  import rasa.utils.io
  from rasa.constants import ENV_SANIC_WORKERS
  from rasa.core import utils
  from rasa.core.lock_store import LockStore, RedisLockStore, InMemoryLockStore
  from rasa.core.policies.policy import PolicyPrediction
  from rasa.shared.core.domain import Domain
  from rasa.utils.endpoints import EndpointConfig
  from tests.conftest import write_endpoint_config_to_yaml
label_desc: Use image node_id 7 for calling a global function with example usage: test_read_endpoints_from_path(tmp_path) without return types