code: def from_dict(cls, database, mapping):
          
          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
docs: 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`