def warn_or_error(removal_version, deprecated_entity_description, hint=None, stacklevel=3):
 removal_semver = validate_removal_semver(removal_version)
 msg = u'DEPRECATED: {} {} removed in version {}.'.format(deprecated_entity_description, get_deprecated_tense(removal_version), removal_version)
 if hint:
  msg += u'\n  {}'.format(hint)
 if (removal_semver > PANTS_SEMVER):
  warnings.warn(msg, DeprecationWarning, stacklevel=stacklevel)
 else:
  raise CodeRemovedError(msg)

def warn_or_error ( removal_version , deprecated_entity_description , hint = None , stacklevel = 3 ) : removal_semver = validate_removal_semver ( removal_version ) msg = u'DEPRECATED: {} {} removed in version {}.' . format ( deprecated_entity_description , get_deprecated_tense ( removal_version ) , removal_version ) if hint : msg += u'\n  {}' . format ( hint ) if ( removal_semver > PANTS_SEMVER ) : warnings . warn ( msg , DeprecationWarning , stacklevel = stacklevel ) else : raise CodeRemovedError ( msg )
check the removal_version against the current pants version .