build the object from hash
174329
def build_from_hash(attributes)
      return nil unless attributes.is_a?(Hash)
      self.class.swagger_types.each_pair do |key, type|
        if type =~ /^Array<(.*)>/i
          if attributes[self.class.attribute_map[key]].is_a?(Array)
            self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
          else
            #TODO show warning in debug mode
          end
        elsif !attributes[self.class.attribute_map[key]].nil?
          self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
        else
          # data not found in attributes(hash), not an issue as the data can be optional
        end
      end

      self
    end
563962
def hash(self, build_context) -> str:
        """"""
        if self._hash is None:
            self.compute_hash(build_context)
        return self._hash
31477
def to_h
      hash = {}
      @data.each_pair do |key, value|
        hash[key] = value.to_h
      end
      
      hash      
    end
578937
function hash(object) {
  return crypto
    .createHash('sha256')
    .update(typeof object === 'string' ? object : JSON.stringify(object))
    .digest('base64')
}
1168899
def to_params_hash(keys,values)
      hash = {}
      keys.size.times { |i| hash[ keys[i].to_sym ] = values[i] }
      hash
    end
1020721
function hashObject (obj) {
  if (!isObject(obj)) return null;
  return shortHash(JSON.stringify(sortKeys(obj, { deep: true })));
}
1233898
def to_hash(args = {}) # :nodoc:
      args ||= {}
      hash = {}

      self.attributes.each do |name, value|
        hash[name] = if value.is_a?(::Array)
          value.map {|x| x.respond_to?(:to_hash) ? call_method_with_optional_parameters(x, :to_hash, :nested => true) : x}
        elsif value.respond_to?(:to_hash)
          call_method_with_optional_parameters(value, :to_hash, :nested => true)
        elsif value.respond_to?(:as_json)
          value.as_json(:nested => true)
        else
          value
        end
      end

      hash
    end
1170958
def to_hash
      characteristics.inject({}) do |memo, (k, v)|
        memo[k] = v.value
        memo
      end
    end
1230386
def to_hash
      hash = {}
      attributes = self.class.attribute_map.sort_by {|key,value| key}
      attributes.each { |attr, param|
        value = self.send(attr)
        next if value.nil?
        if value.is_a?(Array)
          hash[param] = value.compact.map{ |v| _to_hash(v) }
        else
          hash[param] = _to_hash(value)
        end
      }
      hash
    end
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
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
719731
def to_hash
      index_hash = Hash.new
      index_hash["json_claz"] = self.class.name
      index_hash["id"] = id
      index_hash["code"] = code
      index_hash["amount"] = amount
      index_hash["created_at"] = created_at
      index_hash
    end
426990
def to_hash(object, use_alias = false)
      return object.map { |i| to_hash(i, use_alias) } if object.is_a?(Array)

      validate_class_kit(object.class)

      hash = {}

      attributes = @attribute_helper.get_attributes(object.class)
      attributes.each do |attribute|
        key = use_alias ? (attribute[:alias] || attribute[:name]) : attribute[:name]
        type = attribute[:type]
        value = object.public_send(attribute[:name])
        if value != nil
          hash[key] = if is_class_kit?(type)
                        to_hash(value, use_alias)
                      elsif type == Array
                        value.map do |i|
                          if is_class_kit?(i.class)
                            to_hash(i, use_alias)
                          else
                            i
                          end
                        end
                      else
                        value
                      end
        end
      end
      @hash_helper.indifferent!(hash)
      hash
    end
97536
def to_h
      copied_object.each_with_object({}) do |pair, memo|
        value = pair.last
        if value.is_a?(Footing::Hash)
          memo[pair.first] = value.to_h
        elsif value.is_a?(::Array)
          memo[pair.first] = value.map do |val|
            if val.is_a?(Footing::Hash)
              val.to_h
            else
              val
            end
          end
        else
          memo[pair.first] = value
        end
      end
    end
526514
def to_hash(options = {})
      out = {}
      each_key do |k|
        assignment_key =
          if options[:stringify_keys]
            k.to_s
          elsif options[:symbolize_keys]
            k.to_s.to_sym
          else
            k
          end
        if self[k].is_a?(Array)
          out[assignment_key] ||= []
          self[k].each do |array_object|
            out[assignment_key] << maybe_convert_to_hash(array_object, options)
          end
        else
          out[assignment_key] = maybe_convert_to_hash(self[k], options)
        end
      end
      out
    end
1333684
def deserialize_object(definition, hash)
      return nil if hash.nil?
      result = definition.new
      result.__fields.each do |field|
        name = field.key_json || name_to_json(field.sym)

        if field.options[:as] == :list
          value = deserialize_list(hash[name], field)
        elsif field.options[:as] == :dto
          value = deserialize_object(field.options[:of], hash[name])
        else
          value = hash[name]
        end

        next if value.nil?

        result.send("#{field.key_ruby}=", value)
      end
      result
    end
1185670
function hash(object) {
    if (object === undefined || isScalar(object)) {
        return '' + object;
    }

    if (object.hash) {
        return object.hash();
    }

    //Default implementation
    var hashes = [],
        value, key, hashKey, hashValue;

    for (key in object) {
        if (object.hasOwnProperty(key)) {
            value = object[key];
            hashKey = String(key);
            hashValue = hash(value);
            hashValue = (hashKey > hashValue) ? hashValue + hashKey : hashKey + hashValue;
            hashes.push(hashValue);
        }
    }

    return hashes.sort().join('');
}