input: 
  from typing import List, Any
  
  def sort_by_attr(objects: List[Any], attr: str) -> List[Any]:
      """
      Sorts a list of objects by a specified attribute of the objects.
      
      >>> sort_by_attr([{"name": "Alice", "age": 20}, {"name": "Bob", "age": 21}], "age")
      [{'name': 'Alice', 'age': 20}, {'name': 'Bob', 'age': 21}]
      
      >>> sort_by_attr([{"name": "Alice", "age": 21}, {"name": "Bob", "age": 20}], "name")
      [{'name': 'Alice', 'age': 21}, {'name': 'Bob', 'age': 20}]
      """
      return sorted(objects, key=lambda item: item[attr])
  
output:     return sorted(objects, key=lambda item: item[attr])