input: from typing import List, Dict
  
  def sort_by_attr(objects: List[Dict[str, any]], attr: str) -> List[Dict[str, any]]:
      """ 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}]
      """
      return sorted(objects, key=lambda item: item[attr])
   
  sort_by_attr([{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}], "age")
output:     
      return sorted(objects, key=lambda item: item[attr])
  