code: def matches(cntxt: Context, T: RDFGraph, expr: ShExJ.tripleExpr) -> bool:
      
      if isinstance_(expr, ShExJ.tripleExprLabel):
          return matchesExpr(cntxt, T, expr)
      else:
          return matchesCardinality(cntxt, T, expr) and (expr.semActs is None or semActsSatisfied(expr.semActs, cntxt))
docs: **matches**: asserts that a triple expression is matched by a set of triples that come from the neighbourhood of a
      node in an RDF graph. The expression `matches(T, expr, m)` indicates that a set of triples `T` can satisfy these
      rules:
  
      * expr has semActs and `matches(T, expr, m)` by the remaining rules in this list and the evaluation
        of semActs succeeds according to the section below on Semantic Actions.
      * expr has a cardinality of min and/or max not equal to 1, where a max of -1 is treated as unbounded, and T
        can be partitioned into k subsets T1, T2,…Tk such that min ≤ k ≤ max and for each Tn,
        `matches(Tn, expr, m)` by the remaining rules in this list.
      * expr is a OneOf and there is some shape expression se2 in shapeExprs such that a matches(T, se2, m).
      * expr is an EachOf and there is some partition of T into T1, T2,… such that for every expression
        expr1, expr2,… in shapeExprs, matches(Tn, exprn, m).
      * expr is a TripleConstraint and:
          * T is a set of one triple. Let t be the soul triple in T.
          * t's predicate equals expr's predicate. Let value be t's subject if inverse is true, else t's object.
          * if inverse is true, t is in arcsIn, else t is in `arcsOut`.
          * either
              * expr has no valueExpr
              * or `satisfies(value, valueExpr, G, m).