<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_piis(query_str):
 """Search ScienceDirect through the API for articles and return PIIs. Note that ScienceDirect has a limitation in which a maximum of 6,000 PIIs can be retrieved for a given search and therefore this call is internally broken up into multiple queries by a range of years and the results are combined. Parameters query_str : str The query string to search with Returns ------- piis : list[str] The list of PIIs identifying the papers returned by the search """

    dates = range(1960, datetime.datetime.now().year)
    all_piis = flatten([get_piis_for_date(query_str, date) for date in dates])
    return all_piis