def _warn_if_deprecated(key):
d = _get_deprecated_option(key)<EOL>if d:<EOL><INDENT>if d.msg:<EOL><INDENT>print(d.msg)<EOL>warnings.warn(d.msg, FutureWarning)<EOL><DEDENT>else:<EOL><INDENT>msg = "<STR_LIT>".format(key=key)<EOL>if d.removal_ver:<EOL><INDENT>msg += ('<STR_LIT>'<EOL>.format(version=d.removal_ver))<EOL><DEDENT>if d.rkey:<EOL><INDENT>msg += "<STR_LIT>".format(rkey=d.rkey)<EOL><DEDENT>else:<EOL><INDENT>msg += '<STR_LIT>'<EOL><DEDENT>warnings.warn(msg, FutureWarning)<EOL><DEDENT>return True<EOL><DEDENT>return False<EOL>
Checks if `key` is a deprecated option and if so, prints a warning.

Returns
-------
bool - True if `key` is deprecated, False otherwise.