def rename_candidate_hugo(candidate, renamings):
  """Renames a candidate name according to a renaming map."""
  name_expr = candidate.split(".")
  base_name = name_expr[0]
  if base_name in renamings:
    base_name = renamings[base_name]
  name_expr[0] = base_name
  result = ".".join(name_expr)
  return result