code: def bedpe_parser(filename: str) -> Iterable[range_pb2.Range]:
      """Parses Range objects from a BEDPE-formatted file object.
  
      See http://bedtools.readthedocs.org/en/latest/content/general-usage.html
      for more information on the BEDPE format.
  
      Skips events that span across chromosomes. For example, if the starting
      location is on chr1 and the ending location is on chr2, that record will
      not appear in the output.
  
      Args:
        filename: file name of a BEDPE-formatted file.
  
      Yields:
        nucleus.genomics.v1.Range protobuf objects.
      """
      with epath.Path(filename).open("r") as fp:
          for line in fp:
              parts = line.split("\t")
              if parts[0] == parts[3]:
                  # only keep events on the same chromosome
                  yield make_range(
                      parts[0], int(parts[1]), int(parts[5])
                  )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import re
  from typing import Dict, Iterable, Optional, Sequence
  from absl import logging
  from etils import epath
  import intervaltree
  import six
  from third_party.nucleus.io import bed
  from third_party.nucleus.protos import position_pb2
  from third_party.nucleus.protos import range_pb2
  from third_party.nucleus.protos import reference_pb2
  from third_party.nucleus.protos import variants_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: bedpe_parser(filename) without return types