code: def simple_slice(value):
      
      try:
          start, stop = value.split(':')
          start = ast.literal_eval(start)
          stop = ast.literal_eval(stop)
          if start is not None and stop is not None:
              assert start < stop
      except Exception:
          raise ValueError('invalid slice: %s' % value)
      return (start, stop)
docs: >>> simple_slice('2:5')
      (2, 5)
      >>> simple_slice('0:None')
      (0, None)