input: 
  def sort_by_attr(objects, attr):
      """ Sort a list of objects by a specified attribute.
      >>> sort_by_attr([{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}], "age")
      [{'name': 'Alice', 'age': 20}, {'name': 'Bob', 'age': 21}]
      >>> sort_by_attr([{"name": "Eve", "age": 25}, {"name": "Charlie", "age": 19}], "name")
      [{'name': 'Charlie', 'age': 19}, {'name': 'Eve', 'age': 25}]
      """
  
output:     return sorted(objects, key=lambda x: x[attr])