def validate_duration(self, field, duration):
        '''
        2h
        2h5m
        5m
        180
        1h4m3
        :param duration:
        :return:
        '''
        DURATION_RE = r'^(\d+d)?(\d+h)?(\d+m)?(\d+s?)?$'
        if not re.match(DURATION_RE, duration):
            self._error(field, 'Load duration examples: 2h30m; 5m15; 180')
def validate_duration(self, field, duration):
        '''
        2h
        2h5m
        5m
        180
        1h4m3
        :param duration:
        :return:
        '''
        DURATION_RE = r'^(\d+d)?(\d+h)?(\d+m)?(\d+s?)?$'
        if not re.match(DURATION_RE, duration):
            self._error(field, 'Load duration examples: 2h30m; 5m15; 180')
def validate_duration ( self , field , duration ) : DURATION_RE = r'^(\d+d)?(\d+h)?(\d+m)?(\d+s?)?$' if not re . match ( DURATION_RE , duration ) : self . _error ( field , 'Load duration examples: 2h30m; 5m15; 180' )
2h
        2h5m
        5m
        180
        1h4m3
        :param duration:
        :return:
2h 2h5m 5m 180 1h4m3 : param duration : : return :