<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def critical(message, category=PsyPlotCritical, logger=None):
 """wrapper around the warnings.warn function for critical warnings. logger may be a logging.Logger instance"""

    if logger is not None:
        message = "[Critical warning by %s]\n%s" % (logger.name, message)
    warnings.warn(message, category, stacklevel=2)