In Python you can use ete3 package.
UPDATED: The following code finds a sister group to your query taxon and prints all leaves of that sister group (if bootstrap value is equal or greater than threshold)
import ete3
YOUR_TREE = '((raccoon:19.19959,bear:6.80041)50:0.84600,((sea_lion:11.99700, seal:12.00300)100:7.52973,((monkey:100.85930,cat:47.14069)80:20.59201, weasel:18.87953)75:2.09460)50:3.87382,dog:25.46154);'
YOUR_QUERY = 'weasel'
MIN_BOOTSTRAP = 50
t = ete3.Tree(YOUR_TREE)
node = t.search_nodes(name=YOUR_QUERY)[0]
for sister_group in node.get_sisters():
if sister_group.support >= MIN_BOOTSTRAP:
for leaf in sister_group.get_leaves():
printleaf.name)
You will get the names of leaves that are present in the sister group (cat and monkey) to weasel. Of note, the tree is unrooted (so there is no outgroup here). If you look at the QUERY_TREE you can see that weasel is next to monkey and cat: [..] ((monkey:100.85930,cat:47.14069)80:20.59201, weasel:18.87953) [..].