def identical_elem_tuple_to_int(param):
    """
    Convert tuples with all the same int elem to
    a single int (ex. (3, 3, 3) --> 3)
    """
    if isinstance(param, int):
        return param

    if not isinstance(param, (list, tuple)) or not all(x == param[0] for x in param):
        raise RuntimeError(f"AIT supports square param values only, but got {param}")
    return param[0]

    Convert tuples with all the same int elem to
    a single int (ex. (3, 3, 3) --> 3)
    
fx2ait/fx2ait/converters/utils.py