Check if this object configuration is correct ::

        * Check our own specific properties
        * Call our parent class is_correct checker

        :return: True if the configuration is correct, otherwise False
        :rtype: bool
321785
def is_correct(self):
        
        state = True

        # Internal checks before executing inherited function...

        # If we got the _time parameters, we are time based. Unless, we are not :)
        if hasattr(self, 'first_notification_time') or hasattr(self, 'last_notification_time'):
            self.time_based = True

        # Ok now we manage special cases...
        if not hasattr(self, 'contacts') and not hasattr(self, 'contact_groups'):
            self.add_error('%s: I do not have contacts nor contact_groups' % (self.get_name()))
            state = False

        # If time_based or not, we do not check all properties
        if self.time_based:
            if not hasattr(self, 'first_notification_time'):
                self.add_error('%s: I do not have first_notification_time' % (self.get_name()))
                state = False
            if not hasattr(self, 'last_notification_time'):
                self.add_error('%s: I do not have last_notification_time' % (self.get_name()))
                state = False
        else:  # we check classical properties
            if not hasattr(self, 'first_notification'):
                self.add_error('%s: I do not have first_notification' % (self.get_name()))
                state = False
            if not hasattr(self, 'last_notification'):
                self.add_error('%s: I do not have last_notification' % (self.get_name()))
                state = False

        # Change the special_properties definition according to time_based ...
        save_special_properties = self.special_properties
        if self.time_based:
            self.special_properties = self.special_properties_time_based

        state_parent = super(Escalation, self).is_correct()

        if self.time_based:
            self.special_properties = save_special_properties

        return state_parent and state
1033
def _assert_correct_model(model_to_check, model_reference, obj_name):
        
        if not issubclass(model_to_check, model_reference):
            raise ConfigurationException('The %s model must be a subclass of %s'
                                         % (obj_name, model_reference.__name__))
377938
def check_config(data):
    

    is_right = True

    if "title" not in data:
        logging.error("No 'title' in _config.yml")
        is_right = False

    return is_right
794150
def is_valid(self):
        

        valid = True
        if not self.sons:
            valid = False
        else:
            for son in self.sons:
                if isinstance(son, DependencyNode) and not son.is_valid():
                    self.configuration_errors.extend(son.configuration_errors)
                    valid = False
        return valid
865161
def _check_configuration(self, *attrs):
        
        for attr in attrs:
            if getattr(self, attr, None) is None:
                raise ConfigurationError("{} not configured".format(attr))
521696
def valid(self, value, include_name=True):
		

		# Call the parent valid method and return the result
		return super(Tree, self).valid(value, include_name and [self._name] or [])
1270959
def should_we_load(kls):
    
    # we don't load abstract classes
    if kls.__name__.endswith("AbstractCheck"):
        return False
    # and we only load checks
    if not kls.__name__.endswith("Check"):
        return False
    mro = kls.__mro__
    # and the class needs to be a child of AbstractCheck
    for m in mro:
        if m.__name__ == "AbstractCheck":
            return True
    return False
1080362
def is_locked(self):
        
        if not self.__locked__:
            return False
        elif self.get_parent():
            return self.get_parent().is_locked()

        return True
1173664
protected function checkByClassNameAndFlavor()
    {
        $checkFunctionName = 'check_' . $this->className;
        if (!empty($this->flavor)) {
            $checkFunctionName .= '_' . $this->flavor;
        }

        // Check whether a check for the corresponding class exists.
        if (method_exists($this, $checkFunctionName)) {
            $this->$checkFunctionName();
        } else {
            trigger_error(
                'No configuration check ' . $checkFunctionName . ' created yet.'
            );
        }
    }
309434
def _validate_configuration_type(self, configuration_type):
        

        if configuration_type.lower() != 'running' and configuration_type.lower() != 'startup':
            raise Exception(self.__class__.__name__, 'Configuration Type is invalid. Should be startup or running')
1049135
def check(cls):
        
        attribs = [
            'app_version',
            'app_name',
            'config_file_path',
            'config_sep_str',
        ]
        for attrib in attribs:
            if getattr(cls, attrib) == 'not_set':
                raise IncompleteSetupError(f'elib_config setup is incomplete; missing: {attrib}')
590264
def validate_check_configs(cls, config):
        
        if "checks" not in config:
            raise ValueError("No checks defined.")
        if "interval" not in config["checks"]:
            raise ValueError("No check interval defined.")

        for check_name, check_config in six.iteritems(config["checks"]):
            if check_name == "interval":
                continue

            Check.from_config(check_name, check_config)
1330233
def _validate(self):
        
        # disable methods matching before validation
        self._disable_patching = True
        # validation by Invariant.validate
        self._validate_base(self)
        # enable methods matching after validation
        self._disable_patching = False
802517
def check_config(self, section, name, has_default=False, value=None, allowEmpty=False):
    
    

    cfg = self.config
    if not cfg.has_key(section) or not cfg.get(section).has_key(name):
      if not has_default:
        self.config_errors.append("%s: %s -> missing" % (section, name))
        return False
      else:
        return True

    v = cfg.get(section).get(name)

    if v == "" and not allowEmpty:
      self.config_errors.append("%s: %s -> empty" % (section, name))
      return False
    return True
1044336
def is_main_variation(self) -> bool:
        
        if not self.parent:
            return True

        return not self.parent.variations or self.parent.variations[0] == self
1257670
def _is_modified_property(self, prop):
        
        if type(prop) is str:
            return prop in self._modified_members
        return False
787347
def parent(self, parent):
        
        if parent is None:
            self._parent = None
        else:
            from rafcon.core.states.state import State
            assert isinstance(parent, State)

            old_parent = self.parent
            self._parent = ref(parent)

            valid, message = self._check_validity()
            if not valid:
                if not old_parent:
                    self._parent = None
                else:
                    self._parent = ref(old_parent)

                class_name = self.__class__.__name__
                if global_config.get_config_value("LIBRARY_RECOVERY_MODE") is True:
                    do_delete_item = True
                    # In case of just the data type is wrong raise an Exception but keep the data flow
                    if "not have matching data types" in message:
                        do_delete_item = False
                        self._parent = ref(parent)
                    raise RecoveryModeException("{0} invalid within state \"{1}\" (id {2}): {3}".format(
                        class_name, parent.name, parent.state_id, message), do_delete_item=do_delete_item)
                else:
                    raise ValueError("{0} invalid within state \"{1}\" (id {2}): {3} {4}".format(
                        class_name, parent.name, parent.state_id, message, self))