return unified reference.

@param hash   the hash
@param object the object
@return the object
196653
public static Object unifyReferences(final Hashtable hash, Object object) {
		final Object itemAtHash = hash.get(object.hashCode());
		if (itemAtHash == null) {
			hash.put(object.hashCode(), object);
		} else {
			object = itemAtHash;
		}
		return object;
	}
847421
@SuppressWarnings("unchecked")
	public static <V> Map<String,V> toUnderscoreHash(Map<String,V> hash) {
		if (hash == null) return null;
		
		Map<String,V> newHash = new HashMap<String,V>();
		
		for (Map.Entry<String, V> entry : hash.entrySet())
		{
			V value = entry.getValue();
			
			// Apply toUnderscoreHash recursively on sub-hashes
			if (value instanceof Map) {
				value = (V) toUnderscoreHash((Map<String,Object>) value);
			}
			newHash.put(MnoStringHelper.toSnakeCase(entry.getKey()), value);
			
		}
		
		return newHash;
	}
53412
function circularClone(obj, hash) {
    if (!hash) hash = new WeakMap();
    // Do not try to clone primitives or functions
    if (Object(obj) !== obj || obj instanceof Function) return obj;
    if (hash.has(obj)) return hash.get(obj); // Cyclic reference
    try { // Try to run constructor (without arguments, as we don't know them)
        var result = new obj.constructor();
    } catch(e) { // Constructor failed, create object without running the constructor
        result = Object.create(Object.getPrototypeOf(obj));
    }
    // Optional: support for some standard constructors (extend as desired)
    /*if (obj instanceof Map)
        Array.from(obj, ([key, val]) => result.set(circularClone(key, hash),
                                                   circularClone(val, hash)) );
    else if (obj instanceof Set)
        Array.from(obj, (key) => result.add(circularClone(key, hash)) );
    */
    // Register in hash
    hash.set(obj, result);
    // Clone and assign enumerable own properties recursively
    return Object.assign(result, ...Object.keys(obj).map (
        key => ({ [key]: circularClone(obj[key], hash) }) ));
}
1066086
@Pure
	@Override
	@SuppressWarnings({"unchecked", "checkstyle:npathcomplexity"})
	public int compareTo(Object obj) {
		final Object oth = (obj instanceof Reference) ? ((Reference<?>) obj).get() : obj;
		final T cur = get();

		if (oth == null && cur == null) {
			return 0;
		}
		if (cur == null) {
			return 1;
		}
		if (oth == null) {
			return -1;
		}

		if (cur instanceof Comparable) {
			try {
				return ((Comparable<Object>) cur).compareTo(oth);
			} catch (AssertionError e) {
				throw e;
			} catch (Throwable exception) {
				//
			}
		}

		if (oth instanceof Comparable) {
			try {
				return -((Comparable<Object>) oth).compareTo(cur);
			} catch (AssertionError e) {
				throw e;
			} catch (Throwable exception) {
				//
			}
		}

		return oth.hashCode() - cur.hashCode();
	}
686874
@Override
    public long opHash() {
        if (hash == 0) {
            val map = Nd4j.getExecutioner().getCustomOperations();
            val desc = map.get(opName());
            if (desc == null) {
                throw new ND4JIllegalStateException("Op name " + opName() + " is missing!");
            }

            hash = desc.getHash();
        }

        return hash;
    }
1243696
def GetHashObject(self):
    """"""
    hash_object = rdf_crypto.Hash()
    hash_object.num_bytes = self._bytes_read
    for algorithm in self._hashers:
      setattr(hash_object, algorithm, self._hashers[algorithm].digest())
    return hash_object
314711
function getInfo(hash) {
  const info = getHashInfo(hash);
  const algo = getAlgorithmFromId(info.id);
  info.algorithm = algo.name;
  info.options = algo.getOptions(hash, info);

  return info;
}
204164
@Override
	public int hash(Record object) {
		int i = 0;
		try {
			int code = 0;
			for (; i < this.keyFields.length; i++) {
				code ^= object.getField(this.keyFields[i], this.transientKeyHolders[i]).hashCode();
				code *= HASH_SALT[i & 0x1F]; // salt code with (i % HASH_SALT.length)-th salt component
			}
			return code;
		}
		catch (NullPointerException npex) {
			throw new NullKeyFieldException(this.keyFields[i]);
		}
		catch (IndexOutOfBoundsException iobex) {
			throw new KeyFieldOutOfBoundsException(this.keyFields[i]);
		}
	}
