Creates a subclass with discreet named bits constraint.

        Reduce fully duplicate enumerations along the way.
483581
def withNamedBits(cls, **values):
        
        enums = set(cls.namedValues.items())
        enums.update(values.items())

        class X(cls):
            namedValues = namedval.NamedValues(*enums)

        X.__name__ = cls.__name__
        return X
1310248
def _encode_binary(name, value, dummy0, dummy1):
    """"""
    subtype = value.subtype
    if subtype == 2:
        value = _PACK_INT(len(value)) + value
    return b"\x05" + name + _PACK_LENGTH_SUBTYPE(len(value), subtype) + value
1186772
function _gpfClassSuperCreateWithSameSignature (superMethod) {
    var definition = _gpfFunctionDescribe(superMethod);
    definition.body = "return _superMethod_.apply(this, arguments);";
    return _gpfFunctionBuild(definition, {
        _superMethod_: superMethod
    });
}
193549
def zero_extend(self, new_length):
        
        si = self.copy()
        si._bits = new_length

        return si
780728
@NotNull
    public static EnhancedMimeType create(@NotNull final String primary, @NotNull final String sub) {
        return create(primary, sub, null, null, null);
    }
436008
def extend(self, namespace = None, name = None, **kwargs):
        '''
        
        '''
        if name is None:
            name = self._readablename
        d = dict(self._values)
        d.update(kwargs)
        return enum(name, namespace, self, self._bitwise, **d)
715251
private Set<ClassDescriptor> computeKnownSubtypes(ClassDescriptor classDescriptor) throws ClassNotFoundException {
        LinkedList<ClassVertex> workList = new LinkedList<>();

        ClassVertex startVertex = resolveClassVertex(classDescriptor);
        workList.addLast(startVertex);

        Set<ClassDescriptor> result = new HashSet<>();

        while (!workList.isEmpty()) {
            ClassVertex current = workList.removeFirst();

            if (result.contains(current.getClassDescriptor())) {
                // Already added this class
                continue;
            }

            // Add class to the result
            result.add(current.getClassDescriptor());

            // Add all known subtype vertices to the work list
            Iterator<InheritanceEdge> i = graph.incomingEdgeIterator(current);
            while (i.hasNext()) {
                InheritanceEdge edge = i.next();
                workList.addLast(edge.getSource());
            }
        }

        return new HashSet<>(result);
    }
816079
public final void xor(ThreadSafeBitSet other) {
        if (other.size != size) throw new IllegalArgumentException("BitSets must be of equal size");
        for (int i = 0; i < bits.length; i++) {
            bits[i] ^= other.bits[i];
        }
    }
1189524
public JBBPDslBuilder Bits(final String name, final JBBPBitNumber bits) {
    final Item item = new Item(BinType.BIT, name, this.byteOrder);
    item.bitNumber = bits;
    this.addItem(item);
    return this;
  }
253757
function _gpfClassSuperCreate (superMember) {
    var superMethod;
    if (typeof superMember === "function") {
        superMethod = superMember;
    } else {
        superMethod = _gpfClassNoSuper;
    }
    return _gpfClassSuperCreateWithSameSignature(superMethod);
}
428619
private ConstraintSet makeAtomic() {
    boolean done = false;
    List<Constraint> current = subConstraints;
    List<Constraint> next = Lists.newArrayList();
    TypeReplacement nextBindings = new TypeReplacement(bindings);
    boolean solvable = this.solvable;
    while (!done) {
      done = true;
      for (Constraint c : current) {
        Constraint substituted = c.substitute(nextBindings.getBindings());
        Type subtype = substituted.subtype;
        Type supertype = substituted.supertype;
        
        if (subtype.isFunctional() && supertype.isFunctional()) {
          next.add(new Constraint(supertype.getArgumentType(), subtype.getArgumentType()));
          next.add(new Constraint(subtype.getReturnType(), supertype.getReturnType()));
          done = false;
        } else if (!subtype.isFunctional() && supertype.isFunctional()) {
          if (subtype.hasTypeVariables()) {
            Type subtypeReplacement = upcast(supertype, next, false);
            nextBindings.add(subtype.getAtomicTypeVar(), subtypeReplacement);
            done = false;
          } else {
            solvable = false;
          }
        } else if (subtype.isFunctional() && !supertype.isFunctional()) {
          if (supertype.hasTypeVariables()) {
            Type supertypeReplacement = upcast(subtype, next, true);
            nextBindings.add(supertype.getAtomicTypeVar(), supertypeReplacement);
            done = false;
          } else {
            solvable = false;
          }
        } else {
          next.add(substituted);
        }
      }

      current = next;
      next = Lists.newArrayList();
    }

    return new ConstraintSet(Lists.newArrayList(), current, nextBindings,
        solvable, typeVarCounter);
  }
1220138
@GwtIncompatible
    public static <T> Key<T> create( Class<? extends T> kindClass, String name ) {
        throw new UnsupportedOperationException();
    }
957683
public static Object newInstance(final HexEncoder encoder) {

        if (encoder == null) {
            throw new NullPointerException("encoder");
        }

        return newInstance(
            HexBinaryEncoderProxy.class, HexEncoder.class, encoder);
    }
