def tree_from_cix(cix):
 if isinstance(cix, unicode):
  cix = cix.encode('UTF-8', 'xmlcharrefreplace')
 tree = ET.XML(cix)
 version = tree.get('version')
 if (version == CIX_VERSION):
  return tree
 elif (version == '0.1'):
  return tree_2_0_from_tree_0_1(tree)
 else:
  raise CodeIntelError(('unknown CIX version: %r' % version))

def tree_from_cix ( cix ) : if isinstance ( cix , unicode ) : cix = cix . encode ( 'UTF-8' , 'xmlcharrefreplace' ) tree = ET . XML ( cix ) version = tree . get ( 'version' ) if ( version == CIX_VERSION ) : return tree elif ( version == '0.1' ) : return tree_2_0_from_tree_0_1 ( tree ) else : raise CodeIntelError ( ( 'unknown CIX version: %r' % version ) )
return a tree for the given cix content .