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 instance playing the content of the current clip
  but with a modified timeline, time ``t`` being replaced by another
  time `time_func(t)`.
  
  Parameters
  ----------
  
  time_func : function
    A function ``t -> new_t``.
  
  apply_to : {"mask", "audio", ["mask", "audio"]}, optional
    Can be either 'mask', or 'audio', or ['mask','audio'].
    Specifies if the filter ``transform`` should also be applied to the
    audio or the mask of the clip, if any.
  
  keep_duration : bool, optional
    ``False`` (default) if the transformation modifies the
    ``duration`` of the clip.
  
  Examples
  --------
  
  >>> # plays the clip (and its mask and sound) twice faster
  >>> new_clip = clip.time_transform(lambda t: 2*t, apply_to=['mask', 'audio'])
  >>>
  >>> # plays the clip starting at t=3, and backwards:
  >>> new_clip = clip.time_transform(lambda t: 3-t)
docstr_tok: ["Returns","a","Clip","instance","playing","the","content","of","the","current","clip","but","with","a","modified","timeline",",","time","``","t","``","being","replaced","by","another","time","`","time_func","(","t",")","`",".","Parameters","--","--","--","--","--","time_func",":","function","A","function","``","t","-",">","new_t","``",".","apply_to",":","{","``","mask","''",",","``","audio","''",",","[","``","mask","''",",","``","audio","''","]","}",",","optional","Can","be","either","'mask","'",",","or","'audio","'",",","or","[","'mask","'",",","'audio","'","]",".","Specifies","if","the","filter","``","transform","``","should","also","be","applied","to","the","audio","or","the","mask","of","the","clip",",","if","any",".","keep_duration",":","bool",",","optional","``","False","``","(","default",")","if","the","transformation","modifies","the","``","duration","``","of","the","clip",".","Examples","--","--","--","--",">",">",">","#","plays","the","clip","(","and","its","mask","and","sound",")","twice","faster",">",">",">","new_clip","=","clip.time_transform","(","lambda","t",":","2","*","t",",","apply_to=","[","'mask","'",",","'audio","'","]",")",">",">",">",">",">",">","#","plays","the","clip","starting","at","t=3",",","and","backwards",":",">",">",">","new_clip","=","clip.time_transform","(","lambda","t",":","3-t",")"]
code: def time_transform(
      self, time_func, apply_to=None, keep_duration=False
  ):
      """
      Returns a Clip instance playing the content of the current clip
      but with a modified timeline, time ``t`` being replaced by another
      time `time_func(t)`.
  
      Parameters
      ----------
  
      time_func : function
        A function ``t -> new_t``.
  
      apply_to : {"mask", "audio", ["mask", "audio"]}, optional
        Can be either 'mask', or 'audio', or ['mask','audio'].
        Specifies if the filter ``transform`` should also be applied to the
        audio or the mask of the clip, if any.
  
      keep_duration : bool, optional
        ``False`` (default) if the transformation modifies the
        ``duration`` of the clip.
  
      Examples
      --------
  
      >>> # plays the clip (and its mask and sound) twice faster
      >>> new_clip = clip.time_transform(lambda t: 2*t, apply_to=['mask', 'audio'])
      >>>
      >>> # plays the clip starting at t=3, and backwards:
      >>> new_clip = clip.time_transform(lambda t: 3-t)
  
      """
      if apply_to is None:
          apply_to = []
  
      return self.transform(
          lambda get_frame, t: get_frame(time_func(t)),
          apply_to,
          keep_duration=keep_duration,
      )
  
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 5 for calling the Clip obj's underlying member method code with example usage: obj.time_transform(time_func, apply_to, keep_duration) and returns: self