<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def view_plugins(category=None):
 """ return a view of the loaded plugin names and descriptions Parameters category : None or str if str, apply for single plugin category Examples -------- {'decoders': {}, 'encoders': {}, 'parsers': {}} {'decoders': {'example': 'a decoder for dicts containing _example_ key'}, 'encoders': {}, 'parsers': {}} {'example': 'a decoder for dicts containing _example_ key'} """

    if category is not None:
        if category == 'parsers':
            return {
                name: {"descript": klass.plugin_descript,
                       "regex": klass.file_regex}
                for name, klass in _all_plugins[category].items()
            }
        return {
            name: klass.plugin_descript
            for name, klass in _all_plugins[category].items()
        }
    else:
        return {cat: {name: klass.plugin_descript
                      for name, klass in plugins.items()}
                for cat, plugins in _all_plugins.items()}