def read_single_param_file(src, typename=int):
    """Read a file with one value

    This function can be used to read files in Kaldi which
    has parameter values stored in them. E.g. egs/info/num_archives.
    Pass the typename in advance to return the value without errors.

    Args:
        src: the path to file that contains the parameter value
        typename (type): The type of value to be expected in the file.
            Default is int. Any custom value that can take a string
            can be passed.

    Returns:
        Value in the "src" file casted into type "typename"
         
    Raises:
        AssertionError if parameter value is empty.
    """
    param = None
    with open(src) as ipf:
        param = typename(ipf.readline().strip())
    assert param is not None
    return param