def _select_options(pat):
<EOL>if pat in _registered_options:<EOL><INDENT>return [pat]<EOL><DEDENT>keys = sorted(_registered_options.keys())<EOL>if pat == '<STR_LIT:all>':  <EOL><INDENT>return keys<EOL><DEDENT>return [k for k in keys if re.search(pat, k, re.I)]<EOL>
returns a list of keys matching `pat`

    if pat=="all", returns all registered options