'GET /api/tool_shed_repositories
Display a list of dictionaries containing information about installed tool shed repositories.'

@expose_api
def index(self, trans, **kwd):

    clause_list = []
    if ('name' in kwd):
        clause_list.append((self.app.install_model.ToolShedRepository.table.c.name == kwd.get('name', None)))
    if ('owner' in kwd):
        clause_list.append((self.app.install_model.ToolShedRepository.table.c.owner == kwd.get('owner', None)))
    if ('changeset' in kwd):
        clause_list.append((self.app.install_model.ToolShedRepository.table.c.changeset_revision == kwd.get('changeset', None)))
    tool_shed_repository_dicts = []
    query = trans.install_model.context.query(self.app.install_model.ToolShedRepository).order_by(self.app.install_model.ToolShedRepository.table.c.name)
    if (len(clause_list) > 0):
        query = query.filter(and_(*clause_list))
    for tool_shed_repository in query.all():
        tool_shed_repository_dict = tool_shed_repository.to_dict(value_mapper=self.__get_value_mapper(trans, tool_shed_repository))
        tool_shed_repository_dict['url'] = web.url_for(controller='tool_shed_repositories', action='show', id=trans.security.encode_id(tool_shed_repository.id))
        tool_shed_repository_dicts.append(tool_shed_repository_dict)
    return tool_shed_repository_dicts
