<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 BioVida
Step1:  Let's also get some data from the Cancer Imaging Archive.
Step3:  Next, we can import the tool we will be using to unify the data
Step4:  To close out this section, we can take a quick look at the resultant DataFrame.
Step5:  Note
Step6:  Next, we simply define a which will inform image_delete of which rows to delete.
Step7:  In this example, we'll use the instance of OpeniInterface created above.
<ASSISTANT_TASK:>
Python Code:
from biovida.images import OpeniInterface
opi = OpeniInterface()
opi.search(query='lung cancer')
pull_df1 = opi.pull()
Explanation: BioVida: Domain Unification and Data Management
This tutorial will cover the facilities BioVida offers to:
integrate images data against other kinds of biomedical data
manage cached resources.
Domain  Unification
While primarily focused on image data, BioVida also contains interfaces to allow you to easily gain access to other biomedical data types. Namely, medical diagnostics and genomics data. This section will show how one, or several, image interfaces can be unified into a single DataFrame, complete with data from these additional sources.
We can start by collecting some data.
End of explanation
from biovida.images import CancerImageInterface
cii = CancerImageInterface(api_key=YOUR_API_KEY_HERE)
cii.search(cancer_type='lung')
pull_df2 = cii.pull(collections_limit=1)  # only download the first collection/study
Explanation: Let's also get some data from the Cancer Imaging Archive.
End of explanation
from biovida.unification import unify_against_images
unified_df = unify_against_images(instances=[opi, cii])
import numpy as np
def simplify_df(df):
    This function simplifies dataframes
    for the purposes of this tutorial.
    data_frame = df.copy()
    for c in ('source_images_path', 'cached_images_path'):
        data_frame[c] = 'path_to_image'
    return data_frame.replace({np.NaN: ''})
Explanation: Next, we can import the tool we will be using to unify the data
End of explanation
simplify_df(unified_df)[85:90]
Explanation: To close out this section, we can take a quick look at the resultant DataFrame.
End of explanation
from biovida.images import image_delete
Explanation: Note: the 'mentioned_symptoms' column provides a list of symptoms known to be associated with the disease which were mentioned in the article.
Data Management
This section is intended to provide a brief overview of the ways in which data downloaded with BioVida can be removed from your computer. 
1. The simplest way to delete BioVida data is to manually delete the biovida_cache folder, or some portion of files (e.g., images) contained within in. Both OpeniInterfaces and CancerImageInterface check for deleted files each time they are instantiated. <br>
2. While the first approach is straightforward, it is neither elegant nor precise. For situations that require more finesse, we can employ the image_delete tool.
End of explanation
def my_delete_rule(row):
    if isinstance(row['abstract'], str) and 'proteins' in row['abstract'].lower():
        return True
Explanation: Next, we simply define a which will inform image_delete of which rows to delete.
End of explanation
deleted_rows = image_delete(opi, delete_rule=my_delete_rule, only_recent=True)
Explanation: In this example, we'll use the instance of OpeniInterface created above.
End of explanation
<END_TASK>