375978
public <T> T copy (T object) {
		if (object == null) return null;
		if (copyShallow) return object;
		copyDepth++;
		try {
			if (originalToCopy == null) originalToCopy = new IdentityMap();
			Object existingCopy = originalToCopy.get(object);
			if (existingCopy != null) return (T)existingCopy;

			if (copyReferences) needsCopyReference = object;
			Object copy;
			if (object instanceof KryoCopyable)
				copy = ((KryoCopyable)object).copy(this);
			else
				copy = getSerializer(object.getClass()).copy(this, object);
			if (needsCopyReference != null) reference(copy);
			if (TRACE || (DEBUG && copyDepth == 1)) log("Copy", copy, -1);
			return (T)copy;
		} finally {
			if (--copyDepth == 0) reset();
		}
	}
1277234
HashCode hashObjWithSalt(T object, int moreSalt) {
		Hasher hashInst = hasher.newHasher();
		hashInst.putObject(object, funnel);
		hashInst.putLong(seedNSalt);
		hashInst.putInt(moreSalt);
		return hashInst.hash();
	}
824904
def parse_object_ref(ref)
      prefix = ref[1]
      ref = ref[0]
      # Let's make sure the value isn't nil. If it is, return the default Hash.
      return {} if ref.nil?
      class_name =
        if ref.respond_to?(:haml_object_ref)
          ref.haml_object_ref
        else
          underscore(ref.class)
        end
      ref_id =
        if ref.respond_to?(:to_key)
          key = ref.to_key
          key.join('_') unless key.nil?
        else
          ref.id
        end
      id = "#{class_name}_#{ref_id || 'new'}"
      if prefix
        class_name = "#{ prefix }_#{ class_name}"
        id = "#{ prefix }_#{ id }"
      end

      { 'id'.freeze => id, 'class'.freeze => class_name }
    end
932579
private V get(K key, int hash) {
    if (hash == this.hash && key.equals(this.key)) {
      return this.value;
    }
    int bucket = bucket(hash);
    int bucketMask = 1 << bucket;
    return (mask & bucketMask) != 0 ? children[index(bucketMask)].get(key, shift(hash)) : null;
  }
918000
public static Reflect on(Object object) {
        return new Reflect(object == null ? Object.class : object.getClass(), object);
    }
1020721
function hashObject (obj) {
  if (!isObject(obj)) return null;
  return shortHash(JSON.stringify(sortKeys(obj, { deep: true })));
}
351899
function getOrderIndependentHash(object) {
    var accum = 0;
    var type = realTypeOf(object);

    if (type === 'array') {
      object.forEach(function (item) {
        // Addition is commutative so this is order indep
        accum += getOrderIndependentHash(item);
      });

      var arrayString = '[type: array, hash: ' + accum + ']';
      return accum + hashThisString(arrayString);
    }

    if (type === 'object') {
      for (var key in object) {
        if (object.hasOwnProperty(key)) {
          var keyValueString = '[ type: object, key: ' + key + ', value hash: ' + getOrderIndependentHash(object[key]) + ']';
          accum += hashThisString(keyValueString);
        }
      }

      return accum;
    }

    // Non object, non array...should be good?
    var stringToHash = '[ type: ' + type + ' ; value: ' + object + ']';
    return accum + hashThisString(stringToHash);
  }
164038
public static int hash(int aSeed, Object aObject)
   {
      int result = aSeed;
      if (aObject == null)
      {
         result = org.jboss.ws.common.utils.HashCodeUtil.hash(result, 0);
      }
      else if (!org.jboss.ws.common.utils.HashCodeUtil.isArray(aObject))
      {
         result = org.jboss.ws.common.utils.HashCodeUtil.hash(result, aObject.hashCode());
      }
      else
      {
         int length = Array.getLength(aObject);
         for (int idx = 0; idx < length; ++idx)
         {
            Object item = Array.get(aObject, idx);
            //recursive call!
            result = org.jboss.ws.common.utils.HashCodeUtil.hash(result, item);
         }
      }
      return result;
   }
1357122
function hash() {
	var i = 0,
		args = arguments,
		length = args.length,
		obj = {};
	for (; i < length; i++) {
		obj[args[i++]] = args[i];
	}
	return obj;
}