class_docstr: This class can create a struct of PyTensor types (like `TensorType`, etc.)
  to be used as a convenience `Op` parameter wrapping many data.
  
  `ParamsType` constructor takes key-value args.  Key will be the name of the
  attribute in the struct.  Value is the PyTensor type of this attribute,
  ie. an instance of (a subclass of) :class:`CType`
  (eg. ``TensorType('int64', (None,))``).
  
  In a Python code any attribute named ``key`` will be available via::
  
      structObject.key
  
  In a C code, any attribute named ``key`` will be available via:
  
  .. code-block:: c
  
      structObject->key;
  
  .. note::
  
      This `Type` is not complete and should never be used for regular graph
      operations.
class_docstr_tok: ["This","class","can","create","a","struct","of","PyTensor","types","(","like","`","TensorType","`",",","etc",".",")","to","be","used","as","a","convenience","`","Op","`","parameter","wrapping","many","data",".","`","ParamsType","`","constructor","takes","key-value","args",".","Key","will","be","the","name","of","the","attribute","in","the","struct",".","Value","is","the","PyTensor","type","of","this","attribute",",","ie",".","an","instance","of","(","a","subclass","of",")",":","class",":","`","CType","`","(","eg",".","``","TensorType","(","'int64","'",",","(","None",",",")",")","``",")",".","In","a","Python","code","any","attribute","named","``","key","``","will","be","available","via",":",":","structObject.key","In","a","C","code",",","any","attribute","named","``","key","``","will","be","available","via",":","..","code-block",":",":","c","structObject-",">","key",";","..","note",":",":","This","`","Type","`","is","not","complete","and","should","never","be","used","for","regular","graph","operations","."]
docstr: Look for a constant that has alias ``alias`` in the PyTensor enumeration types
  wrapped into current ParamsType. Return value of the constant found,
  or raise an exception if either
  
  1. there is no constant with this alias,
  2. there is no constant which name is this alias, or
  3. current wrapper does not contain any PyTensor enumeration type.
  
  **Example**::
  
      from pytensor.graph.params_type import ParamsType
      from pytensor.link.c.type import EnumType, EnumList
      from pytensor.scalar import ScalarType
  
      wrapper = ParamsType(scalar=ScalarType('int32'),
                           letters=EnumType(A=(1, 'alpha'), B=(2, 'beta'), C=3),
                           digits=EnumList(('ZERO', 'nothing'), ('ONE', 'unit'), ('TWO', 'couple')))
      print(wrapper.get_enum('C'))  # 3
      print(wrapper.get_enum('TWO'))  # 2
      print(wrapper.enum_from_alias('alpha')) # 1
      print(wrapper.enum_from_alias('nothing')) # 0
  
      # For the following, alias 'C' is not defined, so the method looks for
      # a constant named 'C', and finds it.
      print(wrapper.enum_from_alias('C')) # 3
  
  .. note::
  
      Unlike with constant names, you can **NOT** access constants values directly with aliases through
      ParamsType (ie. you can't write ``wrapper.alpha``). You **must** use ``wrapper.enum_from_alias()``
      method to do that.
docstr_tok: ["Look","for","a","constant","that","has","alias","``","alias","``","in","the","PyTensor","enumeration","types","wrapped","into","current","ParamsType",".","Return","value","of","the","constant","found",",","or","raise","an","exception","if","either","1.","there","is","no","constant","with","this","alias",",","2.","there","is","no","constant","which","name","is","this","alias",",","or","3.","current","wrapper","does","not","contain","any","PyTensor","enumeration","type",".","*","*","Example","*","*",":",":","from","pytensor.graph.params_type","import","ParamsType","from","pytensor.link.c.type","import","EnumType",",","EnumList","from","pytensor.scalar","import","ScalarType","wrapper","=","ParamsType","(","scalar=ScalarType","(","'int32","'",")",",","letters=EnumType","(","A=","(","1",",","'alpha","'",")",",","B=","(","2",",","'beta","'",")",",","C=3",")",",","digits=EnumList","(","(","'ZERO","'",",","'nothing","'",")",",","(","'ONE","'",",","'unit","'",")",",","(","'TWO","'",",","'couple","'",")",")",")","print","(","wrapper.get_enum","(","'","C","'",")",")","#","3","print","(","wrapper.get_enum","(","'TWO","'",")",")","#","2","print","(","wrapper.enum_from_alias","(","'alpha","'",")",")","#","1","print","(","wrapper.enum_from_alias","(","'nothing","'",")",")","#","0","#","For","the","following",",","alias","'","C","'","is","not","defined",",","so","the","method","looks","for","#","a","constant","named","'","C","'",",","and","finds","it",".","print","(","wrapper.enum_from_alias","(","'","C","'",")",")","#","3","..","note",":",":","Unlike","with","constant","names",",","you","can","*","*","NOT","*","*","access","constants","values","directly","with","aliases","through","ParamsType","(","ie",".","you","ca","n't","write","``","wrapper.alpha","``",")",".","You","*","*","must","*","*","use","``","wrapper.enum_from_alias","(",")","``","method","to","do","that","."]
code: def enum_from_alias(self, alias):
      """
      Look for a constant that has alias ``alias`` in the PyTensor enumeration types
      wrapped into current ParamsType. Return value of the constant found,
      or raise an exception if either
  
      1. there is no constant with this alias,
      2. there is no constant which name is this alias, or
      3. current wrapper does not contain any PyTensor enumeration type.
  
      **Example**::
  
          from pytensor.graph.params_type import ParamsType
          from pytensor.link.c.type import EnumType, EnumList
          from pytensor.scalar import ScalarType
  
          wrapper = ParamsType(scalar=ScalarType('int32'),
                               letters=EnumType(A=(1, 'alpha'), B=(2, 'beta'), C=3),
                               digits=EnumList(('ZERO', 'nothing'), ('ONE', 'unit'), ('TWO', 'couple')))
          print(wrapper.get_enum('C'))  # 3
          print(wrapper.get_enum('TWO'))  # 2
          print(wrapper.enum_from_alias('alpha')) # 1
          print(wrapper.enum_from_alias('nothing')) # 0
  
          # For the following, alias 'C' is not defined, so the method looks for
          # a constant named 'C', and finds it.
          print(wrapper.enum_from_alias('C')) # 3
  
      .. note::
  
          Unlike with constant names, you can **NOT** access constants values directly with aliases through
          ParamsType (ie. you can't write ``wrapper.alpha``). You **must** use ``wrapper.enum_from_alias()``
          method to do that.
  
      """
      return (
          self.__alias_to_enum[alias].fromalias(alias)
          if alias in self.__alias_to_enum
          else self.__const_to_enum[alias][alias]
      )
  
imports: import hashlib
  import re
  from pytensor.graph.utils import MethodNotDefined
  from pytensor.link.c.type import CType, EnumType
label_desc: Use image node_id 12 for calling the ParamsType obj's underlying member method code with example usage: obj.enum_from_alias(alias) and returns: unknown