code: def _process_one_batch(
      self, model: MultiRelationEmbedder, batch_edges: EdgeList
  ) -> Stats:
      with torch.no_grad():
          scores, _ = model(batch_edges)
  
      self._adjust_scores(scores, batch_edges)
  
      batch_size = len(batch_edges)
  
      loss = self.calc_loss(scores, batch_edges)
  
      ranks = []
      aucs = []
      if scores.lhs_neg.nelement() > 0:
          lhs_rank = (
              scores.lhs_neg >= scores.lhs_pos.unsqueeze(1)
          ).sum(1) + 1
          lhs_auc = compute_randomized_auc(
              scores.lhs_pos, scores.lhs_neg, batch_size
          )
          ranks.append(lhs_rank)
          aucs.append(lhs_auc)
  
      if scores.rhs_neg.nelement() > 0:
          rhs_rank = (
              scores.rhs_neg >= scores.rhs_pos.unsqueeze(1)
          ).sum(1) + 1
          rhs_auc = compute_randomized_auc(
              scores.rhs_pos, scores.rhs_neg, batch_size
          )
          ranks.append(rhs_rank)
          aucs.append(rhs_auc)
  
      return Stats(
          loss=float(loss),
          pos_rank=average_of_sums(*ranks),
          mrr=average_of_sums(
              *(rank.float().reciprocal() for rank in ranks)
          ),
          r1=average_of_sums(*(rank.le(1) for rank in ranks)),
          r10=average_of_sums(*(rank.le(10) for rank in ranks)),
          r50=average_of_sums(*(rank.le(50) for rank in ranks)),
          # At the end the AUC will be averaged over count.
          auc=batch_size * sum(aucs) / len(aucs),
          count=batch_size,
      )
  
imports: import argparse
  import logging
  import time
  from functools import partial
  from typing import Callable, Generator, List, Optional, Tuple
  import torch
  from torchbiggraph.batching import AbstractBatchProcessor, call, process_in_batches
  from torchbiggraph.bucket_scheduling import create_buckets_ordered_lexicographically
  from torchbiggraph.checkpoint_manager import CheckpointManager
  from torchbiggraph.config import add_to_sys_path, ConfigFileLoader, ConfigSchema
  from torchbiggraph.edgelist import EdgeList
  from torchbiggraph.graph_storages import EDGE_STORAGES
  from torchbiggraph.losses import LOSS_FUNCTIONS
  from torchbiggraph.model import make_model, MultiRelationEmbedder, Scores
  from torchbiggraph.stats import average_of_sums, Stats
  from torchbiggraph.types import Bucket, EntityName, Partition, UNPARTITIONED
  from torchbiggraph.util import compute_randomized_auc, create_pool, EmbeddingHolder, get_async_result, get_num_workers, set_logging_verbosity, setup_logging, split_almost_equally, SubprocessInitializer, tag_logs_with_process_name
label_desc: Use image node_id 1 for calling the RankingEvaluator obj's underlying member method code with example usage: obj._process_one_batch(model, batch_edges) and returns: Stats