def METHOD_NAME(df: pd.DataFrame, labels_series: pd.Series, category_id: int,
                             labeled_status: LabeledStatus, label_types: Set[LabelType] = None):
    """
    :param df:
    :param labels_series: series of the label dictionary corresponding to each element in the dataframe
    :param category_id:
    :param labeled_status: unlabeled, labeled or all
    :param label_types: set of applicable label types if filtering for labeled elements (LabelStatus.LABELED)
    :return:
    """
    if labeled_status in [LabeledStatus.UNLABELED, LabeledStatus.ALL] and label_types is not None:
        raise Exception(f"Label type is inapplicable when fetching {labeled_status} elements")
    if labeled_status == LabeledStatus.LABELED and label_types is None:
        raise Exception(f"label_types must be provided when filtering labeled elements")
    if labeled_status == LabeledStatus.UNLABELED:
        return df[labels_series.apply(lambda x: category_id not in x)]
    elif labeled_status == LabeledStatus.LABELED:
        return df[labels_series.apply(lambda x: category_id in x and x[category_id].label_type in label_types)]
    return df