Calculate forecast percentage stats.

  Args:
    matched: The number of matched impressions.
    available: The number of available impressions.
    possible: The optional number of possible impressions.

  Returns:
    The percentage of impressions that are available and possible.

def CalculateForecastStats(matched, available, possible=None):
  """Calculate forecast percentage stats.

  Args:
    matched: The number of matched impressions.
    available: The number of available impressions.
    possible: The optional number of possible impressions.

  Returns:
    The percentage of impressions that are available and possible.
  """
  if matched > 0:
    available_percent = (float(available) / matched) * 100.
  else:
    available_percent = 0

  if possible is not None:
    if matched > 0:
      possible_percent = (possible/float(matched)) * 100.
    else:
      possible_percent = 0
  else:
    possible_percent = None

  return available_percent, possible_percent