def validate_removal_semver(removal_version):
  if removal_version is None:
    raise MissingRemovalVersionError('The removal version must be provided.')
  if not isinstance(removal_version, six.string_types):
    raise BadRemovalVersionError('The removal_version must be a semver version string.')
  try:
    return Revision.semver(removal_version)
  except Revision.BadRevision as e:
    raise BadRemovalVersionError('The given removal version {} is not a valid semver: '
                                 '{}'.format(removal_version, e))
Validates that removal_version is a valid semver.
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/base/deprecated.py/validate_removal_semver