code: def _to_desired_dates(self, arr):
          
          times = utils.times.extract_months(
              arr[internal_names.TIME_STR], self.months
          )
          return arr.sel(time=times)
docs: Restrict the xarray DataArray or Dataset to the desired months.