def activity_profile_get(req_dict):
    # Instantiate ActivityProfile
    ap = ActivityProfileManager()
    # Get profileId and activityId
    profile_id = req_dict['params'].get('profileId', None) if 'params' in req_dict else None
    activity_id = req_dict['params'].get('activityId', None) if 'params' in req_dict else None
    
    #If the profileId exists, get the profile and return it in the response
    if profile_id:
        resource = ap.get_profile(profile_id, activity_id)
        if resource.profile:
            try:
                response = HttpResponse(resource.profile.read(), content_type=resource.content_type)
            except __HOLE__:
                response = HttpResponseNotFound("Error reading file, could not find: %s" % profile_id)
        else:
            response = HttpResponse(resource.json_profile, content_type=resource.content_type)
        response['ETag'] = '"%s"' % resource.etag
        return response

    #Return IDs of profiles stored since profileId was not submitted
    since = req_dict['params'].get('since', None) if 'params' in req_dict else None
    resource = ap.get_profile_ids(activity_id, since)
    response = JsonResponse([k for k in resource], safe=False)
    response['since'] = since
    
    # If it's a HEAD request
    if req_dict['method'].lower() != 'get':
        response.body = ''
    return response
dataset/ETHPy150Open adlnet/ADL_LRS/lrs/utils/req_process.py/activity_profile_get