code: def test_params_type_with_enums(self):
      # Test that we fail if we create a params type with common enum names inside different enum types.
      try:
          ParamsType(
              enum1=EnumList("A", "B", "C"),
              enum2=EnumList("A", "B", "F"),
          )
      except AttributeError:
          pass
      else:
          raise Exception(
              "ParamsType should fail with common enum names inside different enum types."
          )
  
      # Test that we fail if we create a params type with common names in both aliases and constants.
      try:
          ParamsType(
              enum1=EnumList(("A", "a"), ("B", "b")),
              enum2=EnumList(("ONE", "a"), ("TWO", "two")),
          )
      except AttributeError:
          ParamsType(
              enum1=EnumList(("A", "a"), ("B", "b")),
              enum2=EnumList(("ONE", "one"), ("TWO", "two")),
          )
      else:
          raise Exception(
              "ParamsType should fail when there are aliases with same names as some constants."
          )
  
      # Test that we can access enum values through wrapper directly.
      w = ParamsType(
          enum1=EnumList("A", ("B", "beta"), "C"),
          enum2=EnumList(("D", "delta"), "E", "F"),
      )
      assert w.A == 0 and w.B == 1 and w.C == 2
      assert w.D == 0 and w.E == 1 and w.F == 2
      # Test constants access through aliases.
      assert w.enum_from_alias("beta") == w.B
      assert w.enum_from_alias("delta") == w.D
      assert (
          w.enum_from_alias("C") == w.C
      )  # C is not an alias, so it should return a constant named C.
      # Test that other regular wrapper attributes are still available.
      assert len(w.fields) == len(w.types) == w.length
      assert w.name
  
imports: import numpy
  import pytest
  import pytensor
  from pytensor import tensor
  from pytensor.graph.basic import Apply
  from pytensor.link.c.op import COp, ExternalCOp
  from pytensor.link.c.params_type import Params, ParamsType
  from pytensor.link.c.type import EnumList, Generic
  from pytensor.scalar import ScalarType
  from pytensor.tensor.type import TensorType, matrix
  from tests import unittest_tools
label_desc: Use image node_id 4 for calling the TestParamsType obj's underlying member method code with example usage: obj.test_params_type_with_enums() without return types