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

def _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun, rsh):
    '''
    Generate rsync options
    '''
    options = ['-avz']

    if delete:
        options.append('--delete')
    if force:
        options.append('--force')
    if update:
        options.append('--update')
    if rsh:
        options.append('--rsh={0}'.format(rsh))
    if passwordfile:
        options.extend(['--password-file', passwordfile])
    if excludefrom:
        options.extend(['--exclude-from', excludefrom])
        if exclude:
            exclude = False
    if exclude:
        if isinstance(exclude, list):
            for ex_ in exclude:
                options.extend(['--exclude', ex_])
        else:
            options.extend(['--exclude', exclude])
    if dryrun:
        options.append('--dry-run')
    return options