code: def test_sample_contains(space):
      """Test that samples are contained within the space.
  
      Then test that for all other spaces, we test that an error is not raise with a sample and a bool is returned.
      As other spaces can be contained with this space, we cannot test that the contains is always true or false.
      """
      for _ in range(10):
          sample = space.sample()
          assert sample in space
          assert space.contains(sample)
  
      for other_space in TESTING_SPACES:
          assert isinstance(space.contains(other_space.sample()), bool)
  
imports: import copy
  import itertools
  import json
  import pickle
  import tempfile
  from typing import List, Union
  import numpy
  import pytest
  from gym.spaces import Box, Discrete, MultiBinary, MultiDiscrete, Space, Text
  from gym.utils import seeding
  from gym.utils.env_checker import data_equivalence
  from tests.spaces.utils import TESTING_FUNDAMENTAL_SPACES, TESTING_FUNDAMENTAL_SPACES_IDS, TESTING_SPACES, TESTING_SPACES_IDS
label_desc: Use image node_id 7 for calling a global function with example usage: test_sample_contains(space) without return types