@staticmethod<EOL><INDENT>def from_string(date_str):<DEDENT>
if date_str.count('<STR_LIT:->'):<EOL><INDENT>str_format = '<STR_LIT>'<EOL><DEDENT>elif date_str.count('<STR_LIT:.>'):<EOL><INDENT>str_format = '<STR_LIT>'<EOL><DEDENT>elif date_str.count('<STR_LIT:/>'):<EOL><INDENT>str_format = '<STR_LIT>'<EOL><DEDENT>elif len(date_str) == <NUM_LIT:8>:<EOL><INDENT>str_format = '<STR_LIT>'<EOL><DEDENT>elif len(date_str) == <NUM_LIT:4>:<EOL><INDENT>year = ord(date_str[<NUM_LIT:0>]) * <NUM_LIT> + ord(date_str[<NUM_LIT:1>])<EOL>month = ord(date_str[<NUM_LIT:2>])<EOL>day = ord(date_str[<NUM_LIT:3>])<EOL>return BusinessDate.from_ymd(year, month, day)<EOL><DEDENT>else:<EOL><INDENT>msg = "<STR_LIT>" + date_str + "<STR_LIT>"<EOL>raise ValueError(msg)<EOL><DEDENT>d = datetime.strptime(date_str, str_format)<EOL>return BusinessDate.from_ymd(d.year, d.month, d.day)<EOL>
construction from the following string patterns
'%Y-%m-%d'
'%d.%m.%Y'
'%m/%d/%Y'
'%Y%m%d'

:param str date_str:
:return BusinessDate: