code: def process(
      input_name,
      output_name,
      streams,
      element_type,
      chunk_size=32 << 20,
  ):
      converters = build_converters(streams, element_type)
  
      output = open(output_name, "wb")
      # The very first 8 bytes of the file is the CBF magic number.
      output.write(struct.pack("<Q", MAGIC_NUMBER))
      # Next 4 bytes is the CBF version.
      output.write(struct.pack("<I", CBF_VERSION))
  
      header = Header(converters)
      chunk = Chunk()
  
      with open(input_name, "r") as input_file:
          sequence = []
          seq_id = None
          estimated_chunk_size = 0
          for line in input_file:
              (prefix, _) = line.rstrip().split("|", 1)
              prefix = prefix.strip()
              # if the sequence id is empty or not equal to the previous sequence id,
              # we are at a new sequence.
              if (not seq_id and not prefix) or (
                  len(prefix) > 0 and seq_id != prefix
              ):
                  if len(sequence) > 0:
                      estimated_chunk_size += process_sequence(
                          sequence, converters, chunk
                      )
                      sequence = []
                      if estimated_chunk_size >= chunk_size:
                          write_chunk(output, converters, chunk)
                          header.add_chunk(chunk)
                          chunk = Chunk()
                  seq_id = prefix
  
              sequence.append(line)
          # we must parse the last line
          if len(sequence) > 0:
              process_sequence(sequence, converters, chunk)
  
          write_chunk(output, converters, chunk)
          header.add_chunk(chunk)
  
          header.write(output)
  
          output.close()
  
imports: import sys
  import argparse
  import struct
  import os
  from collections import OrderedDict
label_desc: Use image node_id 5 for calling a global function with example usage: process(input_name, output_name, streams, element_type, chunk_size) without return types