def insert_node(
        self,
        node_hint,
        absolute_midtop=None,
        commented_out_state=False,
    ):
        """Trigger node insertion on graph manager.

        Parameters
        ==========

        node_hint

            dict instance
            or graphman.callablenode.main.CallableNode
            or graphman.proxynode.main.ProxyNode
            or None


            if it is a dict, it can be a callable node or
            a proxy node; if it is None we instantiate
            a proxy node without additional data

            if it is a node instance, then naturally no
            instantiation is needed, we just reinsert it
            in the node layout.

        absolute_midtop (2-tuple or None)
            if not None, it is used as the relative midtop
            position of the node being inserted. This
            parameter is relevant only if the node hint
            isn't a node instance.

        commented_out_state (bool)
            the "commented out" state of the node. This
            parameter is relevant only if the node hint
            isn't a node instance.
        """
        ### assess which kind of argument was received in
        ### the node_hint parameter

        ## if we have a node instance, we just insert it

        if isinstance(
            node_hint,
            (CallableNode, OperatorNode, ProxyNode),
        ):

            APP_REFS.gm.insert_node(node=node_hint)

        ### otherwise...

        else:

            ## get new id for the node
            new_id = get_new_node_id()

            ## get absolute midtop coordinates
            ## according to whether it was provided
            ## via argument or not

            absolute_midtop = (
                absolute_midtop if absolute_midtop is not None else self.popup_spawn_pos
            )

            ## the relative midtop is obtained by
            ## taking into account the effect of the
            ## scrolling

            relative_midtop = tuple(absolute_midtop - self.scrolling_amount)

            ## if we have a string, we create an operator
            ## node

            if isinstance(node_hint, str):

                ## gather data in a dict which will be fed
                ## to the node constructor

                node_data = {
                    "id": new_id,
                    "midtop": relative_midtop,
                    "commented_out": commented_out_state,
                }

                for cls, key in (
                    (OperatorNode, "operation_id"),
                    (BuiltinNode, "builtin_id"),
                    (StandardLibNode, "stlib_id"),
                    (ThirdLibNode, "thirdlib_id"),
                    (CapsuleNode, "capsule_id"),
                    (GeneralViewerNode, "genviewer_id"),
                ):

                    if node_hint in cls.available_ids:

                        node_data[key] = node_hint

                        ## create the node, adding its
                        ## data to the file

                        APP_REFS.gm.create_node(
                            cls,
                            data=node_data,
                            midtop=absolute_midtop,
                        )

            ## if we have a dict...

            elif isinstance(node_hint, dict):

                if "signature_callable" in node_hint:

                    ## gather data in a dict which will be
                    ## fed to the node constructor

                    node_data = {
                        "id": new_id,
                        "midtop": relative_midtop,
                        "commented_out": commented_out_state,
                    }

                    ## try creating the node, adding its data to
                    ## the file

                    try:
                        APP_REFS.gm.create_callable_node(
                            node_defining_object=(node_hint),
                            data=node_data,
                            midtop=(absolute_midtop),
                        )

                    except Exception as err:

                        ## log traceback in regular
                        ## log and and user log

                        msg = (
                            "An unexpected error ocurred while trying to"
                            " instantiate the node."
                        )

                        logger.exception(msg)
                        USER_LOGGER.exception(msg)

                        ## notify user via dialog

                        dialog_msg = msg + (
                            " Check the user log for details. (press"
                            " <Ctrl+Shift+j> after leaving this dialog"
                            " or access the \"Help > Show user log\" option"
                            " on menubar)."
                        )

                        create_and_show_dialog(dialog_msg, level_name='error')

                        ## leave the method
                        return

                else:

                    widget_data = deepcopy(node_hint)

                    ## gather data in a dict which will be
                    ## fed to the node constructor

                    node_data = {
                        "id": new_id,
                        "midtop": relative_midtop,
                        "commented_out": commented_out_state,
                        "widget_data": widget_data,
                    }

                    ## create the node, adding its data to the
                    ## file

                    APP_REFS.gm.create_proxy_node(
                        data=node_data,
                        midtop=absolute_midtop,
                    )

            ## if node_hint argument is none, we also
            ## create a proxy node
            elif node_hint is None:

                ## gather data in a dict which will be fed to
                ## the node constructor

                node_data = {
                    "id": new_id,
                    "midtop": relative_midtop,
                    "commented_out": commented_out_state,
                }

                ## create the node, adding its data to the
                ## file

                APP_REFS.gm.create_proxy_node(
                    data=node_data,
                    midtop=absolute_midtop,
                )

        ### indicate the data was changed
        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
Trigger node insertion on graph manager.

        Parameters
        ==========

        node_hint

            dict instance
            or graphman.callablenode.main.CallableNode
            or graphman.proxynode.main.ProxyNode
            or None


            if it is a dict, it can be a callable node or
            a proxy node; if it is None we instantiate
            a proxy node without additional data

            if it is a node instance, then naturally no
            instantiation is needed, we just reinsert it
            in the node layout.

        absolute_midtop (2-tuple or None)
            if not None, it is used as the relative midtop
            position of the node being inserted. This
            parameter is relevant only if the node hint
            isn't a node instance.

        commented_out_state (bool)
            the "commented out" state of the node. This
            parameter is relevant only if the node hint
            isn't a node instance.
        
nodezator/editing/objinsert.py