from typing import List
from typing import Tuple


def dimensions(nodes: List) -> Tuple:
    """calculate dimensions of a set of nodes"""

    x_vals = [x.location[0] for x in nodes] + [x.location[0] + x.dimensions[0] for x in nodes]
    y_vals = [x.location[1] for x in nodes] + [x.location[1] + x.dimensions[1] for x in nodes]

    return (
        (min(x_vals), min(y_vals)),
        (max(x_vals) - min(x_vals), max(y_vals) - min(y_vals)))