code: def hidden_cursor(self):
          
          self.stream.write(self.hide_cursor)
          try:
              yield
          finally:
              self.stream.write(self.normal_cursor)
docs: Return a context manager that hides the cursor while inside it and
          makes it visible on leaving.