Consolidate python region matching into one line