Check changetype attribute for issues.
332528
def _check_changetype(self, dn, changetype, attr_value):
        """"""
        if dn is None:
            self._error('Read changetype: before getting valid dn: line.')
        if changetype is not None:
            self._error('Two lines starting with changetype: in one record.')
        if attr_value not in CHANGE_TYPES:
            self._error('changetype value %s is invalid.' % attr_value)
395704
def oc_attr_isdefault(o):
    """"""
    if not o._changed() and not o.default():
        return True
    if o == o.default():
        return True
    return False
900236
def _check_for_unit_changes(name):
    '''
    
    '''
    contextkey = 'systemd._check_for_unit_changes.{0}'.format(name)
    if contextkey not in __context__:
        if _untracked_custom_unit_found(name) or _unit_file_changed(name):
            systemctl_reload()
        # Set context key to avoid repeating this check
        __context__[contextkey] = True
125420
def _check_type(self, check_type, properties):
        """"""
        if 'PrimitiveType' in properties:
            return properties['PrimitiveType'] == check_type
        if properties['Type'] == 'List':
            if 'ItemType' in properties:
                return properties['ItemType'] == check_type
            else:
                return properties['PrimitiveItemType'] == check_type
        return False
1309569
def _check_reset_and_type_change(self, name, orig_ctr):
    """"""
    # Resetting a hyperparameter
    if name in orig_ctr:
      tf.logging.warning("Overwriting hparam %s", name)

    ctr_names = [
        (self._categorical_params, "categorical"),
        (self._discrete_params, "discrete"),
        (self._float_params, "float"),
        (self._int_params, "int"),
    ]
    ctrs, names = list(zip(*ctr_names))
    orig_name = names[ctrs.index(orig_ctr)]

    for ctr, ctr_name in ctr_names:
      if ctr is orig_ctr:
        continue

      # Using a different type for the same hyperparameter name
      if name in ctr:
        raise ValueError("Setting hyperparameter %s as type %s, but a "
                         "hyperparemeter of the same name was originally "
                         "registered as type %s" % (name, ctr_name, orig_name))
1046945
function checkType(type, Type) {
  if (type && type !== Type.TYPE_NAME) {
    throw new Error(
      `Invalid type detected: ${type} while creating ${Type.name} instance`
    );
  }
}
676532
private Attribute checkContext(URI type, URI id, URI issuer,
                                        URI category, int designatorType) {
        if (!STRING_ATTRIBUTE_TYPE_URI.equals(type)) return null;
        String [] values = null;
        switch(designatorType){
            case AttributeDesignator.SUBJECT_TARGET:
                values = context.getSubjectValues(id.toString());
                break;
            case AttributeDesignator.RESOURCE_TARGET:
                values = context.getResourceValues(id);
                break;
            case AttributeDesignator.ACTION_TARGET:
                values = context.getActionValues(id);
                break;
            case AttributeDesignator.ENVIRONMENT_TARGET:
                values = context.getEnvironmentValues(id);
                break;
        }
        if (values == null || values.length == 0) return null;
        String iString = (issuer == null) ? null : issuer.toString();
        String tString = type.toString();
        if (values.length == 1) {
            AttributeValue val = stringToValue(values[0], tString);
            return (val == null) ? null :
                new SingletonAttribute(id, iString, getCurrentDateTime(), val);
        } else {
            ArrayList<AttributeValue> valCollection = new ArrayList<AttributeValue>(values.length);
            for (int i=0;i<values.length;i++) {
                AttributeValue val = stringToValue(values[i], tString);
                if (val != null) valCollection.add(val);
            }
            return new BasicAttribute(id, type, iString, getCurrentDateTime(), valCollection);
        }
    }
827514
def _checkAttribs(self, strict):
        """"""
        if self.min:
            warning("Minimum value not allowed for boolean-type parameter " +
                    self.name, strict)
            self.min = None
        if self.max:
            if not self.prompt:
                warning("Maximum value not allowed for boolean-type parameter " +
                                self.name + " (probably missing comma)",
                                strict)
                # try to recover by assuming max string is prompt
                self.prompt = self.max
            else:
                warning("Maximum value not allowed for boolean-type parameter " +
                        self.name, strict)
            self.max = None
        if self.choice:
            warning("Choice values not allowed for boolean-type parameter " +
                    self.name, strict)
            self.choice = None
