code: def test_ranges(p=english.torange):
      assert_timespan(
          p.date_from("last tuesday to next tuesday", basedate),
          dict(year=2010, month=9, day=14),
          dict(year=2010, month=9, day=21),
      )
      assert_timespan(
          p.date_from("last monday to dec 25", basedate),
          dict(year=2010, month=9, day=13),
          dict(year=None, month=12, day=25),
      )
      assert_timespan(
          p.date_from("oct 25 to feb 14", basedate),
          dict(year=None, month=10, day=25),
          dict(year=None, month=2, day=14),
      )
      assert_timespan(
          p.date_from("3am oct 12 to 5pm", basedate),
          dict(year=None, month=10, day=12, hour=3),
          dict(year=None, month=None, day=None, hour=17),
      )
      assert_timespan(
          p.date_from("3am feb 12 to 5pm today", basedate),
          dict(year=None, month=2, day=12, hour=3),
          dict(year=2010, month=9, day=20, hour=17),
      )
      assert_timespan(
          p.date_from("feb to oct", basedate),
          dict(year=None, month=2),
          dict(year=None, month=10),
      )
      assert_timespan(
          p.date_from("oct 25 2005 11am to 5pm tomorrow", basedate),
          dict(year=2005, month=10, day=25, hour=11),
          dict(year=2010, month=9, day=21, hour=17),
      )
      assert_timespan(
          p.date_from("oct 5 2005 to november 20", basedate),
          dict(year=2005, month=10, day=5),
          dict(year=None, month=11, day=20),
      )
      assert_timespan(
          p.date_from("2007 to 2010", basedate),
          dict(year=2007, month=None, day=None),
          dict(year=2010, month=None, day=None),
      )
      assert_timespan(
          p.date_from("2007 to oct 12", basedate),
          dict(year=2007, month=None, day=None),
          dict(year=None, month=10, day=12),
      )
  
      assert_datespan(
          p.date_from("-2d to +1w", basedate),
          basedate + relativedelta(days=-2),
          basedate + relativedelta(weeks=1),
      )
  
file_path: whoosh/tests/test_dateparse.py
imports: from whoosh.qparser.dateparse import *
label_desc: Use image node_id 15 for calling a global function with example usage: test_ranges(p) without return types