<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ips_with_roles(self, roles, env=None, match_all=False):
 """ Returns a function that, when called, gets servers with the given roles. If env is given, then the environment must match as well. If match_all is True, then only return servers who have all of the given roles. Otherwise, return servers that have one or more of the given roles. """

        def func():
            return [s['external_ip'] for s in self.servers_with_roles(roles, env, match_all)]
        return func