from typing import List


def return_overlapping_cells(currentCell, cells: List):
    """
    Determines if there is overlap between a cell of interest and a list of
    other cells. In the event that the cell of interest is entirely contained
    within one of the cells in the cells it is being compared to, an empty
    list is returned. Otherwise, the cell of interest and any overlapping
    cells are returned.
    Args:
        currentCell: A spatial feature of interest
        cells: A list of spatial features to compare to, the spatial feature
               of interest is expected to be in this list

    Returns:
        A list of spatial features including the cell of interest and all
        overlapping cells, or an empty list if the cell of intereset is
        entirely contained within one of the cells it is compared to
    """
    areas = [currentCell.intersection(x) for x in cells]
    overlapping = [cells[i] for i, x in enumerate(areas) if x > 0]
    benchmark = currentCell.intersection(currentCell)
    contained = [x for x in overlapping if
                 x.intersection(currentCell) == benchmark]
    if len(contained) > 1:
        overlapping = []
    else:
        toReturn = []
        for c in overlapping:
            if c.get_feature_id() == currentCell.get_feature_id():
                toReturn.append(c)
            else:
                if c.intersection(currentCell) != c.intersection(c):
                    toReturn.append(c)
        overlapping = toReturn

    return overlapping