You are given following data for agents:
.available_since(time since the agent is available)
.roles(a list of roles that the user has eg:Spanish speaker, sales,export etc.,)
*When an issue comes in we need to present the issue to 1 or any agent based on agent selection mode can be all available least busy or random.In "all available mode" the issue is presented to all agents so they pick the issue if they want.In least busy the issue is presented to the agent that has been available for the longest.In random mode we randomly pick an agent.An issue has many roles(sales, export.,) the issue is presented to the only with matched roles.
Please write a function the takes input of list of agents with their data,agent selection mode and returns a list of agents the issue should be presented to...