def filter_tags(tags, prefixes=None):
    """Filter list of relation tags matching specified prefixes."""

    if prefixes is not None:
        # filter by specified relation tag prefixes
        tags = tuple( t  for t in tags if any(( t.startswith(p)  for p in prefixes )) )
    return tags