<s> import os <EOL> import matplotlib . pyplot as plt <EOL> from framework . mongo import database <EOL> from website import settings <EOL> from . utils import plot_dates , oid_to_datetime , mkdirp <EOL> watch_collection = database [ '<STR_LIT>' ] <EOL> FIG_PATH = os . path . join ( settings . ANALYTICS_PATH , '<STR_LIT>' , '<STR_LIT>' ) <EOL> mkdirp ( FIG_PATH ) <EOL> def main ( ) : <EOL> watch_configs = watch_collection . find ( ) <EOL> dates_watched = [ <EOL> oid_to_datetime ( watch_config [ '<STR_LIT>' ] ) <EOL> for watch_config in watch_configs <EOL> ] <EOL> if not dates_watched : <EOL> return <EOL> fig = plot_dates ( dates_watched ) <EOL> plt . title ( '<STR_LIT>' . format ( len ( dates_watched ) ) ) <EOL> plt . savefig ( os . path . join ( FIG_PATH , '<STR_LIT>' ) ) <EOL> plt . close ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
