def METHOD_NAME(x, y, trans):
    """
    Transform coordinates from source to target system.
    :arg x,y: coordinates, float or numpy.array_like
    :kwarg trans: pyproj Transformer object
    """
    x_is_array = isinstance(x, numpy.ndarray)
    y_is_array = isinstance(y, numpy.ndarray)
    numpy_inputs = x_is_array or y_is_array
    if numpy_inputs:
        assert x_is_array and y_is_array, 'both x and y must be numpy arrays'
        assert x.shape == y.shape, 'x and y must have same shape'
        # transform only non-nan entries as proj behavior can be erratic
        a = numpy.full_like(x, numpy.nan)
        b = numpy.full_like(y, numpy.nan)
        good_ix = numpy.logical_and(numpy.isfinite(x), numpy.isfinite(y))
        a[good_ix], b[good_ix] = trans.transform(x[good_ix], y[good_ix])
    else:
        a, b = trans.transform(x, y)
    return a, b