Compatibility function, return mode=metal, when
    available, mode=hill, when not (ASE <= 3.13)
439543
def get_chemical_formula(atoms, mode='metal'):
    
    try:
        return atoms.get_chemical_formula(mode=mode)
    except ValueError:
        return atoms.get_chemical_formula(mode='hill')
272009
function isCompatible(tdef, node) {
	if (tdef && node) {
		if (tdef.select('metaData[name=virtual]').array.length > 0) {
			// tdef is virtual, so it is compatible
			return true;

		} else {
			const nodePlatforms = getPlatforms(node.typeDefinition);

			for (let i = 0; i < nodePlatforms.length; i++) {
				if (tdef.select('deployUnits[name=*]/filters[name=platform,value=' + nodePlatforms[i] + ']').array.length > 0) {
					return true;
				}
			}
		}
	}
	return false;
}
140726
function compatMaxage(opts) {
  if (opts) {
    opts.maxage = opts.maxage === undefined
      ? opts.maxAge
      : opts.maxage;
    delete opts.maxAge;
  }
}
1208962
def _check_mode(mode):
    """"""
    if not isinstance(mode, (_unicode, str)):
        raise TypeError("Invalid mode: {0!r}".format(mode))
    mode_set = set(mode)
    if mode_set.difference('xrwb+') or len(mode) > len(mode_set):
        raise ValueError("Invalid mode: {0!r}".format(mode))
    if len(mode_set.intersection('xrw')) != 1:
        raise ValueError("mode must contain exactly one of 'xrw'")

    if '+' in mode_set:
        mode_int = _snd.SFM_RDWR
    elif 'r' in mode_set:
        mode_int = _snd.SFM_READ
    else:
        mode_int = _snd.SFM_WRITE
    return mode_int
145040
def get_global_compatibility_level(self):
        
        res = requests.get(self._url('/config'), headers=HEADERS)
        raise_if_failed(res)
        return res.json()['compatibility']
508147
def is_compatible_assembly_level(self, ncbi_assembly_level):
        """"""
        configured_ncbi_strings = [self._LEVELS[level] for level in self.assembly_level]
        return ncbi_assembly_level in configured_ncbi_strings
233875
function compatibleTypes(x,y) {
	if (x === y)
		return true;
	if (x instanceof TQualifiedReference && y instanceof TQualifiedReference)
		return x.qname === y.qname;
	return false;
}
873657
function checkTypeComparableTo(source, target, errorNode, headMessage, containingMessageChain) {
            return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain);
        }
336489
def valid_modes(self):
        """"""
        default_mode = (self.mode,) if self.mode is not None else None
        return getattr(self, '_valid_mode', default_mode)
