code: def generate(ast_tree: ast.Tree, model_name: str, options: Dict[str, bool]=None) -> Model:
      
      if options is None:
          options = {}
      component_ref = ast.ComponentRef.from_string(model_name)
      ast_walker = GeneratorWalker()
      flat_tree = flatten(ast_tree, component_ref)
      component_ref_tuple = component_ref.to_tuple()
      casadi_gen = Generator(flat_tree, component_ref_tuple[-1], options)
      ast_walker.walk(casadi_gen, flat_tree)
      return casadi_gen.model
docs: :param ast_tree: AST to generate from
      :param model_name: class to generate
      :param options: dictionary of generator options
      :return: casadi model