code: def test_get_valid_actions(self):
      type_r = NamedBasicType("R")
      type_d = NamedBasicType("D")
      type_e = NamedBasicType("E")
      name_mapping = {"sample_function": "F"}
      # <e,<r,<d,r>>>
      type_signatures = {
          "F": ComplexType(
              type_e, ComplexType(type_r, ComplexType(type_d, type_r))
          )
      }
      basic_types = set([type_r, type_d, type_e])
      valid_actions = types.get_valid_actions(
          name_mapping, type_signatures, basic_types
      )
      assert len(valid_actions) == 3
      assert valid_actions["<e,<r,<d,r>>>"] == [
          "<e,<r,<d,r>>> -> sample_function"
      ]
      assert valid_actions["r"] == ["r -> [<e,<r,<d,r>>>, e, r, d]"]
      assert valid_actions["@start@"] == [
          "@start@ -> d",
          "@start@ -> e",
          "@start@ -> r",
      ]
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/semparse/type_declarations/type_declaration_test.py
imports: from __future__ import absolute_import
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.semparse.type_declarations import type_declaration
  from allennlp.semparse.type_declarations.type_declaration import ANY_TYPE, BinaryOpType, ComplexType, NamedBasicType, UnaryOpType
  from allennlp.semparse.type_declarations import wikitables_type_declaration
  from allennlp.semparse.type_declarations.wikitables_type_declaration import CELL_TYPE, ROW_TYPE
label_desc: Use image node_id 4 for calling the TestTypeDeclaration obj's underlying member method code with example usage: obj.test_get_valid_actions() without return types