<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_query_targets(cli_ctx, apps, resource_group):
 """Produces a list of uniform GUIDs representing applications to query."""

    if isinstance(apps, list):
        if resource_group:
            return [get_id_from_azure_resource(cli_ctx, apps[0], resource_group)]
        return list(map(lambda x: get_id_from_azure_resource(cli_ctx, x), apps))
    else:
        if resource_group:
            return [get_id_from_azure_resource(cli_ctx, apps, resource_group)]
        return apps