Return the value of the execute a function inside the model, for example:
 :column => :function
 this function execute the function _function_ to get the value and set it his return to column
161277
def get_value_of(value, model=nil)
      if value.kind_of? Symbol
        # If the function exist, we execute it
        if  model.respond_to? value
          return model.send value
        # if the the function not exist, whe set te symbol as a value
        else
          return value
        end
      elsif value.kind_of? Proc
        return value.call
      else
        return value
      end
    end
423526
function getValueReturnedInFirstStatement(func) {
    const firstLine = getFirstFunctionLine(func)
    if (func) {
        if (isFunctionDefinitionWithBlock(func)) {
            return isReturnStatement(firstLine) ? firstLine.argument : undefined
        }
        if (func.type === 'ArrowFunctionExpression') {
            return firstLine
        }
    }
}
976498
def value_get(method_name):
    

    def value_get(value, context, **_params):
        method = getattr(value, method_name)
        return _get(method, context["key"], (), {})

    return value_get
665849
def get_value(key, &block)
      key   = key.to_sym
      value = @table[key]

      if block_given?
        block.arity == 0 ? value.instance_eval(&block) : block.call(value)
      end

      value
    end
526857
def col_mod(df,col_name,func,*args,**kwargs):
    
    backup = df[col_name].copy()
    try:
        return_val = func(df,col_name,*args,**kwargs)
        if return_val is not None:
            set_col(df,col_name,return_val)
    except:
        df[col_name] = backup
1035352
def value
      val = self.lazy_proc?(@value) ? self.coerce(@value.call) : @value
      val.respond_to?(:returned_value) ? val.returned_value : val
    end
81986
def columns(self, model=None):
        
        column = self.column(model=model)
        if column:
            yield column

        check = self.__value
        if not isinstance(check, (list, set, tuple)):
            check = (check,)

        for val in check:
            if isinstance(val, (Query, QueryCompound)):
                for col in val.columns(model):
                    yield col
1132282
def execute_function(self, func, *nargs, **kwargs):
        
        # makes a copy of the func
        import types
        fn = types.FunctionType(func.func_code,
                                func.func_globals.copy(),
                                name=func.func_name,
                                argdefs=func.func_defaults,
                                closure=func.func_closure)
        fn.func_globals.update(self.globals)

        error_class = Exception if config.catch_rex_errors else None

        try:
            return fn(*nargs, **kwargs)
        except RexError:
            raise
        except error_class as e:
            from inspect import getfile

            stack = traceback.format_exc()
            filename = getfile(func)

            raise RexError("Failed to exec %s:\n\n%s" % (filename, stack))
1049698
def _at_return(self, calculator, rule, scope, block):
        
        # TODO should assert this only happens within a @function
        ret = calculator.calculate(block.argument)
        raise SassReturn(ret)
891062
def run(
        self
        ):
        
        if self._function and not self._kwargs:
            return self._function()
        if self._function and self._kwargs:
            return self._function(**self._kwargs)
656579
def and_return_result_of(self, return_value):
        
        if not check_func_takes_args(return_value):
            self._return_value = lambda *args, **kwargs: return_value()
        else:
            self._return_value = return_value

        return self
167005
def invoke_function(self, ctx, name, arguments):
        
        from temba_expressions import EvaluationError, conversions

        # find function with given name
        func = self.get_function(name)
        if func is None:
            raise EvaluationError("Undefined function: %s" % name)

        args, varargs, defaults = self._get_arg_spec(func)

        call_args = []
        passed_args = list(arguments)

        for arg in args:
            if arg == 'ctx':
                call_args.append(ctx)
            elif passed_args:
                call_args.append(passed_args.pop(0))
            elif arg in defaults:
                call_args.append(defaults[arg])
            else:
                raise EvaluationError("Too few arguments provided for function %s" % name)

        if varargs is not None:
            call_args.extend(passed_args)
            passed_args = []

        # any unused arguments?
        if passed_args:
            raise EvaluationError("Too many arguments provided for function %s" % name)

        try:
            return func(*call_args)
        except Exception as e:
            pretty_args = []
            for arg in arguments:
                if isinstance(arg, str):
                    pretty = '"%s"' % arg
                else:
                    try:
                        pretty = conversions.to_string(arg, ctx)
                    except EvaluationError:
                        pretty = str(arg)
                pretty_args.append(pretty)

            raise EvaluationError("Error calling function %s with arguments %s" % (name, ', '.join(pretty_args)), e)
870602
def get_column(self, column_name):
        
        frame = self._call_func()
        return DataFrameWrapper(self.name, frame,
                                copy_col=self.copy_col).get_column(column_name)
871514
def do(self, func, *args, **kwargs):
        
        if not callable(func):
            func = getattr(self.engine.function, func)
        func(self, *args, **kwargs)
        return self
1248897
def expr(str):
    
    sc = SparkContext._active_spark_context
    return Column(sc._jvm.functions.expr(str))
84064
def read_with_columns(func):
    
    def wrapper(*args, **kwargs):
        # parse columns argument
        columns = kwargs.pop("columns", None)

        # read table
        tab = func(*args, **kwargs)

        # filter on columns
        if columns is None:
            return tab
        return tab[columns]

    return _safe_wraps(wrapper, func)
554584
def get(name, function=None):
        
        if function is not None:
            if hasattr(function, Settings.FUNCTION_SETTINGS_NAME):
                if name in getattr(function, Settings.FUNCTION_SETTINGS_NAME):
                    return getattr(function, Settings.FUNCTION_SETTINGS_NAME)[name]
        return Settings.__global_setting_values[name]