def _check_validity_of_inputs(data, input_arg, input_name, grid_plot, dimension):
    """
    Function that verifies when an input ('input_arg') of function 'plot' has a valid structure.

    ----------
    Parameters
    ----------
    data : list or list of lists
        Structure with the data that will be plotted.

    input_arg : list or list of lists
        The input data to be verified.

    input_name : str
        Name of the input_arg variable.

    grid_plot : bool
        A flag that identifies when the input_arg is a matrix or not.

    dimension : int
        Level of verification in the matrix format structure.

    Returns
    -------
    out : list or list of lists
        Returns the same value as input_arg or a modified version.
    """
    if input_arg is not None:
        if grid_plot is True:
            if isinstance(input_arg, list):
                if numpy.shape(input_arg)[:dimension] != numpy.shape(data)[:dimension]:
                    raise RuntimeError("The shape of " + input_name + " does not match with data "
                                       "input.")

            else:
                raise RuntimeError("The specified data type of " + input_name +
                                   " field is not valid. Input must be a list.")
        else:
            if not isinstance(input_arg, str):
                raise RuntimeError("Taking into account that only one time-series had been "
                                   "specified at 'data', the " + input_name + " field must be a "
                                   "string")
    elif grid_plot is True:
        input_arg = numpy.ndarray(shape=numpy.shape(data)[:dimension], dtype=numpy.object)

    return input_arg
Function that verifies when an input ('input_arg') of function 'plot' has a valid structure.

    ----------
    Parameters
    ----------
    data : list or list of lists
        Structure with the data that will be plotted.

    input_arg : list or list of lists
        The input data to be verified.

    input_name : str
        Name of the input_arg variable.

    grid_plot : bool
        A flag that identifies when the input_arg is a matrix or not.

    dimension : int
        Level of verification in the matrix format structure.

    Returns
    -------
    out : list or list of lists
        Returns the same value as input_arg or a modified version.