<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def console_from_xp(filename: str) -> tcod.console.Console: """Return a single console from a REXPaint `.xp` file."""

    return tcod.console.Console._from_cdata(
        lib.TCOD_console_from_xp(filename.encode("utf-8"))
    )