<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def now_by_tz(tz='US/Central', ignoretz=True):
 """Gets the current datetime object by timezone. :param tz: is the timezone to get the date for. tz can be passed as a string or as a timezone object. (i.e. 'US/Central' or pytz.timezone('US/Central'), etc) :param ignoretz: will ignore the timezone portion of the datetime object and tzinfo will be None. :return: the current datetime object by tz Examples: 2011-09-28 10:06:01.130025 2011-09-28 10:06:01.130025-07:00 2011-09-28 12:06:01.130025 2011-09-28 12:06:01.130025-05:00 """

    if isinstance(tz, string_types):
        tz = pytz.timezone(tz)

    if ignoretz:
        return datetime.now(tz).replace(tzinfo=None)
    return datetime.now(tz)