Compare with another object
164611
def equals(self, rest_object):
        

        if self._is_dirty:
            return False

        if rest_object is None:
            return False

        if not isinstance(rest_object, NURESTObject):
            raise TypeError('The object is not a NURESTObject %s' % rest_object)

        if self.rest_name != rest_object.rest_name:
            return False

        if self.id and rest_object.id:
            return self.id == rest_object.id

        if self.local_id and rest_object.local_id:
            return self.local_id == rest_object.local_id

        return False
1341607
function _comparer (a, b) {
    var result = 0;

    if (typeof a !== typeof b) {
        a = String(a);
        b = String(b);
    }

    if (!areSVZ(a, b)) {
        // eslint-disable-next-line no-self-compare
        result = a > b || a !== a ? 1 : -1;
    }

    return result;
}
73027
function compare(a, b) {
    try {
        return semver.compare(a, b);
    } catch(err) {
        if(semver.valid(a)) {
            return 1
        }
        if(semver.valid(b)) {
            return -1;
        }
        return 0;
    }
}
451334
function objectEach(obj, fn, thisObj) {
  var keys = Object.keys(obj).sort(function (a,b) {
    a = a.toLowerCase()
    b = b.toLowerCase()
    return a === b ? 0 : a < b ? -1 : 1
  })
  for (var i = 0, l = keys.length; i < l; i++) {
    var key = keys[i]
    fn.call(thisObj, obj[key], key, obj)
  }
}
239028
@Override
    public boolean compare(Object object) {
        if (!(object instanceof IAtom)) {
            return false;
        }
        if (!super.compare(object)) {
            return false;
        }
        Atom atom = (Atom) object;
        // XXX: floating point comparision!
        if (((point2d == atom.point2d) || ((point2d != null) && (point2d.equals(atom.point2d))))
            && ((point3d == atom.point3d) || ((point3d != null) && (point3d.equals(atom.point3d))))
            && (Objects.equals(hydrogenCount, atom.hydrogenCount)) && (Objects.equals(stereoParity, atom.stereoParity))
            && (Objects.equals(charge, atom.charge))) {
            return true;
        }
        return false;
    }
180103
@Override
  public int compare(String s1, String s2) {
    if (s1 == s2) { // NOSONAR false-positive: Compare Objects With Equals
      return 0;
    }
    int h1 = s1.hashCode();
    int h2 = s2.hashCode();
    if (h1 < h2) {
      return -1;
    } else if (h1 > h2) {
      return 1;
    } else {
      return s1.compareTo(s2);
    }
  }
382927
private int compare(Object key1, Object key2) {
        if (comparator == null)
            return ((Comparable) key1).compareTo(key2);
        else
            return comparator.compare(key1, key2);
    }
421746
@Override
  public int compareTo(Object other) {
    if (other == null) {
      return -1;
    }
    JobKey otherKey = (JobKey)other;
    return new CompareToBuilder().appendSuper(super.compareTo(otherKey))
        .append(this.jobId, otherKey.getJobId())
        .toComparison();
  }
1175776
private static final boolean match(Object obj1, Object obj2) {
        return obj1 == obj2 || (obj1 != null && obj1.equals(obj2));
    }
391975
public function compare($another)
    {
        if ($another instanceof Collection) {
            $another = $another->toArray();
        }

        $me = $this->toArray();

        if ($me == $another) {
            return 0;
        } else {
            return 1;
        }
    }
848897
public static boolean equal(Object obj1, Object obj2) {
//		return (obj1 != null) ? (obj1.equals(obj2)) : (obj2 == null);
		return (obj1 == obj2) || (obj1 != null && obj1.equals(obj2));
	}
1211700
@Override
    public int compare(Object o1, Object o2) {
        return (o1.hashCode() - o2.hashCode());
    }
837284
def check_obj(keys, name, obj):
    """"""
    msg = validate_obj(keys, obj)

    if msg:
        raise aomi.exceptions.AomiData("object check : %s in %s" % (msg, name))
124252
function equals( a, b ) {
   const aKeys = Object.keys( a );
   const bKeys = Object.keys( b );
   return aKeys.length === bKeys.length && aKeys.every( key => key in b && a[ key ] === b[ key ] );
}
38885
public boolean compare(Object object) {
        if (!(object instanceof IChemObject)) {
            return false;
        }
        ChemObject chemObj = (ChemObject) object;
        return Objects.equal(identifier, chemObj.identifier);
    }
350919
function CompareTo( $obj )
	{
		if ( ! $obj instanceof TimeValue )
			throw new ArgumentException("$obj");

		/**
		 * @var TimeValue $other
		 */
		$other = $obj;
		return $this->Value == $other->Value
			? 0
			: ( $this->Value > $other->Value ? 1 : -1 );
	}
1261394
function checkObject (obj) {
  if (util.isArray(obj)) {
    obj.forEach(function (o) {
      checkObject(o);
    });
  }

  if (typeof obj === 'object' && obj !== null) {
    Object.keys(obj).forEach(function (k) {
      checkKey(k, obj[k]);
      checkObject(obj[k]);
    });
  }
}