def create_job_id(self, data):
        """
        Create a new job id and reference (refs/aetros/job/<id>) by creating a new commit with empty tree. That
        root commit is the actual job id. A reference is then created to the newest (head) commit of this commit history.
        The reference will always be updated once a new commit is added.
        """
        self.add_file('aetros/job.json', simplejson.dumps(data, indent=4))
        tree_id = self.write_tree()

        self.job_id = self.command_exec(['commit-tree', '-m', "JOB_CREATED", tree_id])[0].decode('utf-8').strip()

        out, code, err = self.command_exec(['show-ref', self.ref_head], allowed_to_fail=True)
        if not code:
            self.logger.warning("Generated job id already exists, because exact same experiment values given. Ref " + self.ref_head)

        self.command_exec(['update-ref', self.ref_head, self.job_id])

        # make sure we have checkedout all files we have added until now. Important for simple models, so we have the
        # actual model.py and dataset scripts.
        if not os.path.exists(self.work_tree):
            os.makedirs(self.work_tree)

        # updates index and working tree
        # '--', '.' is important to not update HEAD
        self.command_exec(['--work-tree', self.work_tree, 'checkout', self.ref_head, '--', '.'])

        # every caller needs to make sure to call git.push
        return self.job_id
def create_job_id ( self , data ) : self . add_file ( 'aetros/job.json' , simplejson . dumps ( data , indent = 4 ) ) tree_id = self . write_tree ( ) self . job_id = self . command_exec ( [ 'commit-tree' , '-m' , "JOB_CREATED" , tree_id ] ) [ 0 ] . decode ( 'utf-8' ) . strip ( ) out , code , err = self . command_exec ( [ 'show-ref' , self . ref_head ] , allowed_to_fail = True ) if not code : self . logger . warning ( "Generated job id already exists, because exact same experiment values given. Ref " + self . ref_head ) self . command_exec ( [ 'update-ref' , self . ref_head , self . job_id ] ) if not os . path . exists ( self . work_tree ) : os . makedirs ( self . work_tree ) self . command_exec ( [ '--work-tree' , self . work_tree , 'checkout' , self . ref_head , '--' , '.' ] ) return self . job_id
Create a new job id and reference (refs/aetros/job/<id>) by creating a new commit with empty tree. That
        root commit is the actual job id. A reference is then created to the newest (head) commit of this commit history.
        The reference will always be updated once a new commit is added.