@staticmethod
    def update_program(program, encoding, gbias, lbias_arr, fdidx):

        offset = 0
        for item in encoding:
            subr = item[1]
            s = slice(item[0] - offset, item[0] + subr.length - offset)
            if subr._flatten:
                program[s] = subr._program
                offset += subr.length - len(subr._program)
            else:
                assert hasattr(subr, "_position"), \
                        "CandidateSubr without position in Subrs encountered"   

                if subr._global:
                    operator = "callgsubr"
                    bias = gbias
                else:
                    # assert this is a local or global only used by one FD
                    assert len(subr._fdidx) == 1
                    assert fdidx == None or subr._fdidx[0] == fdidx
                    operator = "callsubr"
                    bias = lbias_arr[subr._fdidx[0]]
                    
                program[s] = [subr._position - bias, operator]
                offset += subr.length - 2
        return program
Get repository object for project.
dataset/ETHPy150Open googlei18n/compreffor/compreffor/pyCompressor.py/Compreffor.update_program--crossover with--dataset/ETHPy150Open ask/python-github2/github2/repositories.py/Repositories.show