@classmethod
def from_job(cls, job):
    'Create a profile based on a given job. All properties\n        are set according to the given job, except the jobs temp state,\n        which will be kept unmodified.\n\n        :param job: the job\n        :returns: new profile generated from the job\n        '
    profile = cls()
    profile.threads = (job.threads if (job.threads > 0) else None)
    profile.nodes = job.nodes
    profile.tasks = job.tasks
    profile.tasts_per_node = job.tasks_per_node
    profile.environment = job.environment
    profile.queue = job.queue
    profile.priority = job.priority
    profile.time = job.max_time
    profile.mem = job.max_memory
    profile.log = job.stderr
    profile.out = job.stdout
    profile.account = job.account
    profile.extra = job.extra
    profile.working_dir = job.working_directory
    profile.env = job.env
    return profile
Create a profile based on a given job. All properties
are set according to the given job, except the jobs temp state,
which will be kept unmodified.

:param job: the job
:returns: new profile generated from the job
@classmethod
def from_job(cls, job):
    'Create a profile based on a given job. All properties\n        are set according to the given job, except the jobs temp state,\n        which will be kept unmodified.\n\n        :param job: the job\n        :returns: new profile generated from the job\n        '
    profile = cls()
    profile.threads = (job.threads if (job.threads > 0) else None)
    profile.nodes = job.nodes
    profile.tasks = job.tasks
    profile.tasts_per_node = job.tasks_per_node
    profile.environment = job.environment
    profile.queue = job.queue
    profile.priority = job.priority
    profile.time = job.max_time
    profile.mem = job.max_memory
    profile.log = job.stderr
    profile.out = job.stdout
    profile.account = job.account
    profile.extra = job.extra
    profile.working_dir = job.working_directory
    profile.env = job.env
    return profile