repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
scipy/scipy | scipy/optimize/_minimize.py | 1 | 44930 | """
Unified interfaces to minimization algorithms.
Functions
---------
- minimize : minimization of a function of several variables.
- minimize_scalar : minimization of a function of one variable.
"""
__all__ = ['minimize', 'minimize_scalar']
from warnings import warn
import numpy as np
# unconstrained minimizati... | bsd-3-clause | caf8da6473aa7f781ea3e6d83d53ba59 | 43.353406 | 89 | 0.614445 | 3.985276 | false | false | false | false |
scipy/scipy | scipy/special/__init__.py | 8 | 29005 | """
========================================
Special functions (:mod:`scipy.special`)
========================================
.. currentmodule:: scipy.special
Almost all of the functions below accept NumPy arrays as input
arguments as well as single numbers. This means they follow
broadcasting and automatic array-lo... | bsd-3-clause | b4fc7f8f8028f510f0c4ea7fde366988 | 39.852113 | 104 | 0.678124 | 3.753721 | false | false | false | false |
ellmetha/django-machina | machina/apps/forum/forms.py | 1 | 4255 | """
Forum forms
===========
This module defines forms provided by the ``forum`` application.
"""
from django import forms
from django.contrib.admin.widgets import ForeignKeyRawIdWidget
from django.forms.forms import NON_FIELD_ERRORS
from django.utils.translation import gettext_lazy as _
from mptt.forms i... | bsd-3-clause | 31d83b685042532b2e72e600bc0f6983 | 34.165289 | 99 | 0.617861 | 4.107143 | false | false | false | false |
ellmetha/django-machina | machina/apps/forum_conversation/migrations/0013_auto_20201220_1745.py | 1 | 1043 | # Generated by Django 3.1.2 on 2020-12-20 22:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum_conversation', '0012_auto_20200423_1049'),
]
operations = [
migrations.AlterField(
model_name='topic',
name='c... | bsd-3-clause | 6897f7e0135b211ee996637f5d128f50 | 31.59375 | 112 | 0.584851 | 3.965779 | false | false | false | false |
ellmetha/django-machina | machina/templatetags/forum_tags.py | 1 | 2609 | from django import template
from django.utils.safestring import mark_safe
from machina.core.db.models import get_model
from machina.core.loading import get_class
Forum = get_model('forum', 'Forum')
PermissionHandler = get_class('forum_permission.handler', 'PermissionHandler')
TrackingHandler = get_class('forum_trac... | bsd-3-clause | abb13174a37ccca560d045c15a8e70b4 | 31.6125 | 96 | 0.68187 | 3.859467 | false | false | false | false |
ellmetha/django-machina | machina/apps/forum_tracking/urls.py | 1 | 1597 | """
Forum tracking URLs
===================
This module defines URL patterns associated with the django-machina's ``forum_tracking``
application.
"""
from django.urls import path
from machina.core.loading import get_class
from machina.core.urls import URLPatternsFactory
class ForumTrackingURLPatte... | bsd-3-clause | 93cad08ef959ef1be6384d73cc48623b | 30.313725 | 92 | 0.574202 | 4.148052 | false | false | false | false |
statsmodels/statsmodels | statsmodels/multivariate/factor_rotation/_analytic_rotation.py | 6 | 4008 | # -*- coding: utf-8 -*-
"""
This file contains analytic implementations of rotation methods.
"""
import numpy as np
import scipy as sp
def target_rotation(A, H, full_rank=False):
r"""
Analytically performs orthogonal rotations towards a target matrix,
i.e., we minimize:
.. math::
\phi(L) =\f... | bsd-3-clause | 6896d2ff22df150682db05e762d13281 | 25.196078 | 78 | 0.612525 | 3.458154 | false | false | false | false |
statsmodels/statsmodels | statsmodels/discrete/tests/results/results_predict.py | 3 | 11609 | """This file has been manually edited based on the generated results
edits
- rearrange Bunch
- use DataFrame
note seond `_cons` in params_table rownames is lnalpha
"""
# flake8: noqa
import numpy as np
import pandas as pd
from statsmodels.tools.testing import ParamsTableTestBunch
est = dict(
rank = 9,
... | bsd-3-clause | 4e43b83b287066ce2cd555c7bc3862e8 | 44.885375 | 105 | 0.596692 | 2.599418 | false | false | true | false |
statsmodels/statsmodels | statsmodels/examples/es_misc_poisson2.py | 3 | 1895 |
import numpy as np
import statsmodels.api as sm
from statsmodels.miscmodels.count import (PoissonGMLE, PoissonOffsetGMLE,
PoissonZiGMLE)
from statsmodels.discrete.discrete_model import Poisson
DEC = 3
class Dummy:
pass
self = Dummy()
# generate artificial data
np.ran... | bsd-3-clause | 8f404d71db6c769c1456eb324d84c72d | 29.564516 | 84 | 0.701319 | 2.654062 | false | false | false | false |
statsmodels/statsmodels | statsmodels/datasets/sunspots/data.py | 3 | 1535 | """Yearly sunspots data 1700-2008"""
from statsmodels.datasets import utils as du
__docformat__ = 'restructuredtext'
COPYRIGHT = """This data is public domain."""
TITLE = __doc__
SOURCE = """
http://www.ngdc.noaa.gov/stp/solar/solarda3.html
The original dataset contains monthly data on sunspot activity ... | bsd-3-clause | 7da306b3b37e490f838a60526e72dad2 | 24.583333 | 74 | 0.657329 | 3.586449 | false | false | false | false |
statsmodels/statsmodels | statsmodels/datasets/fair/data.py | 3 | 2491 | """Fair's Extramarital Affairs Data"""
from statsmodels.datasets import utils as du
__docformat__ = 'restructuredtext'
COPYRIGHT = """Included with permission of the author."""
TITLE = """Affairs dataset"""
SOURCE = """
Fair, Ray. 1978. "A Theory of Extramarital Affairs," `Journal of Political
Economy`, ... | bsd-3-clause | c27e0b5961642d1dcbc761fc3608ff5e | 34.084507 | 79 | 0.600161 | 3.838213 | false | false | false | false |
statsmodels/statsmodels | statsmodels/stats/meta_analysis.py | 3 | 26580 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 2 14:34:25 2020
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
import pandas as pd
from scipy import stats
from statsmodels.stats.base import HolderTuple
class CombineResults:
"""Results from combined estimate of means or effect sizes
This cur... | bsd-3-clause | fd2f24b5b25d9a24fd28a2bd525c3c23 | 34.15873 | 79 | 0.583371 | 3.712291 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/tests/results/arima112_results.py | 6 | 27176 | import numpy as np
from statsmodels.tools.tools import Bunch
llf = np.array([-245.40783909604])
nobs = np.array([202])
k = np.array([5])
k_exog = np.array([1])
sigma = np.array([.8100467417583])
chi2 = np.array([2153.20304012])
df_model = np.array([3])
k_ar = np.array([1])
k_ma = np.array([2])
params = np.ar... | bsd-3-clause | beae8f5a71009724cd882704eeebc3fb | 19.66616 | 41 | 0.655873 | 2.338525 | false | false | true | false |
statsmodels/statsmodels | statsmodels/discrete/discrete_margins.py | 3 | 26628 | #Splitting out maringal effects to see if they can be generalized
from statsmodels.compat.python import lzip
import numpy as np
from scipy.stats import norm
from statsmodels.tools.decorators import cache_readonly
#### margeff helper functions ####
#NOTE: todo marginal effects for group 2
# group 2 oprobit, ologit, go... | bsd-3-clause | 7176ecfc0d7db041cd978277e79bd348 | 35.377049 | 83 | 0.560162 | 3.887299 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/arima/estimators/innovations.py | 3 | 9666 | """
Innovations algorithm for MA(q) and SARIMA(p,d,q)x(P,D,Q,s) model parameters.
Author: Chad Fulton
License: BSD-3
"""
import warnings
import numpy as np
from scipy.optimize import minimize
from statsmodels.tools.tools import Bunch
from statsmodels.tsa.innovations import arma_innovations
from statsmodels.tsa.statto... | bsd-3-clause | 78b88de84be26c0d749be75847710081 | 37.50996 | 79 | 0.645251 | 3.897581 | false | false | false | false |
statsmodels/statsmodels | statsmodels/miscmodels/tests/results/results_ordinal_model.py | 4 | 5453 | """
Test Results for ordinal models from R MASS lib
"""
import numpy as np
import os
import pandas as pd
from statsmodels.tools.testing import Holder
# R (v3.4.4) code inspired from
# https://stats.idre.ucla.edu/r/dae/ordinal-logistic-regression/
# library(readr) # to open the file
# library(MASS) # to perform ordina... | bsd-3-clause | 267fc1198190f810fdc96ca380314aa6 | 43.696721 | 79 | 0.591234 | 2.67173 | false | false | false | false |
statsmodels/statsmodels | statsmodels/genmod/families/tests/test_link.py | 3 | 6190 | """
Test functions for genmod.families.links
"""
import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_array_less
from scipy import stats
import pytest
import statsmodels.genmod.families as families
from statsmodels.tools import numdiff as nd
# Family instances
links = families.links
logi... | bsd-3-clause | 6d43977543c8bcb2d23c9b24742f2ed2 | 31.408377 | 76 | 0.611955 | 3.035802 | false | true | false | false |
statsmodels/statsmodels | statsmodels/sandbox/examples/example_sysreg.py | 3 | 8058 | """Example: statsmodels.sandbox.sysreg
"""
#TODO: this is going to change significantly once we have a panel data structure
from statsmodels.compat.python import asbytes, lmap
import numpy as np
import statsmodels.api as sm
from statsmodels.sandbox.regression.gmm import IV2SLS
from statsmodels.sandbox.sysreg import S... | bsd-3-clause | 5d993fd49a53f57eb5e9a746fd612c32 | 37.555024 | 102 | 0.69521 | 3.06155 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/arima/estimators/statespace.py | 6 | 4950 | """
State space approach to estimating SARIMAX models.
Author: Chad Fulton
License: BSD-3
"""
import numpy as np
from statsmodels.tools.tools import add_constant, Bunch
from statsmodels.tsa.statespace.sarimax import SARIMAX
from statsmodels.tsa.arima.specification import SARIMAXSpecification
from statsmodels.tsa.ari... | bsd-3-clause | 67d1b21ddabc84af931744a91b55cb78 | 39.57377 | 79 | 0.671919 | 4.044118 | false | false | false | false |
statsmodels/statsmodels | statsmodels/sandbox/nonparametric/kernels.py | 3 | 19776 | # -*- coding: utf-8 -*-
"""
This models contains the Kernels for Kernel smoothing.
Hopefully in the future they may be reused/extended for other kernel based
method
References:
----------
Pointwise Kernel Confidence Bounds
(smoothconf)
http://fedc.wiwi.hu-berlin.de/xplore/ebooks/html/anr/anrhtmlframe62.html
"""
# ... | bsd-3-clause | 496a1e070feb5ec6ae12eae841d9e478 | 33.214533 | 93 | 0.535042 | 3.729913 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/statespace/tests/test_pickle.py | 6 | 5110 | """
Tests for python wrapper of state space representation and filtering
Author: Chad Fulton
License: Simplified-BSD
References
----------
Kim, Chang-Jin, and Charles R. Nelson. 1999.
"State-Space Models with Regime Switching:
Classical and Gibbs-Sampling Approaches with Applications".
MIT Press Books. The MIT Press... | bsd-3-clause | 3d011abb4c6091f74e2ec4d944c02fa7 | 32.84106 | 77 | 0.647162 | 3.07646 | false | true | false | false |
statsmodels/statsmodels | statsmodels/examples/tsa/ar1cholesky.py | 6 | 1041 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 21 15:42:18 2010
Author: josef-pktd
"""
import numpy as np
from scipy import linalg
def tiny2zero(x, eps = 1e-15):
'''replace abs values smaller than eps by zero, makes copy
'''
mask = np.abs(x.copy()) < eps
x[mask] = 0
return x
nobs = 5
autocov =... | bsd-3-clause | ce14f761da84d543c4c73b4bd1b362f7 | 23.785714 | 70 | 0.636888 | 2.502404 | false | false | false | false |
statsmodels/statsmodels | statsmodels/sandbox/distributions/extras.py | 3 | 38846 | '''Various extensions to distributions
* skew normal and skew t distribution by Azzalini, A. & Capitanio, A.
* Gram-Charlier expansion distribution (using 4 moments),
* distributions based on non-linear transformation
- Transf_gen
- ExpTransf_gen, LogTransf_gen
- TransfTwo_gen
(defines as examples: square, n... | bsd-3-clause | b865b0a31cfc9b9a2879bb65924a6cae | 33.165347 | 105 | 0.614066 | 3.343029 | false | false | false | false |
statsmodels/statsmodels | statsmodels/miscmodels/tmodel.py | 2 | 7295 | """Linear Model with Student-t distributed errors
Because the t distribution has fatter tails than the normal distribution, it
can be used to model observations with heavier tails and observations that have
some outliers. For the latter case, the t-distribution provides more robust
estimators for mean or mean paramete... | bsd-3-clause | 93c78ddd4594dc2b691c5072c8c44380 | 30.580087 | 107 | 0.602879 | 3.817373 | false | false | false | false |
statsmodels/statsmodels | docs/source/plots/graphics_mosaicplot_mosaic.py | 17 | 1943 | # -*- coding: utf-8 -*-
from itertools import product
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from statsmodels.graphics.mosaicplot import mosaic
# The most simple use case is to take a dictionary and plot the result
data = {'a': 10, 'b': 15, 'c': 16}
mosaic(data, title='basic dictionar... | bsd-3-clause | 9d0b18f002c44adb0c033946afe3ec6a | 31.932203 | 79 | 0.67473 | 3.138934 | false | false | false | false |
statsmodels/statsmodels | statsmodels/sandbox/datarich/factormodels.py | 3 | 6854 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 14 08:21:41 2010
Author: josef-pktd
License: BSD (3-clause)
"""
import numpy as np
import statsmodels.api as sm
from statsmodels.sandbox.tools import pca
from statsmodels.sandbox.tools.cross_val import LeaveOneOut
#converting example Principal Component Regression to a ... | bsd-3-clause | 58091dd7da530eea41f121161498322e | 35.652406 | 91 | 0.55194 | 3.47038 | false | false | false | false |
statsmodels/statsmodels | statsmodels/graphics/tukeyplot.py | 3 | 2392 | import matplotlib.lines as lines
import matplotlib.pyplot as plt
import numpy as np
def tukeyplot(results, dim=None, yticklabels=None):
npairs = len(results)
fig = plt.figure()
fsp = fig.add_subplot(111)
fsp.axis([-50,50,0.5,10.5])
fsp.set_title('95 % family-wise confidence level')
fsp.title.... | bsd-3-clause | e2fd9e9274ea51de322ac211019be9aa | 30.893333 | 82 | 0.599916 | 2.724374 | false | false | false | false |
statsmodels/statsmodels | statsmodels/examples/ex_feasible_gls_het.py | 6 | 4220 | # -*- coding: utf-8 -*-
"""Examples for linear model with heteroscedasticity estimated by feasible GLS
These are examples to check the results during development.
The assumptions:
We have a linear model y = X*beta where the variance of an observation depends
on some explanatory variable Z (`exog_var`).
linear_model.... | bsd-3-clause | 89fc6de584dda2aea196dc3ee832ce05 | 33.308943 | 94 | 0.651896 | 2.944871 | false | false | false | false |
statsmodels/statsmodels | statsmodels/sandbox/nonparametric/kde2.py | 3 | 3192 | # -*- coding: utf-8 -*-
from statsmodels.compat.python import lzip
import numpy as np
from statsmodels.tools.validation import array_like
from . import kernels
#TODO: should this be a function?
class KDE:
"""
Kernel Density Estimator
Parameters
----------
x : array_like
N-dimensional ar... | bsd-3-clause | 6c0196547828c51cd336ec832a0c14da | 26.756522 | 90 | 0.577068 | 2.891304 | false | false | false | false |
statsmodels/statsmodels | examples/incomplete/glsar.py | 6 | 4706 | """
Generalized Least Squares with AR Errors
6 examples for GLSAR with artificial data
"""
# .. note: These examples were written mostly to cross-check results. It is
# still being written, and GLSAR is still being worked on.
import numpy as np
import numpy.testing as npt
from scipy import signal
import statsmo... | bsd-3-clause | 147a764f2bb78b59d6ed3bfea6d33a59 | 29.75817 | 76 | 0.634509 | 2.857316 | false | true | false | false |
statsmodels/statsmodels | statsmodels/stats/contingency_tables.py | 3 | 44260 | """
Methods for analyzing two-way contingency tables (i.e. frequency
tables for observations that are cross-classified with respect to two
categorical variables).
The main classes are:
* Table : implements methods that can be applied to any two-way
contingency table.
* SquareTable : implements methods that can... | bsd-3-clause | 4d4f232dbce492d2a09f2c97f89e245c | 29.92942 | 79 | 0.559218 | 3.895098 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/statespace/kalman_smoother.py | 3 | 75873 | """
State Space Representation and Kalman Filter, Smoother
Author: Chad Fulton
License: Simplified-BSD
"""
import numpy as np
from types import SimpleNamespace
from statsmodels.tsa.statespace.representation import OptionWrapper
from statsmodels.tsa.statespace.kalman_filter import (KalmanFilter,
... | bsd-3-clause | 5a35a23b2c9fe047603a03ab35ebac0a | 42.330097 | 79 | 0.580683 | 4.174011 | false | false | false | false |
statsmodels/statsmodels | statsmodels/discrete/discrete_model.py | 1 | 197877 | """
Limited dependent variable and qualitative variables.
Includes binary outcomes, count data, (ordered) ordinal data and limited
dependent variables.
General References
--------------------
A.C. Cameron and P.K. Trivedi. `Regression Analysis of Count Data`.
Cambridge, 1998
G.S. Madalla. `Limited-Dependent an... | bsd-3-clause | 3fe921ab2960276cd2b862ad44204351 | 34.259622 | 401 | 0.541094 | 3.948222 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/ardl/pss_critical_values.py | 3 | 22444 | #!/usr/bin/env python
# coding: utf-8
"""
Critical value polynomials and related quantities for the bounds test of
Pesaran, M. H., Shin, Y., & Smith, R. J. (2001). Bounds testing approaches
to the analysis of level relationships. Journal of applied econometrics,
16(3), 289-326.
These were computed using 32,000... | bsd-3-clause | bb4764ff697ab2f46e9113d1fc021e69 | 48.545254 | 78 | 0.569952 | 2.066667 | false | false | false | false |
statsmodels/statsmodels | statsmodels/distributions/bernstein.py | 3 | 7397 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 17 15:35:23 2021
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import stats
from statsmodels.tools.decorators import cache_readonly
from statsmodels.distributions.tools import (
_Grid, cdf2prob_grid, prob2cdf_grid,
_eval_bernst... | bsd-3-clause | b602d611ff16ae4994e02a9da133bb92 | 31.585903 | 78 | 0.567122 | 3.96622 | false | false | false | false |
statsmodels/statsmodels | statsmodels/sandbox/examples/thirdparty/findow_1.py | 6 | 2569 | # -*- coding: utf-8 -*-
"""A quick look at volatility of stock returns for 2009
Just an exercise to find my way around the pandas methods.
Shows the daily rate of return, the square of it (volatility) and
a 5 day moving average of the volatility.
No guarantee for correctness.
Assumes no missing values.
colors of lines... | bsd-3-clause | bfe8d89aba42efc4661399f06816d792 | 26.623656 | 82 | 0.678474 | 3.036643 | false | false | false | false |
statsmodels/statsmodels | statsmodels/regression/tests/results/results_grunfeld_ols_robust_cluster.py | 6 | 23552 | import numpy as np
from statsmodels.tools.testing import ParamsTableTestBunch
est = dict(
N_clust=10,
N=200,
df_m=2,
df_r=9,
F=51.59060716590177,
r2=.8124080178314147,
rmse=94.40840193979599,
mss=7604093.484267689,
rss=1755850.432294737,
r2_a=.8105035307027997,
ll=-1191.80... | bsd-3-clause | ccf4b17b838e859f694e48ec01895e3e | 27.827417 | 107 | 0.654254 | 2.531384 | false | false | false | false |
statsmodels/statsmodels | statsmodels/base/l1_slsqp.py | 6 | 5604 | """
Holds files for l1 regularization of LikelihoodModel, using
scipy.optimize.slsqp
"""
import numpy as np
from scipy.optimize import fmin_slsqp
import statsmodels.base.l1_solvers_common as l1_solvers_common
def fit_l1_slsqp(
f, score, start_params, args, kwargs, disp=False, maxiter=1000,
callback=No... | bsd-3-clause | b39c7652ad07f4f45637132831d2f435 | 32.357143 | 78 | 0.62384 | 3.277193 | false | false | false | false |
statsmodels/statsmodels | statsmodels/distributions/copula/elliptical.py | 3 | 8894 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 19:19:45 2021
Author: Josef Perktold
Author: Pamphile Roy
License: BSD-3
"""
import numpy as np
from scipy import stats
# scipy compat:
from statsmodels.compat.scipy import multivariate_t
from statsmodels.distributions.copula.copulas import Copula
class EllipticalC... | bsd-3-clause | d17a4955f8ff5d26a7d2a12db188b0f1 | 30.207018 | 79 | 0.60018 | 4.020796 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/statespace/dynamic_factor_mq.py | 3 | 195420 | # -*- coding: utf-8 -*-
"""
Dynamic factor model.
Author: Chad Fulton
License: BSD-3
"""
from collections import OrderedDict
from warnings import warn
import numpy as np
import pandas as pd
from scipy.linalg import cho_factor, cho_solve, LinAlgError
from statsmodels.tools.data import _is_using_pandas
from statsmodel... | bsd-3-clause | d5132c6a92012ac2da1f1a4e461a81ec | 44.392102 | 79 | 0.572889 | 4.234393 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/statespace/tests/results/results_varmax.py | 7 | 8709 | """
Results for VARMAX tests
Results from Stata using script `test_varmax_stata.do`.
See also Stata time series documentation, in particular `dfactor`.
Data from:
http://www.jmulti.de/download/datasets/e1.dat
Author: Chad Fulton
License: Simplified-BSD
"""
# See http://www.jmulti.de/download/datasets/e1.dat
# 1960... | bsd-3-clause | d834e61af559afa3c1afe84d6ef83eb5 | 36.217949 | 79 | 0.523711 | 2.449789 | false | false | false | false |
statsmodels/statsmodels | statsmodels/tsa/vector_ar/var_model.py | 3 | 76840 | # -*- coding: utf-8 -*-
"""
Vector Autoregression (VAR) processes
References
----------
Lütkepohl (2005) New Introduction to Multiple Time Series Analysis
"""
from __future__ import annotations
from statsmodels.compat.python import lrange
from collections import defaultdict
from io import StringIO
import numpy as n... | bsd-3-clause | 6b435c8ff8392b5b7bfe12498034f52f | 29.800321 | 103 | 0.543454 | 3.720083 | false | false | false | false |
statsmodels/statsmodels | statsmodels/distributions/copula/depfunc_ev.py | 3 | 9244 | # -*- coding: utf-8 -*-
""" Pickand's dependence functions as generators for EV-copulas
Created on Wed Jan 27 14:33:40 2021
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import stats
from statsmodels.tools.numdiff import _approx_fprime_cs_scalar, approx_hess
class PickandDependence:
... | bsd-3-clause | f43df8d2b50f2b45f688608ed92ba8c3 | 27.072948 | 79 | 0.484517 | 2.862101 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/kombu/tests/utilities/test_encoding.py | 2 | 2306 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
import sys
from contextlib import contextmanager
from mock import patch
from nose import SkipTest
from kombu.utils.encoding import safe_str
from kombu.tests.utils import TestCase
@contextmanager
def clean_encoding... | bsd-3-clause | e4072f5ae41d1351e334c923e3b06b91 | 26.722892 | 65 | 0.632768 | 3.73539 | false | true | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/security/certificate.py | 1 | 2549 | # -*- coding: utf-8 -*-
"""
celery.security.certificate
~~~~~~~~~~~~~~~~~~~~~~~~~~~
X.509 certificates.
"""
from __future__ import absolute_import
from __future__ import with_statement
import glob
import os
from celery.exceptions import SecurityError
from .utils import crypto, reraise_errors
class Ce... | bsd-3-clause | f2815940c0c71685ac66912e1cb9e9a1 | 27.965909 | 75 | 0.570027 | 4.151466 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/djcelery/managers.py | 3 | 7647 | from __future__ import absolute_import
import warnings
from functools import wraps
from itertools import count
from django.db import transaction, connection
try:
from django.db import connections, router
except ImportError: # pre-Django 1.2
connections = router = None # noqa
from django.db import models
f... | bsd-3-clause | 5c03cadbbc56791fe1b72e039b923f0c | 31.540426 | 79 | 0.596705 | 4.464098 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/billiard/heap.py | 1 | 8005 | #
# Module which supports allocation of memory from an mmap
#
# multiprocessing/heap.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
import bisect
import mmap
import os
import sys
import threading
import itertools
from ._ext import _b... | bsd-3-clause | 776b83da6ee746794233c7e2fe6f6df9 | 30.515748 | 79 | 0.5604 | 3.904878 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/djcelery/models.py | 3 | 13390 | from __future__ import absolute_import
from datetime import datetime, timedelta
from time import time, mktime
from django.core.exceptions import MultipleObjectsReturned, ValidationError
from django.db import models
from django.db.models import signals
from django.utils.translation import ugettext_lazy as _
from cele... | bsd-3-clause | 9ac436b05e425346b2b455f7c480b91a | 37.699422 | 78 | 0.558252 | 4.185683 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/backends/database/a805d4bd.py | 1 | 2292 | # -*- coding: utf-8 -*-
"""
celery.backends.database.a805d4bd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module fixes a bug with pickling and relative imports in Python < 2.6.
The problem is with pickling an e.g. `exceptions.KeyError` instance.
As SQLAlchemy has its own `exceptions` module, pickle wil... | bsd-3-clause | 57d248392a70cff8da0fa761f06317e1 | 31.28169 | 79 | 0.602531 | 4.459144 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/utils/imports.py | 1 | 2531 | # -*- coding: utf-8 -*-
"""
celery.utils.import
~~~~~~~~~~~~~~~~~~~
Utilities related to importing modules and symbols by name.
"""
from __future__ import absolute_import
from __future__ import with_statement
import imp as _imp
import importlib
import os
import sys
from contextlib import contextmanager
... | bsd-3-clause | 3973729b528b7f4c82a5c8695b55598a | 22.435185 | 70 | 0.576057 | 3.930124 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/concurrency/base.py | 1 | 3738 | # -*- coding: utf-8 -*-
"""
celery.concurrency.base
~~~~~~~~~~~~~~~~~~~~~~~
TaskPool interface.
"""
from __future__ import absolute_import
import logging
import os
import time
from kombu.utils.encoding import safe_repr
from celery.utils import timer2
from celery.utils.log import get_logger
logger = ge... | bsd-3-clause | 8050cc4b7c84b7972fe34a4c1e889408 | 21.792683 | 72 | 0.582665 | 4.036717 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/tests/tasks/test_canvas.py | 1 | 5372 | from __future__ import absolute_import
from __future__ import with_statement
from mock import Mock
from celery import current_app, task
from celery.canvas import Signature, chain, group, chord, subtask
from celery.result import EagerResult
from celery.tests.utils import Case
SIG = Signature({'task': 'TASK',
... | bsd-3-clause | 008cc8c1759b7030b6fdce08bdaf0252 | 28.516484 | 76 | 0.561057 | 3.247884 | false | true | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/worker/bootsteps.py | 1 | 6204 | # -*- coding: utf-8 -*-
"""
celery.worker.bootsteps
~~~~~~~~~~~~~~~~~~~~~~~
The boot-step components.
"""
from __future__ import absolute_import
from collections import defaultdict
from importlib import import_module
from celery.datastructures import DependencyGraph
from celery.utils.imports import inst... | bsd-3-clause | 215ca4275a590918a339cd35af9b8d8b | 28.402844 | 79 | 0.607672 | 4.431429 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/requests/packages/charade/sjisprober.py | 169 | 3825 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
... | bsd-3-clause | bcdedddca44563fe6584b24b86c778ee | 40.032967 | 78 | 0.588235 | 4.602888 | false | false | false | false |
conda-forge/conda-forge.github.io | scripts/update_teams.py | 1 | 4482 | #!/usr/bin/env conda-execute
# conda execute
# env:
# - python 2.7.*
# - conda-smithy
# - pygithub 1.*
# - six
# - conda-build
# channels:
# - conda-forge
# run_with: python
from __future__ import print_function
import argparse
import collections
import os
import six
from github import Github
import github
im... | bsd-3-clause | dadb19cb338404b9d9c1a297f5cb0c33 | 35.737705 | 129 | 0.640116 | 3.691928 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/kombu/tests/test_serialization.py | 2 | 9679 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
import sys
from kombu.serialization import (registry, register, SerializerNotInstalled,
raw_encode, register_yaml, register_msgpack,
... | bsd-3-clause | 637aa429d2fa47c12028d291dec385d5 | 38.329268 | 78 | 0.534987 | 4.334677 | false | true | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/states.py | 1 | 2809 | # -*- coding: utf-8 -*-
"""
celery.states
=============
Built-in task states.
.. _states:
States
------
See :ref:`task-states`.
.. _statesets:
Sets
----
.. state:: READY_STATES
READY_STATES
~~~~~~~~~~~~
Set of states meaning the task result is ready (has been executed).
.. state:: UNREADY_STATES
UNREADY_STAT... | bsd-3-clause | 70716e6476b63792c988609dc08385de | 19.50365 | 75 | 0.61303 | 3.735372 | false | false | false | false |
mozilla/firefox-flicks | flicks/users/migrations/0001_initial.py | 1 | 4435 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserProfile'
db.create_table('users_userprofile', (
('id', self.gf('django.db.mo... | bsd-3-clause | 6f4a1da6ea9162f821e93f938a0712a6 | 62.371429 | 182 | 0.55761 | 3.764856 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/basket/base.py | 1 | 3662 | import json
import os
try:
from django.conf import settings
except (ImportError, AttributeError):
settings = None
import requests
BASKET_URL = getattr(settings, 'BASKET_URL',
os.getenv('BASKET_URL', 'http://localhost:8000'))
class BasketException(Exception):
pass
def basket_url(... | bsd-3-clause | 410cb6408e9a5a13563744a4dfe48a09 | 29.016393 | 73 | 0.626707 | 4.119235 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/djcelery/admin.py | 2 | 10765 | from __future__ import absolute_import
from __future__ import with_statement
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.views import main as main_views
from django.shortcuts import render_to_response
from... | bsd-3-clause | 69699ee026e547ef3d0d6bfcb14e01d5 | 34.76412 | 78 | 0.579006 | 4.226541 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/signals.py | 1 | 1818 | # -*- coding: utf-8 -*-
"""
celery.signals
~~~~~~~~~~~~~~
This module defines the signals (Observer pattern) sent by
both workers and clients.
Functions can be connected to these signals, and connected
functions are called whenever a signal is called.
See :ref:`signals` for more informati... | bsd-3-clause | 1c562be0494d4b6c31f119304bce5642 | 40.318182 | 74 | 0.688119 | 3.456274 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/kombu/transport/mongodb.py | 2 | 7541 | """
kombu.transport.mongodb
=======================
MongoDB transport.
:copyright: (c) 2010 - 2012 by Flavio Percoco Premoli.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from Queue import Empty
import pymongo
from pymongo import errors
from anyjson import loads, dumps
f... | bsd-3-clause | 831c35b8402e0b8a52caedc50ce32cfe | 33.122172 | 78 | 0.554701 | 4.306682 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/kombu/transport/beanstalk.py | 2 | 3772 | """
kombu.transport.beanstalk
=========================
Beanstalk transport.
:copyright: (c) 2010 - 2012 by David Ziegler.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import beanstalkc
import socket
from anyjson import loads, dumps
from Queue import Empty
from kombu.exc... | bsd-3-clause | 180954b286483fa9dafe9c8edd1f3152 | 25.194444 | 69 | 0.552492 | 4.163355 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/utils/mail.py | 1 | 5402 | # -*- coding: utf-8 -*-
"""
celery.utils.mail
~~~~~~~~~~~~~~~~~
How task error emails are formatted and sent.
"""
from __future__ import absolute_import
import sys
import smtplib
import socket
import traceback
import warnings
from email.mime.text import MIMEText
from .functional import maybe_list
from ... | bsd-3-clause | 64a7e4166c80bbfdd7af3157984165ef | 26.01 | 75 | 0.585894 | 4.076981 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/kombu/entity.py | 2 | 25059 | """
kombu.entity
================
Exchange and Queue declarations.
"""
from __future__ import absolute_import
from .abstract import MaybeChannelBound
TRANSIENT_DELIVERY_MODE = 1
PERSISTENT_DELIVERY_MODE = 2
DELIVERY_MODES = {'transient': TRANSIENT_DELIVERY_MODE,
'persistent': PERSISTENT_DELIVERY_M... | bsd-3-clause | 0dadd86888c72ed20b7601400f9e45f2 | 35.960177 | 78 | 0.556726 | 4.755028 | false | false | false | false |
mozilla/firefox-flicks | flicks/base/helpers.py | 1 | 1424 | import json as json_mod
from django.utils.translation import get_language
from babel.core import Locale, UnknownLocaleError
from babel.dates import format_date
from jingo import register
from product_details import product_details
from flicks.base import regions
from flicks.base.util import absolutify as real_absolu... | bsd-3-clause | ccaff30fcd0f82ca34ce02b7acad3c57 | 23.135593 | 79 | 0.692416 | 3.660668 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/datastructures.py | 1 | 12131 | # -*- coding: utf-8 -*-
"""
celery.datastructures
~~~~~~~~~~~~~~~~~~~~~
Custom types and data structures.
"""
from __future__ import absolute_import
from __future__ import with_statement
import sys
import time
from collections import defaultdict
from itertools import chain
from billiard.einfo import Ex... | bsd-3-clause | 0072ccf3dd756a175db7cd451ae1f0c0 | 25.544858 | 79 | 0.542247 | 4.098311 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/app/amqp.py | 1 | 14390 | # -*- coding: utf-8 -*-
"""
celery.app.amqp
~~~~~~~~~~~~~~~
Sending and receiving messages using Kombu.
"""
from __future__ import absolute_import
from datetime import timedelta
from weakref import WeakValueDictionary
from kombu import Connection, Consumer, Exchange, Producer, Queue
from kombu.common im... | bsd-3-clause | bcff9659f1ff53bea640519964d809ff | 34.875312 | 79 | 0.579174 | 4.207663 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/bin/celeryd.py | 1 | 6626 | # -*- coding: utf-8 -*-
"""
The :program:`celery worker` command (previously known as ``celeryd``)
.. program:: celery worker
.. seealso::
See :ref:`preload-options`.
.. cmdoption:: -c, --concurrency
Number of child processes processing the queue. The default
is the number of CPUs available on your sy... | bsd-3-clause | 2bb02216db75d520b08d81ca31d73ff3 | 31.165049 | 79 | 0.613945 | 4.010896 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/djcelery/backends/database.py | 3 | 1934 | from __future__ import absolute_import
from celery import current_app
from celery.backends.base import BaseDictBackend
from celery.utils.timeutils import maybe_timedelta
from ..models import TaskMeta, TaskSetMeta
class DatabaseBackend(BaseDictBackend):
"""The database backend.
Using Django models to store ... | bsd-3-clause | 93663a4dd2dc4043207274310b48429d | 32.344828 | 79 | 0.664943 | 3.95501 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/requests/auth.py | 15 | 5258 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import time
import hashlib
import logging
from base64 import b64encode
from .compat import urlparse, str
from .utils import parse_dict_header
log = logging.getLogger(__name__)
CON... | bsd-3-clause | 242dd681fde61f57715253f7f85a9e8b | 30.297619 | 107 | 0.559338 | 3.726435 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/billiard/queues.py | 1 | 10800 | #
# Module implementing queues
#
# multiprocessing/queues.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
from __future__ import with_statement
__all__ = ['Queue', 'SimpleQueue', 'JoinableQueue']
import sys
import os
import threading
... | bsd-3-clause | 896f6290a5ef033f5ff00629f5f3d785 | 29.594901 | 78 | 0.5325 | 4.390244 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/celery/app/utils.py | 1 | 4998 | # -*- coding: utf-8 -*-
"""
celery.app.utils
~~~~~~~~~~~~~~~~
App utilities: Compat settings, bugreport tool, pickling apps.
"""
from __future__ import absolute_import
import os
import platform as _platform
from celery import datastructures
from celery import platforms
from celery.utils.text import pret... | bsd-3-clause | 5f99ee4b8fc65e04565b029d91c626d0 | 30.2375 | 77 | 0.605842 | 3.90774 | false | false | false | false |
mozilla/firefox-flicks | vendor-local/lib/python/oauthlib/oauth2/draft25/__init__.py | 1 | 30698 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
"""
oauthlib.oauth2.draft_25
~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for signing and checking OAuth 2.0 draft 25 requests.
"""
from oauthlib.common import Request
from oauthlib.oauth2.draft25 import tokens... | bsd-3-clause | 92966c379242121909d9514da3e30eff | 42.854286 | 122 | 0.663268 | 4.460622 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/fhirreference_tests.py | 1 | 5773 | # -*- coding: utf-8 -*-
import io
import json
import os.path
import logging
import unittest
import models.questionnaire as questionnaire
import models.medication as medication
import models.resource as resource
import models.valueset as valueset
import models.patient as patient
import models.bundle as bundle
import se... | bsd-3-clause | d89241f3dd285dab028c98cbdfe31b0d | 41.762963 | 104 | 0.671228 | 4.244853 | false | true | false | false |
all-of-us/raw-data-repository | rdr_service/alembic/versions/a2424db07997_add_last_active_retention_time.py | 1 | 2278 | """add_last_active_retention_time
Revision ID: a2424db07997
Revises: b54f52bb5fc5, 56c49230d778
Create Date: 2021-09-14 16:26:40.798067
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderSt... | bsd-3-clause | d226c2b6d5b75e5a94bf03e388e65a3d | 35.741935 | 157 | 0.756365 | 3.553822 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/alembic/versions/16452fdb1334_summary_cope_survey_fields.py | 1 | 3793 | """summary cope survey fields
Revision ID: 16452fdb1334
Revises: c0394a487b8b
Create Date: 2020-05-12 14:02:39.592019
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from sqlalchemy.dialects import mysql
from rdr_service.participant_enums import PhysicalMeasurementsStatus, Questionn... | bsd-3-clause | c8f1811d5a23a36f1a2ed465d31fac36 | 48.907895 | 147 | 0.757712 | 3.420198 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/tools/load_test_locustfile.py | 1 | 8228 | """User behavior definition for load-testing via Locust. Run using tools/load_test.sh.
Locust docs: http://docs.locust.io/en/latest/writing-a-locustfile.html
Instructions:
* In your venv, run easy_install install locustio
* Run "export sdk_dir" to export the path to your locally installed Google Cloud SDK.
* Ru... | bsd-3-clause | c65187d6461d667db79f48abec7ba22e | 41.194872 | 105 | 0.620564 | 3.994175 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/alembic/versions/978d12edb6c5_rename_isduplicate_column.py | 1 | 2454 | """rename isDuplicate column
Revision ID: 978d12edb6c5
Revises: e7cf7c2a25f2
Create Date: 2022-01-12 19:44:59.564063
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from sqlalchemy.dialects import mysql
from rdr_service.participant_enums import PhysicalMeasurementsStatus, Questionna... | bsd-3-clause | 7f7ceb4efd4026859efaec71a9a623cd | 37.952381 | 125 | 0.762429 | 3.73516 | false | false | false | false |
all-of-us/raw-data-repository | tests/dao_tests/test_response_validator.py | 1 | 21957 | from dataclasses import dataclass, field
from datetime import date, datetime
import mock
from typing import Dict, List
from rdr_service.code_constants import PMI_SKIP_CODE
from rdr_service.dao.questionnaire_response_dao import ResponseValidator
from rdr_service.model.code import Code
from rdr_service.model.questionnai... | bsd-3-clause | ceb75ab63713cddae0443eb0b3cc616b | 50.907801 | 120 | 0.656738 | 4.390522 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/contactpoint.py | 1 | 2151 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 (http://hl7.org/fhir/StructureDefinition/ContactPoint) on 2017-03-22.
# 2017, SMART Health IT.
from . import element
class ContactPoint(element.Element):
""" Details of a Technology mediated contact point (phone, fax, email, etc.... | bsd-3-clause | c491c37d07bf6b460591c1932ecc686e | 32.092308 | 104 | 0.578336 | 4.184825 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/genomic/genomic_job_components.py | 1 | 154004 | """
Component Classes for Genomic Jobs
Components are assembled by the JobController for a particular Genomic Job
"""
import csv
import json
import logging
import re
import pytz
from collections import deque, namedtuple
from copy import deepcopy
from dateutil.parser import parse
import sqlalchemy
from werkzeug.excepti... | bsd-3-clause | 7fa3c3d895300a3a951fdd9eca2e26b4 | 38.630468 | 132 | 0.557239 | 4.009477 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/dao/code_dao.py | 1 | 12581 | from collections import defaultdict
import logging
from typing import Dict, List, Optional, Set
from werkzeug.exceptions import BadRequest
from sqlalchemy.orm import joinedload, Session
from rdr_service import clock
from rdr_service.dao.base_dao import BaseDao
from rdr_service.dao.cache_all_dao import CacheAllDao
fro... | bsd-3-clause | a1c40816b5e9107610121ea4d92498f7 | 40.65894 | 119 | 0.613226 | 3.996506 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/auditevent_tests.py | 1 | 28132 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 on 2017-03-22.
# 2017, SMART Health IT.
import io
import json
import os
import unittest
from . import auditevent
from .fhirdate import FHIRDate
class AuditEventTests(unittest.TestCase):
def instantiate_from(self, filename):
... | bsd-3-clause | 016c4d872c91762f8e0a83b6769815e1 | 61.101545 | 207 | 0.679333 | 3.19319 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/visionprescription_tests.py | 1 | 6072 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 on 2017-03-22.
# 2017, SMART Health IT.
import io
import json
import os
import unittest
from . import visionprescription
from .fhirdate import FHIRDate
class VisionPrescriptionTests(unittest.TestCase):
def instantiate_from(self... | bsd-3-clause | ea6e4546ddcaa9a4156e3c2f9ba79924 | 52.734513 | 126 | 0.689559 | 3.319847 | false | true | false | false |
all-of-us/raw-data-repository | rdr_service/client/client_libs/verify_environment.py | 1 | 3772 | #! /bin/env python
#
# Simply verify the environment is valid for running the client apps.
#
import argparse
# pylint: disable=superfluous-parens
# pylint: disable=broad-except
import importlib
import logging
import sys
from rdr_service.tools.tool_libs import GCPProcessContext
from rdr_service.services.gcp_utils imp... | bsd-3-clause | c6ba25fae204def572202b1eb52526f7 | 32.981982 | 116 | 0.610551 | 4.034225 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/elementdefinition.py | 1 | 75790 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ElementDefinition) on 2019-05-07.
# 2019, SMART Health IT.
from . import backboneelement
class ElementDefinition(backboneelement.BackboneElement):
""" Definition of an element in a re... | bsd-3-clause | 62c270bc4144bcedc6fd95f631552029 | 42.407789 | 154 | 0.598601 | 4.601141 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/message_broker/message_broker.py | 1 | 6297 | import logging
from datetime import timedelta
import backoff
import requests
from werkzeug.exceptions import BadRequest, BadGateway, HTTPException
from rdr_service import clock
from rdr_service.model.message_broker import MessageBrokerDestAuthInfo
from rdr_service.model.utils import to_client_participant_id
from rdr_... | bsd-3-clause | 4bccf2e041b78d363031ca3675216a1a | 45.992537 | 115 | 0.665714 | 3.980405 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/alembic/versions/534d805d5dcf_alter_biobank_dv_table.py | 1 | 1944 | """alter biobank dv table
Revision ID: 534d805d5dcf
Revises: dc971fc16861
Create Date: 2019-03-18 13:23:40.194824
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "534d805d5dcf"
down_revision = "dc971fc16861"
branch_labels = ... | bsd-3-clause | a982e653bbd5460173fce75e7f61d7ce | 28.454545 | 110 | 0.659465 | 3.452931 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/alembic/versions/0e92151ebd4a_amend_biobank_orders.py | 1 | 3772 | """amend biobank orders
Revision ID: 0e92151ebd4a
Revises: 075b9eee88b7
Create Date: 2018-08-15 11:43:57.043915
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from rdr_service.participant_enums import BiobankOrderStatus
# revision identifiers, used by Alembic.
revision = "0e92151ebd4a"
down_r... | bsd-3-clause | 8254a165576693cf083a923b94ec3f57 | 45 | 117 | 0.69141 | 3.159129 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_1_0_6/models/auditevent.py | 1 | 14315 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/AuditEvent) on 2016-06-23.
# 2016, SMART Health IT.
from . import domainresource
class AuditEvent(domainresource.DomainResource):
""" Event record kept for security purposes.
A rec... | bsd-3-clause | fb34075a185849017ed2e5e273a8d392 | 36.473822 | 138 | 0.594202 | 4.487461 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/offline/retention_eligible_import.py | 1 | 15568 | import logging
import datetime
from dateutil.parser import parse
from rdr_service.clock import CLOCK
from rdr_service.app_util import nonprod
from rdr_service.storage import GoogleCloudStorageCSVReader
from rdr_service.dao.retention_eligible_metrics_dao import RetentionEligibleMetricsDao
from rdr_service.dao.participa... | bsd-3-clause | 2f4fca9e3d2348253c42471391aceb6b | 49.219355 | 123 | 0.619604 | 3.622993 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/client.py | 1 | 8525 | # -*- coding: utf-8 -*-
import logging
from .server import FHIRNotFoundException, FHIRServer, FHIRUnauthorizedException
__version__ = '3.0.0'
__author__ = 'SMART Platforms Team'
__license__ = 'APACHE2'
__copyright__ = "Copyright 2017 Boston Children's Hospital"
scope_default = 'user/*.* patient/*.read openid profil... | bsd-3-clause | ce44beec2e9647d2ed5df0793d2a909f | 36.227074 | 125 | 0.606217 | 4.071156 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/supplyrequest.py | 1 | 8678 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 (http://hl7.org/fhir/StructureDefinition/SupplyRequest) on 2017-03-22.
# 2017, SMART Health IT.
from . import domainresource
class SupplyRequest(domainresource.DomainResource):
""" Request for a medication, substance or device.
... | bsd-3-clause | 466071558fbed1109340af7b2018fdda | 39.362791 | 138 | 0.630445 | 4.341171 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/alembic/versions/484c5d15ac06_bigquery_sync.py | 1 | 2419 | """bigquery sync
Revision ID: 484c5d15ac06
Revises: b662c5bb00cc
Create Date: 2019-05-31 16:22:55.821536
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "484c5d15ac06"
down_revision = "b662c5bb00cc"
branch_labels = None
depe... | bsd-3-clause | a6ded14920e1fc78382832e18c8f6e80 | 34.573529 | 117 | 0.668458 | 3.521106 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/person.py | 1 | 5297 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Person) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class Person(domainresource.DomainResource):
""" A generic person record.
Demographics and admini... | bsd-3-clause | 8466b24cecb148e9f4f21a2753c877ba | 34.550336 | 110 | 0.608646 | 4.275222 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/tools/tool_libs/biobank_orders.py | 1 | 2552 | from datetime import datetime
from typing import Optional
import argparse
from sqlalchemy.orm import Session
from rdr_service.dao.mail_kit_order_dao import MailKitOrderDao
from rdr_service.model.biobank_mail_kit_order import BiobankMailKitOrder
from rdr_service.model.participant import Participant
from rdr_service.se... | bsd-3-clause | 8250fffbbd75a51d5d17623a0569a97e | 37.089552 | 94 | 0.681426 | 3.725547 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/alembic/versions/3da004006210_add_new_biosample_codes.py | 1 | 2734 | """add new biosample codes
Revision ID: 3da004006210
Revises: c2dd2332a63f
Create Date: 2018-03-01 09:20:45.647001
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from rdr_service.participant_enums import OrderStatus, SampleStatus
# revision identifiers, used by Alembic.
revision = "3da0040062... | bsd-3-clause | 2c575c3f122e240e3954a735077abc3c | 33.175 | 116 | 0.686906 | 3.338217 | false | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/nutritionorder.py | 1 | 18114 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 (http://hl7.org/fhir/StructureDefinition/NutritionOrder) on 2017-03-22.
# 2017, SMART Health IT.
from . import domainresource
class NutritionOrder(domainresource.DomainResource):
""" Diet, formula or nutritional supplement reques... | bsd-3-clause | 754b3c6f5162e308a2068bd0fb2b4f21 | 41.223776 | 117 | 0.640333 | 4.271162 | false | false | false | false |
django/django-localflavor | tests/test_se.py | 4 | 7806 | import datetime
from django.test import SimpleTestCase
from localflavor.se.forms import (SECountySelect, SEOrganisationNumberField, SEPersonalIdentityNumberField,
SEPostalCodeField)
class SELocalFlavorTests(SimpleTestCase):
def setUp(self):
# Mocking datetime.date to m... | bsd-3-clause | a384a9f0665739deb83b4594f3137c1d | 39.435233 | 107 | 0.59021 | 3.684608 | false | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.