def error(message, *args, **kwargs):
    """
    write a message to stderr

    """
    if 'end' in kwargs:
        end = kwargs['end']
    else:
        end = '\n'

    if len(args) == 0:
        sys.stderr.write(message)
    else:
        sys.stderr.write(message % args)
    sys.stderr.write(end)
    sys.stderr.flush()
write a message to stderr