def _select_options(pat):
 if (pat in _registered_options):
  return [pat]
 keys = sorted(_registered_options.keys())
 if (pat == 'all'):
  return keys
 return [k for k in keys if re.search(pat, k, re.I)]

def _select_options ( pat ) : if ( pat in _registered_options ) : return [ pat ] keys = sorted ( _registered_options . keys ( ) ) if ( pat == 'all' ) : return keys return [ k for k in keys if re . search ( pat , k , re . I ) ]
returns a list of keys matching pat if pat=="all" .