nodes: 0, module; 1, function_definition; 2, function_name:find_records; 3, parameters; 4, block; 5, identifier:self; 6, identifier:collection_name; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, expression_statement; 16, if_statement; 17, return_statement; 18, identifier:query; 19, dictionary; 20, identifier:sort_by; 21, None; 22, identifier:sort_direction; 23, None; 24, identifier:start; 25, integer:0; 26, identifier:limit; 27, None; 28, comment:"""
          Return a cursor of records from the given MongoDB collection.
  
          :param collection_name: Name of the MongoDB collection to query.
          :param query: Standard MongoDB query. By default no restriction.
          :param sort_by: Name of a single field to sort by.
          :param sort_direction: The direction to sort, "asc" or "desc".
          :param start: Skip first n results.
          :param limit: The maximum number of results to return.
  
          :return: Cursor -- An iterable with results.
          :raise DataSourceError
          """; 29, assignment; 30, comparison_operator:sort_by is not None; 31, block; 32, assignment; 33, comparison_operator:limit is not None; 34, block; 35, call; 36, identifier:cursor; 37, call; 38, identifier:sort_by; 39, None; 40, expression_statement; 41, identifier:cursor; 42, call; 43, identifier:limit; 44, None; 45, expression_statement; 46, identifier:MongoDbCursor; 47, argument_list; 48, attribute; 49, argument_list; 50, assignment; 51, attribute; 52, argument_list; 53, assignment; 54, identifier:cursor; 55, call; 56, identifier:find; 57, identifier:query; 58, identifier:cursor; 59, call; 60, identifier:cursor; 61, identifier:skip; 62, identifier:start; 63, identifier:cursor; 64, call; 65, attribute; 66, argument_list; 67, attribute; 68, argument_list; 69, attribute; 70, argument_list; 71, identifier:self; 72, identifier:_get_collection; 73, identifier:collection_name; 74, identifier:self; 75, identifier:_apply_sort; 76, identifier:cursor; 77, identifier:sort_by; 78, identifier:sort_direction; 79, identifier:cursor; 80, identifier:limit; 81, identifier:limit
code: def find_records(self, collection_name, query={}, sort_by=None,
                       sort_direction=None, start=0, limit=None):
          """
          Return a cursor of records from the given MongoDB collection.
  
          :param collection_name: Name of the MongoDB collection to query.
          :param query: Standard MongoDB query. By default no restriction.
          :param sort_by: Name of a single field to sort by.
          :param sort_direction: The direction to sort, "asc" or "desc".
          :param start: Skip first n results.
          :param limit: The maximum number of results to return.
  
          :return: Cursor -- An iterable with results.
          :raise DataSourceError
          """
          cursor = self._get_collection(collection_name).find(query)
          if sort_by is not None:
              cursor = self._apply_sort(cursor, sort_by, sort_direction)
          cursor = cursor.skip(start)
          if limit is not None:
              cursor = cursor.limit(limit)
          return MongoDbCursor(cursor)