def so_lookup_function(shared_object, function_name):
    """Attempt to find a symbol in the loaded shared object
    or raise an IOerror.

    :param shared_object:
    :type shared_object: shared object
    :param function_name:
    :type function_name: string
    :returns: function or raises an exception
    """
    try:
        function = getattr(shared_object, function_name)
    except AttributeError:
        raise IOError("No such function in shared object: {}".format(function_name))

    return function