def _stderr_filed(func):
def wrapper(self, msg, file=None):<EOL><INDENT>if file:<EOL><INDENT>return func(self, msg, file=file)<EOL><DEDENT>elif self.io_manager:<EOL><INDENT>with self.io_manager.with_stderr() as stderr:<EOL><INDENT>return func(self, msg, file=stderr)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return func(self, msg, file=sys.stderr)<EOL><DEDENT><DEDENT>wrapper.__doc__ = func.__doc__<EOL>return wrapper<EOL>
Instance method decorator to convert an optional file keyword
argument into an actual value, whether it be a passed value, a
value obtained from an io_manager, or sys.stderr.