<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_bin(class_, blob):
 """Return the Tx for the given binary blob. :param blob: a binary blob containing a transaction streamed in standard form. The blob may also include the unspents (a nonstandard extension, optionally written by :func:`Tx.stream <stream>`), and they will also be parsed. :return: :class:`Tx` If parsing fails, an exception is raised. """

        f = io.BytesIO(blob)
        tx = class_.parse(f)
        try:
            tx.parse_unspents(f)
        except Exception:
            # parsing unspents failed
            tx.unspents = []
        return tx