def debug(*args, **kwargs):
    """ Just prints to stderr, unless printdebug is installed. Then it
        will be replaced in `main()` by `printdebug.debug`.
    """
    if kwargs.get('file', None) is None:
        kwargs['file'] = sys.stderr
    msg = kwargs.get('sep', ' ').join(str(a) for a in args)
    print('debug: {}'.format(msg), **kwargs)