def create_job(self, name, user, template_name, **kwargs):
        """
        Creates a new job from a JobTemplate.

        Args:
            name (str): The name of the job.
            user (User): A User object for the user who creates the job.
            template_name (str): The name of the JobTemplate from which to create the job.
            **kwargs

        Returns:
            A new job object of the type specified by the JobTemplate
        """
        try:
            template = self.job_templates[template_name]
        except __HOLE__, e:
            raise KeyError('A job template with name %s was not defined' % (template_name,))
        JobClass = template.type
        user_workspace = self.app.get_user_workspace(user)

        kwrgs = dict(name=name, user=user, label=self.label, workspace=user_workspace.path)
        parameters = self._replace_workspaces(template.parameters, user_workspace)
        kwrgs.update(parameters)
        kwrgs.update(kwargs)
        job = JobClass(**kwrgs)
        return job
dataset/ETHPy150Open tethysplatform/tethys/tethys_compute/job_manager.py/JobManager.create_job