title: How to check if user was available in a particular interval? I have to check users busy time and available online in a particular interval?
body: <p>This is my sample dataframe: Here U1 was online from 9:45 to 15:00 PM and then from 22:00 PM to 23:45, and same is with U2.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>user</th>
  <th>Status</th>
  <th>Flag</th>
  <th>Timestamp</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>U1</td>
  <td>0</td>
  <td>Offline</td>
  <td>09:30</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>1</td>
  <td>Online</td>
  <td>09:45</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>0</td>
  <td>Offline</td>
  <td>15:00</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>0</td>
  <td>Offline</td>
  <td>16:00</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>0</td>
  <td>Offline</td>
  <td>00:00</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>1</td>
  <td>Online</td>
  <td>22:00</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>0</td>
  <td>Offline</td>
  <td>23:45</td>
  </tr>
  <tr>
  <td>U2</td>
  <td>0</td>
  <td>Offline</td>
  <td>09:30</td>
  </tr>
  <tr>
  <td>U2</td>
  <td>1</td>
  <td>Online</td>
  <td>09:45</td>
  </tr>
  <tr>
  <td>U2</td>
  <td>0</td>
  <td>Offline</td>
  <td>15:00</td>
  </tr>
  <tr>
  <td>U2</td>
  <td>0</td>
  <td>Offline</td>
  <td>16:00</td>
  </tr>
  <tr>
  <td>U2</td>
  <td>0</td>
  <td>Offline</td>
  <td>00:00</td>
  </tr>
  <tr>
  <td>U2</td>
  <td>1</td>
  <td>Online</td>
  <td>22:00</td>
  </tr>
  <tr>
  <td>U2</td>
  <td>0</td>
  <td>Offline</td>
  <td>23:45</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Expected output for each user:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>User</th>
  <th>TimeInterval</th>
  <th>Online/Offline</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>U1</td>
  <td>00:00-00:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>00:31-01:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>01:00-01:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>01:31-02:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>02:00-02:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>02:31-03:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>03:00-03:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>03:31-04:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>04:00-04:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>04:31-05:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>05:00-05:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>05:31-06:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>06:00-06:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>06:31-07:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>07:00-07:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>07:31-08:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>08:00-08:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>08:31-09:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>09:00-09:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>09:31-10:00</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>10:00-10:30</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>10:31-11:00</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>11:00-11:30</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>11:31-12:00</td>
  <td>online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>12:00-12:30</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>12:31-13:00</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>13:00-13:30</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>13:31-14:00</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>14:00-14:30</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>14:31-15:00</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>15:00-15:30</td>
  <td>Offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>15:31-16:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>16:00-16:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>16:31-17:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>17:00-17:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>17:31-18:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>18:00-18:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>18:31-19:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>19:00-19:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>19:31-20:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>20:00-20:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>20:31-21:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>21:00-21:30</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>21:31-22:00</td>
  <td>offline</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>22:00-22:30</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>22:31-23:00</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>23:00-23:30</td>
  <td>Online</td>
  </tr>
  <tr>
  <td>U1</td>
  <td>23:31-00:00</td>
  <td>Online</td>
  </tr>
  </tbody>
  </table>
  </div>