def get_building_coords(town):
    """
    Generates a dictionary of all (x,y) co-ordinates that are within buildings
    in the town, where the keys are the buildings' numbers (or "pub" for the 
    pub) and the values are lists of co-ordinates associated with the building.
    Data must have 25 houses (numbered as multiples of 10 from 10 to 250) and
    1 pub.

    Parameters
    ----------
    town : list
        List (cols) of lists (rows) representing raster data of the town. 

    Returns
    -------
    building_coords : dict
        Keys are the buildings' numbers (or "pub" for the pub) and the values 
        are lists of all co-ordinates that are within the building.
        
    """
    #Create empty dictionary to collect building co-ordinates
    building_coords = {}
    
    # Create list of co-ordinates for each building in the town
    # Dictionary key is either "pub" or building number and value is list of 
    # coords
    for n in [1, *range(10, 260, 10)]:
        if n == 1:
            building_name = "pub"
        else:
            building_name = n
        building_coords[building_name] = []
        for y in range(len(town)):
            for x in range(len(town[y])):
                if town[y][x] == n:
                    building_coords[building_name].append((x, y))
                    
    return building_coords
    
    """
    # Make pub clearer for plotting
    for i in range(len(town)):
        for j in range(len(town[i])):
            if town[i][j] == 1:
                town[i][j] = -50
    """