<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_reserved_binding(vlan_id, switch_ip, instance_id, port_id, is_switch_binding=True, is_native=False, ch_grp=0):
 """Updates reserved binding. This overloads port bindings to support reserved Switch binding used to maintain the state of a switch so it can be viewed by all other neutron processes. There's also the case of a reserved port binding to keep switch information on a given interface. The values of these arguments is as follows: :param vlan_id: 0 :param switch_ip: ip address of the switch :param instance_id: fixed string RESERVED_NEXUS_SWITCH_DEVICE_ID_R1 :param port_id: switch-state of ACTIVE, RESTORE_S1, RESTORE_S2, INACTIVE : port-expected port_id :param ch_grp: 0 if no port-channel else non-zero integer """

    if not port_id:
        LOG.warning("update_reserved_binding called with no state")
        return
    LOG.debug("update_reserved_binding called")
    session = bc.get_writer_session()
    if is_switch_binding:
        # For reserved switch binding
        binding = _lookup_one_nexus_binding(session=session,
                                            vlan_id=vlan_id,
                                            switch_ip=switch_ip,
                                            instance_id=instance_id)
        binding.port_id = port_id
    else:
        # For reserved port binding
        binding = _lookup_one_nexus_binding(session=session,
                                            vlan_id=vlan_id,
                                            switch_ip=switch_ip,
                                            instance_id=instance_id,
                                            port_id=port_id)
    binding.is_native = is_native
    binding.channel_group = ch_grp
    session.merge(binding)
    session.flush()
    return binding