Return True if the arrow is in a chemical name.
11988
def _is_saccharide_arrow(self, before, after):
        """"""
        if (before and after and before[-1].isdigit() and after[0].isdigit() and
            before.rstrip('0123456789').endswith('(') and after.lstrip('0123456789').startswith(')-')):
            return True
        else:
            return False
15689
def check_for_non_canonical(residue):
        """"""
        res_label = list(residue[0])[0][2]
        atom_labels = {x[2] for x in itertools.chain(
            *residue[1].values())}  # Used to find unnatural aas
        if (all(x in atom_labels for x in ['N', 'CA', 'C', 'O'])) and (
                len(res_label) == 3):
            return Residue, True
        return None
1143590
@Override
    public boolean matches(IAtom atom) {
        return Preconditions.checkNotNull(atom.getAtomicNumber(), "Atomic number is not set.").equals(
                this.getAtomicNumber());
    }
615541
function matchIndex(prop) {
    if (!prop || !/\[\d+\]/.test(prop))
        return false;
    var prefix = prop.match(/[^\[]+/i);
    var idx;
    var indices = prop.match(/\d+/g);
    if (!indices)
        return false;
    return {
        name: prefix[0],
        index: indices[0],
        indices: indices.slice(1)
    };
}
210982
def is_exchange(self, reaction_id):
        """"""
        reaction = self.get_reaction(reaction_id)
        return (len(reaction.left) == 0) != (len(reaction.right) == 0)
108441
def check_in_ase(atoms, ase_db, energy=None):
    """"""

    db_ase = ase.db.connect(ase_db)
    if energy is None:
        energy = atoms.get_potential_energy()
    formula = get_chemical_formula(atoms)
    rows = db_ase.select(energy=energy)
    n = 0
    ids = []
    for row in rows:
        if formula == row.formula:
            n += 1
            ids.append(row.id)
    if n > 0:
        id = ids[0]
        unique_id = db_ase.get(id)['unique_id']
        return id, unique_id
    else:
        return None, None
236549
def could_be(self, other):
        """"""
        # TODO: Some suffix and title differences should be allowed
        if type(other) is not type(self):
            return NotImplemented
        if self == other:
            return True
        for attr in ['title', 'firstname', 'middlename', 'nickname', 'prefix', 'lastname', 'suffix']:
            if attr not in self or attr not in other:
                continue
            puncmap = dict((ord(char), None) for char in string.punctuation)
            s = self[attr].lower().translate(puncmap)
            o = other[attr].lower().translate(puncmap)
            if s == o:
                continue
            if attr in {'firstname', 'middlename', 'lastname'}:
                if (({len(comp) for comp in s.split()} == {1} and [el[0] for el in o.split()] == s.split()) or
                        ({len(comp) for comp in o.split()} == {1} and [el[0] for el in s.split()] == o.split())):
                    continue
            return False
        return True
1205539
def arrows(self):
        """"""
        for o in self.arrow.values():
            for arro in o.values():
                yield arro
642504
def drug_names_match_criteria(drug_names: List[str],
                              names_are_generic: bool = False,
                              include_categories: bool = False,
                              **criteria: Dict[str, bool]) -> List[bool]:
    
    return [
        drug_name_matches_criteria(
            dn,
            name_is_generic=names_are_generic,
            include_categories=include_categories,
            **criteria)
        for dn in drug_names
    ]
106259
public static boolean isValidName(String name) {
    final int length = name.length();
    if (length == 0) {
      return false;
    }
    char ch = name.charAt(0);
    if (!isNameStart(ch)) {
      return false;
    }
    for (int i = 1; i < length; ++i) {
      ch = name.charAt(i);
      if (!isName(ch)) {
        return false;
      }
    }
    return true;
  }
73612
@Override
    public boolean matches(IAtom atom) {
        String symbol = atom.getSymbol();
        int group = PeriodicTable.getGroup(symbol);
        return group == this.groupNumber;
    }
143527
private static boolean familyHalogen(IAtom atom) {
        String symbol = atom.getSymbol();
        if (symbol.equals("F") || symbol.equals("Cl") || symbol.equals("Br") || symbol.equals("I"))
            return true;
        else
            return false;
    }
842740
def _check_lookup_prop(self, result_data):
        """"""
        if not self._lookup_prop:
            return False

        if not result_data.get("id") and self._lookup_prop != "name":
            return False
        if not result_data.get("title") and self._lookup_prop == "name":
            return False
        return True
961184
def has_data(d, fullname):
    
    fullname = r'%s-' % (fullname, )
    for k in d:
        if not k.startswith(fullname):
            continue
        return True
    return False
602694
private boolean isNotSymbol(String text, int index, char c) {
        if (index >= 0 && index < text.length()) {
            return text.charAt(index) != c;
        }

        return true;
    }
1303480
def _is_vis(channel):
        """"""
        if isinstance(channel, str):
            return channel == '00_7'
        elif isinstance(channel, int):
            return channel == 1
        else:
            raise ValueError('Invalid channel')
1156218
function (s, r) {
        var i, l
        for (i = 0, l = this.length; i < l; i++) {
          if (nw.match(this[i], s, r)) {
            return true
          }
        }
        return false
      }