188466
def validate():
    
    msg = Printer()
    with msg.loading("Loading compatibility table..."):
        r = requests.get(about.__compatibility__)
        if r.status_code != 200:
            msg.fail(
                "Server error ({})".format(r.status_code),
                "Couldn't fetch compatibility table.",
                exits=1,
            )
    msg.good("Loaded compatibility table")
    compat = r.json()["spacy"]
    version = about.__version__
    version = version.rsplit(".dev", 1)[0]
    current_compat = compat.get(version)
    if not current_compat:
        msg.fail(
            "Can't find spaCy v{} in compatibility table".format(version),
            about.__compatibility__,
            exits=1,
        )
    all_models = set()
    for spacy_v, models in dict(compat).items():
        all_models.update(models.keys())
        for model, model_vs in models.items():
            compat[spacy_v][model] = [reformat_version(v) for v in model_vs]
    model_links = get_model_links(current_compat)
    model_pkgs = get_model_pkgs(current_compat, all_models)
    incompat_links = {l for l, d in model_links.items() if not d["compat"]}
    incompat_models = {d["name"] for _, d in model_pkgs.items() if not d["compat"]}
    incompat_models.update(
        [d["name"] for _, d in model_links.items() if not d["compat"]]
    )
    na_models = [m for m in incompat_models if m not in current_compat]
    update_models = [m for m in incompat_models if m in current_compat]
    spacy_dir = Path(__file__).parent.parent

    msg.divider("Installed models (spaCy v{})".format(about.__version__))
    msg.info("spaCy installation: {}".format(path2str(spacy_dir)))

    if model_links or model_pkgs:
        header = ("TYPE", "NAME", "MODEL", "VERSION", "")
        rows = []
        for name, data in model_pkgs.items():
            rows.append(get_model_row(current_compat, name, data, msg))
        for name, data in model_links.items():
            rows.append(get_model_row(current_compat, name, data, msg, "link"))
        msg.table(rows, header=header)
    else:
        msg.text("No models found in your current environment.", exits=0)
    if update_models:
        msg.divider("Install updates")
        msg.text("Use the following commands to update the model packages:")
        cmd = "python -m spacy download {}"
        print("\n".join([cmd.format(pkg) for pkg in update_models]) + "\n")
    if na_models:
        msg.text(
            "The following models are not available for spaCy "
            "v{}: {}".format(about.__version__, ", ".join(na_models))
        )
    if incompat_links:
        msg.text(
            "You may also want to overwrite the incompatible links using the "
            "`python -m spacy link` command with `--force`, or remove them "
            "from the data directory. "
            "Data path: {path}".format(path=path2str(get_data_path()))
        )
    if incompat_models or incompat_links:
        sys.exit(1)
1048955
def _match_modes(self, remote_path, l_st):
        """"""
        self.sftp.chmod(remote_path, S_IMODE(l_st.st_mode))
        self.sftp.utime(remote_path, (l_st.st_atime, l_st.st_mtime))

        if self.chown:
            self.sftp.chown(remote_path, l_st.st_uid, l_st.st_gid)
245221
def check_compatibility(name):
    

    comp = comp_names[name]

    if sys.version_info.major < 3 and comp.compat == "python3":
        return False

    if sys.version_info.major >= 3 and comp.compat != "python3":
        return False

    return True
1270929
def better(old_value, new_value, mode):
    
    if (old_value is None or np.isnan(old_value)) and (new_value is not None and not np.isnan(new_value)):
        return True

    if mode == 'min':
        return new_value < old_value
    elif mode == 'max':
        return new_value > old_value
    else:
        raise RuntimeError(f"Mode '{mode}' value is not supported")
668978
function match(level) {
    var result;
    if (_.isArray(config.cout)) {
      result = _.indexOf(config.cout, '*') > -1 ? true : _.indexOf(config.cout, level.toString().toLowerCase()) > -1 ? true : false;

    } else if (_.isString(config.cout)) {
      if (level === '*') {
        result = true;
      } else {
        result = config.cout === level;
      }
    } else if (_.isBoolean(config.cout)) {
      if (config.cout === true) {
        result = true;
      }
    }
    return result;
  }
1301134
def compatibility_rank(self, supported):
        
        preferences = []
        for tag in self.compatibility_tags:
            try:
                preferences.append(supported.index(tag))
            # Tag not present
            except ValueError:
                pass
        if len(preferences):
            return (min(preferences), self.arity)
        return (_big_number, 0)
606111
def kind(self):
        
        self._verify_crc()
        if 'vertex_colors' in self._data:
            mode = 'vertex'
        elif 'face_colors' in self._data:
            mode = 'face'
        else:
            mode = None

        return mode
983253
def _mode(self, s):
        
        # Note: Output from git-fast-export slightly different to spec
        if s in [b'644', b'100644', b'0100644']:
            return 0o100644
        elif s in [b'755', b'100755', b'0100755']:
            return 0o100755
        elif s in [b'040000', b'0040000']:
            return 0o40000
        elif s in [b'120000', b'0120000']:
            return 0o120000
        elif s in [b'160000', b'0160000']:
            return 0o160000
        else:
            self.abort(errors.BadFormat, 'filemodify', 'mode', s)