parameters: (self,context,prefix=None,modify=False)
docstring: Adds all items inside another context.  If prefix != None, self.[prefix] is set to context,
          and all names in that context are prepended by the given prefix and a '.'.
  
          If modify=True, then all the Variable and Function names inside the given sub-context are modified
          to fit the `self` context.  This is useful if you are saving/loading expressions and using the convenience
          form self.[prefix].[functionName] to instantiate Functions embedded inside the sub-context.  But be
          careful not to re-use the sub-context inside multiple super-contexts.
docstring_summary: Adds all items inside another context.  If prefix != None, self.[prefix] is set to context,
          and all names in that context are prepended by the given prefix and a '.'.
docstring_tokens: Adds all items inside another context . If prefix ! = None self . [ prefix ] is set to context and all names in that context are prepended by the given prefix and a . .
function: def include(self,context,prefix=None,modify=False):
          """Adds all items inside another context.  If prefix != None, self.[prefix] is set to context,
          and all names in that context are prepended by the given prefix and a '.'.
  
          If modify=True, then all the Variable and Function names inside the given sub-context are modified
          to fit the `self` context.  This is useful if you are saving/loading expressions and using the convenience
          form self.[prefix].[functionName] to instantiate Functions embedded inside the sub-context.  But be
          careful not to re-use the sub-context inside multiple super-contexts.
          """
          if prefix is not None:
              assert not hasattr(self,prefix),"Can't include a new context, already have an element named "+prefix
              setattr(self,prefix,context)
              prefix = prefix + '.'
          if prefix is None:
              modify = False
          for v in context.variables:
              n = v.name if prefix is None else prefix+v.name
              self.addVar(n,v.type)
              if modify:
                  v.name = n
          if modify:
              context.variableDict = dict((v.name,v) for v in context.variables)
          def emodify(e):
              if isinstance(e,VariableExpression):
                  return VariableExpression(self.variableDict[prefix + e.var.name])
              elif isinstance(e,UserDataExpression):
                  return UserDataExpression(prefix +e.var.name)
              elif isinstance(e,OperatorExpression):
                  return OperatorExpression(e.functionInfo,[emodify(a) for a in e.args],e.op)
              return e
          for n,e in context.expressions.iteritems():
              n = n if prefix is None else prefix+n
              if prefix is None:
                  self.addExpr(n,e)
              else:
                  #need to modify any user data or variables
                  self.addExpr(n,emodify(e))
          for n,d in context.userData.iteritems():
              n = n if prefix is None else prefix+n
              self.addUserData(n,d)
          newfunctions = []
          for n,d in context.customFunctions.iteritems():
              if modify:
                  fnew = d
              else:
                  fnew = copy.copy(d)
              fnew.simplifierDict = _addDictPrefix(prefix,fnew.simplifierDict,context.customFunctions)
              fnew.presimplifierDict = _addDictPrefix(prefix,fnew.presimplifierDict,context.customFunctions)
              newfunctions.append(fnew)
          for f in newfunctions:
              f.name = prefix + f.name
              self.declare(f)
          if modify:
              context.variableDict = dict((v.name,v) for v in context.variables)
              context.userData = dict((prefix+n,d) for n,d in context.userData.iteritems())
              context.expressions = dict((prefix+n,e) for n,e in context.expressions.iteritems())
              context.customFunctions = dict((d.name,d) for d in context.customFunctions.itervalues())
function_tokens: def include ( self , context , prefix = None , modify = False ) : if prefix is not None : assert not hasattr ( self , prefix ) , "Can't include a new context, already have an element named " + prefix setattr ( self , prefix , context ) prefix = prefix + '.' if prefix is None : modify = False for v in context . variables : n = v . name if prefix is None else prefix + v . name self . addVar ( n , v . type ) if modify : v . name = n if modify : context . variableDict = dict ( ( v . name , v ) for v in context . variables ) def emodify ( e ) : if isinstance ( e , VariableExpression ) : return VariableExpression ( self . variableDict [ prefix + e . var . name ] ) elif isinstance ( e , UserDataExpression ) : return UserDataExpression ( prefix + e . var . name ) elif isinstance ( e , OperatorExpression ) : return OperatorExpression ( e . functionInfo , [ emodify ( a ) for a in e . args ] , e . op ) return e for n , e in context . expressions . iteritems ( ) : n = n if prefix is None else prefix + n if prefix is None : self . addExpr ( n , e ) else : #need to modify any user data or variables self . addExpr ( n , emodify ( e ) ) for n , d in context . userData . iteritems ( ) : n = n if prefix is None else prefix + n self . addUserData ( n , d ) newfunctions = [ ] for n , d in context . customFunctions . iteritems ( ) : if modify : fnew = d else : fnew = copy . copy ( d ) fnew . simplifierDict = _addDictPrefix ( prefix , fnew . simplifierDict , context . customFunctions ) fnew . presimplifierDict = _addDictPrefix ( prefix , fnew . presimplifierDict , context . customFunctions ) newfunctions . append ( fnew ) for f in newfunctions : f . name = prefix + f . name self . declare ( f ) if modify : context . variableDict = dict ( ( v . name , v ) for v in context . variables ) context . userData = dict ( ( prefix + n , d ) for n , d in context . userData . iteritems ( ) ) context . expressions = dict ( ( prefix + n , e ) for n , e in context . expressions . iteritems ( ) ) context . customFunctions = dict ( ( d . name , d ) for d in context . customFunctions . itervalues ( ) )