<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def trading_dates(start, end, calendar='US'):
 """ Trading dates for given exchange Args: start: start date end: end date calendar: exchange as string Returns: pd.DatetimeIndex: datetime index Examples: """

    kw = dict(start=pd.Timestamp(start, tz='UTC').date(), end=pd.Timestamp(end, tz='UTC').date())
    us_cal = getattr(sys.modules[__name__], f'{calendar}TradingCalendar')()
    return pd.bdate_range(**kw).drop(us_cal.holidays(**kw))