def set_server(job, project_parameter):
    """
    Set the potential, queue and cpu_cores defined in the project_parameter dictionary to the job object.

    Args:
        job (GenericJob): Job object
        project_parameter (dict): Dictionary with the keys potential and cpu_cores and optionally queue

    Returns:
        GenericJob: Updated job object
    """
    job.potential = project_parameter["potential"]
    if "queue" in project_parameter.keys():
        job.server.queue = project_parameter["queue"]
    job.server.cores = project_parameter["cpu_cores"]
    return job