Returns the old values from the diff
976078
def old_values(self):
        ''''''
        def get_old_values_and_key(item):
            values = item.old_values
            values.update({self._key: item.past_dict[self._key]})
            return values

        return [get_old_values_and_key(el)
                for el in self._get_recursive_difference('all')
                if el.diffs and el.past_dict]
622164
def get_old_value(self, args, kwargs, default=None):
        # type: (List[Any], Dict[str, Any], Any) -> Any
        
        if self.arg_pos is not None and len(args) > self.arg_pos:
            return args[self.arg_pos]
        else:
            return kwargs.get(self.name, default)
79907
def _diff(d1,d2):
    '''
        
    '''
    d = {}
    ds = _diff_internal(d1,d2)
    for key in ds['vdiff']:
        d[key] = d1[key]
    for key in ds['kdiff']:
        d[key] = d1[key]
    return(d)
773817
def removed(self):
        '''
        
        '''
        def _removed(diffs, prefix):
            keys = []
            for key in diffs.keys():
                if isinstance(diffs[key], dict) and 'old' not in diffs[key]:
                    keys.extend(_removed(diffs[key],
                                       prefix='{0}{1}.'.format(prefix, key)))
                elif diffs[key]['new'] == self.NONE_VALUE:
                    keys.append('{0}{1}'.format(prefix, key))
                elif isinstance(diffs[key]['new'], dict):
                    keys.extend(
                        _removed(diffs[key]['new'],
                                 prefix='{0}{1}.'.format(prefix, key)))
            return keys

        return sorted(_removed(self._diffs, prefix=''))
482243
function convertDiff (diff) {
  var converted = []
  var index = 0

  for (var i = 0; i < diff.length; i += 1) {
    var change = diff[i]

    if (!change.added && !change.removed) {
      index += change.items.length
      continue
    }

    var next = diff[i + 1]
    if (next && change.removed && next.added) {
      var changeLen = change.items.length
      var nextLen = next.items.length
      var len = Math.min(changeLen, nextLen)
      converted.push({
        items: next.items.slice(0, len),
        index: index,
        added: true,
        removed: true
      })

      index += len

      if (changeLen < nextLen) {
        converted.push({
          items: next.items.slice(len),
          index: index,
          added: true,
          removed: false
        })
        index += nextLen - len
      } else if (nextLen < changeLen) {
        converted.push({
          items: change.items.slice(len),
          index: index,
          added: false,
          removed: true
        })
      }

      i += 1
      continue
    }

    converted.push({
      items: change.items.slice(),
      index: index,
      added: change.added,
      removed: change.removed
    })

    if (change.added) {
      index += change.items.length
    }
  }

  return converted
}
377837
def _diff_internal(d1,d2):
    '''
        
    '''
    same =[]
    kdiff =[]
    vdiff = []
    for key in d1:
        value = d1[key]
        if(key in d2):
            if(value == d2[key]):
                same.append(key)
            else:
                vdiff.append(key)
        else:
            kdiff.append(key)
    return({'same':same,'kdiff':kdiff,'vdiff':vdiff})
232435
def _get_val2_dict_from_diff_dict(diff_dict):
    '''
    
    '''
    ret_dict = {}
    for p in diff_dict.keys():
        if not isinstance(diff_dict[p], dict):
            raise ValueError('Unexpected diff difct \'{0}\''.format(diff_dict))
        if 'val2' in diff_dict[p].keys():
            ret_dict.update({p: diff_dict[p]['val2']})
        else:
            ret_dict.update(
                {p: _get_val2_dict_from_diff_dict(diff_dict[p])})
    return ret_dict
662878
def _get_changes_from_diff_dict(diff_dict):
    '''
    
    '''
    changes_strings = []
    for p in diff_dict.keys():
        if not isinstance(diff_dict[p], dict):
            raise ValueError('Unexpected diff difct \'{0}\''.format(diff_dict))
        if sorted(diff_dict[p].keys()) == ['val1', 'val2']:
            # Some string formatting
            from_str = diff_dict[p]['val1']
            if isinstance(diff_dict[p]['val1'], six.string_types):
                from_str = '\'{0}\''.format(diff_dict[p]['val1'])
            elif isinstance(diff_dict[p]['val1'], list):
                from_str = '\'{0}\''.format(', '.join(diff_dict[p]['val1']))
            to_str = diff_dict[p]['val2']
            if isinstance(diff_dict[p]['val2'], six.string_types):
                to_str = '\'{0}\''.format(diff_dict[p]['val2'])
            elif isinstance(diff_dict[p]['val2'], list):
                to_str = '\'{0}\''.format(', '.join(diff_dict[p]['val2']))
            changes_strings.append('{0} from {1} to {2}'.format(
                p, from_str, to_str))
        else:
            sub_changes = _get_changes_from_diff_dict(diff_dict[p])
            if sub_changes:
                changes_strings.append('{0}:'.format(p))
                changes_strings.extend(['\t{0}'.format(c)
                                       for c in sub_changes])
    return changes_strings
