Args:
            xyz_string: string of the form 'x, y, z, +1', '-x, -y, z, -1',
                '-2y+1/2, 3x+1/2, z-y+1/2, +1', etc.
        Returns:
            MagSymmOp object
512543
def from_xyzt_string(xyzt_string):
        
        symmop = SymmOp.from_xyz_string(xyzt_string.rsplit(',', 1)[0])
        try:
            time_reversal = int(xyzt_string.rsplit(',', 1)[1])
        except:
            raise Exception("Time reversal operator could not be parsed.")
        return MagSymmOp.from_symmop(symmop, time_reversal)
657150
private function _mult(string $X, string $Y): string
    {
        $x = GCM::strToGMP($X);
        $Z = GCM::strToGMP(GCM::ZB_128);
        $V = GCM::strToGMP($Y);
        $R = GCM::strToGMP(self::R);
        for ($i = 0; $i < 128; ++$i) {
            // if bit at X[i] is set
            if (gmp_testbit($x, 127 - $i)) {
                $Z ^= $V;
            }
            // if LSB(Vi) = 0
            if (!gmp_testbit($V, 0)) {
                $V >>= 1;
            } else {
                $V = ($V >> 1) ^ $R;
            }
        }
        return GCM::gmpToStr($Z, 16);
    }
1179219
def _force_xyz(self,x,y,z,i):
        """"""
        return -4.*numpy.pi*self._b*self._c\
            *_forceInt(x,y,z,
                       lambda m: self._mdens(m),
                       self._b2,self._c2,i,glx=self._glx,glw=self._glw)
685628
def _evaluate_xyz(self,x,y,z):
        """"""
        return 2.*numpy.pi*self._b*self._c\
            *_potInt(x,y,z,self._psi,
                     self._b2,self._c2,glx=self._glx,glw=self._glw)
682026
def minimise_xyz(xyz):
    """"""
    x, y, z = xyz
    m = max(min(x, y), min(max(x, y), z))
    return (x-m, y-m, z-m)
1258111
def _P(m):
    
    P = np.zeros((m**2,m**2), dtype=np.int64)
    for i in range(1, m**2 + 1):
        j = 1 + m*((i - 1) % m) + (i - 1)//m
        P[i-1, j-1] = 1
    return P
43863
public static function xyzm(float $x, float $y, float $z, float $m, int $srid = 0) : Point
    {
        return new Point(CoordinateSystem::xyzm($srid), $x, $y, $z, $m);
    }
540965
def tileXYZToQuadKey(self, x, y, z):
        '''
        
        '''
        quadKey = ''
        for i in range(z, 0, -1):
            digit = 0
            mask = 1 << (i - 1)
            if (x & mask) != 0:
                digit += 1
            if (y & mask) != 0:
                digit += 2
            quadKey += str(digit)
        return quadKey
1063345
def tuple_as_vec(xyzw):
        
        vec = Vector4()
        vec[0] = xyzw[0]
        vec[1] = xyzw[1]
        vec[2] = xyzw[2]
        vec[3] = xyzw[3]
        return vec
405290
def begin_y(self):
        
        cxnSp = self._element
        y, cy, flipV = cxnSp.y, cxnSp.cy, cxnSp.flipV
        begin_y = y+cy if flipV else y
        return Emu(begin_y)
887790
def xy(self):
        """"""
        if self._xy != (None, None):
            self._x, self._y = self._xy

        if self._x is not None and self._y is not None:
            x = self._x
            if self._x > 1:
                x = self._x / 65555
            y = self._y
            if self._y > 1:
                y = self._y / 65555
            return (x, y)

        return None
