def get_idranges(names, counts, num_chunks=None):
    """
    counts will be a list of numbers of a dictionary.
    Length is less than or equal to the num_parts variable.

    Parameters:
    -----------
    names : list of strings
        which are either node-types or edge-types
    counts : list of integers
        which are total no. of nodes or edges for a give node
        or edge type
    num_chunks : int, optional
        specifying the no. of chunks

    Returns:
    --------
    dictionary
        dictionary where the keys are node-/edge-type names and values are
        list of tuples where each tuple indicates the range of values for
        corresponding type-ids.
    dictionary
        dictionary where the keys are node-/edge-type names and value is a tuple.
        This tuple indicates the global-ids for the associated node-/edge-type.
    """
    gnid_start = 0
    gnid_end = gnid_start
    tid_dict = {}
    gid_dict = {}

    for idx, typename in enumerate(names):
        gnid_end += counts[typename]
        tid_dict[typename] = [[0, counts[typename]]]
        gid_dict[typename] = np.array([gnid_start, gnid_end]).reshape([1, 2])
        gnid_start = gnid_end

    return tid_dict, gid_dict

    counts will be a list of numbers of a dictionary.
    Length is less than or equal to the num_parts variable.

    Parameters:
    -----------
    names : list of strings
        which are either node-types or edge-types
    counts : list of integers
        which are total no. of nodes or edges for a give node
        or edge type
    num_chunks : int, optional
        specifying the no. of chunks

    Returns:
    --------
    dictionary
        dictionary where the keys are node-/edge-type names and values are
        list of tuples where each tuple indicates the range of values for
        corresponding type-ids.
    dictionary
        dictionary where the keys are node-/edge-type names and value is a tuple.
        This tuple indicates the global-ids for the associated node-/edge-type.
    
tools/distpartitioning/utils.py