def TransformExtract(r, *keys):
  """Extract an ordered list of values from the resource for the specified keys.

  Args:
    r: A JSON-serializable object.
    *keys: The list of keys in the resource whose associated values will be
        included in the result.

  Returns:
    The list of extracted values.
  """
  try:
    return [r[k] for k in keys if k in r]
  except TypeError:
    return []