<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_dimension_by_name(dimension_name,**kwargs):
 """ Given a dimension name returns all its data. Used in convert functions """

    try:
        if dimension_name is None:
            dimension_name = ''
        dimension = db.DBSession.query(Dimension).filter(func.lower(Dimension.name)==func.lower(dimension_name.strip())).one()

        return get_dimension(dimension.id)

    except NoResultFound:
        # The dimension does not exist
        raise ResourceNotFoundError("Dimension %s not found"%(dimension_name))