class_docstr: Validate a metadata field.
  
  All _process_*() methods correspond to a core metadata field. The method is
  called with the field's raw value. If the raw value is valid it is returned
  in its "enriched" form (e.g. ``version.Version`` for the ``Version`` field).
  If the raw value is invalid, :exc:`InvalidMetadata` is raised (with a cause
  as appropriate).
class_docstr_tok: ["Validate","a","metadata","field",".","All","_process_","*","(",")","methods","correspond","to","a","core","metadata","field",".","The","method","is","called","with","the","field","'s","raw","value",".","If","the","raw","value","is","valid","it","is","returned","in","its","``","enriched","''","form","(","e.g",".","``","version.Version","``","for","the","``","Version","``","field",")",".","If","the","raw","value","is","invalid",",",":","exc",":","`","InvalidMetadata","`","is","raised","(","with","a","cause","as","appropriate",")","."]
code: def _process_metadata_version(self, value: str) -> _MetadataVersion:
      # Implicitly makes Metadata-Version required.
      if value not in _VALID_METADATA_VERSIONS:
          raise self._invalid_metadata(
              f"{value!r} is not a valid metadata version"
          )
      return cast(_MetadataVersion, value)
  
imports: import email.feedparser
  import email.header
  import email.message
  import email.parser
  import email.policy
  import sys
  import typing
  from typing import Any, Callable, Dict, Generic, List, Optional, Tuple, Type, Union, cast
  from .None import requirements, specifiers, utils, version
label_desc: Use image node_id 5 for calling the _Validator obj's underlying member method code with example usage: obj._process_metadata_version(value) and returns: cast