def fromPython(cls, python_datetime):

        ''' a method for constructing a labDT from a python datetime with timezone info
        
        :param python_datetime: datetime object with timezone info
        :return: labDT object
        '''

    # validate inputs
        title = 'Python datetime input for labDT.fromPython'
        if not isinstance(python_datetime, datetime):
            raise TypeError('\n%s must be a valid %s object.' % (title, datetime.__class__))
        elif not python_datetime.tzinfo:
            raise ValueError('\n%s must have a timezone.' % title)

    # construct labDT from python datetime
        dT = python_datetime.astimezone(pytz.utc)
        dt_kwargs = {
            'year': dT.year,
            'month': dT.month,
            'day': dT.day,
            'hour': dT.hour,
            'minute': dT.minute,
            'second': dT.second,
            'microsecond': dT.microsecond,
            'tzinfo': dT.tzinfo
        }
        return labDT(**dt_kwargs)
def fromPython ( cls , python_datetime ) : title = 'Python datetime input for labDT.fromPython' if not isinstance ( python_datetime , datetime ) : raise TypeError ( '\n%s must be a valid %s object.' % ( title , datetime . __class__ ) ) elif not python_datetime . tzinfo : raise ValueError ( '\n%s must have a timezone.' % title ) dT = python_datetime . astimezone ( pytz . utc ) dt_kwargs = { 'year' : dT . year , 'month' : dT . month , 'day' : dT . day , 'hour' : dT . hour , 'minute' : dT . minute , 'second' : dT . second , 'microsecond' : dT . microsecond , 'tzinfo' : dT . tzinfo } return labDT ( ** dt_kwargs )
a method for constructing a labDT from a python datetime with timezone info
        
        :param python_datetime: datetime object with timezone info
        :return: labDT object