Abstraction, memory leaks, polymorphism
Implement an extensible Python design for processing heterogeneous resources. Define an abstract Resource interface, provide polymorphic text and image implementations, and use a manager that does not retain processed resources after the function returns. The function must return each rendered resource and the number of resources still retained by the manager.
Function: render_resources(records)
Each record is a dictionary with kind equal to "text" or "image", and a string value. Return (rendered, live_count), where rendered is a list of strings and live_count is the manager's retained-resource count after processing.
def render_resources(records):