def METHOD_NAME(cls, content: str, filename: str | pathlib.Path | None = None, **kwargs: t.Any) -> 'SinglefileData':
    """Construct a new instance and set ``content`` as its contents.
    :param content: The content as a string.
    :param filename: Specify filename to use (defaults to ``file.txt``).
    """
    return cls(io.StringIO(content), filename, **kwargs)