code: def flush():
      
      try:
          sys.stdout.flush()
          sys.stderr.flush()
      except (AttributeError, ValueError, IOError):
          pass  # unsupported
      try:
          libc.fflush(None)
      except (AttributeError, ValueError, IOError):
          pass
docs: Try to flush all stdio buffers, both from python and from C.