Build a pyramid of specified base size `s` and `height`, centered at `pos`.
778030
def Pyramid(pos=(0, 0, 0), s=1, height=1, axis=(0, 0, 1), c="dg", alpha=1):
    
    return Cone(pos, s, height, axis, c, alpha, 4)
1270332
def center_at(self, x, y):
        """"""

        self.x = x - (self.width / 2)
        self.y = y - (self.height / 2)
243836
def __make_skeleton(self, path):
        """"""
        
        self.path = path
        if os.path.exists(os.path.join(self.path, "output", self.name)):
            shutil.rmtree(os.path.join(self.path, "output", self.name))
        
        self.path_folders = os.path.join(self.path, "output", self.name, "site", "static")
        os.makedirs(self.path_folders)
        
        self.path_folders = os.path.join(self.path, "output", self.name, "site", "static", "css")
        os.makedirs(self.path_folders)
        
        self.path_folders = os.path.join(self.path, "output", self.name, "site", "static", "js")
        os.makedirs(self.path_folders)
        
        for key in self.sections:
            self.path_folders = os.path.join(self.path, "output", self.name, "site", key)
            os.makedirs(self.path_folders)
497078
def _rspiral(width, height):
        

        x0 = 0
        y0 = 0
        x1 = width - 1
        y1 = height - 1

        while x0 < x1 and y0 < y1:
            for x in range(x0, x1):
                yield x, y0
            for y in range(y0, y1):
                yield x1, y
            for x in range(x1, x0, -1):
                yield x, y1
            for y in range(y1, y0, -1):
                yield x0, y

            x0 += 1
            y0 += 1
            x1 -= 1
            y1 -= 1

        if x0 == x1:
            for y in range(y0, y1 + 1):
                yield x0, y
        elif y0 == y1:
            for x in range(x0, x1 + 1):
                yield x, y0
621059
def height(poly):
    """"""
    num = len(poly) - 1
    if abs(poly[num][2] - poly[0][2]) > abs(poly[1][2] - poly[0][2]):
        return dist(poly[num], poly[0])
    elif abs(poly[num][2] - poly[0][2]) < abs(poly[1][2] - poly[0][2]):
        return dist(poly[1], poly[0])
    else:
        return min(dist(poly[num], poly[0]), dist(poly[1], poly[0]))
971224
def set_base_xpos(self, pos):
        """"""
        node = self.worldbody.find("./body[@name='base']")
        node.set("pos", array_to_string(pos - self.bottom_offset))
1154267
protected static void constructM(List<Point2D_F64> obsPts,
									 DMatrixRMaj alphas, DMatrixRMaj M)
	{
		int N = obsPts.size();
		M.reshape(3*alphas.numCols,2*N,false);

		for( int i = 0; i < N; i++ ) {
			Point2D_F64 p2 = obsPts.get(i);

			int row = i*2;

			for( int j = 0; j < alphas.numCols; j++ ) {
				int col = j*3;

				double alpha = alphas.unsafe_get(i, j);
				M.unsafe_set(col, row, alpha);
				M.unsafe_set(col + 1, row, 0);
				M.unsafe_set(col + 2, row, -alpha * p2.x);
				M.unsafe_set(col    , row + 1, 0);
				M.unsafe_set(col + 1, row + 1, alpha);
				M.unsafe_set(col + 2, row + 1, -alpha * p2.y);
			}
		}
	}
1118348
public Pie center(Object width, Object height) {
        this.center = new Object[]{width, height};
        return this;
    }
925926
def build(self, builder):
        """"""
        builder.start("BasicDefinitions", {})
        for child in self.measurement_units:
            child.build(builder)
        builder.end("BasicDefinitions")
746932
def make_relative(base, obj):
    """"""
    uri = obj.get("location", obj.get("path"))
    if ":" in uri.split("/")[0] and not uri.startswith("file://"):
        pass
    else:
        if uri.startswith("file://"):
            uri = uri_file_path(uri)
            obj["location"] = os.path.relpath(uri, base)
