def _assert_same_pattern(item_candidate, existing_patterns, maxlag):
    """
    Tests if a particular pattern has already been tested and retrieved as
    significant.

    Parameters
    ----------
    item_candidate : list of list with two components
        in the first component there are the neurons involved in the assembly,
        in the second there are the correspondent lags
    existing_patterns: list
        list of the already significant patterns
    maxlag: int
        maximum lag to be tested

    Returns
    -------
        True if the pattern was already tested and retrieved as significant
        False if not
    """
    item_candidate = sorted(item_candidate[0] * 2 * maxlag + item_candidate
        [1] + maxlag)
    if item_candidate in existing_patterns:
        return True
    else:
        return False
