Merge a non-umail account with a umail account.
327898
def merge_users(merge_to, merge_from):
    """"""
    # Determine most active user based on most recently created group
    assert(merge_to.username.endswith('umail.ucsb.edu'))

    # Merge groups
    for u2g in merge_from.groups_assocs[:]:
        merge_to.group_with(merge_from, u2g.project, bypass_limit=True)

    # merge classes and files
    merge_to.classes.extend(merge_from.classes)
    merge_to.files.extend(merge_from.files)

    # update file ownership
    for sub in Submission.query_by(created_by=merge_from).all():
        sub.created_by = merge_to

    # Delete the secondary user
    Session.delete(merge_from)
370745
function mergeMeta(ctx, newMeta) {
	if (newMeta)
		_.assign(ctx.meta, newMeta);
	return ctx.meta;
}
951074
def merge(self, other):
        
        if self.is_blank() or other.is_blank():
            raise ValueError('Cannot merge if there is a blank.')
        else:
            self.properties.update(other.properties)
202653
def merge_dict(dict_1, *other, **kw):
    """"""
    tmp = dict_1.copy()
    for x in other:
        tmp.update(x)
    tmp.update(kw)
    return tmp
287937
function MERGER(oldVal, newVal) {
		let onme = CNAME(oldVal), ocon = ISCONFIG(oldVal), otyp = ISPTYPE(oldVal),
			nnme = CNAME(newVal), ncon = ISCONFIG(newVal), ntyp = ISPTYPE(newVal);
		if (otyp || ntyp) { return newVal; };
		if (ocon && ncon && onme==nnme) {
			return new GETCONFIG(onme)(Assign(oldVal, newVal));
		};
		if (ocon && onme=='GNParam') {
			if (nnme=='array') return oldVal.AddVersion(newVal[0],     newVal[1]);
			if (nnme=='List' ) return oldVal.AddVersion(newVal.get(0), newVal.get(1).toJS());
		};
		return newVal;
	}
811133
def cmd_merge(self):
        """"""
        from peewee_migrate.router import Router, LOGGER

        LOGGER.setLevel('DEBUG')
        LOGGER.propagate = 0

        router = Router(self.database,
                        migrate_dir=self.app.config['PEEWEE_MIGRATE_DIR'],
                        migrate_table=self.app.config['PEEWEE_MIGRATE_TABLE'])

        router.merge()
1141553
def MergeVcards(vcard1, vcard2):
    """"""
    new_vcard = vobject.vCard()
    vcard1_fields = set(vcard1.contents.keys())
    vcard2_fields = set(vcard2.contents.keys())
    mutual_fields = vcard1_fields.intersection(vcard2_fields)
    logger.debug('Potentially conflicting fields: {}'.format(mutual_fields))
    for field in mutual_fields:
        val1 = vcard1.contents.get(field)
        val2 = vcard2.contents.get(field)
        new_values = []
        if not VcardFieldsEqual(val1, val2):
            # we have a conflict, if a list maybe append otherwise prompt user
            if field not in MERGEABLE_FIELDS:
                context_str = GetVcardContextString(vcard1, vcard2)
                new_values.extend(SelectFieldPrompt(field,
                                                    context_str,
                                                    val1,
                                                    val2))
            else:
                new_values.extend(VcardMergeListFields(val1, val2))
        else:
            new_values.extend(val1)

        logger.debug('Merged values for field {}: {}'.format(
            field.upper(),
            u(str(new_values)))
        )
        new_vcard = SetVcardField(new_vcard, field, new_values)

    new_vcard = CopyVcardFields(new_vcard,
                                vcard1,
                                vcard1_fields - vcard2_fields)
    new_vcard = CopyVcardFields(new_vcard,
                                vcard2,
                                vcard2_fields - vcard1_fields)

    return new_vcard
