import copy


def merge_normalized_sequence_analyzers(sequence_analyzers):
  """Merges SequenceAnalyzers and returns the result

  SequenceAnalyzers copied and normalized setting their individual total
  frequency to one. The sum of all normalized SequenceAnalyzers is then
  returned.

  Args:
    sequence_analyzers: List of SequenceAnalyzers to merge.

  Returns:
    The resulting normalized merge of the SequenceAnalyzers.
  """

  # copy input to avoid mutation
  sas_copy = [copy.deepcopy(sa) for sa in sequence_analyzers]

  # normalize sequences analyzers
  for sa in sas_copy:
    sa.total_freq = 1

  # add all sequences analyzers to the first
  for sa in sas_copy[1:]:
    sas_copy[0] += sa
  return sas_copy[0]