def get_holidays(employee, from_date, to_date):
 holiday_list = get_holiday_list_for_employee(employee)
 holidays = frappe.db.sql(u'select count(distinct holiday_date) from `tabHoliday` h1, `tabHoliday List` h2\n DCTB  DCTB where h1.parent = h2.name and h1.holiday_date between %s and %s\n DCTB  DCTB and h2.name = %s', (from_date, to_date, holiday_list))[0][0]
 return holidays

def get_holidays ( employee , from_date , to_date ) : holiday_list = get_holiday_list_for_employee ( employee ) holidays = frappe . db . sql ( u'select count(distinct holiday_date) from `tabHoliday` h1, `tabHoliday List` h2\n DCTB  DCTB where h1.parent = h2.name and h1.holiday_date between %s and %s\n DCTB  DCTB and h2.name = %s' , ( from_date , to_date , holiday_list ) ) [ 0 ] [ 0 ] return holidays
get holidays between two dates for the given employee .