Be aware that this treats any sequence type with the equal members as
        equal. As it is used to identify equality of schemas, this can be
        considered okay as definitions are semantically equal regardless the
        container type.
329497
def mapping_to_frozenset(mapping):
    

    aggregation = {}

    for key, value in mapping.items():
        if isinstance(value, Mapping):
            aggregation[key] = mapping_to_frozenset(value)
        elif isinstance(value, Sequence):
            value = list(value)
            for i, item in enumerate(value):
                if isinstance(item, Mapping):
                    value[i] = mapping_to_frozenset(item)
            aggregation[key] = tuple(value)
        elif isinstance(value, Set):
            aggregation[key] = frozenset(value)
        else:
            aggregation[key] = value

    return frozenset(aggregation.items())
134672
private boolean isMoreToReadBeforeReadingRecord(
      final SequenceOffsetType recordSequenceNumber,
      final SequenceOffsetType endSequenceNumber
  )
  {
    final int compareToEnd = createSequenceNumber(recordSequenceNumber)
        .compareTo(createSequenceNumber(endSequenceNumber));

    return isEndOffsetExclusive() ? compareToEnd < 0 : compareToEnd <= 0;
  }
740482
boolean checkUnionEquivalenceHelper(UnionType that, EquivalenceMethod eqMethod, EqCache eqCache) {
    List<JSType> thatAlternates = that.getAlternates();
    if (eqMethod == EquivalenceMethod.IDENTITY && alternates.size() != thatAlternates.size()) {
      return false;
    }
    for (int i = 0; i < thatAlternates.size(); i++) {
      JSType thatAlternate = thatAlternates.get(i);
      if (!hasAlternate(thatAlternate, eqMethod, eqCache)) {
        return false;
      }
    }
    return true;
  }
1238186
def isMemberOf(self, schemas):
        
        if type(schemas) not in (tuple, list, set):
            schemas = (schemas,)

        for schema in schemas:
            if schema.hasColumn(self):
                return True
        return False
648878
function equalType (a, b) {
  if (Array.isArray(a) && Array.isArray(b)) {
    if (0 === a.length || 0 === b.length) {
      return true;
    }

    return equalType(a[0], b[0]);
  }

  if ('null' == a || 'null' == b) {
    return true;
  }

  return a == b;
}
574095
final boolean checkStructuralEquivalenceHelper(
      ObjectType otherObject, EquivalenceMethod eqMethod, EqCache eqCache) {
    if (this.isTemplatizedType() && this.toMaybeTemplatizedType().wrapsSameRawType(otherObject)) {
      return this.getTemplateTypeMap().checkEquivalenceHelper(
          otherObject.getTemplateTypeMap(), eqMethod, eqCache, SubtypingMode.NORMAL);
    }

    MatchStatus result = eqCache.checkCache(this, otherObject);
    if (result != null) {
      return result.subtypeValue();
    }
    Set<String> keySet = getPropertyNames();
    Set<String> otherKeySet = otherObject.getPropertyNames();
    if (!otherKeySet.equals(keySet)) {
      eqCache.updateCache(this, otherObject, MatchStatus.NOT_MATCH);
      return false;
    }
    for (String key : keySet) {
      if (!otherObject.getPropertyType(key).checkEquivalenceHelper(
              getPropertyType(key), eqMethod, eqCache)) {
        eqCache.updateCache(this, otherObject, MatchStatus.NOT_MATCH);
        return false;
      }
    }
    eqCache.updateCache(this, otherObject, MatchStatus.MATCH);
    return true;
  }
406786
function memberEqual(source, target) {
  if(typeof source === 'string'
    && typeof target === 'string') {
    return source === target;
  }else if(Buffer.isBuffer(source) && Buffer.isBuffer(target)) {
    return bufferEqual(source, target);
  }

  return false;
}
233705
@GwtIncompatible("incompatible method")
    private static boolean arrayMemberEquals(final Class<?> componentType, final Object o1, final Object o2) {
        if (componentType.isAnnotation()) {
            return annotationArrayMemberEquals((Annotation[]) o1, (Annotation[]) o2);
        }
        if (componentType.equals(Byte.TYPE)) {
            return Arrays.equals((byte[]) o1, (byte[]) o2);
        }
        if (componentType.equals(Short.TYPE)) {
            return Arrays.equals((short[]) o1, (short[]) o2);
        }
        if (componentType.equals(Integer.TYPE)) {
            return Arrays.equals((int[]) o1, (int[]) o2);
        }
        if (componentType.equals(Character.TYPE)) {
            return Arrays.equals((char[]) o1, (char[]) o2);
        }
        if (componentType.equals(Long.TYPE)) {
            return Arrays.equals((long[]) o1, (long[]) o2);
        }
        if (componentType.equals(Float.TYPE)) {
            return Arrays.equals((float[]) o1, (float[]) o2);
        }
        if (componentType.equals(Double.TYPE)) {
            return Arrays.equals((double[]) o1, (double[]) o2);
        }
        if (componentType.equals(Boolean.TYPE)) {
            return Arrays.equals((boolean[]) o1, (boolean[]) o2);
        }
        return Arrays.equals((Object[]) o1, (Object[]) o2);
    }
