code: def parse_byte_range(byte_range):
      """Returns the two numbers in 'bytes=123-456' or throws ValueError.
  
      The last number or both numbers may be None.
      """
      if byte_range.strip() == "":
          return None, None
  
      m = BYTE_RANGE_RE.match(byte_range)
      if not m:
          raise ValueError("Invalid byte range %s" % byte_range)
  
      first, last = [x and int(x) for x in m.groups()]
      if last and last < first:
          raise ValueError("Invalid byte range %s" % byte_range)
      return first, last
  
file_path: rasterio/tests/rangehttpserver.py
imports: import os
  import re
label_desc: Use image node_id 2 for calling a global function with example usage: parse_byte_range(byte_range) and returns: first,  last, None,  None