<s> '''<STR_LIT>''' <EOL> from datetime import datetime <EOL> class OneDriveObjectBase ( object ) : <EOL> DATETIME_FORMAT = "<STR_LIT>" <EOL> DATETIME_FORMAT_NO_MILLISECONDS = "<STR_LIT>" <EOL> def to_dict ( self ) : <EOL> """<STR_LIT>""" <EOL> serialized = { } <EOL> for prop in self . _prop_dict : <EOL> if isinstance ( self . _prop_dict [ prop ] , OneDriveObjectBase ) : <EOL> serialized [ prop ] = self . _prop_dict [ prop ] . to_dict ( ) <EOL> else : <EOL> serialized [ prop ] = self . _prop_dict [ prop ] <EOL> return serialized <EOL> @ staticmethod <EOL> def get_datetime_from_string ( s ) : <EOL> try : <EOL> dt = datetime . strptime ( <EOL> s , <EOL> OneDriveObjectBase . DATETIME_FORMAT ) <EOL> except ValueError as ve : <EOL> dt = datetime . strptime ( <EOL> s , <EOL> OneDriveObjectBase . DATETIME_FORMAT_NO_MILLISECONDS ) <EOL> return dt <EOL> @ staticmethod <EOL> def get_string_from_datetime ( dt ) : <EOL> return dt . strftime ( OneDriveObjectBase . DATETIME_FORMAT ) </s>
