def _resourceOverlap(self, res1_start_time, res1_end_time, res2_start_time, res2_end_time):
        # resource temporal availability

        # hack on
        # instead of doing a lot of complicated branching for None checking, we just coalesce the values into something easier

        now = datetime.datetime.utcnow()
        forever = datetime.datetime(9999, 1, 1)

        r1s = res1_start_time or now
        r2s = res2_start_time or now
        r1e = res1_end_time or forever
        r2e = res2_end_time or forever

        assert r1s < r1e, 'Cannot detect overlap for backwards reservation (1)'
        assert r2s < r2e, 'Cannot detect overlap for backwards reservation (2)'

        if r2e < r1s:
            return False # res2 ends before res1 starts so it is ok
        if r2s > r1e:
            return False # res2 starts after res1 ends so it is ok

        # resources overlap in time
        return True
dataset/ETHPy150Open NORDUnet/opennsa/opennsa/backends/common/calendar.py/ReservationCalendar._resourceOverlap/original