def METHOD_NAME(self, port_num, lpmode):
    # Check for invalid port_num
    if port_num < self.SFP_PORT_START or port_num > self.SFP_PORT_END:
        return False
    sfp_lpmode_path = "/sys/devices/pci0000:00/0000:00:12.0/i2c-0/i2c-9/i2c-{0}/{0}-0066/xcvr_lpmode"\
                       .format(self.SFP_I2C_BUS_START + (port_num - self.SFP_PORT_START))
    try:
        with open(sfp_lpmode_path, 'w') as fd:
            if lpmode:
                fd.write('1')
            else:
                fd.write('0')
            return True
    except IOError as e:
        print("Error: unable to open file: %s" % str(e))
        return False
    return False