def create(cls_name, model_cfg, env_cfg=None):
    """
    Create an instance of given module class.

    Args:
        cls_name(str): Class of which to create instnce.

    Return: instance of type `cls_or_name`
    """
    assert type(cls_name) == str, "should be a name of class"
    if cls_name not in global_config:
        raise ValueError("The module {} is not registered".format(cls_name))
    cls = global_config[cls_name]
    return cls(model_cfg, env_cfg)

    Create an instance of given module class.

    Args:
        cls_name(str): Class of which to create instnce.

    Return: instance of type `cls_or_name`
    
contrib/QualityInspector/qinspector/cvlib/workspace.py