old_contents: import kindred
  import sys
  import six
  
  class Entity:
  	"""
  	Biomedical entity with information of location in text
  	"""
  	
  	nextInternalID = 1
  
  	def __init__(self,entityType,text,position,sourceEntityID=None):
  		"""
  		Constructor for Entity class
  		
  		:param entityType: Type of the entity
  		:param text: Text of the entity
  		:param position: Position within the text passage at which point entity appears. Entity may be non-contigious
  		:param sourceEntityID: Entity ID used in source document
  		:type entityType: str
  		:type text: str
  		:type position: list of tuples of two integers
  		:type sourceEntityID: str
  		"""
  	
  		posErrorMsg = "Entity position must be list of tuples (startPos,endPos)"
  			
  		isinstance(entityType, six.string_types), "entityType must be a string"
  		isinstance(text, six.string_types), "text must be a string"
  
  		assert isinstance(position,list), posErrorMsg
  		for p in position:
  			assert isinstance(p,tuple), posErrorMsg
  			assert len(p) == 2, posErrorMsg
  			assert isinstance(p[0],int), posErrorMsg
  			assert isinstance(p[1],int), posErrorMsg
  	
  		self.entityType = entityType
  		self.sourceEntityID = sourceEntityID
  		self.text = text
  		self.position = position
  		
  		self.entityID = Entity.nextInternalID
  		Entity.nextInternalID += 1
  		
  	def __str__(self):
  		out = "<Entity %s:'%s' id=%d sourceid=%s %s>" % (self.entityType,self.text,self.entityID,str(self.sourceEntityID),str(self.position))
  		return out
  		
  	def __repr__(self):
  		return self.__str__()
  		
  	def __eq__(self, other):
  		"""Override the default Equals behavior"""
  		if isinstance(other, self.__class__):
  			return self.__dict__ == other.__dict__
  		return False
  	
  	def __ne__(self, other):
  		"""Define a non-equality test"""
  		return not self.__eq__(other)
  
  
new_contents: import kindred
  import sys
  import six
  
  class Entity:
  	"""
  	Biomedical entity with information of location in text
  	"""
  	
  	_nextInternalID = 1
  
  	def __init__(self,entityType,text,position,sourceEntityID=None):
  		"""
  		Constructor for Entity class
  		
  		:param entityType: Type of the entity
  		:param text: Text of the entity
  		:param position: Position within the text passage at which point entity appears. Entity may be non-contigious
  		:param sourceEntityID: Entity ID used in source document
  		:type entityType: str
  		:type text: str
  		:type position: list of tuples of two integers
  		:type sourceEntityID: str
  		"""
  	
  		posErrorMsg = "Entity position must be list of tuples (startPos,endPos)"
  			
  		isinstance(entityType, six.string_types), "entityType must be a string"
  		isinstance(text, six.string_types), "text must be a string"
  
  		assert isinstance(position,list), posErrorMsg
  		for p in position:
  			assert isinstance(p,tuple), posErrorMsg
  			assert len(p) == 2, posErrorMsg
  			assert isinstance(p[0],int), posErrorMsg
  			assert isinstance(p[1],int), posErrorMsg
  	
  		self.entityType = entityType
  		self.sourceEntityID = sourceEntityID
  		self.text = text
  		self.position = position
  		
  		self.entityID = Entity.nextInternalID
  		Entity._nextInternalID += 1
  		
  	def __str__(self):
  		out = "<Entity %s:'%s' id=%d sourceid=%s %s>" % (self.entityType,self.text,self.entityID,str(self.sourceEntityID),str(self.position))
  		return out
  		
  	def __repr__(self):
  		return self.__str__()
  		
  	def __eq__(self, other):
  		"""Override the default Equals behavior"""
  		if isinstance(other, self.__class__):
  			return self.__dict__ == other.__dict__
  		return False
  	
  	def __ne__(self, other):
  		"""Define a non-equality test"""
  		return not self.__eq__(other)
  
  
subject: Hide nextInternalID field