def get_params_from_str(param_str, no_lists=False):
    """
    get_params_from_str(param_str)

    Returns parameter information extracted from the parameter string.

    Required args:
        - param_str (str): String containing parameter information, of the form
                           "m{}_s{}_plane_stimtype_fluor_scaled_comp_shuffled",
                           though the order can be different as of plane
    
    Optional args:
        - no_lists (bool): if True, list parameters are replaced with a string, 
                           e.g. "both"
                           False
    Returns:
        - params (dict): parameter dictionary
            - bri_dir (str or list) : Bricks direction parameter ("right", 
                                      "left", ["right", "left"] or "none") 
            - bri_size (int or list): Bricks size parameter (128, 256, 
                                      [128, 256] or "none")
            - comp (str)            : comparison parameter ("surp", "AvB",
                                      "AvC", "BvC" or "DvU", None)
            - fluor (str)           : fluorescence parameter ("raw" or "dff")
            - gabk (int or list)    : Gabor kappa parameter (4, 16, [4, 16] or 
                                      "none")
            - plane (str)           : plane ("soma" or "dend")
            - mouse_n (int)         : mouse number
            - sess_n (int)          : session number
            - scale (bool)          : scaling parameter
            - shuffle (bool)        : shuffle parameter
            - stimtype (str)        : stimulus type ("gabors" or "bricks")
    """

    params = dict()

    params["mouse_n"] = int(param_str.split("_")[0][1:])
    params["sess_n"]  = int(param_str.split("_")[1][1:])

    [params["bri_dir"], params["bri_size"], params["gabk"]] = \
        "none", "none", "none"
    
    if "gab" in param_str:
        params["stimtype"] = "gabors"
        params["gabk"] = 16
        if "both" in param_str:
            if no_lists:
                params["gabk"] = "both"
            else:
                params["gabk"] = [4, 16]
        elif "gab4" in param_str:
            params["gabk"] = 4
    elif "bri" in param_str:
        params["stimtype"] = "bricks"
        params["bri_size"] = 128
        if "both" in param_str:
            if no_lists:
                params["bri_size"] = "both"
            else:
                params["bri_size"] = [128, 256]
        elif "bri256" in param_str:
            params["bri_size"] = 256
        if no_lists:
            params["bri_dir"] = "both"
        else:
            params["bri_dir"] = ["right", "left"]
        if "right" in param_str:
            params["bri_dir"] = "right"
        elif "left" in param_str:
            params["bri_dir"] = "left"
    else:
        raise ValueError("Stimtype not identified.")

    if "soma" in param_str:
        params["plane"] = "soma"
    elif "dend" in param_str:
        params["plane"] = "dend"
    else:
        raise ValueError("plane not identified.")

    if "dff" in param_str:
        params["fluor"] = "dff"
    elif "raw" in param_str:
        params["fluor"] = "raw"
    else:
        raise ValueError("Fluorescence type not identified.")

    params["scale"] = False
    if "scale" in param_str:
        params["scale"] = True

    params["comp"] = None
    for comptype in ["surp", "AvB", "AvC", "BvC", "DvU"]:
        if comptype in param_str:
            params["comp"] = comptype

    if "shuffled" in param_str:
        params["shuffle"] = True
    else:
        params["shuffle"] = False

    return params