def require_foreign(namespace, symbol=None):
 try:
  if (symbol is None):
   get_foreign_module(namespace)
  else:
   get_foreign_struct(namespace, symbol)
 except ForeignError as e:
  raise ImportError(e)

def require_foreign ( namespace , symbol = None ) : try : if ( symbol is None ) : get_foreign_module ( namespace ) else : get_foreign_struct ( namespace , symbol ) except ForeignError as e : raise ImportError ( e )
raises importerror if the specified foreign module isnt supported or the needed dependencies arent installed .