code: def begin_transaction(self, bookmark=None, metadata=None, timeout=None):
          
          self._assert_open()
          if self.has_transaction():
              raise TransactionError("Explicit transaction already open")
  
          self._open_transaction(metadata=metadata, timeout=timeout)
          return self._transaction
docs: Create a new :class:`.Transaction` within this session.
          Calling this method with a bookmark is equivalent to
  
          :param bookmark: a bookmark to which the server should
                           synchronise before beginning the transaction
          :param metadata:
          :param timeout:
          :returns: new :class:`.Transaction` instance.
          :raise: :class:`.TransactionError` if a transaction is already open