code: def _get_bands(inputs, sources, d, i=None):
      """Get a rasterio.Band object from calc's inputs."""
      idx = d if d in dict(inputs) else int(d) - 1
      src = sources[idx]
      return (
          rasterio.band(src, i)
          if i
          else [rasterio.band(src, j) for j in src.indexes]
      )
  
imports: from collections import OrderedDict, UserDict
  from contextlib import ExitStack
  import math
  from typing import Mapping
  import click
  import numpy
  import rasterio
  from rasterio._vendor import snuggs
  from rasterio.features import sieve
  from rasterio.fill import fillnodata
  from rasterio.rio import options
  from rasterio.rio.helpers import resolve_inout
  from rasterio.windows import Window
label_desc: Use image node_id 1 for calling a global function with example usage: _get_bands(inputs, sources, d, i) and returns: unknown