Check the output data types of the state

        Checks all output data ports if the handed data is not of the specified type and generate an error logger
        message with details of the found type conflict.
191691
def check_output_data_type(self):
        
        for data_port in self.output_data_ports.values():
            if data_port.name in self.output_data and self.output_data[data_port.name] is not None:
                # check for class
                if not isinstance(self.output_data[data_port.name], data_port.data_type):
                    logger.error("{0} had an data port error: Output of execute function must be of type '{1}' not "
                                 "'{2}' as current value {3}".format(self, data_port.data_type.__name__,
                                                               type(self.output_data[data_port.name]).__name__,
                                                               self.output_data[data_port.name]))
538216
function _checkData(modbus, buf) {
    // check buffer size
    if (buf.length !== modbus._length && buf.length !== 5) {
        modbusSerialDebug({ action: "length error", recive: buf.length, expected: modbus._length });

        return false;
    }

    // check buffer unit-id and command
    return (buf[0] === modbus._id &&
        (0x7f & buf[1]) === modbus._cmd);
}
1267936
private boolean handleOverridesAndConflicts(JvmOperation operation, Multimap<String, AbstractResolvedOperation> processedOperations) {
		String simpleName = operation.getSimpleName();
		if (!processedOperations.containsKey(simpleName)) {
			return true;
		}
		List<AbstractResolvedOperation> conflictingOperations = null;
		for (AbstractResolvedOperation candidate : processedOperations.get(simpleName)) {
			OverrideTester overrideTester = candidate.getOverrideTester();
			IOverrideCheckResult checkResult = overrideTester.isSubsignature(candidate, operation, false);
			if (checkResult.getDetails().contains(OverrideCheckDetails.DEFAULT_IMPL_CONFLICT)) {
				// The current operation conflicts with the candidate
				if (conflictingOperations == null)
					conflictingOperations = Lists.newLinkedList();
				conflictingOperations.add(candidate);
			} else if (checkResult.isOverridingOrImplementing()) {
				return false;
			}
		}
		if (conflictingOperations != null) {
			if (conflictingOperations.size() == 1 && conflictingOperations.get(0) instanceof ConflictingDefaultOperation) {
				// The current operation contributes to the already existing conflict
				ConflictingDefaultOperation conflictingDefaultOperation = (ConflictingDefaultOperation) conflictingOperations.get(0);
				boolean isOverridden = false;
				for (IResolvedOperation conflictingOp : conflictingDefaultOperation.getConflictingOperations()) {
					if (conflictingOp.getResolvedDeclarator().isSubtypeOf(operation.getDeclaringType())) {
						isOverridden = true;
						break;
					}
				}
				if (!isOverridden)
					conflictingDefaultOperation.getConflictingOperations().add(createResolvedOperation(operation));
				return false;
			}
			// A new conflict of default implementations was found
			if (operation.isAbstract()) {
				ConflictingDefaultOperation resolvedOperation = createConflictingOperation(conflictingOperations.get(0).getDeclaration());
				resolvedOperation.getConflictingOperations().add(createResolvedOperation(operation));
				for (AbstractResolvedOperation conflictingOp : conflictingOperations) {
					processedOperations.remove(simpleName, conflictingOp);
					if (conflictingOp.getDeclaration() != resolvedOperation.getDeclaration()) {
						resolvedOperation.getConflictingOperations().add(conflictingOp);
					}
				}
				processedOperations.put(simpleName, resolvedOperation);
			} else {
				ConflictingDefaultOperation resolvedOperation = createConflictingOperation(operation);
				for (AbstractResolvedOperation conflictingOp : conflictingOperations) {
					processedOperations.remove(simpleName, conflictingOp);
					resolvedOperation.getConflictingOperations().add(conflictingOp);
				}
				processedOperations.put(simpleName, resolvedOperation);
			}
			return false;
		}
		return true;
	}
1265240
def _output_pins(self, pins):
        
        [self._validate_channel(pin) for pin in pins.keys()]
        # Set each changed pin's bit.
        for pin, value in iter(pins.items()):
            if value:
                self.gpio[int(pin/8)] |= 1 << (int(pin%8))
            else:
                self.gpio[int(pin/8)] &= ~(1 << (int(pin%8)))
        # Write GPIO state.
        self._write_gpio()
581500
def _validate_output_data(
        self, original_res, serialized_res, formatted_res, request):
        

        validator = self.representation

        # when not to validate...
        if not validator:
            return

        try:
            if isinstance(serialized_res, (list, tuple)):
                map(validator.validate, serialized_res)
            else:
                validator.validate(serialized_res)
        except ValidationError, exc:
            self._output_validation_failed(exc, serialized_res, request)
1038442
def check_physical(self, line):
        """"""
        self.physical_line = line
        for name, check, argument_names in self._physical_checks:
            self.init_checker_state(name, argument_names)
            result = self.run_check(check, argument_names)
            if result is not None:
                (offset, text) = result
                self.report_error(self.line_number, offset, text, check)
                if text[:4] == 'E101':
                    self.indent_char = line[0]
126925
def external_incompatibilities(self):  # type: () -> Generator[Incompatibility]
        
        if isinstance(self._cause, ConflictCause):
            cause = self._cause  # type: ConflictCause
            for incompatibility in cause.conflict.external_incompatibilities:
                yield incompatibility

            for incompatibility in cause.other.external_incompatibilities:
                yield incompatibility
        else:
            yield self
