Convert Nested List Into Single List Python Methods And Classes