<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetNumberOfRows(self):
 """Retrieves the number of rows of the table. Returns: int: number of rows. Raises: IOError: if the file-like object has not been opened. OSError: if the file-like object has not been opened. """

    if not self._database_object:
      raise IOError('Not opened.')

    if self._number_of_rows is None:
      self._number_of_rows = self._database_object.GetNumberOfRows(
          self._table_name)

    return self._number_of_rows