code: def requires_duration(func, clip, *args, **kwargs):
      """Raises an error if the clip has no duration."""
      if clip.duration is None:
          raise ValueError("Attribute 'duration' not set")
      else:
          return func(clip, *args, **kwargs)
  
file_path: moviepy/moviepy/decorators.py
imports: import inspect
  import os
  import decorator
  from moviepy.tools import convert_to_seconds
label_desc: Use image node_id 5 for calling a global function with example usage: requires_duration(func, clip) and returns: func