def _wrap_section(source, width):
    # type: (str, int) -> str
    """Wrap the given section string to the current terminal size.

    Intelligently wraps the section string to the given width. When wrapping
    section lines, it auto-adjusts the spacing between terms and definitions.
    It also adjusts commands the fit the correct length for the arguments.

    Args:
        source: The section string to wrap.

    Returns:
        The wrapped section string.
    """
    if _get_section('usage', source):
        return _wrap_usage_section(source, width)
    if _is_definition_section(source):
        return _wrap_definition_section(source, width)
    lines = inspect.cleandoc(source).splitlines()
    paragraphs = (textwrap.wrap(line, width, replace_whitespace=False)
                  for line in lines)
    return '\n'.join(line for paragraph in paragraphs for line in paragraph)
def _wrap_section ( source , width ) : if _get_section ( 'usage' , source ) : return _wrap_usage_section ( source , width ) if _is_definition_section ( source ) : return _wrap_definition_section ( source , width ) lines = inspect . cleandoc ( source ) . splitlines ( ) paragraphs = ( textwrap . wrap ( line , width , replace_whitespace = False ) for line in lines ) return '\n' . join ( line for paragraph in paragraphs for line in paragraph )
Wrap the given section string to the current terminal size.

    Intelligently wraps the section string to the given width. When wrapping
    section lines, it auto-adjusts the spacing between terms and definitions.
    It also adjusts commands the fit the correct length for the arguments.

    Args:
        source: The section string to wrap.

    Returns:
        The wrapped section string.