code: def parse_units(units_str):
      
      if not len(units_str):
          return units_str, (None, None)
  
      if units_str[-1] == ']':
          units, lims = units_str.rsplit('[')  # type: str, str
      else:
          units = units_str
          lims = '?, ?]'
  
      lims = tuple([float(x) if x.strip() != '?' else None for x in lims.strip(']').split(',')])
  
      return units.strip(), lims
docs: Extract and parse the units
      Extract the bounds over which the expression is assumed to apply.
  
      Parameters
      ----------
      units_str
  
      Returns
      -------
  
      Examples
      --------
      >>> parse_units('Widgets/Month [-10,10,1]')
      ('Widgets/Month', (-10,10,1))
  
      >>> parse_units('Month [0,?]')
      ('Month', [-10, None])
  
      >>> parse_units('Widgets [0,100]')
      ('Widgets', (0, 100))
  
      >>> parse_units('Widgets')
      ('Widgets', (None, None))
  
      >>> parse_units('[0, 100]')
      ('', (0, 100))