def parse(self, timestr, default=None, ignoretz=False, settings=None, **kwargs):
        # timestr needs to be a buffer as required by _parse
        if isinstance(timestr, binary_type):
            timestr = timestr.decode()

        # Parse timestr
        # handle dateutil>=2.5 tuple result first
        try:
            res, _ = self._parse(timestr, **kwargs)
        except __HOLE__:
            res = self._parse(timestr, **kwargs)

        if res is None:
            raise ValueError("unknown string format")

        # Fill in missing date
        new_date = self._populate(res, default, settings=settings)

        # Clean hour and minutes, etc in case not defined
        for e in ['hour', 'minute', 'second', 'microsecond']:
            if not getattr(res, e):
                new_date = new_date.replace(**{e: 0})

        return new_date, self.get_period(res)
dataset/ETHPy150Open scrapinghub/dateparser/dateparser/date_parser.py/new_parser.parse