code: def _remove_keys_from_dict_with_nonunique_values(self, d, log_fh=None, log_outprefix=None):
          '''Returns a new dictionary, with keys from input dict removed if their value was not unique'''
          value_counts = collections.Counter(d.values())
          new_d = {}
          writing_log_file = None not in [log_fh, log_outprefix]
  
          for key in d:
              if value_counts[d[key]] == 1:
                  new_d[key] = d[key]
              elif writing_log_file:
                  print(log_outprefix, 'Reject because non-unique:', d[key], sep='\t', file=log_fh)
  
          return new_f _remove_keys_from_dict_with_nonunique_values(self, d, log_fh=None, log_outprefix=None):
          '''Returns a new dictionary, with keys from input dict removed if their value was not unique'''
          value_counts = collections.Counter(d.values())
          new_d = {}
          writing_log_file = None not in [log_fh, log_outprefix]
  
          for key in d:
              if value_counts[d[key]] == 1:
                  new_d[key] = d[key]
              elif writing_log_file:
                  print(log_outprefix, 'Reject because non-unique:', d[key], sep='\t', file=log_fh)
  
          return new_d
docs: Returns a new dictionary, with keys from input dict removed if their value was not unique