def do_use_container(**kwargs):
    """
    Decide whether to use a container or not.

    :param kwargs: dictionary of key-word arguments.
    :return: True if function has decided that a container should be used, False otherwise (boolean).
    """
    use_container = False
    job = kwargs.get('job', False)
    copytool = kwargs.get('copytool', False)
    if job:
        if job.is_analysis() and job.imagename:
            use_container = False
        elif not (job.platform or job.alrbuserplatform):
            use_container = False
        else:
            queuedata = job.infosys.queuedata
            container_name = queuedata.container_type.get('pilot')
            if container_name == 'singularity':
                use_container = True
    elif copytool:
        use_container = True
    return use_container
