do the keys in object 1 match object 2?
15220
function objectSignaturesMatch(object1, object2){

    // because typeof null is object we need to check for it here before Object.keys
    if(object1 === null && object2 === null){
      return true;
    }

    // if the objects have different lengths of keys we should fail immediatly
    if (Object.keys(object1).length !== Object.keys(object2).length) {
      return false;
    }

    // loop over all the keys in object1 (we know the objects have the same number of keys at this point)
    for(var key in object1) {

      // if the keys match keep checking if not we have a mismatch
      if(typeof object1[key] === typeof object2[key]) {

        if(typeof object1[key] === null && typeof object2[key] === null) {

        }

        // if the keys represent an object make sure that it matches.
        else if(object1[key] instanceof Array && object2[key] instanceof Array) {
          if(!arrySignaturesMatch(object1[key],object2[key])){
            return false;
          }
        }

        // if the keys represent an array make sure it matches
        else if(typeof object1[key] === "object" && typeof object2[key] === "object") {
          if(!objectSignaturesMatch(object1[key],object2[key])){
            return false;
          }
        }

      }
    }
    return true;
  }
240258
public static boolean keyMatch(String key1, String key2) {
        int i = key2.indexOf('*');
        if (i == -1) {
            return key1.equals(key2);
        }

        if (key1.length() > i) {
            return key1.substring(0, i).equals(key2.substring(0, i));
        }
        return key1.equals(key2.substring(0, i));
    }
577210
function shallowEqual(objA, objB) {
  if (objA === objB) {
    return true;
  }
  var key;
  // Test for A's keys different from B.
  for (key in objA) {
    if (objA.hasOwnProperty(key) &&
        (!objB.hasOwnProperty(key) || objA[key] !== objB[key])) {
      return false;
    }
  }
  // Test for B's keys missing from A.
  for (key in objB) {
    if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) {
      return false;
    }
  }
  return true;
}
96471
def equals object
      if table == object.table && database == object.database
        return true
      end
      return false
    end
1333853
function(o1, o2)
{
   var rval = 0;
   
   if(o1.constructor === String)
   {
      if(o2.constructor !== String)
      {
         rval = -1;
      }
      else
      {
         rval = _compare(o1, o2);
      }
   }
   else if(o2.constructor === String)
   {
      rval = 1;
   }
   else
   {
      rval = _compareObjectKeys(o1, o2, '@literal');
      if(rval === 0)
      {
         if('@literal' in o1)
         {
            rval = _compareObjectKeys(o1, o2, '@type');
            if(rval === 0)
            {
               rval = _compareObjectKeys(o1, o2, '@language');
            }
         }
         // both are '@id' objects
         else
         {
            rval = _compare(o1['@id'], o2['@id']);
         }
      }
   }
   
   return rval;
}
523673
public static boolean notEquals(final Object object1, final Object object2) {
        return object1 != null && !object1.equals(object2) || object1 == null && object2 != null;
    }
794046
function _shallowEqual(lhs, rhs) {
    var lhsKeys = Object.keys(lhs);
    var rhsKeys = Object.keys(rhs);
    if (lhsKeys.length !== rhsKeys.length) {
      return false;
    }
    for (var k in lhs) {
      if (lhs[k] !== rhs[k]) {
        return false;
      }
    }
    return true;
  }
356920
function arrySignaturesMatch(array1, array2){
    // setup variables
    var ref, test;

    // we want to use the shorter array if one is longer
    if (array1.length >= array2.length) {
      ref = array2;
      test = array1;
    } else {
      ref = array1;
      test = array2;
    }

    // loop over the shorter array and make sure the corresponding key in the longer array matches
    for(var key in ref) {
      if(typeof ref[key] === typeof test[key]) {

       // if the keys represent an object make sure that it matches
        if(typeof ref[key] === "object" && typeof test[key] === "object") {
          if(!objectSignaturesMatch(ref[key], test[key])){
            return false;
          }
        }

        // if the keys represent an array make sure that it matches
        if(typeof ref[key] === "array" && typeof test[key] === "array") {
          if(!arrySignaturesMatch(ref[key],test[key])){
            return false;
          }
        }

      }
    }
    return true;
  }
538968
function matches(id1, id2) {
        if (id1 === undefined || id1 === null || id1 === ''
            || id2 === undefined || id2 === null || id2 === '') {
            return false;
        }
        // The id can be a MongoDB ObjectID
        return id1 === id2 || id1.toString() === id2.toString();
    }
862154
private function keysAreEqual($a, $b): bool
    {
        if (is_object($a) && $a instanceof Hashable) {
            return get_class($a) === get_class($b) && $a->equals($b);
        }

        return $a === $b;
    }
511140
function isKey(value, object) {
  if (isArray_1(value)) {
    return false;
  }
  var type = typeof value;
  if (type == 'number' || type == 'symbol' || type == 'boolean' ||
      value == null || isSymbol_1(value)) {
    return true;
  }
  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
    (object != null && value in Object(object));
}
113858
function _objEquals(a, b) {
    const aKeys = Object.keys(a);

    return _arrEquals(aKeys.sort(), Object.keys(b).sort()) &&
        aKeys.every(i => _equals(a[i], b[i]));
}
141508
function merge(obj1, obj2){
    for(var key in obj2){
        obj1[key] = obj2[key]
    }

    return obj1
}
48396
def matches(self, object):
    

    try:
      self.check_match(object)
    except securesystemslib.exceptions.FormatError:
      return False
    else:
      return True
1116052
def matching_key_for(self, key):
		
		try:
			return next(e_key for e_key in self.keys() if e_key == key)
		except StopIteration:
			raise KeyError(key)
372663
private <T> boolean isKeyEquals(T t1, T t2, List<Field> fields) {
		if(t1 == null || t2 == null || fields == null) {
			 return false;
		}
		List<Field> keyFields = DOInfoReader.getKeyColumns(t1.getClass());
		if(keyFields == null || keyFields.isEmpty()) {
			return false;
		}
		for(Field keyField : keyFields) {
			Object key1 = DOInfoReader.getValue(keyField, t1);
			Object key2 = DOInfoReader.getValue(keyField, t2);
			if(key1 == null || key2 == null || !key1.equals(key2)) {
				return false;
			}
		}
		return true;
	}
251564
function _equals(a, b) {
     switch (typeof a) {
         case 'undefined':
         case 'boolean':
         case 'string':
         case 'number':
             return a === b;
         case 'object':
             if (a === null)
                 {return b === null;}
             if (_isArray(a)) {
                 if (!_isArray(b) || a.length !== b.length)
                     {return false;}

                 for (var i = 0, l = a.length; i < l; i++) {
                   if (!_equals(a[i], b[i]))
                   {return false;}
                 }

                 return true;
             }

             var bKeys = _objectKeys(b);
             var bLength = bKeys.length;
             if (_objectKeys(a).length !== bLength)
                 {return false;}

             for (var i = 0, k; i < bLength; i++) {
               k = bKeys[i];
               if (!(k in a && _equals(a[k], b[k])))
               {return false;}
             }

             return true;

         default:
             return false;
     }
 }