def METHOD_NAME(handle, cmd, module_id):
    # Construct the port module map.
    log_port_list = get_log_ports(handle, module_id)
    if cmd == "enable":
        pwr_attr_set(handle, module_id, log_port_list,
                     SX_MGMT_PHY_MOD_PWR_ATTR_PWR_MODE_E, SX_MGMT_PHY_MOD_PWR_MODE_LOW_E)
        print("Enabled low power mode for module [%d]" % module_id)
    elif cmd == "disable":
        pwr_attr_set(handle, module_id, log_port_list,
                     SX_MGMT_PHY_MOD_PWR_ATTR_PWR_MODE_E, SX_MGMT_PHY_MOD_PWR_MODE_AUTO_E)
        print("Disabled low power mode for module [%d]" % module_id)
    else:
        print("Error: Invalid command")
        sys.exit(0)