code: def open_doc(self, doc_id):
          '''Imitated fetching the document from the database.
          Doesnt implement options from paisley to get the old revision or
          get the list of revision.
          '''
          d = defer.Deferred()
          self.increase_stat('open_doc')
          try:
              doc = self._get_doc(doc_id)
              doc = copy.deepcopy(doc)
              if doc.get('_deleted', None):
                  raise NotFoundError('%s deleted' % doc_id)
              d.callback(Response(doc))
          except NotFoundError as e:
              d.errback(e)
  
          return f open_doc(self, doc_id):
          '''Imitated fetching the document from the database.
          Doesnt implement options from paisley to get the old revision or
          get the list of revision.
          '''
          d = defer.Deferred()
          self.increase_stat('open_doc')
          try:
              doc = self._get_doc(doc_id)
              doc = copy.deepcopy(doc)
              if doc.get('_deleted', None):
                  raise NotFoundError('%s deleted' % doc_id)
              d.callback(Response(doc))
          except NotFoundError as e:
              d.errback(e)
  
          return d
docs: Imitated fetching the document from the database.
          Doesnt implement options from paisley to get the old revision or
          get the list of revision.