<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def or_by_masks(df, masks):
 """Returns a sub-dataframe by the logical or over the given masks. Parameters df : pandas.DataFrame The dataframe to take a subframe of. masks : list A list of pandas.Series of dtype bool, indexed identically to the given dataframe. Returns ------- pandas.DataFrame The sub-dataframe resulting from applying the masks to the dataframe. Example ------- Age Name 2 19 Mi 3 15 Di """

    if len(masks) < 1:
        return df
    if len(masks) == 1:
        return df[masks[0]]
    overall_mask = masks[0] | masks[1]
    for mask in masks[2:]:
        overall_mask = overall_mask | mask
    return df[overall_mask]