def parse_docopt_string(docopt_string):
from re import match, DOTALL<EOL>only_usage_pattern = r"""<STR_LIT>"""<EOL>usage_and_options_pattern = r"""<STR_LIT>"""<EOL>usage, options = '<STR_LIT>', '<STR_LIT>'<EOL>if match(usage_and_options_pattern, docopt_string, DOTALL):<EOL><INDENT>usage = match(usage_and_options_pattern, docopt_string, DOTALL).groupdict()['<STR_LIT>']<EOL>options = match(usage_and_options_pattern, docopt_string, DOTALL).groupdict()['<STR_LIT>']<EOL><DEDENT>elif match(only_usage_pattern, docopt_string, DOTALL):<EOL><INDENT>usage = match(only_usage_pattern, docopt_string, DOTALL).groupdict()['<STR_LIT>']<EOL><DEDENT>return usage, options<EOL>
returns a 2-tuple (usage, options)