338658
def setup(delta_x, delta_y, delta_z, pos)
      # Set up the provided parameters:
      @delta_x = delta_x
      @delta_y = delta_y
      @delta_z = delta_z
      self.pos = pos
      # Set up the dimensional parameters:
      @nx, @ny, @nz = self.shape
    end
697142
def grav_pot(self, x, y, rho0, gamma, center_x=0, center_y=0):
        
        x_ = x - center_x
        y_ = y - center_y
        r = np.sqrt(x_**2 + y_**2)
        mass_3d = self.mass_3d(r, rho0, gamma)
        pot = mass_3d/r
        return pot
903536
def build(self, builder):
        
        params = dict(LocationOID=self.oid)
        # mixins
        self.mixin()
        self.mixin_params(params)

        builder.start("SiteRef", params)
        builder.end("SiteRef")
427381
def build(self, builder):
        """"""
        params = dict(LabelOID=self.oid, OrderNumber=str(self.order_number))

        builder.start("mdsol:LabelRef", params)
        builder.end("mdsol:LabelRef")
1060884
def build(self, builder):
        """"""

        params = dict(OID=self.oid, Name=self.name)

        if self.unit_dictionary_name:
            params["mdsol:UnitDictionaryName"] = self.unit_dictionary_name

        for suffix in ["A", "B", "C", "K"]:
            val = getattr(self, "constant_{0}".format(suffix.lower()))
            params["mdsol:Constant{0}".format(suffix)] = str(val)

        if self.standard_unit:
            params["mdsol:StandardUnit"] = "Yes"

        builder.start("MeasurementUnit", params)
        for child in self.symbols:
            child.build(builder)
        builder.end("MeasurementUnit")
588650
def coord_pyramid(coord, zoom_start, zoom_stop):
    
    if zoom_start <= coord.zoom:
        yield coord
    for child_coord in coord_children_range(coord, zoom_stop):
        if zoom_start <= child_coord.zoom:
            yield child_coord
1134771
def smeftpar(scale, C, basis):
    """"""
    # start with a zero dict and update it with the input values
    MW = p['m_W']
    # MZ = p['m_Z']
    GF = p['GF']
    Mh = p['m_h']
    vb = sqrt(1 / sqrt(2) / GF)
    v = vb  # TODO
    _d = vMh2_to_m2Lambda(v=v, Mh2=Mh**2, C=C)
    m2 = _d['m2'].real
    Lambda = _d['Lambda'].real
    gsbar = sqrt(4 * pi * p['alpha_s'])
    gs = (1 - C['phiG'] * (v**2)) * gsbar
    gbar = 2 * MW / v
    g = gbar * (1 - C['phiW'] * (v**2))
    ebar = sqrt(4 * pi * p['alpha_e'])
    gp = get_gpbar(ebar, gbar, v, C)
    c = {}
    c['m2'] = m2
    c['Lambda'] = Lambda
    c['g'] = g
    c['gp'] = gp
    c['gs'] = gs
    K = ckmutil.ckm.ckm_tree(p['Vus'], p['Vub'], p['Vcb'], p['delta'])
    if basis == 'Warsaw':
        Mu = K.conj().T @ np.diag([p['m_u'], p['m_c'], p['m_t']])
        Md = np.diag([p['m_d'], p['m_s'], p['m_b']])
    elif basis == 'Warsaw up':
        Mu = np.diag([p['m_u'], p['m_c'], p['m_t']])
        Md = K @ np.diag([p['m_d'], p['m_s'], p['m_b']])
    else:
        raise ValueError("Basis '{}' not supported".format(basis))
    Me = np.diag([p['m_e'], p['m_mu'], p['m_tau']])
    c['Gd'] = Md / (v / sqrt(2)) + C['dphi'] * (v**2) / 2
    c['Gu'] = Mu / (v / sqrt(2)) + C['uphi'] * (v**2) / 2
    c['Ge'] = Me / (v / sqrt(2)) + C['ephi'] * (v**2) / 2
    return c