code: def batch_edges_mix_relation_types(
      edges: EdgeList, *, batch_size: int
  ) -> Iterable[EdgeList]:
      """Split the edges in batches that can contain multiple relation types
  
      The output preserves the input's order. Batches are all of the same size,
      except possibly the last one.
      """
      for offset in range(0, len(edges), batch_size):
          yield edges[offset : offset + batch_size]
  
file_path: PyTorch-BigGraph/torchbiggraph/batching.py
imports: import time
  from abc import ABC, abstractmethod
  from typing import Any, Callable, Dict, Iterable, List, Optional
  import torch
  from torchbiggraph.edgelist import EdgeList
  from torchbiggraph.losses import AbstractLossFunction
  from torchbiggraph.model import MultiRelationEmbedder, override_model, Scores
  from torchbiggraph.stats import Stats
  from torchbiggraph.types import LongTensorType
label_desc: Use image node_id 2 for calling a global function with example usage: batch_edges_mix_relation_types(edges) without return types