(
    function_name: Text, functions_mapping: FunctionsMapping
)
get function from functions_mapping,
        if not found, then try to check if builtin function.

    Args:
        function_name (str): function name
        functions_mapping (dict): functions mapping

    Returns:
        mapping function object.

    Raises:
        exceptions.FunctionNotFound: function is neither defined in debugtalk.py nor builtin.
get function from functions_mapping,
        if not found, then try to check if builtin function.
get function from functions_mapping if not found then try to check if builtin function .
def get_mapping_function(
    function_name: Text, functions_mapping: FunctionsMapping
) -> Callable:
    """ get function from functions_mapping,
        if not found, then try to check if builtin function.

    Args:
        function_name (str): function name
        functions_mapping (dict): functions mapping

    Returns:
        mapping function object.

    Raises:
        exceptions.FunctionNotFound: function is neither defined in debugtalk.py nor builtin.

    """
    if function_name in functions_mapping:
        return functions_mapping[function_name]

    elif function_name in ["parameterize", "P"]:
        return loader.load_csv_file

    elif function_name in ["environ", "ENV"]:
        return utils.get_os_environ

    elif function_name in ["multipart_encoder", "multipart_content_type"]:
        # extension for upload test
        from httprunner.ext import uploader

        return getattr(uploader, function_name)

    try:
        # check if HttpRunner builtin functions
        built_in_functions = loader.load_builtin_functions()
        return built_in_functions[function_name]
    except KeyError:
        pass

    try:
        # check if Python builtin functions
        return getattr(builtins, function_name)
    except AttributeError:
        pass

    raise exceptions.FunctionNotFound(f"{function_name} is not found.")
def get_mapping_function ( function_name : Text , functions_mapping : FunctionsMapping ) -> Callable : if function_name in functions_mapping : return functions_mapping [ function_name ] elif function_name in [ "parameterize" , "P" ] : return loader . load_csv_file elif function_name in [ "environ" , "ENV" ] : return utils . get_os_environ elif function_name in [ "multipart_encoder" , "multipart_content_type" ] : # extension for upload test from httprunner . ext import uploader return getattr ( uploader , function_name ) try : # check if HttpRunner builtin functions built_in_functions = loader . load_builtin_functions ( ) return built_in_functions [ function_name ] except KeyError : pass try : # check if Python builtin functions return getattr ( builtins , function_name ) except AttributeError : pass raise exceptions . FunctionNotFound ( f"{function_name} is not found." )