human
Complete this python program:
def _spacing_preflight(func):
assistant
#Here is the Python program you requested.

    """This wrapper function is used to do some preflight checks on
    functions used for padding ANSIStrings.
    """
    def wrapped(self, width, fillchar=None):
        if (fillchar is None):
            fillchar = '    '
        if ((len(fillchar) != 1) or (not isinstance(fillchar, basestring))):
            raise TypeError(('must    be    char,    not    %s' % type(fillchar)))
        if (not isinstance(width, int)):
            raise TypeError(('integer    argument    expected,    got    %s' % type(width)))
        difference = (width - len(self))
        if (difference <= 0):
            return self
        return func(self, width, fillchar, difference)
    return wrapped