code: def get_gid_offsets(typenames, typecounts):
      """
      Builds a map where the key-value pairs are typnames and respective
      global-id offsets.
  
      Parameters:
      -----------
      typenames : list of strings
          a list of strings which can be either node typenames or edge typenames
      typecounts : list of integers
          a list of integers indicating the total number of nodes/edges for its
          typeid which is the index in this list
  
      Returns:
      --------
      dictionary :
          a dictionary where keys are node_type names and values are
          global_nid range, which is a tuple.
  
      """
      assert len(typenames) == len(
          typecounts
      ), f"No. of typenames does not match with its type counts names = {typenames}, counts = {typecounts}"
  
      counts = []
      for name in typenames:
          counts.append(typecounts[name])
      starts = np.cumsum([0] + counts[:-1])
      ends = np.cumsum(counts)
  
      gid_offsets = {}
      for idx, name in enumerate(typenames):
          gid_offsets[name] = [starts[idx], ends[idx]]
      return gid_offsets
  
      """
      starts = np.cumsum([0] + type_counts[:-1])
      ends = np.cumsum(type_counts)
      gid_offsets = {}
      for idx, name in enumerate(typenames):
          gid_offsets[name] = [start[idx], ends[idx]]
  
      return gid_offsets
      """
  
imports: import json
  import logging
  import os
  from itertools import cycle
  import constants
  import dgl
  import numpy
  import psutil
  import pyarrow
  import torch
  from dgl.distributed.partition import _dump_part_config
  from pyarrow import csv
label_desc: Use image node_id 7 for calling a global function with example usage: get_gid_offsets(typenames, typecounts) and returns: gid_offsets