import re


def parse_prerequisites(course_description):
  """Parses prerequisites from a course description.

  Args:
    course_description: The course description text.

  Returns:
    The course prerequisite codes.
  """
  if 'Prerequisite:' not in course_description:
    return []

  parts = course_description.split('Offered:')[0].split('Prerequisite:')
  return sorted(
      set([k.strip() for k in re.findall(r'([A-Z& ]+ \d+)', parts[1])]))