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

def _auto(direction, name, value, source='auto', convert_to_human=True):
    '''
    Internal magic for from_auto and to_auto
    '''
    # NOTE: check direction
    if direction not in ['to', 'from']:
        return value

    # NOTE: collect property data
    props = property_data_zpool()
    if source == 'zfs':
        props = property_data_zfs()
    elif source == 'auto':
        props.update(property_data_zfs())

    # NOTE: figure out the conversion type
    value_type = props[name]['type'] if name in props else 'str'

    # NOTE: convert
    if value_type == 'size' and direction == 'to':
        return globals()['{}_{}'.format(direction, value_type)](value, convert_to_human)

    return globals()['{}_{}'.format(direction, value_type)](value)