class_docstr: This class extract relations, objects or triplets from Wikidata HDT file.
class_docstr_tok: ["This","class","extract","relations",",","objects","or","triplets","from","Wikidata","HDT","file","."]
code: def find_object(
      self, entity: str, rel: str, direction: str
  ) -> List[str]:
      objects = []
      if not direction:
          direction = "forw"
      if self.file_format == "hdt":
          entity = f"{self.prefixes['entity']}/{entity.split('/')[-1]}"
          rel = f"{self.prefixes['rels']['direct']}/{rel}"
          if direction == "forw":
              triplets, cnt = self.document.search_triples(
                  entity, rel, ""
              )
              if cnt < self.max_comb_num:
                  objects.extend(
                      [
                          triplet[2].split("/")[-1]
                          for triplet in triplets
                      ]
                  )
          else:
              triplets, cnt = self.document.search_triples(
                  "", rel, entity
              )
              objects.extend(
                  [triplet[0].split("/")[-1] for triplet in triplets]
              )
      else:
          entity = entity.split("/")[-1]
          rel = rel.split("/")[-1]
          triplets = self.document.get(entity, {}).get(direction, [])
          triplets = self.uncompress(triplets)
          for found_rel, *objects in triplets:
              if rel == found_rel:
                  objects.extend(objects)
      return objects
  
imports: import datetime
  import re
  from collections import namedtuple
  from logging import getLogger
  from typing import List, Tuple, Dict, Any, Union
  from hdt import HDTDocument
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.file import load_pickle, read_json
  from deeppavlov.core.common.registry import register
label_desc: Use image node_id 13 for calling the WikiParser obj's underlying member method code with example usage: obj.find_object(entity, rel, direction) and returns: objects