def get_calendar(self, weekmask, holidays, calendar):
        """Generate busdaycalendar"""
        if isinstance(calendar, np.busdaycalendar):
            if not holidays:
                holidays = tuple(calendar.holidays)
            elif not isinstance(holidays, tuple):
                holidays = tuple(holidays)
            else:
                # trust that calendar.holidays and holidays are
                # consistent
                pass
            return calendar, holidays

        if holidays is None:
            holidays = []
        try:
            holidays = holidays + calendar.holidays().tolist()
        except __HOLE__:
            pass
        holidays = [self._to_dt64(dt, dtype='datetime64[D]') for dt in
                    holidays]
        holidays = tuple(sorted(holidays))

        kwargs = {'weekmask': weekmask}
        if holidays:
            kwargs['holidays'] = holidays

        busdaycalendar = np.busdaycalendar(**kwargs)
        return busdaycalendar, holidays
dataset/ETHPy150Open pydata/pandas/pandas/tseries/offsets.py/CustomBusinessDay.get_calendar