code: def get_dim_name(arr, names):
      
      for name in names:
          # TODO: raise warning/exception when multiple names arr attrs.
          if hasattr(arr, name):
              return name
      raise AttributeError("No attributes of the object `{0}` match the "
                           "specified names of `{1}`".format(arr, names))
docs: Determine if an object has an attribute name matching a given list.