parameters: (self, function_def)
return_statement: return function
docstring: Returns a function object for use within the sandbox for the given
          function definition.
  
          The wrapper function does type coercion on the function arguments
docstring_summary: Returns a function object for use within the sandbox for the given
          function definition.
docstring_tokens: Returns a function object for use within the sandbox for the given function definition .
function: def _create_function(self, function_def):
          """Returns a function object for use within the sandbox for the given
          function definition.
  
          The wrapper function does type coercion on the function arguments
          """
          func, args_def, doc = function_def
          def function(*args):
              def coerce(arg, type):
                  if not isinstance(arg, type):
                      if issubclass(type, ContextDerivedValue):
                          arg = type(self._context, arg)
                      else:
                          arg = type(arg)
                  return arg
              args = [coerce(arg, type) for arg, type in zip(args, args_def)]
              return func(self)(*args)
  
          return function
function_tokens: def _create_function ( self , function_def ) : func , args_def , doc = function_def def function ( * args ) : def coerce ( arg , type ) : if not isinstance ( arg , type ) : if issubclass ( type , ContextDerivedValue ) : arg = type ( self . _context , arg ) else : arg = type ( arg ) return arg args = [ coerce ( arg , type ) for arg , type in zip ( args , args_def ) ] return func ( self ) ( * args ) return function