def get_date(date, date_format = None):
date_obj = datetime.datetime.now()<EOL>if date:<EOL><INDENT>if date_format:<EOL><INDENT>date_obj = datetime.datetime.strptime(date, date_format)<EOL><DEDENT>else:<EOL><INDENT>if match_date(date):<EOL><INDENT>if len(date.split('<STR_LIT:->')) == <NUM_LIT:3>:<EOL><INDENT>date = date.split('<STR_LIT:->')<EOL><DEDENT>elif len(date.split('<STR_LIT:U+0020>')) == <NUM_LIT:3>:<EOL><INDENT>date = date.split('<STR_LIT:U+0020>')<EOL><DEDENT>elif len(date.split('<STR_LIT:.>')) == <NUM_LIT:3>:<EOL><INDENT>date = date.split('<STR_LIT:.>')<EOL><DEDENT>else:<EOL><INDENT>date = date.split('<STR_LIT:/>')<EOL><DEDENT>date_obj = datetime.datetime(*(int(number) for number in date))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % date)<EOL><DEDENT><DEDENT><DEDENT>return date_obj<EOL>
Return a datetime object if there is a valid date

        Raise exception if date is not valid
        Return todays date if no date where added

        Args:
            date(str)
            date_format(str)

        Returns:
            date_obj(datetime.datetime)