code: def _transform_xy(dataset, xy):
      # Transform x, y coordinates to row, col
      # Chunked to reduce calls, thus unnecessary overhead, to rowcol()
      dt = dataset.transform
      _xy = iter(xy)
      while True:
          buf = tuple(islice(_xy, 0, 256))
          if not buf:
              break
          x, y = rowcol(dt, *zip(*buf))
          yield from zip(x, y)
  
file_path: rasterio/rasterio/sample.py
imports: import numpy
  from itertools import islice
  from rasterio.enums import MaskFlags
  from rasterio.windows import Window
  from rasterio.transform import rowcol
label_desc: Use image node_id 1 for calling a global function with example usage: _transform_xy(dataset, xy) without return types