docs: def _get_attr_by_name_and_dimension(name, dimension_id):
      """
          Search for an attribute with the given name and dimension_id.
          If such an attribute does not exist, create one.
      """
  
      attr = db.DBSession.query(Attr).filter(Attr.name==name, Attr.dimension_id==dimension_id).first()
  
      if attr is None:
          # In this case the attr does not exists so we must create it
          attr         = Attr()
          attr.dimension_id = dimension_id
          attr.name  = name
  
          log.debug("Attribute not found, creating new attribute: name:%s, dimen:%s",
                      attr.name, attr.dimension_id)
  
          db.DBSession.add(attr)
  
      return attr