def inspect_container(container, args):
    """
    Return inspection data for the given container.

    Includes backward-compatibility for the State.Status field.
    """

    inspect_data = args.client.inspect_container(container["Id"])
    if "Status" not in inspect_data["State"]:
        # pre-1.21 API: synthesize Status from other State fields
        inspect_data["State"]["Status"] = (
            "restarting" if inspect_data["State"]["Restarting"] else
            "running" if inspect_data["State"]["Running"] else
            "paused" if inspect_data["State"]["Paused"] else
            "dead" if inspect_data["State"].get("Dead", False) else
            "exited" if (not inspect_data["State"]["Pid"]
                         and inspect_data["State"]["StartedAt"] >= inspect_data["Created"]) else
            "created"
        )
    return inspect_data