def parse_scheme(scheme, stream, error_handler=None, allow_pickle_data=False):
 warnings.warn("Use 'scheme_load' instead", DeprecationWarning, stacklevel=2)
 doc = parse(stream)
 scheme_el = doc.getroot()
 version = scheme_el.attrib.get('version', None)
 if (version is None):
  if (scheme_el.find('widgets') is not None):
   version = '1.0'
  else:
   version = '2.0'
 if (error_handler is None):
  def error_handler(exc):
   raise exc
 if (version == '1.0'):
  parse_scheme_v_1_0(doc, scheme, error_handler=error_handler, allow_pickle_data=allow_pickle_data)
  return scheme
 else:
  parse_scheme_v_2_0(doc, scheme, error_handler=error_handler, allow_pickle_data=allow_pickle_data)
  return scheme

def parse_scheme ( scheme , stream , error_handler = None , allow_pickle_data = False ) : warnings . warn ( "Use 'scheme_load' instead" , DeprecationWarning , stacklevel = 2 ) doc = parse ( stream ) scheme_el = doc . getroot ( ) version = scheme_el . attrib . get ( 'version' , None ) if ( version is None ) : if ( scheme_el . find ( 'widgets' ) is not None ) : version = '1.0' else : version = '2.0' if ( error_handler is None ) : def error_handler ( exc ) : raise exc if ( version == '1.0' ) : parse_scheme_v_1_0 ( doc , scheme , error_handler = error_handler , allow_pickle_data = allow_pickle_data ) return scheme else : parse_scheme_v_2_0 ( doc , scheme , error_handler = error_handler , allow_pickle_data = allow_pickle_data ) return scheme
parse a saved scheme from stream and populate a scheme instance .