code: def test_char_span_to_token_span_handles_easy_cases(self):
      # These are _inclusive_ spans, on both sides.
      tokenizer = WordTokenizer()
      passage = (
          "On January 7, 2012, Beyoncé gave birth to her first child, a daughter, Blue Ivy "
          + "Carter, at Lenox Hill Hospital in New York. Five months later, she performed for four "
          + "nights at Revel Atlantic City's Ovation Hall to celebrate the resort's opening, her "
          + "first performances since giving birth to Blue Ivy."
      )
      tokens = tokenizer.tokenize(passage)
      offsets = [(t.idx, t.idx + len(t.text)) for t in tokens]
      # "January 7, 2012"
      token_span = util.char_span_to_token_span(offsets, (3, 18))[0]
      assert token_span == (1, 4)
      # "Lenox Hill Hospital"
      token_span = util.char_span_to_token_span(offsets, (91, 110))[0]
      assert token_span == (22, 24)
      # "Lenox Hill Hospital in New York."
      token_span = util.char_span_to_token_span(offsets, (91, 123))[0]
      assert token_span == (22, 28)
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/dataset_readers/reading_comprehension/util_test.py
imports: from __future__ import absolute_import
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.dataset_readers.reading_comprehension import util
  from allennlp.data.tokenizers import WordTokenizer
label_desc: Use image node_id 1 for calling the TestReadingComprehensionUtil obj's underlying member method code with example usage: obj.test_char_span_to_token_span_handles_easy_cases() without return types