Converts k/v data into ruby hash
968855
def convert_to_hash(data)
      data.map do |item|
        item[:key].split('/').reverse.reduce(item[:value]) { |h, v| { v => h } }
      end.reduce(:deep_merge)
    end
1129591
def to_hash(obj=nil, methods:[], recursive: false, check: false, compact: false)
			return {} if obj.nil?
			obj||=self
			stack=[*obj]
			processed=[]
			klass=stack.first.class
			h={}
			while !stack.empty?
				obj=stack.shift
				next if processed.include?(obj)
				processed << obj
				attributes={}
				methods.each do |m|
					next if check and !obj.respond_to? m
					v=obj.public_send(m)
					attributes[m]=v
					if recursive
						vals=v.kind_of?(Enumerable) ? v.to_a.flatten : [v]
						vals.select! {|v| v.kind_of?(klass)}
						stack.concat(vals)
					end
				end
				attributes=attributes.values.first if compact and attributes.keys.length == 1
				h[obj]=attributes
			end
			h
		end
592302
def to_hash
      load

      {}.tap do |hash|
        @_definition.each do |k, v|
          hash[k] = v
        end
      end
    end
1170299
def to_h
      Hash[
        attribute_names.
        map do |name| [
          name.to_s.gsub("@","").to_sym,  # key
          (instance_variable_get(name) rescue send(name))] # val
        end
      ]
    end
664583
def to_hash
      result = {}

      @values.keys.each do |field_name|
        value = __send__(field_name)
        hashed_value = value.respond_to?(:to_hash_value) ? value.to_hash_value : value
        result.merge!(field_name => hashed_value)
      end

      result
    end
1272374
def dict_hash(dct):
    """"""
    dct_s = json.dumps(dct, sort_keys=True)

    try:
        m = md5(dct_s)
    except TypeError:
        m = md5(dct_s.encode())

    return m.hexdigest()
79156
def to_hash
      {
        :installer => installer,
        :installer_arguments => installer_arguments,
        :iso_path => iso_path,
        :iso_upload_path => iso_upload_path,
        :iso_mount_point => iso_mount_point,
        :auto_update => auto_update,
        :auto_reboot => auto_reboot,
        :no_install => no_install,
        :no_remote => no_remote,
        :yes => yes
      }
    end
684391
def convert(data)
      data.each do |k, v|
        k = KEYS[k] if KEYS.include?(k)
        v = v.to_s if k.eql? 'zip'

        if NIDT.include?(k)
          instance_variable_set('@nidt', k)
          k = 'nidn'
          v = v.to_s
        end

        var_set(k, v)
      end
    end
551100
def []=(k, v)  # :nodoc:
      unless v.is_a?(Sycl::Hash) || v.is_a?(Sycl::Array)
        v = Sycl::from_object(v)
      end
      super
    end
428685
def to_hash
      ret = {}
      @hash.dup.each_pair do |key, val|
        ret[key] = self.convert_value_from_ostruct(val)
      end
      ret
    end
231312
function argHashToArray(hash)
{
	var keys = Object.keys(hash);
	var result = [];
	for (var i = 0; i < keys.length; i++)
	{
		result[parseInt(keys[i], 10)] = hash[keys[i]];
	}
	return result;
}
704078
def hash_data(data, blocksize=65536):
    "
    data = pickle.dumps(data)

    hasher = hashlib.sha1()
    hasher.update(data)

    return hasher.hexdigest()
475293
def to_hash
      data = {}
      data[:start_time] = TimeUtil.serialize_time(start_time)
      data[:start_date] = data[:start_time] if IceCube.compatibility <= 11
      data[:end_time] = TimeUtil.serialize_time(end_time) if end_time
      data[:rrules] = recurrence_rules.map(&:to_hash)
      if IceCube.compatibility <= 11 && exception_rules.any?
        data[:exrules] = exception_rules.map(&:to_hash)
      end
      data[:rtimes] = recurrence_times.map do |rt|
        TimeUtil.serialize_time(rt)
      end
      data[:extimes] = exception_times.map do |et|
        TimeUtil.serialize_time(et)
      end
      data
    end
