def filter(arg_list, nsitemin, nsitemax):
    """Filters so nsites is within nsitemin and nsitemax.

    Parameters:
    arg_list (list): list of materials.
    nsitesmin (int): min of nsites.
    nsitemax (int): max of nsites.

    Returns:
    list: filtered list.
    """
    respond_filter_list = []
    for i,el in enumerate(arg_list):
        nsites = el["nsites"]
        if nsites > nsitemax or nsites < nsitemin:
            pass
        else:
            respond_filter_list.append(el)

    return respond_filter_list