<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def method_repr_string(inst_str, meth_str, arg_strs=None, allow_mixed_seps=True):
 r"""Return a repr string for a method that respects line width. This function is useful to generate a ``repr`` string for a derived class that is created through a method, for instance :: functional.translated(x) as a better way of representing :: FunctionalTranslation(functional, x) Parameters inst_str : str Stringification of a class instance. meth_str : str Name of the method (not including the ``'.'``). arg_strs : sequence of str, optional Stringification of the arguments to the method. allow_mixed_seps : bool, optional If ``False`` and the argument strings do not fit on one line, use ``',\n'`` to separate all strings. By default, a mixture of ``', '`` and ``',\n'`` is used to fit as much on one line as possible. In case some of the ``arg_strs`` span multiple lines, it is usually advisable to set ``allow_mixed_seps`` to ``False`` since the result tends to be more readable that way. Returns ------- meth_repr_str : str Concatenation of all strings in a way that the line width is respected. Examples -------- MyClass.empty() MyClass.fromfile('tmpfile.txt') MyClass('init string').method(2.0) MyClass( 'long string that will definitely trigger a line break' ).method( 'long argument string that should come on the next line', param1=1, param2=2.0 ) MyClass( 'long string that will definitely trigger a line break' ).method( 'long argument string that should come on the next line', param1=1, param2=2.0 ) """

    linewidth = np.get_printoptions()['linewidth']

    # Part up to the method name
    if (len(inst_str) + 1 + len(meth_str) + 1 <= linewidth or
            '(' not in inst_str):
        init_parts = [inst_str, meth_str]
        # Length of the line to the end of the method name
        meth_line_start_len = len(inst_str) + 1 + len(meth_str)
    else:
        # TODO(kohr-h): use `maxsplit=1` kwarg, not supported in Py 2
        left, rest = inst_str.split('(', 1)
        right, middle = rest[::-1].split(')', 1)
        middle, right = middle[::-1], right[::-1]
        if middle.startswith('\n') and middle.endswith('\n'):
            # Already on multiple lines
            new_inst_str = inst_str
        else:
            new_inst_str = '(\n'.join([left, indent(middle)]) + '\n)' + right

        # Length of the line to the end of the method name, consisting of
        # ')' + '.' + <method name>
        meth_line_start_len = 1 + 1 + len(meth_str)
        init_parts = [new_inst_str, meth_str]

    # Method call part
    arg_str_oneline = ', '.join(arg_strs)
    if meth_line_start_len + 1 + len(arg_str_oneline) + 1 <= linewidth:
        meth_call_str = '(' + arg_str_oneline + ')'
    elif not arg_str_oneline:
        meth_call_str = '(\n)'
    else:
        if allow_mixed_seps:
            arg_seps = _separators(arg_strs, linewidth - 4)  # indented
        else:
            arg_seps = [',\n'] * (len(arg_strs) - 1)

        full_arg_str = ''
        for arg_str, sep in zip_longest(arg_strs, arg_seps, fillvalue=''):
            full_arg_str += arg_str + sep

        meth_call_str = '(\n' + indent(full_arg_str) + '\n)'

    return '.'.join(init_parts) + meth_call_str