Set comprehensions the way they are done in Python3.
        They're more other comprehensions, e.g. set comprehensions
        See if we can combine code.
490396
def setcomprehension_walk3(self, node, collection_index):
        
        p = self.prec
        self.prec = 27

        code = Code(node[1].attr, self.scanner, self.currentclass)
        ast = self.build_ast(code._tokens, code._customize)
        self.customize(code._customize)
        ast = ast[0][0][0]
        store = ast[3]
        collection = node[collection_index]

        n = ast[4]
        list_if = None
        assert n == 'comp_iter'

        # find innermost node
        while n == 'comp_iter':
            n = n[0] # recurse one step
            # FIXME: adjust for set comprehension
            if n == 'list_for':
                store = n[2]
                n = n[3]
            elif n in ('list_if', 'list_if_not', 'comp_if', 'comp_if_not'):
                # FIXME: just a guess
                if n[0].kind == 'expr':
                    list_if = n
                else:
                    list_if = n[1]
                n = n[2]
                pass
            pass

        assert n == 'comp_body', ast

        self.preorder(n[0])
        self.write(' for ')
        self.preorder(store)
        self.write(' in ')
        self.preorder(collection)
        if list_if:
            self.preorder(list_if)
        self.prec = p
318284
def as_set(obj):
    
    if obj is None or isinstance(obj, collections.Set):
        return obj

    if not isinstance(obj, collections.Iterable):
        return set((obj,))
    else:
        return set(obj)
1313275
def is_entailed_by(self, other):
        
        other = self.coerce(other)
        to_i = self.to_i
        return to_i(other.low) >= to_i(self.low) and \
                to_i(other.high) <= to_i(self.high)
999697
def merge(self, other):
        
        ignore = self.ignore
        extra = self.extras
        if isinstance(other, Dict):
            other_keys = other.keys
            ignore += other.ignore
            extra += other.extras
        elif isinstance(other, (list, tuple)):
            other_keys = list(other)
        elif isinstance(other, dict):
            return self.__class__(other, *self.keys)
        else:
            raise TypeError('You must merge Dict only with Dict'
                            ' or list of Keys')
        return self.__class__(*(self.keys + other_keys), ignore_extra=ignore,
                              allow_extra=extra)
73137
void and(LongBitSet other) {
		int pos = Math.min(numWords, other.numWords);
		while (--pos >= 0) {
			bits[pos] &= other.bits[pos];
		}
		if (numWords > other.numWords) {
			Arrays.fill(bits, other.numWords, numWords, 0L);
		}
	}
352318
void or(LongBitSet other) {
		assert other.numWords <= numWords : "numWords=" + numWords + ", other.numWords=" + other.numWords;
		int pos = Math.min(numWords, other.numWords);
		while (--pos >= 0) {
			bits[pos] |= other.bits[pos];
		}
	}
1074515
def do_whatis(self, arg):
        
        try:
            value = self._getval(arg)
        except Exception:
            # _getval() already printed the error
            return
        code = None
        # Is it a function?
        try:
            code = value.__code__
        except Exception:
            pass
        if code:
            self.message('Function %s' % code.co_name)
            return
        # Is it an instance method?
        try:
            code = value.__func__.__code__
        except Exception:
            pass
        if code:
            self.message('Method %s' % code.co_name)
            return
        # Is it a class?
        if value.__class__ is type:
            self.message('Class %s.%s' % (value.__module__, value.__name__))
            return
        # None of the above...
        self.message(type(value))
1200401
def as_set(self, decode=False):
        
        items = self.database.smembers(self.key)
        return set(_decode(item) for item in items) if decode else items
546450
def absorb(self, other):
        
        if not isinstance(other, self.__class__):
            raise TypeError("`other` has to be a instance of %s!" %
                            self.__class__)

        for attr, value in other.items():
            if value is not None:
                setattr(self, attr, deepcopy(value))
755295
def _set_concatenate(sets):
    
    def con(set):
        # if not all():
        #     raise ValueError('concatenated keys must have the same dtype')
        try:
            return np.concatenate([s for s in sets if len(s)])
        except ValueError:
            return set[0]

    if any(not isinstance(s, tuple) for s in sets):
        #assume all arrays
        return con(sets)
    else:
        #assume all tuples
        return tuple(con(s) for s in zip(*sets))
