def date_gen(self, tz_in=None, tz_out=None):
        """Generates the according datetime object using given parameters"""
        # Check parameters and gather tzinfo data (and raise a few exceptions)
        if tz_in is None:
            tz_in = self.default['tz_in']

        if tz_in == "local":
            tz_in = self.local_tz

        tz_in  = self.check_tzparam(tz_in,  'tz_in')
        tz_out = self.check_tzparam(tz_out, 'tz_out')

        # Get timedata
        try:
            dt = tz_in.localize(datetime.now())
        except AttributeError:
            # Fallback for non-pytz timezones ('local')
            dt = datetime.now(tz=tz_in)

        # Process timedata
        # TODO: shift datetime here | split into other function(s)
        if not tz_out:
            return dt

        # Adjust timedata for target timezone
        dt = dt.astimezone(tz_out)
        try:
            return tz_out.normalize(dt)
        except __HOLE__:
            # Fallback for non-pytz timezones ('local')
            return dt
dataset/ETHPy150Open FichteFoll/InsertDate/format_date/__init__.py/FormatDate.date_gen