def strip(text, chars=None):
    """
    Creates a copy of ``text`` with the leading and trailing characters removed. 
    
    The ``chars`` argument is a string specifying the set of characters to be removed. 
    If omitted or None, the ``chars`` argument defaults to removing whitespace. The ``chars`` 
    argument is not a prefix or suffix; rather, all combinations of its values are stripped::
        
        >>>
        >>> strip('   spacious   ')
        'spacious'
        >>> strip('www.example.com','cmowz.')
        'example'
    
    The outermost leading and trailing ``chars`` argument values are stripped from the string.
    Characters are removed from the leading end until reaching a string character that 
    is not contained in the set of characters in chars. A similar action takes place on 
    the trailing end. For example::
        
        >>>
        >>> comment_string = '#....... Section 3.2.1 Issue #32 .......'
        >>> strip(comment_string,'.#! ')
        'Section 3.2.1 Issue #32'
    
    :param text: The string to copy
    :type text:  ``str``
    
    :param chars: The characters to remove from the ends
    :type chars:  ``str``
    
    :return: A copy of ``text`` with the leading and trailing characters removed.
    :rtype:  ``str``
    """
    assert isinstance(text,str), '%s is not a string' % text
    return text.strip(chars)