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/cpld-qsfp28/port-"+str(port_num)+"/module_present")
    except IOError as e:
        print("Error: unable to open file: %s" % str(e))
        return False
    reg_value = reg_file.readline().rstrip()
    if reg_value == '1':
        return True
    return False