def get_tokens(sequences, lower=False, upper=False):
  """Returns a sorted list of all unique characters of a list of sequences.

  Args:
    sequences: An iterable of string sequences.
    lower: Whether to lower-case sequences before computing tokens.
    upper: Whether to upper-case sequences before computing tokens.

  Returns:
    A sorted list of all characters that appear in `sequences`.
  """
  if lower and upper:
    raise ValueError('lower and upper must not be specified at the same time!')
  if lower:
    sequences = [seq.lower() for seq in sequences]
  if upper:
    sequences = [seq.upper() for seq in sequences]
  return sorted(set.union(*[set(seq) for seq in sequences]))