def __getattribute__(self, name):
        try:
            result = super(GsxElement, self).__getattribute__(name)
        except AttributeError:
            """
            The XML returned by GSX can be pretty inconsistent, especially
            between the different environments. It's therefore more
            practical to return None than to expect AttributeErrors all
            over your application.
            """
            return

        # Work around lxml chomping leading zeros off of IMEI numbers
        if name in STRING_TYPES:
            return unicode(result.text or '')

        if isinstance(result, objectify.NumberElement):
            return result.pyval

        if isinstance(result, objectify.StringElement):
            name = result.tag
            result = result.text or ''
            result = unicode(result)

            if not result:
                return

            if name in DATETIME_TYPES:
                return gsx_datetime(result)
            if name in DIAGS_TIMESTAMP_TYPES:
                return gsx_diags_timestamp(result)
            if name in BASE64_TYPES:
                return gsx_attachment(result)
            if name in FLOAT_TYPES:
                return gsx_price(result)
            if name.endswith('Date'):
                return gsx_date(result)
            if name.endswith('Timestamp'):
                return gsx_timestamp(result)
            if re.search(r'^[YN]$', result):
                return gsx_boolean(result)

        return result
dataset/ETHPy150Open filipp/py-gsxws/gsxws/objectify.py/GsxElement.__getattribute__/original