code: def period(argument):
          
          since, until, period = None, None, None
          if "today" in argument:
              since = Date("today")
              until = Date("today")
              until.date += delta(days=1)
              period = "today"
          elif "yesterday" in argument:
              since = Date("yesterday")
              until = Date("yesterday")
              until.date += delta(days=1)
              period = "yesterday"
          elif "year" in argument:
              if "last" in argument:
                  since, until = Date.last_year()
                  period = "the last fiscal year"
              else:
                  since, until = Date.this_year()
                  period = "this fiscal year"
          elif "quarter" in argument:
              if "last" in argument:
                  since, until = Date.last_quarter()
                  period = "the last quarter"
              else:
                  since, until = Date.this_quarter()
                  period = "this quarter"
          elif "month" in argument:
              if "last" in argument:
                  since, until = Date.last_month()
              else:
                  since, until = Date.this_month()
              period = since.datetime.strftime("%B")
          else:
              if "last" in argument:
                  since, until = Date.last_week()
              else:
                  since, until = Date.this_week()
              period = "the week {0}".format(since.datetime.strftime("%V"))
          return since, until, period
docs: Detect desired time period for the argument