code: def _utc_datetime_to_epoch(self, activity_datetime):
          
          if isinstance(activity_datetime, str):
              activity_datetime = arrow.get(activity_datetime).datetime
          assert isinstance(activity_datetime, datetime)
          if activity_datetime.tzinfo:
              activity_datetime = activity_datetime.astimezone(pytz.utc)
  
          return calendar.timegm(activity_datetime.timetuple())
docs: Convert the specified datetime value to a unix epoch timestamp (seconds since epoch).
  
          :param activity_datetime: A string which may contain tzinfo (offset) or a datetime object (naive datetime will
                                      be considered to be UTC).
          :return: Epoch timestamp.
          :rtype: int