original_docstring: Gets snapshot for this reference, creating it if necessary.
  
      If no snapshot has been set for reference's entity group, a snapshot is
      taken and stored for future reads (this also sets the read position),
      and a CONCURRENT_TRANSACTION exception is thrown if we no longer have
      a consistent snapshot.
  
      Args:
        reference: A entity_pb.Reference from which to extract the entity group.
      Raises:
        apiproxy_errors.ApplicationError if the snapshot is not consistent.
      
docstring: Gets snapshot for this reference, creating it if necessary.
  If no snapshot has been set for reference's entity group, a snapshot is
  taken and stored for future reads (this also sets the read position),
  and a CONCURRENT_TRANSACTION exception is thrown if we no longer have
  a consistent snapshot.
  
  A entity_pb.Reference from which to extract the entity group.
  Raises:
  apiproxy_errors.ApplicationError if the snapshot is not consistent.
docstring_tokens: Gets snapshot for this reference creating it if necessary . If no snapshot has been set for reference ' s entity group a snapshot is taken and stored for future reads ( this also sets the read position ) and a CONCURRENT_TRANSACTION exception is thrown if we no longer have a consistent snapshot . A entity_pb . Reference from which to extract the entity group . Raises : apiproxy_errors . ApplicationError if the snapshot is not consistent .
code: def _GrabSnapshot(self, reference):
      """Gets snapshot for this reference, creating it if necessary.
  
      If no snapshot has been set for reference's entity group, a snapshot is
      taken and stored for future reads (this also sets the read position),
      and a CONCURRENT_TRANSACTION exception is thrown if we no longer have
      a consistent snapshot.
  
      Args:
        reference: A entity_pb.Reference from which to extract the entity group.
      Raises:
        apiproxy_errors.ApplicationError if the snapshot is not consistent.
      """
      tracker = self._GetTracker(reference)
      check_contention = tracker._snapshot is None
      snapshot = tracker._GrabSnapshot(self._txn_manager)
      if check_contention:
  
  
  
  
  
        candidates = [other for other in self._entity_groups.values()
                      if other._snapshot is not None and other != tracker]
        meta_data_list = [other._meta_data for other in candidates]
        self._txn_manager._AcquireWriteLocks(meta_data_list)
        try:
          for other in candidates:
            if other._meta_data._log_pos != other._read_pos:
              self._state = self.FAILED
              raise apiproxy_errors.ApplicationError(
                  datastore_pb.Error.CONCURRENT_TRANSACTION,
                  'Concurrency exception.')
        finally:
          self._txn_manager._ReleaseWriteLocks(meta_data_list)
      return snapshot
code_tokens: def _GrabSnapshot ( self , reference ) : tracker = self . _GetTracker ( reference ) check_contention = tracker . _snapshot is None snapshot = tracker . _GrabSnapshot ( self . _txn_manager ) if check_contention : candidates = [ other for other in self . _entity_groups . values ( ) if other . _snapshot is not None and other != tracker ] meta_data_list = [ other . _meta_data for other in candidates ] self . _txn_manager . _AcquireWriteLocks ( meta_data_list ) try : for other in candidates : if other . _meta_data . _log_pos != other . _read_pos : self . _state = self . FAILED raise apiproxy_errors . ApplicationError ( datastore_pb . Error . CONCURRENT_TRANSACTION , 'Concurrency exception.' ) finally : self . _txn_manager . _ReleaseWriteLocks ( meta_data_list ) return snapshot
short_docstring: Gets snapshot for this reference, creating it if necessary.
short_docstring_tokens: Gets snapshot for this reference creating it if necessary .
comment: """Gets snapshot for this reference, creating it if necessary.
  
      If no snapshot has been set for reference's entity group, a snapshot is
      taken and stored for future reads (this also sets the read position),
      and a CONCURRENT_TRANSACTION exception is thrown if we no longer have
      a consistent snapshot.
  
      Args:
        reference: A entity_pb.Reference from which to extract the entity group.
      Raises:
        apiproxy_errors.ApplicationError if the snapshot is not consistent.
      """