Assumption: one CQIE per mapping axiom (no nested union)
961539
private ImmutableMap<CQIE, PPMappingAssertionProvenance> convertIntoDatalog(SQLPPMapping ppMapping, RDBMetadata dbMetadata)
            throws InvalidMappingSourceQueriesException {

        /*
         * May also add views in the DBMetadata!
         */
        ImmutableMap<CQIE, PPMappingAssertionProvenance> datalogMap = ppMapping2DatalogConverter.convert(
                ppMapping.getTripleMaps(), dbMetadata);

        LOGGER.debug("Original mapping size: {}", datalogMap.size());

        // Normalizing language tags and equalities (SIDE-EFFECT!)
        normalizeMapping(datalogMap.keySet());

        return datalogMap;
    }
1226040
private Optional<PushDownBooleanExpressionProposal> makeProposalForJoinOrFilterNode(
            IntermediateQuery currentQuery, JoinOrFilterNode providerNode, ImmutableList<QueryNode> preSelectedChildren) {

        /*
         * If there is no boolean expression, no proposal
         */
        Optional<ImmutableExpression> optionalNestedExpression = providerNode.getOptionalFilterCondition();

        if (!optionalNestedExpression.isPresent()) {
            return Optional.empty();
        }

        /*
         * Decomposes the boolean expressions as much as possible (conjunction)
         */
        ImmutableSet<ImmutableExpression> booleanExpressions = optionalNestedExpression.get().flattenAND();

        /*
         * For each boolean expression, looks for recipients.
         */
        ImmutableMultimap<Recipient, ImmutableExpression> recipientMap = booleanExpressions.stream()
                .flatMap(ex -> selectPushes(currentQuery, providerNode, preSelectedChildren, ex))
                .collect(ImmutableCollectors.toMultimap(
                        p -> p.recipient,
                        p -> p.expression));

        return buildProposal(providerNode, recipientMap);
    }
1298416
def from_mapping(cls, mapping):
		
		out = cls()
		for elem, count in mapping.items():
			out._set_count(elem, count)
		return out
986359
@SuppressWarnings("unchecked")
  public static <E, C extends Counter<E>> C union(C c1, C c2) {
    C result = (C) c1.getFactory().create();
    addInPlace(result, c1);
    addInPlace(result, c2);
    return result;
  }
276158
private ImmutableSet<ImmutableExpression> getExpressionsToPropagateAboveUnion(ImmutableSet<CommutativeJoinOrFilterNode> providers) {
        return providers.stream()
                .map(n -> n.getOptionalFilterCondition().get().flattenAND())
                .reduce(this::computeIntersection).get();
    }
1062910
private void addUniqueConstraintForTableBasedSequence(Statements statements, IdSourceKeyMetadata generatorKeyMetadata) {
		Statement statement = createUniqueConstraintStatement( generatorKeyMetadata.getKeyColumnName(), generatorKeyMetadata.getName() );
		statements.addStatement( statement );
	}
80705
def from_mapping(self, *mapping, **kwargs):
        
        mappings = []
        if len(mapping) == 1:
            if hasattr(mapping[0], 'items'):
                mappings.append(mapping[0].items())
            else:
                mappings.append(mapping[0])
        elif len(mapping) > 1:
            raise TypeError('expected at most 1 positional argument, got %d' % len(mapping))

        mappings.append(kwargs.items())
        for mapping in mappings:
            for key, value in mapping:
                if key.isupper():
                    self[key] = value
        return True
799217
private ImmutableMap<Predicate,ImmutableList<TermType>> extractCastTypeMap(
            Multimap<Predicate, CQIE> ruleIndex, List<Predicate> predicatesInBottomUp,
            ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap, DBMetadata metadata) {

        // Append-only
        Map<Predicate,ImmutableList<TermType>> mutableCastMap = Maps.newHashMap();

        for (Predicate predicate : predicatesInBottomUp) {
            ImmutableList<TermType> castTypes = inferCastTypes(predicate, ruleIndex.get(predicate), termTypeMap,
                    mutableCastMap,metadata);

            mutableCastMap.put(predicate, castTypes);
        }

        return ImmutableMap.copyOf(mutableCastMap);
    }
