def loadAliasFile(domains, filename=None, fp=None):
    result = {}
    if fp is None:
        fp = file(filename)
    else:
        filename = getattr(fp, 'name', '<unknown>')
    i = 0
    prev = ''
    for line in fp:
        i += 1
        line = line.rstrip()
        if line.lstrip().startswith('#'):
            continue
        elif line.startswith(' ') or line.startswith('\t'):
            prev = prev + line
        else:
            if prev:
                handle(result, prev, filename, i)
            prev = line
    if prev:
        handle(result, prev, filename, i)
    for (u, a) in result.items():
        addr = smtp.Address(u)
        result[u] = AliasGroup(a, domains, u)
    return result
C{--logger} takes precedence over a C{--syslog} command line
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/mail/alias.py/loadAliasFile--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/test/test_twistd.py/AppLoggerTests.test_configuredLogObserverBeatsSyslog