class_docstr: Coloring a chunk graph according to an algorithm
  described in https://github.com/mars-project/mars/issues/2435
class_docstr_tok: ["Coloring","a","chunk","graph","according","to","an","algorithm","described","in","https",":","\/\/github.com\/mars-project\/mars\/issues\/2435"]
code: def _can_color_same(
      cls, chunk: ChunkType, predecessors: List[ChunkType]
  ) -> bool:
      if (
          # VirtualOperand cannot be fused
          any(
              isinstance(n.op, VirtualOperand)
              for n in [chunk] + predecessors
          )
          # allocated on different bands
          or len({n.op.gpu for n in [chunk] + predecessors}) > 1
          # expect worker changed
          or len({n.op.expect_worker for n in [chunk] + predecessors})
          > 1
          # scheduling hint tells that cannot be fused
          or (
              chunk.op.scheduling_hint is not None
              and not chunk.op.scheduling_hint.can_be_fused()
          )
      ):
          return False
      return True
  
file_path: mars/mars/services/task/analyzer/fusion.py
imports: import itertools
  from collections import defaultdict
  from typing import Dict, List
  from ....config import options
  from ....core import ChunkGraph
  from ....core.operand import VirtualOperand
  from ....typing import BandType, ChunkType, OperandType
label_desc: Use image node_id 3 for calling the Coloring obj's underlying member method code with example usage: obj._can_color_same(cls, chunk, predecessors) and returns: True, False