code: def test_numeric_ranges():
      schema = fields.Schema(id=fields.STORED, num=fields.NUMERIC)
      ix = RamStorage().create_index(schema)
      w = ix.writer()
  
      for i in xrange(400):
          w.add_document(id=i, num=i)
      w.commit()
  
      with ix.searcher() as s:
          qp = qparser.QueryParser("num", schema)
  
          def check(qs, target):
              q = qp.parse(qs)
              result = [s.stored_fields(d)["id"] for d in q.docs(s)]
              assert result == target
  
          # Note that range() is always inclusive-exclusive
          check("[10 to 390]", list(range(10, 390 + 1)))
          check("[100 to]", list(range(100, 400)))
          check("[to 350]", list(range(0, 350 + 1)))
          check("[16 to 255]", list(range(16, 255 + 1)))
          check("{10 to 390]", list(range(11, 390 + 1)))
          check("[10 to 390}", list(range(10, 390)))
          check("{10 to 390}", list(range(11, 390)))
          check("{16 to 255}", list(range(17, 255)))
  
imports: from __future__ import with_statement
  from datetime import datetime, timedelta
  import pytest
  from whoosh import fields, qparser, query
  from whoosh.compat import u, b, xrange
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util import times
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 11 for calling a global function with example usage: test_numeric_ranges() without return types