def _time_to_datetime(value):
 if (not isinstance(value, datetime.time)):
  raise TypeError(('Cannot convert to datetime expected time value; received %s' % value))
 return datetime.datetime(1970, 1, 1, value.hour, value.minute, value.second, value.microsecond)

def _time_to_datetime ( value ) : if ( not isinstance ( value , datetime . time ) ) : raise TypeError ( ( 'Cannot convert to datetime expected time value; received %s' % value ) ) return datetime . datetime ( 1970 , 1 , 1 , value . hour , value . minute , value . second , value . microsecond )
convert a time to a datetime for datastore storage .