Hash an item (CIM value, CIM object), by delegating to its hash function.

    The item may be `None`.
168020
def _hash_item(item):
    
    if isinstance(item, list):
        item = tuple(item)
    return hash(item)
688459
def remove(self, value):
        
        # Raise TypeError if value is not hashable
        hash(value)

        result = self.redis.srem(self.key, self._pickle(value))
        if not result:
            raise KeyError(value)
193181
def digestable_hash
      @item.slice(CLASS_KEY, QUEUE_KEY, UNIQUE_ARGS_KEY).tap do |hash|
        hash.delete(QUEUE_KEY) if unique_across_queues?
        hash.delete(CLASS_KEY) if unique_across_workers?
      end
    end
60230
def _hashes(self, item):
        
        item = self._binary(item)

        m = hashlib.sha1()
        m.update(item)
        digits = m.hexdigest()

        # Add another 160 bits for every 8 (20-bit long) hashes we need
        for i in range(int(self.num_hashes // 8)):
            m.update(self._binary(str(i)))
            digits += m.hexdigest()

        hashes = [int(digits[i*5:i*5+5], 16) % self.hashbits for i in range(self.num_hashes)]
        return hashes
522914
def add_hashed_value(self, hash_value, store_key):
        
        if self._unique and hash_value in self._index:
            raise NonUnique('Hash value {} already in index'.format(hash_value))
        if store_key not in self._index[hash_value]:
            self._index[hash_value].append(store_key)
        if hash_value not in self._reverse_index[store_key]:
            self._reverse_index[store_key].append(hash_value)
1342633
def set(self, item_name, item_value):
		
		if self.prefix:
			item_name = self.prefix + self.seperator + item_name
		item_names = item_name.split(self.seperator)
		item_last = item_names.pop()
		node = self._storage
		for item_name in item_names:
			if not item_name in node:
				node[item_name] = {}
			node = node[item_name]
		node[item_last] = item_value
		return
814683
def to_hash
      @relations.each_with_object({}) do |(rel,val), obj|
        rel = rel.to_s

        hashed_val = val.map(&:to_hash)
        if val.length == 1 && !single_item_arrays?
          hashed_val = val.first.to_hash
        end

        obj[rel] = hashed_val
      end
    end
1170958
def to_hash
      characteristics.inject({}) do |memo, (k, v)|
        memo[k] = v.value
        memo
      end
    end
253975
def _cim_method(key, value):
    

    if key is None:
        raise ValueError("Method name must not be None")

    try:
        assert isinstance(value, CIMMethod)
    except AssertionError:
        raise TypeError(
            _format("Method must be a CIMMethod object, but is: {0}",
                    type(value)))

    if value.name.lower() != key.lower():
        raise ValueError(
            _format("CIMMethod.name must be dictionary key {0!A}, but is ",
                    "{1!A}", key, value.name))

    return value
841700
def _hash(self, obj, parent, parents_ids=EMPTY_FROZENSET):
        """"""

        try:
            result = self[obj]
        except (TypeError, KeyError):
            pass
        else:
            return result

        result = not_hashed

        if self._skip_this(obj, parent):
            return

        elif obj is None:
            result = 'NONE'

        elif isinstance(obj, strings):
            result = prepare_string_for_hashing(
                obj, ignore_string_type_changes=self.ignore_string_type_changes,
                ignore_string_case=self.ignore_string_case)

        elif isinstance(obj, numbers):
            result = self._prep_number(obj)

        elif isinstance(obj, MutableMapping):
            result = self._prep_dict(obj=obj, parent=parent, parents_ids=parents_ids)

        elif isinstance(obj, tuple):
            result = self._prep_tuple(obj=obj, parent=parent, parents_ids=parents_ids)

        elif isinstance(obj, Iterable):
            result = self._prep_iterable(obj=obj, parent=parent, parents_ids=parents_ids)

        else:
            result = self._prep_obj(obj=obj, parent=parent, parents_ids=parents_ids)

        if result is not_hashed:  # pragma: no cover
            self[UNPROCESSED].append(obj)

        elif result is unprocessed:
            pass

        elif self.apply_hash:
            if isinstance(obj, strings):
                result_cleaned = result
            else:
                result_cleaned = prepare_string_for_hashing(
                    result, ignore_string_type_changes=self.ignore_string_type_changes,
                    ignore_string_case=self.ignore_string_case)
            result = self.hasher(result_cleaned)

        # It is important to keep the hash of all objects.
        # The hashes will be later used for comparing the objects.
        try:
            self[obj] = result
        except TypeError:
            obj_id = get_id(obj)
            self[obj_id] = result

        return result
604719
def hash(self, *args, **kwargs):
        
        joiner = kwargs.get('joiner', '').encode('utf-8')
        as_bytes = kwargs.get('as_bytes', False)

        def conv(arg):
            if isinstance(arg, integer_types):
                arg = int_to_bytes(arg)

            if PY3:
                if isinstance(arg, str):
                    arg = arg.encode('utf-8')
                return arg

            return str(arg)

        digest = joiner.join(map(conv, args))

        hash_obj = self._hash_func(digest)

        if as_bytes:
            return hash_obj.digest()

        return int_from_hex(hash_obj.hexdigest())
804443
def _build_list_item(self, item_value, id_=None):
        
        return {
            '$type': self._type_map[self.input_type]['list_item_type'],
            'id': id_ or SID.generate(),
            'value': item_value
        }
1087626
def get_item(cls, hash_key, range_key=None):
        
        key = cls._encode_key(hash_key, range_key)
        raw_data = cls._get_connection().get_item(cls.get_table_name(), key)
        if 'Item' not in raw_data:
            raise ItemNotFoundException
        return cls.from_raw_data(raw_data['Item'])
33522
def put(self, item):
        
        check_not_none(item, "Value can't be None")
        element_data = self._to_data(item)
        return self._encode_invoke(queue_put_codec, value=element_data)
1039541
def _hash(self, iv, value):
        
        return hmac.new(self.key, msg=iv+value, digestmod=hashlib.sha256).hexdigest()
1119671
def convert_map_to_hash(object, &block)
      hash = Hash.new
      i = object.entrySet.iterator
      if block_given?
        while i.hasNext
          entry = i.next
          yield hash, entry.getKey, entry.getValue
        end
      else
        while i.hasNext
          entry = i.next
          hash[entry.getKey] = entry.getValue
        end
      end
      hash
    end
480919
function h_reduce(memo, item) {
            if ( !memo[0] || item < memo[0]) memo[0] = item;
            if ( !memo[1] || item > memo[1]) memo[1] = item;
            return memo;
        }