<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def world_info(world_name, world_config=None, initial_indent="", next_indent=" "):
 """Gets and prints the information of a world. Args: world_name (str):
 the name of the world to retrieve information for world_config (dict optional):
 A dictionary containing the world's configuration. Will find the config if None. Defaults to None. initial_indent (str optional):
 This indent will apply to each output line. Defaults to "". next_indent (str optional):
 This indent will be applied within each nested line. Defaults to " ". """

    if world_config is None:
        for config, _ in _iter_packages():
            for world in config["maps"]:
                if world["name"] == world_name:
                    world_config = world

    if world_config is None:
        raise HolodeckException("Couldn't find world " + world_name)

    second_indent = initial_indent + next_indent
    agent_indent = second_indent + next_indent
    sensor_indent = agent_indent + next_indent

    print(initial_indent, world_config["name"])
    print(second_indent, "Resolution:", world_config["window_width"], "x", world_config["window_height"])
    print(second_indent, "Agents:")
    for agent in world_config["agents"]:
        print(agent_indent, "Name:", agent["agent_name"])
        print(agent_indent, "Type:", agent["agent_type"])
        print(agent_indent, "Sensors:")
        for sensor in agent["sensors"]:
            print(sensor_indent, sensor)