code: def get_max_dim(self, obj):
          
  
          try:
              iter(obj)
  
          except TypeError:
              return 0
  
          try:
              for o in obj:
                  iter(o)
                  break
  
          except TypeError:
              return 1
  
          return 2
docs: Returns maximum dimensionality over which obj is iterable <= 2