def METHOD_NAME(cls: Type, rewrap: str) -> bool:
    wrapped = None
    if is_model_wrapped(cls):
        wrapped = 'model_wrapper'
    elif is_basic_unit(cls):
        wrapped = 'basic_unit'
    elif is_wrapped_with_trace(cls):
        wrapped = 'nni.trace'
    if wrapped:
        if wrapped != rewrap:
            raise TypeError(f'{cls} is already wrapped with {wrapped}. Cannot rewrap with {rewrap}.')
        return True
    return False