code: def years_match(data, years):
      
      years = [years] if isinstance(years, int) else years
      dt = datetime.datetime
      if isinstance(years, dt) or isinstance(years[0], dt):
          error_msg = "`year` can only be filtered with ints or lists of ints"
          raise TypeError(error_msg)
      return data.isin(years)
docs: matching of year columns for data filtering