def port_error_check(self, port):
    if (self.has_port and (port == None)):
        debug.error('Cannot retrieve measurement, port input was expected.', 1)
    elif ((not self.has_port) and (port != None)):
        debug.error('Unexpected port input received during measure retrieval.', 1)
def port_error_check(self, port):
    if (self.has_port and (port == None)):
        debug.error('Cannot retrieve measurement, port input was expected.', 1)
    elif ((not self.has_port) and (port != None)):
        debug.error('Unexpected port input received during measure retrieval.', 1)