def register_func(env, need_function):
if not hasattr(env, '<STR_LIT>'):<EOL><INDENT>env.needs_functions = {}<EOL><DEDENT>func_name = need_function.__name__<EOL>if func_name in env.needs_functions.keys():<EOL><INDENT>raise SphinxError('<STR_LIT>'.format(func_name))<EOL><DEDENT>env.needs_functions[func_name] = {<EOL>'<STR_LIT:name>': func_name,<EOL>'<STR_LIT>': need_function<EOL>}<EOL>
Registers a new sphinx-needs function for the given sphinx environment.
:param env: Sphinx environment
:param need_function: Python method
:return: None