1019736
function getDiffs(prs) {
  print('Fetching diffs', debug);
  return Promise.all(prs.reduce((flattenedPRs, pr) => {
    if (pr) {
      return flattenedPRs.concat(pr);
    }
  }, []).map(getDiffForPR));
}
587996
def generateDiff(self, oldWarnings, newWarnings):
        
        diffWarnings = {}

        for modulename in newWarnings:
            diffInModule = (
                newWarnings[modulename] -
                oldWarnings.get(modulename, set()))
            if diffInModule:
                diffWarnings[modulename] = diffInModule

        return diffWarnings
841118
def unchanged(self):
        '''
        
        '''
        def _unchanged(current_dict, diffs, prefix):
            keys = []
            for key in current_dict.keys():
                if key not in diffs:
                    keys.append('{0}{1}'.format(prefix, key))
                elif isinstance(current_dict[key], dict):
                    if 'new' in diffs[key]:
                        # There is a diff
                        continue
                    else:
                        keys.extend(
                            _unchanged(current_dict[key],
                                       diffs[key],
                                       prefix='{0}{1}.'.format(prefix, key)))

            return keys
        return sorted(_unchanged(self.current_dict, self._diffs, prefix=''))
926185
def _get_recursive_difference(self, type):
        ''''''
        if type == 'intersect':
            return [recursive_diff(item['old'], item['new']) for item in self._intersect]
        elif type == 'added':
            return [recursive_diff({}, item) for item in self._added]
        elif type == 'removed':
            return [recursive_diff(item, {}, ignore_missing_keys=False)
                    for item in self._removed]
        elif type == 'all':
            recursive_list = []
            recursive_list.extend([recursive_diff(item['old'], item['new']) for item in self._intersect])
            recursive_list.extend([recursive_diff({}, item) for item in self._added])
            recursive_list.extend([recursive_diff(item, {},
                                                  ignore_missing_keys=False)
                                   for item in self._removed])
            return recursive_list
        else:
            raise ValueError('The given type for recursive list matching '
                             'is not supported.')
941490
private function findDiff($new)
    {
        $old = $this->oldValues;
        $diff = [];

        foreach ($new as $key => $value) {
            if (!isset($old[$key]) || $old[$key] !== $new[$key]) {
                $diff[$key] = $value;
            }
        }

        return $diff;
    }
652315
def showDiffResults(self):
        
        try:
            oldWarnings = self.parseWarnings(self._readDiffFile())
        except:
            sys.stderr.write(self.errorResultRead % self.diffOption)
            return 1

        newWarnings = self.parseWarnings(self.streamForDiff.getvalue())

        diffWarnings = self.generateDiff(oldWarnings, newWarnings)

        if diffWarnings:
            diffResult = self.formatWarnings(diffWarnings)
            self.outputStream.write(diffResult + "\n")
            return len(diffWarnings)
        else:
            return 0
129739
def diff_from(ts = nil, version: nil, time: nil)
      Deprecations.show_ts_deprecation_for("#diff_from") if ts
      time ||= ts
      time = parse_time(time) if time
      changes = log_data.diff_from(time: time, version: version).tap do |v|
        deserialize_changes!(v)
      end

      changes.delete_if { |k, _v| deleted_column?(k) }

      { "id" => id, "changes" => changes }
    end
1134276
def split_diff(old, new):
        
        return map(lambda l: l.rstrip(),
                   icdiff.ConsoleDiff(cols=COLUMNS).make_table(old.splitlines(), new.splitlines()))
24085
def difference_update(self, values):
        ''''''
        d = self.value_pickler.dumps
        return self.cache.remove(tuple((d(v) for v in values)))