def METHOD_NAME(self, port_num):
    # Check for invalid port_num
    if port_num < self.port_start or port_num > self.port_end:
        return False
    try:
        reg_file = open("/sys/class/swps/port"+str(port_num)+"/present")
    except IOError as e:
        print("Error: unable to open file: %s" % str(e))
        return False
    reg_value = int(reg_file.readline().rstrip())
    if reg_value == 0:
        return True
    return False