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
    path = "/sys/bus/i2c/devices/{0}-0050/sfp_is_present"
    port_ps = path.format(self._port_to_i2c_mapping[port_num])
    try:
        reg_file = open(port_ps)
    except IOError as e:
        print("Error: unable to open file: %s" % str(e))
        return False
    try:
        reg_value = reg_file.readline().rstrip()
    except IOError as e:
        time.sleep(1)
        try:
            reg_value = reg_file.readline().rstrip()
        except IOError as e:
            print("Error:try again to read file failed: %s %s" % (str(e), port_ps))
            reg_file.close()
            return False
        reg_file.close()
        if reg_value == '1':
            return True
    reg_file.close()
    if reg_value == '1':
        return True
    return False