1050364
def hash_vector(self, v, querying=False):
        

        bucket_keys = []

        if querying:
            # If we are querying, use the bucket key map
            for lshash in self.child_hashes:
                # Get regular bucket keys from hash
                for bucket_key in lshash.hash_vector(v, querying):
                    prefixed_key = lshash.hash_name+'_'+bucket_key
                    # Get entries from map (bucket keys with hamming distance of 1)
                    if prefixed_key in self.bucket_key_map:
                        bucket_keys.extend(self.bucket_key_map[prefixed_key].keys())
        else:
            # If we are indexing (storing) just use child hashes without permuted index
            for lshash in self.child_hashes:
                # Get regular bucket keys from hash
                for bucket_key in lshash.hash_vector(v, querying):
                    # Get permuted keys
                    perm_keys = self.permuted_keys(bucket_key)
                    # Put extact hit key into list
                    perm_keys.append(bucket_key)

                    # Append key for storage (not the permutations)
                    bucket_keys.append(lshash.hash_name+'_'+bucket_key)

                    # For every permutation register all the variants
                    for perm_key in perm_keys:
                        prefixed_key = lshash.hash_name+'_'+perm_key

                        # Make sure dictionary exists
                        if not prefixed_key in self.bucket_key_map:
                            self.bucket_key_map[prefixed_key] = {}

                        for variant in perm_keys:
                            prefixed_variant = lshash.hash_name+'_'+variant
                            self.bucket_key_map[prefixed_key][prefixed_variant] = 1

        # Return all the bucket keys
        return bucket_keys
1213887
def to_hash
            index_hash = Hash.new
            index_hash["json_claz"] = self.class.name
            index_hash["id"] = id
            index_hash["account_id"] = account_id
            index_hash["asm_id"] = asm_id
            index_hash["org_id"] = org_id
            index_hash["tosca_type"] = tosca_type
            index_hash["inputs"] = inputs
            index_hash["outputs"] = outputs
            index_hash["name"] = name
            index_hash["status"] = status
            index_hash["disk_id"] = disk_id
            index_hash["snap_id"] = snap_id
            index_hash["created_at"] = created_at
            index_hash["updated_at"] = updated_at
            index_hash["some_msg"] = some_msg
            index_hash
        end
258707
def murmur2(key):
    

    # Convert key to bytes or bytearray
    if isinstance(key, bytearray) or (six.PY3 and isinstance(key, bytes)):
        data = key
    else:
        data = bytearray(str(key).encode())

    length = len(data)
    seed = 0x9747b28c
    # 'm' and 'r' are mixing constants generated offline.
    # They're not really 'magic', they just happen to work well.
    m = 0x5bd1e995
    r = 24

    # Initialize the hash to a random value
    h = seed ^ length
    length4 = length // 4

    for i in range(length4):
        i4 = i * 4
        k = ((data[i4 + 0] & 0xff) +
             ((data[i4 + 1] & 0xff) << 8) +
             ((data[i4 + 2] & 0xff) << 16) +
             ((data[i4 + 3] & 0xff) << 24))
        k &= 0xffffffff
        k *= m
        k &= 0xffffffff
        k ^= (k % 0x100000000) >> r  # k ^= k >>> r
        k &= 0xffffffff
        k *= m
        k &= 0xffffffff

        h *= m
        h &= 0xffffffff
        h ^= k
        h &= 0xffffffff

    # Handle the last few bytes of the input array
    extra_bytes = length % 4
    if extra_bytes >= 3:
        h ^= (data[(length & ~3) + 2] & 0xff) << 16
        h &= 0xffffffff
    if extra_bytes >= 2:
        h ^= (data[(length & ~3) + 1] & 0xff) << 8
        h &= 0xffffffff
    if extra_bytes >= 1:
        h ^= (data[length & ~3] & 0xff)
        h &= 0xffffffff
        h *= m
        h &= 0xffffffff

    h ^= (h % 0x100000000) >> 13  # h >>> 13;
    h &= 0xffffffff
    h *= m
    h &= 0xffffffff
    h ^= (h % 0x100000000) >> 15  # h >>> 15;
    h &= 0xffffffff

    return h
1190274
def to_hash
      ret = {}
      self.each_pair do |k, v|
        ret[k] = v.to_hash()
      end
      ret
    end