265616
def with_slots(cls):
    
    def _compare(self, other):
        for slot in self.__class__._slots_:
            attr = operator.attrgetter(slot)
            source = attr(self)
            target = attr(other)
            if isinstance(source, numpy.ndarray):
                eq = numpy.array_equal(source, target)
            elif hasattr(source, '_slots_'):
                source.assert_equal(target)
                eq = True
            else:
                eq = source == target
            yield slot, source, target, eq

    def __eq__(self, other):
        return all(eq for slot, source, target, eq in _compare(self, other))

    def __ne__(self, other):
        return not self.__eq__(other)

    def assert_equal(self, other, ignore=()):
        for slot, source, target, eq in _compare(self, other):
            if not eq and slot not in ignore:
                raise AssertionError('slot %s: %s is different from %s' %
                                     (slot, source, target))

    cls._slots_  # raise an AttributeError for missing slots
    cls.__eq__ = __eq__
    cls.__ne__ = __ne__
    cls.assert_equal = assert_equal
    return cls
516116
def difference(self, *iterables):
        
        diff = self._set.difference(*iterables)
        new_set = self.__class__(key=self._key, load=self._load, _set=diff)
        return new_set
460731
def issubset(self, other):
        """"""
        self._binary_sanity_check(other)
        return set.issubset(self, other)
839203
def better_sentences(func):
    """"""

    @wraps(func)
    def wrapped(*args):

            sentences = func(*args)
            new_sentences = []
            for i, l in enumerate(sentences):
                if '\n\n' in l:
                    splits = l.split('\n\n')
                    if len(splits)>1:
                        for ind,spl in enumerate(splits):
                            if len(spl) <20:
                                #if DEBUG: print "Discarding: ", spl
                                del splits[ind]
                    new_sentences.extend(splits)
                else:
                    new_sentences.append(l)
            return new_sentences
    return wrapped
1056656
def Prepend(self, **kw):
        
        kw = copy_non_reserved_keywords(kw)
        for key, val in kw.items():
            # It would be easier on the eyes to write this using
            # "continue" statements whenever we finish processing an item,
            # but Python 1.5.2 apparently doesn't let you use "continue"
            # within try:-except: blocks, so we have to nest our code.
            try:
                orig = self._dict[key]
            except KeyError:
                # No existing variable in the environment, so just set
                # it to the new value.
                self._dict[key] = val
            else:
                try:
                    # Check if the original looks like a dictionary.
                    # If it is, we can't just try adding the value because
                    # dictionaries don't have __add__() methods, and
                    # things like UserList will incorrectly coerce the
                    # original dict to a list (which we don't want).
                    update_dict = orig.update
                except AttributeError:
                    try:
                        # Most straightforward:  just try to add them
                        # together.  This will work in most cases, when the
                        # original and new values are of compatible types.
                        self._dict[key] = val + orig
                    except (KeyError, TypeError):
                        try:
                            # Check if the added value is a list.
                            add_to_val = val.append
                        except AttributeError:
                            # The added value isn't a list, but the
                            # original is (by process of elimination),
                            # so insert the the new value in the original
                            # (if there's one to insert).
                            if val:
                                orig.insert(0, val)
                        else:
                            # The added value is a list, so append
                            # the original to it (if there's a value
                            # to append).
                            if orig:
                                add_to_val(orig)
                            self._dict[key] = val
                else:
                    # The original looks like a dictionary, so update it
                    # based on what we think the value looks like.
                    if SCons.Util.is_List(val):
                        for v in val:
                            orig[v] = None
                    else:
                        try:
                            update_dict(val)
                        except (AttributeError, TypeError, ValueError):
                            if SCons.Util.is_Dict(val):
                                for k, v in val.items():
                                    orig[k] = v
                            else:
                                orig[val] = None
        self.scanner_map_delete(kw)
969036
def set_python(self, value):
        """"""
        if self.multiselect:
            value = value or []
            elements = []

            for element in value:
                self.validate_value(element)
                elements.append(element)

            value = elements
        else:
            self.validate_value(value)

        self._set(value)
442766
def dict_isect_combine(dict1, dict2, combine_op=op.add):
    
    keys3 = set(dict1.keys()).intersection(set(dict2.keys()))
    dict3 = {key: combine_op(dict1[key], dict2[key]) for key in keys3}
    return dict3