code: def make_tsv_for_entities(
      model: MultiRelationEmbedder,
      checkpoint_manager: CheckpointManager,
      entity_storage: AbstractEntityStorage,
      entities_tf: TextIO,
  ) -> None:
      print("Writing entity embeddings...")
      for ent_t_name, ent_t_config in model.entities.items():
          for partition in range(ent_t_config.num_partitions):
              print(
                  f"Reading embeddings for entity type {ent_t_name} partition "
                  f"{partition} from checkpoint..."
              )
              entities = entity_storage.load_names(
                  ent_t_name, partition
              )
              embeddings, _ = checkpoint_manager.read(
                  ent_t_name, partition
              )
  
              if model.global_embs is not None:
                  embeddings += model.global_embs[
                      model.EMB_PREFIX + ent_t_name
                  ]
  
              print(
                  f"Writing embeddings for entity type {ent_t_name} partition "
                  f"{partition} to output file..."
              )
              for ix in range(len(embeddings)):
                  write(entities_tf, (entities[ix],), embeddings[ix])
                  if (ix + 1) % 5000 == 0:
                      print(
                          f"- Processed {ix+1}/{len(embeddings)} entities so far..."
                      )
              print(f"- Processed all {len(embeddings)} entities")
  
      entities_output_filename = getattr(
          entities_tf, "name", "the output file"
      )
      print(f"Done exporting entity data to {entities_output_filename}")
  
file_path: PyTorch-BigGraph/torchbiggraph/converters/export_to_tsv.py
imports: import argparse
  from typing import Iterable, TextIO
  from torchbiggraph.checkpoint_manager import CheckpointManager
  from torchbiggraph.config import ConfigFileLoader, ConfigSchema
  from torchbiggraph.graph_storages import AbstractEntityStorage, AbstractRelationTypeStorage, ENTITY_STORAGES, RELATION_TYPE_STORAGES
  from torchbiggraph.model import make_model, MultiRelationEmbedder
label_desc: Use image node_id 3 for calling a global function with example usage: make_tsv_for_entities(model, checkpoint_manager, entity_storage, entities_tf) without return types