code: def check_candidate_mentions_are_well_defined(
      self, span_starts, span_ends, text
  ):
      candidate_mentions = []
      for start, end in izip(span_starts, span_ends):
          # Spans are inclusive.
          text_span = text[start : end + 1]
          candidate_mentions.append(text_span)
  
      # Check we aren't considering zero length spans and all
      # candidate spans are less than what we specified
      assert all(
          [self.span_width >= len(x) > 0 for x in candidate_mentions]
      )  # pylint: disable=len-as-condition
      return candidate_mentions
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/dataset_readers/coreference/coref_reader_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  import pytest
  from allennlp.data.dataset_readers import ConllCorefReader
  from allennlp.common.util import ensure_list
  from allennlp.common.testing import AllenNlpTestCase
label_desc: Use image node_id 2 for calling the TestCorefReader obj's underlying member method code with example usage: obj.check_candidate_mentions_are_well_defined(span_starts, span_ends, text) and returns: candidate_mentions