def search(self, query=None, args=None):
<EOL>if query is None:<EOL><INDENT>if args.endpoint is None:<EOL><INDENT>bot.info('<STR_LIT>')<EOL>return self._list_endpoints()<EOL><DEDENT>else:<EOL><INDENT>return self._list_endpoint(args.endpoint)<EOL><DEDENT><DEDENT>if args.endpoint is None:<EOL><INDENT>bot.info('<STR_LIT>')<EOL>return self._list_endpoints(query)<EOL><DEDENT>return self._list_endpoint(endpoint=args.endpoint, <EOL>query=query)<EOL>
query will show images determined by the extension of img
       or simg.

       Parameters
       ==========
       query: the container name (path) or uri to search for
       args.endpoint: can be an endpoint id and optional path, e.g.:

             --endpoint  6881ae2e-db26-11e5-9772-22000b9da45e:.singularity'
             --endpoint  6881ae2e-db26-11e5-9772-22000b9da45e'

       if not defined, we show the user endpoints to choose from

       Usage
       =====
       If endpoint is defined with a query, then we search the given endpoint
       for a container of interested (designated by ending in .img or .simg

       If no endpoint is provided but instead just a query, we use the query
       to search endpoints.