def METHOD_NAME(self):
    for field in "co_consts co_names co_varnames co_freevars co_cellvars".split():
        val = getattr(self, field)
        if isinstance(val, list):
            setattr(self, field, tuple(val))
    # for field, typename in self.fieldtypes:
    #     pass
    if isinstance(self.co_lnotab, dict):
        d = self.co_lnotab
        self.co_lnotab = sorted(zip(d.keys(), d.values()), key=lambda tup: tup[0])
    if isinstance(self.co_lnotab, list):
        # We assume we have a list of tuples:
        # (offset, linenumber) which we convert
        # into the encoded format
        self.encode_lineno_tab()
    if isinstance(self.co_code, str) and PYTHON_VERSION_TRIPLE >= (3, 0):
        self.co_code = self.co_code.encode()
    if isinstance(self.co_lnotab, str):
        self.co_lnotab = self.co_lnotab.encode()
    return self