code: def do_json_dupes_for_keys(self, params):
          try:
              Keys.validate(params.keys)
          except Keys.Bad as ex:
              self.show_output(str(ex))
              return
          path_map = PathMap(self._zk, params.path)
          dupes_by_path = defaultdict(lambda: defaultdict(list))
          for path, data in path_map.get():
              parent, child = split(path)
              if not child.startswith(params.prefix):
                  continue
              try:
                  value = Keys.value(json_deserialize(data), params.keys)
                  dupes_by_path[parent][value].append(path)
              except BadJSON as ex:
                  if params.report_errors:
                      self.show_output("Path %s has bad JSON.", path)
              except Keys.Missing as ex:
                  if params.report_errors:
                      self.show_output("Path %s is missing key %s.", path, ex)
          dupes = []
          for _, paths_by_value in dupes_by_path.items():
              for _, paths in paths_by_value.items():
                  if len(paths) > 1:
                      paths.sort()
                      paths = paths if params.first else paths[1:]
                      for path in paths:
                          idx = bisect.bisect(dupes, path)
                          dupes.insert(idx, path)
          for dup in dupes:
              self.show_output(dup)
          if len(dupes) == 0:
              return False