code: def test_unary_ops_resolve_correctly(self):
      unary_type = UnaryOpType()
  
      # Resolution should fail against a basic type
      assert unary_type.resolve(ROW_TYPE) is None
  
      # Resolution should fail against a complex type where the argument and return types are not same
      assert (
          unary_type.resolve(ComplexType(CELL_TYPE, ROW_TYPE)) is None
      )
  
      # Resolution should resolve ANY_TYPE given the other type
      resolution = unary_type.resolve(ComplexType(ANY_TYPE, ROW_TYPE))
      assert resolution == UnaryOpType(ROW_TYPE)
      resolution = unary_type.resolve(ComplexType(CELL_TYPE, ANY_TYPE))
      assert resolution == UnaryOpType(CELL_TYPE)
  
      reverse_type = ComplexType(
          ComplexType(CELL_TYPE, ROW_TYPE),
          ComplexType(CELL_TYPE, ROW_TYPE),
      )
      resolution = unary_type.resolve(reverse_type)
      assert resolution == UnaryOpType(ComplexType(CELL_TYPE, ROW_TYPE))
  
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 2 for calling the TestTypeDeclaration obj's underlying member method code with example usage: obj.test_unary_ops_resolve_correctly() without return types