Returns {name: Enum}
340126
def _load_enums(root):
    """"""
    out = collections.OrderedDict()
    for elem in root.findall('enums/enum'):
        name = elem.attrib['name']
        value = elem.attrib['value']
        comment = elem.get('comment')
        out[name] = Enum(name, value, comment)
    return out
983633
def _ConvertEnumType(self, enumType):
      
      if enumType:
         vmodlName = enumType.name
         wsdlName = enumType.wsdlName
         version = enumType.version
         values = enumType.value
         enumType = (vmodlName, wsdlName, version, values)
      else:
         enumType = None
      return enumType
475084
def describe_enum(enum_definition):
    
    enum_descriptor = EnumDescriptor()
    enum_descriptor.name = enum_definition.definition_name().split('.')[-1]

    values = []
    for number in enum_definition.numbers():
        value = enum_definition.lookup_by_number(number)
        values.append(describe_enum_value(value))

    if values:
        enum_descriptor.values = values

    return enum_descriptor
1240354
function envInfo () {
	var browser = browserInfo();
	var osName = browser.os;

	if (osName === 'MacOS') {
		osName = 'OS X';
	}

	return {
		runtime: {
			name: browser.name,
			version: browser.version
		},
		os: {
			name: osName
		}
	};
}
476579
public static String getName(EnumConstant constant) {
        String name = constant.getName();
        String underscored = Formatter.toUnderscoreCase(name);
        return Formatter.toUpperCase(underscored);
    }
40871
public String getString(Enum<?> key)
    {
        if (key == null)
        {
            return null;
        }

        return getString(key.name());
    }
222785
def import_enum(dest, src, name):
    
    dest.enums[name] = src.enums[name]
1014732
private Object getEnumValue(EnumValueDescriptor enumDesc) {
    if (enumSerialization == EnumSerialization.NAME) {
      return getCustSerializedEnumValue(enumDesc.getOptions(), enumDesc.getName());
    } else {
      return enumDesc.getNumber();
    }
  }
1021017
def _lookup_enum_in_ns(namespace, value):
    """"""
    for attribute in dir(namespace):
        if getattr(namespace, attribute) == value:
            return attribute
1101109
def enum(description, **kwargs) -> typing.Type:
    
    kwargs['description'] = description
    return type('Enum', (Enum,), kwargs)
947412
public String getStringValue(Enum key) {
  if (this._job.get(key) == null) {
    return "";
  } else {
      return this._job.get(key);
  }
  }
1343899
private Enum getYesNoEnum(String answer) {
        return answer.equals("Y") ? YesNoDataType.Y_YES : YesNoDataType.N_NO;
    }
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 "";
    }
936809
def get_season_code_from_name(self, season_name) -> int:
        
        self.validator_season_name.validate(season_name, 'get_season_code_from_name')
        return self.seasons_enum[season_name]
329530
def value(self):
        
        if self._enum and issubclass(self._enum, Enumeration):
            name = self._enum.get_name(self._value)
            if name:
                return name
        return self._value
1330839
function en(schema, defaults, options) {
  if (kindOf(schema) !== 'array') {
    if (process.env.NODE_ENV !== 'production') {
      throw new Error(
        `Enum structs must be defined as an array, but you passed: ${schema}`
      )
    } else {
      throw new Error(`Invalid schema: ${schema}`)
    }
  }

  const name = 'enum'
  const type = schema
    .map(s => {
      try {
        return JSON.stringify(s)
      } catch (e) {
        return String(s)
      }
    })
    .join(' | ')

  const validate = (value = resolveDefaults(defaults)) => {
    return schema.includes(value)
      ? [undefined, value]
      : [{ data: value, path: [], value, type }]
  }

  return new Kind(name, type, validate)
}
1084056
def get_enum_from_canonical_name(self, enum_name):
        
        return next((e for e in self.enums if e.canonical_name == enum_name), None)