Returns a mongo-ready doc for a single CBD
@param $docId
@param $context
@return array
194929
function to_tripod_array($docId,$context)
    {
        $docId = $this->_labeller->qname_to_alias($docId);
        $contextAlias = $this->_labeller->uri_to_alias($context);

        if ($docId!=null)
        {
            $subjects = $this->get_subjects();
            foreach ($subjects as $subject)
            {
                if ($subject==$docId)
                {
                    $graph = $this->get_subject_subgraph($subject);
                    $doc = $this->index_to_tarray($graph,$contextAlias);
                    return $doc;
                }
            }
        }
        return null;
    }
532319
public function getEntity($entityId)
    {
        if (isset($this->entities[$entityId])) {
            return $this->entities[$entityId];
        }

        $this->entities[$entityId] = $this->client->getEntity($entityId);

        return $this->entities[$entityId];
    }
359566
public function getTfIdf(DocumentAbstract $document, $token, $mode = 1)
    {
        return $this->getTermFrequency($document, $token, $mode) * $this->getIdf($token);
    }
106106
public function getContext( $id )
	{
		return isset( $this->contexts[ $id ] ) ? $this->contexts[ $id ] : null;
	}
436353
private int getNumDoc(String docID) {
    if (goneContext != null ) {
      removeDoc(docID);
    }
    for (int i = 0; i < documents.size(); i++) {
      if (documents.get(i).getDocID().equals(docID)) {  //  document exist
        if(!testMode && documents.get(i).getXComponent() == null) {
          XComponent xComponent = OfficeTools.getCurrentComponent(xContext);
          if (xComponent == null) {
            MessageHandler.printToLogFile("Error: Document (ID: " + docID + ") has no XComponent -> Internal space will not be deleted when document disposes");
          } else {
            try {
              xComponent.addEventListener(xEventListener);
            } catch (Throwable t) {
              MessageHandler.printToLogFile("Error: Document (ID: " + docID + ") has no XComponent -> Internal space will not be deleted when document disposes");
              xComponent = null;
            }
            if(xComponent != null) {
              documents.get(i).setXComponent(xContext, xComponent);
              MessageHandler.printToLogFile("Fixed: XComponent set for Document (ID: " + docID + ")");
            }
          }
        }
        return i;
      }
    }
    //  Add new document
    XComponent xComponent = null;
    if (!testMode) {              //  xComponent == null for test cases 
      xComponent = OfficeTools.getCurrentComponent(xContext);
      if (xComponent == null) {
        MessageHandler.printToLogFile("Error: Document (ID: " + docID + ") has no XComponent -> Internal space will not be deleted when document disposes");
      } else {
        try {
          xComponent.addEventListener(xEventListener);
        } catch (Throwable t) {
          MessageHandler.printToLogFile("Error: Document (ID: " + docID + ") has no XComponent -> Internal space will not be deleted when document disposes");
          xComponent = null;
        }
      }
    }
    documents.add(new SingleDocument(xContext, config, docID, xComponent));
    setMenuTextForSwitchOff(xContext);
    if (debugMode) {
      MessageHandler.printToLogFile("Document " + docNum + " created; docID = " + docID);
    }
    return documents.size() - 1;
  }
1071105
protected function getDescriptionDoc(MethodDoc $method) : array
    {
        $docDescription = [];
        if (null !== $method->getDescription()) {
            $docDescription['description'] = $method->getDescription();
        }

        $responseDescription = $this->getResponseDescription($method);
        if (null !== $responseDescription) {
            $hasInitialDescription = isset($docDescription['description'])
                && strlen($docDescription['description']) > 0
            ;
            $docDescription['description'] = sprintf(
                '%s%s%s',
                ($hasInitialDescription ? $docDescription['description'] : ''),
                ($hasInitialDescription ? "\n" : ''),
                $responseDescription
            );
        }

        return $docDescription;
    }
356872
public static function objectId($fieldId)
    {
        //====================================================================//
        // decode
        $result = self::isIdField($fieldId);
        if (empty($result)) {
            return false;
        }
        //====================================================================//
        // Return List Name
        return   $result['ObjectId'];
    }
538267
public LocalDocument getLocalDocument(final String docId) throws DocumentNotFoundException {
        Misc.checkState(this.isOpen(), "Database is closed");
        try {
            return get(queue.submit(new GetLocalDocumentCallable(docId)));
        } catch (ExecutionException e) {
            throw new DocumentNotFoundException(e);
        }
    }
102739
public function getDepartment($orgId, $departmentId)
    {
        $response = $this->doRequest(
            self::RESOURCE_GET_DEPARTMENT,
            [
                'orgId' => $orgId,
                'departmentId' => $departmentId
            ]
        );

        return Department::fromStream($response);
    }
495963
public function getAll($appId, $scanId, $issueId, array $queryParams = [])
    {
        $response = $this->api
            ->applications()
            ->scans()
            ->issues()
            ->contexts()
            ->getAll($appId, $scanId, $issueId, $queryParams);

        return new ContextsResponse($response);
    }
102829
public static function get_blockids_from_moduleid($moduleid) {
        global $DB;

        // Get the context of the module
        $contextid = context_module::instance($moduleid)->id;

        // Get all the block instances which parentcontextid is the module contextid
        $blockids = array();
        $instances = $DB->get_records('block_instances', array('parentcontextid' => $contextid), '', 'id');
        foreach ($instances as $instance) {
            $blockids[] = $instance->id;
        }
        return $blockids;
    }
1342724
public function update($docId, $doc)
    {
        return $this->montage->request(
            'post',
            $this->montage->url('document-detail', $this->schema->name, $docId),
            ['body' => json_encode($doc)]
        );
    }
453151
public function getProductsInCategoryByMetadata(int $categoryId, array $context) : array
    {
        Assert::that($categoryId)->greaterThan(0, 'The $categoryId has to be positive');
        Assert::that($context)->notEmpty();

        return (array)$this->master->doRequest(
            'POST',
            sprintf('/admin/WEBAPI/Endpoints/v1_0/ProductService/{KEY}/Products/%d', $categoryId),
            $context
        );
    }
1374614
function getCollection(docdbClient, nodeContext) {
    nodeContext.log(`Getting collection:\n${collectionName}\n`);
    var colldef = {id : collectionName};
    return new Promise((resolve, reject) => {
        docdbClient.readCollection(collectionUrl, (err, result) => {
            if (err) {
                if (err.code == HttpStatusCodes.NOTFOUND) {
                    docdbClient.createCollection(databaseUrl, colldef, { offerThroughput: 400 }, (err, created) => {
                        if (err) reject(err)
                        else resolve(created);
                    });
                } else {
                    reject(err);
                }
            } else {
                resolve(result);
            }
        });
    });
}
529990
protected function proxy() {
        if (!$this->context) {
            $this->context = new DocumentContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
101293
function getDoc (docName, qs0, callback0) {
      const { opts, callback } = getCallback(qs0, callback0)

      if (!docName) {
        if (callback) { callback(new Error('Invalid doc id'), null) }
      } else {
        return relax({ db: dbName, doc: docName, qs: opts }, callback)
      }
    }
1269034
public function getDocument($collection, $id, array $options = [])
    {
        $this->setOptions($options);
        $doc = new Document($this->client, $this->database, $collection);
        $doc->setHeaders($this->getHeaders());
        $rs = $doc->get($id);
        $this->checkResponse($rs);
        unset($rs['_curl_info']);

        return $rs;
    }