Converts shims of format: ['dep'] into { deps: ['deps'] } and transform shim hash into an {Array} of shims.
556391
function normalizeShims(shims) {
  return Object.keys(shims).map(function (k) {
    var shim = shims[k];
    if (Array.isArray(shim)) shim = { deps: shim };
    shim.alias = k;
    return shim;
  });
}
780819
function normaliseDeps (deps) {
  if (Array.isArray(deps)) {
    deps = deps.reduce(function (d, depName) {
      d[depName] = '*'
      return d
    }, {})
  }
  return deps
}
568295
def to_matrix_properties(hash = {})
      properties = hash.map do |k, v|
        key   = CGI.escape(k.to_s)
        value = CGI.escape(v.to_s)

        "#{key}=#{value}"
      end

      if properties.empty?
        nil
      else
        ";#{properties.join(';')}"
      end
    end
1372700
def to_hash
      h = {:width => width, :height => height, :bits => bits, :comment => comment}
      h.merge!(exif) if exif?
      h
    end
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
56489
def to_input_hash
      HASH_SCHEMA.schema(
        map { |attr| [attr.name, attr.to_write_type] }.to_h
      )
    end
83348
def convert_param_keys(underscored_params)
      pairs = underscored_params.map do |key, value|
        key = key.to_s.gsub(/_([a-z])/i) { $1.upcase }
        [key, value]
      end
      Hash[pairs]
    end
1154728
def map_array_of_hashes(arr_hashes)
      return if arr_hashes.nil?

      [].tap do |output_array|
        arr_hashes.each do |hash|
          output_array.push hash.values
        end
      end
    end
592302
def to_hash
      load

      {}.tap do |hash|
        @_definition.each do |k, v|
          hash[k] = v
        end
      end
    end
691504
def to_output_hash
      HASH_SCHEMA.schema(
        map { |attr| [attr.key, attr.to_read_type] }.to_h
      )
    end
997064
def compose_sep(deps, separator):
        
        result = {}
        for dep in deps:
            if dep.name not in result:
                result[dep.name] = separator.join([op + ver for op, ver in dep.spec])
            else:
                result[dep.name] += separator + separator.join([op + ver for op, ver in dep.spec])
        return result
1044757
def _to_hash(value)
      if value.is_a?(Array)
        value.compact.map{ |v| _to_hash(v) }
      elsif value.is_a?(Hash)
        {}.tap do |hash|
          value.each { |k, v| hash[k] = _to_hash(v) }
        end
      elsif value.respond_to? :to_hash
        value.to_hash
      else
        value
      end
    end
1190274
def to_hash
      ret = {}
      self.each_pair do |k, v|
        ret[k] = v.to_hash()
      end
      ret
    end
1067382
def buffer_attributes_to_hash(attributes)
      '{' + attributes.inject([]) do |extend_map, (key, attribute)|
        extend_map << (
          ":\"#{key}\" => " + if key == :class
                                '[' + attribute.map do |exp|
                                  exp[@value]
                                end.join(', ') + ']'
                              else
                                attribute[@value]
                              end
        )
      end.join(', ') + '}'
    end
183723
def to_hash
      config = load_base_config
      config = config.deep_merge(load_env_config)
      config.deep_merge(load_jvm_config)
    end
268613
def to_hash
            index_hash = {}
            index_hash['json_claz'] = self.class.name
            index_hash['id'] = id
            index_hash['name'] = name
            index_hash['tosca_type'] = tosca_type
            index_hash['inputs'] = inputs
            index_hash['outputs'] = outputs
            index_hash['envs'] = envs
            index_hash['artifacts'] = artifacts
            index_hash['related_components'] = related_components
            index_hash['operations'] = operations
            index_hash['status'] = status
            index_hash['state'] = state
            index_hash['repo'] = repo
            index_hash['created_at'] = created_at
            index_hash
        end
19310
def diff_as_hash(diff_command, opts=[])
      command_lines(diff_command, opts).inject({}) do |memo, line|
        info, file = line.split("\t")
        mode_src, mode_dest, sha_src, sha_dest, type = info.split

        memo[file] = {
          :mode_index => mode_dest,
          :mode_repo => mode_src.to_s[1, 7],
          :path => file,
          :sha_repo => sha_src,
          :sha_index => sha_dest,
          :type => type
        }

        memo
      end
    end