def select_hcons(xmrs, hi=None, relation=None, lo=None):
    """
    Return the list of all [HandleConstraints] that have the matching
    *hi*, *relation*, and/or *lo* values. If none match, return an
    empty list.
    """
    hcmatch = lambda hc: (
        (hi is None or hc.hi == hi) and
        (relation is None or hc.relation == relation) and
        (lo is None or hc.lo == lo))
    return list(filter(hcmatch, xmrs.hcons()))