Creates a pure composition.

        Args:
            z (int): atomic number
169336
def from_pure(cls, z):
        
        return cls(cls._key, {z: 1.0}, {z: 1.0}, pyxray.element_symbol(z))
255486
def __update_molar_mass(self, compound='', element=''):
        
        _molar_mass_element = 0
        list_ratio = self.stack[compound][element]['isotopes']['isotopic_ratio']
        list_mass = self.stack[compound][element]['isotopes']['mass']['value']
        ratio_mass = zip(list_ratio, list_mass)
        for _ratio, _mass in ratio_mass:
            _molar_mass_element += np.float(_ratio) * np.float(_mass)
        self.stack[compound][element]['molar_mass']['value'] = _molar_mass_element
872929
def get_composition(source, *fxns):
  """"""
  val = source
  for fxn in fxns:
    val = fxn(val)
  return val
779519
IAtom newCDKAtom(Atom atom) {
        Element element = atom.element();
        boolean unknown = element == Element.Unknown;
        if (unknown) {
            IPseudoAtom pseudoAtom = builder.newInstance(IPseudoAtom.class, element.symbol());
            pseudoAtom.setSymbol(element.symbol());
            pseudoAtom.setLabel(atom.label());
            return pseudoAtom;
        }
        return createAtom(element);
    }
513427
def from_dict(cls, d):
        
        atoms_n_occu = {}
        for sp_occu in d["species"]:
            if "oxidation_state" in sp_occu and Element.is_valid_symbol(
                    sp_occu["element"]):
                sp = Specie.from_dict(sp_occu)
            elif "oxidation_state" in sp_occu:
                sp = DummySpecie.from_dict(sp_occu)
            else:
                sp = Element(sp_occu["element"])
            atoms_n_occu[sp] = sp_occu["occu"]
        props = d.get("properties", None)
        return cls(atoms_n_occu, d["xyz"], properties=props)
879834
def composition_to_s
      axes.map { |axis| CompositeUnit === axis ? "(#{axis.composition_to_s})" : axis.label.to_s }.join(" #{operator} ")
    end
549483
def implicify_hydrogens(self):
        
        explicit = defaultdict(list)
        c = 0
        for n, atom in self.atoms():
            if atom.element == 'H':
                for m in self.neighbors(n):
                    if self._node[m].element != 'H':
                        explicit[m].append(n)

        for n, h in explicit.items():
            atom = self._node[n]
            len_h = len(h)
            for i in range(len_h, 0, -1):
                hi = h[:i]
                if atom.get_implicit_h([y.order for x, y in self._adj[n].items() if x not in hi]) == i:
                    for x in hi:
                        self.remove_node(x)
                        c += 1
                    break

        self.flush_cache()
        return c
443171
static <T> Enumeration<T> compose(Enumeration<T> e1, Enumeration<T> e2) {
        // return the composite of e1 and e2, or whichever is non-empty 
        return isEmpty(e1) ? e2
                        : isEmpty(e2) ? e1
                                        : new CompositeEnumeration<T>(e1).add(e2);
    }
562002
def zaffine(c0, c1, c2, d):
    

    xx, yy = zmeshgrid(d)
    Hx, Hy = _vector.vector.to_list(xx), _vector.vector.to_list(yy)

    Hs = _cp.deepcopy(Hx)
    Hs[0][:, :, 0] = c1 * Hx[0][:, :, 0] + c2 * Hy[0][:, :, 0]
    Hs[-1][1, :, :] = c1 * Hx[-1][1, :, :] + (c0 + c2 * Hy[-1][1, :, :])

    d = len(Hs)
    for k in range(1, d - 1):
        Hs[k][1, :, 0] = c1 * Hx[k][1, :, 0] + c2 * Hy[k][1, :, 0]

    return _vector.vector.from_list(Hs)
1031342
def create(cls, expr, binds):
        
        return cls(expr=expr, binds=binds, dtype=bool_dtype)
1334275
function create(con, p, cb) {
  var data = 'created by zk-mkdir-p'; // just want a dir, so store something
  var flags = 0; // none
  con.a_create(p, data, flags, function(rc, error, zkPath) {
    // already exists, cool.
    if(rc == ZooKeeper.ZNODEEXISTS) {
      return cb();
    }
    if(rc != 0) {
      return cb(new Error('Zookeeper Error: code='+rc+'   '+error));
    }
    // sucessfully created!
    return cb();
  });
}
759706
function fromXYZ(x, y, z) {
    var color = create();
    setXYZ(color, x, y, z);
    return color;
}
1260251
@Pure
	@Inline(value = "new $2($1.intValue())", imported = AtomicInteger.class)
	public static AtomicInteger toAtomicInteger(AtomicDouble number) {
		return new AtomicInteger(number.intValue());
	}
389055
def calculate_ideal_weight_percent(pif):
    
    if not isinstance(pif, ChemicalSystem):
        return pif
    if not pif.chemical_formula:
        return pif
    else:
        expanded_formula_no_special_char = _expand_formula_(
            pif.chemical_formula)
        element_array = _create_emprical_compositional_array_(
            expanded_formula_no_special_char)
        appended_e_array = _add_ideal_atomic_weights_(element_array)
        a_array_with_pcts = _add_ideal_weight_percent_(appended_e_array)
        for e in a_array_with_pcts:
            # Checks if a Composition element decribing that element already
            # exists.
            if _get_element_in_pif_composition_(pif, e["symbol"]):
                # If it exists, it removes the old Composition object, and
                # inserts a new one with ideal atomic weight percent added
                in_pif = _get_element_in_pif_composition_(pif, e["symbol"])
                comp = in_pif[0]
                pif.composition.pop(in_pif[1])
                comp.idealWeightPercent = e["weight_percent"]
                pif.composition.append(comp)
            else:
                # If not, it creates a new Composition object with the element
                # and ideal atomic weight percent.
                comp = Composition()
                comp.element = e["symbol"]
                comp.idealWeightPercent = e["weight_percent"]
                pif.composition.append(comp)
        return pif
1828
def sZ(qubit: Qubit, coefficient: complex = 1.0) -> Pauli:
    """"""
    return Pauli.sigma(qubit, 'Z', coefficient)
462192
def calcMzFromMass(mass, charge):
    
    mz = (mass + (maspy.constants.atomicMassProton * charge)) / charge
    return mz
1092397
def calcMzFromMh(mh, charge):
    
    mz = (mh + (maspy.constants.atomicMassProton * (charge-1))) / charge
    return mz