def execute_func(env, need, func_string):
func_name, func_args, func_kwargs = _analyze_func_string(func_string)<EOL>if func_name not in env.needs_functions.keys():<EOL><INDENT>raise SphinxError('<STR_LIT>'.format(func_name, need['<STR_LIT:id>']))<EOL><DEDENT>func = env.needs_functions[func_name]['<STR_LIT>']<EOL>func_return = func(env, need, env.needs_all_needs, *func_args, **func_kwargs)<EOL>if not isinstance(func_return, (str, int, float, list, unicode)) and func_return is not None:<EOL><INDENT>raise SphinxError('<STR_LIT>'.format(<EOL>func_name, type(func_return)))<EOL><DEDENT>if isinstance(func_return, list):<EOL><INDENT>for element in func_return:<EOL><INDENT>if not isinstance(element, (str, int, float, unicode)):<EOL><INDENT>raise SphinxError('<STR_LIT>'<EOL>'<STR_LIT>'.format(func_name, type(func_return)))<EOL><DEDENT><DEDENT><DEDENT>return func_return<EOL>
Executes a given function string.
:param env: Sphinx environment
:param need: Actual need, which contains the found function string
:param func_string: string of the found function. Without [[ ]]
:return: return value of executed function