python get top level directory from path