input: from typing import List, Dict
  
  def sort_by_attr(objects: List[Dict], attr: str) -> List[Dict]:
      """ Takes a list of objects and returns a list of those objects sorted by one of their attributes.
      >>> sort_by_attr([{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}], "age")
      [{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}]
      >>> sort_by_attr([{"name": "Charlie", "age": 25}, {"name": "Bob", "age": 21}], "name")
      [{"name": "Bob", "age": 21}, {"name": "Charlie", "age": 25}]
      """
      return sorted(objects, key=lambda item: item[attr])
output:     return sorted(objects, key=lambda item: item[attr])