def remove_subparameter_widget(self, widget):
        """Remove existing widget from a subparameter.

        Parameters
        ==========
        widget (widget instance)
            reference to widget instance to be removed.
        """
        ### discover the parameter and subparameter index
        ### of the widget to be removed; once you break
        ### out of the for loops, the right names will
        ### be bound to the param_name and subparam_index
        ### variables;

        ## retrieve the parameter name and the data for
        ## widgets in its subparameters

        for param_name in self.var_kind_map:

            # retrieve subparam widgets data (a map which associates
            # the index of a subparam with its widget)
            subparam_widgets_data = self.widget_live_flmap[param_name]

            # retrieve subparameter index and its value,
            # which is a widget instance

            for subparam_index, widget_instance in subparam_widgets_data.items():

                # if the widget to be removed is the
                # widget instance, we can break out of
                # this inner "for" loop
                if widget is widget_instance:
                    break

            # if we didn't break out of the inner "for"
            # loop, this "else" clause will execute,
            # making us start again with the next item
            # in the outer "for" loop
            else:
                continue

            # otherwise, if we broke out from the inner
            # "for" loop, it means the parameter name
            # and subparameter indices stored are the ones
            # we are looking for: we can finally break
            # out of the outer "for" loop
            break

        ### alias live instances maps using variables of
        ### low character count, for better code layout

        wl_flmap = self.widget_live_flmap
        wrb_flmap = self.widget_remove_button_flmap

        ### remove widget from widget map
        widget = wl_flmap[param_name].pop(subparam_index)

        ## this dict subclass instance needs to be updated
        ## every time it is changed
        wl_flmap.update()

        ### remove the "remove widget" button
        button = wrb_flmap[param_name].pop(subparam_index)

        ## this dict subclass instance needs to be updated
        ## every time it is changed
        wrb_flmap.update()

        ### remove the widget data from the subwidgets data
        ### map for this parameter
        self.data["subparam_widget_map"][param_name].pop(subparam_index)

        ### reference the list of subparameters for
        ### unpacking locally for easier access
        subparams_for_unpacking = self.data["subparam_unpacking_map"][param_name]

        ### perform operations assuming the input socket doesn't have
        ### a source of data anymore, that is, remove the input socket
        ### and perform needed admin tasks

        ## remove input socket from live map
        self.input_socket_live_flmap[param_name].pop(subparam_index)

        # this dict subclass instance must be updated
        # whenever it changes
        self.input_socket_live_flmap.update()

        ## remove the subparam index from the list
        ## in the subparam map
        self.data["subparam_map"][param_name].remove(subparam_index)

        ## remove "move subparam" buttons
        self.subparam_up_button_flmap[param_name].pop(subparam_index)

        # this dict subclass instance must be updated
        # whenever it changes
        self.subparam_up_button_flmap.update()

        self.subparam_down_button_flmap[param_name].pop(subparam_index)

        # this dict subclass instance must be updated
        # whenever it changes
        self.subparam_down_button_flmap.update()

        ## since the input socket was removed...

        ## if the subparameter was marked to be
        ## unpacked, remove the unpacking icon from
        ## the respective map and the subparameter
        ## index from the respective list as well

        if subparam_index in subparams_for_unpacking:

            ## remove unpacking icon
            self.subparam_unpacking_icon_flmap[param_name].pop(subparam_index)

            # this special dict subclass instance must
            # be updated whenever it is changed
            self.subparam_unpacking_icon_flmap.update()

            ## remove subparameter index from list
            ## within the subparameter unpacking map
            self.data["subparam_unpacking_map"][param_name].remove(subparam_index)

        ## else if the parameter is of keyword-variable
        ## kind remove the keyword entry from the
        ## respective map and the keyword from the
        ## respective map as well

        elif self.var_kind_map[param_name] == "var_key":

            ## remove keyword entry widget
            self.subparam_keyword_entry_live_map.pop(subparam_index)

            ## remove keyword name from subparameter
            ## keyword map
            self.data["subparam_keyword_map"].pop(subparam_index)

        ## remove the subparameter rectsman from the
        ## subparameter rectsman map
        self.subparam_rectsman_map[param_name].pop(subparam_index)

        ## fix names of remaining subparameters
        self.fix_subparameter_indices(param_name)

        ### reposition all objects within the node
        self.reposition_elements()

        ### reset body's height and image
        self.reset_body_height_and_image()

        ### indicate that changes were made in the data
        indicate_unsaved()

        ### indicate birdseye view state of window manager must
        ### have its objects updated next time it is set
        APP_REFS.ea.must_update_birdseye_view_objects = True
Remove existing widget from a subparameter.

        Parameters
        ==========
        widget (widget instance)
            reference to widget instance to be removed.
        
nodezator/graphman/callablenode/subparam/widget.py