def find(self, spec=None, fields=None, skip=<NUM_LIT:0>, limit=<NUM_LIT:0>,<EOL>timeout=True, snapshot=False, tailable=False, sort=None,<EOL>max_scan=None, slave_okay=False,<EOL>_must_use_master=False, _is_command=False, hint=None, debug=False,<EOL>comment=None, callback=None):
if spec is None:<EOL><INDENT>spec = {}<EOL><DEDENT>if limit is None:<EOL><INDENT>limit = <NUM_LIT:0><EOL><DEDENT>if not isinstance(spec, dict):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(skip, int):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(limit, int):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(timeout, bool):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(snapshot, bool):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(tailable, bool):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if not callable(callback):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if fields is not None:<EOL><INDENT>if not fields:<EOL><INDENT>fields = {"<STR_LIT>": <NUM_LIT:1>}<EOL><DEDENT>if not isinstance(fields, dict):<EOL><INDENT>fields = helpers._fields_list_to_dict(fields)<EOL><DEDENT><DEDENT>self.__spec = spec<EOL>self.__fields = fields<EOL>self.__skip = skip<EOL>self.__limit = limit<EOL>self.__batch_size = <NUM_LIT:0><EOL>self.__timeout = timeout<EOL>self.__tailable = tailable<EOL>self.__snapshot = snapshot<EOL>self.__ordering = sort and helpers._index_document(sort) or None<EOL>self.__max_scan = max_scan<EOL>self.__slave_okay = slave_okay<EOL>self.__explain = False<EOL>self.__hint = hint<EOL>self.__comment = comment<EOL>self.__debug = debug<EOL>self.__tz_aware = False <EOL>self.__must_use_master = _must_use_master<EOL>self.__is_command = _is_command<EOL>connection = self.__pool.connection()<EOL>try:<EOL><INDENT>if self.__debug:<EOL><INDENT>logging.debug('<STR_LIT>' % self.__query_spec())<EOL><DEDENT>connection.send_message(<EOL>message.query(self.__query_options(),<EOL>self.full_collection_name,<EOL>self.__skip, <EOL>self.__limit,<EOL>self.__query_spec(),<EOL>self.__fields), <EOL>callback=functools.partial(self._handle_response, orig_callback=callback))<EOL><DEDENT>except Exception as e:<EOL><INDENT>logging.debug('<STR_LIT>' % e)<EOL>connection.close()<EOL>raise<EOL><DEDENT>
Query the database.

        The `spec` argument is a prototype document that all results
        must match. For example:

        >>> db.test.find({"hello": "world"}, callback=...)

        only matches documents that have a key "hello" with value
        "world".  Matches can have other keys *in addition* to
        "hello". The `fields` argument is used to specify a subset of
        fields that should be included in the result documents. By
        limiting results to a certain subset of fields you can cut
        down on network traffic and decoding time.

        Raises :class:`TypeError` if any of the arguments are of
        improper type.

        :Parameters:
          - `spec` (optional): a SON object specifying elements which
            must be present for a document to be included in the
            result set
          - `fields` (optional): a list of field names that should be
            returned in the result set ("_id" will always be
            included), or a dict specifying the fields to return
          - `skip` (optional): the number of documents to omit (from
            the start of the result set) when returning the results
          - `limit` (optional): the maximum number of results to
            return
          - `timeout` (optional): if True, any returned cursor will be
            subject to the normal timeout behavior of the mongod
            process. Otherwise, the returned cursor will never timeout
            at the server. Care should be taken to ensure that cursors
            with timeout turned off are properly closed.
          - `snapshot` (optional): if True, snapshot mode will be used
            for this query. Snapshot mode assures no duplicates are
            returned, or objects missed, which were present at both
            the start and end of the query's execution. For details,
            see the `snapshot documentation
            <http://dochub.mongodb.org/core/snapshot>`_.
          - `tailable` (optional): the result of this find call will
            be a tailable cursor - tailable cursors aren't closed when
            the last data is retrieved but are kept open and the
            cursors location marks the final document's position. if
            more data is received iteration of the cursor will
            continue from the last document received. For details, see
            the `tailable cursor documentation
            <http://www.mongodb.org/display/DOCS/Tailable+Cursors>`_.
          - `sort` (optional): a list of (key, direction) pairs
            specifying the sort order for this query. See
            :meth:`~pymongo.cursor.Cursor.sort` for details.
          - `max_scan` (optional): limit the number of documents
            examined when performing the query
          - `slave_okay` (optional): is it okay to connect directly
            to and perform queries on a slave instance

        .. mongodoc:: find