Get a document or a page using its ID
        Won't instantiate them if they are not yet available
778432
def get(self, obj_id):
        
        if BasicPage.PAGE_ID_SEPARATOR in obj_id:
            (docid, page_nb) = obj_id.split(BasicPage.PAGE_ID_SEPARATOR)
            page_nb = int(page_nb)
            return self._docs_by_id[docid].pages[page_nb]
        return self._docs_by_id[obj_id]
666053
def get(self, sid):
        
        return DocumentContext(self._version, service_sid=self._solution['service_sid'], sid=sid, )
111295
def loadPage(self, number=0):
        """"""
        if self.isClosed or self.isEncrypted:
            raise ValueError("operation illegal for closed / encrypted doc")

        val = _fitz.Document_loadPage(self, number)

        if val:
            val.thisown = True
            val.parent = weakref.proxy(self)
            pageCount = self.pageCount
            n = number
            while n < 0: n += pageCount
            val.number = n
            self._page_refs[id(val)] = val
            val._annot_refs = weakref.WeakValueDictionary()


        return val
1140860
def get(self, id):
        
        url = self._url('%s' % (id))
        return self.client.get(url)
918545
def _get(self, *args, **kwargs):
        """"""
        prev_data = kwargs.pop('prev_data', [])
        resp = self._request('get', *args, **kwargs)
        resp_content = resp._content
        if not resp_content:
            # No content so its obviously not paginated
            return resp

        # if resp._content is a bytes object, decode it so we can loads it as json
        if isinstance(resp_content, bytes):
            resp_content = resp_content.decode('utf-8')

        # Load the json so we can use the data as python objects
        content = json.loads(resp_content)
        if 'pagination' not in content:
            # Result is not paginated
            return resp

        page_info = content['pagination']
        if not page_info['next_uri']:
            # next_uri is None when the cursor has been iterated to the last element
            content['data'].extend(prev_data)
            # If resp._content was is a bytes object, only set it as a bytes object
            if isinstance(resp_content, bytes):
                resp._content = json.dumps(content).decode('utf-8')
            else:
                resp._content = json.dumps(content)
            return resp

        prev_data.extend(content['data'])
        next_page_id = page_info['next_uri'].split('=')[-1]
        kwargs.update({
            'prev_data': prev_data,
            'params': {'starting_after': next_page_id}
        })
        return self._get(*args, **kwargs)
1051359
def get(cls, id):
        '''  '''

        if not id:
            return None

        redis = cls.get_redis()
        key = '{}:{}:obj'.format(cls.cls_key(), id)

        if not redis.exists(key):
            return None

        obj = cls(id=id)
        obj._persisted = True

        data = debyte_hash(redis.hgetall(key))

        for fieldname, field in obj.proxy:
            value = field.recover(data, redis)

            setattr(
                obj,
                fieldname,
                value
            )

        return obj
411088
def clone(self, document):
		'''  '''

		wrapped = document.wrap()
		if '_id' in wrapped:
			del wrapped['_id']
		return type(document).unwrap(wrapped, session=self)
838236
def unavailable(from)
      doc = Document.new
      doc.create_element('presence',
        'from' => from.to_s,
        'id'   => Kit.uuid,
        'type' => 'unavailable')
    end
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())
65778
def id_exists(api, search_id):
    
    response = utils.checked_api_call(api, 'get_specific', id=search_id)
    return response is not None
303791
function (id) {
            var description = this._requests[id];
            if (!description) {
                // The request was aborted
                return;
            }
            var request = description.request;
            var callback = description.cb;

            var iFrame = request.iFrame;
            var responseText, contentDocument = iFrame.contentDocument, contentWindow;

            if (contentDocument == null) {
                var contentWindow = iFrame.contentWindow;
                if (contentWindow) {
                    contentDocument = contentWindow.document;
                }
            }
            if (contentDocument) {
                var body = contentDocument.body || contentDocument.documentElement;
                if (body) {
                    // this is for content displayed as text:
                    responseText = body.textContent || body.outerText;
                }
                var xmlDoc = contentDocument.XMLDocument;
                // In IE, contentDocument contains a transformation of the document
                // see: http://www.aspnet-answers.com/microsoft/JScript/29847637/javascript-ie-xml.aspx
                if (xmlDoc) {
                    contentDocument = xmlDoc;
                }
            }

            this._deleteRequest(request);

            var response = {
                status : 200,
                responseText : responseText,
                responseXML : contentDocument
            };

            callback.fn.call(callback.scope, false, callback.args, response);
        }
96888
def _getEventFromUid(self, request, uid):
        """"""
        event = getEventFromUid(request, uid) # might raise ObjectDoesNotExist
        home = request.site.root_page
        if event.get_ancestors().filter(id=home.id).exists():
            # only return event if it is in the same site
            return event
148064
def find_by_id(self, attachment, params={}, **options): 
        
        path = "/attachments/%s" % (attachment)
        return self.client.get(path, params, **options)
1291946
function getDocument(element, callback) {
                        //Opera 12 seem to call the object.onload before the actual document has been created.
                        //So if it is not present, poll it with an timeout until it is present.
                        //TODO: Could maybe be handled better with object.onreadystatechange or similar.
                        if(!element.contentDocument) {
                            setTimeout(function checkForObjectDocument() {
                                getDocument(element, callback);
                            }, 100);

                            return;
                        }

                        callback(element.contentDocument);
                    }
1305937
def get(self, id):
        
        try:
            if self.request.headers.get("Id"):
                object_ = yield self.client.find_one({self.request.headers.get("Id"): id})
            else:
                object_ = yield self.client.find_one_by_id(id)

            if object_:
                self.write(object_)
                return

            self.raise_error(404, "%s/%s not found" % (self.object_name, id))

        except InvalidId as ex:
            self.raise_error(400, message="Your ID is malformed: %s" % id)
        except Exception as ex:
            self.logger.error(ex)
            self.raise_error()
595223
def get(cls, id):
        '''
        
        '''
        client = cls._new_api_client()
        return client.make_request(cls, 'get', url_params={'id': id})
860699
def _get_document(self, source):
        """"""
        scheme_url = source
        if not source.startswith("http"):
            scheme_url = "http://%s" % source

        text = source

        try:
            text = urllib.urlopen(scheme_url).read()
        except:
            pass
        else:
            return (text, scheme_url)

        try:
            text = open(source, "r").read()
        except:
            pass
        else:
            return (text, source)

        return (text, None)