parameters: (
      code_string: str, enum_descriptor: descriptor.EnumDescriptor
  )
docstring: Returns an EnumValueDescriptor for a provided EnumDescriptor and raw code.
  
    Args:
      code_string: A raw string representation of the code to retrieve.
      enum_descriptor: The EnumDescriptor the desired EnumValueDescriptor belongs
        to.
  
    Returns:
      An instance of EnumValueDescriptor that the code_string represents.
  
    Raises:
      fhir_errors.InvalidFhirError: In the event that a conversion from
      code_string was unsuccessful.
docstring_summary: Returns an EnumValueDescriptor for a provided EnumDescriptor and raw code.
docstring_tokens: Returns an EnumValueDescriptor for a provided EnumDescriptor and raw code .
function: def code_string_to_enum_value_descriptor(
      code_string: str, enum_descriptor: descriptor.EnumDescriptor
  ) -> descriptor.EnumValueDescriptor:
    """Returns an EnumValueDescriptor for a provided EnumDescriptor and raw code.
  
    Args:
      code_string: A raw string representation of the code to retrieve.
      enum_descriptor: The EnumDescriptor the desired EnumValueDescriptor belongs
        to.
  
    Returns:
      An instance of EnumValueDescriptor that the code_string represents.
  
    Raises:
      fhir_errors.InvalidFhirError: In the event that a conversion from
      code_string was unsuccessful.
    """
    # Check the shared memos mapping
    value_descriptor = _get_enum_value_descriptor_memo(enum_descriptor,
                                                       code_string)
    if value_descriptor is not None:
      return value_descriptor
  
    # Make minor substitutions to the raw value, and search for value descriptor.
    # If found, update the shared memo mapping.
    fhir_case_code_string = code_string.upper().replace('-', '_')
    value_descriptor = enum_descriptor.values_by_name.get(fhir_case_code_string)
    if value_descriptor is not None:
      _set_enum_value_descriptor_memo(enum_descriptor, code_string,
                                      value_descriptor)
      return value_descriptor
  
    # Finally, some codes had to be renamed to make them valid enum values.
    # Iterate through all target enum values, and look for the FHIR original code
    # extension value.
    for value_descriptor in enum_descriptor.values:
      if (value_descriptor.GetOptions().HasExtension(
          annotations_pb2.fhir_original_code) and
          value_descriptor.GetOptions().Extensions[
              annotations_pb2.fhir_original_code] == code_string):
        _set_enum_value_descriptor_memo(enum_descriptor, code_string,
                                        value_descriptor)
        return value_descriptor
  
    raise fhir_errors.InvalidFhirError(
        f'Failed to convert {code_string!r} to {enum_descriptor.full_name}. No '
        f'matching enum found.')
function_tokens: def code_string_to_enum_value_descriptor ( code_string : str , enum_descriptor : descriptor . EnumDescriptor ) -> descriptor . EnumValueDescriptor : # Check the shared memos mapping value_descriptor = _get_enum_value_descriptor_memo ( enum_descriptor , code_string ) if value_descriptor is not None : return value_descriptor # Make minor substitutions to the raw value, and search for value descriptor. # If found, update the shared memo mapping. fhir_case_code_string = code_string . upper ( ) . replace ( '-' , '_' ) value_descriptor = enum_descriptor . values_by_name . get ( fhir_case_code_string ) if value_descriptor is not None : _set_enum_value_descriptor_memo ( enum_descriptor , code_string , value_descriptor ) return value_descriptor # Finally, some codes had to be renamed to make them valid enum values. # Iterate through all target enum values, and look for the FHIR original code # extension value. for value_descriptor in enum_descriptor . values : if ( value_descriptor . GetOptions ( ) . HasExtension ( annotations_pb2 . fhir_original_code ) and value_descriptor . GetOptions ( ) . Extensions [ annotations_pb2 . fhir_original_code ] == code_string ) : _set_enum_value_descriptor_memo ( enum_descriptor , code_string , value_descriptor ) return value_descriptor raise fhir_errors . InvalidFhirError ( f'Failed to convert {code_string!r} to {enum_descriptor.full_name}. No ' f'matching enum found.' )