def METHOD_NAME(self, python_model):
    """
    Check if python model name is valid
    This function gets the name of the classes and functions in the imported python module whose names is passed in
    as the python model to RunModel. There should be at least one class or function in the module - if not there,
    then the function exits raising a ValueError. If there is at least one class or function in the module,
    if the model object name is not given as input and there is only one class or function, that class name or
    function name is used to run the model. If there is a model_object_name given, check if it is a valid name.
    Else, a ValueError is raised.
    """
    # Get the names of the classes and functions in the imported module
    import inspect
    class_list = []
    function_list = []
    for name, obj in inspect.getmembers(python_model):
        if inspect.isclass(obj):
            class_list.append(name)
        elif inspect.isfunction(obj):
            function_list.append(name)
    # There should be at least one class or function in the module - if not there, exit with error.
    if len(class_list) == 0 and len(function_list) == 0:
        raise ValueError("\nUQpy: A python model should be defined as a function or class in the script.\n")
    else:  # If there is at least one class or function in the module
        # If the model object name is not given as input and there is only one class or function,
        # take that class name or function name to run the model.
        if self.model_object_name is None and len(class_list) + len(function_list) == 1:
            if len(class_list) == 1:
                self.model_object_name = class_list[0]
            elif len(function_list) == 1:
                self.model_object_name = function_list[0]
        # If there is a model_object_name given, check if it is in the list.
        if self.model_object_name in class_list:
            self.logger.info("\nUQpy: The model class that will be run: " + self.model_object_name)
            self.model_is_class = True
        elif self.model_object_name in function_list:
            self.logger.info("\nUQpy: The model function that will be run: " + self.model_object_name)
            self.model_is_class = False
        else:
            if self.model_object_name is None:
                raise ValueError("\nUQpy: There are more than one objects in the module. Specify the name of the "
                                 "function or class which has to be executed.\n")
            else:
                print("\nUQpy: You specified the model_object_name as: " + str(self.model_object_name))
                raise ValueError("\nUQpy: The file does not contain an object which was specified as the model.\n")