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

def _parse_oratab(sid):
    '''
    Return ORACLE_HOME for a given SID found in oratab

    Note: only works with Unix-like minions
    '''
    if __grains__.get('kernel') in ('Linux', 'AIX', 'FreeBSD', 'OpenBSD', 'NetBSD'):
        ORATAB = '/etc/oratab'
    elif __grains__.get('kernel') in 'SunOS':
        ORATAB = '/var/opt/oracle/oratab'
    else:
        # Windows has no oratab file
        raise CommandExecutionError(
            'No uri defined for {0} and oratab not available in this OS'.format(sid))
    with fopen(ORATAB, 'r') as f:
        while True:
            line = f.readline()
            if not line:
                break
            if line.startswith('#'):
                continue
            if sid in line.split(':')[0]:
                return line.split(':')[1]
    return None