def get_identifier(identifier, module_globals, module_name):
if isinstance(identifier, six.string_types):<EOL><INDENT>fn = module_globals.get(identifier)<EOL>if fn is None:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(module_name, identifier))<EOL><DEDENT>return fn<EOL><DEDENT>elif callable(identifier):<EOL><INDENT>return identifier<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>
Helper utility to retrieve the callable function associated with a string identifier.

    Args:
        identifier: The identifier. Could be a string or function.
        module_globals: The global objects of the module.
        module_name: The module name

    Returns:
        The callable associated with the identifier.