def _ReplaceVariables(data, environment):
  """Replace all occurrence of the variable in data by the value.

  Args:
    data: the original data string
    environment: an iterable of (variable name, its value) pairs

  Returns:
    the data string which replaces the variables by the value.
  """
  result = data
  for (k, v) in environment:
    result = result.replace(k, v)
  return result