<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def draw(instance):
 """Generic draw function"""

    # Draw Wavefront instance
    if isinstance(instance, Wavefront):
        draw_materials(instance.materials)
    # Draw single material
    elif isinstance(instance, Material):
        draw_material(instance)
    # Draw dict of materials
    elif isinstance(instance, dict):
        draw_materials(instance)
    else:
        raise ValueError("Cannot figure out how to draw: {}".format(instance))