def METHOD_NAME(
    self,
    contents: AnyStr,
    target_path: DevicePath | None = None,
    *,
    consumer: PyDeviceConsumer = None,
):
    _contents: str | bytes = contents
    if isinstance(_contents, bytes):
        _contents = _contents.decode()
    with self.repl():
        try:
            out_bytes = self.eval(_contents, consumer=consumer)
        except PyboardError as e:
            raise Exception(str(e)) from e
        out = out_bytes.decode("utf-8")
        return out