@classmethod<EOL><INDENT>def construct_datetime(cls, *args, **kwargs):<DEDENT>
if len(args) == <NUM_LIT:1>:<EOL><INDENT>arg = args[<NUM_LIT:0>]<EOL>method = cls.__get_dt_constructor(<EOL>type(arg).__module__,<EOL>type(arg).__name__,<EOL>)<EOL>result = method(arg)<EOL>try:<EOL><INDENT>result = result.replace(tzinfo=kwargs.pop('<STR_LIT>'))<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>if kwargs:<EOL><INDENT>first_key = kwargs.keys()[<NUM_LIT:0>]<EOL>tmpl = (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>raise TypeError(tmpl.format(**locals()))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>result = datetime.datetime(*args, **kwargs)<EOL><DEDENT>return result<EOL>
Construct a datetime.datetime from a number of different time
        types found in python and pythonwin