<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_dict(cls, database, mapping):
 """Reconstruct an instance from a mapping. :type database: :class:`~google.cloud.spanner.database.Database` :param database: database to use :type mapping: mapping :param mapping: serialized state of the instance :rtype: :class:`BatchSnapshot` """

        instance = cls(database)
        session = instance._session = database.session()
        session._session_id = mapping["session_id"]
        snapshot = instance._snapshot = session.snapshot()
        snapshot._transaction_id = mapping["transaction_id"]
        return instance