top level python functions