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

def _compress(compress):
    '''
    Resolve compression flags
    '''
    if compress in ('bz2', 'bzip2', 'j'):
        compression = 'j'
        ext = 'bz2'
    elif compress in ('gz', 'gzip', 'z'):
        compression = 'z'
        ext = 'gz'
    elif compress in ('xz', 'a', 'J'):
        compression = 'J'
        ext = 'xz'

    return compression, ext