Returns all keys that have been changed.

        If the keys are in child dictionaries they will be represented with
        . notation
344388
def changed(self):
        '''
        
        '''
        def _changed(diffs, prefix):
            keys = []
            for key in diffs.keys():
                if not isinstance(diffs[key], dict):
                    continue

                if isinstance(diffs[key], dict) and 'old' not in diffs[key]:
                    keys.extend(_changed(diffs[key],
                                       prefix='{0}{1}.'.format(prefix, key)))
                    continue
                if self.ignore_unset_values:
                    if 'old' in diffs[key] and 'new' in diffs[key] and \
                            diffs[key]['old'] != self.NONE_VALUE and \
                            diffs[key]['new'] != self.NONE_VALUE:
                        if isinstance(diffs[key]['new'], dict):
                            keys.extend(
                                _changed(diffs[key]['new'],
                                         prefix='{0}{1}.'.format(prefix, key)))
                        else:
                            keys.append('{0}{1}'.format(prefix, key))
                    elif isinstance(diffs[key], dict):
                        keys.extend(
                            _changed(diffs[key],
                                     prefix='{0}{1}.'.format(prefix, key)))
                else:
                    if 'old' in diffs[key] and 'new' in diffs[key]:
                        if isinstance(diffs[key]['new'], dict):
                            keys.extend(
                                _changed(diffs[key]['new'],
                                         prefix='{0}{1}.'.format(prefix, key)))
                        else:
                            keys.append('{0}{1}'.format(prefix, key))
                    elif isinstance(diffs[key], dict):
                        keys.extend(
                            _changed(diffs[key],
                                     prefix='{0}{1}.'.format(prefix, key)))

            return keys

        return sorted(_changed(self._diffs, prefix=''))
553864
def dict_diff(old, new):
    
    old_keys = viewkeys(old)
    new_keys = viewkeys(dict(new))
    out = {}
    for key in new_keys - old_keys:
        out[key] = new[key]
    for key in old_keys - new_keys:
        out[key] = None
    for key in old_keys & new_keys:
        if old[key] != new[key]:
            out[key] = new[key]
    return out
1002025
def _nested_changes(changes):
    '''
    
    '''
    ret = '\n'
    ret += salt.output.out_format(
            changes,
            'nested',
            __opts__,
            nested_indent=14)
    return ret
790918
def get_selected_keys(self, selection):
        """"""
        return [k for k, b in self._lookup.items() if b & selection]
1252225
public Map<String, OperationResult<ModelMetadataKey>> getChangedMetadataKeys(Map<String, ModelMetadataKey> keys) {
        String body = _serialize(keys);
        HttpResponse result = invoker.invoke("/metadatakey/changing" , body, HttpMethod.POST);

        if (result.getHttpCode() != HTTP_OK) {
            throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
                    "HTTP Code is not OK, code=%s", result.getHttpCode());
        }

        Map<String, OperationResult<ModelMetadataKey>> changedKeys = _deserialize(
                    result.getRetBody(), new TypeReference<Map<String, OperationResult<ModelMetadataKey>>>(){});

        return changedKeys;
    }
1258807
def calculate_dict_diff(old_params: dict, new_params: dict):
    
    # Ignore all None values as those cannot be saved.
    old_params = remove_None(old_params)
    new_params = remove_None(new_params)
    params_diff = {}
    for key, value in old_params.items():
        if key in new_params:
            if value != new_params[key]:
                params_diff[key] = new_params[key]
        else:
            params_diff[key] = ''
    for key, value in new_params.items():
        if key not in old_params:
            params_diff[key] = value
    return params_diff
165688
def iterkeys(self):
        """"""
        patterns = self.patterns
        replace = self.replace
        seen = set()
        for key in six.iterkeys(self.base):
            for pattern in patterns:
                m = pattern.match(key)
                if m:
                    ret = m.group('key') if replace else m.group()
                    if ret not in seen:
                        seen.add(ret)
                        yield ret
                    break
        for key in DictMethods.iterkeys(self):
            if key not in seen:
                yield key
