import re


def parse_events(events):
  """Parse events.

  Args:
    events: List of events.

  Returns
    pods_created: Set of unique pod names created.
    services_created: Set of unique services created.
  """
  pattern = re.compile(".*Created.*(pod|Service).*: (.*)", re.IGNORECASE)

  pods = set()
  services = set()
  for e in events:
    m = re.match(pattern, e.message)
    if not m:
      continue

    kind = m.group(1)
    name = m.group(2)

    if kind.lower() == "pod":
      pods.add(name)
    elif kind.lower() == "service":
      services.add(name)

  return pods, services