200931
function assertTlsOptionsAreEqual(optionName, queryString, queryStringKeys) {
  const queryStringHasTLSOption = queryStringKeys.indexOf(optionName) !== -1;

  let optionValue;
  if (Array.isArray(queryString[optionName])) {
    optionValue = queryString[optionName][0];
  } else {
    optionValue = queryString[optionName];
  }

  if (queryStringHasTLSOption) {
    if (Array.isArray(queryString[optionName])) {
      const firstValue = queryString[optionName][0];
      queryString[optionName].forEach(tlsValue => {
        if (tlsValue !== firstValue) {
          throw new MongoParseError('All values of ${optionName} must be the same.');
        }
      });
    }
  }

  return optionValue;
}
776118
public boolean contentOfEquals(Map<String, Object> one, Object two) {
        if (one == null) {
            return two == null;
        } else {
            return one.equals(two);
        }
    }
484387
def from_mapping(cls, mapping):
        
        group = cls()
        for name, value in mapping.items():
            if name.startswith('_'):
                continue
            group[name] = Parameter(
                name=name,
                value=value,
                constraint=Parameter.constraint_from_type(value),
            )
        return group
1374386
function isEquivalentMemberExp(a, b) {
    return _.isEqualWith(a, b, (left, right, key) => {
        if (_.includes(['loc', 'range', 'computed', 'start', 'end', 'parent'], key)) {
            return true
        }
        if (isComputed(left) || isComputed(right)) {
            return false
        }
        if (key === 'property') {
            const leftValue = left.name || left.value
            const rightValue = right.name || right.value
            return leftValue === rightValue
        }
    })
}
1156738
def satisfy_one(self, assumptions=None, **params):
        
        verbosity = params.get('verbosity', 0)
        default_phase = params.get('default_phase', 2)
        propagation_limit = params.get('propagation_limit', -1)
        decision_limit = params.get('decision_limit', -1)
        seed = params.get('seed', 1)
        return picosat.satisfy_one(self.nvars, self.clauses, assumptions,
                                   verbosity, default_phase, propagation_limit,
                                   decision_limit, seed)
531989
private int maptype1_quantvals() {
        int vals = (int) (Math.floor(Math.pow(entries, 1. / dim)));

        // the above *should* be reliable, but we'll not assume that FP is
        // ever reliable when bitstream sync is at stake; verify via integer
        // means that vals really is the greatest value of dim for which
        // vals^b->bim <= b->entries
        // treat the above as an initial guess
        while (true) {
            int acc = 1;
            int acc1 = 1;
            for (int i = 0; i < dim; i++) {
                acc *= vals;
                acc1 *= vals + 1;
            }
            if (acc <= entries && acc1 > entries) {
                return (vals);
            } else {
                if (acc > entries) {
                    vals--;
                } else {
                    vals++;
                }
            }
        }
    }
934268
private static void tc(Map<M, Set<M>> index) {
        final Map<String, Object[]> warnings = new HashMap<>();

        for (Entry<M, Set<M>> entry: index.entrySet()) {
            final M src = entry.getKey();
            final Set<M> dependents = entry.getValue();
            final Queue<M> queue = new LinkedList<M>(dependents);

            while (!queue.isEmpty()) {
                final M key = queue.poll();
                if (!index.containsKey(key)) {
                    continue;
                }

                for (M addition: index.get(key)) {
                    if (!dependents.contains(addition)) {
                        dependents.add(addition);
                        queue.add(addition);
                        warnings.put(src + "|" + addition + "|" + key, new Object[] {src, addition, key});
                    }
                }
            }
        }

        for (final Object[] args: warnings.values()) {
            StructuredLog.ImpliedTransitiveDependency.warn(log, args);
        }
    }
708629
private boolean isRedundant(IContextMapping<INode> mapping, IMappingElement<INode> e) {
        switch (e.getRelation()) {
            case IMappingElement.LESS_GENERAL: {
                if (verifyCondition1(mapping, e)) {
                    return true;
                }
                break;
            }
            case IMappingElement.MORE_GENERAL: {
                if (verifyCondition2(mapping, e)) {
                    return true;
                }
                break;
            }
            case IMappingElement.DISJOINT: {
                if (verifyCondition3(mapping, e)) {
                    return true;
                }
                break;
            }
            case IMappingElement.EQUIVALENCE: {
                if (verifyCondition4(mapping, e)) {
                    return true;
                }
                break;
            }
            default: {
                return false;
            }

        }// end switch

        return false;
    }
1031105
private <V> BiMap<V, Integer> createIndex(Set<V> values) {
    if (values == null) {
      return null;
    }

    ImmutableBiMap.Builder<V, Integer> builder = ImmutableBiMap.builder();
    int idx = 0;
    for (V value : values) {
      builder.put(value, idx++);
    }
    return builder.build();
  }