def METHOD_NAME(
    da_or_ds: Union[xr.DataArray, xr.Dataset],
    time_units: str,
    dim: str = "time",
):
    """Convert the coordinates of a datetime axis to a human-readable float
    representation.
    Examples:
        Convert a `DataArray`'s time dimension coordinates from
        minutes to seconds:
        >>> import numpy as np
        >>> import xarray as xr
        >>> import janitor.xarray
        >>> timepoints = 5
        >>> da = xr.DataArray(
        ...     np.array([2, 8, 0, 1, 7, 7]),
        ...     dims="time",
        ...     coords=dict(time=np.arange(6) * np.timedelta64(1, "m"))
        ... )
        >>> da_minutes = da.convert_datetime_to_number("s", dim="time")
        >>> da_minutes
        <xarray.DataArray (time: 6)>
        array([2, 8, 0, 1, 7, 7])
        Coordinates:
          * time     (time) float64 0.0 60.0 120.0 180.0 240.0 300.0
    Args:
        da_or_ds: XArray object.
        time_units: Numpy timedelta string specification for the unit you
            would like to convert the coordinates to.
        dim: The time dimension whose coordinates are datetime objects.
    Returns:
        The original XArray object with the time dimension reassigned.
    """
    times = da_or_ds.coords[dim].data / np.timedelta64(1, time_units)
    return da_or_ds.assign_coords({dim: times})