def METHOD_NAME(base_name:str, dims:List[int], order:str) -> str:
    # Generate a "fname_tot" style filename, decoded by the above
    if len(dims) == 2:
        d1, d2, d3 = dims[0], dims[1], 1
    else:
        d1, d2, d3 = dims[0], dims[1], dims[2]
    ret = '_'.join([base_name, 'd1', str(d1), 'd2', str(d2), 'd3', str(d3), 'order', order])
    ret = re.sub(r'(_)+', '_', ret) # Turn repeated underscores into just one
    return ret