from typing import List
from typing import Dict


def seq_hist(seq_lens: List[int]) -> Dict[int, int]:
  """Returns a dict of sequence_length/count key/val pairs.

  For each entry in the list of sequence lengths, tabulates
  the frequency of appearance in the list and returns the
  data as a dict.  Useful for histogram operations on sequence
  length.
  """
  seq_count = {}
  for slen in seq_lens:
    if slen in seq_count:
      seq_count[slen] += 1
    else:
      seq_count[slen] = 1

  return seq_count