def get_list(get_fn):
  """Returns a function that retrieves a list of objects.

  Args:
    get_fn: The get function to be used for individual identifiers.

  Returns:
    A function that retrieves an object or a list of objects.
  """
  def get_list_fn(identifier):
    """Retrieves a list of objects.

    Args:
      identifier: An object identifier. Must be a string, a dictionary, an
        `ObjectConfig` or `None`.

    Returns:
      A list of Keras objects as class instances.
    """
    if isinstance(identifier, list):
      return [get_fn(ident) for ident in identifier]
    return get_fn(identifier)
  return get_list_fn