def perform_pre_execution_setups(self):
        """If unpack data received in subparameters if requested."""

        ### reference and alias argument map locally for quicker
        ### and easier access
        arg_map = self.argument_map

        ### iterate over the name of each variable parameter, performing
        ### setups according to their kind

        for param_name, kind in self.var_kind_map.items():

            ## retrieve subparam value map
            subparam_value_map = arg_map[param_name]

            ## if we have a variable parameter of positional kind...

            if kind == 'var_pos':

                # retrieve the list of subparameters that must
                # be unpacked
                subparams_for_unpacking = (
                    self.data['subparam_unpacking_map'][param_name]
                )

                # retrieve the values of each subparameter in the
                # order defined by the subparameter indices
                # building a list with the values

                param_args = []

                for index in sorted(subparam_value_map):

                    if index in subparams_for_unpacking:

                        try:
                            param_args.extend(subparam_value_map[index])

                        except Exception as err:

                            raise PositionalSubparameterUnpackingError(
                                self,
                                param_name,
                                index,
                            ) from err

                    else:
                        param_args.append(subparam_value_map[index])

                # replace the parameter data in the argument map
                # by the list we populated
                arg_map[param_name] = param_args

            ## if otherwise we have a variable parameter of the keyword kind...

            elif kind == 'var_key':

                # retrieve map containing name of keyword for each
                # subparameter
                subparam_keywords = self.data['subparam_keyword_map']

                # now build a new dictionary with the sorted keys
                # from the subparam value map and its values

                param_args = {}

                for index in sorted(subparam_value_map):

                    value = subparam_value_map.pop(index)

                    if index in subparam_keywords:
                        param_args[subparam_keywords[index]] = value

                    else:

                        # note that we use '.update(**value)'
                        # instead of '.update(value)'; this is
                        # so because '.update(value)' would be
                        # more lenient than the '**', and thus
                        # not equivalent ('**' only accepts
                        # mappings, while .update accepts
                        # other iterables as well);
                        #
                        # since we are emulating the behaviour
                        # of '**', we go with the less lenient
                        # behaviour of only accepting mappings

                        try:
                            param_args.update(**value)

                        except Exception as err:

                            raise KeywordSubparameterUnpackingError(
                                self,
                                param_name,
                                index,
                            ) from err

                # replace the parameter data in
                # the argument map by the dict
                # we just created
                arg_map[param_name] = param_args

            else:

                raise RuntimeError(
                    "there shouldn't be possible to specify a variable"
                    " parameter of a kind which is neither 'var_pos' or"
                    " 'var_key'"
                )
If unpack data received in subparameters if requested.
nodezator/graphman/callablenode/execution.py