<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def fix_ilx(self, ilx_id: str) -> str:
        ''' Database only excepts lower case and underscore version of ID '''
        ilx_id = ilx_id.replace('http://uri.interlex.org/base/', '')
        if ilx_id[:4] not in ['TMP:', 'tmp_', 'ILX:', 'ilx_']:
            raise ValueError(
                'Need to provide ilx ID with format ilx_# or ILX:# for given ID ' + ilx_id)
        return ilx_id.replace('ILX:', 'ilx_').replace('TMP:', 'tmp_')