Checks for DS9 compatibility.
195887
def check_ds9(self):
        
        if self.region_type not in regions_attributes:
            raise ValueError("'{0}' is not a valid region type in this package"
                             "supported by DS9".format(self.region_type))

        if self.coordsys not in valid_coordsys['DS9']:
            raise ValueError("'{0}' is not a valid coordinate reference frame "
                             "in astropy supported by DS9".format(self.coordsys))
956130
def auto_detect_serial(preferred_list=['*']):
    ''''''
    # see if 
    if os.name == 'nt':
        return auto_detect_serial_win32(preferred_list=preferred_list)
    return auto_detect_serial_unix(preferred_list=preferred_list)
825137
def _validate(self):
        
        if self.region_type not in regions_attributes:
            raise ValueError("'{0}' is not a valid region type in this package"
                             .format(self.region_type))

        if self.coordsys not in valid_coordsys['DS9'] + valid_coordsys['CRTF']:
            raise ValueError("'{0}' is not a valid coordinate reference frame "
                             "in astropy".format(self.coordsys))
411742
def check(self):
        """"""

        for i in [f for fs in [self.networks, self.ansible_hosts, self.systems, self.deploys,
                               self.configures, [self.contextualize]] for f in fs]:
            i.check(self)

        snames = [s.name for s in self.systems]
        if len(set(snames)) != len(snames):
            raise RADLParseException("Some System name duplicated.")

        nids = [s.id for s in self.networks]
        if len(set(nids)) != len(nids):
            raise RADLParseException("Some Network name duplicated.")

        return True
1100802
def _check_has_primary(sds):
    
    for s in sds.values():
        if s.server_type == SERVER_TYPE.RSPrimary:
            return TOPOLOGY_TYPE.ReplicaSetWithPrimary
    else:
        return TOPOLOGY_TYPE.ReplicaSetNoPrimary
199635
function _compatibility (rs) {
  const _rs = [rs.rise, rs.transit, rs.set]
  _rs.rise = rs.rise
  _rs.transit = rs.transit
  _rs.set = rs.set
  return _rs
}
258343
def is_applicable(cls, conf):
        """"""
        return all((
            URLPromoter.is_applicable(conf),
            not cls.needs_firefox(conf),
        ))
429652
def _check_compatibility(self):
        """"""
        stored_descr = self._file_trace_description()
        try:
            for k, v in self._model_trace_description():
                assert(stored_descr[k][0] == v[0])
        except:
            raise ValueError(
                "The objects to tally are incompatible with the objects stored in the file.")
970844
public function check()
    {
        try {
            $data = $this->getData(true);
            $id   = $this->getId();

            $checker            = new CompatibilityCheckerModel($data);
            $isCompatible       = (int)$checker->isCompatibleConfig();
            $data['compatible'] = $isCompatible;

            try {
                $storageService = $this->getServiceLocator()->get(Storage::SERVICE_ID);
                $storageService->store($id, $data);
            } catch (StorageException $e) {
                $this->logInfo($e->getMessage());
            }

            $compatibilityMessage = [
                //Not compatible
                '0' => [
                    'success' => true,
                    'type'    => 'error',
                    'message' => __('Your system requires a compatibility update, please contact your system administrator.')
                ],
                //Compatible
                '1' => [
                    'success' => true,
                    'type'    => 'success',
                    'message' => __('Compatible')
                ],
                //Not tested
                '2' => [
                    'success' => true,
                    'type'    => 'warning',
                    'message' => __('This browser is not tested.')
                ],
            ];

            $this->returnJson($compatibilityMessage[$isCompatible]);

        } catch (\common_exception_MissingParameter $e) {
            $this->returnJson(array('success' => false, 'type' => 'error', 'message' => $e->getUserMessage()));
        }
    }
912213
def does_match_definition(given, main, secondary):
    """"""
    assert isinstance(secondary, tuple)
    assert len(secondary) == 2  # general solution could be provided
    types = decompose_type(given)

    if isinstance(types[0], main):
        return True

    if len(types) >= 2:
        cond1 = isinstance(types[0], main)
        cond2 = isinstance(types[1], secondary)
        cond3 = isinstance(types[1], main)
        cond4 = isinstance(types[0], secondary)
        if (cond1 and cond2) or (cond3 and cond4):
            return True

        if len(types) >= 3:
            classes = set([tp.__class__ for tp in types[:3]])
            desired = set([main] + list(secondary))
            diff = classes.symmetric_difference(desired)
            if not diff:
                return True
            if len(diff) == 2:
                items = list(diff)
                return (
                    issubclass(
                        items[0], items[1]) or issubclass(items[1], items[0]))
            return False
    else:
        return False
493991
protected function verifyFormatCompatiblity ()
	{
		$isCompatible 	= true;
		$gdInfo			= gd_info();
		
		switch ($this->format)
		{
			case 'GIF':
				$isCompatible = $gdInfo['GIF Create Support'];
				break;
			case 'JPG':
				$isCompatible = (isset($gdInfo['JPG Support']) || isset($gdInfo['JPEG Support'])) ? true : false;
				break;
			case 'PNG':
				$isCompatible = $gdInfo[$this->format . ' Support'];
				break;
			default:
				$isCompatible = false;
		}
		
		if (!$isCompatible)
		{
			// one last check for "JPEG" instead
			$isCompatible = $gdInfo['JPEG Support'];
			
			if (!$isCompatible)
			{
				$this->triggerError('Your GD installation does not support ' . $this->format . ' image types');
			}
		}
	}
1135784
def _check_consistency(self):
        ''''''
        type_count = defaultdict(int)
        for _, section in sorted(self.sections.items()):
            type_count[section.section_type] += 1

        if type_count[POINT_TYPE.SOMA] != 1:
            L.info('Have %d somas, expected 1', type_count[POINT_TYPE.SOMA])
1194082
public boolean isMatch() {
        if (shuntsuList.size() > 0) {
            return false;
        }
        for (Toitsu toitsu : toitsuList) {
            int num = toitsu.getTile().getNumber();
            if (1 < num && num < 9) {
                return false;
            }
        }

        for (Kotsu kotsu : kotsuList) {
            int num = kotsu.getTile().getNumber();
            if (1 < num && num < 9) {
                return false;
            }
        }
        return true;
    }
1161069
def check(self, value, namespace):
        
        return namespace.is_compatible(self.typevar, type(value))
48396
def matches(self, object):
    

    try:
      self.check_match(object)
    except securesystemslib.exceptions.FormatError:
      return False
    else:
      return True
1166654
def check(self, version):
        

        for disjunct in self._disjuncts:
            if self._check_insersection(version, disjunct):
                return True

        return False
1077253
private void checkSolaris(String PortName, int PortType) {
        char p[] = {91};
        for (p[0] = 97; p[0] < 123; p[0]++) {
            if (testRead(PortName.concat(new String(p)), PortType)) {
                CommPortIdentifier.addPortName(PortName.concat(new String(p)), PortType, this);
            }
        }
        /**
         * check for 0-9 in case we have them (Solaris USB)
         */
        for (p[0] = 48; p[0] <= 57; p[0]++) {
            if (testRead(PortName.concat(new String(p)), PortType)) {
                CommPortIdentifier.addPortName(PortName.concat(new String(p)), PortType, this);
            }
        }
    }