original_string: public function lookup(EntityInterface $entity) {
      if ($entity->id() != NULL) {
        $drupal_uri = $entity->toUrl()->setAbsolute()->toString();
        $drupal_uri .= '?_format=jsonld';
        $token = "Bearer " . $this->jwtProvider->generateToken();
        $linked_uri = $this->geminiClient->findByUri($drupal_uri, $token);
        if (!is_null($linked_uri)) {
          if (is_array($linked_uri)) {
            $linked_uri = reset($linked_uri);
          }
          return $linked_uri;
        }
      }
      // Return null if we weren't in a saved entity or we didn't find a uri.
      return NULL;
    }
code: public function lookup(EntityInterface $entity) {
      if ($entity->id() != NULL) {
        $drupal_uri = $entity->toUrl()->setAbsolute()->toString();
        $drupal_uri .= '?_format=jsonld';
        $token = "Bearer " . $this->jwtProvider->generateToken();
        $linked_uri = $this->geminiClient->findByUri($drupal_uri, $token);
        if (!is_null($linked_uri)) {
          if (is_array($linked_uri)) {
            $linked_uri = reset($linked_uri);
          }
          return $linked_uri;
        }
      }
      // Return null if we weren't in a saved entity or we didn't find a uri.
      return NULL;
    }
code_tokens: public function lookup ( EntityInterface $ entity ) { if ( $ entity -> id ( ) != NULL ) { $ drupal_uri = $ entity -> toUrl ( ) -> setAbsolute ( ) -> toString ( ) ; $ drupal_uri .= '?_format=jsonld' ; $ token = "Bearer " . $ this -> jwtProvider -> generateToken ( ) ; $ linked_uri = $ this -> geminiClient -> findByUri ( $ drupal_uri , $ token ) ; if ( ! is_null ( $ linked_uri ) ) { if ( is_array ( $ linked_uri ) ) { $ linked_uri = reset ( $ linked_uri ) ; } return $ linked_uri ; } } // Return null if we weren't in a saved entity or we didn't find a uri. return NULL ; }
docstring: Lookup this entity's URI in the Gemini db and return the other URI.
  
  @param \Drupal\Core\Entity\EntityInterface $entity
  The entity to look for.
  
  @return string|null
  Return the URI or null
  
  @throws \Drupal\Core\Entity\EntityMalformedException
  If the entity cannot be converted to a URL.
docstring_tokens: Lookup this entity s URI in the Gemini db and return the other URI .