def parseEventRange(self, trace, eventRange):
    """
    Convert an event range description string into a concrete event range for a trace.
    The string may be an integral event number or a frame number preceded with '#',
    or a range with ":" as the separator between start and end events.
    
    @param trace        Trace for event
    @param eventNumber  Event range string
    
    @returns the first and last event number specified by the range
    """
    if not eventRange:
      return (0, len(trace.events))
    
    def parse(number, base = 0, default = 0):
      if not number:
        return default
      
      if number[0] == '+':
        offset = base
        number = number[1:]
      else:
        offset = 0
        
      try:
        return int(number) + offset
      except __HOLE__:
        assert number[0] == "#"
        targetFrameNumber = int(number[1:])
        frameNumber       = 0
        
        if targetFrameNumber < 0:
          frames = len([e for e in trace.events if self.lookupFunction(e).isFrameMarker])
          targetFrameNumber += frames
        
        i = 0
        for i, event in enumerate(trace.events[offset:]):
          if frameNumber == targetFrameNumber:
            break
          if self.lookupFunction(event).isFrameMarker:
            frameNumber += 1
        return i + offset
    
    try:
      first, last = eventRange.split(":")
    except ValueError:
      first, last = eventRange, eventRange
      
    first = parse(first)
    last  = parse(last, first, len(trace.events))
    if first == last: last += 1
    return (first, last)
dataset/ETHPy150Open skyostil/tracy/src/analyzer/Analyzer.py/InteractiveAnalyzer.parseEventRange