def copy_job(self, jobname, newjobname):
        """
        Copy a job 
        :param jobname: name of a exist job, str
        :param newjobname: name of new job, str
        :return: new Job obj
        """
        qs = urllib.urlencode({'name': newjobname,
                               'mode': 'copy',
                               'from': jobname})
        copy_job_url = urlparse.urljoin(self.baseurl, "createItem?%s" % qs)
        self.post_data(copy_job_url, '')
        newjk = Jenkins(self.baseurl, username=self.username,
                        password=self.password, proxyhost=self.proxyhost,
                        proxyport=self.proxyport, proxyuser=self.proxyuser,
                        proxypass=self.proxypass, formauth=self.formauth)
        return newjk.get_job(newjobname)
dataset/ETHPy150Open ramonvanalteren/jenkinsapi/jenkinsapi/jenkins.py/Jenkins.copy_job/original