def infer_time_coord_name(ds):
    """ Infer name for time coordinate in a dataset"""
    if "time" in ds.variables:
        return "time"

    unlimited_dims = ds.encoding.get("unlimited_dims", None)
    if len(unlimited_dims) == 1:
        return list(unlimited_dims)[0]

    raise ValueError(
        "Cannot infer `time_coord_name` from multiple unlimited dimensions: %s \n\t\t ***** Please specify time_coord_name to use. *****"
        % unlimited_dims
    )