def map_function(self):
        "handle function.extension"
        arg0 = self.harg0    # map hyphens
        functions = self.functions.get(self.controller, set())
        if isinstance(self.router.default_function, dict):
            default_function = self.router.default_function.get(
                self.controller, None)
        else:
            default_function = self.router.default_function  # str or None
        default_function = self.domain_function or default_function
        if not arg0 or functions and arg0 not in functions:
            self.function = default_function or ""
            self.pop_arg_if(arg0 and self.function == arg0)
        else:
            func_ext = arg0.split('.')
            if len(func_ext) > 1:
                self.function = func_ext[0]
                self.extension = func_ext[-1]
            else:
                self.function = arg0
            self.pop_arg_if(True)
        log_rewrite(
            "route: function.ext=%s.%s" % (self.function, self.extension))

        if not self.router._acfe_match.match(self.function):
            raise HTTP(
                400, 'invalid request' % THREAD_LOCAL.routes.error_message,
                web2py_error='invalid function')
        if self.extension and not self.router._acfe_match.match(self.extension):
            raise HTTP(
                400, THREAD_LOCAL.routes.error_message % 'invalid request',
                web2py_error='invalid extension')
dataset/ETHPy150Open uwdata/termite-visualizations/web2py/gluon/rewrite.py/MapUrlIn.map_function/swapped operands of `%`