code: def parse_time_indices(s):
    
    if not s.startswith('['):
      s = '[' + s + ']'
    parsed = command_parser._parse_slices(s)
    if len(parsed) != 1:
      raise ValueError(
          'Invalid number of slicing objects in time indices (%d)' % len(parsed))
    else:
      return parsed[0]
docs: Parse a string as time indices.
  
    Args:
      s: A valid slicing string for time indices. E.g., '-1', '[:]', ':', '2:10'
  
    Returns:
      A slice object.
  
    Raises:
      ValueError: If `s` does not represent valid time indices.