def create_class(class_name, dynamic_imports):
    try:
        new_class = globals()[class_name]

        if not inspect.isclass(new_class):
            raise TypeError('Not a class!')

        return new_class
    except (KeyError, TypeError):
        for dynamic_class in dynamic_imports:
            # Dynamic classes can be provided directly as a Class instance,
            # for example as `MyCustomParameter`,
            # or as a string describing where to import the class from,
            # for instance as `'mypackage.mymodule.MyCustomParameter'`.
            if inspect.isclass(dynamic_class):
                if class_name == dynamic_class.__name__:
                    return dynamic_class
            else:
                # The class name is always the last in an import string,
                # e.g. `'mypackage.mymodule.MyCustomParameter'`
                class_name_to_test = dynamic_class.split('.')[-1]
                if class_name == class_name_to_test:
                    new_class = load_class(dynamic_class)
                    return new_class
        raise ImportError('Could not create the class named `%s`.' % class_name)
determine if a unicode code point is printable.
dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/utils/dynamicimports.py/create_class--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/validation/parameter_types.py/_is_printable