merge them somehow
161050
public static String encode(String realpath) {

	int qIndex = realpath.indexOf('?');

	if (qIndex == -1) return realpath;

	String file = realpath.substring(0, qIndex);
	String query = realpath.substring(qIndex + 1);
	int sIndex = query.indexOf('#');

	String anker = null;
	if (sIndex != -1) {
	    // print.o(sIndex);
	    anker = query.substring(sIndex + 1);
	    query = query.substring(0, sIndex);
	}

	StringBuilder res = new StringBuilder(file);

	// query
	if (!StringUtil.isEmpty(query)) {

	    StringList list = ListUtil.toList(query, '&');
	    String str;
	    int index;
	    char del = '?';
	    while (list.hasNext()) {
		res.append(del);
		del = '&';
		str = list.next();
		index = str.indexOf('=');
		if (index == -1) res.append(escapeQSValue(str));
		else {
		    res.append(escapeQSValue(str.substring(0, index)));
		    res.append('=');
		    res.append(escapeQSValue(str.substring(index + 1)));
		}
	    }
	}

	// anker
	if (anker != null) {
	    res.append('#');
	    res.append(escapeQSValue(anker));
	}

	return res.toString();
    }
1096164
def merge(*maps):
    """"""
    copies = map(deepcopy, maps)
    return reduce(lambda acc, val: acc.update(val) or acc, copies)
1032926
def union(self, other, ignore_conflicts=False):
        """"""
        result = self.copy()
        result.union_update(other, ignore_conflicts)
        return result
295231
def merge(s, t):
    """"""

    for k, v in t.items():
        if isinstance(v, dict):
            if k not in s:
                s[k] = v
                continue

            s[k] = merge(s[k], v)
            continue

        s[k] = v

    return s
760283
def merge(self, other):
    """"""
    def merge_dict(a, b):
      for k, v in six.iteritems(b):
        a[k] += v

    self.replays += other.replays
    self.steps += other.steps
    self.camera_move += other.camera_move
    self.select_pt += other.select_pt
    self.select_rect += other.select_rect
    self.control_group += other.control_group
    merge_dict(self.maps, other.maps)
    merge_dict(self.races, other.races)
    merge_dict(self.unit_ids, other.unit_ids)
    merge_dict(self.valid_abilities, other.valid_abilities)
    merge_dict(self.made_abilities, other.made_abilities)
    merge_dict(self.valid_actions, other.valid_actions)
    merge_dict(self.made_actions, other.made_actions)
    self.crashing_replays |= other.crashing_replays
    self.invalid_replays |= other.invalid_replays
1017127
def _perform_merge(self, other):
        
        if len(other.value) > len(self.value):
            self.value = other.value[:]
        return True
141508
function merge(obj1, obj2){
    for(var key in obj2){
        obj1[key] = obj2[key]
    }

    return obj1
}
667002
function merge(obj1, obj2) {
  var res = {}, attrname;

  for (attrname in obj1) {
    res[attrname] = obj1[attrname];
  }
  for (attrname in obj2) {
    res[attrname] = obj2[attrname];
  }
  return res;
}
553741
def merge!(errors)
      if errors
        errors.each_pair do |field, messages|
          messages.each do |message|
            add(field, message)
          end
        end
      end
    end
499067
def merge(self, other):
        
        other.qualify()
        for n in ('name',
                  'qname',
                  'min',
                  'max',
                  'default',
                  'type',
                  'nillable',
                  'form_qualified',):
            if getattr(self, n) is not None:
                continue
            v = getattr(other, n)
            if v is None:
                continue
            setattr(self, n, v)
1325341
function merge (s) {
  var r = {}
  var k

  if (s) {
    for (k in s) {
      if (s.hasOwnProperty(k)) {
        r[k] = s[k]
      }
    }
  }

  return r
}
811888
function mergeWithoutOverwrite(object1, object2) {
		if (object1 === object2) {
			return object1;
		}

		var oMergedObject = {};

		// Clone object1
		Object.keys(object1).forEach(function(sKey) {
			oMergedObject[sKey] = object1[sKey];
		});

		// merge
		Object.keys(object2).forEach(function(sKey) {
			if (!oMergedObject.hasOwnProperty(sKey)) {
				oMergedObject[sKey] = object2[sKey];
			}
		});

		return oMergedObject;
	}
168392
function merge(a, b) {
  if (type(a) !== type(b)) {
    throw new Error('Incompatible merge scenario.');
  } else if ('object' === type(a)) {
    return mergeObject(a, b);
  } else if ('array' === type(a)) {
    return mergeArray(a, b);
  } else {
    throw new Error('Unsupported merge scenario');
  }
}
77780
def combine(self, other, name=None):
    """"""
    return PhaseGroup(
        setup=self.setup + other.setup,
        main=self.main + other.main,
        teardown=self.teardown + other.teardown,
        name=name)
493884
def merge(self, other):
        ''''''
        our_element_frequencies = self.items
        their_element_frequencies = other.items
        for element_name, freq in sorted(our_element_frequencies.iteritems()):
            our_element_frequencies[element_name] = max(our_element_frequencies.get(element_name, 0), their_element_frequencies.get(element_name, 0))
        for element_name, freq in sorted(their_element_frequencies.iteritems()):
            if element_name not in our_element_frequencies:
                our_element_frequencies[element_name] = their_element_frequencies[element_name]
327110
def merge_from(self, other):
        """"""
        if other.pattern is not None:
            self.pattern = other.pattern
        if other.format is not None:
            self.format = other.format
        self.leading_digits_pattern.extend(other.leading_digits_pattern)
        if other.national_prefix_formatting_rule is not None:
            self.national_prefix_formatting_rule = other.national_prefix_formatting_rule
        if other.national_prefix_optional_when_formatting is not None:
            self.national_prefix_optional_when_formatting = other.national_prefix_optional_when_formatting
        if other.domestic_carrier_code_formatting_rule is not None:
            self.domestic_carrier_code_formatting_rule = other.domestic_carrier_code_formatting_rule
434206
def merge(self, other):
        ''''''
        assert self.refnames == other.refnames
        assert self.dirs == other.dirs
        assert self.lengths == other.lengths

        for i in range(2):
            if self.pos[i] is None:
                if other.pos[i] is None:
                   raise Error('Error merging these two links:\n' + str(self) + '\n' + str(other))
                self.pos[i] = other.pos[i]
            else:
                if other.pos[i] is not None:
                   raise Error('Error merging these two links:\n' + str(self) + '\n' + str(other))