class_docstr: Base class of all clips (VideoClips and AudioClips).
  
  Attributes
  ----------
  
  start : float
    When the clip is included in a composition, time of the
    composition at which the clip starts playing (in seconds).
  
  end : float
    When the clip is included in a composition, time of the
    composition at which the clip stops playing (in seconds).
  
  duration : float
    Duration of the clip (in seconds). Some clips are infinite, in
    this case their duration will be ``None``.
class_docstr_tok: ["Base","class","of","all","clips","(","VideoClips","and","AudioClips",")",".","Attributes","--","--","--","--","--","start",":","float","When","the","clip","is","included","in","a","composition",",","time","of","the","composition","at","which","the","clip","starts","playing","(","in","seconds",")",".","end",":","float","When","the","clip","is","included","in","a","composition",",","time","of","the","composition","at","which","the","clip","stops","playing","(","in","seconds",")",".","duration",":","float","Duration","of","the","clip","(","in","seconds",")",".","Some","clips","are","infinite",",","in","this","case","their","duration","will","be","``","None","``","."]
docstr: Returns a clip playing the content of the current clip between times
  ``start_time`` and ``end_time``, which can be expressed in seconds
  (15.35), in (min, sec), in (hour, min, sec), or as a string:
  '01:03:05.35'.
  
  The ``mask`` and ``audio`` of the resulting subclip will be subclips of
  ``mask`` and ``audio`` the original clip, if they exist.
  
  It's equivalent to slice the clip as a sequence, like
  ``clip[t_start:t_end]``.
  
  Parameters
  ----------
  
  start_time : float or tuple or str, optional
    Moment that will be chosen as the beginning of the produced clip. If
    is negative, it is reset to ``clip.duration + start_time``.
  
  end_time : float or tuple or str, optional
    Moment that will be chosen as the end of the produced clip. If not
    provided, it is assumed to be the duration of the clip (potentially
    infinite). If is negative, it is reset to ``clip.duration + end_time``.
    For instance:
  
    >>> # cut the last two seconds of the clip:
    >>> new_clip = clip.subclip(0, -2)
  
    If ``end_time`` is provided or if the clip has a duration attribute,
    the duration of the returned clip is set automatically.
docstr_tok: ["Returns","a","clip","playing","the","content","of","the","current","clip","between","times","``","start_time","``","and","``","end_time","``",",","which","can","be","expressed","in","seconds","(","15.35",")",",","in","(","min",",","sec",")",",","in","(","hour",",","min",",","sec",")",",","or","as","a","string",":","'01:03:05.35","'",".","The","``","mask","``","and","``","audio","``","of","the","resulting","subclip","will","be","subclips","of","``","mask","``","and","``","audio","``","the","original","clip",",","if","they","exist",".","It","'s","equivalent","to","slice","the","clip","as","a","sequence",",","like","``","clip","[","t_start",":","t_end","]","``",".","Parameters","--","--","--","--","--","start_time",":","float","or","tuple","or","str",",","optional","Moment","that","will","be","chosen","as","the","beginning","of","the","produced","clip",".","If","is","negative",",","it","is","reset","to","``","clip.duration","+","start_time","``",".","end_time",":","float","or","tuple","or","str",",","optional","Moment","that","will","be","chosen","as","the","end","of","the","produced","clip",".","If","not","provided",",","it","is","assumed","to","be","the","duration","of","the","clip","(","potentially","infinite",")",".","If","is","negative",",","it","is","reset","to","``","clip.duration","+","end_time","``",".","For","instance",":",">",">",">","#","cut","the","last","two","seconds","of","the","clip",":",">",">",">","new_clip","=","clip.subclip","(","0",",","-2",")","If","``","end_time","``","is","provided","or","if","the","clip","has","a","duration","attribute",",","the","duration","of","the","returned","clip","is","set","automatically","."]
code: def subclip(self, start_time=0, end_time=None):
      """Returns a clip playing the content of the current clip between times
      ``start_time`` and ``end_time``, which can be expressed in seconds
      (15.35), in (min, sec), in (hour, min, sec), or as a string:
      '01:03:05.35'.
  
      The ``mask`` and ``audio`` of the resulting subclip will be subclips of
      ``mask`` and ``audio`` the original clip, if they exist.
  
      It's equivalent to slice the clip as a sequence, like
      ``clip[t_start:t_end]``.
  
      Parameters
      ----------
  
      start_time : float or tuple or str, optional
        Moment that will be chosen as the beginning of the produced clip. If
        is negative, it is reset to ``clip.duration + start_time``.
  
      end_time : float or tuple or str, optional
        Moment that will be chosen as the end of the produced clip. If not
        provided, it is assumed to be the duration of the clip (potentially
        infinite). If is negative, it is reset to ``clip.duration + end_time``.
        For instance:
  
        >>> # cut the last two seconds of the clip:
        >>> new_clip = clip.subclip(0, -2)
  
        If ``end_time`` is provided or if the clip has a duration attribute,
        the duration of the returned clip is set automatically.
      """
      if start_time < 0:
          # Make this more Python-like, a negative value means to move
          # backward from the end of the clip
          start_time = (
              self.duration + start_time
          )  # Remember start_time is negative
  
      if (self.duration is not None) and (start_time >= self.duration):
          raise ValueError(
              "start_time (%.02f) " % start_time
              + "should be smaller than the clip's "
              + "duration (%.02f)." % self.duration
          )
  
      new_clip = self.time_transform(
          lambda t: t + start_time, apply_to=[]
      )
  
      if (end_time is None) and (self.duration is not None):
          end_time = self.duration
  
      elif (end_time is not None) and (end_time < 0):
          if self.duration is None:
              raise ValueError(
                  (
                      "Subclip with negative times (here %s)"
                      " can only be extracted from clips with a ``duration``"
                  )
                  % (str((start_time, end_time)))
              )
  
          else:
              end_time = self.duration + end_time
  
      if end_time is not None:
          new_clip.duration = end_time - start_time
          new_clip.end = new_clip.start + new_clip.duration
  
      return new_clip
  
imports: import copy
  from functools import reduce
  from numbers import Real
  from operator import add
  import numpy
  import proglog
  from moviepy.decorators import apply_to_audio, apply_to_mask, convert_parameter_to_seconds, outplace, requires_duration, use_clip_fps_by_default
label_desc: Use image node_id 15 for calling the Clip obj's underlying member method code with example usage: obj.subclip(start_time, end_time) and returns: new_clip