def remove_whitespace(s, right=False, left=False):
    '\n    Remove white-space characters from the given string.\n\n    If neither right nor left is specified (the default),\n    then all white-space is removed.\n\n    Parameters\n    ----------\n    s : str\n        The string to be modified.\n    right : bool\n        If True, remove white-space from the end of the string.\n    left : bool\n        If True, remove white-space from the beginning of the string.\n\n    Returns\n    -------\n    str\n        The string with white-space removed.\n    '
    if ((not left) and (not right)):
        return re.sub('\\s+', '', s, flags=re.UNICODE)
    elif (right and left):
        return re.sub('^\\s+|\\s+$', '', s, flags=re.UNICODE)
    elif right:
        return re.sub('\\s+$', '', s, flags=re.UNICODE)
    else:
        return re.sub('^\\s+', '', s, flags=re.UNICODE)
Remove white-space characters from the given string.

If neither right nor left is specified (the default),
then all white-space is removed.

Parameters
----------
s : str
    The string to be modified.
right : bool
    If True, remove white-space from the end of the string.
left : bool
    If True, remove white-space from the beginning of the string.

Returns
-------
str
    The string with white-space removed.
def remove_whitespace(s, right=False, left=False):
    '\n    Remove white-space characters from the given string.\n\n    If neither right nor left is specified (the default),\n    then all white-space is removed.\n\n    Parameters\n    ----------\n    s : str\n        The string to be modified.\n    right : bool\n        If True, remove white-space from the end of the string.\n    left : bool\n        If True, remove white-space from the beginning of the string.\n\n    Returns\n    -------\n    str\n        The string with white-space removed.\n    '
    if ((not left) and (not right)):
        return re.sub('\\s+', , s, flags=re.UNICODE)
    elif (right and left):
        return re.sub('^\\s+|\\s+$', , s, flags=re.UNICODE)
    elif right:
        return re.sub('\\s+$', , s, flags=re.UNICODE)
    else:
        return re.sub('^\\s+', , s, flags=re.UNICODE)