Returns ``True`` if the dict contains keys with duplicates.
        Recurses through any all keys with value that is ``VDFDict``.
335650
def has_duplicates(self):
        
        for n in getattr(self.__kcount, _iter_values)():
            if n != 1:
                return True

        def dict_recurse(obj):
            for v in getattr(obj, _iter_values)():
                if isinstance(v, VDFDict) and v.has_duplicates():
                    return True
                elif isinstance(v, dict):
                    return dict_recurse(v)
            return False

        return dict_recurse(self)
919107
def clean_dict_keys(d):
    
    new_d = {}
    for (k, v) in d.iteritems():
        new_d[str(k)] = v
    return new_d
1117237
def _remove_duplicate_slices(dicoms):
    
    # Loop overall files and build dict

    dicoms_dict = {}
    filtered_dicoms = []
    for dicom_ in dicoms:
        if tuple(dicom_.ImagePositionPatient) not in dicoms_dict:
            dicoms_dict[tuple(dicom_.ImagePositionPatient)] = dicom_
            filtered_dicoms.append(dicom_)
        else:
            if numpy.array_equal(dicom_.pixel_array,
                                 dicoms_dict[tuple(dicom_.ImagePositionPatient)].pixel_array):
                logger.warning('Removing duplicate slice from series')
            else:
                filtered_dicoms.append(dicom_)
    return filtered_dicoms
1214953
def is_dict_like(obj, attr=('keys', 'items')):
    """"""
    for a in attr:
        if not hasattr(obj, a):
            return False
    return True
162140
public final void containsNoDuplicates() {
    List<Entry<?>> duplicates = newArrayList();
    for (Multiset.Entry<?> entry : LinkedHashMultiset.create(actual()).entrySet()) {
      if (entry.getCount() > 1) {
        duplicates.add(entry);
      }
    }
    if (!duplicates.isEmpty()) {
      failWithoutActual(
          simpleFact("expected not to contain duplicates"),
          fact("but contained", duplicates),
          fullContents());
    }
  }
478605
def filter_dup(lst, lists):
    '''
    
    '''
    max_rank = len(lst) + 1
    dct = to_ranked_dict(lst)
    dicts = [to_ranked_dict(l) for l in lists]
    return [word for word in lst if all(dct[word] < dct2.get(word, max_rank) for dct2 in dicts)]
534548
def validate_unique_items(value, **kwargs):
    
    # we can't just look at the items themselves since 0 and False are treated
    # the same as dictionary keys, and objects aren't hashable.

    counter = collections.Counter((
        json.dumps(v, sort_keys=True) for v in value
    ))
    dupes = [json.loads(v) for v, count in counter.items() if count > 1]
    if dupes:
        raise ValidationError(
            MESSAGES['unique_items']['invalid'].format(
                repr(dupes),
            ),
        )
85265
def is_complete(self, keys=None, alias=None):
        
        return any(k not in list(self.data.keys()) for k in keys)
1366429
def _unique(list_of_dicts):
    '''
    
    '''
    unique_list = []
    for ele in list_of_dicts:
        if ele not in unique_list:
            unique_list.append(ele)
    return unique_list
1107268
def merge_dicts(dict_a, dict_b):
    """"""
    duplicates = [val for val in dict_a if val in dict_b]
    if duplicates:
        _LOGGER.warning(("Duplicates found during merge: %s. "
                         "Renaming is recommended."), duplicates)
    return {**dict_a, **dict_b}
653898
function haveDifferentKeys(object1, object2) {
  var keys1 = Object.keys(object1);
  var keys2 = Object.keys(object2);

  if (keys1.length !== keys2.length) {
    return true;
  }

  return !keys1.every(function existsInKeys2 (key) {
    return keys2.indexOf(key) !== -1;
  });
}
3842
function hasDuplicates(arr, fn) {
  var obj = {};
  var i, l, elem;
  for (i = 0, l = arr.length; i < l; i++) {
    elem = arr[i];
    if (fn) {
      elem = fn(elem);
    }
    if (obj[elem]) {
      return true;
    }
    obj[elem] = true;
  }
  return false;
}
1372693
def merge_dicts(*dicts, **copy_check):
    '''
    
    '''
    merged = {}
    if not dicts:
        return merged
    for index, merge_dict in enumerate(dicts):
        if index == 0 and not copy_check.get('copy'):
            merged = merge_dict
        else:
            merged.update(merge_dict)
    return merged
1019084
def _clean_dict(in_dict):
    
    out = {}
    for key, value in iteritems(in_dict):
        if isinstance(value, dict):
            value = _clean_dict(value)
        if value is None:
            continue
        out[key] = value
    return out
747649
def _recursive_compare(v1, v2):
    '''
    
    '''
    if isinstance(v1, list):
        if v2 is None:
            v2 = []
        if len(v1) != len(v2):
            return False
        v1.sort(key=_id_or_key)
        v2.sort(key=_id_or_key)
        for x, y in zip(v1, v2):
            if not _recursive_compare(x, y):
                return False
        return True
    elif isinstance(v1, dict):
        if v2 is None:
            v2 = {}
        v1 = dict(v1)
        v2 = dict(v2)
        if sorted(v1) != sorted(v2):
            return False
        for k in v1:
            if not _recursive_compare(v1[k], v2[k]):
                return False
        return True
    else:
        return v1 == v2
241731
def _remove_duplicates(objects):
    
    seen = {}
    result = []
    for item in objects:
        marker = id(item)
        if marker in seen:
            continue
        seen[marker] = 1
        result.append(item)
    return result
515112
def check_validity_for_dict(keys, dict):
    
    for key in keys:
        if key not in dict or dict[key] is '' or dict[key] is None:
            return False
    return True