(result)
Judge type of data is given by the user.

    Returns
    -------
    type: int
        0 - StateIO object.
        1 - A list contains n performances for n queries.
        2 - A list contains n tuples with 2 elements, in which, the first
            element is the x_axis (e.g., iteration, cost),
            and the second element is the y_axis (e.g., the performance)
Judge type of data is given by the user.
Judge type of data is given by the user .
def _type_of_data(result):
    """Judge type of data is given by the user.

    Returns
    -------
    type: int
        0 - StateIO object.
        1 - A list contains n performances for n queries.
        2 - A list contains n tuples with 2 elements, in which, the first
            element is the x_axis (e.g., iteration, cost),
            and the second element is the y_axis (e.g., the performance)
    """
    if isinstance(result[0], StateIO):
        return 0
    elif isinstance(result[0], (list, np.ndarray)):
        if isinstance(result[0][0], collections.Iterable):
            if len(result[0][0]) > 1:
                return 2
        return 1
    else:
        raise ValueError("Illegal result data is given.\n"
                         "Legal result object includes:\n"
                         "\t- StateIO object.\n"
                         "\t- A list contains n performances for n queries.\n"
                         "\t- A list contains n tuples with 2 elements, in which, "
                         "the first element is the x_axis (e.g., iteration, cost),"
                         "and the second element is the y_axis (e.g., the performance)")
def _type_of_data ( result ) : if isinstance ( result [ 0 ] , StateIO ) : return 0 elif isinstance ( result [ 0 ] , ( list , np . ndarray ) ) : if isinstance ( result [ 0 ] [ 0 ] , collections . Iterable ) : if len ( result [ 0 ] [ 0 ] ) > 1 : return 2 return 1 else : raise ValueError ( "Illegal result data is given.\n" "Legal result object includes:\n" "\t- StateIO object.\n" "\t- A list contains n performances for n queries.\n" "\t- A list contains n tuples with 2 elements, in which, " "the first element is the x_axis (e.g., iteration, cost)," "and the second element is the y_axis (e.g., the performance)" )