python define function interface