body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
4a8279a046b80c607cc1d120e006480daea41a5e23f15a149cbda95ae25e8b38 | def smooth_density_legacy(coords, tile_width, tile_height, n):
'legacy function to homogenize distribution of points within a\n rectangular area by reducing the number of points within\n n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Paramete... | legacy function to homogenize distribution of points within a
rectangular area by reducing the number of points within
n**2 equally-sized bounding boxes to
the minimum number of points in one of those boxes.
Parameters
----------
coords : numpy.ndarray
Nx2 numpy array of coordinates to consider
tile_w... | em_stitch/lens_correction/mesh_and_solve_transform.py | smooth_density_legacy | AllenInstitute/em_stitch | 2 | python | def smooth_density_legacy(coords, tile_width, tile_height, n):
'legacy function to homogenize distribution of points within a\n rectangular area by reducing the number of points within\n n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Paramete... | def smooth_density_legacy(coords, tile_width, tile_height, n):
'legacy function to homogenize distribution of points within a\n rectangular area by reducing the number of points within\n n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Paramete... |
e38ebeb79c90bbeb3e1e8715ce796a2f54db2929e307bea9ce941aa1badbf710 | def get_bboxes(tile_width, tile_height, n):
'get list of bounds for n**2 equally-sized bounding boxes within a\n rectangular bounding box\n\n\n Parameters\n ----------\n tile_width : int\n width of rectangular area to divide\n tile_height : int\n height of rectangular area to divide... | get list of bounds for n**2 equally-sized bounding boxes within a
rectangular bounding box
Parameters
----------
tile_width : int
width of rectangular area to divide
tile_height : int
height of rectangular area to divide
n : int
number of subdivisions into which tile_width and tile_height
should b... | em_stitch/lens_correction/mesh_and_solve_transform.py | get_bboxes | AllenInstitute/em_stitch | 2 | python | def get_bboxes(tile_width, tile_height, n):
'get list of bounds for n**2 equally-sized bounding boxes within a\n rectangular bounding box\n\n\n Parameters\n ----------\n tile_width : int\n width of rectangular area to divide\n tile_height : int\n height of rectangular area to divide... | def get_bboxes(tile_width, tile_height, n):
'get list of bounds for n**2 equally-sized bounding boxes within a\n rectangular bounding box\n\n\n Parameters\n ----------\n tile_width : int\n width of rectangular area to divide\n tile_height : int\n height of rectangular area to divide... |
fbcfe3ddedfe584676134cdd469ef6c85c5cc1a7d58298c9f70f09707945d2ff | def smooth_density_bbox(coords, tile_width, tile_height, n):
'homogenize distribution of points within a rectangular area by reducing\n the number of points within n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Parameters\n ----------\n coords... | homogenize distribution of points within a rectangular area by reducing
the number of points within n**2 equally-sized bounding boxes to
the minimum number of points in one of those boxes.
Parameters
----------
coords : numpy.ndarray
Nx2 numpy array of coordinates to consider
tile_width : int
width of... | em_stitch/lens_correction/mesh_and_solve_transform.py | smooth_density_bbox | AllenInstitute/em_stitch | 2 | python | def smooth_density_bbox(coords, tile_width, tile_height, n):
'homogenize distribution of points within a rectangular area by reducing\n the number of points within n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Parameters\n ----------\n coords... | def smooth_density_bbox(coords, tile_width, tile_height, n):
'homogenize distribution of points within a rectangular area by reducing\n the number of points within n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Parameters\n ----------\n coords... |
da0feef53c0f36d8922711f800dcd5aaaaa1efafad926d076b8f80558b5a1e14 | def smooth_density(coords, tile_width, tile_height, n, legacy_smooth_density=False, **kwargs):
'homogenize distribution of points within a rectangular area by reducing\n the number of points within n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Para... | homogenize distribution of points within a rectangular area by reducing
the number of points within n**2 equally-sized bounding boxes to
the minimum number of points in one of those boxes.
Parameters
----------
coords : numpy.ndarray
Nx2 numpy array of coordinates to consider
tile_width : int
width of... | em_stitch/lens_correction/mesh_and_solve_transform.py | smooth_density | AllenInstitute/em_stitch | 2 | python | def smooth_density(coords, tile_width, tile_height, n, legacy_smooth_density=False, **kwargs):
'homogenize distribution of points within a rectangular area by reducing\n the number of points within n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Para... | def smooth_density(coords, tile_width, tile_height, n, legacy_smooth_density=False, **kwargs):
'homogenize distribution of points within a rectangular area by reducing\n the number of points within n**2 equally-sized bounding boxes to\n the minimum number of points in one of those boxes.\n\n\n Para... |
332d70b2cb812e8dd13586d03344ce5f703d6ed378c7349796699a8ac2c62534 | def approx_snap_contour(contour, width, height, epsilon=20, snap_dist=5):
"Approximate a contour within a number of pixels, so it isn't too\n fine in the corner and snap to edges\n\n Parameters\n ----------\n contour : numpy.ndarray\n Nx2 array input to cv2.approxPolyDP\n width : int\n ... | Approximate a contour within a number of pixels, so it isn't too
fine in the corner and snap to edges
Parameters
----------
contour : numpy.ndarray
Nx2 array input to cv2.approxPolyDP
width : int
width to which approximated values are snapped
height : int
height to which approximated values are snapped
eps... | em_stitch/lens_correction/mesh_and_solve_transform.py | approx_snap_contour | AllenInstitute/em_stitch | 2 | python | def approx_snap_contour(contour, width, height, epsilon=20, snap_dist=5):
"Approximate a contour within a number of pixels, so it isn't too\n fine in the corner and snap to edges\n\n Parameters\n ----------\n contour : numpy.ndarray\n Nx2 array input to cv2.approxPolyDP\n width : int\n ... | def approx_snap_contour(contour, width, height, epsilon=20, snap_dist=5):
"Approximate a contour within a number of pixels, so it isn't too\n fine in the corner and snap to edges\n\n Parameters\n ----------\n contour : numpy.ndarray\n Nx2 array input to cv2.approxPolyDP\n width : int\n ... |
fb0a96b1b7178df111a6a02153c5661bb9e2920d21e5d573c9fa6f8bd339bb14 | def create_PSLG(tile_width, tile_height, maskUrl):
'create a PSLG (Planar Straight Line Graph) based on a masked image\n\n Parameters\n ----------\n tile_width : int\n width of tile for which PSLG will be created\n tile_height : int\n height of tile for which PSLG will be created\n mask... | create a PSLG (Planar Straight Line Graph) based on a masked image
Parameters
----------
tile_width : int
width of tile for which PSLG will be created
tile_height : int
height of tile for which PSLG will be created
maskUrl : str or None
file uri to binary mask image
Returns
-------
bbox : dict
diction... | em_stitch/lens_correction/mesh_and_solve_transform.py | create_PSLG | AllenInstitute/em_stitch | 2 | python | def create_PSLG(tile_width, tile_height, maskUrl):
'create a PSLG (Planar Straight Line Graph) based on a masked image\n\n Parameters\n ----------\n tile_width : int\n width of tile for which PSLG will be created\n tile_height : int\n height of tile for which PSLG will be created\n mask... | def create_PSLG(tile_width, tile_height, maskUrl):
'create a PSLG (Planar Straight Line Graph) based on a masked image\n\n Parameters\n ----------\n tile_width : int\n width of tile for which PSLG will be created\n tile_height : int\n height of tile for which PSLG will be created\n mask... |
e3d491fd31ae4e562027db3cb2029f308998cc3ca7881ff6aa0a8140d907db8e | def calculate_mesh(a, bbox, target, get_t=False):
'triangulate a mesh based on a Planar Straight Line Graph with\n mesh constraints. Return either the Delaunay triangulation or a\n difference in number of triangles from a target.\n\n Parameters\n ----------\n a : float\n global maximum triang... | triangulate a mesh based on a Planar Straight Line Graph with
mesh constraints. Return either the Delaunay triangulation or a
difference in number of triangles from a target.
Parameters
----------
a : float
global maximum triangular area constraint
bbox : dict
dictionary with keys vertices and segments repres... | em_stitch/lens_correction/mesh_and_solve_transform.py | calculate_mesh | AllenInstitute/em_stitch | 2 | python | def calculate_mesh(a, bbox, target, get_t=False):
'triangulate a mesh based on a Planar Straight Line Graph with\n mesh constraints. Return either the Delaunay triangulation or a\n difference in number of triangles from a target.\n\n Parameters\n ----------\n a : float\n global maximum triang... | def calculate_mesh(a, bbox, target, get_t=False):
'triangulate a mesh based on a Planar Straight Line Graph with\n mesh constraints. Return either the Delaunay triangulation or a\n difference in number of triangles from a target.\n\n Parameters\n ----------\n a : float\n global maximum triang... |
8952c5c0fbc558dd85e53c6db31ddc85d799894b8e216d1638d633e46b768ffa | def force_vertices_with_npoints(area_par, bbox, coords, npts, **kwargs):
'create a triangular mesh which iteratively attempts to conform to a\n minimum number of points per vertex by adjusting the maximum\n triangle area\n\n Parameters\n ----------\n area_par : float\n initial maximum ... | create a triangular mesh which iteratively attempts to conform to a
minimum number of points per vertex by adjusting the maximum
triangle area
Parameters
----------
area_par : float
initial maximum triangle area constraint for triangle.triangulate
bbox : dict
PSLG bounding box dictionary from :func:cre... | em_stitch/lens_correction/mesh_and_solve_transform.py | force_vertices_with_npoints | AllenInstitute/em_stitch | 2 | python | def force_vertices_with_npoints(area_par, bbox, coords, npts, **kwargs):
'create a triangular mesh which iteratively attempts to conform to a\n minimum number of points per vertex by adjusting the maximum\n triangle area\n\n Parameters\n ----------\n area_par : float\n initial maximum ... | def force_vertices_with_npoints(area_par, bbox, coords, npts, **kwargs):
'create a triangular mesh which iteratively attempts to conform to a\n minimum number of points per vertex by adjusting the maximum\n triangle area\n\n Parameters\n ----------\n area_par : float\n initial maximum ... |
fc1ebbead02b61e145265dae7d801f7f13699fe4c4c4c4d41c9ecbeca1539427 | def find_delaunay_with_max_vertices(bbox, nvertex):
'optimize a delaunay triangulation of a PSLG to create an\n expected number of vertices\n\n Parameters\n ----------\n bbox : dict\n dictionary with keys vertices and segments representing a PSLG\n nvertex : int\n number of vertices for... | optimize a delaunay triangulation of a PSLG to create an
expected number of vertices
Parameters
----------
bbox : dict
dictionary with keys vertices and segments representing a PSLG
nvertex : int
number of vertices for the triangulation to target
Returns
-------
mesh : scipy.spatial.Delaunay
resultant tri... | em_stitch/lens_correction/mesh_and_solve_transform.py | find_delaunay_with_max_vertices | AllenInstitute/em_stitch | 2 | python | def find_delaunay_with_max_vertices(bbox, nvertex):
'optimize a delaunay triangulation of a PSLG to create an\n expected number of vertices\n\n Parameters\n ----------\n bbox : dict\n dictionary with keys vertices and segments representing a PSLG\n nvertex : int\n number of vertices for... | def find_delaunay_with_max_vertices(bbox, nvertex):
'optimize a delaunay triangulation of a PSLG to create an\n expected number of vertices\n\n Parameters\n ----------\n bbox : dict\n dictionary with keys vertices and segments representing a PSLG\n nvertex : int\n number of vertices for... |
d8d28b194db1e816bb5ee2aaf1e25941228f06e0d1876209d90707989297fe05 | def compute_barycentrics_legacy(coords, mesh):
'legacy function to compute barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n\n Returns\n -------\n bcoords : numpy.nda... | legacy function to compute barycentric coordinates on mesh
Parameters
----------
coords : numpy.ndarray
Nx2 array of points
mesh : scipy.spatial.qhull.Delaunay
triangular mesh
Returns
-------
bcoords : numpy.ndarray
Nx2 array of barycentric coordinates
triangle_indices : numpy.ndarray
simplex indices ... | em_stitch/lens_correction/mesh_and_solve_transform.py | compute_barycentrics_legacy | AllenInstitute/em_stitch | 2 | python | def compute_barycentrics_legacy(coords, mesh):
'legacy function to compute barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n\n Returns\n -------\n bcoords : numpy.nda... | def compute_barycentrics_legacy(coords, mesh):
'legacy function to compute barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n\n Returns\n -------\n bcoords : numpy.nda... |
1c83430e336247a05749963db192c5b03875aeb193045524a4478ed77a2c6bca | def compute_barycentrics_native(coords, mesh):
'convert coordinates to barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n\n Returns\n -------\n bcoords : numpy.ndarray... | convert coordinates to barycentric coordinates on mesh
Parameters
----------
coords : numpy.ndarray
Nx2 array of points
mesh : scipy.spatial.qhull.Delaunay
triangular mesh
Returns
-------
bcoords : numpy.ndarray
Nx2 array of barycentric coordinates
triangle_indices : numpy.ndarray
simplex indices of b... | em_stitch/lens_correction/mesh_and_solve_transform.py | compute_barycentrics_native | AllenInstitute/em_stitch | 2 | python | def compute_barycentrics_native(coords, mesh):
'convert coordinates to barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n\n Returns\n -------\n bcoords : numpy.ndarray... | def compute_barycentrics_native(coords, mesh):
'convert coordinates to barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n\n Returns\n -------\n bcoords : numpy.ndarray... |
ade31d2253571136321c960f6e47b170806278530d1e186f6d11ef40466dd0b1 | def compute_barycentrics(coords, mesh, legacy_barycentrics=False, **kwargs):
'convert coordinates to barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n legacy_barycentrics :... | convert coordinates to barycentric coordinates on mesh
Parameters
----------
coords : numpy.ndarray
Nx2 array of points
mesh : scipy.spatial.qhull.Delaunay
triangular mesh
legacy_barycentrics : boolean
whether to use (slower) legacy method to find barycentrics.
Returns
-------
bcoords : numpy.ndarray
... | em_stitch/lens_correction/mesh_and_solve_transform.py | compute_barycentrics | AllenInstitute/em_stitch | 2 | python | def compute_barycentrics(coords, mesh, legacy_barycentrics=False, **kwargs):
'convert coordinates to barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n legacy_barycentrics :... | def compute_barycentrics(coords, mesh, legacy_barycentrics=False, **kwargs):
'convert coordinates to barycentric coordinates on mesh\n\n Parameters\n ----------\n coords : numpy.ndarray\n Nx2 array of points\n mesh : scipy.spatial.qhull.Delaunay\n triangular mesh\n legacy_barycentrics :... |
f324f024111c1d1be221fda87022b23fe4e8ea685a3b2bd087943d0c08514b39 | def count_points_near_vertices(t, coords, bruteforce_simplex_counts=False, count_bincount=True, **kwargs):
'enumerate coordinates closest to the vertices in a mesh\n\n Parameters\n ----------\n t : scipy.spatial.qhull.Delaunay\n triangular mesh\n coords : numpy.ndarray\n Nx2 array of point... | enumerate coordinates closest to the vertices in a mesh
Parameters
----------
t : scipy.spatial.qhull.Delaunay
triangular mesh
coords : numpy.ndarray
Nx2 array of points to assign to vertices on t
bruteforce_simplex_counts : boolean
whether to do a bruteforce simplex finding
count_bincount : boolean
use... | em_stitch/lens_correction/mesh_and_solve_transform.py | count_points_near_vertices | AllenInstitute/em_stitch | 2 | python | def count_points_near_vertices(t, coords, bruteforce_simplex_counts=False, count_bincount=True, **kwargs):
'enumerate coordinates closest to the vertices in a mesh\n\n Parameters\n ----------\n t : scipy.spatial.qhull.Delaunay\n triangular mesh\n coords : numpy.ndarray\n Nx2 array of point... | def count_points_near_vertices(t, coords, bruteforce_simplex_counts=False, count_bincount=True, **kwargs):
'enumerate coordinates closest to the vertices in a mesh\n\n Parameters\n ----------\n t : scipy.spatial.qhull.Delaunay\n triangular mesh\n coords : numpy.ndarray\n Nx2 array of point... |
6e241c010f03aa15302360768c6e592ef447ef70c96db901650d8ca9a9abbd66 | def create_regularization(ncols, ntiles, defaultL, transL, lensL):
'create sparse regularization matrix with distinct\n translation and lens regularization factors\n\n Parameters\n ----------\n ncols : int\n columns to generate (based on solver matrix)\n ntiles : int\n number of tiles t... | create sparse regularization matrix with distinct
translation and lens regularization factors
Parameters
----------
ncols : int
columns to generate (based on solver matrix)
ntiles : int
number of tiles to regularize
defaultL : float
default regularization parameter lambda
transL : float
translation-onl... | em_stitch/lens_correction/mesh_and_solve_transform.py | create_regularization | AllenInstitute/em_stitch | 2 | python | def create_regularization(ncols, ntiles, defaultL, transL, lensL):
'create sparse regularization matrix with distinct\n translation and lens regularization factors\n\n Parameters\n ----------\n ncols : int\n columns to generate (based on solver matrix)\n ntiles : int\n number of tiles t... | def create_regularization(ncols, ntiles, defaultL, transL, lensL):
'create sparse regularization matrix with distinct\n translation and lens regularization factors\n\n Parameters\n ----------\n ncols : int\n columns to generate (based on solver matrix)\n ntiles : int\n number of tiles t... |
af028e487807d5b030dec6b33b95cf89115daca1cc96e17901a64ec1acbc64d9 | def create_thinplatespline_tf(mesh, solution, lens_dof_start, logger=default_logger, compute_affine=False):
'create 2D Thin Plate Spline transform required to transform mesh to\n the solution derived from\n em_stitch.lens_correction.mesh_and_solve_transform.solve\n\n Parameters\n ----------\n mesh : ... | create 2D Thin Plate Spline transform required to transform mesh to
the solution derived from
em_stitch.lens_correction.mesh_and_solve_transform.solve
Parameters
----------
mesh : scipy.spatial.qhull.Delaunay
triangular source mesh object
solution : list of numpy.ndarray
list of numpy arrays of x and y vertex ... | em_stitch/lens_correction/mesh_and_solve_transform.py | create_thinplatespline_tf | AllenInstitute/em_stitch | 2 | python | def create_thinplatespline_tf(mesh, solution, lens_dof_start, logger=default_logger, compute_affine=False):
'create 2D Thin Plate Spline transform required to transform mesh to\n the solution derived from\n em_stitch.lens_correction.mesh_and_solve_transform.solve\n\n Parameters\n ----------\n mesh : ... | def create_thinplatespline_tf(mesh, solution, lens_dof_start, logger=default_logger, compute_affine=False):
'create 2D Thin Plate Spline transform required to transform mesh to\n the solution derived from\n em_stitch.lens_correction.mesh_and_solve_transform.solve\n\n Parameters\n ----------\n mesh : ... |
361b20d4432139a23de7a3680c7388d5e65a5098368f96de5ca51ac38ed10464 | def new_specs_with_tf(ref_transform, tilespecs, transforms):
'create a copy of each tilespec in tilespecs with the first transform\n being a reference to ref_transform and the second based on transforms\n provided in transforms.\n This likely expects a single transformation in the input tilespecs.\n\n P... | create a copy of each tilespec in tilespecs with the first transform
being a reference to ref_transform and the second based on transforms
provided in transforms.
This likely expects a single transformation in the input tilespecs.
Parameters
----------
ref_transform : renderapi.transform.Transform
transform to att... | em_stitch/lens_correction/mesh_and_solve_transform.py | new_specs_with_tf | AllenInstitute/em_stitch | 2 | python | def new_specs_with_tf(ref_transform, tilespecs, transforms):
'create a copy of each tilespec in tilespecs with the first transform\n being a reference to ref_transform and the second based on transforms\n provided in transforms.\n This likely expects a single transformation in the input tilespecs.\n\n P... | def new_specs_with_tf(ref_transform, tilespecs, transforms):
'create a copy of each tilespec in tilespecs with the first transform\n being a reference to ref_transform and the second based on transforms\n provided in transforms.\n This likely expects a single transformation in the input tilespecs.\n\n P... |
b80e11b9b1cfab5c2b80fb3dab8c32f95835be3dc8f60297b7e09337fe270b75 | def solve(A, weights, reg, x0, b, precomputed_ATW=None, precomputed_ATWA=None, precomputed_K_factorized=None):
'regularized weighted solve\n\n Parameters\n ----------\n A : :class:`scipy.sparse.csr`\n the matrix, N (equations) x M (degrees of freedom)\n weights : :class:`scipy.sparse.csr_matrix`\... | regularized weighted solve
Parameters
----------
A : :class:`scipy.sparse.csr`
the matrix, N (equations) x M (degrees of freedom)
weights : :class:`scipy.sparse.csr_matrix`
N x N diagonal matrix containing weights
reg : :class:`scipy.sparse.csr_matrix`
M x M diagonal matrix containing regularizations
x0 : ... | em_stitch/lens_correction/mesh_and_solve_transform.py | solve | AllenInstitute/em_stitch | 2 | python | def solve(A, weights, reg, x0, b, precomputed_ATW=None, precomputed_ATWA=None, precomputed_K_factorized=None):
'regularized weighted solve\n\n Parameters\n ----------\n A : :class:`scipy.sparse.csr`\n the matrix, N (equations) x M (degrees of freedom)\n weights : :class:`scipy.sparse.csr_matrix`\... | def solve(A, weights, reg, x0, b, precomputed_ATW=None, precomputed_ATWA=None, precomputed_K_factorized=None):
'regularized weighted solve\n\n Parameters\n ----------\n A : :class:`scipy.sparse.csr`\n the matrix, N (equations) x M (degrees of freedom)\n weights : :class:`scipy.sparse.csr_matrix`\... |
31e77a317bcac278b05fc7a98d2a2019711cc737521a77ebcc10124d97011066 | def report_solution(errx, erry, transforms, criteria):
'compile results, statistics, and messages for reporting information\n about lens correction solves\n\n Parameters\n ----------\n errx : numpy.ndarray\n numpy array of x residuals\n erry : numpy.ndarray\n numpy array of y residuals\... | compile results, statistics, and messages for reporting information
about lens correction solves
Parameters
----------
errx : numpy.ndarray
numpy array of x residuals
erry : numpy.ndarray
numpy array of y residuals
transforms : list of renderapi.transform.Transform
list of transforms considered for the tra... | em_stitch/lens_correction/mesh_and_solve_transform.py | report_solution | AllenInstitute/em_stitch | 2 | python | def report_solution(errx, erry, transforms, criteria):
'compile results, statistics, and messages for reporting information\n about lens correction solves\n\n Parameters\n ----------\n errx : numpy.ndarray\n numpy array of x residuals\n erry : numpy.ndarray\n numpy array of y residuals\... | def report_solution(errx, erry, transforms, criteria):
'compile results, statistics, and messages for reporting information\n about lens correction solves\n\n Parameters\n ----------\n errx : numpy.ndarray\n numpy array of x residuals\n erry : numpy.ndarray\n numpy array of y residuals\... |
def1d304e1cea7309d08d7f03089b99916641959ece472e64bc8a309efcb083a | def create_x0(nrows, tilespecs):
'create initialization array x0\n\n Parameters\n ----------\n nrows : int\n number of rows in array (defined to match A[1])\n tilespecs : list of renderapi.tilespecs.TileSpec\n tilespecs from which initialization is built\n\n Returns\n -------\n x0... | create initialization array x0
Parameters
----------
nrows : int
number of rows in array (defined to match A[1])
tilespecs : list of renderapi.tilespecs.TileSpec
tilespecs from which initialization is built
Returns
-------
x0 : numpy.ndarray
initialization array x0 | em_stitch/lens_correction/mesh_and_solve_transform.py | create_x0 | AllenInstitute/em_stitch | 2 | python | def create_x0(nrows, tilespecs):
'create initialization array x0\n\n Parameters\n ----------\n nrows : int\n number of rows in array (defined to match A[1])\n tilespecs : list of renderapi.tilespecs.TileSpec\n tilespecs from which initialization is built\n\n Returns\n -------\n x0... | def create_x0(nrows, tilespecs):
'create initialization array x0\n\n Parameters\n ----------\n nrows : int\n number of rows in array (defined to match A[1])\n tilespecs : list of renderapi.tilespecs.TileSpec\n tilespecs from which initialization is built\n\n Returns\n -------\n x0... |
3d442f3e534ca70aa05363cfedb1926e3bad9065eca0a40a16a49a387ec4d11b | def create_A(matches, tilespecs, mesh, **kwargs):
'create A matrix describing translation and lens correction\n\n Parameters\n ----------\n matches : list of dict\n list of match dictionaries in render format\n tilespecs : list of renderapi.tilespecs.TileSpec\n tilespecs to include in solv... | create A matrix describing translation and lens correction
Parameters
----------
matches : list of dict
list of match dictionaries in render format
tilespecs : list of renderapi.tilespecs.TileSpec
tilespecs to include in solve
mesh : scipy.spatial.qhull.Delaunay
mesh of input points as produced by
em_s... | em_stitch/lens_correction/mesh_and_solve_transform.py | create_A | AllenInstitute/em_stitch | 2 | python | def create_A(matches, tilespecs, mesh, **kwargs):
'create A matrix describing translation and lens correction\n\n Parameters\n ----------\n matches : list of dict\n list of match dictionaries in render format\n tilespecs : list of renderapi.tilespecs.TileSpec\n tilespecs to include in solv... | def create_A(matches, tilespecs, mesh, **kwargs):
'create A matrix describing translation and lens correction\n\n Parameters\n ----------\n matches : list of dict\n list of match dictionaries in render format\n tilespecs : list of renderapi.tilespecs.TileSpec\n tilespecs to include in solv... |
2c0d319c088da1aa8def8b7c72751f073357c2d59007af5a09280fade672966b | def create_transforms(ntiles, solution):
'create translation transformations from a solution array\n\n Parameters\n ----------\n ntiles : int\n number of tiles represented in the solution\n solution : list of numpy.ndarray\n list of numpy arrays of x and y positions result of solve\n\n ... | create translation transformations from a solution array
Parameters
----------
ntiles : int
number of tiles represented in the solution
solution : list of numpy.ndarray
list of numpy arrays of x and y positions result of solve
Returns
-------
rtransforms : list of renderapi.transform.AffineModel
transform... | em_stitch/lens_correction/mesh_and_solve_transform.py | create_transforms | AllenInstitute/em_stitch | 2 | python | def create_transforms(ntiles, solution):
'create translation transformations from a solution array\n\n Parameters\n ----------\n ntiles : int\n number of tiles represented in the solution\n solution : list of numpy.ndarray\n list of numpy arrays of x and y positions result of solve\n\n ... | def create_transforms(ntiles, solution):
'create translation transformations from a solution array\n\n Parameters\n ----------\n ntiles : int\n number of tiles represented in the solution\n solution : list of numpy.ndarray\n list of numpy arrays of x and y positions result of solve\n\n ... |
fd99f510df909d7bb3e8f53b6ff3bc6c2fe933465ba977fb5254ee73222c7ed4 | def estimate_stage_affine(t0, t1):
'estimate affine transformation between translation components\n of tiles in t0 and tiles in t1 to give overall stage affine transformation.\n\n Parameters\n ----------\n t0 : list of renderapi.tilespec.TileSpec\n source tilespecs (initial position)\n t1 : li... | estimate affine transformation between translation components
of tiles in t0 and tiles in t1 to give overall stage affine transformation.
Parameters
----------
t0 : list of renderapi.tilespec.TileSpec
source tilespecs (initial position)
t1 : list of renderapi.tilespec.TileSpec
destination tilespecs (post-solve... | em_stitch/lens_correction/mesh_and_solve_transform.py | estimate_stage_affine | AllenInstitute/em_stitch | 2 | python | def estimate_stage_affine(t0, t1):
'estimate affine transformation between translation components\n of tiles in t0 and tiles in t1 to give overall stage affine transformation.\n\n Parameters\n ----------\n t0 : list of renderapi.tilespec.TileSpec\n source tilespecs (initial position)\n t1 : li... | def estimate_stage_affine(t0, t1):
'estimate affine transformation between translation components\n of tiles in t0 and tiles in t1 to give overall stage affine transformation.\n\n Parameters\n ----------\n t0 : list of renderapi.tilespec.TileSpec\n source tilespecs (initial position)\n t1 : li... |
ad2cfe0b351e4f390252b2624e1cb07e038a15fed94496aa8f5acf91027e01ba | def _create_mesh(resolvedtiles, matches, nvertex, return_area_triangle_par=False, **kwargs):
'create mesh with a given number of vertices based on example tiles\n and pointmatches\n\n Parameters\n ----------\n resolvedtiles : renderapi.resolvedtiles.ResolvedTiles\n resolvedtiles containing a ... | create mesh with a given number of vertices based on example tiles
and pointmatches
Parameters
----------
resolvedtiles : renderapi.resolvedtiles.ResolvedTiles
resolvedtiles containing a tilespec with mask, width, and height
properties to use as a template for the mesh
matches : list of dict
list of po... | em_stitch/lens_correction/mesh_and_solve_transform.py | _create_mesh | AllenInstitute/em_stitch | 2 | python | def _create_mesh(resolvedtiles, matches, nvertex, return_area_triangle_par=False, **kwargs):
'create mesh with a given number of vertices based on example tiles\n and pointmatches\n\n Parameters\n ----------\n resolvedtiles : renderapi.resolvedtiles.ResolvedTiles\n resolvedtiles containing a ... | def _create_mesh(resolvedtiles, matches, nvertex, return_area_triangle_par=False, **kwargs):
'create mesh with a given number of vertices based on example tiles\n and pointmatches\n\n Parameters\n ----------\n resolvedtiles : renderapi.resolvedtiles.ResolvedTiles\n resolvedtiles containing a ... |
0ab49d4964e62cd5f8fbf2bad144027defa941e667eb284243c27062e5688c44 | def _solve_resolvedtiles(resolvedtiles, matches, nvertex, regularization_lambda, regularization_translation_factor, regularization_lens_lambda, good_solve_dict, logger=default_logger, **kwargs):
'generate lens correction from resolvedtiles and pointmatches\n\n Parameters\n ----------\n resolvedtiles : rend... | generate lens correction from resolvedtiles and pointmatches
Parameters
----------
resolvedtiles : renderapi.resolvedtiles.ResolvedTiles
resolvedtiles object on which transformation will be computed
matches : list of dict
point correspondences to consider in render pointmatch format
nvertex :
number of ve... | em_stitch/lens_correction/mesh_and_solve_transform.py | _solve_resolvedtiles | AllenInstitute/em_stitch | 2 | python | def _solve_resolvedtiles(resolvedtiles, matches, nvertex, regularization_lambda, regularization_translation_factor, regularization_lens_lambda, good_solve_dict, logger=default_logger, **kwargs):
'generate lens correction from resolvedtiles and pointmatches\n\n Parameters\n ----------\n resolvedtiles : rend... | def _solve_resolvedtiles(resolvedtiles, matches, nvertex, regularization_lambda, regularization_translation_factor, regularization_lens_lambda, good_solve_dict, logger=default_logger, **kwargs):
'generate lens correction from resolvedtiles and pointmatches\n\n Parameters\n ----------\n resolvedtiles : rend... |
bcdac2e334b94440749a2980ddb86492bc73f85c59f722d3ec6497b3cdcaa71c | def solve_resolvedtiles_from_args(self):
'use arguments to run lens correction\n\n Returns\n -------\n resolved : renderapi.resolvedtiles.ResolvedTiles\n new resolvedtiles object with derived lens correction applied\n new_ref_transform : renderapi.transform.leaf.ThinPlateSplin... | use arguments to run lens correction
Returns
-------
resolved : renderapi.resolvedtiles.ResolvedTiles
new resolvedtiles object with derived lens correction applied
new_ref_transform : renderapi.transform.leaf.ThinPlateSplineTransform
derived lens correction transform
jresult : dict
dictionary of solve info... | em_stitch/lens_correction/mesh_and_solve_transform.py | solve_resolvedtiles_from_args | AllenInstitute/em_stitch | 2 | python | def solve_resolvedtiles_from_args(self):
'use arguments to run lens correction\n\n Returns\n -------\n resolved : renderapi.resolvedtiles.ResolvedTiles\n new resolvedtiles object with derived lens correction applied\n new_ref_transform : renderapi.transform.leaf.ThinPlateSplin... | def solve_resolvedtiles_from_args(self):
'use arguments to run lens correction\n\n Returns\n -------\n resolved : renderapi.resolvedtiles.ResolvedTiles\n new resolvedtiles object with derived lens correction applied\n new_ref_transform : renderapi.transform.leaf.ThinPlateSplin... |
ec7177b489cf300df91b85888be97a8e248b03b76414f5ede1b23ab92e682687 | def colorWipe(self, R, G, B):
'Wipe color across display a pixel at a time.'
color = Color(R, G, B)
for i in range(self.strip.numPixels()):
self.strip.setPixelColor(i, color)
self.strip.show() | Wipe color across display a pixel at a time. | server/LEDapp.py | colorWipe | ggoupy/Adeept_RaspTank | 2 | python | def colorWipe(self, R, G, B):
color = Color(R, G, B)
for i in range(self.strip.numPixels()):
self.strip.setPixelColor(i, color)
self.strip.show() | def colorWipe(self, R, G, B):
color = Color(R, G, B)
for i in range(self.strip.numPixels()):
self.strip.setPixelColor(i, color)
self.strip.show()<|docstring|>Wipe color across display a pixel at a time.<|endoftext|> |
6955dec1a1d2ccc348eceba460c235a39d88f3637dbcf5bdf6c7b3d904ca5b46 | def generate_args2cmd(self, args, shell):
'\n 转换请求参数为命令行\n :param args:\n :param shell:\n :return:\n '
if shell:
cmd_args = (self.path if self.path else '')
for (name, value) in args.items():
cmd_args += f' -{name} {shlex.quote(str(value))}'
els... | 转换请求参数为命令行
:param args:
:param shell:
:return: | sql/plugins/sqladvisor.py | generate_args2cmd | sosofun123/Archery | 3,458 | python | def generate_args2cmd(self, args, shell):
'\n 转换请求参数为命令行\n :param args:\n :param shell:\n :return:\n '
if shell:
cmd_args = (self.path if self.path else )
for (name, value) in args.items():
cmd_args += f' -{name} {shlex.quote(str(value))}'
else:... | def generate_args2cmd(self, args, shell):
'\n 转换请求参数为命令行\n :param args:\n :param shell:\n :return:\n '
if shell:
cmd_args = (self.path if self.path else )
for (name, value) in args.items():
cmd_args += f' -{name} {shlex.quote(str(value))}'
else:... |
18062f8f6efb2665b834e63c4ba451207149f6ad4aefe16cbbe185f4ed547de1 | def main(argv=sys.argv):
'Main method called by the aip.'
try:
utils.vip_main(historian)
except Exception as e:
print(e)
_log.exception('unhandled exception') | Main method called by the aip. | services/core/ForwardHistorian/forwarder/agent.py | main | ashrafulhaque99/BEMOSS3.5 | 73 | python | def main(argv=sys.argv):
try:
utils.vip_main(historian)
except Exception as e:
print(e)
_log.exception('unhandled exception') | def main(argv=sys.argv):
try:
utils.vip_main(historian)
except Exception as e:
print(e)
_log.exception('unhandled exception')<|docstring|>Main method called by the aip.<|endoftext|> |
2fc836bce2d493d2c9e3ddf0d36ee190c6b9c8d8c91358314fe3ffadcb5af942 | @Core.receiver('onstart')
def starting_base(self, sender, **kwargs):
'\n Subscribes to the platform message bus on the actuator, record,\n datalogger, and device topics to capture data.\n '
def subscriber(subscription, callback_method):
_log.debug('subscribing to {}'.fo... | Subscribes to the platform message bus on the actuator, record,
datalogger, and device topics to capture data. | services/core/ForwardHistorian/forwarder/agent.py | starting_base | ashrafulhaque99/BEMOSS3.5 | 73 | python | @Core.receiver('onstart')
def starting_base(self, sender, **kwargs):
'\n Subscribes to the platform message bus on the actuator, record,\n datalogger, and device topics to capture data.\n '
def subscriber(subscription, callback_method):
_log.debug('subscribing to {}'.fo... | @Core.receiver('onstart')
def starting_base(self, sender, **kwargs):
'\n Subscribes to the platform message bus on the actuator, record,\n datalogger, and device topics to capture data.\n '
def subscriber(subscription, callback_method):
_log.debug('subscribing to {}'.fo... |
fc090acc53b060a2963d3cac7e09d588d273e07ea80e196c3e16a8fb1e3bcff5 | @click.command(name='set-active', context_settings=CONTEXT_SETTINGS)
@add_options(OPTIONS)
@click.pass_context
def cmd(ctx, url, key, secret, adapter_node, adapter_name, cnx_id, active, save_and_fetch, **kwargs):
'Activate/deactivate a connection.'
client = ctx.obj.start_client(url=url, key=key, secret=secret)
... | Activate/deactivate a connection. | axonius_api_client/cli/grp_adapters/grp_cnx/cmd_set_active.py | cmd | kf-careem/axonius_api_client | 11 | python | @click.command(name='set-active', context_settings=CONTEXT_SETTINGS)
@add_options(OPTIONS)
@click.pass_context
def cmd(ctx, url, key, secret, adapter_node, adapter_name, cnx_id, active, save_and_fetch, **kwargs):
client = ctx.obj.start_client(url=url, key=key, secret=secret)
with ctx.obj.exc_wrap(wraperror... | @click.command(name='set-active', context_settings=CONTEXT_SETTINGS)
@add_options(OPTIONS)
@click.pass_context
def cmd(ctx, url, key, secret, adapter_node, adapter_name, cnx_id, active, save_and_fetch, **kwargs):
client = ctx.obj.start_client(url=url, key=key, secret=secret)
with ctx.obj.exc_wrap(wraperror... |
5a5d070c206483008f365f76cb5300b7a14f2db1be89a20bb2a1e813c2279dc1 | def exchangeRefAlt(vcfLine):
'Exchange ref/alt representation of a vcf line\n Ref <---> alt\n '
ss = vcfLine
(ss[3], ss[4]) = (ss[4], ss[3])
for i in range(seqStart, len(ss)):
ns = list(ss[i])
ns[0] = convertMap[ns[0]]
ns[2] = convertMap[ns[2]]
ss[i] = ''... | Exchange ref/alt representation of a vcf line
Ref <---> alt | GWAS/CorrectRef4VCF/CorrectRef4VCF.py | exchangeRefAlt | wavefancy/BIDMC-PYTHON | 0 | python | def exchangeRefAlt(vcfLine):
'Exchange ref/alt representation of a vcf line\n Ref <---> alt\n '
ss = vcfLine
(ss[3], ss[4]) = (ss[4], ss[3])
for i in range(seqStart, len(ss)):
ns = list(ss[i])
ns[0] = convertMap[ns[0]]
ns[2] = convertMap[ns[2]]
ss[i] = .j... | def exchangeRefAlt(vcfLine):
'Exchange ref/alt representation of a vcf line\n Ref <---> alt\n '
ss = vcfLine
(ss[3], ss[4]) = (ss[4], ss[3])
for i in range(seqStart, len(ss)):
ns = list(ss[i])
ns[0] = convertMap[ns[0]]
ns[2] = convertMap[ns[2]]
ss[i] = .j... |
db8682f0d1e48dcfcae3f28f82fe77aff3679f1e072972d3df24c17198ca312e | def getOutputArray(vcfLine, refAllele):
'Check consistency of a vcf line, exchange ref/alt if necessary.\n return corrected vcfLine, [] if exchange also failed.\n '
out = []
ref = vcfLine[3].upper()
alt = vcfLine[4].upper()
if (ref_a == ref):
out = vcfLine
elif (ref_a ==... | Check consistency of a vcf line, exchange ref/alt if necessary.
return corrected vcfLine, [] if exchange also failed. | GWAS/CorrectRef4VCF/CorrectRef4VCF.py | getOutputArray | wavefancy/BIDMC-PYTHON | 0 | python | def getOutputArray(vcfLine, refAllele):
'Check consistency of a vcf line, exchange ref/alt if necessary.\n return corrected vcfLine, [] if exchange also failed.\n '
out = []
ref = vcfLine[3].upper()
alt = vcfLine[4].upper()
if (ref_a == ref):
out = vcfLine
elif (ref_a ==... | def getOutputArray(vcfLine, refAllele):
'Check consistency of a vcf line, exchange ref/alt if necessary.\n return corrected vcfLine, [] if exchange also failed.\n '
out = []
ref = vcfLine[3].upper()
alt = vcfLine[4].upper()
if (ref_a == ref):
out = vcfLine
elif (ref_a ==... |
ba95ff4eaf7927022abbdb106ccacfb04d92ddbc229947c62c8f21b078d3ed3e | def get_label(self, name):
'\n\t\tReturns a label JSON-encoded object\n\t\t'
labels = self.api.get_labels()
for label in labels:
if (label.name == name):
return label
return None | Returns a label JSON-encoded object | lib/ics2doist.py | get_label | jamesbrond/ics2doist | 0 | python | def get_label(self, name):
'\n\t\t\n\t\t'
labels = self.api.get_labels()
for label in labels:
if (label.name == name):
return label
return None | def get_label(self, name):
'\n\t\t\n\t\t'
labels = self.api.get_labels()
for label in labels:
if (label.name == name):
return label
return None<|docstring|>Returns a label JSON-encoded object<|endoftext|> |
6220712118f5d8109093449d64be839be106f0bcdea6a86291feb7c1cd2685b0 | def label_ids(self, label_name):
"\n\t\tGet label id. If label doesn't exitst it will create it\n\t\t"
l = None
if label_name:
l = self.get_label(label_name)
if (l is None):
logging.debug(f'create new label {label_name}')
l = self.api.add_label({'name': label_name})
... | Get label id. If label doesn't exitst it will create it | lib/ics2doist.py | label_ids | jamesbrond/ics2doist | 0 | python | def label_ids(self, label_name):
"\n\t\t\n\t\t"
l = None
if label_name:
l = self.get_label(label_name)
if (l is None):
logging.debug(f'create new label {label_name}')
l = self.api.add_label({'name': label_name})
if (l != None):
l = [l.id]
return l | def label_ids(self, label_name):
"\n\t\t\n\t\t"
l = None
if label_name:
l = self.get_label(label_name)
if (l is None):
logging.debug(f'create new label {label_name}')
l = self.api.add_label({'name': label_name})
if (l != None):
l = [l.id]
return l<|doc... |
71a531a51ac772c7d8547c2f5cea9cc78c896fa4ec07ec8fb12cffc0a1f00329 | def javascript_confirm(url, js_msg, abort_on, *, escape_msg=True):
'Display a javascript confirm prompt.'
log.js.debug('confirm: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url... | Display a javascript confirm prompt. | luminos/browser/Shared.py | javascript_confirm | linuxaddict89/luminos | 0 | python | def javascript_confirm(url, js_msg, abort_on, *, escape_msg=True):
log.js.debug('confirm: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url.toString((QUrl.RemovePassword | QUrl.... | def javascript_confirm(url, js_msg, abort_on, *, escape_msg=True):
log.js.debug('confirm: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url.toString((QUrl.RemovePassword | QUrl.... |
59b77ee7d39d0c0726fa2813b07f013b5470cb3c5a2646a2b01336207d874df4 | def javascript_prompt(url, js_msg, default, abort_on, *, escape_msg=True):
'Display a javascript prompt.'
log.js.debug('prompt: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = '<b>{}</b> asks:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url.... | Display a javascript prompt. | luminos/browser/Shared.py | javascript_prompt | linuxaddict89/luminos | 0 | python | def javascript_prompt(url, js_msg, default, abort_on, *, escape_msg=True):
log.js.debug('prompt: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = '<b>{}</b> asks:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url.toString((QUrl.RemovePassword ... | def javascript_prompt(url, js_msg, default, abort_on, *, escape_msg=True):
log.js.debug('prompt: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = '<b>{}</b> asks:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url.toString((QUrl.RemovePassword ... |
bf1a19c77458501d312efe0856ed6f5baef31895e6a918315c94705e56d24112 | def javascript_alert(url, js_msg, abort_on, *, escape_msg=True):
'Display a javascript alert.'
log.js.debug('alert: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url.toString((QU... | Display a javascript alert. | luminos/browser/Shared.py | javascript_alert | linuxaddict89/luminos | 0 | python | def javascript_alert(url, js_msg, abort_on, *, escape_msg=True):
log.js.debug('alert: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url.toString((QUrl.RemovePassword | QUrl.Full... | def javascript_alert(url, js_msg, abort_on, *, escape_msg=True):
log.js.debug('alert: {}'.format(js_msg))
js_msg = (html.escape(js_msg) if escape_msg else js_msg)
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()), js_msg)
urlstr = url.toString((QUrl.RemovePassword | QUrl.Full... |
d99336a87df5e544c8c6f58984b40c7af0527d7ea1a7b8a7dae9d0cc662d50f9 | def javascript_log_message(level, source, line, msg):
'Display a JavaScript log message.'
logstring = '[{}:{}] {}'.format(source, line, msg)
logger = None
if (level == usertypes.JsLogLevel.info):
logger = log.js.info
if (level == usertypes.JsLogLevel.warning):
logger = log.js.warning... | Display a JavaScript log message. | luminos/browser/Shared.py | javascript_log_message | linuxaddict89/luminos | 0 | python | def javascript_log_message(level, source, line, msg):
logstring = '[{}:{}] {}'.format(source, line, msg)
logger = None
if (level == usertypes.JsLogLevel.info):
logger = log.js.info
if (level == usertypes.JsLogLevel.warning):
logger = log.js.warning
if (level == usertypes.JsLogLe... | def javascript_log_message(level, source, line, msg):
logstring = '[{}:{}] {}'.format(source, line, msg)
logger = None
if (level == usertypes.JsLogLevel.info):
logger = log.js.info
if (level == usertypes.JsLogLevel.warning):
logger = log.js.warning
if (level == usertypes.JsLogLe... |
cdd75aac2fb251eae0e248f2409eaf9025dd3127d8aeb299467a3ae383ecb069 | def default_units(self, kwargs):
'\n Return the unit value and the default units specified\n from the given keyword arguments dictionary.\n '
aliases = self.get_aliases()
laliases = self.get_lowercase_aliases()
units = self.get_units()
val = 0.0
default_unit = self.STANDARD_... | Return the unit value and the default units specified
from the given keyword arguments dictionary. | env/Lib/site-packages/measurement/base.py | default_units | UtkarshR8j/Jeeva-server | 2 | python | def default_units(self, kwargs):
'\n Return the unit value and the default units specified\n from the given keyword arguments dictionary.\n '
aliases = self.get_aliases()
laliases = self.get_lowercase_aliases()
units = self.get_units()
val = 0.0
default_unit = self.STANDARD_... | def default_units(self, kwargs):
'\n Return the unit value and the default units specified\n from the given keyword arguments dictionary.\n '
aliases = self.get_aliases()
laliases = self.get_lowercase_aliases()
units = self.get_units()
val = 0.0
default_unit = self.STANDARD_... |
864117164ff6e38e6c5a69f3c2833476d10088b5640a46b5713152db6db15716 | @classmethod
def unit_attname(cls, unit_str):
"\n Retrieves the unit attribute name for the given unit string.\n For example, if the given unit string is 'metre', 'm' would be returned.\n An exception is raised if an attribute cannot be found.\n "
laliases = cls.get_lowercase_aliases... | Retrieves the unit attribute name for the given unit string.
For example, if the given unit string is 'metre', 'm' would be returned.
An exception is raised if an attribute cannot be found. | env/Lib/site-packages/measurement/base.py | unit_attname | UtkarshR8j/Jeeva-server | 2 | python | @classmethod
def unit_attname(cls, unit_str):
"\n Retrieves the unit attribute name for the given unit string.\n For example, if the given unit string is 'metre', 'm' would be returned.\n An exception is raised if an attribute cannot be found.\n "
laliases = cls.get_lowercase_aliases... | @classmethod
def unit_attname(cls, unit_str):
"\n Retrieves the unit attribute name for the given unit string.\n For example, if the given unit string is 'metre', 'm' would be returned.\n An exception is raised if an attribute cannot be found.\n "
laliases = cls.get_lowercase_aliases... |
aa433758909c43fc57f62a23fda8d2568bf0267adb11310bb05039595136d1fa | def get_l2_fn(target_nt_names, target_opname, arg_nts, arg_name, empty_seq_name, is_const):
"Generate L2 function name from IMM NT names list and EOSZ NT names list.\n\n Each L2 function is defined by a single PATTERN row in xed's grammar.\n (By pattern's IMM-binding and EOSZ-binding NTs)\n Hence, it is en... | Generate L2 function name from IMM NT names list and EOSZ NT names list.
Each L2 function is defined by a single PATTERN row in xed's grammar.
(By pattern's IMM-binding and EOSZ-binding NTs)
Hence, it is enough to know the IMM NTs sequence and EOSZ NTs sequence to
define a L2 function. Or in this case to define a L2 f... | pysrc/ild_codegen.py | get_l2_fn | javiereguiluz/xed | 1,261 | python | def get_l2_fn(target_nt_names, target_opname, arg_nts, arg_name, empty_seq_name, is_const):
"Generate L2 function name from IMM NT names list and EOSZ NT names list.\n\n Each L2 function is defined by a single PATTERN row in xed's grammar.\n (By pattern's IMM-binding and EOSZ-binding NTs)\n Hence, it is en... | def get_l2_fn(target_nt_names, target_opname, arg_nts, arg_name, empty_seq_name, is_const):
"Generate L2 function name from IMM NT names list and EOSZ NT names list.\n\n Each L2 function is defined by a single PATTERN row in xed's grammar.\n (By pattern's IMM-binding and EOSZ-binding NTs)\n Hence, it is en... |
fa9c2170abbe98f6fb700fbfeeea41f9819c17346baa15c588f900f4de58ac30 | def gen_l2_func_list(agi, target_nt_dict, arg_nt_dict, ild_t_member):
'generate L2 functions'
l2_func_list = []
for (nt_name, array) in sorted(target_nt_dict.items()):
target_opname = array.get_target_opname()
if array.is_const_lookup_fun():
fo = gen_const_l2_function(agi, nt_nam... | generate L2 functions | pysrc/ild_codegen.py | gen_l2_func_list | javiereguiluz/xed | 1,261 | python | def gen_l2_func_list(agi, target_nt_dict, arg_nt_dict, ild_t_member):
l2_func_list = []
for (nt_name, array) in sorted(target_nt_dict.items()):
target_opname = array.get_target_opname()
if array.is_const_lookup_fun():
fo = gen_const_l2_function(agi, nt_name, target_opname, ild_t... | def gen_l2_func_list(agi, target_nt_dict, arg_nt_dict, ild_t_member):
l2_func_list = []
for (nt_name, array) in sorted(target_nt_dict.items()):
target_opname = array.get_target_opname()
if array.is_const_lookup_fun():
fo = gen_const_l2_function(agi, nt_name, target_opname, ild_t... |
ef53ebd13ed86f0640abb9628d82e6e98e782d7c148d8f015ae72210a741e6b7 | def _test_map_all_zero(vv, phash_map_lu):
'phash_map_lu is a dict[maps][0...255] pointing to a 2nd level\n lookup or it might be None indicating an empty map.'
all_zero_map = collections.defaultdict(bool)
for xmap in phash_map_lu.keys():
omap = phash_map_lu[xmap]
if (omap == None):
... | phash_map_lu is a dict[maps][0...255] pointing to a 2nd level
lookup or it might be None indicating an empty map. | pysrc/ild_codegen.py | _test_map_all_zero | javiereguiluz/xed | 1,261 | python | def _test_map_all_zero(vv, phash_map_lu):
'phash_map_lu is a dict[maps][0...255] pointing to a 2nd level\n lookup or it might be None indicating an empty map.'
all_zero_map = collections.defaultdict(bool)
for xmap in phash_map_lu.keys():
omap = phash_map_lu[xmap]
if (omap == None):
... | def _test_map_all_zero(vv, phash_map_lu):
'phash_map_lu is a dict[maps][0...255] pointing to a 2nd level\n lookup or it might be None indicating an empty map.'
all_zero_map = collections.defaultdict(bool)
for xmap in phash_map_lu.keys():
omap = phash_map_lu[xmap]
if (omap == None):
... |
9e28c0efd4e8f861613a6af9072f93c6ae0eca98981482f69cef5d756dd234c8 | def gen_static_decode(agi, vv_lu, op_lu_list, h_fn='xed3-phash.h'):
'generate static decoder'
phash_headers = ['xed-ild-eosz-getters.h', 'xed-ild-easz-getters.h', 'xed-internal-header.h', 'xed-ild-private.h']
maplu_headers = []
all_zero_by_map = {}
for vv in sorted(vv_lu.keys()):
(phash_map_... | generate static decoder | pysrc/ild_codegen.py | gen_static_decode | javiereguiluz/xed | 1,261 | python | def gen_static_decode(agi, vv_lu, op_lu_list, h_fn='xed3-phash.h'):
phash_headers = ['xed-ild-eosz-getters.h', 'xed-ild-easz-getters.h', 'xed-internal-header.h', 'xed-ild-private.h']
maplu_headers = []
all_zero_by_map = {}
for vv in sorted(vv_lu.keys()):
(phash_map_lu, lu_fo_list) = vv_lu[v... | def gen_static_decode(agi, vv_lu, op_lu_list, h_fn='xed3-phash.h'):
phash_headers = ['xed-ild-eosz-getters.h', 'xed-ild-easz-getters.h', 'xed-internal-header.h', 'xed-ild-private.h']
maplu_headers = []
all_zero_by_map = {}
for vv in sorted(vv_lu.keys()):
(phash_map_lu, lu_fo_list) = vv_lu[v... |
12b3302868c6e26c0fe498878eed717e7597e9ae3d241f3bc093f7043c54af24 | def dump_lookup(agi, l1_lookup, name_pfx, lu_h_fn, headers, lu_elem_type, define_dict=None, all_zero_by_map=None, output_dir='include-private'):
"Dump the lookup tables - from opcode value to\n the L1 function pointers (in most cases they are L2 function pointers,\n which doesn't matter, because they have the... | Dump the lookup tables - from opcode value to
the L1 function pointers (in most cases they are L2 function pointers,
which doesn't matter, because they have the same signature)
@param l1_lookup: 2D dict so that
l1_lookup[string(insn_map)][string(opcode)] == string(L1_function_name)
all 0..255 opcode values should be se... | pysrc/ild_codegen.py | dump_lookup | javiereguiluz/xed | 1,261 | python | def dump_lookup(agi, l1_lookup, name_pfx, lu_h_fn, headers, lu_elem_type, define_dict=None, all_zero_by_map=None, output_dir='include-private'):
"Dump the lookup tables - from opcode value to\n the L1 function pointers (in most cases they are L2 function pointers,\n which doesn't matter, because they have the... | def dump_lookup(agi, l1_lookup, name_pfx, lu_h_fn, headers, lu_elem_type, define_dict=None, all_zero_by_map=None, output_dir='include-private'):
"Dump the lookup tables - from opcode value to\n the L1 function pointers (in most cases they are L2 function pointers,\n which doesn't matter, because they have the... |
22051faca72edfd2eefdc8e562cbedf28858d35a634dc1ca85520720d0b517a2 | def _dump_lookup_low(agi, h_file, l1_lookup, name_pfx, lu_elem_type, all_zero_by_map=None):
"Dump the lookup tables - from opcode value to\n the L1 function pointers (in most cases they are L2 function pointers,\n which doesn't matter, because they have the same signature)\n @param l1_lookup: 2D dict so th... | Dump the lookup tables - from opcode value to
the L1 function pointers (in most cases they are L2 function pointers,
which doesn't matter, because they have the same signature)
@param l1_lookup: 2D dict so that
l1_lookup[string(insn_map)][string(opcode)] == string(L1_function_name)
all 0..255 opcode values should be se... | pysrc/ild_codegen.py | _dump_lookup_low | javiereguiluz/xed | 1,261 | python | def _dump_lookup_low(agi, h_file, l1_lookup, name_pfx, lu_elem_type, all_zero_by_map=None):
"Dump the lookup tables - from opcode value to\n the L1 function pointers (in most cases they are L2 function pointers,\n which doesn't matter, because they have the same signature)\n @param l1_lookup: 2D dict so th... | def _dump_lookup_low(agi, h_file, l1_lookup, name_pfx, lu_elem_type, all_zero_by_map=None):
"Dump the lookup tables - from opcode value to\n the L1 function pointers (in most cases they are L2 function pointers,\n which doesn't matter, because they have the same signature)\n @param l1_lookup: 2D dict so th... |
e1642101710286bf3e869408c083e78fcfd776641a07214e46a2b14c9e352863 | def _gen_intervals_dict(fun_dict):
'If there are keys that map to the same value, we want to unite\n them to intervals in order to have less conditional branches in\n code. For example if fun_dict is something like: \n {0:f1, 1:f1, 2:f2, 3:f2 , ...} then we will generate dict\n {(0,1):f1, (2,3,4,5,6,7... | If there are keys that map to the same value, we want to unite
them to intervals in order to have less conditional branches in
code. For example if fun_dict is something like:
{0:f1, 1:f1, 2:f2, 3:f2 , ...} then we will generate dict
{(0,1):f1, (2,3,4,5,6,7):f2} | pysrc/ild_codegen.py | _gen_intervals_dict | javiereguiluz/xed | 1,261 | python | def _gen_intervals_dict(fun_dict):
'If there are keys that map to the same value, we want to unite\n them to intervals in order to have less conditional branches in\n code. For example if fun_dict is something like: \n {0:f1, 1:f1, 2:f2, 3:f2 , ...} then we will generate dict\n {(0,1):f1, (2,3,4,5,6,7... | def _gen_intervals_dict(fun_dict):
'If there are keys that map to the same value, we want to unite\n them to intervals in order to have less conditional branches in\n code. For example if fun_dict is something like: \n {0:f1, 1:f1, 2:f2, 3:f2 , ...} then we will generate dict\n {(0,1):f1, (2,3,4,5,6,7... |
306d593e1211b479a3cee3b7d9206fca36a620fd2cfbfff5d9531638efc8f55d | def _is_special_op(opname):
'\n Some operands are "special" - like RM: Sometimes we don\'t have modrm,\n but grammar still likes to use RM operand - in this case it is first\n 3 bits of the opcode.\n In this case we can\'t just use regular RM operand scanned with ILD -\n we must check if MODRM exists... | Some operands are "special" - like RM: Sometimes we don't have modrm,
but grammar still likes to use RM operand - in this case it is first
3 bits of the opcode.
In this case we can't just use regular RM operand scanned with ILD -
we must check if MODRM exists and if not take 3 LSB nits from opcode.
This is what getter ... | pysrc/ild_codegen.py | _is_special_op | javiereguiluz/xed | 1,261 | python | def _is_special_op(opname):
'\n Some operands are "special" - like RM: Sometimes we don\'t have modrm,\n but grammar still likes to use RM operand - in this case it is first\n 3 bits of the opcode.\n In this case we can\'t just use regular RM operand scanned with ILD -\n we must check if MODRM exists... | def _is_special_op(opname):
'\n Some operands are "special" - like RM: Sometimes we don\'t have modrm,\n but grammar still likes to use RM operand - in this case it is first\n 3 bits of the opcode.\n In this case we can\'t just use regular RM operand scanned with ILD -\n we must check if MODRM exists... |
b18a795e51f083b14c17ca6050c096a11221b35c53fe25a1da32a53c1fce2c6c | def _get_special_op_getter_fn(opname):
"\n Returns special operand's getter name.\n See is_special_op comment.\n "
return _special_ops_dict[opname] | Returns special operand's getter name.
See is_special_op comment. | pysrc/ild_codegen.py | _get_special_op_getter_fn | javiereguiluz/xed | 1,261 | python | def _get_special_op_getter_fn(opname):
"\n Returns special operand's getter name.\n See is_special_op comment.\n "
return _special_ops_dict[opname] | def _get_special_op_getter_fn(opname):
"\n Returns special operand's getter name.\n See is_special_op comment.\n "
return _special_ops_dict[opname]<|docstring|>Returns special operand's getter name.
See is_special_op comment.<|endoftext|> |
b2e8bd6152f75864fcc08a5e85c969fa38fe6519a31cad6826eb7792a9a77ea2 | def emit_ild_access_call(opname, data_name, eoasz_set=False):
"\n @param opname: the name of the operand of xed grammar.\n @type opname: string\n\n @param data_name: the name of xed_decoded_inst_t* pointer\n @type data_name: string\n\n @param eoasz_set: when doing static decoding EOSZ and EASZ are no... | @param opname: the name of the operand of xed grammar.
@type opname: string
@param data_name: the name of xed_decoded_inst_t* pointer
@type data_name: string
@param eoasz_set: when doing static decoding EOSZ and EASZ are not
yet set correctly in the operands structure and we have to use
special ILD getters to get the... | pysrc/ild_codegen.py | emit_ild_access_call | javiereguiluz/xed | 1,261 | python | def emit_ild_access_call(opname, data_name, eoasz_set=False):
"\n @param opname: the name of the operand of xed grammar.\n @type opname: string\n\n @param data_name: the name of xed_decoded_inst_t* pointer\n @type data_name: string\n\n @param eoasz_set: when doing static decoding EOSZ and EASZ are no... | def emit_ild_access_call(opname, data_name, eoasz_set=False):
"\n @param opname: the name of the operand of xed grammar.\n @type opname: string\n\n @param data_name: the name of xed_decoded_inst_t* pointer\n @type data_name: string\n\n @param eoasz_set: when doing static decoding EOSZ and EASZ are no... |
788d54e2bb725dc4676db1f11c825e9510ba8b093bf372f5876a6a810d5fc584 | def test_init_optimiser():
'Test init method of Optimiser class.'
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
assert (not optimiser.scoring)
assert (optimiser.n_folds == 2)
assert (optimiser.random_state == 1)
assert (optimiser.to_path ... | Test init method of Optimiser class. | tests/test_optimiser.py | test_init_optimiser | manugarri/MLBox | 1,382 | python | def test_init_optimiser():
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
assert (not optimiser.scoring)
assert (optimiser.n_folds == 2)
assert (optimiser.random_state == 1)
assert (optimiser.to_path == 'save')
assert optimiser.verbos... | def test_init_optimiser():
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
assert (not optimiser.scoring)
assert (optimiser.n_folds == 2)
assert (optimiser.random_state == 1)
assert (optimiser.to_path == 'save')
assert optimiser.verbos... |
a3dc28e053391a336527031c768a4791dec350a70c84336bf8c88ea03767638f | def test_get_params_optimiser():
'Test get_params method of optimiser class.'
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
dict = {'scoring': None, 'n_folds': 2, 'random_state': 1, 'to_path': 'save', 'verbose': True}
assert (optimiser.get_params... | Test get_params method of optimiser class. | tests/test_optimiser.py | test_get_params_optimiser | manugarri/MLBox | 1,382 | python | def test_get_params_optimiser():
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
dict = {'scoring': None, 'n_folds': 2, 'random_state': 1, 'to_path': 'save', 'verbose': True}
assert (optimiser.get_params() == dict) | def test_get_params_optimiser():
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
dict = {'scoring': None, 'n_folds': 2, 'random_state': 1, 'to_path': 'save', 'verbose': True}
assert (optimiser.get_params() == dict)<|docstring|>Test get_params meth... |
375c61fd643ef1b9959fd79f27d5141a1c8eed94ae19f5ffab1f0d5bde33fe11 | def test_set_params_optimiser():
'Test set_params method of Optimiser class.'
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
optimiser.set_params(scoring='accuracy')
assert (optimiser.scoring == 'accuracy')
optimiser.set_params(n_folds=3)
... | Test set_params method of Optimiser class. | tests/test_optimiser.py | test_set_params_optimiser | manugarri/MLBox | 1,382 | python | def test_set_params_optimiser():
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
optimiser.set_params(scoring='accuracy')
assert (optimiser.scoring == 'accuracy')
optimiser.set_params(n_folds=3)
assert (optimiser.n_folds == 3)
optimise... | def test_set_params_optimiser():
with pytest.warns(UserWarning) as record:
optimiser = Optimiser()
assert (len(record) == 1)
optimiser.set_params(scoring='accuracy')
assert (optimiser.scoring == 'accuracy')
optimiser.set_params(n_folds=3)
assert (optimiser.n_folds == 3)
optimise... |
2406fd396ed59f9a510a5135dc8933816bb9c24969fa409ffcbe4a67aa94a3af | def test_evaluate_classification_optimiser():
'Test evaluate method of Optimiser class for classication.'
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train.csv', 'data_for_tests/test.csv'], target_name='Survived')
drift_thresholder = Drift_thresholder()
drift_thres... | Test evaluate method of Optimiser class for classication. | tests/test_optimiser.py | test_evaluate_classification_optimiser | manugarri/MLBox | 1,382 | python | def test_evaluate_classification_optimiser():
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train.csv', 'data_for_tests/test.csv'], target_name='Survived')
drift_thresholder = Drift_thresholder()
drift_thresholder = drift_thresholder.fit_transform(dict)
with pyt... | def test_evaluate_classification_optimiser():
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train.csv', 'data_for_tests/test.csv'], target_name='Survived')
drift_thresholder = Drift_thresholder()
drift_thresholder = drift_thresholder.fit_transform(dict)
with pyt... |
e3582b5bf1b0b37cf53a9e8fd4698a51785e6edeeee18cc9060bc5408fa951a0 | def test_evaluate_regression_optimiser():
'Test evaluate method of Optimiser class for regression.'
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train_regression.csv', 'data_for_tests/test_regression.csv'], target_name='SalePrice')
drift_thresholder = Drift_thresholder(... | Test evaluate method of Optimiser class for regression. | tests/test_optimiser.py | test_evaluate_regression_optimiser | manugarri/MLBox | 1,382 | python | def test_evaluate_regression_optimiser():
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train_regression.csv', 'data_for_tests/test_regression.csv'], target_name='SalePrice')
drift_thresholder = Drift_thresholder()
drift_thresholder = drift_thresholder.fit_transform... | def test_evaluate_regression_optimiser():
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train_regression.csv', 'data_for_tests/test_regression.csv'], target_name='SalePrice')
drift_thresholder = Drift_thresholder()
drift_thresholder = drift_thresholder.fit_transform... |
f20dc53e0fa183f2832d84701c35a0b5ff18e6f82a8e6242df662162547e0bd4 | def test_evaluate_and_optimise_classification():
'Test evaluate_and_optimise method of Optimiser class.'
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train.csv', 'data_for_tests/test.csv'], target_name='Survived')
drift_thresholder = Drift_thresholder()
drift_thresh... | Test evaluate_and_optimise method of Optimiser class. | tests/test_optimiser.py | test_evaluate_and_optimise_classification | manugarri/MLBox | 1,382 | python | def test_evaluate_and_optimise_classification():
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train.csv', 'data_for_tests/test.csv'], target_name='Survived')
drift_thresholder = Drift_thresholder()
drift_thresholder = drift_thresholder.fit_transform(dict)
with ... | def test_evaluate_and_optimise_classification():
reader = Reader(sep=',')
dict = reader.train_test_split(Lpath=['data_for_tests/train.csv', 'data_for_tests/test.csv'], target_name='Survived')
drift_thresholder = Drift_thresholder()
drift_thresholder = drift_thresholder.fit_transform(dict)
with ... |
8a680b662a8c410411557f926c70968d80ed006b7000d43ce8f90f8c7ceb11f3 | def solve(self, func):
'Uses the Riemann sum approximation to compute the integral of func.\n\n Args:\n func ([function]): [Possibly vectorised function to integrate over]\n\n Returns:\n [torch.Tensor]: [Integral of func]\n '
return (self.volume * torch.mean(func(self.... | Uses the Riemann sum approximation to compute the integral of func.
Args:
func ([function]): [Possibly vectorised function to integrate over]
Returns:
[torch.Tensor]: [Integral of func] | src/gaussed/solver/integral_transform/riemann_sum.py | solve | MatthewAlexanderFisher/GaussED | 2 | python | def solve(self, func):
'Uses the Riemann sum approximation to compute the integral of func.\n\n Args:\n func ([function]): [Possibly vectorised function to integrate over]\n\n Returns:\n [torch.Tensor]: [Integral of func]\n '
return (self.volume * torch.mean(func(self.... | def solve(self, func):
'Uses the Riemann sum approximation to compute the integral of func.\n\n Args:\n func ([function]): [Possibly vectorised function to integrate over]\n\n Returns:\n [torch.Tensor]: [Integral of func]\n '
return (self.volume * torch.mean(func(self.... |
d6f55452833eb6011a63cbdaa767a614a937f0cb8da5a9c74b38b3d9b21faf6e | def line_integral_basis(self, func, m):
'Uses the Riemann sum approximation to compute the integral of func over a flattened mesh.\n\n Args:\n func ([function]): [Function to integrate over]\n m ([int, list]): [Number of basis functions]\n\n Returns:\n [torch.Tensor]: ... | Uses the Riemann sum approximation to compute the integral of func over a flattened mesh.
Args:
func ([function]): [Function to integrate over]
m ([int, list]): [Number of basis functions]
Returns:
[torch.Tensor]: [Integral of func] | src/gaussed/solver/integral_transform/riemann_sum.py | line_integral_basis | MatthewAlexanderFisher/GaussED | 2 | python | def line_integral_basis(self, func, m):
'Uses the Riemann sum approximation to compute the integral of func over a flattened mesh.\n\n Args:\n func ([function]): [Function to integrate over]\n m ([int, list]): [Number of basis functions]\n\n Returns:\n [torch.Tensor]: ... | def line_integral_basis(self, func, m):
'Uses the Riemann sum approximation to compute the integral of func over a flattened mesh.\n\n Args:\n func ([function]): [Function to integrate over]\n m ([int, list]): [Number of basis functions]\n\n Returns:\n [torch.Tensor]: ... |
4c3a6d403515efc09e355083d221b914a9a63cdfd83c21e76ce0679f7bfff326 | def print_reversed_list_integer(my_list=[]):
'\n prints the reverse of a given list\n '
if (type(my_list) is list):
new_l = my_list[0:]
new_l.reverse()
for i in range(len(new_l)):
print('{:d}'.format(new_l[i])) | prints the reverse of a given list | 0x03-python-data_structures/3-print_reversed_list_integer.py | print_reversed_list_integer | BennettDixon/holbertonschool-higher_level_programming | 1 | python | def print_reversed_list_integer(my_list=[]):
'\n \n '
if (type(my_list) is list):
new_l = my_list[0:]
new_l.reverse()
for i in range(len(new_l)):
print('{:d}'.format(new_l[i])) | def print_reversed_list_integer(my_list=[]):
'\n \n '
if (type(my_list) is list):
new_l = my_list[0:]
new_l.reverse()
for i in range(len(new_l)):
print('{:d}'.format(new_l[i]))<|docstring|>prints the reverse of a given list<|endoftext|> |
96872c7b0e422a50ecd4cbc8cb5aae714749676ef5f5e809c59a56434cb0590e | def filter(self, npc):
"\n Get NPC's shop.\n\n Args:\n npc: (string) NPC's key.\n "
return self.objects.filter(npc=npc) | Get NPC's shop.
Args:
npc: (string) NPC's key. | muddery/worlddata/dao/npc_shops_mapper.py | filter | noahzaozao/muddery | 0 | python | def filter(self, npc):
"\n Get NPC's shop.\n\n Args:\n npc: (string) NPC's key.\n "
return self.objects.filter(npc=npc) | def filter(self, npc):
"\n Get NPC's shop.\n\n Args:\n npc: (string) NPC's key.\n "
return self.objects.filter(npc=npc)<|docstring|>Get NPC's shop.
Args:
npc: (string) NPC's key.<|endoftext|> |
d72120a96352246e60d35bc146952d0f2e6850e821bec9a39ff624552e9762e0 | def mean(v):
'\n Return the mean of the elements of `v`.\n\n We define the mean of the empty list to be the (symbolic) NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.mean`` or ``numpy.nanmean``\n instead.\n\n INPUT:\n\n - `v` -- a list of ... | Return the mean of the elements of `v`.
We define the mean of the empty list to be the (symbolic) NaN,
following the convention of MATLAB, Scipy, and R.
This function is deprecated. Use ``numpy.mean`` or ``numpy.nanmean``
instead.
INPUT:
- `v` -- a list of numbers
OUTPUT:
- a number
EXAMPLES::
sage: mean([... | src/sage/stats/basic_stats.py | mean | LaisRast/sage | 1,742 | python | def mean(v):
'\n Return the mean of the elements of `v`.\n\n We define the mean of the empty list to be the (symbolic) NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.mean`` or ``numpy.nanmean``\n instead.\n\n INPUT:\n\n - `v` -- a list of ... | def mean(v):
'\n Return the mean of the elements of `v`.\n\n We define the mean of the empty list to be the (symbolic) NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.mean`` or ``numpy.nanmean``\n instead.\n\n INPUT:\n\n - `v` -- a list of ... |
962d4e6530a134a27b3f9ddf06365705e1ffaa433208794179b84bc7585b33e3 | def mode(v):
"\n Return the mode of `v`.\n\n The mode is the list of the most frequently occurring\n elements in `v`. If `n` is the most times that any element occurs\n in `v`, then the mode is the list of elements of `v` that\n occur `n` times. The list is sorted if possible.\n\n This function is... | Return the mode of `v`.
The mode is the list of the most frequently occurring
elements in `v`. If `n` is the most times that any element occurs
in `v`, then the mode is the list of elements of `v` that
occur `n` times. The list is sorted if possible.
This function is deprecated. Use ``scipy.stats.mode`` or
``statist... | src/sage/stats/basic_stats.py | mode | LaisRast/sage | 1,742 | python | def mode(v):
"\n Return the mode of `v`.\n\n The mode is the list of the most frequently occurring\n elements in `v`. If `n` is the most times that any element occurs\n in `v`, then the mode is the list of elements of `v` that\n occur `n` times. The list is sorted if possible.\n\n This function is... | def mode(v):
"\n Return the mode of `v`.\n\n The mode is the list of the most frequently occurring\n elements in `v`. If `n` is the most times that any element occurs\n in `v`, then the mode is the list of elements of `v` that\n occur `n` times. The list is sorted if possible.\n\n This function is... |
259a3fd73739799d66f927c992ed789004def61ecaf9e91f98280b789fe2a5fe | def std(v, bias=False):
'\n Return the standard deviation of the elements of `v`.\n\n We define the standard deviation of the empty list to be NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.std`` or ``numpy.nanstd``\n instead.\n\n INPUT:\n\n ... | Return the standard deviation of the elements of `v`.
We define the standard deviation of the empty list to be NaN,
following the convention of MATLAB, Scipy, and R.
This function is deprecated. Use ``numpy.std`` or ``numpy.nanstd``
instead.
INPUT:
- `v` -- a list of numbers
- ``bias`` -- bool (default: False); i... | src/sage/stats/basic_stats.py | std | LaisRast/sage | 1,742 | python | def std(v, bias=False):
'\n Return the standard deviation of the elements of `v`.\n\n We define the standard deviation of the empty list to be NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.std`` or ``numpy.nanstd``\n instead.\n\n INPUT:\n\n ... | def std(v, bias=False):
'\n Return the standard deviation of the elements of `v`.\n\n We define the standard deviation of the empty list to be NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.std`` or ``numpy.nanstd``\n instead.\n\n INPUT:\n\n ... |
4f7fb6d143f6f5f05b5114033c094c384471b4510a9e8ba04f4013871d0bb7bd | def variance(v, bias=False):
'\n Return the variance of the elements of `v`.\n\n We define the variance of the empty list to be NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.var`` or ``numpy.nanvar``\n instead.\n\n INPUT:\n\n - `v` -- a l... | Return the variance of the elements of `v`.
We define the variance of the empty list to be NaN,
following the convention of MATLAB, Scipy, and R.
This function is deprecated. Use ``numpy.var`` or ``numpy.nanvar``
instead.
INPUT:
- `v` -- a list of numbers
- ``bias`` -- bool (default: False); if False, divide by
... | src/sage/stats/basic_stats.py | variance | LaisRast/sage | 1,742 | python | def variance(v, bias=False):
'\n Return the variance of the elements of `v`.\n\n We define the variance of the empty list to be NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.var`` or ``numpy.nanvar``\n instead.\n\n INPUT:\n\n - `v` -- a l... | def variance(v, bias=False):
'\n Return the variance of the elements of `v`.\n\n We define the variance of the empty list to be NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use ``numpy.var`` or ``numpy.nanvar``\n instead.\n\n INPUT:\n\n - `v` -- a l... |
8aa4c24f24c0e81a3b54edacd91362c26d799523f1fb0f324918a4010bc04fb0 | def median(v):
"\n Return the median (middle value) of the elements of `v`\n\n If `v` is empty, we define the median to be NaN, which is\n consistent with NumPy (note that R returns NULL).\n If `v` is comprised of strings, TypeError occurs.\n For elements other than numbers, the median is a result of... | Return the median (middle value) of the elements of `v`
If `v` is empty, we define the median to be NaN, which is
consistent with NumPy (note that R returns NULL).
If `v` is comprised of strings, TypeError occurs.
For elements other than numbers, the median is a result of ``sorted()``.
This function is deprecated. U... | src/sage/stats/basic_stats.py | median | LaisRast/sage | 1,742 | python | def median(v):
"\n Return the median (middle value) of the elements of `v`\n\n If `v` is empty, we define the median to be NaN, which is\n consistent with NumPy (note that R returns NULL).\n If `v` is comprised of strings, TypeError occurs.\n For elements other than numbers, the median is a result of... | def median(v):
"\n Return the median (middle value) of the elements of `v`\n\n If `v` is empty, we define the median to be NaN, which is\n consistent with NumPy (note that R returns NULL).\n If `v` is comprised of strings, TypeError occurs.\n For elements other than numbers, the median is a result of... |
7adca9d4b49527f25bcdd3df4fa359aa2a0906e12335020699556dd98f3e0191 | def moving_average(v, n):
'\n Return the moving average of a list `v`.\n\n The moving average of a list is often used to smooth out noisy data.\n\n If `v` is empty, we define the entries of the moving average to be NaN.\n\n This method is deprecated. Use ``pandas.Series.rolling`` instead.\n\n INPUT:... | Return the moving average of a list `v`.
The moving average of a list is often used to smooth out noisy data.
If `v` is empty, we define the entries of the moving average to be NaN.
This method is deprecated. Use ``pandas.Series.rolling`` instead.
INPUT:
- `v` -- a list
- `n` -- the number of values used in comp... | src/sage/stats/basic_stats.py | moving_average | LaisRast/sage | 1,742 | python | def moving_average(v, n):
'\n Return the moving average of a list `v`.\n\n The moving average of a list is often used to smooth out noisy data.\n\n If `v` is empty, we define the entries of the moving average to be NaN.\n\n This method is deprecated. Use ``pandas.Series.rolling`` instead.\n\n INPUT:... | def moving_average(v, n):
'\n Return the moving average of a list `v`.\n\n The moving average of a list is often used to smooth out noisy data.\n\n If `v` is empty, we define the entries of the moving average to be NaN.\n\n This method is deprecated. Use ``pandas.Series.rolling`` instead.\n\n INPUT:... |
9f86e2304d0fb1f91c18c9ca54fba1e2bc607fe8fd2ea9a68d9cab22afb063f5 | def Whoami(self):
'Rucio Summoner:Whoami\n Results a dictionary to identify the current\n Rucio user and credentials.\n\n :return A dictionary with Rucio whoami information\n '
return self._rucio.Whoami() | Rucio Summoner:Whoami
Results a dictionary to identify the current
Rucio user and credentials.
:return A dictionary with Rucio whoami information | admix/interfaces/rucio_summoner.py | Whoami | XENONnT/admix | 2 | python | def Whoami(self):
'Rucio Summoner:Whoami\n Results a dictionary to identify the current\n Rucio user and credentials.\n\n :return A dictionary with Rucio whoami information\n '
return self._rucio.Whoami() | def Whoami(self):
'Rucio Summoner:Whoami\n Results a dictionary to identify the current\n Rucio user and credentials.\n\n :return A dictionary with Rucio whoami information\n '
return self._rucio.Whoami()<|docstring|>Rucio Summoner:Whoami
Results a dictionary to identify the... |
b25f74bd094f17c90864f75f3425963ca44753ba0042471faac1cab39f9af6b0 | def Alive(self):
'Function: Alive\n Simple print statement to test Rucio setup\n '
whoami = self._rucio.Whoami()
print('Rucio ')
print('Rucio Whoami()')
for (ikey, ival) in whoami.items():
print(ikey, '\t \t', ival)
print()
print('Rucio alive') | Function: Alive
Simple print statement to test Rucio setup | admix/interfaces/rucio_summoner.py | Alive | XENONnT/admix | 2 | python | def Alive(self):
'Function: Alive\n Simple print statement to test Rucio setup\n '
whoami = self._rucio.Whoami()
print('Rucio ')
print('Rucio Whoami()')
for (ikey, ival) in whoami.items():
print(ikey, '\t \t', ival)
print()
print('Rucio alive') | def Alive(self):
'Function: Alive\n Simple print statement to test Rucio setup\n '
whoami = self._rucio.Whoami()
print('Rucio ')
print('Rucio Whoami()')
for (ikey, ival) in whoami.items():
print(ikey, '\t \t', ival)
print()
print('Rucio alive')<|docstring|>Function: Ali... |
fa81e23684654c539970da9e30d22ad1e4781e20532c3a58192fe4b7cc68175b | def _md5_hash(self, string):
'Function: _md5_hash(...)\n\n Calculate a md5 hash from a string\n\n :param string: A string\n :return result: A md5 checksum of the input string\n '
return hashlib.md5(string.encode('utf-8')).hexdigest() | Function: _md5_hash(...)
Calculate a md5 hash from a string
:param string: A string
:return result: A md5 checksum of the input string | admix/interfaces/rucio_summoner.py | _md5_hash | XENONnT/admix | 2 | python | def _md5_hash(self, string):
'Function: _md5_hash(...)\n\n Calculate a md5 hash from a string\n\n :param string: A string\n :return result: A md5 checksum of the input string\n '
return hashlib.md5(string.encode('utf-8')).hexdigest() | def _md5_hash(self, string):
'Function: _md5_hash(...)\n\n Calculate a md5 hash from a string\n\n :param string: A string\n :return result: A md5 checksum of the input string\n '
return hashlib.md5(string.encode('utf-8')).hexdigest()<|docstring|>Function: _md5_hash(...)
Calculate a ... |
e0a05fb1d1ab8629f5ad86b37e983ac87ae9318b3f5f0ab6220b4638f38b0ae1 | def _VerifyStructure(self, upload_structure=None, level=(- 1)):
'The Rucio summoner is able to deal with\n two kinds of valid input arguments. To avoid\n a break in the command chain we verify the\n structure here first and prepare further steps.\n The two valid input arguments are:\n ... | The Rucio summoner is able to deal with
two kinds of valid input arguments. To avoid
a break in the command chain we verify the
structure here first and prepare further steps.
The two valid input arguments are:
- A Rucio scope:name structure (DID) which is encoded
by a string
- A stacked container-dataset-file struct... | admix/interfaces/rucio_summoner.py | _VerifyStructure | XENONnT/admix | 2 | python | def _VerifyStructure(self, upload_structure=None, level=(- 1)):
'The Rucio summoner is able to deal with\n two kinds of valid input arguments. To avoid\n a break in the command chain we verify the\n structure here first and prepare further steps.\n The two valid input arguments are:\n ... | def _VerifyStructure(self, upload_structure=None, level=(- 1)):
'The Rucio summoner is able to deal with\n two kinds of valid input arguments. To avoid\n a break in the command chain we verify the\n structure here first and prepare further steps.\n The two valid input arguments are:\n ... |
923a49dca8d30fbcaa7026b06d0512ca43d5ded30c57e03d400faabc6a855881 | def _IsTemplate(self, upload_structure):
'Function: _IsTemplate()\n\n :param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :return is_template: Returns True if the input is a template_dictionary, otherwise false\n '
is_template = False
val_scope... | Function: _IsTemplate()
:param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary
:return is_template: Returns True if the input is a template_dictionary, otherwise false | admix/interfaces/rucio_summoner.py | _IsTemplate | XENONnT/admix | 2 | python | def _IsTemplate(self, upload_structure):
'Function: _IsTemplate()\n\n :param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :return is_template: Returns True if the input is a template_dictionary, otherwise false\n '
is_template = False
val_scope... | def _IsTemplate(self, upload_structure):
'Function: _IsTemplate()\n\n :param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :return is_template: Returns True if the input is a template_dictionary, otherwise false\n '
is_template = False
val_scope... |
775d944da536e279ba4b7c871113c0e7aeb9624de0f59ed1ae4c183c64c6b378 | def AddRule(self, did, rse, lifetime=None, protocol='rucio-catalogue', priority=3):
'Add rules for a Rucio DID or dictionary template.\n\n :param: did: Rucio DID form of "scope:name"\n :param: rse: An existing Rucio storage element (RSE)\n :param: lifetime: Choose a lifetime of the transfer rul... | Add rules for a Rucio DID or dictionary template.
:param: did: Rucio DID form of "scope:name"
:param: rse: An existing Rucio storage element (RSE)
:param: lifetime: Choose a lifetime of the transfer rule in seconds or None
:param: protocol: Should always be 'rucio-catalogue'?
:return: | admix/interfaces/rucio_summoner.py | AddRule | XENONnT/admix | 2 | python | def AddRule(self, did, rse, lifetime=None, protocol='rucio-catalogue', priority=3):
'Add rules for a Rucio DID or dictionary template.\n\n :param: did: Rucio DID form of "scope:name"\n :param: rse: An existing Rucio storage element (RSE)\n :param: lifetime: Choose a lifetime of the transfer rul... | def AddRule(self, did, rse, lifetime=None, protocol='rucio-catalogue', priority=3):
'Add rules for a Rucio DID or dictionary template.\n\n :param: did: Rucio DID form of "scope:name"\n :param: rse: An existing Rucio storage element (RSE)\n :param: lifetime: Choose a lifetime of the transfer rul... |
611fed30647511dbe62e97f1cab96e7a52059b934a9f3cf386964811cde8bb90 | def AddConditionalRule(self, did, from_rse, to_rse, lifetime=None, protocol='rucio-catalogue', priority=3):
'Add rules for a Rucio DID or dictionary template.\n\n :param: did: Rucio DID form of "scope:name"\n :param: rse: An existing Rucio storage element (RSE)\n :param: lifetime: Choose a life... | Add rules for a Rucio DID or dictionary template.
:param: did: Rucio DID form of "scope:name"
:param: rse: An existing Rucio storage element (RSE)
:param: lifetime: Choose a lifetime of the transfer rule in seconds or None
:param: protocol: Should always be 'rucio-catalogue'?
:return: | admix/interfaces/rucio_summoner.py | AddConditionalRule | XENONnT/admix | 2 | python | def AddConditionalRule(self, did, from_rse, to_rse, lifetime=None, protocol='rucio-catalogue', priority=3):
'Add rules for a Rucio DID or dictionary template.\n\n :param: did: Rucio DID form of "scope:name"\n :param: rse: An existing Rucio storage element (RSE)\n :param: lifetime: Choose a life... | def AddConditionalRule(self, did, from_rse, to_rse, lifetime=None, protocol='rucio-catalogue', priority=3):
'Add rules for a Rucio DID or dictionary template.\n\n :param: did: Rucio DID form of "scope:name"\n :param: rse: An existing Rucio storage element (RSE)\n :param: lifetime: Choose a life... |
19d3027c890a258d15b5823dbdae3f07172f1a9ed7902224e267be87d8b185a6 | def UpdateRules(self, upload_structure=None, rse_rules=None, level=(- 1)):
'Update existing rules for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: rse_rules: A list of strings which follow a certain templ... | Update existing rules for a Rucio DID or dictionary template.
:param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary
:param: rse_rules: A list of strings which follow a certain template of ["{protocol}:{rse}:{lifetime}",...]
With:
protocol: ru... | admix/interfaces/rucio_summoner.py | UpdateRules | XENONnT/admix | 2 | python | def UpdateRules(self, upload_structure=None, rse_rules=None, level=(- 1)):
'Update existing rules for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: rse_rules: A list of strings which follow a certain templ... | def UpdateRules(self, upload_structure=None, rse_rules=None, level=(- 1)):
'Update existing rules for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: rse_rules: A list of strings which follow a certain templ... |
5f989e1099fc62c1b958c943d3c093c425c1c5dda51ca894dd584a64d59b398c | def _rule_status_dictionary(self):
'This dictionary defines the full set of rule information\n what is returned from Rucio and dedicated to further usage.\n Add information carefully if you need to. Removing anything from\n this dictionary breaks aDMIX.'
rule = {}
rule['rse'] = None
... | This dictionary defines the full set of rule information
what is returned from Rucio and dedicated to further usage.
Add information carefully if you need to. Removing anything from
this dictionary breaks aDMIX. | admix/interfaces/rucio_summoner.py | _rule_status_dictionary | XENONnT/admix | 2 | python | def _rule_status_dictionary(self):
'This dictionary defines the full set of rule information\n what is returned from Rucio and dedicated to further usage.\n Add information carefully if you need to. Removing anything from\n this dictionary breaks aDMIX.'
rule = {}
rule['rse'] = None
... | def _rule_status_dictionary(self):
'This dictionary defines the full set of rule information\n what is returned from Rucio and dedicated to further usage.\n Add information carefully if you need to. Removing anything from\n this dictionary breaks aDMIX.'
rule = {}
rule['rse'] = None
... |
f1db240755c2abc1a0dda8e4cdd51b3d75514326efcb13f4dffb0cbc9b19f0a0 | def ListDidRules(self, upload_structure=None, level=(- 1)):
'List existing rules for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: level: If a template dictionary is used, the level refers to the depth of ... | List existing rules for a Rucio DID or dictionary template.
:param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary
:param: level: If a template dictionary is used, the level refers to the depth of the sorted dictionary at
which the 'did' is chosen from.
:return: A list of ... | admix/interfaces/rucio_summoner.py | ListDidRules | XENONnT/admix | 2 | python | def ListDidRules(self, upload_structure=None, level=(- 1)):
'List existing rules for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: level: If a template dictionary is used, the level refers to the depth of ... | def ListDidRules(self, upload_structure=None, level=(- 1)):
'List existing rules for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: level: If a template dictionary is used, the level refers to the depth of ... |
5eecbeebe07c11a819a06ea46113bc9f7f88251f9b887e500b87a99bc473443e | def ListFileReplicas(self, upload_structure=None, rse=None, level=(- 1), localpath=False):
'Function: ListFileReplicas(...)\n\n List all your file replicas which are attached to a dataset or container.\n\n Hint: List of RSE wide file replicas (local path) was not available in Rucio 1.19.\n\n :p... | Function: ListFileReplicas(...)
List all your file replicas which are attached to a dataset or container.
Hint: List of RSE wide file replicas (local path) was not available in Rucio 1.19.
:param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary
:param rse: A valid Rucio Storage El... | admix/interfaces/rucio_summoner.py | ListFileReplicas | XENONnT/admix | 2 | python | def ListFileReplicas(self, upload_structure=None, rse=None, level=(- 1), localpath=False):
'Function: ListFileReplicas(...)\n\n List all your file replicas which are attached to a dataset or container.\n\n Hint: List of RSE wide file replicas (local path) was not available in Rucio 1.19.\n\n :p... | def ListFileReplicas(self, upload_structure=None, rse=None, level=(- 1), localpath=False):
'Function: ListFileReplicas(...)\n\n List all your file replicas which are attached to a dataset or container.\n\n Hint: List of RSE wide file replicas (local path) was not available in Rucio 1.19.\n\n :p... |
b14105686a4789348f766e8a6b1f133f0210bca35380b715d5536785402a5c7d | def ListFiles(self, upload_structure=None, long=None, level=(- 1)):
'List existing files for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: level: If a template dictionary is used, the level refers to the d... | List existing files for a Rucio DID or dictionary template.
:param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary
:param: level: If a template dictionary is used, the level refers to the depth of the sorted dictionary at
which the 'did' is chosen from.
:param long: Define... | admix/interfaces/rucio_summoner.py | ListFiles | XENONnT/admix | 2 | python | def ListFiles(self, upload_structure=None, long=None, level=(- 1)):
'List existing files for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: level: If a template dictionary is used, the level refers to the d... | def ListFiles(self, upload_structure=None, long=None, level=(- 1)):
'List existing files for a Rucio DID or dictionary template.\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param: level: If a template dictionary is used, the level refers to the d... |
a3a17f5e878e6f8039825bbcb8134de7e32938b76fbb1f4595f2d61bd32fde1a | def ListDids(self, scope, filters, type='collection', long=False, recursive=False):
"\n List all data identifiers in a scope which match a given pattern. Check Rucio github page for details\n\n :param scope: The valid string which follows the Rucio scope name.\n :param filters: A dictionary of ... | List all data identifiers in a scope which match a given pattern. Check Rucio github page for details
:param scope: The valid string which follows the Rucio scope name.
:param filters: A dictionary of key/value pairs like {'name': 'file_name','rse-expression': 'tier0'}.
:param type: The type of the did: 'all'(containe... | admix/interfaces/rucio_summoner.py | ListDids | XENONnT/admix | 2 | python | def ListDids(self, scope, filters, type='collection', long=False, recursive=False):
"\n List all data identifiers in a scope which match a given pattern. Check Rucio github page for details\n\n :param scope: The valid string which follows the Rucio scope name.\n :param filters: A dictionary of ... | def ListDids(self, scope, filters, type='collection', long=False, recursive=False):
"\n List all data identifiers in a scope which match a given pattern. Check Rucio github page for details\n\n :param scope: The valid string which follows the Rucio scope name.\n :param filters: A dictionary of ... |
f06ade64b95645addb1bd60d6f99d0d3119f2d0c5b2693e38fabdbecaa7cbc66 | def GetRule(self, upload_structure=None, rse=None, level=(- 1)):
'This function checks if for a given upload structure or Rucio DID a requested\n upload destination rule exists in Rucio already and returns a standardized\n dictionary.\n\n :param: upload_structure: A string (Rucio DID form of "s... | This function checks if for a given upload structure or Rucio DID a requested
upload destination rule exists in Rucio already and returns a standardized
dictionary.
:param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary
:param: rse: A valid Rucio Storage Element (RSE)
:param: leve... | admix/interfaces/rucio_summoner.py | GetRule | XENONnT/admix | 2 | python | def GetRule(self, upload_structure=None, rse=None, level=(- 1)):
'This function checks if for a given upload structure or Rucio DID a requested\n upload destination rule exists in Rucio already and returns a standardized\n dictionary.\n\n :param: upload_structure: A string (Rucio DID form of "s... | def GetRule(self, upload_structure=None, rse=None, level=(- 1)):
'This function checks if for a given upload structure or Rucio DID a requested\n upload destination rule exists in Rucio already and returns a standardized\n dictionary.\n\n :param: upload_structure: A string (Rucio DID form of "s... |
8b5343d87d81f852a463b768f71cc3c2efa75468e963f282e52c79790b9d3d1a | def CheckRule(self, upload_structure=None, rse=None, level=(- 1)):
'Check the status message for a Rucio DID or dictionary template rule.\n This is a shortcut in combination with the memberfunction GetRule()\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictiona... | Check the status message for a Rucio DID or dictionary template rule.
This is a shortcut in combination with the memberfunction GetRule()
:param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary. The member
function GetRule(...) evaluates the upload_structure variable.
:para... | admix/interfaces/rucio_summoner.py | CheckRule | XENONnT/admix | 2 | python | def CheckRule(self, upload_structure=None, rse=None, level=(- 1)):
'Check the status message for a Rucio DID or dictionary template rule.\n This is a shortcut in combination with the memberfunction GetRule()\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictiona... | def CheckRule(self, upload_structure=None, rse=None, level=(- 1)):
'Check the status message for a Rucio DID or dictionary template rule.\n This is a shortcut in combination with the memberfunction GetRule()\n\n :param: upload_structure: A string (Rucio DID form of "scope:name") or a template dictiona... |
fc30c75cdc779ecf806d532821e7284508acb6677340543154e997fb6feefba9 | def VerifyLocations(self, upload_structure=None, upload_path=None, checksum_test=False, level=(- 1)):
'This function checks if for a given upload structure or Rucio DID a requested\n upload destination rule exists in Rucio already and returns a standardized\n dictionary.\n\n :param upload_struc... | This function checks if for a given upload structure or Rucio DID a requested
upload destination rule exists in Rucio already and returns a standardized
dictionary.
:param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary
:param upload_path: A path which holds the files for the Rucio... | admix/interfaces/rucio_summoner.py | VerifyLocations | XENONnT/admix | 2 | python | def VerifyLocations(self, upload_structure=None, upload_path=None, checksum_test=False, level=(- 1)):
'This function checks if for a given upload structure or Rucio DID a requested\n upload destination rule exists in Rucio already and returns a standardized\n dictionary.\n\n :param upload_struc... | def VerifyLocations(self, upload_structure=None, upload_path=None, checksum_test=False, level=(- 1)):
'This function checks if for a given upload structure or Rucio DID a requested\n upload destination rule exists in Rucio already and returns a standardized\n dictionary.\n\n :param upload_struc... |
3228ca8599ac17f2ec95220998820986b72013c68abf01467aff474e4b68dacb | def DownloadDids(self, dids=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=3, trace_custom_fields={}):
'Function: DownloadDids(...)\n\n This functions offers to download a list if Rucio DIDs which are given by a list.\n\n :param dids: A string or a list of strin... | Function: DownloadDids(...)
This functions offers to download a list if Rucio DIDs which are given by a list.
:param dids: A string or a list of strings which follows the Rucio DID nameing convention
:param download_path: Path to store the downloaded data
:param rse: Specify the RSE from where the data are going to b... | admix/interfaces/rucio_summoner.py | DownloadDids | XENONnT/admix | 2 | python | def DownloadDids(self, dids=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=3, trace_custom_fields={}):
'Function: DownloadDids(...)\n\n This functions offers to download a list if Rucio DIDs which are given by a list.\n\n :param dids: A string or a list of strin... | def DownloadDids(self, dids=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=3, trace_custom_fields={}):
'Function: DownloadDids(...)\n\n This functions offers to download a list if Rucio DIDs which are given by a list.\n\n :param dids: A string or a list of strin... |
f6dcfae0cf1923050819319e0de9dccfe32180cacba6028992dfec0dd7b45d1e | def DownloadChunks(self, download_structure=None, chunks=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=2, trace_custom_fields={}, level=(- 1)):
"Function: DownloadChunks(...)\n\n This function offers to download specific chunks from Rucio a specific DiD.\n Warn... | Function: DownloadChunks(...)
This function offers to download specific chunks from Rucio a specific DiD.
Warning: This function is heavily made for XENON internal structures. Please use with care.
:param download_structure: A valid Rucio DID (string) or a template dictionary of an existing DID
:param download_path: ... | admix/interfaces/rucio_summoner.py | DownloadChunks | XENONnT/admix | 2 | python | def DownloadChunks(self, download_structure=None, chunks=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=2, trace_custom_fields={}, level=(- 1)):
"Function: DownloadChunks(...)\n\n This function offers to download specific chunks from Rucio a specific DiD.\n Warn... | def DownloadChunks(self, download_structure=None, chunks=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=2, trace_custom_fields={}, level=(- 1)):
"Function: DownloadChunks(...)\n\n This function offers to download specific chunks from Rucio a specific DiD.\n Warn... |
b56785c88c41fd43045099c02ed02e1a99ddcba2485a02fc5c7a6b48a225e57f | def Download(self, download_structure=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=2, trace_custom_fields={}, level=(- 1)):
'Function: Download(...)\n\n This function offers to download from Rucio a specific DiD.\n\n :param download_structure: A valid Rucio DI... | Function: Download(...)
This function offers to download from Rucio a specific DiD.
:param download_structure: A valid Rucio DID (string) or a template dictionary of an existing DID
:param download_path: Path to store the downloaded data
:param rse: Specify the RSE from where the data are going to be downloaded
:para... | admix/interfaces/rucio_summoner.py | Download | XENONnT/admix | 2 | python | def Download(self, download_structure=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=2, trace_custom_fields={}, level=(- 1)):
'Function: Download(...)\n\n This function offers to download from Rucio a specific DiD.\n\n :param download_structure: A valid Rucio DI... | def Download(self, download_structure=None, download_path='.', rse=None, no_subdir=False, transfer_timeout=None, num_threads=2, trace_custom_fields={}, level=(- 1)):
'Function: Download(...)\n\n This function offers to download from Rucio a specific DiD.\n\n :param download_structure: A valid Rucio DI... |
7156efcdd263ffeed5a8ac8d47a622a210c5a502982a0487f1ad278788ccea46 | def UploadToScope(self, scope=None, upload_path=None, rse=None, rse_lifetime=None):
"Function: UploadToScope()\n\n Upload a folder to a Rucio scope\n\n :param scope: A string which follows the rules of Rucio string\n :param upload_path: A valid (string) to a folder which holds a file (or files)... | Function: UploadToScope()
Upload a folder to a Rucio scope
:param scope: A string which follows the rules of Rucio string
:param upload_path: A valid (string) to a folder which holds a file (or files) for upload
:param rse: A valid Rucio Storage Element (RSE)
:param rse_lifetime: A valid (int) which defines the lifet... | admix/interfaces/rucio_summoner.py | UploadToScope | XENONnT/admix | 2 | python | def UploadToScope(self, scope=None, upload_path=None, rse=None, rse_lifetime=None):
"Function: UploadToScope()\n\n Upload a folder to a Rucio scope\n\n :param scope: A string which follows the rules of Rucio string\n :param upload_path: A valid (string) to a folder which holds a file (or files)... | def UploadToScope(self, scope=None, upload_path=None, rse=None, rse_lifetime=None):
"Function: UploadToScope()\n\n Upload a folder to a Rucio scope\n\n :param scope: A string which follows the rules of Rucio string\n :param upload_path: A valid (string) to a folder which holds a file (or files)... |
459e2627d14b2a1765d310dd22a63ad2572939cc7b09376e93916a908dfa84f7 | def UploadToDid(self, upload_structure=None, upload_path=None, rse=None, rse_lifetime=None):
"Function UploadToDid()\n\n This function uploads the content of given folder into a Rucio dataset\n which is identified by given DID.\n\n For example a folder:\n\n | /path/to/example/calibration... | Function UploadToDid()
This function uploads the content of given folder into a Rucio dataset
which is identified by given DID.
For example a folder:
| /path/to/example/calibration_source_1
| │
| ├──18_t2_01
| ├──18_t2_02
| └──18_t2_03
DID (dat... | admix/interfaces/rucio_summoner.py | UploadToDid | XENONnT/admix | 2 | python | def UploadToDid(self, upload_structure=None, upload_path=None, rse=None, rse_lifetime=None):
"Function UploadToDid()\n\n This function uploads the content of given folder into a Rucio dataset\n which is identified by given DID.\n\n For example a folder:\n\n | /path/to/example/calibration... | def UploadToDid(self, upload_structure=None, upload_path=None, rse=None, rse_lifetime=None):
"Function UploadToDid()\n\n This function uploads the content of given folder into a Rucio dataset\n which is identified by given DID.\n\n For example a folder:\n\n | /path/to/example/calibration... |
70e5c6f2ce72c71b9012d74024b12705d9c6d184dc4815c60cd9e75fb515d484 | def Upload(self, did, upload_path, rse, lifetime=None):
'Function: Upload(...)\n The data files of the upload_path are always uploaded to the last Rucio dataset.\n\n :param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param upload_path: The absolute pa... | Function: Upload(...)
The data files of the upload_path are always uploaded to the last Rucio dataset.
:param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary
:param upload_path: The absolute path of your dataset
:param rse: A valid Rucio Storage Element (RSE) for the upload
:param ... | admix/interfaces/rucio_summoner.py | Upload | XENONnT/admix | 2 | python | def Upload(self, did, upload_path, rse, lifetime=None):
'Function: Upload(...)\n The data files of the upload_path are always uploaded to the last Rucio dataset.\n\n :param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param upload_path: The absolute pa... | def Upload(self, did, upload_path, rse, lifetime=None):
'Function: Upload(...)\n The data files of the upload_path are always uploaded to the last Rucio dataset.\n\n :param upload_structure: A string (Rucio DID form of "scope:name") or a template dictionary\n :param upload_path: The absolute pa... |
2f5b7c977eb6c84bc1bba8c56526d7ebabb33da19b811c719920293c0f0cb390 | def palindroma(palabra):
'\n Función para detectar palabras palíndromas.\n \n Args: palabra.\n \n Salida: Confirmación si la palabra introducida es palíndroma (o no).\n '
palabra = palabra.lower()
palabra_inv = palabra[::(- 1)]
if (palabra_inv == palabra):
return print(f'La pal... | Función para detectar palabras palíndromas.
Args: palabra.
Salida: Confirmación si la palabra introducida es palíndroma (o no). | ejercicios_basicos/funciones/ejerc7_T10.py | palindroma | JuanDuran85/ejemplos_python | 0 | python | def palindroma(palabra):
'\n Función para detectar palabras palíndromas.\n \n Args: palabra.\n \n Salida: Confirmación si la palabra introducida es palíndroma (o no).\n '
palabra = palabra.lower()
palabra_inv = palabra[::(- 1)]
if (palabra_inv == palabra):
return print(f'La pal... | def palindroma(palabra):
'\n Función para detectar palabras palíndromas.\n \n Args: palabra.\n \n Salida: Confirmación si la palabra introducida es palíndroma (o no).\n '
palabra = palabra.lower()
palabra_inv = palabra[::(- 1)]
if (palabra_inv == palabra):
return print(f'La pal... |
60333911a530c6d0de3d9c6f3fd4f03d0a21d8c3aa7fd465a1f2ea70405cc5e6 | @validate({'client': 's3', 'bucket': 'str'})
def get(client, bucket):
'\n Get the BIG-IP admin password from the S3 bucket created by the CFT\n '
data = client.get_object(Bucket=bucket, Key='credentials/master')
json_data = data['Body'].read()
return json.loads(json_data)['password'] | Get the BIG-IP admin password from the S3 bucket created by the CFT | lambda/f5_sca_libs/src/f5_sca_libs/password.py | get | vinnie357/f5-sca-securitystack | 11 | python | @validate({'client': 's3', 'bucket': 'str'})
def get(client, bucket):
'\n \n '
data = client.get_object(Bucket=bucket, Key='credentials/master')
json_data = data['Body'].read()
return json.loads(json_data)['password'] | @validate({'client': 's3', 'bucket': 'str'})
def get(client, bucket):
'\n \n '
data = client.get_object(Bucket=bucket, Key='credentials/master')
json_data = data['Body'].read()
return json.loads(json_data)['password']<|docstring|>Get the BIG-IP admin password from the S3 bucket created by the CFT<... |
154a8d616bf53be4b4350b72ae87483090afdaa4c9e0f3868622bc82b7647a1a | def snap_del(snap_file, session_name):
'\n Delete an existing attribute in a snap file.\n\n Args:\n --------\n snap_file: \n a snap format file.\n\n session_name: \n attribute to delete ["AM", "GM", "PM", "FM"].\n \n '
if (not os.path.exists(snap_file)):
print((('error... | Delete an existing attribute in a snap file.
Args:
--------
snap_file:
a snap format file.
session_name:
attribute to delete ["AM", "GM", "PM", "FM"]. | snaptools/snap_del.py | snap_del | hisplan/SnapTools | 26 | python | def snap_del(snap_file, session_name):
'\n Delete an existing attribute in a snap file.\n\n Args:\n --------\n snap_file: \n a snap format file.\n\n session_name: \n attribute to delete ["AM", "GM", "PM", "FM"].\n \n '
if (not os.path.exists(snap_file)):
print((('error... | def snap_del(snap_file, session_name):
'\n Delete an existing attribute in a snap file.\n\n Args:\n --------\n snap_file: \n a snap format file.\n\n session_name: \n attribute to delete ["AM", "GM", "PM", "FM"].\n \n '
if (not os.path.exists(snap_file)):
print((('error... |
547a04af09a9782f7ed9ef15f1316b3bbd18a5d3299df34d07a16b1f8ae24287 | def _check_for_flux_ratio_errors(self):
'\n If combination of settings and models are invalid, raise exceptions.\n '
if (self.fix_source_flux_ratio is not False):
if (self._model.n_sources != 2):
msg = ('fix_source_flux_ratio only valid for models with 2' + 'sources. n_sources ... | If combination of settings and models are invalid, raise exceptions. | source/MulensModel/fitdata.py | _check_for_flux_ratio_errors | rpoleski/MulensModel | 30 | python | def _check_for_flux_ratio_errors(self):
'\n \n '
if (self.fix_source_flux_ratio is not False):
if (self._model.n_sources != 2):
msg = ('fix_source_flux_ratio only valid for models with 2' + 'sources. n_sources = {0}'.format(self._model.n_sources))
raise ValueError(m... | def _check_for_flux_ratio_errors(self):
'\n \n '
if (self.fix_source_flux_ratio is not False):
if (self._model.n_sources != 2):
msg = ('fix_source_flux_ratio only valid for models with 2' + 'sources. n_sources = {0}'.format(self._model.n_sources))
raise ValueError(m... |
216882eb9fd9a55b40cc8c01fccab28af02ea8cb1becda681f0ff74dbc55ae92 | def update(self, bad=False):
'\n Calculate the best-fit source and blend fluxes as well as the chi2.\n\n Keywords :\n bad: *bool*\n Default is *False*. If *True* recalculates the data\n magnification for each point to ensure that there are values\n ... | Calculate the best-fit source and blend fluxes as well as the chi2.
Keywords :
bad: *bool*
Default is *False*. If *True* recalculates the data
magnification for each point to ensure that there are values
even for bad datapoints. | source/MulensModel/fitdata.py | update | rpoleski/MulensModel | 30 | python | def update(self, bad=False):
'\n Calculate the best-fit source and blend fluxes as well as the chi2.\n\n Keywords :\n bad: *bool*\n Default is *False*. If *True* recalculates the data\n magnification for each point to ensure that there are values\n ... | def update(self, bad=False):
'\n Calculate the best-fit source and blend fluxes as well as the chi2.\n\n Keywords :\n bad: *bool*\n Default is *False*. If *True* recalculates the data\n magnification for each point to ensure that there are values\n ... |
1bdf8233395879dfb4eba5383231370c0e6b7b521216a49019da6b9ad75eee0c | def _calculate_magnifications(self, bad=True):
'\n Calculate the model magnifications for the epochs of the dataset.\n '
if bad:
select = np.ones(self._dataset.n_epochs, dtype=bool)
else:
select = self._dataset.good
if (self.dataset.ephemerides_file is None):
satell... | Calculate the model magnifications for the epochs of the dataset. | source/MulensModel/fitdata.py | _calculate_magnifications | rpoleski/MulensModel | 30 | python | def _calculate_magnifications(self, bad=True):
'\n \n '
if bad:
select = np.ones(self._dataset.n_epochs, dtype=bool)
else:
select = self._dataset.good
if (self.dataset.ephemerides_file is None):
satellite_skycoord = None
else:
satellite_skycoord = self.d... | def _calculate_magnifications(self, bad=True):
'\n \n '
if bad:
select = np.ones(self._dataset.n_epochs, dtype=bool)
else:
select = self._dataset.good
if (self.dataset.ephemerides_file is None):
satellite_skycoord = None
else:
satellite_skycoord = self.d... |
bc42e8b79f4e6dfb445d1b451328f98e3b0e41d6a27056d20f73a9acfec4d85f | def _get_xy_qflux(self):
' Apply a fixed flux ratio. '
y = self._dataset.flux[self._dataset.good]
x = np.array((self._data_magnification[0][self._dataset.good] + (self.fix_source_flux_ratio * self._data_magnification[1][self._dataset.good])))
self.n_fluxes = 1
return (x, y) | Apply a fixed flux ratio. | source/MulensModel/fitdata.py | _get_xy_qflux | rpoleski/MulensModel | 30 | python | def _get_xy_qflux(self):
' '
y = self._dataset.flux[self._dataset.good]
x = np.array((self._data_magnification[0][self._dataset.good] + (self.fix_source_flux_ratio * self._data_magnification[1][self._dataset.good])))
self.n_fluxes = 1
return (x, y) | def _get_xy_qflux(self):
' '
y = self._dataset.flux[self._dataset.good]
x = np.array((self._data_magnification[0][self._dataset.good] + (self.fix_source_flux_ratio * self._data_magnification[1][self._dataset.good])))
self.n_fluxes = 1
return (x, y)<|docstring|>Apply a fixed flux ratio.<|endoftext|> |
d4057665b889b58cee7e7983c152420ed96f856f87550519d5f0237ab815562c | def _get_xy_individual_fluxes(self):
' Account for source fluxes individually '
y = self._dataset.flux[self._dataset.good]
if (self.fix_source_flux is False):
x = np.array(self._data_magnification)
if (self.model.n_sources == 1):
x = x[self._dataset.good]
else:
... | Account for source fluxes individually | source/MulensModel/fitdata.py | _get_xy_individual_fluxes | rpoleski/MulensModel | 30 | python | def _get_xy_individual_fluxes(self):
' '
y = self._dataset.flux[self._dataset.good]
if (self.fix_source_flux is False):
x = np.array(self._data_magnification)
if (self.model.n_sources == 1):
x = x[self._dataset.good]
else:
x = x[(:, self._dataset.good)]
... | def _get_xy_individual_fluxes(self):
' '
y = self._dataset.flux[self._dataset.good]
if (self.fix_source_flux is False):
x = np.array(self._data_magnification)
if (self.model.n_sources == 1):
x = x[self._dataset.good]
else:
x = x[(:, self._dataset.good)]
... |
2acd09c48566dfe638d2af2c3a90a5d49638e6732d29a1954434de9b1aba2b67 | def _setup_linalg_arrays(self):
'\n Create xT and y arrays\n '
(x, y) = self._create_arrays()
xT = self._invert_x_array(x)
(xT, y) = self._weight_linalg_arrays(xT, y)
return (xT, y) | Create xT and y arrays | source/MulensModel/fitdata.py | _setup_linalg_arrays | rpoleski/MulensModel | 30 | python | def _setup_linalg_arrays(self):
'\n \n '
(x, y) = self._create_arrays()
xT = self._invert_x_array(x)
(xT, y) = self._weight_linalg_arrays(xT, y)
return (xT, y) | def _setup_linalg_arrays(self):
'\n \n '
(x, y) = self._create_arrays()
xT = self._invert_x_array(x)
(xT, y) = self._weight_linalg_arrays(xT, y)
return (xT, y)<|docstring|>Create xT and y arrays<|endoftext|> |
88d9946ebfdeb0ff31093cc4658747114674207de0f3e981d28f61a253ca20d8 | def _invert_x_array(self, x):
' Take the transpose of x '
n_epochs = np.sum(self._dataset.good)
xT = np.copy(x).T
xT.shape = (n_epochs, self.n_fluxes)
return xT | Take the transpose of x | source/MulensModel/fitdata.py | _invert_x_array | rpoleski/MulensModel | 30 | python | def _invert_x_array(self, x):
' '
n_epochs = np.sum(self._dataset.good)
xT = np.copy(x).T
xT.shape = (n_epochs, self.n_fluxes)
return xT | def _invert_x_array(self, x):
' '
n_epochs = np.sum(self._dataset.good)
xT = np.copy(x).T
xT.shape = (n_epochs, self.n_fluxes)
return xT<|docstring|>Take the transpose of x<|endoftext|> |
a2589f4e547cb0b098e52f464815509fb2f9876ddd37a907c71fcd3fea1ac5a4 | def _weight_linalg_arrays(self, xT, y):
'weight by data uncertainties'
sigma_inverse = (1.0 / self._dataset.err_flux[self._dataset.good])
y *= sigma_inverse
xT *= np.array(([sigma_inverse] * self.n_fluxes)).T
return (xT, y) | weight by data uncertainties | source/MulensModel/fitdata.py | _weight_linalg_arrays | rpoleski/MulensModel | 30 | python | def _weight_linalg_arrays(self, xT, y):
sigma_inverse = (1.0 / self._dataset.err_flux[self._dataset.good])
y *= sigma_inverse
xT *= np.array(([sigma_inverse] * self.n_fluxes)).T
return (xT, y) | def _weight_linalg_arrays(self, xT, y):
sigma_inverse = (1.0 / self._dataset.err_flux[self._dataset.good])
y *= sigma_inverse
xT *= np.array(([sigma_inverse] * self.n_fluxes)).T
return (xT, y)<|docstring|>weight by data uncertainties<|endoftext|> |
14162515b5a27fbf15f3aabf24bd57d4722b1fd7fae9b723d321776201724d25 | def fit_fluxes(self):
'\n Execute the linear least squares fit to determine the fitted fluxes.\n Sets the values of :py:obj:`~source_fluxes`, :py:obj:`~blend_flux`,\n and (if applicable) :py:obj:`~source_flux`.\n\n Does *not* calculate chi2. To fit for the fluxes and calculate chi2,\n ... | Execute the linear least squares fit to determine the fitted fluxes.
Sets the values of :py:obj:`~source_fluxes`, :py:obj:`~blend_flux`,
and (if applicable) :py:obj:`~source_flux`.
Does *not* calculate chi2. To fit for the fluxes and calculate chi2,
run :py:func:`~update()`. | source/MulensModel/fitdata.py | fit_fluxes | rpoleski/MulensModel | 30 | python | def fit_fluxes(self):
'\n Execute the linear least squares fit to determine the fitted fluxes.\n Sets the values of :py:obj:`~source_fluxes`, :py:obj:`~blend_flux`,\n and (if applicable) :py:obj:`~source_flux`.\n\n Does *not* calculate chi2. To fit for the fluxes and calculate chi2,\n ... | def fit_fluxes(self):
'\n Execute the linear least squares fit to determine the fitted fluxes.\n Sets the values of :py:obj:`~source_fluxes`, :py:obj:`~blend_flux`,\n and (if applicable) :py:obj:`~source_flux`.\n\n Does *not* calculate chi2. To fit for the fluxes and calculate chi2,\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.