If entry.param.headers exists and is an object other than an array,
converts
it into an array and returns a new entry.  Otherwise, just returns the
original entry.
328715
function reformatHeaders(entry) {
    // If there are no headers, or it is not an object other than an array,
    // return |entry| without modification.
    if (!entry.params || entry.params.headers === undefined ||
        typeof entry.params.headers !== 'object' ||
        entry.params.headers instanceof Array) {
      return entry;
    }

    // Duplicate the top level object, and |entry.params|, so the original
    // object
    // will not be modified.
    entry = shallowCloneObject(entry);
    entry.params = shallowCloneObject(entry.params);

    // Convert headers to an array.
    const headers = [];
    for (const key in entry.params.headers) {
      headers.push(key + ': ' + entry.params.headers[key]);
    }
    entry.params.headers = headers;

    return entry;
  }
372782
def write_header(key, value)
      # @see http://stomp.github.io/stomp-specification-1.2.html#Repeated_Header_Entries
      key = decode_header(key)
      @headers[key] = decode_header(value) unless @headers.has_key?(key)
    end
960493
function (header) {
        if (!(header && header.key)) { return; } // if no valid header is provided, do nothing

        var existing = this.headers.find({ key: header.key });

        if (!existing) {
            return this.headers.add(header);
        }

        existing.value = header.value;
    }
788290
def to_obj
    # If this is not a "entry_list" response, just return
    return @response unless @response && @response["entry_list"]
    
    objects = []
    @response["entry_list"].each do |object|
      attributes = []
      _module    = resolve_module(object)
      attributes = flatten_name_value_list(object)
      namespace = @session.namespace_const
      if namespace.const_get(_module)
        if attributes.length == 0
          raise AttributeParsingError, "response contains objects without attributes!"
        end
        objects << namespace.const_get(_module).new(attributes) 
      else
        raise InvalidModule, "#{_module} does not exist, or is not accessible"
      end
    end
    # If we only have one result, just return the object
    if objects.length == 1 && !@options[:always_return_array]
      return objects[0]
    else
      return objects
    end
  end
1095996
function (headers, headerKey, defaultValue) {
        var headerName = _.findKey(headers, function (value, key) {
            return key.toLowerCase() === headerKey.toLowerCase();
        });

        if (!headerName) {
            headers[headerKey] = defaultValue;
        }
    }
1333244
protected HttpHeaders copy(HttpHeaders headers){
		HttpHeaders newHeaders = new HttpHeaders();
		newHeaders.putAll(headers);
		return newHeaders;
	}
1284845
def []=(key, value)
      key = self.class.normalize_key(key)
      if (header_class = self.class.attributes[key])
        value = header_class.parse(value)
      end
      super(key, value)
    end
1232516
Entry[] reuseChunkArray() {
    Entry[] ea = evictChunkReuse;
    if (ea != null) {
      evictChunkReuse = null;
    } else {
      ea = new Entry[chunkSize];
    }
    return ea;
  }
495020
function (headers) {
      var parsed = {};

      if (headers) {
        headers = headers.trim().split("\n");
        for (var h in headers) {
          if (headers.hasOwnProperty(h)) {
            var header = headers[h].match(/([^:]+):(.*)/);
            parsed[header[1].trim().toLowerCase()] = header[2].trim();
          }
        }
      }
      return parsed;
    }
1519
def headers(h = nil)
      if h
        raise ArgumentError, 'Headers must be an object which responds to #to_hash' unless h.respond_to?(:to_hash)
        default_options[:headers] ||= {}
        default_options[:headers].merge!(h.to_hash)
      else
        default_options[:headers] || {}
      end
    end
354252
function (field, value) {
        if (is(field).a(Object)) {
          for (var key in field) {
            if (Object.prototype.hasOwnProperty.call(field, key)) {
              $this.header(key, field[key])
            }
          }

          return $this
        }

        var existingHeaderName = $this.hasHeader(field)
        $this.options.headers[existingHeaderName || field] = value

        return $this
      }
577889
@Override
    void createEntry(int hash, K key, V value, int bucketIndex) {
	HashMapPro.Entry<K, V> old = table[bucketIndex];
	Entry<K, V> e = new Entry<K, V>(hash, key, value, old);
	table[bucketIndex] = e;
	e.addBefore(header);
	size++;
    }
804789
function headerFactory(key, value) {
  
  var headers = {};
  if (arguments.length === 2) {
    headers[key] = value;
  } else {
    headers = key;
  }
  return function header(req, res, next) {
    for (var name in headers) {
      if (headers.hasOwnProperty(name)) {
        res.setHeader(name, headers[name]);
      }
    }
    next();
  };
}
982242
def get_header(headers, name, default=None):
    
    name = name.lower()
    for header in headers:
        if header[0].lower() == name:
            return header[1]
    return default
166853
def create(cls, custom_headers=None):
        

        if custom_headers is None:
            custom_headers = {}

        request_map = {

        }
        request_map_string = converter.class_to_json(request_map)
        request_map_string = cls._remove_field_for_request(request_map_string)

        api_client = client.ApiClient(cls._get_api_context())
        request_bytes = request_map_string.encode()
        endpoint_url = cls._ENDPOINT_URL_CREATE
        response_raw = api_client.post(endpoint_url, request_bytes,
                                       custom_headers)

        return BunqResponseSandboxUser.cast_from_bunq_response(
            cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
        )
1293601
private static Map<String, String> getOrderedHeadersToSign(Header[] headers) {
        Map<String, String> unique = new TreeMap<>();
        for (Header header : headers) {
            String key = header.getName().toLowerCase(Locale.US).trim();
            if (key.equals("connection")) {
                // do not sign 'connection' header, it is very likely to be changed en-route.
                continue;
            }
            String value = header.getValue();
            if (value == null) {
                value = "";
            } else {
                // minimize white space
                value = value.trim().replaceAll("\\s+", " ");
            }
            // merge all values with same header name
            String prior = unique.get(key);
            if (prior != null) {
                if (prior.length() > 0) {
                    value = prior + ',' + value;
                }
                unique.put(key, value);
            } else {
                unique.put(key, value);
            }
        }
        return unique;
    }
484127
function extractHeaders(options) {
    let headers = {};
    if (options && options.headers) {
        headers = options.headers;
        delete options.headers;
    }
    return headers;
}