code: def get_contained_pyversions(marker):
      
  
      collection = []
      if not marker:
          return set()
      marker = _ensure_marker(marker)
      # Collect the (Variable, Op, Value) tuples and string joiners from the marker
      _markers_collect_pyversions(marker._markers, collection)
      marker_str = " and ".join(sorted(collection))
      if not marker_str:
          return set()
      # Use the distlib dictionary parser to create a dictionary 'trie' which is a bit
      # easier to reason about
      marker_dict = distlib.markers.parse_marker(marker_str)[0]
      version_set = set()
      pyversions, _ = parse_marker_dict(marker_dict)
      if isinstance(pyversions, set):
          version_set.update(pyversions)
      elif pyversions is not None:
          version_set.add(pyversions)
      # Each distinct element in the set was separated by an "and" operator in the marker
      # So we will need to reduce them with an intersection here rather than a union
      # in order to find the boundaries
      versions = set()
      if version_set:
          versions = reduce(lambda x, y: x & y, version_set)
      return versions
docs: Collect all `python_version` operands from a marker.