def inplace_return_series(dataframe, column, series,
                          inplace, return_series, target_column=None):
    """
    helper function to reuse throughout library. It applies logic for
    performing inplace series transformations and returning copies of
    modified series

    :param dataframe: pandas.DataFrame for which we are modifying series
    :param column: str name of target column for our series
    :param series: pandas.Series
    :param inplace: bool whether we wish to overwrite existing column
        with series
    :param return_series: bool whether we wish to return a copy of the
        pandas.Series object
    :return: pandas.Series
    """
    if inplace:
        dataframe[target_column if target_column else column] = series
    if return_series:
        return series