def _gets(gens, exclude):
    '''Return all IP or MAC addresses subject to exclude.
    '''
    x = exclude
    if x is None:
        x = lambda _: False  # PYCHOK expected
    elif not hasattr(x, '__call__'):
        raise TypeError('exclude not callable: %r' % (x,))

    t = []
    for g in gens:
        for a in g():
            if _debugf:
                _debugf('%s yields: %r', g.__name__, a)
            if a and a not in t and not x(a):
                t.append(a)
    t = tuple(t)

    if _debugf:
        _debugf('_gets(exclude=%r): %r', exclude, t)
    return t
Return all IP or MAC addresses subject to exclude.
    
recipes/Python/577191_IP_and_MAC_addresses/recipe-577191.py