def extract_input_lines(self, range_str, raw=False):
    'Return as a string a set of input history slices.\n\n        Parameters\n        ----------\n        range_str : str\n            The set of slices is given as a string, like "~5/6-~4/2 4:8 9",\n            since this function is for use by magic functions which get their\n            arguments as strings. The number before the / is the session\n            number: ~n goes n back from the current session.\n\n            If empty string is given, returns history of current session\n            without the last input.\n\n        raw : bool, optional\n            By default, the processed input is used.  If this is true, the raw\n            input history is used instead.\n\n        Notes\n        -----\n        Slices can be described with two notations:\n\n        * ``N:M`` -> standard python form, means including items N...(M-1).\n        * ``N-M`` -> include items N..M (closed endpoint).\n        '
    lines = self.history_manager.get_range_by_str(range_str, raw=raw)
    text = '\n'.join((x for (_, _, x) in lines))
    if (not range_str):
        if ('\n' not in text):
            text = ''
        else:
            text = text[:text.rfind('\n')]
    return text
Return as a string a set of input history slices.

Parameters
----------
range_str : str
    The set of slices is given as a string, like "~5/6-~4/2 4:8 9",
    since this function is for use by magic functions which get their
    arguments as strings. The number before the / is the session
    number: ~n goes n back from the current session.

    If empty string is given, returns history of current session
    without the last input.

raw : bool, optional
    By default, the processed input is used.  If this is true, the raw
    input history is used instead.

Notes
-----
Slices can be described with two notations:

* ``N:M`` -> standard python form, means including items N...(M-1).
* ``N-M`` -> include items N..M (closed endpoint).
def extract_input_lines(self, range_str, raw=False):
    'Return as a string a set of input history slices.\n\n        Parameters\n        ----------\n        range_str : str\n            The set of slices is given as a string, like "~5/6-~4/2 4:8 9",\n            since this function is for use by magic functions which get their\n            arguments as strings. The number before the / is the session\n            number: ~n goes n back from the current session.\n\n            If empty string is given, returns history of current session\n            without the last input.\n\n        raw : bool, optional\n            By default, the processed input is used.  If this is true, the raw\n            input history is used instead.\n\n        Notes\n        -----\n        Slices can be described with two notations:\n\n        * ``N:M`` -> standard python form, means including items N...(M-1).\n        * ``N-M`` -> include items N..M (closed endpoint).\n        '
    lines = self.history_manager.get_range_by_str(range_str, raw=raw)
    text = '\n'.join((x for (_, _, x) in lines))
    if (not range_str):
        if ('\n' not in text):
            text = 
        else:
            text = text[:text.rfind('\n')]
    return text