class_docstr: Turn a function into a Module by keeping the vars it uses.
class_docstr_tok: ["Turn","a","function","into","a","Module","by","keeping","the","vars","it","uses","."]
docstr: Decorator which turns a function into a module using provided variable collection.
  
  Args:
      vc: the VarCollection of variables used by the function.
docstr_tok: ["Decorator","which","turns","a","function","into","a","module","using","provided","variable","collection",".","Args",":","vc",":","the","VarCollection","of","variables","used","by","the","function","."]
code: def with_vars(vc: VarCollection):
      """Decorator which turns a function into a module using provided variable collection.
  
      Args:
          vc: the VarCollection of variables used by the function.
      """
  
      def from_function(f: Callable):
          return Function(f, vc)
  
      return from_function
  
imports: from collections import namedtuple
  from typing import Optional, List, Union, Callable, Tuple
  import jax
  import jax.numpy
  import numpy
  from objax.typing import JaxArray
  from objax.util import class_name, override_args_kwargs, positional_args_names, repr_function
  from objax.variable import BaseVar, RandomState, VarCollection
label_desc: Use image node_id 4 for calling the Function obj's underlying member method code with example usage: obj.with_vars(vc) and returns: from_function, Function