def check_valid(self, required=None):
missing, empty = [], []<EOL>for attr in (required or [SAMPLE_NAME_COLNAME]):<EOL><INDENT>if not hasattr(self, attr):<EOL><INDENT>missing.append(attr)<EOL><DEDENT>if attr == "<STR_LIT>":<EOL><INDENT>empty.append(attr)<EOL><DEDENT><DEDENT>missing_attributes_message ="<STR_LIT>".format(missing, empty) if (missing or empty) else "<STR_LIT>"<EOL>return missing_attributes_message<EOL>
Check provided sample annotation is valid.

:param Iterable[str] required: collection of required sample attribute
    names, optional; if unspecified, only a name is required.
:return (Exception | NoneType, str, str): exception and messages about
    what's missing/empty; null with empty messages if there was nothing
    exceptional or required inputs are absent or not set