796616
public void makeSameAs(UnconditionalValueDerefSet source) {
        // Copy value numbers
        valueNumbersUnconditionallyDereferenced.clear();
        valueNumbersUnconditionallyDereferenced.or(source.valueNumbersUnconditionallyDereferenced);
        lastUpdateTimestamp = source.lastUpdateTimestamp;
        // Copy dereference locations for each value number
        derefLocationSetMap.clear();
        if (source.derefLocationSetMap.size() > 0) {
            for (Map.Entry<ValueNumber, Set<Location>> sourceEntry : source.derefLocationSetMap.entrySet()) {
                Set<Location> derefLocationSet = Util.makeSmallHashSet(sourceEntry.getValue());
                derefLocationSetMap.put(sourceEntry.getKey(), derefLocationSet);
            }
        }
    }
789048
def intersection(bitfield)
      raise "That's not a bitfield" if ! bitfield.is_a?(Bitfield)
      raise "bitfield lengths must be equal" if ! bitfield.length == length

      newbitfield = Bitfield.new(length)
      newbitfield.copyFrom(self)
      newbitfield.intersection!(bitfield)
    end
754613
public Optional<ImmutableSubstitution<ImmutableTerm>> computeUnidirectionalSubstitution(ImmutableTerm sourceTerm,
                                                                                                   ImmutableTerm targetTerm) {
        /*
         * Variable
         */
        if (sourceTerm instanceof Variable) {
            Variable sourceVariable = (Variable) sourceTerm;

            // Constraint
            if ((!sourceVariable.equals(targetTerm))
                    && (targetTerm instanceof ImmutableFunctionalTerm)
                    && ((ImmutableFunctionalTerm)targetTerm).getVariables().contains(sourceVariable)) {
                return Optional.empty();
            }

            ImmutableSubstitution<ImmutableTerm> substitution = substitutionFactory.getSubstitution(
                    ImmutableMap.of(sourceVariable, targetTerm));
            return Optional.of(substitution);
        }
        /*
         * Functional term
         */
        else if (sourceTerm instanceof ImmutableFunctionalTerm) {
            if (targetTerm instanceof ImmutableFunctionalTerm) {
                return computeUnidirectionalSubstitutionOfFunctionalTerms((ImmutableFunctionalTerm) sourceTerm,
                        (ImmutableFunctionalTerm) targetTerm);
            }
            else {
                return Optional.empty();
            }
        }
        /*
         * Constant
         */
        else if(sourceTerm.equals(targetTerm)) {
            return Optional.of(substitutionFactory.getSubstitution());
        }
        else {
            return Optional.empty();
        }
    }
666120
private Stream<ImmutableSubstitution<ImmutableTerm>> splitSubstitution(
            ImmutableSubstitution<ImmutableTerm> substitution, VariableGenerator variableGenerator) {

        ImmutableMultimap<Variable, Integer> functionSubTermMultimap = substitution.getImmutableMap().entrySet().stream()
                .filter(e -> e.getValue() instanceof ImmutableFunctionalTerm)
                .flatMap(e -> {
                    ImmutableList<? extends ImmutableTerm> subTerms = ((ImmutableFunctionalTerm) e.getValue()).getTerms();
                    return IntStream.range(0, subTerms.size())
                            .filter(i -> subTerms.get(i) instanceof ImmutableFunctionalTerm)
                            .boxed()
                            .map(i -> Maps.immutableEntry(e.getKey(), i));
                })
                .collect(ImmutableCollectors.toMultimap());

        if (functionSubTermMultimap.isEmpty())
            return Stream.of(substitution);

        ImmutableTable<Variable, Integer, Variable> subTermNames = functionSubTermMultimap.entries().stream()
                .map(e -> Tables.immutableCell(e.getKey(), e.getValue(), variableGenerator.generateNewVariable()))
                .collect(ImmutableCollectors.toTable());

        ImmutableMap<Variable, ImmutableTerm> parentSubstitutionMap = substitution.getImmutableMap().entrySet().stream()
                .map(e ->
                        Optional.ofNullable(functionSubTermMultimap.get(e.getKey()))
                                .map(indexes -> {
                                    Variable v = e.getKey();
                                    ImmutableFunctionalTerm def = (ImmutableFunctionalTerm) substitution.get(v);
                                    ImmutableList<ImmutableTerm> newArgs = IntStream.range(0, def.getArity())
                                            .boxed()
                                            .map(i -> Optional.ofNullable((ImmutableTerm) subTermNames.get(v, i))
                                                    .orElseGet(() -> def.getTerm(i)))
                                            .collect(ImmutableCollectors.toList());

                                    ImmutableTerm newDef = termFactory.getImmutableFunctionalTerm(
                                            def.getFunctionSymbol(), newArgs);
                                    return Maps.immutableEntry(v, newDef);
                                })
                                .orElse(e))
                .collect(ImmutableCollectors.toMap());

        ImmutableSubstitution<ImmutableTerm> parentSubstitution = substitutionFactory.getSubstitution(parentSubstitutionMap);


        ImmutableSubstitution<ImmutableTerm> childSubstitution = substitutionFactory.getSubstitution(
                subTermNames.cellSet().stream()
                    .collect(ImmutableCollectors.toMap(
                        Table.Cell::getValue,
                        c -> ((ImmutableFunctionalTerm) substitution.get(c.getRowKey())).getTerm(c.getColumnKey()))));

        return Stream.concat(
                // Recursive
                splitSubstitution(childSubstitution, variableGenerator),
                Stream.of(parentSubstitution));
    }