<s> from importlib import import_module <EOL> import inspect <EOL> import re <EOL> from rest_framework_transforms . transforms import BaseTransform <EOL> def get_transform_classes ( transform_base = None , base_version = <NUM_LIT:1> , reverse = False ) : <EOL> """<STR_LIT>""" <EOL> module , base = transform_base . rsplit ( '<STR_LIT:.>' , <NUM_LIT:1> ) <EOL> mod = import_module ( module ) <EOL> transform_classes_dict = { } <EOL> for name , transform_class in inspect . getmembers ( mod ) : <EOL> if name . startswith ( base ) and issubclass ( transform_class , BaseTransform ) : <EOL> transform_index_match = re . search ( '<STR_LIT>' , name ) <EOL> if transform_index_match : <EOL> int_transform_index = int ( transform_index_match . group ( <NUM_LIT:0> ) ) <EOL> if base_version < int_transform_index : <EOL> transform_classes_dict [ int_transform_index ] = transform_class <EOL> ordered_transform_classes_list = [ <EOL> transform_classes_dict [ key ] <EOL> for key <EOL> in sorted ( transform_classes_dict , reverse = reverse ) <EOL> ] <EOL> return ordered_transform_classes_list </s>
