def get_resources_for_rgs(ew, bearer_token, sub_url, resource_groups, input_sourcetype, checkpoint_dict):
    '\n        map the resource groups to a function that gets resources\n    '
    resource_group_names = []
    for resource_group in resource_groups:
        resource_group_names.append(resource_group['name'])
    with futures.ThreadPoolExecutor(max_workers=5) as executor:
        rg_future = dict(((executor.submit(get_resources, ew, bearer_token, sub_url, rg), rg) for rg in resource_group_names))
        for future in futures.as_completed(rg_future, None):
            resource_group = rg_future[future]
            if (future.exception() is not None):
                ew.log('ERROR', 'Resource group {0} generated an exception: {1}'.format(resource_group, future.exception()))
            else:
                get_metrics_for_resources(ew, bearer_token, sub_url, resource_group, future.result(), input_sourcetype, checkpoint_dict)
map the resource groups to a function that gets resources
def get_resources_for_rgs(ew, bearer_token, sub_url, resource_groups, input_sourcetype, checkpoint_dict):
    '\n        \n    '
    resource_group_names = []
    for resource_group in resource_groups:
        resource_group_names.append(resource_group['name'])
    with futures.ThreadPoolExecutor(max_workers=5) as executor:
        rg_future = dict(((executor.submit(get_resources, ew, bearer_token, sub_url, rg), rg) for rg in resource_group_names))
        for future in futures.as_completed(rg_future, None):
            resource_group = rg_future[future]
            if (future.exception() is not None):
                ew.log('ERROR', 'Resource group {0} generated an exception: {1}'.format(resource_group, future.exception()))
            else:
                get_metrics_for_resources(ew, bearer_token, sub_url, resource_group, future.result(), input_sourcetype, checkpoint_dict)