@staticmethod
def box_string(string, min_width=(- 1), print_string=False):
    "\n        Place a string into an ASCII box.\n\n        The result is placed inside of a ASCII box consisting of '+' characters for the corners and '-' characters for the edges.\n\n        Parameters\n        ----------\n        string : str\n            String to be boxed.\n        min_width : int, optional\n            Specifies that the box be of a certain minimum width. Defaults to input string width.\n        print_string : bool, optional\n            If True, prints the string after building it. Defaults to False.\n\n        Returns\n        -------\n        str\n            Input string with a box around it.\n        "
    split_string = string.split('\n')
    height = len(split_string)
    length = max(min_width, *[len(x) for x in split_string])
    result = (('+' + ('-' * (length + 2))) + '+\n')
    for i in range(height):
        result += ('| %s |\n' % split_string[i].center(length))
    result += (('+' + ('-' * (length + 2))) + '+')
    if print_string:
        print(result)
    return result
Place a string into an ASCII box.

The result is placed inside of a ASCII box consisting of '+' characters for the corners and '-' characters for the edges.

Parameters
----------
string : str
    String to be boxed.
min_width : int, optional
    Specifies that the box be of a certain minimum width. Defaults to input string width.
print_string : bool, optional
    If True, prints the string after building it. Defaults to False.

Returns
-------
str
    Input string with a box around it.
@staticmethod
def box_string(string, min_width=(- 1), print_string=False):
    "\n        Place a string into an ASCII box.\n\n        The result is placed inside of a ASCII box consisting of '+' characters for the corners and '-' characters for the edges.\n\n        Parameters\n        ----------\n        string : str\n            String to be boxed.\n        min_width : int, optional\n            Specifies that the box be of a certain minimum width. Defaults to input string width.\n        print_string : bool, optional\n            If True, prints the string after building it. Defaults to False.\n\n        Returns\n        -------\n        str\n            Input string with a box around it.\n        "
    split_string = string.split('\n')
    height = len(split_string)
    length = max(min_width, *[len(x) for x in split_string])
    result = (('+' + ('-' * (length + 2))) + '+\n')
    for i in range(height):
        result += ('| %s |\n' % split_string[i].center(length))
    result += (('+' + ('-' * (length + 2))) + '+')
    if print_string:
        print(result)
    return result