docstr: Calculate limitation of number of initial operands for bands.
  
  Parameters
  ----------
  initial_count : int
      Number of nodes that is ready for running.
  occupied : dict
     Band to those initials that already assigned.
  
  Returns
  -------
  slot_assign_limits: dict
      Slot to limitation of number of initial operands.
docstr_tok: ["Calculate","limitation","of","number","of","initial","operands","for","bands",".","Parameters","--","--","--","--","--","initial_count",":","int","Number","of","nodes","that","is","ready","for","running",".","occupied",":","dict","Band","to","those","initials","that","already","assigned",".","Returns","--","--","--","-","slot_assign_limits",":","dict","Slot","to","limitation","of","number","of","initial","operands","."]
code: def _calc_band_assign_limits(
      self, initial_count: int, occupied: Dict[BandType, int]
  ) -> Dict[BandType, int]:
      """
      Calculate limitation of number of initial operands for bands.
  
      Parameters
      ----------
      initial_count : int
          Number of nodes that is ready for running.
      occupied : dict
         Band to those initials that already assigned.
  
      Returns
      -------
      slot_assign_limits: dict
          Slot to limitation of number of initial operands.
      """
      actual_count: int = initial_count - sum(occupied.values())
      band_slots = sorted(
          self.get_device_band_slots().items(),
          key=itemgetter(1),
          reverse=True,
      )
      bands: List[BandType] = [it[0] for it in band_slots]
      slots = np.asarray([it[1] for it in band_slots], dtype=np.float32)
  
      # remove assigned nodes from limitations
      counts = initial_count * slots / slots.sum()
      for i, band in enumerate(bands):
          counts[i] = max(0, counts[i] - occupied.get(band, 0))
  
      # all assigned, nothing to do
      if counts.sum() == 0:
          return {band: 0 for band in bands}
  
      # assign remaining nodes
      counts = (actual_count * counts / counts.sum()).astype(np.int32)
      pos = 0
      rest = actual_count - counts.sum()
      while rest > 0:
          counts[pos] += 1
          rest -= 1
          pos = (pos + 1) % len(counts)
      return dict(zip(bands, counts))
  
imports: from abc import ABC, abstractmethod
  from collections import defaultdict
  from operator import itemgetter
  from typing import List, Dict, Union
  import numpy
  from ....core import ChunkGraph, ChunkData
  from ....core.operand import Operand, Fetch
  from ....lib.ordered_set import OrderedSet
  from ....resource import Resource
  from ....typing import BandType
  from ....utils import implements
label_desc: Use image node_id 2 for calling the GraphAssigner obj's underlying member method code with example usage: obj._calc_band_assign_limits(initial_count, occupied) and returns: dict, unknown