partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
cublasZgemm
Matrix-matrix product for complex general matrix.
hebel/pycuda_ops/cublas.py
def cublasZgemm(handle, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for complex general matrix. """ status = _libcublas.cublasZgemm_v2(handle, _CUBLAS_OP[transa], _CUBLAS_OP[trans...
def cublasZgemm(handle, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for complex general matrix. """ status = _libcublas.cublasZgemm_v2(handle, _CUBLAS_OP[transa], _CUBLAS_OP[trans...
[ "Matrix", "-", "matrix", "product", "for", "complex", "general", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4010-L4025
[ "def", "cublasZgemm", "(", "handle", ",", "transa", ",", "transb", ",", "m", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasZge...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasSsymm
Matrix-matrix product for symmetric matrix.
hebel/pycuda_ops/cublas.py
def cublasSsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for symmetric matrix. """ status = _libcublas.cublasSsymm_v2(handle, _CUBLAS_SIDE_MODE[side], _CUBLAS_FILL_MODE[u...
def cublasSsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for symmetric matrix. """ status = _libcublas.cublasSsymm_v2(handle, _CUBLAS_SIDE_MODE[side], _CUBLAS_FILL_MODE[u...
[ "Matrix", "-", "matrix", "product", "for", "symmetric", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4042-L4055
[ "def", "cublasSsymm", "(", "handle", ",", "side", ",", "uplo", ",", "m", ",", "n", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasSsymm_v2", "(", "...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasDsymm
Matrix-matrix product for real symmetric matrix.
hebel/pycuda_ops/cublas.py
def cublasDsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for real symmetric matrix. """ status = _libcublas.cublasDsymm_v2(handle, _CUBLAS_SIDE_MODE[side], _CUBLAS_FILL_M...
def cublasDsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for real symmetric matrix. """ status = _libcublas.cublasDsymm_v2(handle, _CUBLAS_SIDE_MODE[side], _CUBLAS_FILL_M...
[ "Matrix", "-", "matrix", "product", "for", "real", "symmetric", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4072-L4085
[ "def", "cublasDsymm", "(", "handle", ",", "side", ",", "uplo", ",", "m", ",", "n", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasDsymm_v2", "(", "...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasCsymm
Matrix-matrix product for complex symmetric matrix.
hebel/pycuda_ops/cublas.py
def cublasCsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for complex symmetric matrix. """ status = _libcublas.cublasCsymm_v2(handle, _CUBLAS_SIDE_MODE[side], _CUBLAS_FI...
def cublasCsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for complex symmetric matrix. """ status = _libcublas.cublasCsymm_v2(handle, _CUBLAS_SIDE_MODE[side], _CUBLAS_FI...
[ "Matrix", "-", "matrix", "product", "for", "complex", "symmetric", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4101-L4116
[ "def", "cublasCsymm", "(", "handle", ",", "side", ",", "uplo", ",", "m", ",", "n", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasCsymm_v2", "(", "...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasSsyrk
Rank-k operation on real symmetric matrix.
hebel/pycuda_ops/cublas.py
def cublasSsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc): """ Rank-k operation on real symmetric matrix. """ status = _libcublas.cublasSsyrk_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
def cublasSsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc): """ Rank-k operation on real symmetric matrix. """ status = _libcublas.cublasSsyrk_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
[ "Rank", "-", "k", "operation", "on", "real", "symmetric", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4162-L4175
[ "def", "cublasSsyrk", "(", "handle", ",", "uplo", ",", "trans", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasSsyrk_v2", "(", "handle", ",", "_CUBLAS_FI...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasDsyrk
Rank-k operation on real symmetric matrix.
hebel/pycuda_ops/cublas.py
def cublasDsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc): """ Rank-k operation on real symmetric matrix. """ status = _libcublas.cublasDsyrk_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
def cublasDsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc): """ Rank-k operation on real symmetric matrix. """ status = _libcublas.cublasDsyrk_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
[ "Rank", "-", "k", "operation", "on", "real", "symmetric", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4189-L4204
[ "def", "cublasDsyrk", "(", "handle", ",", "uplo", ",", "trans", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasDsyrk_v2", "(", "handle", ",", "_CUBLAS_FI...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasZsyrk
Rank-k operation on complex symmetric matrix.
hebel/pycuda_ops/cublas.py
def cublasZsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc): """ Rank-k operation on complex symmetric matrix. """ status = _libcublas.cublasZsyrk_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
def cublasZsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc): """ Rank-k operation on complex symmetric matrix. """ status = _libcublas.cublasZsyrk_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
[ "Rank", "-", "k", "operation", "on", "complex", "symmetric", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4247-L4262
[ "def", "cublasZsyrk", "(", "handle", ",", "uplo", ",", "trans", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasZsyrk_v2", "(", "handle", ",", "_CUBLAS_FI...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasSsyr2k
Rank-2k operation on real symmetric matrix.
hebel/pycuda_ops/cublas.py
def cublasSsyr2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Rank-2k operation on real symmetric matrix. """ status = _libcublas.cublasSsyr2k_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[tra...
def cublasSsyr2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Rank-2k operation on real symmetric matrix. """ status = _libcublas.cublasSsyr2k_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[tra...
[ "Rank", "-", "2k", "operation", "on", "real", "symmetric", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4279-L4292
[ "def", "cublasSsyr2k", "(", "handle", ",", "uplo", ",", "trans", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasSsyr2k_v2", "(", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasDsyr2k
Rank-2k operation on real symmetric matrix.
hebel/pycuda_ops/cublas.py
def cublasDsyr2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Rank-2k operation on real symmetric matrix. """ status = _libcublas.cublasDsyr2k_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans]...
def cublasDsyr2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Rank-2k operation on real symmetric matrix. """ status = _libcublas.cublasDsyr2k_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans]...
[ "Rank", "-", "2k", "operation", "on", "real", "symmetric", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4308-L4321
[ "def", "cublasDsyr2k", "(", "handle", ",", "uplo", ",", "trans", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasDsyr2k_v2", "(", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasStrmm
Matrix-matrix product for real triangular matrix.
hebel/pycuda_ops/cublas.py
def cublasStrmm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb, C, ldc): """ Matrix-matrix product for real triangular matrix. """ status = _libcublas.cublasStrmm_v2(handle, _CUBLAS_SIDE_MODE[side], _CUBLA...
def cublasStrmm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb, C, ldc): """ Matrix-matrix product for real triangular matrix. """ status = _libcublas.cublasStrmm_v2(handle, _CUBLAS_SIDE_MODE[side], _CUBLA...
[ "Matrix", "-", "matrix", "product", "for", "real", "triangular", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4401-L4414
[ "def", "cublasStrmm", "(", "handle", ",", "side", ",", "uplo", ",", "trans", ",", "diag", ",", "m", ",", "n", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasStr...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasZtrmm
Matrix-matrix product for complex triangular matrix.
hebel/pycuda_ops/cublas.py
def cublasZtrmm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb, C, ldc): """ Matrix-matrix product for complex triangular matrix. """ status = _libcublas.cublasZtrmm_v2(handle, _CUBLAS_SIDE_MODE[side], _C...
def cublasZtrmm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb, C, ldc): """ Matrix-matrix product for complex triangular matrix. """ status = _libcublas.cublasZtrmm_v2(handle, _CUBLAS_SIDE_MODE[side], _C...
[ "Matrix", "-", "matrix", "product", "for", "complex", "triangular", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4492-L4506
[ "def", "cublasZtrmm", "(", "handle", ",", "side", ",", "uplo", ",", "trans", ",", "diag", ",", "m", ",", "n", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasZtr...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasStrsm
Solve a real triangular system with multiple right-hand sides.
hebel/pycuda_ops/cublas.py
def cublasStrsm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb): """ Solve a real triangular system with multiple right-hand sides. """ status = _libcublas.cublasStrsm_v2(handle, _CUBLAS_SIDE_MODE[side], ...
def cublasStrsm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb): """ Solve a real triangular system with multiple right-hand sides. """ status = _libcublas.cublasStrsm_v2(handle, _CUBLAS_SIDE_MODE[side], ...
[ "Solve", "a", "real", "triangular", "system", "with", "multiple", "right", "-", "hand", "sides", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4522-L4535
[ "def", "cublasStrsm", "(", "handle", ",", "side", ",", "uplo", ",", "trans", ",", "diag", ",", "m", ",", "n", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ")", ":", "status", "=", "_libcublas", ".", "cublasStrsm_v2", "(", "handle", "...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasDtrsm
Solve a real triangular system with multiple right-hand sides.
hebel/pycuda_ops/cublas.py
def cublasDtrsm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb): """ Solve a real triangular system with multiple right-hand sides. """ status = _libcublas.cublasDtrsm_v2(handle, _CUBLAS_SIDE_MODE[side], ...
def cublasDtrsm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb): """ Solve a real triangular system with multiple right-hand sides. """ status = _libcublas.cublasDtrsm_v2(handle, _CUBLAS_SIDE_MODE[side], ...
[ "Solve", "a", "real", "triangular", "system", "with", "multiple", "right", "-", "hand", "sides", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4550-L4563
[ "def", "cublasDtrsm", "(", "handle", ",", "side", ",", "uplo", ",", "trans", ",", "diag", ",", "m", ",", "n", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ")", ":", "status", "=", "_libcublas", ".", "cublasDtrsm_v2", "(", "handle", "...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasZtrsm
Solve complex triangular system with multiple right-hand sides.
hebel/pycuda_ops/cublas.py
def cublasZtrsm(handle, side, uplo, transa, diag, m, n, alpha, A, lda, B, ldb): """ Solve complex triangular system with multiple right-hand sides. """ status = _libcublas.cublasZtrsm_v2(handle, _CUBLAS_SIDE_MODE[side], ...
def cublasZtrsm(handle, side, uplo, transa, diag, m, n, alpha, A, lda, B, ldb): """ Solve complex triangular system with multiple right-hand sides. """ status = _libcublas.cublasZtrsm_v2(handle, _CUBLAS_SIDE_MODE[side], ...
[ "Solve", "complex", "triangular", "system", "with", "multiple", "right", "-", "hand", "sides", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4607-L4621
[ "def", "cublasZtrsm", "(", "handle", ",", "side", ",", "uplo", ",", "transa", ",", "diag", ",", "m", ",", "n", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ")", ":", "status", "=", "_libcublas", ".", "cublasZtrsm_v2", "(", "handle", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasZherk
Rank-k operation on Hermitian matrix.
hebel/pycuda_ops/cublas.py
def cublasZherk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc): """ Rank-k operation on Hermitian matrix. """ status = _libcublas.cublasZherk_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
def cublasZherk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc): """ Rank-k operation on Hermitian matrix. """ status = _libcublas.cublasZherk_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
[ "Rank", "-", "k", "operation", "on", "Hermitian", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4726-L4739
[ "def", "cublasZherk", "(", "handle", ",", "uplo", ",", "trans", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasZherk_v2", "(", "handle", ",", "_CUBLAS_FI...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasCher2k
Rank-2k operation on Hermitian matrix.
hebel/pycuda_ops/cublas.py
def cublasCher2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Rank-2k operation on Hermitian matrix. """ status = _libcublas.cublasCher2k_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans],...
def cublasCher2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Rank-2k operation on Hermitian matrix. """ status = _libcublas.cublasCher2k_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans],...
[ "Rank", "-", "2k", "operation", "on", "Hermitian", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4756-L4771
[ "def", "cublasCher2k", "(", "handle", ",", "uplo", ",", "trans", ",", "n", ",", "k", ",", "alpha", ",", "A", ",", "lda", ",", "B", ",", "ldb", ",", "beta", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasCher2k_v2", "(", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
cublasSdgmm
Matrix-diagonal matrix product for real general matrix.
hebel/pycuda_ops/cublas.py
def cublasSdgmm(handle, mode, m, n, A, lda, x, incx, C, ldc): """ Matrix-diagonal matrix product for real general matrix. """ status = _libcublas.cublasSdgmm(handle, _CUBLAS_SIDE[mode], m, n, ...
def cublasSdgmm(handle, mode, m, n, A, lda, x, incx, C, ldc): """ Matrix-diagonal matrix product for real general matrix. """ status = _libcublas.cublasSdgmm(handle, _CUBLAS_SIDE[mode], m, n, ...
[ "Matrix", "-", "diagonal", "matrix", "product", "for", "real", "general", "matrix", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/cublas.py#L4819-L4831
[ "def", "cublasSdgmm", "(", "handle", ",", "mode", ",", "m", ",", "n", ",", "A", ",", "lda", ",", "x", ",", "incx", ",", "C", ",", "ldc", ")", ":", "status", "=", "_libcublas", ".", "cublasSdgmm", "(", "handle", ",", "_CUBLAS_SIDE", "[", "mode", "...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
load_EROS_lc
Read an EROS light curve and return its data. Parameters ---------- filename : str, optional A light-curve filename. Returns ------- dates : numpy.ndarray An array of dates. magnitudes : numpy.ndarray An array of magnitudes. errors : numpy.ndarray An arr...
upsilon/datasets/base.py
def load_EROS_lc(filename='lm0010n22323.time'): """ Read an EROS light curve and return its data. Parameters ---------- filename : str, optional A light-curve filename. Returns ------- dates : numpy.ndarray An array of dates. magnitudes : numpy.ndarray An ar...
def load_EROS_lc(filename='lm0010n22323.time'): """ Read an EROS light curve and return its data. Parameters ---------- filename : str, optional A light-curve filename. Returns ------- dates : numpy.ndarray An array of dates. magnitudes : numpy.ndarray An ar...
[ "Read", "an", "EROS", "light", "curve", "and", "return", "its", "data", "." ]
dwkim78/upsilon
python
https://github.com/dwkim78/upsilon/blob/5f381453f26582ef56e62fb8fed7317ce67861af/upsilon/datasets/base.py#L12-L39
[ "def", "load_EROS_lc", "(", "filename", "=", "'lm0010n22323.time'", ")", ":", "module_path", "=", "dirname", "(", "__file__", ")", "file_path", "=", "join", "(", "module_path", ",", "'lightcurves'", ",", "filename", ")", "data", "=", "np", ".", "loadtxt", "(...
5f381453f26582ef56e62fb8fed7317ce67861af
train
load_rf_model
Return the UPSILoN random forests classifier. The classifier is trained using OGLE and EROS periodic variables (Kim et al. 2015). Returns ------- clf : sklearn.ensemble.RandomForestClassifier The UPSILoN random forests classifier.
upsilon/datasets/base.py
def load_rf_model(): """ Return the UPSILoN random forests classifier. The classifier is trained using OGLE and EROS periodic variables (Kim et al. 2015). Returns ------- clf : sklearn.ensemble.RandomForestClassifier The UPSILoN random forests classifier. """ import gzip ...
def load_rf_model(): """ Return the UPSILoN random forests classifier. The classifier is trained using OGLE and EROS periodic variables (Kim et al. 2015). Returns ------- clf : sklearn.ensemble.RandomForestClassifier The UPSILoN random forests classifier. """ import gzip ...
[ "Return", "the", "UPSILoN", "random", "forests", "classifier", "." ]
dwkim78/upsilon
python
https://github.com/dwkim78/upsilon/blob/5f381453f26582ef56e62fb8fed7317ce67861af/upsilon/datasets/base.py#L42-L71
[ "def", "load_rf_model", "(", ")", ":", "import", "gzip", "try", ":", "import", "cPickle", "as", "pickle", "except", ":", "import", "pickle", "module_path", "=", "dirname", "(", "__file__", ")", "file_path", "=", "join", "(", "module_path", ",", "'models/rf.m...
5f381453f26582ef56e62fb8fed7317ce67861af
train
sample_dropout_mask
Samples a dropout mask and applies it in place
hebel/pycuda_ops/elementwise.py
def sample_dropout_mask(x, dropout_probability=.5, columns=None, stream=None, target=None, dropout_mask=None, dropout_prob_array=None): """ Samples a dropout mask and applies it in place""" assert x.flags.c_contiguous if columns is not None: assert len(columns) == 2 ...
def sample_dropout_mask(x, dropout_probability=.5, columns=None, stream=None, target=None, dropout_mask=None, dropout_prob_array=None): """ Samples a dropout mask and applies it in place""" assert x.flags.c_contiguous if columns is not None: assert len(columns) == 2 ...
[ "Samples", "a", "dropout", "mask", "and", "applies", "it", "in", "place" ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/pycuda_ops/elementwise.py#L222-L251
[ "def", "sample_dropout_mask", "(", "x", ",", "dropout_probability", "=", ".5", ",", "columns", "=", "None", ",", "stream", "=", "None", ",", "target", "=", "None", ",", "dropout_mask", "=", "None", ",", "dropout_prob_array", "=", "None", ")", ":", "assert"...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
reads
Load but don't evaluate a GCL expression from a string.
gcl/__init__.py
def reads(s, filename=None, loader=None, implicit_tuple=True, allow_errors=False): """Load but don't evaluate a GCL expression from a string.""" return ast.reads(s, filename=filename or '<input>', loader=loader or default_loader, implicit_tuple=implicit_tuple, allow_errors=allow_errors)
def reads(s, filename=None, loader=None, implicit_tuple=True, allow_errors=False): """Load but don't evaluate a GCL expression from a string.""" return ast.reads(s, filename=filename or '<input>', loader=loader or default_loader, implicit_tuple=implicit_tuple, allow_errors=allow_errors)
[ "Load", "but", "don", "t", "evaluate", "a", "GCL", "expression", "from", "a", "string", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/__init__.py#L77-L83
[ "def", "reads", "(", "s", ",", "filename", "=", "None", ",", "loader", "=", "None", ",", "implicit_tuple", "=", "True", ",", "allow_errors", "=", "False", ")", ":", "return", "ast", ".", "reads", "(", "s", ",", "filename", "=", "filename", "or", "'<i...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
read
Load but don't evaluate a GCL expression from a file.
gcl/__init__.py
def read(filename, loader=None, implicit_tuple=True, allow_errors=False): """Load but don't evaluate a GCL expression from a file.""" with open(filename, 'r') as f: return reads(f.read(), filename=filename, loader=loader, implicit_tuple=implicit_tuple, ...
def read(filename, loader=None, implicit_tuple=True, allow_errors=False): """Load but don't evaluate a GCL expression from a file.""" with open(filename, 'r') as f: return reads(f.read(), filename=filename, loader=loader, implicit_tuple=implicit_tuple, ...
[ "Load", "but", "don", "t", "evaluate", "a", "GCL", "expression", "from", "a", "file", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/__init__.py#L86-L93
[ "def", "read", "(", "filename", ",", "loader", "=", "None", ",", "implicit_tuple", "=", "True", ",", "allow_errors", "=", "False", ")", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "return", "reads", "(", "f", ".", "read", ...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
loads
Load and evaluate a GCL expression from a string.
gcl/__init__.py
def loads(s, filename=None, loader=None, implicit_tuple=True, env={}, schema=None): """Load and evaluate a GCL expression from a string.""" ast = reads(s, filename=filename, loader=loader, implicit_tuple=implicit_tuple) if not isinstance(env, framework.Environment): # For backwards compatibility we accept an ...
def loads(s, filename=None, loader=None, implicit_tuple=True, env={}, schema=None): """Load and evaluate a GCL expression from a string.""" ast = reads(s, filename=filename, loader=loader, implicit_tuple=implicit_tuple) if not isinstance(env, framework.Environment): # For backwards compatibility we accept an ...
[ "Load", "and", "evaluate", "a", "GCL", "expression", "from", "a", "string", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/__init__.py#L97-L105
[ "def", "loads", "(", "s", ",", "filename", "=", "None", ",", "loader", "=", "None", ",", "implicit_tuple", "=", "True", ",", "env", "=", "{", "}", ",", "schema", "=", "None", ")", ":", "ast", "=", "reads", "(", "s", ",", "filename", "=", "filenam...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
load
Load and evaluate a GCL expression from a file.
gcl/__init__.py
def load(filename, loader=None, implicit_tuple=True, env={}, schema=None): """Load and evaluate a GCL expression from a file.""" with open(filename, 'r') as f: return loads(f.read(), filename=filename, loader=loader, implicit_tuple=implicit_tuple, ...
def load(filename, loader=None, implicit_tuple=True, env={}, schema=None): """Load and evaluate a GCL expression from a file.""" with open(filename, 'r') as f: return loads(f.read(), filename=filename, loader=loader, implicit_tuple=implicit_tuple, ...
[ "Load", "and", "evaluate", "a", "GCL", "expression", "from", "a", "file", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/__init__.py#L108-L116
[ "def", "load", "(", "filename", ",", "loader", "=", "None", ",", "implicit_tuple", "=", "True", ",", "env", "=", "{", "}", ",", "schema", "=", "None", ")", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "return", "loads", ...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
linear_scheduler_up
Increases linearly and then stays flat
hebel/schedulers.py
def linear_scheduler_up(init_value, target_value, duration): """ Increases linearly and then stays flat """ value = init_value t = 0 while True: yield value t += 1 if t < duration: value = init_value + t * (target_value - init_value) / duration else: ...
def linear_scheduler_up(init_value, target_value, duration): """ Increases linearly and then stays flat """ value = init_value t = 0 while True: yield value t += 1 if t < duration: value = init_value + t * (target_value - init_value) / duration else: ...
[ "Increases", "linearly", "and", "then", "stays", "flat" ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/schedulers.py#L38-L49
[ "def", "linear_scheduler_up", "(", "init_value", ",", "target_value", ",", "duration", ")", ":", "value", "=", "init_value", "t", "=", "0", "while", "True", ":", "yield", "value", "t", "+=", "1", "if", "t", "<", "duration", ":", "value", "=", "init_value...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
linear_scheduler_up_down
Increases linearly to target_value, stays at target_value until t_decrease and then decreases linearly
hebel/schedulers.py
def linear_scheduler_up_down(init_value, target_value, final_value, duration_up, t_decrease, duration_down): """ Increases linearly to target_value, stays at target_value until t_decrease and then decreases linearly """ value = init_value t = 0 while True: ...
def linear_scheduler_up_down(init_value, target_value, final_value, duration_up, t_decrease, duration_down): """ Increases linearly to target_value, stays at target_value until t_decrease and then decreases linearly """ value = init_value t = 0 while True: ...
[ "Increases", "linearly", "to", "target_value", "stays", "at", "target_value", "until", "t_decrease", "and", "then", "decreases", "linearly" ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/schedulers.py#L52-L72
[ "def", "linear_scheduler_up_down", "(", "init_value", ",", "target_value", ",", "final_value", ",", "duration_up", ",", "t_decrease", ",", "duration_down", ")", ":", "value", "=", "init_value", "t", "=", "0", "while", "True", ":", "yield", "value", "t", "+=", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
load
Loads a YAML configuration from a string or file-like object. Parameters ---------- stream : str or object Either a string containing valid YAML or a file-like object supporting the .read() interface. overrides : dict, optional A dictionary containing overrides to apply. The loc...
hebel/config.py
def load(stream, overrides=None, **kwargs): """ Loads a YAML configuration from a string or file-like object. Parameters ---------- stream : str or object Either a string containing valid YAML or a file-like object supporting the .read() interface. overrides : dict, optional ...
def load(stream, overrides=None, **kwargs): """ Loads a YAML configuration from a string or file-like object. Parameters ---------- stream : str or object Either a string containing valid YAML or a file-like object supporting the .read() interface. overrides : dict, optional ...
[ "Loads", "a", "YAML", "configuration", "from", "a", "string", "or", "file", "-", "like", "object", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/config.py#L56-L100
[ "def", "load", "(", "stream", ",", "overrides", "=", "None", ",", "*", "*", "kwargs", ")", ":", "global", "is_initialized", "if", "not", "is_initialized", ":", "initialize", "(", ")", "if", "isinstance", "(", "stream", ",", "basestring", ")", ":", "strin...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
load_path
Convenience function for loading a YAML configuration from a file. Parameters ---------- path : str The path to the file to load on disk. overrides : dict, optional A dictionary containing overrides to apply. The location of the override is specified in the key as a dot-delimite...
hebel/config.py
def load_path(path, overrides=None, **kwargs): """ Convenience function for loading a YAML configuration from a file. Parameters ---------- path : str The path to the file to load on disk. overrides : dict, optional A dictionary containing overrides to apply. The location of ...
def load_path(path, overrides=None, **kwargs): """ Convenience function for loading a YAML configuration from a file. Parameters ---------- path : str The path to the file to load on disk. overrides : dict, optional A dictionary containing overrides to apply. The location of ...
[ "Convenience", "function", "for", "loading", "a", "YAML", "configuration", "from", "a", "file", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/config.py#L103-L133
[ "def", "load_path", "(", "path", ",", "overrides", "=", "None", ",", "*", "*", "kwargs", ")", ":", "f", "=", "open", "(", "path", ",", "'r'", ")", "content", "=", "''", ".", "join", "(", "f", ".", "readlines", "(", ")", ")", "f", ".", "close", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
handle_overrides
Handle any overrides for this model configuration. Parameters ---------- graph : dict or object A dictionary (or an ObjectProxy) containing the object graph loaded from a YAML file. overrides : dict A dictionary containing overrides to apply. The location of the override...
hebel/config.py
def handle_overrides(graph, overrides): """ Handle any overrides for this model configuration. Parameters ---------- graph : dict or object A dictionary (or an ObjectProxy) containing the object graph loaded from a YAML file. overrides : dict A dictionary containing over...
def handle_overrides(graph, overrides): """ Handle any overrides for this model configuration. Parameters ---------- graph : dict or object A dictionary (or an ObjectProxy) containing the object graph loaded from a YAML file. overrides : dict A dictionary containing over...
[ "Handle", "any", "overrides", "for", "this", "model", "configuration", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/config.py#L136-L161
[ "def", "handle_overrides", "(", "graph", ",", "overrides", ")", ":", "for", "key", "in", "overrides", ":", "levels", "=", "key", ".", "split", "(", "'.'", ")", "part", "=", "graph", "for", "lvl", "in", "levels", "[", ":", "-", "1", "]", ":", "try",...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
instantiate_all
Instantiate all ObjectProxy objects in a nested hierarchy. Parameters ---------- graph : dict or object A dictionary (or an ObjectProxy) containing the object graph loaded from a YAML file. Returns ------- graph : dict or object The dictionary or object resulting after ...
hebel/config.py
def instantiate_all(graph): """ Instantiate all ObjectProxy objects in a nested hierarchy. Parameters ---------- graph : dict or object A dictionary (or an ObjectProxy) containing the object graph loaded from a YAML file. Returns ------- graph : dict or object T...
def instantiate_all(graph): """ Instantiate all ObjectProxy objects in a nested hierarchy. Parameters ---------- graph : dict or object A dictionary (or an ObjectProxy) containing the object graph loaded from a YAML file. Returns ------- graph : dict or object T...
[ "Instantiate", "all", "ObjectProxy", "objects", "in", "a", "nested", "hierarchy", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/config.py#L164-L203
[ "def", "instantiate_all", "(", "graph", ")", ":", "def", "should_instantiate", "(", "obj", ")", ":", "classes", "=", "[", "ObjectProxy", ",", "dict", ",", "list", "]", "return", "True", "in", "[", "isinstance", "(", "obj", ",", "cls", ")", "for", "cls"...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
multi_constructor
Constructor function passed to PyYAML telling it how to construct objects from argument descriptions. See PyYAML documentation for details on the call signature.
hebel/config.py
def multi_constructor(loader, tag_suffix, node): """ Constructor function passed to PyYAML telling it how to construct objects from argument descriptions. See PyYAML documentation for details on the call signature. """ yaml_src = yaml.serialize(node) mapping = loader.construct_mapping(node) ...
def multi_constructor(loader, tag_suffix, node): """ Constructor function passed to PyYAML telling it how to construct objects from argument descriptions. See PyYAML documentation for details on the call signature. """ yaml_src = yaml.serialize(node) mapping = loader.construct_mapping(node) ...
[ "Constructor", "function", "passed", "to", "PyYAML", "telling", "it", "how", "to", "construct", "objects", "from", "argument", "descriptions", ".", "See", "PyYAML", "documentation", "for", "details", "on", "the", "call", "signature", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/config.py#L311-L326
[ "def", "multi_constructor", "(", "loader", ",", "tag_suffix", ",", "node", ")", ":", "yaml_src", "=", "yaml", ".", "serialize", "(", "node", ")", "mapping", "=", "loader", ".", "construct_mapping", "(", "node", ")", "if", "'.'", "not", "in", "tag_suffix", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
multi_constructor_pkl
Constructor function passed to PyYAML telling it how to load objects from paths to .pkl files. See PyYAML documentation for details on the call signature.
hebel/config.py
def multi_constructor_pkl(loader, tag_suffix, node): """ Constructor function passed to PyYAML telling it how to load objects from paths to .pkl files. See PyYAML documentation for details on the call signature. """ mapping = loader.construct_yaml_str(node) if tag_suffix != "" and tag_suffi...
def multi_constructor_pkl(loader, tag_suffix, node): """ Constructor function passed to PyYAML telling it how to load objects from paths to .pkl files. See PyYAML documentation for details on the call signature. """ mapping = loader.construct_yaml_str(node) if tag_suffix != "" and tag_suffi...
[ "Constructor", "function", "passed", "to", "PyYAML", "telling", "it", "how", "to", "load", "objects", "from", "paths", "to", ".", "pkl", "files", ".", "See", "PyYAML", "documentation", "for", "details", "on", "the", "call", "signature", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/config.py#L329-L343
[ "def", "multi_constructor_pkl", "(", "loader", ",", "tag_suffix", ",", "node", ")", ":", "mapping", "=", "loader", ".", "construct_yaml_str", "(", "node", ")", "if", "tag_suffix", "!=", "\"\"", "and", "tag_suffix", "!=", "u\"\"", ":", "raise", "AssertionError"...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
initialize
Initialize the configuration system by installing YAML handlers. Automatically done on first call to load() specified in this file.
hebel/config.py
def initialize(): """ Initialize the configuration system by installing YAML handlers. Automatically done on first call to load() specified in this file. """ global is_initialized # Add the custom multi-constructor yaml.add_multi_constructor('!obj:', multi_constructor) yaml.add_multi_con...
def initialize(): """ Initialize the configuration system by installing YAML handlers. Automatically done on first call to load() specified in this file. """ global is_initialized # Add the custom multi-constructor yaml.add_multi_constructor('!obj:', multi_constructor) yaml.add_multi_con...
[ "Initialize", "the", "configuration", "system", "by", "installing", "YAML", "handlers", ".", "Automatically", "done", "on", "first", "call", "to", "load", "()", "specified", "in", "this", "file", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/config.py#L367-L388
[ "def", "initialize", "(", ")", ":", "global", "is_initialized", "# Add the custom multi-constructor", "yaml", ".", "add_multi_constructor", "(", "'!obj:'", ",", "multi_constructor", ")", "yaml", ".", "add_multi_constructor", "(", "'!pkl:'", ",", "multi_constructor_pkl", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
ObjectProxy.instantiate
Instantiate this object with the supplied parameters in `self.kwds`, or if already instantiated, return the cached instance.
hebel/config.py
def instantiate(self): """ Instantiate this object with the supplied parameters in `self.kwds`, or if already instantiated, return the cached instance. """ if self.instance is None: self.instance = checked_call(self.cls, self.kwds) #endif try: ...
def instantiate(self): """ Instantiate this object with the supplied parameters in `self.kwds`, or if already instantiated, return the cached instance. """ if self.instance is None: self.instance = checked_call(self.cls, self.kwds) #endif try: ...
[ "Instantiate", "this", "object", "with", "the", "supplied", "parameters", "in", "self", ".", "kwds", "or", "if", "already", "instantiated", "return", "the", "cached", "instance", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/config.py#L232-L244
[ "def", "instantiate", "(", "self", ")", ":", "if", "self", ".", "instance", "is", "None", ":", "self", ".", "instance", "=", "checked_call", "(", "self", ".", "cls", ",", "self", ".", "kwds", ")", "#endif", "try", ":", "self", ".", "instance", ".", ...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
LinearRegressionLayer.feed_forward
Propagate forward through the layer. **Parameters:** input_data : ``GPUArray`` Inpute data to compute activations for. prediction : bool, optional Whether to use prediction model. Only relevant when using dropout. If true, then weights are multiplied by ...
hebel/layers/linear_regression_layer.py
def feed_forward(self, input_data, prediction=False): """Propagate forward through the layer. **Parameters:** input_data : ``GPUArray`` Inpute data to compute activations for. prediction : bool, optional Whether to use prediction model. Only relevant when using...
def feed_forward(self, input_data, prediction=False): """Propagate forward through the layer. **Parameters:** input_data : ``GPUArray`` Inpute data to compute activations for. prediction : bool, optional Whether to use prediction model. Only relevant when using...
[ "Propagate", "forward", "through", "the", "layer", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/layers/linear_regression_layer.py#L113-L140
[ "def", "feed_forward", "(", "self", ",", "input_data", ",", "prediction", "=", "False", ")", ":", "if", "input_data", ".", "shape", "[", "1", "]", "!=", "self", ".", "W", ".", "shape", "[", "0", "]", ":", "raise", "ValueError", "(", "'Number of outputs...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
fasper
Given abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger). this routine creates an array wk1 with a sequence of nout increasing frequencies (not angular frequencies) up to hifac times the "average" Nyquist frequ...
upsilon/extract_features/period_LS_pyfftw.py
def fasper(x, y, ofac, hifac, n_threads, MACC=4): """ Given abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger). this routine creates an array wk1 with a sequence of nout increasing frequencies (not angular ...
def fasper(x, y, ofac, hifac, n_threads, MACC=4): """ Given abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger). this routine creates an array wk1 with a sequence of nout increasing frequencies (not angular ...
[ "Given", "abscissas", "x", "(", "which", "need", "not", "be", "equally", "spaced", ")", "and", "ordinates", "y", "and", "given", "a", "desired", "oversampling", "factor", "ofac", "(", "a", "typical", "value", "being", "4", "or", "larger", ")", ".", "this...
dwkim78/upsilon
python
https://github.com/dwkim78/upsilon/blob/5f381453f26582ef56e62fb8fed7317ce67861af/upsilon/extract_features/period_LS_pyfftw.py#L95-L232
[ "def", "fasper", "(", "x", ",", "y", ",", "ofac", ",", "hifac", ",", "n_threads", ",", "MACC", "=", "4", ")", ":", "#Check dimensions of input arrays", "n", "=", "long", "(", "len", "(", "x", ")", ")", "if", "n", "!=", "len", "(", "y", ")", ":", ...
5f381453f26582ef56e62fb8fed7317ce67861af
train
Tuple.get_no_validate
Return an item without validating the schema.
gcl/runtime.py
def get_no_validate(self, key): """Return an item without validating the schema.""" x, env = self.get_thunk_env(key) # Check if this is a Thunk that needs to be lazily evaluated before we # return it. if isinstance(x, framework.Thunk): x = framework.eval(x, env) return x
def get_no_validate(self, key): """Return an item without validating the schema.""" x, env = self.get_thunk_env(key) # Check if this is a Thunk that needs to be lazily evaluated before we # return it. if isinstance(x, framework.Thunk): x = framework.eval(x, env) return x
[ "Return", "an", "item", "without", "validating", "the", "schema", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L63-L72
[ "def", "get_no_validate", "(", "self", ",", "key", ")", ":", "x", ",", "env", "=", "self", ".", "get_thunk_env", "(", "key", ")", "# Check if this is a Thunk that needs to be lazily evaluated before we", "# return it.", "if", "isinstance", "(", "x", ",", "framework"...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
Tuple.env
Return an environment that will look up in current_scope for keys in this tuple, and the parent env otherwise.
gcl/runtime.py
def env(self, current_scope): """Return an environment that will look up in current_scope for keys in this tuple, and the parent env otherwise. """ return self.__env_cache.get( current_scope.ident, framework.Environment, current_scope, names=self.keys(), p...
def env(self, current_scope): """Return an environment that will look up in current_scope for keys in this tuple, and the parent env otherwise. """ return self.__env_cache.get( current_scope.ident, framework.Environment, current_scope, names=self.keys(), p...
[ "Return", "an", "environment", "that", "will", "look", "up", "in", "current_scope", "for", "keys", "in", "this", "tuple", "and", "the", "parent", "env", "otherwise", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L77-L85
[ "def", "env", "(", "self", ",", "current_scope", ")", ":", "return", "self", ".", "__env_cache", ".", "get", "(", "current_scope", ".", "ident", ",", "framework", ".", "Environment", ",", "current_scope", ",", "names", "=", "self", ".", "keys", "(", ")",...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
Tuple.get_thunk_env
Return the thunk AND environment for validating it in for the given key. There might be different envs in case the thunk comes from a different (composed) tuple. If the thunk needs its environment bound on retrieval, that will be done here.
gcl/runtime.py
def get_thunk_env(self, k): """Return the thunk AND environment for validating it in for the given key. There might be different envs in case the thunk comes from a different (composed) tuple. If the thunk needs its environment bound on retrieval, that will be done here. """ if k not in self.__item...
def get_thunk_env(self, k): """Return the thunk AND environment for validating it in for the given key. There might be different envs in case the thunk comes from a different (composed) tuple. If the thunk needs its environment bound on retrieval, that will be done here. """ if k not in self.__item...
[ "Return", "the", "thunk", "AND", "environment", "for", "validating", "it", "in", "for", "the", "given", "key", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L107-L122
[ "def", "get_thunk_env", "(", "self", ",", "k", ")", ":", "if", "k", "not", "in", "self", ".", "__items", ":", "raise", "exceptions", ".", "EvaluationError", "(", "'Unknown key: %r in tuple %r'", "%", "(", "k", ",", "self", ")", ")", "x", "=", "self", "...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
Tuple.attach_schema
Add a tuple schema to this object (externally imposed)
gcl/runtime.py
def attach_schema(self, schem): """Add a tuple schema to this object (externally imposed)""" self.tuple_schema = schema.AndSchema.make(self.tuple_schema, schem)
def attach_schema(self, schem): """Add a tuple schema to this object (externally imposed)""" self.tuple_schema = schema.AndSchema.make(self.tuple_schema, schem)
[ "Add", "a", "tuple", "schema", "to", "this", "object", "(", "externally", "imposed", ")" ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L146-L148
[ "def", "attach_schema", "(", "self", ",", "schem", ")", ":", "self", ".", "tuple_schema", "=", "schema", ".", "AndSchema", ".", "make", "(", "self", ".", "tuple_schema", ",", "schem", ")" ]
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
Tuple.get_schema_spec
Return the evaluated schema expression from a subkey.
gcl/runtime.py
def get_schema_spec(self, key): """Return the evaluated schema expression from a subkey.""" member_node = self._ast_node.member.get(key, None) if not member_node: return schema.AnySchema() s = framework.eval(member_node.member_schema, self.env(self)) if not isinstance(s, schema.Schema): ...
def get_schema_spec(self, key): """Return the evaluated schema expression from a subkey.""" member_node = self._ast_node.member.get(key, None) if not member_node: return schema.AnySchema() s = framework.eval(member_node.member_schema, self.env(self)) if not isinstance(s, schema.Schema): ...
[ "Return", "the", "evaluated", "schema", "expression", "from", "a", "subkey", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L150-L159
[ "def", "get_schema_spec", "(", "self", ",", "key", ")", ":", "member_node", "=", "self", ".", "_ast_node", ".", "member", ".", "get", "(", "key", ",", "None", ")", "if", "not", "member_node", ":", "return", "schema", ".", "AnySchema", "(", ")", "s", ...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
Tuple.get_required_fields
Return the names of fields that are required according to the schema.
gcl/runtime.py
def get_required_fields(self): """Return the names of fields that are required according to the schema.""" return [m.name for m in self._ast_node.members if m.member_schema.required]
def get_required_fields(self): """Return the names of fields that are required according to the schema.""" return [m.name for m in self._ast_node.members if m.member_schema.required]
[ "Return", "the", "names", "of", "fields", "that", "are", "required", "according", "to", "the", "schema", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L161-L163
[ "def", "get_required_fields", "(", "self", ")", ":", "return", "[", "m", ".", "name", "for", "m", "in", "self", ".", "_ast_node", ".", "members", "if", "m", ".", "member_schema", ".", "required", "]" ]
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
CompositeTuple.get_member_node
Return the AST node for the given member, from the first tuple that serves it.
gcl/runtime.py
def get_member_node(self, key): """Return the AST node for the given member, from the first tuple that serves it.""" for tup, _ in self.lookups: if key in tup: return tup.get_member_node(key) raise RuntimeError('Key not found in composite tuple: %r' % key)
def get_member_node(self, key): """Return the AST node for the given member, from the first tuple that serves it.""" for tup, _ in self.lookups: if key in tup: return tup.get_member_node(key) raise RuntimeError('Key not found in composite tuple: %r' % key)
[ "Return", "the", "AST", "node", "for", "the", "given", "member", "from", "the", "first", "tuple", "that", "serves", "it", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L283-L288
[ "def", "get_member_node", "(", "self", ",", "key", ")", ":", "for", "tup", ",", "_", "in", "self", ".", "lookups", ":", "if", "key", "in", "tup", ":", "return", "tup", ".", "get_member_node", "(", "key", ")", "raise", "RuntimeError", "(", "'Key not fou...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
CompositeTuple.exportable_keys
Return a list of keys that are exportable from this tuple. Returns all keys that are not private in any of the tuples.
gcl/runtime.py
def exportable_keys(self): """Return a list of keys that are exportable from this tuple. Returns all keys that are not private in any of the tuples. """ keys = collections.defaultdict(list) for tup in self._tuples: for key, private in tup._keys_and_privacy().items(): keys[key].append(...
def exportable_keys(self): """Return a list of keys that are exportable from this tuple. Returns all keys that are not private in any of the tuples. """ keys = collections.defaultdict(list) for tup in self._tuples: for key, private in tup._keys_and_privacy().items(): keys[key].append(...
[ "Return", "a", "list", "of", "keys", "that", "are", "exportable", "from", "this", "tuple", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L290-L299
[ "def", "exportable_keys", "(", "self", ")", ":", "keys", "=", "collections", ".", "defaultdict", "(", "list", ")", "for", "tup", "in", "self", ".", "_tuples", ":", "for", "key", ",", "private", "in", "tup", ".", "_keys_and_privacy", "(", ")", ".", "ite...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
OnDiskFiles.resolve
Search the filesystem.
gcl/runtime.py
def resolve(self, current_file, rel_path): """Search the filesystem.""" search_path = [path.dirname(current_file)] + self.search_path target_path = None for search in search_path: if self.exists(path.join(search, rel_path)): target_path = path.normpath(path.join(search, rel_path)) ...
def resolve(self, current_file, rel_path): """Search the filesystem.""" search_path = [path.dirname(current_file)] + self.search_path target_path = None for search in search_path: if self.exists(path.join(search, rel_path)): target_path = path.normpath(path.join(search, rel_path)) ...
[ "Search", "the", "filesystem", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L312-L326
[ "def", "resolve", "(", "self", ",", "current_file", ",", "rel_path", ")", ":", "search_path", "=", "[", "path", ".", "dirname", "(", "current_file", ")", "]", "+", "self", ".", "search_path", "target_path", "=", "None", "for", "search", "in", "search_path"...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
InMemoryFiles.resolve
Search the filesystem.
gcl/runtime.py
def resolve(self, current_file, rel_path): """Search the filesystem.""" p = path.join(path.dirname(current_file), rel_path) if p not in self.file_dict: raise RuntimeError('No such fake file: %r' % p) return p, p
def resolve(self, current_file, rel_path): """Search the filesystem.""" p = path.join(path.dirname(current_file), rel_path) if p not in self.file_dict: raise RuntimeError('No such fake file: %r' % p) return p, p
[ "Search", "the", "filesystem", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/runtime.py#L344-L349
[ "def", "resolve", "(", "self", ",", "current_file", ",", "rel_path", ")", ":", "p", "=", "path", ".", "join", "(", "path", ".", "dirname", "(", "current_file", ")", ",", "rel_path", ")", "if", "p", "not", "in", "self", ".", "file_dict", ":", "raise",...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
check_call_arguments
Check the call signature against a dictionary of proposed arguments, raising an informative exception in the case of mismatch. Parameters ---------- to_call : class or callable Function or class to examine (in the case of classes, the constructor call signature is analyzed) kwargs :...
hebel/utils/call_check.py
def check_call_arguments(to_call, kwargs): """ Check the call signature against a dictionary of proposed arguments, raising an informative exception in the case of mismatch. Parameters ---------- to_call : class or callable Function or class to examine (in the case of classes, the ...
def check_call_arguments(to_call, kwargs): """ Check the call signature against a dictionary of proposed arguments, raising an informative exception in the case of mismatch. Parameters ---------- to_call : class or callable Function or class to examine (in the case of classes, the ...
[ "Check", "the", "call", "signature", "against", "a", "dictionary", "of", "proposed", "arguments", "raising", "an", "informative", "exception", "in", "the", "case", "of", "mismatch", "." ]
hannes-brt/hebel
python
https://github.com/hannes-brt/hebel/blob/1e2c3a9309c2646103901b26a55be4e312dd5005/hebel/utils/call_check.py#L26-L96
[ "def", "check_call_arguments", "(", "to_call", ",", "kwargs", ")", ":", "if", "'self'", "in", "kwargs", ".", "keys", "(", ")", ":", "raise", "TypeError", "(", "\"Your dictionary includes an entry for 'self', \"", "\"which is just asking for trouble\"", ")", "orig_to_cal...
1e2c3a9309c2646103901b26a55be4e312dd5005
train
predict
Return label and probability estimated. Parameters ---------- rf_model : sklearn.ensemble.RandomForestClassifier The UPSILoN random forests model. features : array_like A list of features estimated by UPSILoN. Returns ------- label : str A predicted label (i.e. clas...
upsilon/predict/predict.py
def predict(rf_model, features): """ Return label and probability estimated. Parameters ---------- rf_model : sklearn.ensemble.RandomForestClassifier The UPSILoN random forests model. features : array_like A list of features estimated by UPSILoN. Returns ------- lab...
def predict(rf_model, features): """ Return label and probability estimated. Parameters ---------- rf_model : sklearn.ensemble.RandomForestClassifier The UPSILoN random forests model. features : array_like A list of features estimated by UPSILoN. Returns ------- lab...
[ "Return", "label", "and", "probability", "estimated", "." ]
dwkim78/upsilon
python
https://github.com/dwkim78/upsilon/blob/5f381453f26582ef56e62fb8fed7317ce67861af/upsilon/predict/predict.py#L4-L50
[ "def", "predict", "(", "rf_model", ",", "features", ")", ":", "import", "numpy", "as", "np", "from", "upsilon", ".", "extract_features", ".", "feature_set", "import", "get_feature_set", "feature_set", "=", "get_feature_set", "(", ")", "# Grab only necessary features...
5f381453f26582ef56e62fb8fed7317ce67861af
train
fmt
fmt(string, [tuple]) -> string Interpolate a string, replacing {patterns} with the variables with the same name. If given a tuple, use the keys from the tuple to substitute. If not given a tuple, uses the current environment as the variable source.
gcl/functions.py
def fmt(str, args=None, env=None): """fmt(string, [tuple]) -> string Interpolate a string, replacing {patterns} with the variables with the same name. If given a tuple, use the keys from the tuple to substitute. If not given a tuple, uses the current environment as the variable source. """ # Normally, we'd...
def fmt(str, args=None, env=None): """fmt(string, [tuple]) -> string Interpolate a string, replacing {patterns} with the variables with the same name. If given a tuple, use the keys from the tuple to substitute. If not given a tuple, uses the current environment as the variable source. """ # Normally, we'd...
[ "fmt", "(", "string", "[", "tuple", "]", ")", "-", ">", "string" ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/functions.py#L47-L61
[ "def", "fmt", "(", "str", ",", "args", "=", "None", ",", "env", "=", "None", ")", ":", "# Normally, we'd just call str.format(**args), but we only want to evaluate", "# values from the tuple which are actually used in the string interpolation,", "# so we use proxy objects.", "# If ...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
compose_all
Compose all given tuples together.
gcl/functions.py
def compose_all(tups): """Compose all given tuples together.""" from . import ast # I weep for humanity return functools.reduce(lambda x, y: x.compose(y), map(ast.make_tuple, tups), ast.make_tuple({}))
def compose_all(tups): """Compose all given tuples together.""" from . import ast # I weep for humanity return functools.reduce(lambda x, y: x.compose(y), map(ast.make_tuple, tups), ast.make_tuple({}))
[ "Compose", "all", "given", "tuples", "together", "." ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/functions.py#L71-L74
[ "def", "compose_all", "(", "tups", ")", ":", "from", ".", "import", "ast", "# I weep for humanity", "return", "functools", ".", "reduce", "(", "lambda", "x", ",", "y", ":", "x", ".", "compose", "(", "y", ")", ",", "map", "(", "ast", ".", "make_tuple", ...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
has_key
has(tuple, string) -> bool Return whether a given tuple has a key and the key is bound.
gcl/functions.py
def has_key(tup, key): """has(tuple, string) -> bool Return whether a given tuple has a key and the key is bound. """ if isinstance(tup, framework.TupleLike): return tup.is_bound(key) if isinstance(tup, dict): return key in tup if isinstance(tup, list): if not isinstance(key, int): raise ...
def has_key(tup, key): """has(tuple, string) -> bool Return whether a given tuple has a key and the key is bound. """ if isinstance(tup, framework.TupleLike): return tup.is_bound(key) if isinstance(tup, dict): return key in tup if isinstance(tup, list): if not isinstance(key, int): raise ...
[ "has", "(", "tuple", "string", ")", "-", ">", "bool" ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/functions.py#L85-L98
[ "def", "has_key", "(", "tup", ",", "key", ")", ":", "if", "isinstance", "(", "tup", ",", "framework", ".", "TupleLike", ")", ":", "return", "tup", ".", "is_bound", "(", "key", ")", "if", "isinstance", "(", "tup", ",", "dict", ")", ":", "return", "k...
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
flatten
flatten([[A]]) -> [A] Flatten a list of lists.
gcl/functions.py
def flatten(list_of_lists): """flatten([[A]]) -> [A] Flatten a list of lists. """ ret = [] for lst in list_of_lists: if not isinstance(lst, list): raise ValueError('%r is not a list' % lst) ret.extend(lst) return ret
def flatten(list_of_lists): """flatten([[A]]) -> [A] Flatten a list of lists. """ ret = [] for lst in list_of_lists: if not isinstance(lst, list): raise ValueError('%r is not a list' % lst) ret.extend(lst) return ret
[ "flatten", "(", "[[", "A", "]]", ")", "-", ">", "[", "A", "]" ]
rix0rrr/gcl
python
https://github.com/rix0rrr/gcl/blob/4e3bccc978a9c60aaaffd20f6f291c4d23775cdf/gcl/functions.py#L101-L111
[ "def", "flatten", "(", "list_of_lists", ")", ":", "ret", "=", "[", "]", "for", "lst", "in", "list_of_lists", ":", "if", "not", "isinstance", "(", "lst", ",", "list", ")", ":", "raise", "ValueError", "(", "'%r is not a list'", "%", "lst", ")", "ret", "....
4e3bccc978a9c60aaaffd20f6f291c4d23775cdf
train
extract_dark
Extract superdark data from ``DARKFILE`` or ``DRKCFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- dark : ndarray or `None` Super...
acstools/utils_calib.py
def extract_dark(prihdr, scihdu): """Extract superdark data from ``DARKFILE`` or ``DRKCFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- ...
def extract_dark(prihdr, scihdu): """Extract superdark data from ``DARKFILE`` or ``DRKCFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- ...
[ "Extract", "superdark", "data", "from", "DARKFILE", "or", "DRKCFILE", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L25-L73
[ "def", "extract_dark", "(", "prihdr", ",", "scihdu", ")", ":", "if", "prihdr", ".", "get", "(", "'PCTECORR'", ",", "'OMIT'", ")", "==", "'COMPLETE'", ":", "darkfile", "=", "prihdr", ".", "get", "(", "'DRKCFILE'", ",", "'N/A'", ")", "else", ":", "darkfi...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
extract_flash
Extract postflash data from ``FLSHFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- flash : ndarray or `None` Postflash, if any. S...
acstools/utils_calib.py
def extract_flash(prihdr, scihdu): """Extract postflash data from ``FLSHFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- flash : ndar...
def extract_flash(prihdr, scihdu): """Extract postflash data from ``FLSHFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- flash : ndar...
[ "Extract", "postflash", "data", "from", "FLSHFILE", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L76-L120
[ "def", "extract_flash", "(", "prihdr", ",", "scihdu", ")", ":", "flshfile", "=", "prihdr", ".", "get", "(", "'FLSHFILE'", ",", "'N/A'", ")", "flashsta", "=", "prihdr", ".", "get", "(", "'FLASHSTA'", ",", "'N/A'", ")", "flashdur", "=", "prihdr", ".", "g...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
extract_flatfield
Extract flatfield data from ``PFLTFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- invflat : ndarray or `None` Inverse flatfield,...
acstools/utils_calib.py
def extract_flatfield(prihdr, scihdu): """Extract flatfield data from ``PFLTFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- invflat ...
def extract_flatfield(prihdr, scihdu): """Extract flatfield data from ``PFLTFILE``. Parameters ---------- prihdr : obj FITS primary header HDU. scihdu : obj Extension HDU of the science image. This is only used to extract subarray data. Returns ------- invflat ...
[ "Extract", "flatfield", "data", "from", "PFLTFILE", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L123-L165
[ "def", "extract_flatfield", "(", "prihdr", ",", "scihdu", ")", ":", "for", "ff", "in", "[", "'DFLTFILE'", ",", "'LFLTFILE'", "]", ":", "vv", "=", "prihdr", ".", "get", "(", "ff", ",", "'N/A'", ")", "if", "vv", "!=", "'N/A'", ":", "warnings", ".", "...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
from_irafpath
Resolve IRAF path like ``jref$`` into actual file path. Parameters ---------- irafpath : str Path containing IRAF syntax. Returns ------- realpath : str Actual file path. If input does not follow ``path$filename`` format, then this is the same as input. Raises ...
acstools/utils_calib.py
def from_irafpath(irafpath): """Resolve IRAF path like ``jref$`` into actual file path. Parameters ---------- irafpath : str Path containing IRAF syntax. Returns ------- realpath : str Actual file path. If input does not follow ``path$filename`` format, then this is...
def from_irafpath(irafpath): """Resolve IRAF path like ``jref$`` into actual file path. Parameters ---------- irafpath : str Path containing IRAF syntax. Returns ------- realpath : str Actual file path. If input does not follow ``path$filename`` format, then this is...
[ "Resolve", "IRAF", "path", "like", "jref$", "into", "actual", "file", "path", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L168-L200
[ "def", "from_irafpath", "(", "irafpath", ")", ":", "s", "=", "irafpath", ".", "split", "(", "'$'", ")", "if", "len", "(", "s", ")", "!=", "2", ":", "return", "irafpath", "if", "len", "(", "s", "[", "0", "]", ")", "==", "0", ":", "return", "iraf...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
extract_ref
Extract section of the reference image that corresponds to the given science image. This only returns a view, not a copy of the reference image's array. Parameters ---------- scihdu, refhdu : obj Extension HDU's of the science and reference image, respectively. Returns ...
acstools/utils_calib.py
def extract_ref(scihdu, refhdu): """Extract section of the reference image that corresponds to the given science image. This only returns a view, not a copy of the reference image's array. Parameters ---------- scihdu, refhdu : obj Extension HDU's of the science and reference image...
def extract_ref(scihdu, refhdu): """Extract section of the reference image that corresponds to the given science image. This only returns a view, not a copy of the reference image's array. Parameters ---------- scihdu, refhdu : obj Extension HDU's of the science and reference image...
[ "Extract", "section", "of", "the", "reference", "image", "that", "corresponds", "to", "the", "given", "science", "image", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L203-L249
[ "def", "extract_ref", "(", "scihdu", ",", "refhdu", ")", ":", "same_size", ",", "rx", ",", "ry", ",", "x0", ",", "y0", "=", "find_line", "(", "scihdu", ",", "refhdu", ")", "# Use the whole reference image", "if", "same_size", ":", "return", "refhdu", ".", ...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
find_line
Obtain bin factors and corner location to extract and bin the appropriate subset of a reference image to match a science image. If the science image has zero offset and is the same size and binning as the reference image, ``same_size`` will be set to `True`. Otherwise, the values of ``rx``, ``ry``,...
acstools/utils_calib.py
def find_line(scihdu, refhdu): """Obtain bin factors and corner location to extract and bin the appropriate subset of a reference image to match a science image. If the science image has zero offset and is the same size and binning as the reference image, ``same_size`` will be set to `True`. Ot...
def find_line(scihdu, refhdu): """Obtain bin factors and corner location to extract and bin the appropriate subset of a reference image to match a science image. If the science image has zero offset and is the same size and binning as the reference image, ``same_size`` will be set to `True`. Ot...
[ "Obtain", "bin", "factors", "and", "corner", "location", "to", "extract", "and", "bin", "the", "appropriate", "subset", "of", "a", "reference", "image", "to", "match", "a", "science", "image", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L252-L351
[ "def", "find_line", "(", "scihdu", ",", "refhdu", ")", ":", "sci_bin", ",", "sci_corner", "=", "get_corner", "(", "scihdu", ".", "header", ")", "ref_bin", ",", "ref_corner", "=", "get_corner", "(", "refhdu", ".", "header", ")", "# We can use the reference imag...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
get_corner
Obtain bin and corner information for a subarray. ``LTV1``, ``LTV2``, ``LTM1_1``, and ``LTM2_2`` keywords are extracted from the given extension header and converted to bin and corner values (0-indexed). ``LTV1`` for the CCD uses the beginning of the illuminated portion as the origin, not the begi...
acstools/utils_calib.py
def get_corner(hdr, rsize=1): """Obtain bin and corner information for a subarray. ``LTV1``, ``LTV2``, ``LTM1_1``, and ``LTM2_2`` keywords are extracted from the given extension header and converted to bin and corner values (0-indexed). ``LTV1`` for the CCD uses the beginning of the illuminated ...
def get_corner(hdr, rsize=1): """Obtain bin and corner information for a subarray. ``LTV1``, ``LTV2``, ``LTM1_1``, and ``LTM2_2`` keywords are extracted from the given extension header and converted to bin and corner values (0-indexed). ``LTV1`` for the CCD uses the beginning of the illuminated ...
[ "Obtain", "bin", "and", "corner", "information", "for", "a", "subarray", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L354-L388
[ "def", "get_corner", "(", "hdr", ",", "rsize", "=", "1", ")", ":", "ltm", ",", "ltv", "=", "get_lt", "(", "hdr", ")", "return", "from_lt", "(", "rsize", ",", "ltm", ",", "ltv", ")" ]
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
get_lt
Obtain the LTV and LTM keyword values. Note that this returns the values just as read from the header, which means in particular that the LTV values are for one-indexed pixel coordinates. LTM keywords are the diagonal elements of MWCS linear transformation matrix, while LTV's are MWCS linear trans...
acstools/utils_calib.py
def get_lt(hdr): """Obtain the LTV and LTM keyword values. Note that this returns the values just as read from the header, which means in particular that the LTV values are for one-indexed pixel coordinates. LTM keywords are the diagonal elements of MWCS linear transformation matrix, while LTV...
def get_lt(hdr): """Obtain the LTV and LTM keyword values. Note that this returns the values just as read from the header, which means in particular that the LTV values are for one-indexed pixel coordinates. LTM keywords are the diagonal elements of MWCS linear transformation matrix, while LTV...
[ "Obtain", "the", "LTV", "and", "LTM", "keyword", "values", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L391-L428
[ "def", "get_lt", "(", "hdr", ")", ":", "ltm", "=", "(", "hdr", ".", "get", "(", "'LTM1_1'", ",", "1.0", ")", ",", "hdr", ".", "get", "(", "'LTM2_2'", ",", "1.0", ")", ")", "if", "ltm", "[", "0", "]", "<=", "0", "or", "ltm", "[", "1", "]", ...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
from_lt
Compute the corner location and pixel size in units of unbinned pixels. .. note:: Translated from ``calacs/lib/fromlt.c``. Parameters ---------- rsize : int Reference pixel size. Usually 1. ltm, ltv : tuple of float See :func:`get_lt`. Returns ------- bin : tuple ...
acstools/utils_calib.py
def from_lt(rsize, ltm, ltv): """Compute the corner location and pixel size in units of unbinned pixels. .. note:: Translated from ``calacs/lib/fromlt.c``. Parameters ---------- rsize : int Reference pixel size. Usually 1. ltm, ltv : tuple of float See :func:`get_lt`. ...
def from_lt(rsize, ltm, ltv): """Compute the corner location and pixel size in units of unbinned pixels. .. note:: Translated from ``calacs/lib/fromlt.c``. Parameters ---------- rsize : int Reference pixel size. Usually 1. ltm, ltv : tuple of float See :func:`get_lt`. ...
[ "Compute", "the", "corner", "location", "and", "pixel", "size", "in", "units", "of", "unbinned", "pixels", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L431-L464
[ "def", "from_lt", "(", "rsize", ",", "ltm", ",", "ltv", ")", ":", "dbinx", "=", "rsize", "/", "ltm", "[", "0", "]", "dbiny", "=", "rsize", "/", "ltm", "[", "1", "]", "dxcorner", "=", "(", "dbinx", "-", "rsize", ")", "-", "dbinx", "*", "ltv", ...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
hdr_vals_for_overscan
Retrieve header keyword values from RAW and SPT FITS files to pass on to :func:`check_oscntab` and :func:`check_overscan`. Parameters ---------- root : str Rootname of the observation. Can be relative path to the file excluding the type of FITS file and extension, e.g., '/my...
acstools/utils_calib.py
def hdr_vals_for_overscan(root): """Retrieve header keyword values from RAW and SPT FITS files to pass on to :func:`check_oscntab` and :func:`check_overscan`. Parameters ---------- root : str Rootname of the observation. Can be relative path to the file excluding the type of FIT...
def hdr_vals_for_overscan(root): """Retrieve header keyword values from RAW and SPT FITS files to pass on to :func:`check_oscntab` and :func:`check_overscan`. Parameters ---------- root : str Rootname of the observation. Can be relative path to the file excluding the type of FIT...
[ "Retrieve", "header", "keyword", "values", "from", "RAW", "and", "SPT", "FITS", "files", "to", "pass", "on", "to", ":", "func", ":", "check_oscntab", "and", ":", "func", ":", "check_overscan", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L476-L518
[ "def", "hdr_vals_for_overscan", "(", "root", ")", ":", "with", "fits", ".", "open", "(", "root", "+", "'_spt.fits'", ")", "as", "hdu", ":", "spthdr", "=", "hdu", "[", "0", "]", ".", "header", "with", "fits", ".", "open", "(", "root", "+", "'_raw.fits...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
check_oscntab
Check if the supplied parameters are in the ``OSCNTAB`` reference file. .. note:: Even if an entry does not exist in ``OSCNTAB``, as long as the subarray does not have any overscan, it should not be a problem for CALACS. .. note:: This function does not check the virtual bias r...
acstools/utils_calib.py
def check_oscntab(oscntab, ccdamp, xsize, ysize, leading, trailing): """Check if the supplied parameters are in the ``OSCNTAB`` reference file. .. note:: Even if an entry does not exist in ``OSCNTAB``, as long as the subarray does not have any overscan, it should not be a proble...
def check_oscntab(oscntab, ccdamp, xsize, ysize, leading, trailing): """Check if the supplied parameters are in the ``OSCNTAB`` reference file. .. note:: Even if an entry does not exist in ``OSCNTAB``, as long as the subarray does not have any overscan, it should not be a proble...
[ "Check", "if", "the", "supplied", "parameters", "are", "in", "the", "OSCNTAB", "reference", "file", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L521-L566
[ "def", "check_oscntab", "(", "oscntab", ",", "ccdamp", ",", "xsize", ",", "ysize", ",", "leading", ",", "trailing", ")", ":", "tab", "=", "Table", ".", "read", "(", "oscntab", ")", "ccdamp", "=", "ccdamp", ".", "lower", "(", ")", ".", "rstrip", "(", ...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
check_overscan
Check image for bias columns. Parameters ---------- xstart : int Starting column of the readout in detector coordinates. xsize : int Number of columns in the readout. total_prescan_pixels : int Total prescan pixels for a single amplifier on a detector. Default is 2...
acstools/utils_calib.py
def check_overscan(xstart, xsize, total_prescan_pixels=24, total_science_pixels=4096): """Check image for bias columns. Parameters ---------- xstart : int Starting column of the readout in detector coordinates. xsize : int Number of columns in the readout. t...
def check_overscan(xstart, xsize, total_prescan_pixels=24, total_science_pixels=4096): """Check image for bias columns. Parameters ---------- xstart : int Starting column of the readout in detector coordinates. xsize : int Number of columns in the readout. t...
[ "Check", "image", "for", "bias", "columns", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/utils_calib.py#L569-L616
[ "def", "check_overscan", "(", "xstart", ",", "xsize", ",", "total_prescan_pixels", "=", "24", ",", "total_science_pixels", "=", "4096", ")", ":", "hasoverscan", "=", "False", "leading", "=", "0", "trailing", "=", "0", "if", "xstart", "<", "total_prescan_pixels...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
ModelAdminMiddleware.process_request
Ignore unnecessary actions for static file requests, posts, or ajax requests. We're only interested in redirecting following a 'natural' request redirection to the `wagtailadmin_explore_root` or `wagtailadmin_explore` views.
wagtailmodeladmin/middleware.py
def process_request(self, request): """ Ignore unnecessary actions for static file requests, posts, or ajax requests. We're only interested in redirecting following a 'natural' request redirection to the `wagtailadmin_explore_root` or `wagtailadmin_explore` views. """ ...
def process_request(self, request): """ Ignore unnecessary actions for static file requests, posts, or ajax requests. We're only interested in redirecting following a 'natural' request redirection to the `wagtailadmin_explore_root` or `wagtailadmin_explore` views. """ ...
[ "Ignore", "unnecessary", "actions", "for", "static", "file", "requests", "posts", "or", "ajax", "requests", ".", "We", "re", "only", "interested", "in", "redirecting", "following", "a", "natural", "request", "redirection", "to", "the", "wagtailadmin_explore_root", ...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/middleware.py#L14-L63
[ "def", "process_request", "(", "self", ",", "request", ")", ":", "referer_url", "=", "request", ".", "META", ".", "get", "(", "'HTTP_REFERER'", ")", "return_to_index_url", "=", "request", ".", "session", ".", "get", "(", "'return_to_index_url'", ")", "try", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
acs2d
r""" Run the acs2d.e executable as from the shell. Output is automatically named based on input suffix: +--------------------+----------------+------------------------------+ | INPUT | OUTPUT | EXPECTED DATA | +====================+================+=...
acstools/acs2d.py
def acs2d(input, exec_path='', time_stamps=False, verbose=False, quiet=False, exe_args=None): r""" Run the acs2d.e executable as from the shell. Output is automatically named based on input suffix: +--------------------+----------------+------------------------------+ | INPUT ...
def acs2d(input, exec_path='', time_stamps=False, verbose=False, quiet=False, exe_args=None): r""" Run the acs2d.e executable as from the shell. Output is automatically named based on input suffix: +--------------------+----------------+------------------------------+ | INPUT ...
[ "r", "Run", "the", "acs2d", ".", "e", "executable", "as", "from", "the", "shell", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acs2d.py#L32-L109
[ "def", "acs2d", "(", "input", ",", "exec_path", "=", "''", ",", "time_stamps", "=", "False", ",", "verbose", "=", "False", ",", "quiet", "=", "False", ",", "exe_args", "=", "None", ")", ":", "from", "stsci", ".", "tools", "import", "parseinput", "# Opt...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
run
TEAL interface for the `acs2d` function.
acstools/acs2d.py
def run(configobj=None): """ TEAL interface for the `acs2d` function. """ acs2d(configobj['input'], exec_path=configobj['exec_path'], time_stamps=configobj['time_stamps'], verbose=configobj['verbose'], quiet=configobj['quiet'] )
def run(configobj=None): """ TEAL interface for the `acs2d` function. """ acs2d(configobj['input'], exec_path=configobj['exec_path'], time_stamps=configobj['time_stamps'], verbose=configobj['verbose'], quiet=configobj['quiet'] )
[ "TEAL", "interface", "for", "the", "acs2d", "function", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acs2d.py#L120-L130
[ "def", "run", "(", "configobj", "=", "None", ")", ":", "acs2d", "(", "configobj", "[", "'input'", "]", ",", "exec_path", "=", "configobj", "[", "'exec_path'", "]", ",", "time_stamps", "=", "configobj", "[", "'time_stamps'", "]", ",", "verbose", "=", "con...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
run
TEAL interface for the `acscte` function.
acstools/acscte.py
def run(configobj=None): """ TEAL interface for the `acscte` function. """ acscte(configobj['input'], exec_path=configobj['exec_path'], time_stamps=configobj['time_stamps'], verbose=configobj['verbose'], quiet=configobj['quiet'], single_core=config...
def run(configobj=None): """ TEAL interface for the `acscte` function. """ acscte(configobj['input'], exec_path=configobj['exec_path'], time_stamps=configobj['time_stamps'], verbose=configobj['verbose'], quiet=configobj['quiet'], single_core=config...
[ "TEAL", "interface", "for", "the", "acscte", "function", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acscte.py#L121-L132
[ "def", "run", "(", "configobj", "=", "None", ")", ":", "acscte", "(", "configobj", "[", "'input'", "]", ",", "exec_path", "=", "configobj", "[", "'exec_path'", "]", ",", "time_stamps", "=", "configobj", "[", "'time_stamps'", "]", ",", "verbose", "=", "co...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
Query._check_inputs
Check the inputs to ensure they are valid. Returns ------- status : bool True if all inputs are valid, False if one is not.
acstools/acszpt.py
def _check_inputs(self): """Check the inputs to ensure they are valid. Returns ------- status : bool True if all inputs are valid, False if one is not. """ valid_detector = True valid_filter = True valid_date = True # Determine the su...
def _check_inputs(self): """Check the inputs to ensure they are valid. Returns ------- status : bool True if all inputs are valid, False if one is not. """ valid_detector = True valid_filter = True valid_date = True # Determine the su...
[ "Check", "the", "inputs", "to", "ensure", "they", "are", "valid", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acszpt.py#L206-L248
[ "def", "_check_inputs", "(", "self", ")", ":", "valid_detector", "=", "True", "valid_filter", "=", "True", "valid_date", "=", "True", "# Determine the submitted detector is valid", "if", "self", ".", "detector", "not", "in", "self", ".", "_valid_detectors", ":", "...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
Query._check_date
Convenience method for determining if the input date is valid. Parameters ---------- fmt : str The format of the date string. The default is ``%Y-%m-%d``, which corresponds to ``YYYY-MM-DD``. Returns ------- status : str or `None` If ...
acstools/acszpt.py
def _check_date(self, fmt='%Y-%m-%d'): """Convenience method for determining if the input date is valid. Parameters ---------- fmt : str The format of the date string. The default is ``%Y-%m-%d``, which corresponds to ``YYYY-MM-DD``. Returns ----...
def _check_date(self, fmt='%Y-%m-%d'): """Convenience method for determining if the input date is valid. Parameters ---------- fmt : str The format of the date string. The default is ``%Y-%m-%d``, which corresponds to ``YYYY-MM-DD``. Returns ----...
[ "Convenience", "method", "for", "determining", "if", "the", "input", "date", "is", "valid", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acszpt.py#L250-L283
[ "def", "_check_date", "(", "self", ",", "fmt", "=", "'%Y-%m-%d'", ")", ":", "result", "=", "None", "try", ":", "dt_obj", "=", "dt", ".", "datetime", ".", "strptime", "(", "self", ".", "date", ",", "fmt", ")", "except", "ValueError", ":", "result", "=...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
Query._submit_request
Submit a request to the ACS Zeropoint Calculator. If an exception is raised during the request, an error message is given. Otherwise, the response is saved in the corresponding attribute.
acstools/acszpt.py
def _submit_request(self): """Submit a request to the ACS Zeropoint Calculator. If an exception is raised during the request, an error message is given. Otherwise, the response is saved in the corresponding attribute. """ try: self._response = urlopen(self._...
def _submit_request(self): """Submit a request to the ACS Zeropoint Calculator. If an exception is raised during the request, an error message is given. Otherwise, the response is saved in the corresponding attribute. """ try: self._response = urlopen(self._...
[ "Submit", "a", "request", "to", "the", "ACS", "Zeropoint", "Calculator", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acszpt.py#L285-L303
[ "def", "_submit_request", "(", "self", ")", ":", "try", ":", "self", ".", "_response", "=", "urlopen", "(", "self", ".", "_url", ")", "except", "URLError", "as", "e", ":", "msg", "=", "(", "'{}\\n{}\\nThe query failed! Please check your inputs. '", "'If the erro...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
Query._parse_and_format
Parse and format the results returned by the ACS Zeropoint Calculator. Using ``beautifulsoup4``, find all the ``<tb> </tb>`` tags present in the response. Format the results into an astropy.table.QTable with corresponding units and assign it to the zpt_table attribute.
acstools/acszpt.py
def _parse_and_format(self): """ Parse and format the results returned by the ACS Zeropoint Calculator. Using ``beautifulsoup4``, find all the ``<tb> </tb>`` tags present in the response. Format the results into an astropy.table.QTable with corresponding units and assign it to the zpt_t...
def _parse_and_format(self): """ Parse and format the results returned by the ACS Zeropoint Calculator. Using ``beautifulsoup4``, find all the ``<tb> </tb>`` tags present in the response. Format the results into an astropy.table.QTable with corresponding units and assign it to the zpt_t...
[ "Parse", "and", "format", "the", "results", "returned", "by", "the", "ACS", "Zeropoint", "Calculator", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acszpt.py#L305-L349
[ "def", "_parse_and_format", "(", "self", ")", ":", "soup", "=", "BeautifulSoup", "(", "self", ".", "_response", ".", "read", "(", ")", ",", "'html.parser'", ")", "# Grab all elements in the table returned by the ZPT calc.", "td", "=", "soup", ".", "find_all", "(",...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
Query.fetch
Submit the request to the ACS Zeropoints Calculator. This method will: * submit the request * parse the response * format the results into a table with the correct units Returns ------- tab : `astropy.table.QTable` or `None` If the request was succe...
acstools/acszpt.py
def fetch(self): """Submit the request to the ACS Zeropoints Calculator. This method will: * submit the request * parse the response * format the results into a table with the correct units Returns ------- tab : `astropy.table.QTable` or `None` ...
def fetch(self): """Submit the request to the ACS Zeropoints Calculator. This method will: * submit the request * parse the response * format the results into a table with the correct units Returns ------- tab : `astropy.table.QTable` or `None` ...
[ "Submit", "the", "request", "to", "the", "ACS", "Zeropoints", "Calculator", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acszpt.py#L351-L379
[ "def", "fetch", "(", "self", ")", ":", "LOG", ".", "info", "(", "'Checking inputs...'", ")", "valid_inputs", "=", "self", ".", "_check_inputs", "(", ")", "if", "valid_inputs", ":", "LOG", ".", "info", "(", "'Submitting request to {}'", ".", "format", "(", ...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
ModelAdmin.get_queryset
Returns a QuerySet of all model instances that can be edited by the admin site.
wagtailmodeladmin/options.py
def get_queryset(self, request): """ Returns a QuerySet of all model instances that can be edited by the admin site. """ qs = self.model._default_manager.get_queryset() ordering = self.get_ordering(request) if ordering: qs = qs.order_by(*ordering) ...
def get_queryset(self, request): """ Returns a QuerySet of all model instances that can be edited by the admin site. """ qs = self.model._default_manager.get_queryset() ordering = self.get_ordering(request) if ordering: qs = qs.order_by(*ordering) ...
[ "Returns", "a", "QuerySet", "of", "all", "model", "instances", "that", "can", "be", "edited", "by", "the", "admin", "site", "." ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L236-L245
[ "def", "get_queryset", "(", "self", ",", "request", ")", ":", "qs", "=", "self", ".", "model", ".", "_default_manager", ".", "get_queryset", "(", ")", "ordering", "=", "self", ".", "get_ordering", "(", "request", ")", "if", "ordering", ":", "qs", "=", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.index_view
Instantiates a class-based view to provide listing functionality for the assigned model. The view class used can be overridden by changing the 'index_view_class' attribute.
wagtailmodeladmin/options.py
def index_view(self, request): """ Instantiates a class-based view to provide listing functionality for the assigned model. The view class used can be overridden by changing the 'index_view_class' attribute. """ kwargs = {'model_admin': self} view_class = self.ind...
def index_view(self, request): """ Instantiates a class-based view to provide listing functionality for the assigned model. The view class used can be overridden by changing the 'index_view_class' attribute. """ kwargs = {'model_admin': self} view_class = self.ind...
[ "Instantiates", "a", "class", "-", "based", "view", "to", "provide", "listing", "functionality", "for", "the", "assigned", "model", ".", "The", "view", "class", "used", "can", "be", "overridden", "by", "changing", "the", "index_view_class", "attribute", "." ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L316-L324
[ "def", "index_view", "(", "self", ",", "request", ")", ":", "kwargs", "=", "{", "'model_admin'", ":", "self", "}", "view_class", "=", "self", ".", "index_view_class", "return", "view_class", ".", "as_view", "(", "*", "*", "kwargs", ")", "(", "request", "...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.create_view
Instantiates a class-based view to provide 'creation' functionality for the assigned model, or redirect to Wagtail's create view if the assigned model extends 'Page'. The view class used can be overridden by changing the 'create_view_class' attribute.
wagtailmodeladmin/options.py
def create_view(self, request): """ Instantiates a class-based view to provide 'creation' functionality for the assigned model, or redirect to Wagtail's create view if the assigned model extends 'Page'. The view class used can be overridden by changing the 'create_view_class' att...
def create_view(self, request): """ Instantiates a class-based view to provide 'creation' functionality for the assigned model, or redirect to Wagtail's create view if the assigned model extends 'Page'. The view class used can be overridden by changing the 'create_view_class' att...
[ "Instantiates", "a", "class", "-", "based", "view", "to", "provide", "creation", "functionality", "for", "the", "assigned", "model", "or", "redirect", "to", "Wagtail", "s", "create", "view", "if", "the", "assigned", "model", "extends", "Page", ".", "The", "v...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L326-L335
[ "def", "create_view", "(", "self", ",", "request", ")", ":", "kwargs", "=", "{", "'model_admin'", ":", "self", "}", "view_class", "=", "self", ".", "create_view_class", "return", "view_class", ".", "as_view", "(", "*", "*", "kwargs", ")", "(", "request", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.choose_parent_view
Instantiates a class-based view to provide a view that allows a parent page to be chosen for a new object, where the assigned model extends Wagtail's Page model, and there is more than one potential parent for new instances. The view class used can be overridden by changing the 'choose_p...
wagtailmodeladmin/options.py
def choose_parent_view(self, request): """ Instantiates a class-based view to provide a view that allows a parent page to be chosen for a new object, where the assigned model extends Wagtail's Page model, and there is more than one potential parent for new instances. The view cla...
def choose_parent_view(self, request): """ Instantiates a class-based view to provide a view that allows a parent page to be chosen for a new object, where the assigned model extends Wagtail's Page model, and there is more than one potential parent for new instances. The view cla...
[ "Instantiates", "a", "class", "-", "based", "view", "to", "provide", "a", "view", "that", "allows", "a", "parent", "page", "to", "be", "chosen", "for", "a", "new", "object", "where", "the", "assigned", "model", "extends", "Wagtail", "s", "Page", "model", ...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L342-L352
[ "def", "choose_parent_view", "(", "self", ",", "request", ")", ":", "kwargs", "=", "{", "'model_admin'", ":", "self", "}", "view_class", "=", "self", ".", "choose_parent_view_class", "return", "view_class", ".", "as_view", "(", "*", "*", "kwargs", ")", "(", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.edit_view
Instantiates a class-based view to provide 'edit' functionality for the assigned model, or redirect to Wagtail's edit view if the assigned model extends 'Page'. The view class used can be overridden by changing the 'edit_view_class' attribute.
wagtailmodeladmin/options.py
def edit_view(self, request, object_id): """ Instantiates a class-based view to provide 'edit' functionality for the assigned model, or redirect to Wagtail's edit view if the assigned model extends 'Page'. The view class used can be overridden by changing the 'edit_view_class' a...
def edit_view(self, request, object_id): """ Instantiates a class-based view to provide 'edit' functionality for the assigned model, or redirect to Wagtail's edit view if the assigned model extends 'Page'. The view class used can be overridden by changing the 'edit_view_class' a...
[ "Instantiates", "a", "class", "-", "based", "view", "to", "provide", "edit", "functionality", "for", "the", "assigned", "model", "or", "redirect", "to", "Wagtail", "s", "edit", "view", "if", "the", "assigned", "model", "extends", "Page", ".", "The", "view", ...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L354-L363
[ "def", "edit_view", "(", "self", ",", "request", ",", "object_id", ")", ":", "kwargs", "=", "{", "'model_admin'", ":", "self", ",", "'object_id'", ":", "object_id", "}", "view_class", "=", "self", ".", "edit_view_class", "return", "view_class", ".", "as_view...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.confirm_delete_view
Instantiates a class-based view to provide 'delete confirmation' functionality for the assigned model, or redirect to Wagtail's delete confirmation view if the assigned model extends 'Page'. The view class used can be overridden by changing the 'confirm_delete_view_class' attribute.
wagtailmodeladmin/options.py
def confirm_delete_view(self, request, object_id): """ Instantiates a class-based view to provide 'delete confirmation' functionality for the assigned model, or redirect to Wagtail's delete confirmation view if the assigned model extends 'Page'. The view class used can be overrid...
def confirm_delete_view(self, request, object_id): """ Instantiates a class-based view to provide 'delete confirmation' functionality for the assigned model, or redirect to Wagtail's delete confirmation view if the assigned model extends 'Page'. The view class used can be overrid...
[ "Instantiates", "a", "class", "-", "based", "view", "to", "provide", "delete", "confirmation", "functionality", "for", "the", "assigned", "model", "or", "redirect", "to", "Wagtail", "s", "delete", "confirmation", "view", "if", "the", "assigned", "model", "extend...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L365-L375
[ "def", "confirm_delete_view", "(", "self", ",", "request", ",", "object_id", ")", ":", "kwargs", "=", "{", "'model_admin'", ":", "self", ",", "'object_id'", ":", "object_id", "}", "view_class", "=", "self", ".", "confirm_delete_view_class", "return", "view_class...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.unpublish_view
Instantiates a class-based view that redirects to Wagtail's 'unpublish' view for models that extend 'Page' (if the user has sufficient permissions). We do this via our own view so that we can reliably control redirection of the user back to the index_view once the action is completed. Th...
wagtailmodeladmin/options.py
def unpublish_view(self, request, object_id): """ Instantiates a class-based view that redirects to Wagtail's 'unpublish' view for models that extend 'Page' (if the user has sufficient permissions). We do this via our own view so that we can reliably control redirection of the us...
def unpublish_view(self, request, object_id): """ Instantiates a class-based view that redirects to Wagtail's 'unpublish' view for models that extend 'Page' (if the user has sufficient permissions). We do this via our own view so that we can reliably control redirection of the us...
[ "Instantiates", "a", "class", "-", "based", "view", "that", "redirects", "to", "Wagtail", "s", "unpublish", "view", "for", "models", "that", "extend", "Page", "(", "if", "the", "user", "has", "sufficient", "permissions", ")", ".", "We", "do", "this", "via"...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L377-L388
[ "def", "unpublish_view", "(", "self", ",", "request", ",", "object_id", ")", ":", "kwargs", "=", "{", "'model_admin'", ":", "self", ",", "'object_id'", ":", "object_id", "}", "view_class", "=", "self", ".", "unpublish_view_class", "return", "view_class", ".", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.copy_view
Instantiates a class-based view that redirects to Wagtail's 'copy' view for models that extend 'Page' (if the user has sufficient permissions). We do this via our own view so that we can reliably control redirection of the user back to the index_view once the action is completed. The vie...
wagtailmodeladmin/options.py
def copy_view(self, request, object_id): """ Instantiates a class-based view that redirects to Wagtail's 'copy' view for models that extend 'Page' (if the user has sufficient permissions). We do this via our own view so that we can reliably control redirection of the user back to...
def copy_view(self, request, object_id): """ Instantiates a class-based view that redirects to Wagtail's 'copy' view for models that extend 'Page' (if the user has sufficient permissions). We do this via our own view so that we can reliably control redirection of the user back to...
[ "Instantiates", "a", "class", "-", "based", "view", "that", "redirects", "to", "Wagtail", "s", "copy", "view", "for", "models", "that", "extend", "Page", "(", "if", "the", "user", "has", "sufficient", "permissions", ")", ".", "We", "do", "this", "via", "...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L390-L401
[ "def", "copy_view", "(", "self", ",", "request", ",", "object_id", ")", ":", "kwargs", "=", "{", "'model_admin'", ":", "self", ",", "'object_id'", ":", "object_id", "}", "view_class", "=", "self", ".", "copy_view_class", "return", "view_class", ".", "as_view...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.get_templates
Utility function that provides a list of templates to try for a given view, when the template isn't overridden by one of the template attributes on the class.
wagtailmodeladmin/options.py
def get_templates(self, action='index'): """ Utility function that provides a list of templates to try for a given view, when the template isn't overridden by one of the template attributes on the class. """ app = self.opts.app_label model_name = self.opts.model_n...
def get_templates(self, action='index'): """ Utility function that provides a list of templates to try for a given view, when the template isn't overridden by one of the template attributes on the class. """ app = self.opts.app_label model_name = self.opts.model_n...
[ "Utility", "function", "that", "provides", "a", "list", "of", "templates", "to", "try", "for", "a", "given", "view", "when", "the", "template", "isn", "t", "overridden", "by", "one", "of", "the", "template", "attributes", "on", "the", "class", "." ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L403-L415
[ "def", "get_templates", "(", "self", ",", "action", "=", "'index'", ")", ":", "app", "=", "self", ".", "opts", ".", "app_label", "model_name", "=", "self", ".", "opts", ".", "model_name", "return", "[", "'wagtailmodeladmin/%s/%s/%s.html'", "%", "(", "app", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.get_permissions_for_registration
Utilised by Wagtail's 'register_permissions' hook to allow permissions for a model to be assigned to groups in settings. This is only required if the model isn't a Page model, and isn't registered as a Snippet
wagtailmodeladmin/options.py
def get_permissions_for_registration(self): """ Utilised by Wagtail's 'register_permissions' hook to allow permissions for a model to be assigned to groups in settings. This is only required if the model isn't a Page model, and isn't registered as a Snippet """ from wagta...
def get_permissions_for_registration(self): """ Utilised by Wagtail's 'register_permissions' hook to allow permissions for a model to be assigned to groups in settings. This is only required if the model isn't a Page model, and isn't registered as a Snippet """ from wagta...
[ "Utilised", "by", "Wagtail", "s", "register_permissions", "hook", "to", "allow", "permissions", "for", "a", "model", "to", "be", "assigned", "to", "groups", "in", "settings", ".", "This", "is", "only", "required", "if", "the", "model", "isn", "t", "a", "Pa...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L481-L490
[ "def", "get_permissions_for_registration", "(", "self", ")", ":", "from", "wagtail", ".", "wagtailsnippets", ".", "models", "import", "SNIPPET_MODELS", "if", "not", "self", ".", "is_pagemodel", "and", "self", ".", "model", "not", "in", "SNIPPET_MODELS", ":", "re...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdmin.get_admin_urls_for_registration
Utilised by Wagtail's 'register_admin_urls' hook to register urls for our the views that class offers.
wagtailmodeladmin/options.py
def get_admin_urls_for_registration(self): """ Utilised by Wagtail's 'register_admin_urls' hook to register urls for our the views that class offers. """ urls = ( url(get_url_pattern(self.opts), self.index_view, name=get_url_name(self.opts)), ...
def get_admin_urls_for_registration(self): """ Utilised by Wagtail's 'register_admin_urls' hook to register urls for our the views that class offers. """ urls = ( url(get_url_pattern(self.opts), self.index_view, name=get_url_name(self.opts)), ...
[ "Utilised", "by", "Wagtail", "s", "register_admin_urls", "hook", "to", "register", "urls", "for", "our", "the", "views", "that", "class", "offers", "." ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L492-L533
[ "def", "get_admin_urls_for_registration", "(", "self", ")", ":", "urls", "=", "(", "url", "(", "get_url_pattern", "(", "self", ".", "opts", ")", ",", "self", ".", "index_view", ",", "name", "=", "get_url_name", "(", "self", ".", "opts", ")", ")", ",", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdminGroup.get_menu_item
Utilised by Wagtail's 'register_menu_item' hook to create a menu for this group with a SubMenu linking to listing pages for any associated ModelAdmin instances
wagtailmodeladmin/options.py
def get_menu_item(self): """ Utilised by Wagtail's 'register_menu_item' hook to create a menu for this group with a SubMenu linking to listing pages for any associated ModelAdmin instances """ if self.modeladmin_instances: submenu = SubMenu(self.get_submenu_it...
def get_menu_item(self): """ Utilised by Wagtail's 'register_menu_item' hook to create a menu for this group with a SubMenu linking to listing pages for any associated ModelAdmin instances """ if self.modeladmin_instances: submenu = SubMenu(self.get_submenu_it...
[ "Utilised", "by", "Wagtail", "s", "register_menu_item", "hook", "to", "create", "a", "menu", "for", "this", "group", "with", "a", "SubMenu", "linking", "to", "listing", "pages", "for", "any", "associated", "ModelAdmin", "instances" ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L579-L587
[ "def", "get_menu_item", "(", "self", ")", ":", "if", "self", ".", "modeladmin_instances", ":", "submenu", "=", "SubMenu", "(", "self", ".", "get_submenu_items", "(", ")", ")", "return", "GroupMenuItem", "(", "self", ",", "self", ".", "get_menu_order", "(", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdminGroup.get_permissions_for_registration
Utilised by Wagtail's 'register_permissions' hook to allow permissions for a all models grouped by this class to be assigned to Groups in settings.
wagtailmodeladmin/options.py
def get_permissions_for_registration(self): """ Utilised by Wagtail's 'register_permissions' hook to allow permissions for a all models grouped by this class to be assigned to Groups in settings. """ qs = Permission.objects.none() for instance in self.modeladmin_i...
def get_permissions_for_registration(self): """ Utilised by Wagtail's 'register_permissions' hook to allow permissions for a all models grouped by this class to be assigned to Groups in settings. """ qs = Permission.objects.none() for instance in self.modeladmin_i...
[ "Utilised", "by", "Wagtail", "s", "register_permissions", "hook", "to", "allow", "permissions", "for", "a", "all", "models", "grouped", "by", "this", "class", "to", "be", "assigned", "to", "Groups", "in", "settings", "." ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L589-L598
[ "def", "get_permissions_for_registration", "(", "self", ")", ":", "qs", "=", "Permission", ".", "objects", ".", "none", "(", ")", "for", "instance", "in", "self", ".", "modeladmin_instances", ":", "qs", "=", "qs", "|", "instance", ".", "get_permissions_for_reg...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
ModelAdminGroup.get_admin_urls_for_registration
Utilised by Wagtail's 'register_admin_urls' hook to register urls for used by any associated ModelAdmin instances
wagtailmodeladmin/options.py
def get_admin_urls_for_registration(self): """ Utilised by Wagtail's 'register_admin_urls' hook to register urls for used by any associated ModelAdmin instances """ urls = [] for instance in self.modeladmin_instances: urls.extend(instance.get_admin_urls_for_re...
def get_admin_urls_for_registration(self): """ Utilised by Wagtail's 'register_admin_urls' hook to register urls for used by any associated ModelAdmin instances """ urls = [] for instance in self.modeladmin_instances: urls.extend(instance.get_admin_urls_for_re...
[ "Utilised", "by", "Wagtail", "s", "register_admin_urls", "hook", "to", "register", "urls", "for", "used", "by", "any", "associated", "ModelAdmin", "instances" ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/options.py#L600-L608
[ "def", "get_admin_urls_for_registration", "(", "self", ")", ":", "urls", "=", "[", "]", "for", "instance", "in", "self", ".", "modeladmin_instances", ":", "urls", ".", "extend", "(", "instance", ".", "get_admin_urls_for_registration", "(", ")", ")", "return", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
GroupMenuItem.is_shown
If there aren't any visible items in the submenu, don't bother to show this menu item
wagtailmodeladmin/menus.py
def is_shown(self, request): """ If there aren't any visible items in the submenu, don't bother to show this menu item """ for menuitem in self.menu._registered_menu_items: if menuitem.is_shown(request): return True return False
def is_shown(self, request): """ If there aren't any visible items in the submenu, don't bother to show this menu item """ for menuitem in self.menu._registered_menu_items: if menuitem.is_shown(request): return True return False
[ "If", "there", "aren", "t", "any", "visible", "items", "in", "the", "submenu", "don", "t", "bother", "to", "show", "this", "menu", "item" ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/menus.py#L34-L42
[ "def", "is_shown", "(", "self", ",", "request", ")", ":", "for", "menuitem", "in", "self", ".", "menu", ".", "_registered_menu_items", ":", "if", "menuitem", ".", "is_shown", "(", "request", ")", ":", "return", "True", "return", "False" ]
7fddc853bab2ff3868b8c7a03329308c55f16358
train
run
TEAL interface for the `acscteforwardmodel` function.
acstools/acscteforwardmodel.py
def run(configobj=None): """ TEAL interface for the `acscteforwardmodel` function. """ acscteforwardmodel(configobj['input'], exec_path=configobj['exec_path'], time_stamps=configobj['time_stamps'], verbose=configobj['verbose'], ...
def run(configobj=None): """ TEAL interface for the `acscteforwardmodel` function. """ acscteforwardmodel(configobj['input'], exec_path=configobj['exec_path'], time_stamps=configobj['time_stamps'], verbose=configobj['verbose'], ...
[ "TEAL", "interface", "for", "the", "acscteforwardmodel", "function", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acscteforwardmodel.py#L127-L138
[ "def", "run", "(", "configobj", "=", "None", ")", ":", "acscteforwardmodel", "(", "configobj", "[", "'input'", "]", ",", "exec_path", "=", "configobj", "[", "'exec_path'", "]", ",", "time_stamps", "=", "configobj", "[", "'time_stamps'", "]", ",", "verbose", ...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
run
TEAL interface for the `acsccd` function.
acstools/acsccd.py
def run(configobj=None): """ TEAL interface for the `acsccd` function. """ acsccd(configobj['input'], exec_path=configobj['exec_path'], time_stamps=configobj['time_stamps'], verbose=configobj['verbose'], quiet=configobj['quiet'] #, #dqicorr=config...
def run(configobj=None): """ TEAL interface for the `acsccd` function. """ acsccd(configobj['input'], exec_path=configobj['exec_path'], time_stamps=configobj['time_stamps'], verbose=configobj['verbose'], quiet=configobj['quiet'] #, #dqicorr=config...
[ "TEAL", "interface", "for", "the", "acsccd", "function", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acsccd.py#L134-L148
[ "def", "run", "(", "configobj", "=", "None", ")", ":", "acsccd", "(", "configobj", "[", "'input'", "]", ",", "exec_path", "=", "configobj", "[", "'exec_path'", "]", ",", "time_stamps", "=", "configobj", "[", "'time_stamps'", "]", ",", "verbose", "=", "co...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
destripe_plus
r"""Calibrate post-SM4 ACS/WFC exposure(s) and use standalone :ref:`acsdestripe`. This takes a RAW image and generates a FLT file containing its calibrated and destriped counterpart. If CTE correction is performed, FLC will also be present. Parameters ---------- inputfile : str or list of ...
acstools/acs_destripe_plus.py
def destripe_plus(inputfile, suffix='strp', stat='pmode1', maxiter=15, sigrej=2.0, lower=None, upper=None, binwidth=0.3, scimask1=None, scimask2=None, dqbits=None, rpt_clean=0, atol=0.01, cte_correct=True, clobber=False, verbose=True): r"""Cali...
def destripe_plus(inputfile, suffix='strp', stat='pmode1', maxiter=15, sigrej=2.0, lower=None, upper=None, binwidth=0.3, scimask1=None, scimask2=None, dqbits=None, rpt_clean=0, atol=0.01, cte_correct=True, clobber=False, verbose=True): r"""Cali...
[ "r", "Calibrate", "post", "-", "SM4", "ACS", "/", "WFC", "exposure", "(", "s", ")", "and", "use", "standalone", ":", "ref", ":", "acsdestripe", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acs_destripe_plus.py#L111-L498
[ "def", "destripe_plus", "(", "inputfile", ",", "suffix", "=", "'strp'", ",", "stat", "=", "'pmode1'", ",", "maxiter", "=", "15", ",", "sigrej", "=", "2.0", ",", "lower", "=", "None", ",", "upper", "=", "None", ",", "binwidth", "=", "0.3", ",", "scima...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
run
TEAL interface for :func:`destripe_plus`.
acstools/acs_destripe_plus.py
def run(configobj=None): """TEAL interface for :func:`destripe_plus`.""" destripe_plus( configobj['input'], suffix=configobj['suffix'], stat=configobj['stat'], maxiter=configobj['maxiter'], sigrej=configobj['sigrej'], lower=configobj['lower'], upper=config...
def run(configobj=None): """TEAL interface for :func:`destripe_plus`.""" destripe_plus( configobj['input'], suffix=configobj['suffix'], stat=configobj['stat'], maxiter=configobj['maxiter'], sigrej=configobj['sigrej'], lower=configobj['lower'], upper=config...
[ "TEAL", "interface", "for", ":", "func", ":", "destripe_plus", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acs_destripe_plus.py#L537-L555
[ "def", "run", "(", "configobj", "=", "None", ")", ":", "destripe_plus", "(", "configobj", "[", "'input'", "]", ",", "suffix", "=", "configobj", "[", "'suffix'", "]", ",", "stat", "=", "configobj", "[", "'stat'", "]", ",", "maxiter", "=", "configobj", "...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
main
Command line driver.
acstools/acs_destripe_plus.py
def main(): """Command line driver.""" import argparse # Parse input parameters parser = argparse.ArgumentParser( prog=__taskname__, description=( 'Run CALACS and standalone acs_destripe script on given post-SM4 ' 'ACS/WFC RAW full-frame or supported subarray ima...
def main(): """Command line driver.""" import argparse # Parse input parameters parser = argparse.ArgumentParser( prog=__taskname__, description=( 'Run CALACS and standalone acs_destripe script on given post-SM4 ' 'ACS/WFC RAW full-frame or supported subarray ima...
[ "Command", "line", "driver", "." ]
spacetelescope/acstools
python
https://github.com/spacetelescope/acstools/blob/bbf8dd080cefcbf88529ec87c420f9e1b8002554/acstools/acs_destripe_plus.py#L562-L636
[ "def", "main", "(", ")", ":", "import", "argparse", "# Parse input parameters", "parser", "=", "argparse", ".", "ArgumentParser", "(", "prog", "=", "__taskname__", ",", "description", "=", "(", "'Run CALACS and standalone acs_destripe script on given post-SM4 '", "'ACS/WF...
bbf8dd080cefcbf88529ec87c420f9e1b8002554
train
IndexView.get_search_results
Returns a tuple containing a queryset to implement the search, and a boolean indicating if the results may contain duplicates.
wagtailmodeladmin/views.py
def get_search_results(self, request, queryset, search_term): """ Returns a tuple containing a queryset to implement the search, and a boolean indicating if the results may contain duplicates. """ # Apply keyword searches. def construct_search(field_name): if ...
def get_search_results(self, request, queryset, search_term): """ Returns a tuple containing a queryset to implement the search, and a boolean indicating if the results may contain duplicates. """ # Apply keyword searches. def construct_search(field_name): if ...
[ "Returns", "a", "tuple", "containing", "a", "queryset", "to", "implement", "the", "search", "and", "a", "boolean", "indicating", "if", "the", "results", "may", "contain", "duplicates", "." ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/views.py#L297-L327
[ "def", "get_search_results", "(", "self", ",", "request", ",", "queryset", ",", "search_term", ")", ":", "# Apply keyword searches.", "def", "construct_search", "(", "field_name", ")", ":", "if", "field_name", ".", "startswith", "(", "'^'", ")", ":", "return", ...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
IndexView.get_filters_params
Returns all params except IGNORED_PARAMS
wagtailmodeladmin/views.py
def get_filters_params(self, params=None): """ Returns all params except IGNORED_PARAMS """ if not params: params = self.params lookup_params = params.copy() # a dictionary of the query string # Remove all the parameters that are globally and systematically ...
def get_filters_params(self, params=None): """ Returns all params except IGNORED_PARAMS """ if not params: params = self.params lookup_params = params.copy() # a dictionary of the query string # Remove all the parameters that are globally and systematically ...
[ "Returns", "all", "params", "except", "IGNORED_PARAMS" ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/views.py#L377-L389
[ "def", "get_filters_params", "(", "self", ",", "params", "=", "None", ")", ":", "if", "not", "params", ":", "params", "=", "self", ".", "params", "lookup_params", "=", "params", ".", "copy", "(", ")", "# a dictionary of the query string", "# Remove all the param...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
IndexView.get_ordering_field
Returns the proper model field name corresponding to the given field_name to use for ordering. field_name may either be the name of a proper model field or the name of a method (on the admin or model) or a callable with the 'admin_order_field' attribute. Returns None if no proper model f...
wagtailmodeladmin/views.py
def get_ordering_field(self, field_name): """ Returns the proper model field name corresponding to the given field_name to use for ordering. field_name may either be the name of a proper model field or the name of a method (on the admin or model) or a callable with the 'admin_ord...
def get_ordering_field(self, field_name): """ Returns the proper model field name corresponding to the given field_name to use for ordering. field_name may either be the name of a proper model field or the name of a method (on the admin or model) or a callable with the 'admin_ord...
[ "Returns", "the", "proper", "model", "field", "name", "corresponding", "to", "the", "given", "field_name", "to", "use", "for", "ordering", ".", "field_name", "may", "either", "be", "the", "name", "of", "a", "proper", "model", "field", "or", "the", "name", ...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/views.py#L494-L514
[ "def", "get_ordering_field", "(", "self", ",", "field_name", ")", ":", "try", ":", "field", "=", "self", ".", "opts", ".", "get_field", "(", "field_name", ")", "return", "field", ".", "name", "except", "FieldDoesNotExist", ":", "# See whether field_name is a nam...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
IndexView.get_ordering
Returns the list of ordering fields for the change list. First we check the get_ordering() method in model admin, then we check the object's default ordering. Then, any manually-specified ordering from the query string overrides anything. Finally, a deterministic order is guaranteed by e...
wagtailmodeladmin/views.py
def get_ordering(self, request, queryset): """ Returns the list of ordering fields for the change list. First we check the get_ordering() method in model admin, then we check the object's default ordering. Then, any manually-specified ordering from the query string overrides anyt...
def get_ordering(self, request, queryset): """ Returns the list of ordering fields for the change list. First we check the get_ordering() method in model admin, then we check the object's default ordering. Then, any manually-specified ordering from the query string overrides anyt...
[ "Returns", "the", "list", "of", "ordering", "fields", "for", "the", "change", "list", ".", "First", "we", "check", "the", "get_ordering", "()", "method", "in", "model", "admin", "then", "we", "check", "the", "object", "s", "default", "ordering", ".", "Then...
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/views.py#L516-L558
[ "def", "get_ordering", "(", "self", ",", "request", ",", "queryset", ")", ":", "params", "=", "self", ".", "params", "ordering", "=", "list", "(", "self", ".", "get_default_ordering", "(", "request", ")", ")", "if", "ORDER_VAR", "in", "params", ":", "# C...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
IndexView.get_ordering_field_columns
Returns an OrderedDict of ordering field column numbers and asc/desc
wagtailmodeladmin/views.py
def get_ordering_field_columns(self): """ Returns an OrderedDict of ordering field column numbers and asc/desc """ # We must cope with more than one column having the same underlying # sort field, so we base things on column numbers. ordering = self._get_default_ordering...
def get_ordering_field_columns(self): """ Returns an OrderedDict of ordering field column numbers and asc/desc """ # We must cope with more than one column having the same underlying # sort field, so we base things on column numbers. ordering = self._get_default_ordering...
[ "Returns", "an", "OrderedDict", "of", "ordering", "field", "column", "numbers", "and", "asc", "/", "desc" ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/views.py#L560-L591
[ "def", "get_ordering_field_columns", "(", "self", ")", ":", "# We must cope with more than one column having the same underlying", "# sort field, so we base things on column numbers.", "ordering", "=", "self", ".", "_get_default_ordering", "(", ")", "ordering_fields", "=", "Ordered...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
InspectView.get_field_label
Return a label to display for a field
wagtailmodeladmin/views.py
def get_field_label(self, field_name, field=None): """ Return a label to display for a field """ label = None if field is not None: label = getattr(field, 'verbose_name', None) if label is None: label = getattr(field, 'name', None) if label is None...
def get_field_label(self, field_name, field=None): """ Return a label to display for a field """ label = None if field is not None: label = getattr(field, 'verbose_name', None) if label is None: label = getattr(field, 'name', None) if label is None...
[ "Return", "a", "label", "to", "display", "for", "a", "field" ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/views.py#L732-L741
[ "def", "get_field_label", "(", "self", ",", "field_name", ",", "field", "=", "None", ")", ":", "label", "=", "None", "if", "field", "is", "not", "None", ":", "label", "=", "getattr", "(", "field", ",", "'verbose_name'", ",", "None", ")", "if", "label",...
7fddc853bab2ff3868b8c7a03329308c55f16358
train
InspectView.get_field_display_value
Return a display value for a field
wagtailmodeladmin/views.py
def get_field_display_value(self, field_name, field=None): """ Return a display value for a field """ """ Firstly, check for a 'get_fieldname_display' property/method on the model, and return the value of that, if present. """ val_funct = getattr(self.instance, 'get_%s_d...
def get_field_display_value(self, field_name, field=None): """ Return a display value for a field """ """ Firstly, check for a 'get_fieldname_display' property/method on the model, and return the value of that, if present. """ val_funct = getattr(self.instance, 'get_%s_d...
[ "Return", "a", "display", "value", "for", "a", "field" ]
rkhleics/wagtailmodeladmin
python
https://github.com/rkhleics/wagtailmodeladmin/blob/7fddc853bab2ff3868b8c7a03329308c55f16358/wagtailmodeladmin/views.py#L743-L784
[ "def", "get_field_display_value", "(", "self", ",", "field_name", ",", "field", "=", "None", ")", ":", "\"\"\"\n Firstly, check for a 'get_fieldname_display' property/method on\n the model, and return the value of that, if present.\n \"\"\"", "val_funct", "=", "get...
7fddc853bab2ff3868b8c7a03329308c55f16358