def ensure_fromlist(mod, fromlist, buf, recursive):
 if (not hasattr(mod, '__path__')):
  return
 for item in fromlist:
  if (not hasattr(item, 'rindex')):
   raise TypeError("Item in ``from list'' not a string")
  if (item == '*'):
   if recursive:
    continue
   try:
    all = mod.__all__
   except AttributeError:
    pass
   else:
    ret = ensure_fromlist(mod, all, buf, 1)
    if (not ret):
     return 0
  elif (not hasattr(mod, item)):
   import_submodule(mod, item, ((buf + '.') + item))

def ensure_fromlist ( mod , fromlist , buf , recursive ) : if ( not hasattr ( mod , '__path__' ) ) : return for item in fromlist : if ( not hasattr ( item , 'rindex' ) ) : raise TypeError ( "Item in ``from list'' not a string" ) if ( item == '*' ) : if recursive : continue try : all = mod . __all__ except AttributeError : pass else : ret = ensure_fromlist ( mod , all , buf , 1 ) if ( not ret ) : return 0 elif ( not hasattr ( mod , item ) ) : import_submodule ( mod , item , ( ( buf + '.' ) + item ) )
handle from module import a .