def get_associated_coords(cube, dimensions):
    """
    Return all coords containing any of the given dimensions.

    Return all coords, dimensional and auxiliary, that contain any of
    the given dimensions.
    """
    dims = []
    dim_set = set()
    for dim in dimensions:
        if dim not in dim_set:
            dims.append(dim)
            dim_set.add(dim)
    dim_coords = []
    for i in dims:
        coords = cube.coords(contains_dimension=i, dim_coords=True)
        if coords:
            dim_coords.append(coords[0])
    aux_coords = []
    for i in dims:
        coords = cube.coords(contains_dimension=i, dim_coords=False)
        if coords:
            aux_coords.append(coords[0])
    return dim_coords, aux_coords