14598
def initialize_from_string(content: str) -> 'CapitanSymbol':
        

        if content is None or content is "":
            return None

        parts = content.split(":")
        min_x = 100000
        max_x = 0
        min_y = 100000
        max_y = 0

        symbol_name = parts[0]

        sequence = parts[1]
        image_numbers = parts[2].split(',')
        image_data = numpy.asarray(image_numbers, numpy.uint8).reshape((30, 30))

        stroke = []

        for point_string in sequence.split(";"):
            if point_string is "":
                continue  # Skip the last element, that is due to a trailing ; in each line

            point_x, point_y = point_string.split(",")
            x = float(point_x)
            y = float(point_y)
            stroke.append(SimplePoint2D(x, y))

            max_x = max(max_x, x)
            min_x = min(min_x, x)
            max_y = max(max_y, y)
            min_y = min(min_y, y)

        dimensions = Rectangle(Point2D(min_x, min_y), int(max_x - min_x + 1), int(max_y - min_y + 1))
        return CapitanSymbol(content, stroke, image_data, symbol_name, dimensions)
1282771
def xyz2lab(x__, y__, z__):
    

    def f__(arr):
        """f__ function
        """

        return np.where(arr > 216.0 / 24389.0,
                        arr ** (1.0/3.0),
                        (1.0 / 3.0) * (29.0 / 6.0) * (29.0 / 6.0) * arr
                        + 4.0 / 29.0)
    fy_ = f__(y__ / 100.0)
    l__ = 116 * fy_ - 16
    a__ = 500.0 * (f__(x__ / 95.047) - fy_)
    b__ = 200.0 * (fy_ - f__(z__ / 108.883))
    return l__, a__, b__
148626
def from_string(rxn_string):
        
        rct_str, prod_str = rxn_string.split("->")

        def get_comp_amt(comp_str):
            return {Composition(m.group(2)): float(m.group(1) or 1)
                    for m in re.finditer(r"([\d\.]*(?:[eE]-?[\d\.]+)?)\s*([A-Z][\w\.\(\)]*)",
                                         comp_str)}
        return BalancedReaction(get_comp_amt(rct_str), get_comp_amt(prod_str))
1077206
def from_string(string):
        
        lines = string.split("\n")
        toks = lines[0].split()
        lengths = [float(i) for i in toks]
        toks = lines[1].split()
        angles = [float(i) for i in toks[0:3]]
        # Zeo++ takes x-axis along a and pymatgen takes z-axis along c
        a = lengths.pop(-1)
        lengths.insert(0, a)
        alpha = angles.pop(-1)
        angles.insert(0, alpha)
        latt = Lattice.from_lengths_and_angles(lengths, angles)
        sp = []
        coords = []
        chrg = []
        for l in lines[4:]:
            m = re.match(r'\d+\s+(\w+)\s+([0-9\-\.]+)\s+([0-9\-\.]+)\s+' +
                         r'([0-9\-\.]+)\s+(?:0\s+){8}([0-9\-\.]+)', l.strip())
            if m:
                sp.append(m.group(1))
                # coords.append([float(m.group(i)) for i in xrange(2, 5)])
                # Zeo++ takes x-axis along a and pymatgen takes z-axis along c
                coords.append([float(m.group(i)) for i in [3, 4, 2]])
                chrg.append(m.group(5))
        return ZeoCssr(
            Structure(latt, sp, coords, site_properties={'charge': chrg})
        )
1235136
def XYZ_to_xyY(cobj, *args, **kwargs):
    
    xyz_sum = cobj.xyz_x + cobj.xyz_y + cobj.xyz_z
    # avoid division by zero
    if xyz_sum == 0.0:
        xyy_x = 0.0
        xyy_y = 0.0
    else:
        xyy_x = cobj.xyz_x / xyz_sum
        xyy_y = cobj.xyz_y / xyz_sum
    xyy_Y = cobj.xyz_y

    return xyYColor(
        xyy_x, xyy_y, xyy_Y, observer=cobj.observer, illuminant=cobj.illuminant)
861319
def xyz2lonlat(x,y,z):
    

    xs = np.array(x)
    ys = np.array(y)
    zs = np.array(z)

    lons = np.arctan2(ys, xs)
    lats = np.arcsin(zs)

    return lons, lats