def extractor(data, cell_type, conditions, cell_type_key='cell_type',
    condition_key='condition'):
    """
        Returns a list of `data` files while filtering for a specific `cell_type`.

        # Parameters
        data: `~anndata.AnnData`
            Annotated data matrix
        cell_type: basestring
            specific cell type to be extracted from `data`.
        conditions: dict
            dictionary of stimulated/control of `data`.

        # Returns
            list of `data` files while filtering for a specific `cell_type`.

        # Example
        ```python
        import scgen
        import anndata
        train_data = anndata.read("./data/train.h5ad")
        test_data = anndata.read("./data/test.h5ad")
        train_data_extracted_list = extractor(train_data, "CD4T", conditions={"ctrl": "control", "stim": "stimulated"})
        ```

    """
    cell_with_both_condition = data[data.obs[cell_type_key] == cell_type]
    condtion_1 = data[(data.obs[cell_type_key] == cell_type) & (data.obs[
        condition_key] == conditions['ctrl'])]
    condtion_2 = data[(data.obs[cell_type_key] == cell_type) & (data.obs[
        condition_key] == conditions['stim'])]
    training = data[~((data.obs[cell_type_key] == cell_type) & (data.obs[
        condition_key] == conditions['stim']))]
    return [training, condtion_1, condtion_2, cell_with_both_condition]
