def _FormatData(text, data):
  """Returns formatted text, using key/value from data dictionary"""
  for (key, value) in data.items():
    key_str = '%%(%s)s' % key
    if key_str in text:
      text = text.replace(key_str, value)

  return text