parameters: (dates)
return_statement: return month_loc, month_fm
docstring: 获取显示日线时使用的Major Locator和Major Formatter
docstring_summary: 获取显示日线时使用的Major Locator和Major Formatter
docstring_tokens: 获取显示日线时使用的Major Locator和Major Formatter
function: def getDayLocatorAndFormatter(dates):
      """获取显示日线时使用的Major Locator和Major Formatter"""
      sep = len(dates) / 8
      loc = [
          (
              i, str(d) if
              (i !=
               (len(dates) - 1)) and (i % sep != 0) else "{}-{}-{}".format(d.year, d.month, d.day)
          ) for i, d in enumerate(dates)
      ]
      fixed_loc = [
          i for i in range(len(dates)) if (i == (len(dates) - 1)) or (i != 0 and i % sep == 0)
      ]
  
      month_loc = FixedLocator(fixed_loc)
      month_fm = FuncFormatter(StockFuncFormatter(dict(loc)))
      return month_loc, month_fm
function_tokens: def getDayLocatorAndFormatter ( dates ) : sep = len ( dates ) / 8 loc = [ ( i , str ( d ) if ( i != ( len ( dates ) - 1 ) ) and ( i % sep != 0 ) else "{}-{}-{}" . format ( d . year , d . month , d . day ) ) for i , d in enumerate ( dates ) ] fixed_loc = [ i for i in range ( len ( dates ) ) if ( i == ( len ( dates ) - 1 ) ) or ( i != 0 and i % sep == 0 ) ] month_loc = FixedLocator ( fixed_loc ) month_fm = FuncFormatter ( StockFuncFormatter ( dict ( loc ) ) ) return month_loc , month_fm