def parse_from_strings(name, code, pxds=None, level=None, initial_pos=None, context=None, allow_struct_enum_decorator=False):
 if (context is None):
  context = StringParseContext(name)
 assert isinstance(code, _unicode), 'unicode code snippets only please'
 encoding = 'UTF-8'
 module_name = name
 if (initial_pos is None):
  initial_pos = (name, 1, 0)
 code_source = StringSourceDescriptor(name, code)
 scope = context.find_module(module_name, pos=initial_pos, need_pxd=False)
 buf = StringIO(code)
 scanner = PyrexScanner(buf, code_source, source_encoding=encoding, scope=scope, context=context, initial_pos=initial_pos)
 ctx = Parsing.Ctx(allow_struct_enum_decorator=allow_struct_enum_decorator)
 if (level is None):
  tree = Parsing.p_module(scanner, 0, module_name, ctx=ctx)
  tree.scope = scope
  tree.is_pxd = False
 else:
  tree = Parsing.p_code(scanner, level=level, ctx=ctx)
 tree.scope = scope
 return tree

def parse_from_strings ( name , code , pxds = None , level = None , initial_pos = None , context = None , allow_struct_enum_decorator = False ) : if ( context is None ) : context = StringParseContext ( name ) assert isinstance ( code , _unicode ) , 'unicode code snippets only please' encoding = 'UTF-8' module_name = name if ( initial_pos is None ) : initial_pos = ( name , 1 , 0 ) code_source = StringSourceDescriptor ( name , code ) scope = context . find_module ( module_name , pos = initial_pos , need_pxd = False ) buf = StringIO ( code ) scanner = PyrexScanner ( buf , code_source , source_encoding = encoding , scope = scope , context = context , initial_pos = initial_pos ) ctx = Parsing . Ctx ( allow_struct_enum_decorator = allow_struct_enum_decorator ) if ( level is None ) : tree = Parsing . p_module ( scanner , 0 , module_name , ctx = ctx ) tree . scope = scope tree . is_pxd = False else : tree = Parsing . p_code ( scanner , level = level , ctx = ctx ) tree . scope = scope return tree
utility method to parse a string of code .