code: def test_key_string_requirement(self):
      # Tests that an exception is thrown if a non-string key is used in
      # the outputs dictionary.
  
      x = T.scalar("x")
      try:
          theano.function([x], outputs={1.0: x})
          raise Exception(
              "Did not throw exception with 1.0 as only key"
          )
      except AssertionError:
          pass
      try:
          theano.function([x], outputs={1.0: x, "a": x**2})
          raise Exception("Did not throw exception with 1.0 as one key")
      except AssertionError:
          pass
      try:
          theano.function([x], outputs={(1, "b"): x, 1.0: x**2})
          raise Exception("Did not throw exception with tuple as key")
      except AssertionError:
          pass
  
file_path: Theano/theano/tests/test_dictionary_output.py
imports: from __future__ import absolute_import, print_function, division
  import unittest
  import theano
  import theano.tensor
label_desc: Use image node_id 8 for calling the dictionary_output_checker obj's underlying member method code with example usage: obj.test_key_string_requirement() without return types