@staticmethod
def _warning(source, msg, category=Warning):
    """Return a Warning object with source description."""
    if isinstance(source, str):
        msg = f'@{source}: ' + msg
    elif source:
        msg = f'@{type(source).__name__} {str(source)}: ' + msg
    return category(msg)
