Returns the amount of the element in the reaction.

        Args:
            element (Element/Specie): Element in the reaction

        Returns:
            Amount of that element in the reaction.
428253
def get_el_amount(self, element):
        
        return sum([self._all_comp[i][element] * abs(self._coeffs[i])
                    for i in range(len(self._all_comp))]) / 2
929157
public static int getTotalMonomerCount(PolymerNotation polymer) {
    int count = 0;
    for (MonomerNotation element : polymer.getPolymerElements().getListOfElements()) {
      count += getMonomerCountFromMonomerNotation(element);
    }
    return count;
  }
476633
def max_element (elements, ordered = None):
    
    assert is_iterable(elements)
    assert callable(ordered) or ordered is None
    if not ordered: ordered = operator.lt

    max = elements [0]
    for e in elements [1:]:
        if ordered (max, e):
            max = e

    return max
319178
public static int getAtomCount(IMolecularFormula formula) {

        int count = 0;
        for (IIsotope isotope : formula.isotopes()) {
            count += formula.getIsotopeCount(isotope);
        }
        return count;
    }
1202737
def from_element(cls, element):
        
        def _int_helper(name):
            """Try to convert the name attribute to an int, or None."""
            result = element.get(name)
            if result is not None:
                try:
                    return int(result)
                except ValueError:
                    raise DIDLMetadataError(
                        'Could not convert {0} to an integer'.format(name))
            else:
                return None

        content = {}
        # required
        content['protocol_info'] = element.get('protocolInfo')
        if content['protocol_info'] is None:
            raise DIDLMetadataError('Could not create Resource from Element: '
                                    'protocolInfo not found (required).')
        # Optional
        content['import_uri'] = element.get('importUri')
        content['size'] = _int_helper('size')
        content['duration'] = element.get('duration')
        content['bitrate'] = _int_helper('bitrate')
        content['sample_frequency'] = _int_helper('sampleFrequency')
        content['bits_per_sample'] = _int_helper('bitsPerSample')
        content['nr_audio_channels'] = _int_helper('nrAudioChannels')
        content['resolution'] = element.get('resolution')
        content['color_depth'] = _int_helper('colorDepth')
        content['protection'] = element.get('protection')
        content['uri'] = element.text
        return cls(**content)
590219
def specificity(self):
        
        ids = sum(a.countIDs() for a in self.elements)
        non_ids = sum((a.countNames() - a.countIDs()) for a in self.elements)
        tests = sum(len(a.tests) for a in self.elements)
        
        return (ids, non_ids, tests)
1072690
def H_donor_count(mol):
    
    mol.require("Valence")
    return sum(1 for _, a in mol.atoms_iter() if a.H_donor)
719325
def _body(self):
        
        if self.__body is None:
            self.__body = _Body(self._element.body, self)
        return self.__body
407306
def _return_value(content, ns):
    
    doc = ElementTree.fromstring(content)
    query = './/{%(ns)s}%(item)s' % {'ns': ns, 'item': 'ReturnValue'}
    rv = doc.find(query)
    return int(rv.text)
749653
def number(self):
        
        return int(math.ceil(self.total_size / float(self.size)))
844494
def get_form_energy(self, entry):
        
        c = entry.composition
        return entry.energy - sum([c[el] * self.el_refs[el].energy_per_atom
                                   for el in c.elements])
403944
public static int getImplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
        return atom.getImplicitHydrogenCount() == CDKConstants.UNSET ? 0 : atom.getImplicitHydrogenCount();
    }
1202803
def element(self, inp=None):
        
        if inp is None:
            return self.elements[0]
        elif inp in self.elements:
            return inp
        else:
            raise ValueError('cannot convert inp {} to element in {}'
                             ''.format(inp, self))
315451
def get_abundance_elem(self,cycle):
        

        import nuutils as u

        masses_for_this_cycle = self.se.get(cycle,'mass')
        self._read_iso_abund_marco([min(masses_for_this_cycle),max(masses_for_this_cycle)],cycle)

        u.stable_specie()
        self.decay(self.mass_frac)

        # provide library for Z versus element names, and Z for elements
        element_name = self.se.elements
        u.give_zip_element_z_and_names(element_name)
        # from here read solar abundances
        solar_factor = 2.
        u.solar('iniab1.0E-02.ppn_GN93',solar_factor)

        self.stable_isotope_identifier=u.jjdum
        self.stable_isotope_list=u.stable


        self.element_abundance_not_decayed=[]
        self.element_abundance_decayed =[]
        self.element_production_factors=[]
        self.element_production_factors_decayed=[]
        for i in range(len(masses_for_this_cycle)):
            mass_fractions_array_decayed = decayed_multi_d[i]
            mass_fractions_array_not_decayed = self.mass_frac[i]
            u.element_abund_marco(2,self.stable_isotope_list,self.stable_isotope_identifier,mass_fractions_array_not_decayed,mass_fractions_array_decayed)
            self.element_abundance_not_decayed.append(u.elem_abund)
            self.element_abundance_decayed.append(u.elem_abund_decayed)
            self.element_production_factors.append(u.elem_prod_fac)
            self.element_production_factors_decayed.append(u.elem_prod_fac_decayed)
1256127
def remove(self, element):
        
        if element not in self._counts:
            raise KeyError(element)
        elif self._counts[element] == 1:
            newc = self._counts.remove(element)
        else:
            newc = self._counts.set(element, self._counts[element] - 1)
        return PBag(newc)
453019
def _get_elements(self, site):
        
        try:
            if isinstance(site.specie, Element):
                return [site.specie]
            return [Element(site.specie)]
        except:
            return site.species.elements
179982
def getElementByID(self, id):
        
        pos=0
        for element in self._subElements:
            if element.get_id()==id:
                return (element,pos)
            pos+=1