792930
public AuthToken merge(AuthToken other) {
        if (other.equals(NULL_AUTH_TOKEN)) {
            // NULL_AUTH_TOKEN can't merge
            return other;
        }
        AuthToken merged = new AuthToken();
        merged.key = other.key != null ? other.key : this.key;
        merged.tokenName = other.tokenName != null ? other.tokenName : this.tokenName;
        merged.startTime = other.startTime != 0 ? other.startTime : this.startTime;
        merged.expiration = other.expiration != 0 ? other.expiration : this.expiration;
        merged.ip = other.ip != null ? other.ip : this.ip;
        merged.acl = other.acl != null ? other.acl : this.acl;
        merged.duration = other.duration != 0 ? other.duration : this.duration;
        return merged;
    }
671792
def merge_dupes(self):
        """"""
        for dupe in self.dupe_of:
            if dupe in self.catalog.entries:
                if self.catalog.entries[dupe]._stub:
                    # merge = False to avoid infinite recursion
                    self.catalog.load_entry_from_name(
                        dupe, delete=True, merge=False)
                self.catalog.copy_entry_to_entry(self.catalog.entries[dupe],
                                                 self)
                del self.catalog.entries[dupe]
        self.dupe_of = []
476081
def __merge(self, matched, interactive):
        """"""

        for m in matched:
            identities = m['identities']
            uuid = identities[0]

            try:
                for c in identities[1:]:
                    if self.__merge_unique_identities(c, uuid, interactive):
                        self.matched += 1

                        # Retrieve unique identity to show updated info
                        if interactive:
                            uuid = api.unique_identities(self.db, uuid=uuid)[0]
            except Exception as e:
                if self.recovery:
                    self.recovery_file.save_matches(matched)
                raise e

            m['processed'] = True
1216070
def _merge(cls, default, user):
        """"""
        section = cls._CFG_SECTION
        merged = default[section]

        if section not in user:
            return merged

        user = user[section]
        for key, value in user.items():
            if key in merged:
                merged[key] += ' ' + value
            else:
                merged[key] = value
        return merged
1107251
def merge_arena(self, mujoco_arena):
        """"""
        self.arena = mujoco_arena
        self.table_top_offset = mujoco_arena.table_top_abs
        self.table_size = mujoco_arena.table_full_size
        self.merge(mujoco_arena)
863075
def merge(self, other):
        
        self.stats = set(self.stats)
        self.stats.update(set(other.stats))
        self.stats = list(self.stats)
        if other._error:
            self._error = True
748997
def merge(other)
      old_attributes = attributes
      other_attributes = other.is_a?(Hash) ? other : other.attributes

      old_attributes.merge!(other_attributes) do |key, old_value, new_value|
        case key
        when :clusters, :contexts, :users
          old_value + new_value.reject do |new_mapping|
            old_value.any? { |old_mapping| old_mapping[:name] == new_mapping[:name] }
          end
        else
          case old_value
          when Array
            (old_value + new_value).uniq
          when Hash
            old_value.merge(new_value) do |_key, inner_old_value, inner_new_value|
              inner_old_value.nil? ? inner_new_value : inner_old_value
            end
          when NilClass
            new_value
          else
            warn "key is #{key} old val is #{old_value.inspect} and new val is #{new_value.inspect}"
            old_value
          end
        end
      end

      self.class.new(old_attributes)
    end
840764
def merge(self, other):
        """"""
        if not getattr(other, '_catalog', None):
            return  # NullTranslations() has no _catalog
        if self._catalog is None:
            # Take plural and _info from first catalog found
            self.plural = other.plural
            self._info = other._info.copy()
            self._catalog = other._catalog.copy()
        else:
            self._catalog.update(other._catalog)
772166
def register_transfer(self, relation, old_id, new_id):
    """"""
    transfer = Transfer(relation_id=relation.id, old_id=old_id, new_id=new_id)
    self.data_access.insert_model(transfer)
    return transfer
996470
def merge(directory, message, branch_label, rev_id, revisions):
    """"""
    _merge(directory, revisions, message, branch_label, rev_id)