def object_from_string(st):
    """Creates a Python class or function from its fully qualified name.

    :param st: A fully qualified name of a class or a function.
    :return: A function or class object.

    This method is used by serialization code to create a function or class
    from a fully qualified name.

    """
    pos = st.rfind('.')
    if pos < 0:
        raise ValueError('Invalid function or class name %s' % st)
    module_name = st[:pos]
    func_name = st[pos + 1:]
    mod = __import__(module_name, fromlist=[func_name], level=0)
    return getattr(mod, func_name)
