def fieldspec_subset_by_name(
            fieldspeclist: FIELDSPECLIST_TYPE,
            fieldnames: Container[str]) -> FIELDSPECLIST_TYPE:
        """Returns a subset of the fieldspecs matching the fieldnames list."""
        result = []
        for x in fieldspeclist:
            if x["name"] in fieldnames:
                result.append(x)
        return result