def METHOD_NAME(self, tree: Tree, pattern: str) -> Portfolio:
    """Return portfolio info based on matching account name.
    Args:
        tree: Ledger root tree node.
        pattern: Account name regex pattern.
    Return:
        Data structured for use with a querytable (types, rows).
    """
    regexer = re.compile(pattern)
    selected_nodes = [
        node for acct, node in tree.items() if regexer.match(acct)
    ]
    return Portfolio(
        f"Account names matching: '{pattern}'",
        self._portfolio_data(selected_nodes),
    )