def calculate_intrusion_aware_edge(img_shape, intrusion_ratio):
    """Calculate top and bottom edges of intrusion aware areas"""
    height = img_shape[0]
    if isinstance(intrusion_ratio, list):
        return (int(height * intrusion_ratio[0]), int(height - height * intrusion_ratio[1]))
    return (int(height * intrusion_ratio), int(height - height * intrusion_ratio))