How would you write and maintain a library of reusable test templates or CI/CD pipelines using GitLab CI or Jenkins? Implement a resolver for named pipeline templates that inherit steps from at most one parent template. Return the fully ordered steps for a requested template, or None if the target is missing or inheritance contains a cycle. Input is a dictionary of template names to objects containing an optional extends name and a list of string steps.
None for a missing target, missing parent, or cyclic inheritancedef resolve_pipeline(templates, target):