Get the owner document that is associated with the current thread
17030
public static Document getOwnerDocument()
   {
      Document doc = documentThreadLocal.get();
      if (doc == null)
      {
         doc = getDocumentBuilder().newDocument();
         documentThreadLocal.set(doc);
      }
      return doc;
   }
707757
def <<(object)
            owner = object.document

            #
            # Does object belongs to another PDF ?
            #
            if owner and not owner.equal?(self)
                import object
            else
                add_to_revision(object, @revisions.last)
            end
        end
357072
def fetch(included_filename)
      if source = @cache[included_filename]
        return source
      end

      if @m.locked? && @owns_lock == Thread.current
        @cache[included_filename] = yield
      else
        ret = nil
        @cache[included_filename] = @m.synchronize do
          begin
            @owns_lock = Thread.current
            ret = yield
          ensure
            @owns_lock = nil
          end
        end
        ret
      end
    end
964746
def getThread(self, name):
		
		if not name in self.thread_list:
			self.logger.error("Thread {0} is not registered!".format(name))
			raise Exception("Thread {0} is not registered!".format(name))

		return self.thread_list[name]
957949
def get_current_thread_id(thread):
    '''
    
    '''
    try:
        # Fast path without getting lock.
        tid = thread.__pydevd_id__
        if tid is None:
            # Fix for https://www.brainwy.com/tracker/PyDev/645
            # if __pydevd_id__ is None, recalculate it... also, use an heuristic
            # that gives us always the same id for the thread (using thread.ident or id(thread)).
            raise AttributeError()
    except AttributeError:
        tid = _get_or_compute_thread_id_with_lock(thread, is_current_thread=True)

    return tid
779479
public static Document getOwnerDocument(Node n) {
    return n == null || !isElement(n) ? null : n.getNodeType() == Node.DOCUMENT_NODE
        ? n.<Document> cast() : n.getOwnerDocument();
  }
1342889
def document(self):
        
        if self.is_document:
            return self
        return self.adapter.wrap_document(self.adapter.impl_document)
1054065
function ownerDocument(componentOrElement) {
    var elem = ReactDOM.findDOMNode(componentOrElement);
    return elem && elem.ownerDocument || document;
}
813880
def get_current_object(self):
        
        if not hasattr(self.__local, '__release_local__'):
            return self.__local()
        try:
            return getattr(self.__local, self.__name__)
        except AttributeError:
            raise RuntimeError('no object bound to %s' % self.__name__)
814225
public static int getTotalThreadCount() {
		ThreadGroup parentThread = Thread.currentThread().getThreadGroup();
		while(null != parentThread.getParent()) {
			parentThread = parentThread.getParent();
		}
		return parentThread.activeCount();
	}
641816
def get_async_doc(id, opts = {})
      data, _status_code, _headers = get_async_doc_with_http_info(id, opts)
      return data
    end
12803
public void updateDocumentInfo(DocumentReference docref,
            String documentType, String ownerType, Long ownerId, Integer statusCode, String statusMessage) throws DataAccessException {
        TransactionWrapper transaction=null;
        try {
            transaction = startTransaction();
            engineImpl.updateDocumentInfo(docref, documentType, ownerType, ownerId, statusCode, statusMessage);
        } catch (DataAccessException e) {
            if (canRetryTransaction(e)) {
                transaction = (TransactionWrapper)initTransactionRetry(transaction);
                ((ProcessExecutor)getTransactionRetrier()).updateDocumentInfo(docref, documentType, ownerType, ownerId, statusCode, statusMessage);
            }
            else
                throw e;
        } finally {
            stopTransaction(transaction);
        }
    }
558103
def get(self, copy=False):
        """"""
        array = getattr(self.owner, self.name)
        if copy:
            return array.copy()
        else:
            return array
728056
def user(self):
        
        # Note, do any tasks really have an "owner_id", or are they all
        # "owner"?
        owner_id = getattr(self.task, 'owner_id', self.task.owner)
        return self.task.connection.cache.user_name(owner_id)
1154777
def get(self, master_id):
        
        collection_name = self.request.headers.get("collection")
        self.client = BaseAsyncMotorDocument("%s_revisions" % collection_name)

        limit = self.get_query_argument("limit", 2)
        add_current_revision = self.get_arg_value_as_type("addCurrent",
                                                          "false")
        show_history = self.get_arg_value_as_type("showHistory", "false")

        objects_processed = []

        if isinstance(limit, unicode):
            limit = int(limit)

        objects = yield self.client.find({"master_id": master_id,
                                          "processed": False},
                                         orderby="toa",
                                         order_by_direction=1,
                                         page=0,
                                         limit=20)

        # If this is a document that should have a revision and doesn't we
        # orchestratioin creation of the first one
        if len(objects) == 0:

            new_revision = yield self.__lazy_migration(master_id)
            if not new_revision:
                return

        if show_history:
            objects_processed = yield self.client.find({"master_id": master_id,
                                                        "processed": True},
                                                       orderby="toa",
                                                       order_by_direction=-1,
                                                       page=0,
                                                       limit=limit)

        elif add_current_revision:
            objects_processed = yield self.client.find({"master_id": master_id,
                                                        "processed": True},
                                                       orderby="toa",
                                                       order_by_direction=-1,
                                                       page=0,
                                                       limit=1)

        if len(objects_processed) > 0:
            objects_processed = objects_processed[::-1]
            objects_processed[-1]["current"] = True
            objects = objects_processed + objects

        self.write({
            "count": len(objects),
            "results": objects
        })
717397
@InterfaceAudience.Public
    public Document getDocument() {
        if (getDocumentId() == null) {
            return null;
        }
        assert (database != null);
        Document document = database.getDocument(getDocumentId());
        document.loadCurrentRevisionFrom(this);
        return document;
    }
640793
def owned(self):
        
        stored_token = self.redis.get(self.name)
        # need to always compare bytes to bytes
        # TODO: this can be simplified when the context manager is finished
        if stored_token and not isinstance(stored_token, bytes):
            encoder = self.redis.connection_pool.get_encoder()
            stored_token = encoder.encode(stored_token)
        return self.local.token is not None and \
            stored_token == self.local.token