class_docstr: Generic GDAL transformer base class
  
  Notes
  -----
  Subclasses must have a _transformer attribute and implement a `_transform` method.
docstr: Returns geographic coordinates given dataset rows and cols coordinates
  
  Parameters
  ----------
  rows, cols : int or list of int
      Image pixel coordinates
  zs : float or list of float, optional
      Height associated with coordinates. Primarily used for RPC based
      coordinate transformations. Ignored for affine based
      transformations. Default: 0.
  offset : str, optional
      Determines if the returned coordinates are for the center of the
      pixel or for a corner. Available options include center, ul, ur, ll,
      lr.
  Raises
  ------
  ValueError
      If input coordinates are not all equal length
  
  Returns
  -------
  tuple of float or list of float
docstr_tok: ["Returns","geographic","coordinates","given","dataset","rows","and","cols","coordinates","Parameters","--","--","--","--","--","rows",",","cols",":","int","or","list","of","int","Image","pixel","coordinates","zs",":","float","or","list","of","float",",","optional","Height","associated","with","coordinates",".","Primarily","used","for","RPC","based","coordinate","transformations",".","Ignored","for","affine","based","transformations",".","Default",":","0.","offset",":","str",",","optional","Determines","if","the","returned","coordinates","are","for","the","center","of","the","pixel","or","for","a","corner",".","Available","options","include","center",",","ul",",","ur",",","ll",",","lr",".","Raises","--","--","--","ValueError","If","input","coordinates","are","not","all","equal","length","Returns","--","--","--","-","tuple","of","float","or","list","of","float"]
code: def xy(self, rows, cols, zs=None, offset="center"):
      """
      Returns geographic coordinates given dataset rows and cols coordinates
  
      Parameters
      ----------
      rows, cols : int or list of int
          Image pixel coordinates
      zs : float or list of float, optional
          Height associated with coordinates. Primarily used for RPC based
          coordinate transformations. Ignored for affine based
          transformations. Default: 0.
      offset : str, optional
          Determines if the returned coordinates are for the center of the
          pixel or for a corner. Available options include center, ul, ur, ll,
          lr.
      Raises
      ------
      ValueError
          If input coordinates are not all equal length
  
      Returns
      -------
      tuple of float or list of float
  
      """
      AS_ARR = True if hasattr(rows, "__iter__") else False
      rows, cols, zs = self._ensure_arr_input(rows, cols, zs=zs)
  
      if offset == "center":
          coff, roff = (0.5, 0.5)
      elif offset == "ul":
          coff, roff = (0, 0)
      elif offset == "ur":
          coff, roff = (1, 0)
      elif offset == "ll":
          coff, roff = (0, 1)
      elif offset == "lr":
          coff, roff = (1, 1)
      else:
          raise TransformError("Invalid offset")
  
      try:
          # shift input coordinates according to offset
          T = IDENTITY.translation(coff, roff)
          identity_transformer = AffineTransformer(T)
          offset_cols, offset_rows = identity_transformer._transform(
              cols,
              rows,
              zs,
              transform_direction=TransformDirection.forward,
          )
          new_xs, new_ys = self._transform(
              offset_cols,
              offset_rows,
              zs,
              transform_direction=TransformDirection.forward,
          )
          if len(new_xs) == 1 and not AS_ARR:
              return (new_xs[0], new_ys[0])
          else:
              return (list(new_xs), list(new_ys))
      except TypeError:
          raise TransformError("Invalid inputs")
  
imports: from contextlib import ExitStack
  from functools import partial
  import math
  import numpy
  import warnings
  from affine import Affine
  from rasterio.env import env_ctx_if_needed
  from rasterio._transform import _transform_from_gcps, RPCTransformerBase, GCPTransformerBase
  from rasterio.enums import TransformDirection, TransformMethod
  from rasterio.control import GroundControlPoint
  from rasterio.rpc import RPC
  from rasterio.errors import TransformError, RasterioDeprecationWarning
label_desc: Use image node_id 6 for calling the TransformerBase obj's underlying member method code with example usage: obj.xy(rows, cols, zs, offset) and returns: new_xs,  new_ys, list,  list