<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_date(cls, date):
 """ Returns a Month instance from the given datetime.date or datetime.datetime object """

        try:
            date = date.date()
        except AttributeError:
            pass
        return cls(date.year, date.month)