code: def _get_entity_coordinates(self, entity_term):
          
          # The following lines get the starting coordinate of the sentence
          # containing the entity.
          sent_id = entity_term.get('sentence')
          if sent_id is None:
              return None
          qstr = "$.sentences.frames[(@.frame_id is \'%s')]" % sent_id
          res = self.tree.execute(qstr)
          if res is None:
              return None
          try:
              sentence = next(res)
          except StopIteration:
              return None
          sent_start = sentence.get('start-pos')
          if sent_start is None:
              return None
          sent_start = sent_start.get('offset')
          if sent_start is None:
              return None
          # Get the entity coordinate in the entire text and subtract the
          # coordinate of the first character in the associated sentence to
          # get the sentence coordinate of the entity. Return None if entity
          # coordinates are missing
          entity_start = entity_term.get('start-pos')
          entity_stop = entity_term.get('end-pos')
          if entity_start is None or entity_stop is None:
              return None
          entity_start = entity_start.get('offset')
          entity_stop = entity_stop.get('offset')
          if entity_start is None or entity_stop is None:
              return None
          return (entity_start - sent_start, entity_stop - sent_start)
docs: Return sentence coordinates for a given entity.
  
          Given an entity term return the associated sentence coordinates as
          a tuple of the form (int, int). Returns None if for any reason the
          sentence coordinates cannot be found.