353528
def get_fields(self):
        
        result = [key for key in self.__original_data__.keys()
                  if key not in self.__deleted_fields__]
        result.extend([key for key in self.__modified_data__.keys()
                       if key not in result and key not in self.__deleted_fields__])

        return result
854420
def get_all_changes(self, *args, **kwds):
        """"""
        result = []
        for project, refactoring in zip(self.projects, self.refactorings):
            args, kwds = self._resources_for_args(project, args, kwds)
            result.append((project, refactoring.get_changes(*args, **kwds)))
        return result
286788
def deleted_keys(self) -> Iterable[bytes]:
        
        for key, value in self._changes.items():
            if value is DELETED:
                yield key
71043
def changes_str(self):
        ''''''
        changes = ''
        for item in self._get_recursive_difference(type='intersect'):
            if item.diffs:
                changes = ''.join([changes,
                                   # Tabulate comment deeper, show the key attribute and the value
                                   # Next line should be tabulated even deeper,
                                   #  every change should be tabulated 1 deeper
                                   '\tidentified by {0} {1}:\n\t{2}\n'.format(
                                       self._key,
                                       item.past_dict[self._key],
                                       item.changes_str.replace('\n', '\n\t'))])
        for item in self._get_recursive_difference(type='removed'):
            if item.past_dict:
                changes = ''.join([changes,
                                   # Tabulate comment deeper, show the key attribute and the value
                                   '\tidentified by {0} {1}:'
                                   '\n\twill be removed\n'.format(self._key,
                                                                  item.past_dict[self._key])])
        for item in self._get_recursive_difference(type='added'):
            if item.current_dict:
                changes = ''.join([changes,
                                   # Tabulate comment deeper, show the key attribute and the value
                                   '\tidentified by {0} {1}:'
                                   '\n\twill be added\n'.format(self._key,
                                                                item.current_dict[self._key])])
        return changes
415676
def get_filtered_keys(self, suffix, *args, **kwargs):
        

        args = self.prepare_args(args, transform=False)

        for index in self._indexes:
            if index.can_handle_suffix(suffix):
                return index.get_filtered_keys(suffix, *args, **kwargs)
813484
def added(self):
        '''
        
        '''
        def _added(diffs, prefix):
            keys = []
            for key in diffs.keys():
                if isinstance(diffs[key], dict) and 'old' not in diffs[key]:
                    keys.extend(_added(diffs[key],
                                       prefix='{0}{1}.'.format(prefix, key)))
                elif diffs[key]['old'] == self.NONE_VALUE:
                    if isinstance(diffs[key]['new'], dict):
                        keys.extend(
                            _added(diffs[key]['new'],
                                   prefix='{0}{1}.'.format(prefix, key)))
                    else:
                        keys.append('{0}{1}'.format(prefix, key))
            return keys

        return sorted(_added(self._diffs, prefix=''))
239893
def get_changed_columns(self):
        
        return [k for k, v in self._values.items() if v.changed]
590097
def changes(new_cmp_dict, old_cmp_dict, id_column, columns):
    

    update_ldict = []
    same_keys = set(new_cmp_dict).intersection(set(old_cmp_dict))
    for same_key in same_keys:
        # Get the Union of the set of keys
        # for both dictionaries to account
        # for missing keys
        old_dict = old_cmp_dict[same_key]
        new_dict = new_cmp_dict[same_key]
        dict_keys = set(old_dict).intersection(set(new_dict))

        update_dict = {}
        for dict_key in columns:
            old_val = old_dict.get(dict_key, 'NaN')
            new_val = new_dict.get(dict_key, 'NaN')
            if old_val != new_val and new_val != 'NaN':
                if id_column!=None:
                    try:
                        update_dict[id_column] = old_dict[id_column]
                    except KeyError:
                        print("Input Dictionary 'old_cmp_dict' must have ID column")
                update_dict[dict_key] = new_val
        if update_dict:
            update_ldict.append(update_dict)
    return update_ldict
1224687
def changed(self):
        """"""
        if not self.instance.pk:
            return {}
        saved = self.saved_data.items()
        current = self.current()
        return dict((k, v) for k, v in saved if v != current[k])
662290
def keys(self):
        ""
        return tuple(set(self.new.keys()).union(self.old.keys()))