1187345
def _check_patch_type_mismatch(self, patched_item, existing_item):
        """"""
        def raise_mismatch_error(patched_item, existing_item, data_type_name):
            error_msg = ('Type mismatch. Patch {} corresponds to pre-existing '
                'data_type {} ({}:{}) that has type other than {}.')
            raise InvalidSpec(error_msg.format(
                quote(patched_item.name),
                quote(existing_item.name),
                existing_item.path,
                existing_item.lineno,
                quote(data_type_name)), patched_item.lineno, patched_item.path)

        if isinstance(patched_item, AstStructPatch):
            if not isinstance(existing_item, AstStructDef):
                raise_mismatch_error(patched_item, existing_item, 'struct')
        elif isinstance(patched_item, AstUnionPatch):
            if not isinstance(existing_item, AstUnionDef):
                raise_mismatch_error(patched_item, existing_item, 'union')
            else:
                if existing_item.closed != patched_item.closed:
                    raise_mismatch_error(
                        patched_item, existing_item,
                        'union_closed' if existing_item.closed else 'union')
        else:
            raise AssertionError(
                'Unknown Patch Object Type {}'.format(patched_item.__class__.__name__))
575909
def switch_types(self):
        
        if not self.__switch_types:
            self.__switch_types = SwitchTypes(self.__connection)
        return self.__switch_types
203917
def logic(self, data):
        
        try:
            msg = Message(data, self)
            msg.validate(self.protocol_version)
        except (ValueError, vol.Invalid) as exc:
            _LOGGER.warning('Not a valid message: %s', exc)
            return None

        message_type = self.const.MessageType(msg.type)
        handler = message_type.get_handler(self.handlers)
        ret = handler(msg)
        ret = self._route_message(ret)
        ret = ret.encode() if ret else None
        return ret
448416
def data_integrity(components, components_data):
    

    data_check = {}

    for comp in ['Bus', 'Load']:  # list(components_data.keys()):
        data_check[comp] = {}
        data_check[comp]['length_diff'] = len(components[comp]) - len(
            components_data[comp])

    # print short report to user and exit program if not integer
    for comp in list(data_check.keys()):
        if data_check[comp]['length_diff'] != 0:
            logger.exception("{comp} data is invalid. You supplied {no_comp} {comp} "
                  "objects and {no_data} datasets. Check you grid data "
                  "and try again".format(comp=comp,
                                         no_comp=len(components[comp]),
                                         no_data=len(components_data[comp])))
            sys.exit(1)
838501
def check_errors(self):
        '''
        
        '''
        errors = ERROR_PATTTERN.findall(self.out)
        # "errors" is a list of tuples
        if errors:
            self.log.error('! Errors occurred:')

            self.log.error('\n'.join(
                [error.replace('\r', '').strip() for error
                 in chain(*errors) if error.strip()]
            ))

            self.log.error('! See "%s.log" for details.' % self.project_name)

            if self.opt.exit_on_error:
                self.log.error('! Exiting...')
                sys.exit(1)
812980
protected boolean checkSupportedMessageTypes(Message msg) {
        if (msg instanceof TextMessage) {
            return true;
        } else {
            try {
                log.error("Unsupported message type: " + msg.getJMSType());
            } catch (JMSException ignore) {
            }
            sendToInvalidMessageQueue(msg);
            return false;
        }
    }
227472
def conflict(self, key, **kwargs):
        
        try:
            msg = self.error_messages[key]
        except KeyError:
            class_name = self.__class__.__name__
            msg = MISSING_ERROR_MESSAGE.format(class_name=class_name, key=key)
            raise AssertionError(msg)
        message_string = msg.format(**kwargs)
        raise Conflict(message_string)
1220889
def check_output(*args, **kwargs):
    ''''''
    if hasattr(subprocess, 'check_output'):
        return subprocess.check_output(stderr=subprocess.STDOUT, universal_newlines=True,
                                       *args, **kwargs)
    else:
        process = subprocess.Popen(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                                   universal_newlines=True, **kwargs)
        output, _ = process.communicate()
        retcode = process.poll()
        if retcode:
            error = subprocess.CalledProcessError(retcode, args[0])
            error.output = output
            raise error
        return output
782137
def _check_errors(self):
        """"""
        # use this to make sure that sweep, sstart, sstop, and sinterval
        # all have values if one of them has values
        # (P^Q^R^S) OR (-P and -Q and -R and -S)
        # above is the minimal form for this logical statement in DNF
        if not ((self._inn(self.args.sweep) and self._inn(self.args.sstart)
                 and self._inn(self.args.sstop) and self._inn(self.args.sinterval))
                or
                (not self._inn(self.args.sweep) and not self._inn(self.args.sstart) and not
                 self._inn(self.args.sstop) and not self._inn(self.args.sinterval))):
            mutually_inclusive = ["sweep", "sstart", "sstop", "sinterval"]
            print_str = ""
            for each in mutually_inclusive:
                print_str += "    {0}: {1}\n".format(each, getattr(self.args, each))
            raise AssertionError("""You specified one or more of the --sweep,
            --sstart, --stop, or --sinterval arguments but did not specify all of
            them. All of them are required when running the program in sweep mode.
            Do not specify any of these arguments if not running the program in
            sweep mode.\n{0}""".format(print_str))
852519
def record_type
      @out << @input.scan(/\{/)

      return false unless rtype_item

      while @input.scan(/,/)
        @out << ","
        return false unless rtype_item
      end

      return false unless @input.scan(/\}/)
      @out << "}"

      true
    end