904125
def check_attr(self, pos, attrs):
        """"""

        for at in attrs:
            (ns, local_name) = self.split_qname(at)
            if ns is None:
                error.err_add(self.ctx.errors, pos,
                              'UNEXPECTED_ATTRIBUTE', local_name)
            elif ns == yin_namespace:
                error.err_add(self.ctx.errors, pos,
                              'UNEXPECTED_ATTRIBUTE', "{"+at)
654042
def get_change_type(self, ref, a1, a2):
        
        if ref == '.':
            return self.INSERTION
        elif a1 == '.' or a2 == '.':
            return self.DELETION
587616
private void checkIfUpdateIsNeeded(CmsUUID structureId, String rootPath, int typeId) {

        try {
            I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(typeId);
            if ((resType instanceof CmsResourceTypeXmlContent)
                && !OpenCms.getResourceManager().matchResourceType(
                    CmsResourceTypeXmlContainerPage.RESOURCE_TYPE_NAME,
                    typeId)) {
                markForUpdate(structureId);
            }
        } catch (CmsLoaderException e) {
            // resource type not found, just log an error
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
725913
void onEndTypeChange() {

        EndType endType = m_model.getEndType();
        m_groupDuration.selectButton(getDurationButtonForType(endType));
        switch (endType) {
            case DATE:
            case TIMES:
                m_durationPanel.setVisible(true);
                m_seriesEndDate.setValue(m_model.getSeriesEndDate());
                int occurrences = m_model.getOccurrences();
                if (!m_occurrences.isFocused()) {
                    m_occurrences.setFormValueAsString(occurrences > 0 ? "" + occurrences : "");
                }
                break;
            default:
                m_durationPanel.setVisible(false);
                break;
        }
        updateExceptions();
    }
480245
def is_attr_selected(attr_name,     # type: str
                     include=None,  # type: Union[str, Tuple[str]]
                     exclude=None   # type: Union[str, Tuple[str]]
                     ):
    """"""

    if include is not None and exclude is not None:
        raise ValueError('Only one of \'include\' or \'exclude\' argument should be provided.')

    # win time by not doing this
    # check_var(include, var_name='include', var_types=[str, tuple], enforce_not_none=False)
    # check_var(exclude, var_name='exclude', var_types=[str, tuple], enforce_not_none=False)

    if attr_name is 'self':
        return False
    if exclude and attr_name in exclude:
        return False
    if not include or attr_name in include:
        return True
    else:
        return False
1158812
def has_changed(self, initial, data):
        ""
        if initial is None and data is None:
            return False
        if data and not hasattr(data, '__iter__'):
            data = self.widget.decompress(data)
        initial = self.to_python(initial)
        data = self.to_python(data)
        if hasattr(self, '_coerce'):
            data = self._coerce(data)
        if isinstance(data, Model) and isinstance(initial, Model):
            return model_vars(data) != model_vars(initial)
        else:
            return data != initial
428805
def attribute_will_change!(attr)
      unless changed_attributes.key?(attr)
        changed_attributes[attr] = read_raw_attribute(attr).__deep_copy__
      end
    end
869558
def _check_diff(changes):
    '''
    
    '''
    for conf_dict in changes:
        if conf_dict == 'Networks':
            continue
        for item in changes[conf_dict]:
            if changes[conf_dict][item]['new'] is None:
                old = changes[conf_dict][item]['old']
                if old == '':
                    return True
                else:
                    try:
                        if all(x == '' for x in old):
                            return True
                    except TypeError:
                        # Old value is not an iterable type
                        pass
    return False
1346043
def check_impl(self):
        

        c = False
        for change in self.collect():
            change.check()
            c = c or change.is_change()
        return c, None