386882
public static boolean areEqual(Object a, Object b) {

        if (a == b) {
            return true;
        }

        if (a == null || b == null) {
            return false;
        }

        // TODO refactor the instance-ofs below

        if (a instanceof Number && b instanceof Number) {

            double delta = ((Number) a).doubleValue() - ((Number) b).doubleValue();

            // To account for floating point rounding errors, return true if
            // the difference between double a and double b is very small.
            return Math.abs(delta) < 0.00000000001;
        }

        if (AtomNode.isEmpty(a) && (b instanceof CharSequence)) {
            return ((CharSequence)b).length() == 0;
        }

        if (AtomNode.isEmpty(b) && (a instanceof CharSequence)) {
            return ((CharSequence)a).length() == 0;
        }

        if (AtomNode.isEmpty(a) && (b instanceof Collection)) {
            return ((Collection)b).size() == 0;
        }

        if (AtomNode.isEmpty(b) && (a instanceof Collection)) {
            return ((Collection)a).size() == 0;
        }

        if (AtomNode.isEmpty(a) && (b.getClass().isArray())) {
            return ((Object[])b).length == 0;
        }

        if (AtomNode.isEmpty(b) && (a.getClass().isArray())) {
            return ((Object[])a).length == 0;
        }

        return a.equals(b);
    }
1276102
private void assignPreliminaryTypes(IAtomContainer container, String[] symbs) {
        // shallow copy
        IAtomContainer cpy = container.getBuilder().newInstance(IAtomContainer.class, container);
        Cycles.markRingAtomsAndBonds(cpy);
        for (AtomTypePattern matcher : patterns) {
            for (final int idx : matcher.matches(cpy)) {
                if (symbs[idx] == null) {
                    symbs[idx] = matcher.symb;
                }
            }
        }
    }
697045
boolean isTask(int sequence) {
        int index = toIndex(sequence);
        checkSequence(index, sequence);
        return isTask[index];
    }
85096
protected boolean equalElements(KTypeArrayDeque<?> other) {
    int max = size();
    if (other.size() != max) {
      return false;
    }

    Iterator<KTypeCursor<KType>> i1 = this.iterator();
    Iterator<? extends KTypeCursor<?>> i2 = other.iterator();

    while (i1.hasNext() && i2.hasNext()) {
      if (!Intrinsics.equals(this, i1.next().value, i2.next().value)) {
        return false;
      }
    }

    return !i1.hasNext() && 
           !i2.hasNext();
  }
1152864
static boolean isJavaBaseAssignable( Class<?> lhsType, Class<?> rhsType )
    {
        /*
            Assignment to loose type, defer to bsh extensions
            Note: we could shortcut this here:
            if ( lhsType == null ) return true;
            rather than forcing another round.  It's not strictly a Java issue,
            so does it belong here?
        */
        if ( lhsType == null )
            return false;

        // null rhs type corresponds to type of Primitive.NULL assignable to any
        // object type but we give preference here to string types
        if ( rhsType == null )
            return lhsType == String.class;

        if ( lhsType.isPrimitive() && rhsType.isPrimitive() ) {
            if ( lhsType == rhsType )
                return true;

            // handle primitive widening conversions - JLS 5.1.2
            if ( NUMBER_ORDER.containsKey(rhsType)
                    && NUMBER_ORDER.containsKey(lhsType) )
                return NUMBER_ORDER.get(rhsType) < NUMBER_ORDER.get(lhsType);
        }
        else if ( lhsType.isAssignableFrom(rhsType) )
            return true;

        return false;
    }
2464
def equals(self, actual_seq):
    

    try:
      expected = dict([(element, None) for element in self._expected_seq])
      actual = dict([(element, None) for element in actual_seq])
    except TypeError:
      # Fall back to slower list-compare if any of the objects are unhashable.
      expected = list(self._expected_seq)
      actual = list(actual_seq)
      expected.sort()
      actual.sort()
    return expected == actual
1000802
private void doSimpleMatching() {
        for (int i = 0; i < equalElements.size(); i++) {
            if (!alreadyMatched.get(i)) {
                List<Integer> equalTo = equalElements.get(i);
                if (equalTo.size() > 0) {
                    List<Integer> equivalentElements = getEquivalentElements(equalTo);

                    // We have the same set matching as is equivalent, we can remove them all
                    if (equalTo.size() == equivalentElements.size()) {
                        for (int j = 0; j < equivalentElements.size(); j++) {
                            recordMatch(equivalentElements.get(j), equalTo.get(j));
                        }
                    } else if (equivalentElements.size() > 1 && equalTo.size() > 1) {
                        List<Integer> equalToUsedOnlyInEquivalentElements = getEqualToUsedOnlyInEquivalentElements(equalTo, equivalentElements);
                        for (int j = 0; j < min(equivalentElements.size(), equalToUsedOnlyInEquivalentElements.size()); j++) {
                            recordMatch(equivalentElements.get(j), equalTo.get(j));
                        }
                    }
                }
            }
        }
    }
144250
private void checkReferenceEquality(Node n, String typeName, String fileName) {
    if (n.getToken() == Token.SHEQ
        || n.getToken() == Token.EQ
        || n.getToken() == Token.SHNE
        || n.getToken() == Token.NE) {
      JSType firstJsType = n.getFirstChild().getJSType();
      JSType lastJsType = n.getLastChild().getJSType();
      boolean hasType = isType(firstJsType, fileName) || isType(lastJsType, fileName);
      boolean hasNullType = isNullType(firstJsType) || isNullType(lastJsType);
      if (hasType && !hasNullType) {
        compiler.report(JSError.make(n, J2CL_REFERENCE_EQUALITY, typeName));
      }
    }
  }
164480
public function Equals( $obj )
	{
		/**
		 * @var SequenceType $dest
		 */
		$dest = $obj;
		if ( ! is_null( $obj ) )
		{
			return $this->TypeCode == $dest->TypeCode &&
				$this->SchemaElement == $dest->SchemaElement &&
				$this->SchemaAttribute == $dest->SchemaAttribute &&
				$this->SchemaType == $dest->SchemaType &&
				$this->Cardinality == $dest->Cardinality;
		}
		return false;
	}