code: def serial_with_temp_timeout(serial_connection, timeout):
      '''Implements a temporary timeout for a serial connection'''
      saved_timeout = serial_connection.timeout
      if timeout is not None:
          serial_connection.timeout = timeout
      yield serial_connection
      serial_connection.timeout = saved_timeouf serial_with_temp_timeout(serial_connection, timeout):
      '''Implements a temporary timeout for a serial connection'''
      saved_timeout = serial_connection.timeout
      if timeout is not None:
          serial_connection.timeout = timeout
      yield serial_connection
      serial_connection.timeout = saved_timeout
docs: Implements a temporary timeout for a serial connection