Get enum constant by it's name.
483961
public EnumConstant getConstant(String name) {
        for (EnumConstant enumConstant : getConstants()) {
            if (enumConstant.getName().equals(name)) {
                return enumConstant;
            }
        }
        return null;
    }
341603
static <T extends Enum<T>>
    T get( Class<T> clazz, int v ) {
        return get(clazz).constant(v);
    }
1351062
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return Setting(key)
        if key not in Setting._member_map_:
            extend_enum(Setting, key, default)
        return Setting[key]
1325463
def enum(cls, options, values):
    """"""
    names, real = zip(*options)
    del names  # unused

    def factory(i, name):
      return cls(i, name, (len(real),), lambda a: real[a[0]], values)
    return factory
263292
public final int getConstantIndex(String constant)
    {
        int nameIndex = getNameIndex(constant);
        for (ConstantInfo ci : listConstantInfo(ConstantString.class))
        {
            ConstantString ic = (ConstantString) ci;
            if (nameIndex == ic.getString_index())
            {
                return constantPoolIndexMap.get(ci);
            }
        }
        return -1;
    }
154399
def ENUM_DECL(self, cursor):
        """"""
        name = self.get_unique_name(cursor)
        if self.is_registered(name):
            return self.get_registered(name)
        align = cursor.type.get_align()
        size = cursor.type.get_size()
        obj = self.register(name, typedesc.Enumeration(name, size, align))
        self.set_location(obj, cursor)
        self.set_comment(obj, cursor)
        # parse all children
        for child in cursor.get_children():
            self.parse_cursor(child)  # FIXME, where is the starElement
        return obj
818294
def _get_all_constants():
    
    return [
        key for key in globals().keys()
        if all([
            not key.startswith("_"),          # publicly accesible
            key.upper() == key,               # uppercase
            type(globals()[key]) in _ALLOWED  # and with type from _ALLOWED
        ])
    ]
856119
def do_enum(self, parent=None, ident=0):
        
        # TC_ENUM classDesc newHandle enumConstantName
        enum = JavaEnum()
        _, classdesc = self._read_and_exec_opcode(
            ident=ident + 1,
            expect=(
                self.TC_CLASSDESC,
                self.TC_PROXYCLASSDESC,
                self.TC_NULL,
                self.TC_REFERENCE,
            ),
        )
        enum.classdesc = classdesc
        self._add_reference(enum, ident)
        _, enumConstantName = self._read_and_exec_opcode(
            ident=ident + 1, expect=(self.TC_STRING, self.TC_REFERENCE)
        )
        enum.constant = enumConstantName
        return enum
48178
def get_configure_by_name(self, name):
        """"""

        for elem in self.configures:
            if elem.name == name:
                return elem
        return None
52372
@Override
	public EnumeratedConstant findConstantInScope(String currentScope, String constant)
    {
        int i = constant.indexOf('.');
        if (i == -1)
        {
            return null;
        }
        String className = constant.substring(0,i);
        String fieldName = constant.substring(i+1);
        List<String> constants = m_constants.get(className);
        if (constants == null)
        {
            return null;
        }
        if (constants.contains(fieldName))
        {
            return new EnumeratedConstant(m_xsdpackageName,className,fieldName);
        }
        return null;
    }
462537
public StringConstant getString(String name)
  {
    for (int i = 0; i < _entries.size(); i++) {
      ConstantPoolEntry entry = _entries.get(i);

      if (! (entry instanceof StringConstant))
        continue;

      StringConstant stringEntry = (StringConstant) entry;

      if (stringEntry.getString().equals(name))
        return stringEntry;
    }

    return null;
  }
518767
def GetValueByName(self, name):
    
    if not self._registry_key and self._registry:
      self._GetKeyFromRegistry()

    if not self._registry_key:
      return None

    return self._registry_key.GetValueByName(name)
255009
public static function getConstantByName($name)
    {
        switch (strtolower($name)) {
            case 'default':
                return self::DEF;
            break;

            case 'rect':
                return self::RECT;
            break;

            case 'circle':
                return self::CIRCLE;
            break;

            case 'poly':
                return self::POLY;
            break;

            case 'ellipse':
                return self::ELLIPSE;
            break;

            default:
                return false;
            break;
        }
    }
786868
def get_constant(self, const_name, context):
        

        # check if value is compatible with
        const = self._constants[const_name]

        if isinstance(const, ast.AnnAssign):  # Handle ByteArrays.
            if context:
                expr = Expr(const.value, context).lll_node
                return expr
            else:
                raise VariableDeclarationException(
                    "ByteArray: Can not be used outside of a function context: %s" % const_name
                )

        # Other types are already unwrapped, no need
        return self._constants[const_name]
476579
public static String getName(EnumConstant constant) {
        String name = constant.getName();
        String underscored = Formatter.toUnderscoreCase(name);
        return Formatter.toUpperCase(underscored);
    }
923244
public static String getEnumName(Enum[] e, int value) {
        if (e != null) {
            int toCompareValue;
            for (Enum en : e) {
                if (en instanceof EnumReadable) {
                    toCompareValue = ((EnumReadable) en).value();
                } else {
                    toCompareValue = en.ordinal();
                }
                if (value == toCompareValue) {
                    return en.name();
                }
            }
        }
        return "";
    }
350798
public Set<String> getConstantNames() {
        return constants.stream()
                .map(EnumConstant::getName)
                .collect(Collectors.toSet());
    }