code: def slice(self, starts_before=None, starts_after=None, ends_before=None,
                ends_after=None):
          
          clone = copy(self)
  
          if starts_before:
              clone.data = (i for i in clone.data if i.start < starts_before)
          if starts_after:
              clone.data = (i for i in clone.data if i.start > starts_after)
          if ends_before:
              clone.data = (i for i in clone.data if i.end < ends_before)
          if ends_after:
              clone.data = (i for i in clone.data if i.end > ends_after)
  
          clone.data = list(clone.data)
          return clone
docs: slice([starts_before][, starts_after][, ends_before][, ends_after]) \
  -> SubRipFile clone
  
          All arguments are optional, and should be coercible to SubRipTime
          object.
  
          It reduce the set of subtitles to those that match match given time
          constraints.
  
          The returned set is a clone, but still contains references to original
          subtitles. So if you shift this returned set, subs contained in the
          original SubRipFile instance will be altered too.
  
          Example:
              >>> subs.slice(ends_after={'seconds': 20}).shift(seconds=2)