code: def get_attribute(self, attribute):
          
  
          # Check that the attribute exists.
          try:
              attr = attributes.AttributesByID[attribute]
          except KeyError:
              return 0, constants.StatusCode.error_nonsupported_attribute
  
          # Check that the attribute is valid for this session type.
          if not attr.in_resource(self.session_type):
              return 0, constants.StatusCode.error_nonsupported_attribute
  
          # Check that the attribute is readable.
          if not attr.read:
              raise Exception('Do not now how to handle write only attributes.')
  
          # Return the current value of the default according the VISA spec
          return self.attrs.setdefault(attribute, attr.default), constants.StatusCode.success
docs: Get an attribute from the session.
  
          :param attribute:
          :return: attribute value, status code
          :rtype: object, constants.StatusCode