def resolve_dynamic_values(env):
<EOL>if env.needs_workflow['<STR_LIT>']:<EOL><INDENT>return<EOL><DEDENT>needs = env.needs_all_needs<EOL>for key, need in needs.items():<EOL><INDENT>for need_option in need:<EOL><INDENT>if need_option in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:content>']:<EOL><INDENT>continue<EOL><DEDENT>if not isinstance(need[need_option], (list, set)):<EOL><INDENT>func_call = True<EOL>while func_call:<EOL><INDENT>try:<EOL><INDENT>func_call, func_return = _detect_and_execute(need[need_option], need, env)<EOL><DEDENT>except FunctionParsingException:<EOL><INDENT>raise SphinxError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(option=need_option,<EOL>file=need['<STR_LIT>'],<EOL>line=need['<STR_LIT>']))<EOL><DEDENT>if func_call is None:<EOL><INDENT>continue<EOL><DEDENT>if func_return is None:<EOL><INDENT>need[need_option] = need[need_option].replace('<STR_LIT>'.format(func_call), '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>need[need_option] = need[need_option].replace('<STR_LIT>'.format(func_call), str(func_return))<EOL><DEDENT>if need[need_option] == '<STR_LIT>':<EOL><INDENT>need[need_option] = None<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>new_values = []<EOL>for element in need[need_option]:<EOL><INDENT>try:<EOL><INDENT>func_call, func_return = _detect_and_execute(element, need, env)<EOL><DEDENT>except FunctionParsingException:<EOL><INDENT>raise SphinxError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(option=need_option,<EOL>file=need['<STR_LIT>'],<EOL>line=need['<STR_LIT>']))<EOL><DEDENT>if func_call is None:<EOL><INDENT>new_values.append(element)<EOL><DEDENT>else:<EOL><INDENT>if isinstance(need[need_option], (str, int, float)):<EOL><INDENT>new_values.append(element.replace('<STR_LIT>'.format(func_call), str(func_return)))<EOL><DEDENT>else:<EOL><INDENT>if isinstance(need[need_option], (list, set)):<EOL><INDENT>new_values += func_return<EOL><DEDENT><DEDENT><DEDENT><DEDENT>need[need_option] = new_values<EOL><DEDENT><DEDENT><DEDENT>env.needs_workflow['<STR_LIT>'] = True<EOL>
Resolve dynamic values inside need data.

Rough workflow:

#. Parse all needs and their data for a string like [[ my_func(a,b,c) ]]
#. Extract function name and call parameters
#. Execute registered function name with extracted call parameters
#. Replace original string with return value

:param env: Sphinx environment
:return: return value of given function