read the doc back out from the database. we don't store the _id or _rev because we already have _doc_id_rev.
330628
function decodeDoc(doc) {
  if (!doc) {
    return doc;
  }
  var idx = doc._doc_id_rev.lastIndexOf(':');
  doc._id = doc._doc_id_rev.substring(0, idx - 1);
  doc._rev = doc._doc_id_rev.substring(idx + 1);
  delete doc._doc_id_rev;
  return doc;
}
742761
function(index) {
      var that = this;

      return this.readByIndex(index).then(function(doc) {
        return that.delete(doc[that._dbType.id]);
      });
    }
1026198
function read_wb_ID(d, opts) {
	var o = opts || {}, OLD_WTF = !!o.WTF; o.WTF = true;
	try {
		var out = SYLK.to_workbook(d, o);
		o.WTF = OLD_WTF;
		return out;
	} catch(e) {
		o.WTF = OLD_WTF;
		if(!e.message.match(/SYLK bad record ID/) && OLD_WTF) throw e;
		return PRN.to_workbook(d, opts);
	}
}
33388
def save_doc(self, doc, doc_id=None, following_attachments=None):
        ''''''

        self.log("save_document called for doc: %r", doc)

        d = defer.Deferred()

        try:
            if not isinstance(doc, (str, unicode, )):
                raise ValueError('Doc should be either str or unicode')
            doc = json.loads(doc)
            doc = self._set_id_and_revision(doc, doc_id)

            self.increase_stat('save_doc')

            self._documents[doc['_id']] = doc
            if doc['_id'] not in self._attachments:
                self._attachments[doc['_id']] = dict()
            attachments = doc.get('_attachments', dict())
            for name in attachments:
                if attachments[name].get('follows'):
                    if name not in following_attachments:
                        raise ValueError("Document id %s had attachment name"
                                         " %s marked with follows=True, but"
                                         " it was not passed to save_doc() "
                                         % (doc['_id'], name))

                    del attachments[name]['follows']
                    attachments[name]['stub'] = True
                    b = following_attachments[name].get_body()
                    self._attachments[doc['_id']][name] = b

                elif name not in self._attachments[doc['_id']]:
                    raise ValueError("Document id %s body has attachment "
                                     "named %s "
                                     "but it is not in our cache " %
                                     (doc['_id'], name))
            for name in self._attachments[doc['_id']].keys():
                if name not in attachments:
                    del self._attachments[doc['_id']][name]
                    self.log('Deleted attachment %s of the doc: %s because '
                             'its not in the _attachments key' %
                             (name, doc['_id']))

            self._expire_cache(doc['_id'])

            r = Response(ok=True, id=doc['_id'], rev=doc['_rev'])
            self._analize_changes(doc)
            d.callback(r)
        except (ConflictError, ValueError, ) as e:
            d.errback(e)

        return d
87103
def revisionId(self):
        
        log.warning("'RevisionId' requested, ensure that you are don't need 'id'")
        revision_id = self.json()['revisionId']
        assert revision_id == self.id, "RevisionId differs id-{}!=revisionId-{}".format(self.id, revision_id)
        return revision_id
1352232
def _read_doc():
    
    if sys.version_info.major == 2:
        with open('pefile.py', 'r') as f:
            tree = ast.parse(f.read())
    else:
        with open('pefile.py', 'r', encoding='utf-8') as f:
            tree = ast.parse(f.read())
    return ast.get_docstring(tree)
865959
def _getNewXref(self):
        """"""
        if self.isClosed or self.isEncrypted:
            raise ValueError("operation illegal for closed / encrypted doc")

        return _fitz.Document__getNewXref(self)
289036
def as_doc(self):
        
        doc = SON([("$ref", self.collection),
                   ("$id", self.id)])
        if self.database is not None:
            doc["$db"] = self.database
        doc.update(self.__kwargs)
        return doc
751941
def read( handle, id=None ):
    

    from Bio.PDB import PDBParser
    
    if not id:
        id = os.path.basename(handle).split('.')[0] # Get from filename
    
    p = PDBParser()
    s = p.get_structure(id, handle)

    return s
332072
private MethodHandle findIdReadMethod() {
    try {
      Method readMethod = clazz.getMethod(READ_METHOD_NAME);
      Class<?> dataClass = readMethod.getReturnType();
      DataType dataType = IdentifierMetadata.DataType.forClass(dataClass);
      if (dataType == null) {
        String pattern = "Method %s in class %s must have a return type of long, Long or String";
        String error = String.format(pattern, READ_METHOD_NAME, clazz.getName());
        throw new EntityManagerException(error);
      }
      return MethodHandles.lookup().unreflect(readMethod);
    } catch (NoSuchMethodException | SecurityException | IllegalAccessException exp) {
      String error = String.format("Class %s must have a public %s method", clazz.getName(),
          READ_METHOD_NAME);
      throw new EntityManagerException(error, exp);
    }
  }
867529
public Response remove(String id, String rev) {
        assertNotEmpty(id, "id");
        assertNotEmpty(id, "rev");
        return db.remove(ensureDesignPrefix(id), rev);

    }
881996
def detach(doc_id, doc_rev, attachment_name=nil)

      if attachment_name.nil?
        attachment_name = doc_rev
        doc_rev = doc_id['_rev']
        doc_id = doc_id['_id']
      end

      attachment_name = attachment_name.gsub(/\//, '%2F')

      path = adjust("#{doc_id}/#{attachment_name}?rev=#{doc_rev}")

      @http.delete(path)
    end
682639
def destroy(bulk=false)
      caught = catch(:halt)  do
        _run_destroy_callbacks do
          result = database.delete_doc(self, bulk)
          if result['ok']
            self.delete('_rev')
            self.delete('_id')
          end
          result['ok']
        end
      end
    end
915219
def get_doc(self, doc_id):
        
        resp = self._r_session.get('/'.join([self._scheduler, 'docs', '_replicator', doc_id]))
        resp.raise_for_status()
        return response_to_json_dict(resp)
33831
def fetchDocument(self, key, rawResults = False, rev = None) :
        """"""
        url = "%s/%s/%s" % (self.documentsURL, self.name, key)
        if rev is not None :
            r = self.connection.session.get(url, params = {'rev' : rev})
        else :
            r = self.connection.session.get(url)

        if r.status_code < 400 :
            if rawResults :
                return r.json()
            return self.documentClass(self, r.json())
        elif r.status_code == 404 :
            raise DocumentNotFoundError("Unable to find document with _key: %s" % key, r.json())
        else :
            raise DocumentNotFoundError("Unable to find document with _key: %s, response: %s" % (key, r.json()), r.json())
833310
def fetch_object(self, doc_id):
        """"""
        try:
            return self.object_class.objects.get(pk=doc_id)
        except self.object_class.DoesNotExist:
            raise ReferenceNotFoundError
32252
def reload(self):
        

        old_doc = self.mongokat_collection.find_one({"_id": self['_id']}, read_use="primary")

        if not old_doc:
            raise OperationFailure('Can not reload an unsaved document.'
                                   ' %s is not found in the database. Maybe _id was a string and not ObjectId?' % self['_id'])
        else:
            for k in list(self.keys()):
                del self[k]
            self.update(dotdict(old_doc))

        self._initialized_with_doc = False