hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e39a3c3b775461febca500db51904b1f4313be40 | 838 | py | Python | turismo_v1/apps/crud_lugar/migrations/0006_auto_20191015_1633.py | diegogarciapablo/proyecto_tesis | 98882b009486e7324679654d101702cfe3d0e0ee | [
"MIT"
] | null | null | null | turismo_v1/apps/crud_lugar/migrations/0006_auto_20191015_1633.py | diegogarciapablo/proyecto_tesis | 98882b009486e7324679654d101702cfe3d0e0ee | [
"MIT"
] | null | null | null | turismo_v1/apps/crud_lugar/migrations/0006_auto_20191015_1633.py | diegogarciapablo/proyecto_tesis | 98882b009486e7324679654d101702cfe3d0e0ee | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-10-15 20:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crud_lugar', '0005_auto_20191015_1559'),
]
operations = [
migrations.AlterField(
model_name='alojamiento',
name='fecha_fundacion',
field=models.DateField(),
),
migrations.AlterField(
model_name='colegio',
name='fecha_fundacion',
field=models.DateField(),
),
migrations.AlterField(
model_name='iglesia',
name='fecha_fundacion',
field=models.DateField(),
),
migrations.AlterField(
model_name='plaza',
name='fecha_fundacion',
field=models.DateField(),
),
]
| 24.647059 | 50 | 0.551313 | 74 | 838 | 6.081081 | 0.5 | 0.177778 | 0.222222 | 0.257778 | 0.531111 | 0.531111 | 0.446667 | 0.446667 | 0.446667 | 0.446667 | 0 | 0.055755 | 0.336516 | 838 | 33 | 51 | 25.393939 | 0.753597 | 0.053699 | 0 | 0.592593 | 1 | 0 | 0.155499 | 0.029077 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.037037 | 0 | 0.148148 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e3b596dd949fc22f7621b87fe093e66e1ea11087 | 4,533 | py | Python | Alignment/MuonAlignmentAlgorithms/test/standAloneTest_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | Alignment/MuonAlignmentAlgorithms/test/standAloneTest_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | Alignment/MuonAlignmentAlgorithms/test/standAloneTest_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/FAF8A711-C297-DE11-A00E-001731AF66AF.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/FAB8A245-D996-DE11-A866-003048678A6A.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/F8D6CB8E-CD96-DE11-A8D2-003048678FFA.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/F8349AAD-C297-DE11-99E3-0030486792BA.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/F8251242-DA96-DE11-B26B-003048678FC6.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/F49C816C-D796-DE11-AC34-003048D15DDA.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/F288C73C-C297-DE11-9F00-001731AF684D.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/F0BBFDE1-D496-DE11-8E1B-003048678FE6.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/EE1592A7-C297-DE11-8679-0030486792AC.root",
"/store/data/CRAFT09/Cosmics/RAW-RECO/GR09_31X_V5P_CSCSkim_BFieldStudies-332_v4/0021/E2938851-CF96-DE11-8330-0017312B5651.root",
))
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100))
process.StandAloneTest = cms.EDAnalyzer("StandAloneTest", Tracks = cms.InputTag(""))
process.load("Configuration.StandardSequences.MagneticField_cff")
process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
process.load("Geometry.CommonDetUnit.bareGlobalTrackingGeometry_cfi")
process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
process.load("Geometry.DTGeometry.dtGeometry_cfi")
process.load("Geometry.CSCGeometry.cscGeometry_cfi")
process.load("Geometry.RPCGeometry.rpcGeometry_cfi")
process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi")
process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
### for cosmic rays (only use one)
process.load("TrackingTools.TrackRefitter.globalCosmicMuonTrajectories_cff")
process.TrackRefitter = process.globalCosmicMuons.clone()
process.TrackRefitter.Tracks = cms.InputTag("globalCosmicMuons")
process.StandAloneTest.Tracks = cms.InputTag("globalCosmicMuons")
### for collisions (only use one)
# process.load("TrackingTools.TrackRefitter.globalMuonTrajectories_cff")
# process.TrackRefitter = process.globalCosmicMuons.clone()
# process.TrackRefitter.Tracks = cms.InputTag("globalMuons")
# process.StandAloneTest.Tracks = cms.InputTag("globalMuons")
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = cms.string("CRAFT0831X_V1::All")
process.load("CondCore.DBCommon.CondDBSetup_cfi")
### for assigning a custom muon alignment
# process.MuonAlignment = cms.ESSource("PoolDBESSource",
# process.CondDBSetup,
# connect = cms.string("sqlite_file:customMuonAlignment.db"),
# toGet = cms.VPSet(cms.PSet(record = cms.string("DTAlignmentRcd"), tag = cms.string("DTAlignmentRcd")),
# cms.PSet(record = cms.string("CSCAlignmentRcd"), tag = cms.string("CSCAlignmentRcd"))))
# process.es_prefer_MuonAlignment = cms.ESPrefer("PoolDBESSource", "MuonAlignment")
### it is important to refit with zero weights ("infinite" APEs)
process.MuonAlignmentErrorsExtended = cms.ESSource("PoolDBESSource",
process.CondDBSetup,
connect = cms.string("sqlite_file:APE1000cm.db"),
toGet = cms.VPSet(cms.PSet(record = cms.string("DTAlignmentErrorExtendedRcd"), tag = cms.string("DTAlignmentErrorExtendedRcd")),
cms.PSet(record = cms.string("CSCAlignmentErrorExtendedRcd"), tag = cms.string("CSCAlignmentErrorExtendedRcd"))))
process.es_prefer_MuonAlignmentErrorsExtended = cms.ESPrefer("PoolDBESSource", "MuonAlignmentErrorsExtended")
process.TFileService = cms.Service("TFileService", fileName = cms.string("standAloneTest.root"))
process.Path = cms.Path(process.TrackRefitter * process.StandAloneTest)
| 69.738462 | 168 | 0.754467 | 493 | 4,533 | 6.793103 | 0.320487 | 0.042699 | 0.047775 | 0.068677 | 0.405793 | 0.361302 | 0.361302 | 0.333234 | 0.333234 | 0.311138 | 0 | 0.095322 | 0.122877 | 4,533 | 64 | 169 | 70.828125 | 0.746982 | 0.216634 | 0 | 0 | 0 | 0.25 | 0.602891 | 0.563492 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.025 | 0 | 0.025 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e3d98fcaa52e96b195461760f1d7ce8826c761e7 | 167 | py | Python | src/python/nimbusml/preprocessing/__init__.py | GalOshri/NimbusML | a2ba6f51b7c8cdd3c3316d5ecf4605621be3bd8d | [
"MIT"
] | 2 | 2019-03-01T01:22:54.000Z | 2019-07-10T19:57:38.000Z | src/python/nimbusml/preprocessing/__init__.py | GalOshri/NimbusML | a2ba6f51b7c8cdd3c3316d5ecf4605621be3bd8d | [
"MIT"
] | null | null | null | src/python/nimbusml/preprocessing/__init__.py | GalOshri/NimbusML | a2ba6f51b7c8cdd3c3316d5ecf4605621be3bd8d | [
"MIT"
] | null | null | null | from .fromkey import FromKey
from .tokey import ToKey
from .tensorflowscorer import TensorFlowScorer
__all__ = [
'FromKey',
'ToKey',
'TensorFlowScorer'
]
| 16.7 | 46 | 0.724551 | 16 | 167 | 7.3125 | 0.375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.191617 | 167 | 9 | 47 | 18.555556 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0.167665 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
e3f2eeb0757920445defdd3147acac438377a54c | 866 | py | Python | src/pycoils/pycoils/tests/data/testdata.py | harisankar-krishna-swamy/coils | 2fb9606ee2df9c49db4ab67ee650ff8edc285a7e | [
"Apache-2.0"
] | 2 | 2020-12-29T18:37:07.000Z | 2021-05-11T12:48:04.000Z | src/pycoils/pycoils/tests/data/testdata.py | harisankar-krishna-swamy/coils | 2fb9606ee2df9c49db4ab67ee650ff8edc285a7e | [
"Apache-2.0"
] | null | null | null | src/pycoils/pycoils/tests/data/testdata.py | harisankar-krishna-swamy/coils | 2fb9606ee2df9c49db4ab67ee650ff8edc285a7e | [
"Apache-2.0"
] | null | null | null | '''
Created on Nov 8, 2015
@author: hari
'''
from builtins import object
from functools import total_ordering
class WrappedString(object):
'''
This class simply wraps around python string.
'''
def __init__(self, string = 'default string'):
self._string = string
@property
def wrapped_string(self):
return self._string
def __eq__(self, other):
if other == None or type(other) != type(self):
return False
return self._string == other.wrapped_string
def __lt__(self, other):
if other == None or type(other) != type(self):
return False
return self._string < other.wrapped_string
def __str__(self, *args, **kwargs):
return self._string
def __hash__(self, *args, **kwargs):
return hash(self._string) | 24.055556 | 54 | 0.600462 | 100 | 866 | 4.9 | 0.41 | 0.142857 | 0.130612 | 0.077551 | 0.355102 | 0.355102 | 0.355102 | 0.355102 | 0.355102 | 0.355102 | 0 | 0.008251 | 0.300231 | 866 | 36 | 55 | 24.055556 | 0.80033 | 0.095843 | 0 | 0.3 | 0 | 0 | 0.018397 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.15 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
e3f5a9140d6ad6b972face405b41f19f2f822c13 | 79 | py | Python | POO_I/teste.py | saul-rocha/POO_I | ca046576de33c74052a07baafdc0d3b04ec64110 | [
"MIT"
] | null | null | null | POO_I/teste.py | saul-rocha/POO_I | ca046576de33c74052a07baafdc0d3b04ec64110 | [
"MIT"
] | null | null | null | POO_I/teste.py | saul-rocha/POO_I | ca046576de33c74052a07baafdc0d3b04ec64110 | [
"MIT"
] | null | null | null | print ("Hello World")
n = int(input("numero: "))
print(type(n))
print(bin(3)) | 13.166667 | 26 | 0.620253 | 13 | 79 | 3.769231 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014493 | 0.126582 | 79 | 6 | 27 | 13.166667 | 0.695652 | 0 | 0 | 0 | 0 | 0 | 0.2375 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.75 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
540eae033fbb6d53b77734558be9404ebd3f0077 | 791 | py | Python | lokki/feature_transform/feature_engineering/ica.py | bzhanglab/Lokki | 035087d58f2b194b3a1644b932683ded0fb71af4 | [
"Apache-2.0"
] | null | null | null | lokki/feature_transform/feature_engineering/ica.py | bzhanglab/Lokki | 035087d58f2b194b3a1644b932683ded0fb71af4 | [
"Apache-2.0"
] | null | null | null | lokki/feature_transform/feature_engineering/ica.py | bzhanglab/Lokki | 035087d58f2b194b3a1644b932683ded0fb71af4 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import sklearn as sk
from lokki.feature_transform import FeatureTransformChoice
class ICA(FeatureTransformChoice):
def __init__(self, dataset_shape, parameters):
self.dataset_shape = dataset_shape
self.parameters = parameters
self.step_size = int(dataset_shape[1] * 0.15)
self.grid = [{'n_components' : x, 'max_iter' : 100, 'tol' : 0.1} for x in np.arange(1, int(dataset_shape[1] / self.parameters['num_folds']), step = self.step_size)]
def fit(self, hyperparameters, X, y):
self.ica = sk.decomposition.FastICA(**hyperparameters).fit(X)
def transform(self, X, y = None):
return self.ica.transform(X)
def get_name(self):
return 'ICA'
def hyperparameter_grid(self):
return self.grid
| 31.64 | 172 | 0.675095 | 107 | 791 | 4.831776 | 0.448598 | 0.116054 | 0.061896 | 0.061896 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017572 | 0.208597 | 791 | 24 | 173 | 32.958333 | 0.808307 | 0 | 0 | 0 | 0 | 0 | 0.044248 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.176471 | 0.176471 | 0.705882 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
54112033fb0811c1f4b56863ca437e4b2ac9ebaf | 1,445 | py | Python | tests/helpers/test_errorcode.py | marcelb98/pycroft | 34cc59d9ab7fdc0c20b09b4851111048a9f64d90 | [
"Apache-2.0"
] | null | null | null | tests/helpers/test_errorcode.py | marcelb98/pycroft | 34cc59d9ab7fdc0c20b09b4851111048a9f64d90 | [
"Apache-2.0"
] | null | null | null | tests/helpers/test_errorcode.py | marcelb98/pycroft | 34cc59d9ab7fdc0c20b09b4851111048a9f64d90 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import unittest
from pycroft.helpers.errorcode import digits, Type1Code, Type2Code
class Test_010_digits(unittest.TestCase):
def test_0010_zero(self):
self.assertEqual([0], list(digits(0)))
def test_0020_multiple(self):
self.assertEqual([4, 3, 2, 1], list(digits(1234)))
def test_0030_negative(self):
self.assertEqual([4, 3, 2, 1], list(digits(-1234)))
class Test_010_Type1Code(unittest.TestCase):
def test_0010_calculate_zero(self):
self.assertEqual(0, Type1Code.calculate(0))
def test_0020_calculate_mod10(self):
self.assertEqual(0, Type1Code.calculate(1234))
def test_0030_validate_zero(self):
self.assertTrue(Type1Code.is_valid(0, 0))
def test_0040_validate_mod10(self):
self.assertTrue(Type1Code.is_valid(1234, 0))
class Test_010_Type2Code(unittest.TestCase):
def test_0010_calculate_zero(self):
self.assertEqual(98, Type2Code.calculate(0))
def test_0020_calculate_mod10(self):
self.assertEqual(82, Type2Code.calculate(1234))
def test_0030_validate_zero(self):
self.assertTrue(Type2Code.is_valid(0, 98))
def test_0040_validate_mod10(self):
self.assertTrue(Type2Code.is_valid(1234, 82))
| 32.111111 | 74 | 0.722491 | 203 | 1,445 | 4.945813 | 0.285714 | 0.076693 | 0.13247 | 0.068725 | 0.624502 | 0.573705 | 0.49004 | 0.49004 | 0.406375 | 0.406375 | 0 | 0.107769 | 0.171626 | 1,445 | 44 | 75 | 32.840909 | 0.730994 | 0.1391 | 0 | 0.296296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.407407 | 1 | 0.407407 | false | 0 | 0.074074 | 0 | 0.592593 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
541314f74c7841c7007e82add9486abbc00f6fd3 | 352 | py | Python | convsBot/main1.py | nearwatson/sai | e3c3fdb525eab7e0f84afb9fecd124995b18fec1 | [
"Apache-2.0"
] | null | null | null | convsBot/main1.py | nearwatson/sai | e3c3fdb525eab7e0f84afb9fecd124995b18fec1 | [
"Apache-2.0"
] | null | null | null | convsBot/main1.py | nearwatson/sai | e3c3fdb525eab7e0f84afb9fecd124995b18fec1 | [
"Apache-2.0"
] | null | null | null | # RL classification task
# text -to-> graph
# each char as a node
# 1. Annotation task:
# given the state_graph, action space is whether to link several nodes or not
# surrender action to the env?
# how is env defined:
# env.step(action)
# NER
#
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
| 16.761905 | 81 | 0.681818 | 56 | 352 | 4.267857 | 0.660714 | 0.138075 | 0.108787 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003788 | 0.25 | 352 | 20 | 82 | 17.6 | 0.901515 | 0.639205 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
5417ba9f6452e09315c6c3010b5644fd2323b9ae | 727 | py | Python | kapacitor/objects/common.py | ot4kon/kapacitor-python | 253378c514ebae72781586cf1abc9fc9fbccac39 | [
"MIT"
] | null | null | null | kapacitor/objects/common.py | ot4kon/kapacitor-python | 253378c514ebae72781586cf1abc9fc9fbccac39 | [
"MIT"
] | null | null | null | kapacitor/objects/common.py | ot4kon/kapacitor-python | 253378c514ebae72781586cf1abc9fc9fbccac39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .exceptions import InvalidTaskType
class Type(object):
def __init__(self, task_type='stream'):
self._type = task_type
def __str__(self):
return self._type
def __repr__(self):
return self._type
def _check_type(self, task_type):
if task_type not in ['stream', 'batch']:
raise InvalidTaskType('Type can be "stream" or "batch", "%s" provided' % task_type)
@property
def type(self):
return self._type
@type.setter
def type(self, task_type):
self._check_type(task_type)
self._type = task_type
def change(self, task_type):
self.type = task_type
| 22.71875 | 95 | 0.634113 | 94 | 727 | 4.521277 | 0.361702 | 0.188235 | 0.112941 | 0.112941 | 0.263529 | 0.112941 | 0 | 0 | 0 | 0 | 0 | 0.001859 | 0.259972 | 727 | 31 | 96 | 23.451613 | 0.788104 | 0.028886 | 0 | 0.238095 | 0 | 0 | 0.089489 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.095238 | 0.142857 | 0.619048 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
5425893403988ef9814575ec1b4e522c9eb334a3 | 183 | py | Python | backend/web-back/jam/urls.py | kk6/jam | 647fa971a4e053d018a08a48cc840c628deae67c | [
"MIT"
] | null | null | null | backend/web-back/jam/urls.py | kk6/jam | 647fa971a4e053d018a08a48cc840c628deae67c | [
"MIT"
] | null | null | null | backend/web-back/jam/urls.py | kk6/jam | 647fa971a4e053d018a08a48cc840c628deae67c | [
"MIT"
] | null | null | null | from django.urls import path
from .views import ListVideo, DetailVideo
urlpatterns = [
path("video/<str:pk>/", DetailVideo.as_view()),
path("video/", ListVideo.as_view()),
]
| 22.875 | 51 | 0.693989 | 23 | 183 | 5.434783 | 0.608696 | 0.144 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142077 | 183 | 7 | 52 | 26.142857 | 0.796178 | 0 | 0 | 0 | 0 | 0 | 0.114754 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
581f838eff927a43c7429e4d17c518bbfcbc1b23 | 176 | py | Python | SidToS3/objects/indexentry.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | SidToS3/objects/indexentry.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | SidToS3/objects/indexentry.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | class DataFile:
def __init__(self, datetime, chart, datafile):
self.Datetime = datetime
self.Chart = chart
self.Datafile = datafile
return | 22 | 50 | 0.619318 | 18 | 176 | 5.833333 | 0.444444 | 0.228571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.306818 | 176 | 8 | 51 | 22 | 0.860656 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
582aac3fb40d18a8caf88d0e37df5844f69f579a | 5,765 | py | Python | pbgpp/PCAP/Information.py | cmoeller-dx/pbgp-parser | 7db344298c94dc11a86cdd448aa455f188f6362e | [
"Apache-2.0"
] | null | null | null | pbgpp/PCAP/Information.py | cmoeller-dx/pbgp-parser | 7db344298c94dc11a86cdd448aa455f188f6362e | [
"Apache-2.0"
] | null | null | null | pbgpp/PCAP/Information.py | cmoeller-dx/pbgp-parser | 7db344298c94dc11a86cdd448aa455f188f6362e | [
"Apache-2.0"
] | null | null | null | #
# This file is part of PCAP BGP Parser (pbgpp)
#
# Copyright 2016-2017 DE-CIX Management GmbH
# Author: Tobias Hannaske <tobias.hannaske@de-cix.net>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from binascii import hexlify
import datetime
from pbgpp.PCAP.Exceptions import PCAPInformationError
class PCAPInformation:
def __init__(self, ts, mac, ip, ports):
if not isinstance(mac, PCAPLayer2Information):
raise PCAPInformationError("parameter 'mac' must be instance of PCAPLayer2Information")
if not isinstance(ip, PCAPLayer3Information):
raise PCAPInformationError("parameter 'ip' must be instance of PCAPLayer3Information")
if not isinstance(ports, PCAPLayer4Information):
raise PCAPInformationError("parameter 'ports' must be instance of PCAPLayer4Information")
# Assign variables
self.ts = ts # (Timestamp)
self.mac = mac # (MAC address set)
self.ip = ip # (IP address set)
self.ports = ports # (Port set)
def get_timestamp(self):
return self.ts
def get_timestmap_utc(self):
return datetime.datetime.utcfromtimestamp(self.ts[0]).strftime('%Y-%m-%d %H:%M:%S') + "." + str(self.ts[1])
def get_mac(self):
return self.mac
def get_ip(self):
return self.ip
def get_ports(self):
return self.ports
def get_source_mac(self):
return self.mac.source
def get_customer_vlan(self):
return self.mac.vlan[0]
def get_source_ip(self):
return self.ip.source
def get_source_port(self):
return self.ports.source
def get_destination_mac(self):
return self.mac.destination
def get_service_vlan(self):
return self.mac.vlan[1]
def get_destination_ip(self):
return self.ip.destination
def get_destination_port(self):
return self.ports.destination
class PCAPLayer2Information:
def __init__(self, source, destination, vlan):
# Store source and destination MAC address
self.source = source
self.destination = destination
self.vlan = vlan # [802.1q, 802.1ad]
def get_source_string(self, separated=False):
if self.source is None:
output = "000000000000"
else:
output = str(hexlify(self.source).decode("utf-8"))
if separated:
return output[0:2] + ":" + output[2:4] + ":" + output[4:6] + ":" + output[6:8] + ":" + output[8:10] + ":" + output[10:12]
else:
return output
def get_destination_string(self, separated=False):
if self.destination is None:
output = "000000000000"
else:
output = str(hexlify(self.destination).decode("utf-8"))
if separated:
return output[0:2] + ":" + output[2:4] + ":" + output[4:6] + ":" + output[6:8] + ":" + output[8:10] + ":" + output[10:12]
else:
return output
def get_customer_vlan(self):
if len(self.vlan) == 0:
return None
else:
return self.vlan[0]
def get_service_vlan(self):
if len(self.vlan) <= 1:
return None
else:
return self.vlan[1]
def __str__(self):
return "<PCAPLayer2Information source={0} destination={1} ; VLAN ID (Customer)={} Service={}>".format(self.get_source_string(), self.get_destination_string(), self.get_customer_vlan(), self.get_service_vlan())
class PCAPLayer3Information:
IP_VERSION_4 = 0x4
IP_VERSION_6 = 0x6
def __init__(self, source, destination, version):
# Store source and destination IP address
self.version = version
self.source = source
self.destination = destination
def get_source_string(self):
if self.version == self.IP_VERSION_4:
return str(self.source[0]) + "." + str(self.source[1]) + "." + str(self.source[2]) + "." + str(self.source[3])
if self.version == self.IP_VERSION_6:
output = ""
for i in self.source:
output += str( hex(i)[2:] ) + ":"
return output[:-1]
def get_destination_string(self):
if self.version == self.IP_VERSION_4:
return str(self.destination[0]) + "." + str(self.destination[1]) + "." + str(self.destination[2]) + "." + str(self.destination[3])
if self.version == self.IP_VERSION_6:
output = ""
for i in self.destination:
output += str( hex(i)[2:] ) + ":"
return output[:-1]
def __str__(self):
return "<PCAPLayer3Information source={0} destination={1}>".format(self.get_source_string(), self.get_destination_string())
class PCAPLayer4Information:
def __init__(self, source, destination):
# Store source and destination port
self.source = source
self.destination = destination
def get_source_string(self):
return str(self.source)
def get_destination_string(self):
return str(self.destination)
def __str__(self):
return "<PCAPLayer4Information source={0} destination={1}>".format(self.get_source_string(), self.get_destination_string())
| 32.027778 | 217 | 0.624458 | 709 | 5,765 | 4.944993 | 0.212976 | 0.035938 | 0.047918 | 0.032516 | 0.430405 | 0.312892 | 0.241586 | 0.241586 | 0.241586 | 0.183115 | 0 | 0.029135 | 0.261752 | 5,765 | 179 | 218 | 32.206704 | 0.794643 | 0.150737 | 0 | 0.387387 | 0 | 0 | 0.087716 | 0.0265 | 0 | 0 | 0.001233 | 0 | 0 | 1 | 0.252252 | false | 0 | 0.027027 | 0.162162 | 0.603604 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
5852698a7e87ed1af4770747c28bce2a7badd860 | 977 | py | Python | week8/codingbat/list1.py | yestemir/web | 5bdead66c26a3c466701e25ecae9720f04ad4118 | [
"Unlicense"
] | null | null | null | week8/codingbat/list1.py | yestemir/web | 5bdead66c26a3c466701e25ecae9720f04ad4118 | [
"Unlicense"
] | 13 | 2021-03-10T08:46:52.000Z | 2022-03-02T08:13:58.000Z | week8/codingbat/list1.py | yestemir/web | 5bdead66c26a3c466701e25ecae9720f04ad4118 | [
"Unlicense"
] | null | null | null | def first_last6(nums):
if nums[0] == 6 or nums[-1] == 6:
return True
else:
return False
def same_first_last(nums):
if len(nums) >= 1 and nums[0] == nums[-1]:
return True
else:
return False
def make_pi():
return [3, 1, 4]
def common_end(a, b):
if a[-1] == b[-1] or a[0] == b[0]:
return True
else:
return False
def sum3(a):
return a[0] + a[1] + a[2]
def rotate_left3(a):
return [a[1], a[2], a[0]]
def reverse3(nums):
return [nums[2], nums[1], nums[0]]
def max_end3(a):
max = -1
if a[0] > a[2]:
max = a[0]
if a[2] >= a[0]:
max = a[2]
return [max, max, max]
def sum2(nums):
if len(nums) >=2:
return nums[0] + nums[1]
elif len(nums) == 1:
return nums[0]
else:
return 0
def middle_way(a, b):
return [a[1], b[1]]
def make_ends(nums):
return [nums[0], nums[-1]]
def has23(nums):
if nums[0] == 2 or nums[1] == 2 or nums[0] == 3 or nums[1] == 3:
return True
else:
return False | 16.844828 | 66 | 0.546571 | 185 | 977 | 2.837838 | 0.205405 | 0.085714 | 0.106667 | 0.152381 | 0.268571 | 0.16 | 0 | 0 | 0 | 0 | 0 | 0.077778 | 0.26305 | 977 | 58 | 67 | 16.844828 | 0.651389 | 0 | 0 | 0.282609 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0 | 0.130435 | 0.652174 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
5864422c65e66f73ac177dd90544f92bd46d8d4d | 1,240 | py | Python | setup.py | 17451k/eventb-to-txt | 79ab03bd98c6545ffe118f627494c98d18e83fd7 | [
"MIT"
] | 4 | 2019-03-21T07:16:15.000Z | 2022-03-02T11:35:37.000Z | setup.py | 17451k/eventb-to-txt | 79ab03bd98c6545ffe118f627494c98d18e83fd7 | [
"MIT"
] | 2 | 2018-12-14T10:52:26.000Z | 2021-03-15T12:08:57.000Z | setup.py | 17451k/eventb-to-txt | 79ab03bd98c6545ffe118f627494c98d18e83fd7 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Ilya Shchepetkov
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
import setuptools
setuptools.setup(
name='eventb-to-txt',
version='1.4',
author='Ilya Shchepetkov',
author_email='ilya.shchepetkov@yandex.ru',
license='LICENSE.txt',
description="Event-B to txt converter",
long_description=open("README.md", encoding="utf8").read(),
long_description_content_type="text/markdown",
python_requires=">=3.5",
url="https://github.com/17451k/eventb-to-txt",
packages=['eventb_to_txt'],
entry_points={
'console_scripts': [
'eventb-to-txt=eventb_to_txt.__main__:main',
],
},
classifiers=(
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"License :: OSI Approved :: MIT License",
"Operating System :: Unix",
"Operating System :: MacOS :: MacOS X"
)
)
| 33.513514 | 70 | 0.623387 | 143 | 1,240 | 5.293706 | 0.573427 | 0.175694 | 0.231176 | 0.206077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026233 | 0.231452 | 1,240 | 36 | 71 | 34.444444 | 0.768101 | 0.104032 | 0 | 0 | 0 | 0 | 0.550136 | 0.060524 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.032258 | 0 | 0.032258 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
58748af4b38ef6bccdecc903a2765f800951385b | 2,120 | py | Python | dtf/migrations/0021_allow_null_reference.py | siehr/django-testing-framework | 7e411227afff1a5463ebc73ae5cb2c537f0d4f69 | [
"MIT"
] | null | null | null | dtf/migrations/0021_allow_null_reference.py | siehr/django-testing-framework | 7e411227afff1a5463ebc73ae5cb2c537f0d4f69 | [
"MIT"
] | 70 | 2021-03-06T14:36:42.000Z | 2022-03-30T10:00:54.000Z | dtf/migrations/0021_allow_null_reference.py | siehr/django-testing-framework | 7e411227afff1a5463ebc73ae5cb2c537f0d4f69 | [
"MIT"
] | 1 | 2022-02-02T14:05:43.000Z | 2022-02-02T14:05:43.000Z | # Generated by Django 3.1.7 on 2021-04-03 10:48
from django.db import migrations, models
import dtf.validators
class Migration(migrations.Migration):
dependencies = [
('dtf', '0020_introduce_duration'),
]
operations = [
migrations.AlterField(
model_name='testreference',
name='references',
field=models.JSONField(default=dict, validators=[dtf.validators.JSONSchemaValidator(schema={'additionalProperties': {'additionalProperties': False, 'properties': {'source': {'type': 'integer'}, 'value': {'oneOf': [{'$ref': '#/definitions/value'}, {'type': 'null'}]}}, 'required': ['value'], 'type': 'object'}, 'definitions': {'value': {'$id': '#value', 'additionalProperties': False, 'allOf': [{'if': {'properties': {'type': {'const': 'integer'}}}, 'then': {'properties': {'data': {'type': 'integer'}}}}, {'if': {'properties': {'type': {'const': 'float'}}}, 'then': {'properties': {'data': {'type': 'number'}}}}, {'if': {'properties': {'type': {'const': 'string'}}}, 'then': {'properties': {'data': {'type': 'string'}}}}, {'if': {'properties': {'type': {'const': 'duration'}}}, 'then': {'properties': {'data': {'pattern': '^(?P<sign>[-+]?)P(?:(?P<days>\\d+(\\.\\d+)?)D)?(?:T(?:(?P<hours>\\d+(\\.\\d+)?)H)?(?:(?P<minutes>\\d+(\\.\\d+)?)M)?(?:(?P<seconds>\\d+(\\.\\d+)?)S)?)?$', 'type': 'string'}}}}, {'if': {'properties': {'type': {'const': 'ndarray'}}}, 'then': {'properties': {'data': {'additionalProperties': False, 'properties': {'entries': {'items': {'$ref': '#/definitions/value'}, 'type': 'array'}, 'shape': {'items': {'type': 'integer'}, 'type': 'array'}}, 'required': ['shape', 'entries'], 'type': 'object'}}}}, {'if': {'properties': {'type': {'const': 'image'}}}, 'then': {'properties': {'data': {'contentEncoding': 'base64', 'contentMediaType': 'image/png', 'type': 'string'}}}}], 'properties': {'data': {}, 'type': {'enum': ['integer', 'float', 'string', 'duration', 'ndarray', 'image'], 'type': 'string'}}, 'required': ['data', 'type'], 'type': 'object'}}, 'schema': 'http://json-schema.org/draft-07/schema#', 'type': 'object'})]),
),
]
| 106 | 1,755 | 0.559906 | 209 | 2,120 | 5.665072 | 0.416268 | 0.08277 | 0.081081 | 0.106419 | 0.052365 | 0.052365 | 0 | 0 | 0 | 0 | 0 | 0.012254 | 0.114623 | 2,120 | 19 | 1,756 | 111.578947 | 0.61854 | 0.021226 | 0 | 0 | 1 | 0.076923 | 0.502653 | 0.083936 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.153846 | 0 | 0.384615 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5878503093afd58603419e4c7ab382b8a5accd69 | 77,936 | py | Python | wastd/observations/migrations/0001_initial.py | ropable/wastd | 295c60760548d177859de9c0bebdae93342767d0 | [
"MIT"
] | 3 | 2020-07-23T06:37:43.000Z | 2022-01-27T09:40:40.000Z | wastd/observations/migrations/0001_initial.py | ropable/wastd | 295c60760548d177859de9c0bebdae93342767d0 | [
"MIT"
] | 337 | 2018-07-12T05:56:29.000Z | 2022-03-30T02:40:41.000Z | wastd/observations/migrations/0001_initial.py | ropable/wastd | 295c60760548d177859de9c0bebdae93342767d0 | [
"MIT"
] | 2 | 2020-02-24T00:05:46.000Z | 2020-07-15T07:02:29.000Z | # Generated by Django 2.0.7 on 2018-07-31 06:35
import django.contrib.gis.db.models.fields
import django.db.models.deletion
import django_fsm
from django.conf import settings
from django.db import migrations, models
import wastd.observations.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Area',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('area_type', models.CharField(choices=[('MPA', 'MPA'), ('Locality', 'Locality'), ('Site', 'Site')], default='Site', help_text='The area type.', max_length=300, verbose_name='Area type')),
('name', models.CharField(help_text='The name of the area.', max_length=1000, verbose_name='Area Name')),
('centroid', django.contrib.gis.db.models.fields.PointField(blank=True, editable=False, help_text='The centroid is a simplified presentation of the Area.', null=True, srid=4326, verbose_name='Centroid')),
('northern_extent', models.FloatField(blank=True, editable=False, help_text='The northernmost latitude serves to sort areas.', null=True, verbose_name='Northernmost latitude')),
('as_html', models.TextField(blank=True, editable=False, help_text='The cached HTML representation for display purposes.', null=True, verbose_name='HTML representation')),
('geom', django.contrib.gis.db.models.fields.PolygonField(help_text='The exact extent of the area as polygon in WGS84.', srid=4326, verbose_name='Location')),
],
options={
'verbose_name': 'Area',
'verbose_name_plural': 'Areas',
'ordering': ['-northern_extent', 'name'],
},
),
migrations.CreateModel(
name='Encounter',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('source', models.CharField(choices=[('direct', 'Direct entry'), ('paper', 'Paper data sheet'), ('odk', 'OpenDataKit mobile data capture'), ('wamtram', 'WAMTRAM 2 tagging DB'), ('ntp-exmouth', 'NTP Access DB Exmouth'), ('ntp-broome', 'NTP Access DB Broome'), ('cet', 'Cetacean strandings DB'), ('pin', 'Pinniped strandings DB')], default='direct', help_text='Where was this record captured initially?', max_length=300, verbose_name='Data Source')),
('source_id', models.CharField(blank=True, help_text='The ID of the record in the original source, or a newly allocated ID if left blank. Delete and save to regenerate this ID.', max_length=1000, null=True, verbose_name='Source ID')),
('status', django_fsm.FSMField(choices=[('new', 'New'), ('proofread', 'Proofread'), ('curated', 'Curated'), ('published', 'Published')], default='new', max_length=50, verbose_name='QA Status')),
('where', django.contrib.gis.db.models.fields.PointField(help_text='The observation location as point in WGS84', srid=4326, verbose_name='Observed at')),
('when', models.DateTimeField(help_text='The observation datetime, shown as local time (no daylight savings), stored as UTC.', verbose_name='Observed on')),
('location_accuracy', models.CharField(choices=[('10', 'GPS reading at exact location (10 m)'), ('1000', 'Site centroid or place name (1 km)'), ('10000', 'Rough estimate (10 km)')], default='1000', help_text='The accuracy of the supplied location.', max_length=300, verbose_name='Location accuracy (m)')),
('name', models.CharField(blank=True, editable=False, help_text="The animal's earliest associated flipper tag ID.", max_length=1000, null=True, verbose_name='Animal Name')),
('as_html', models.TextField(blank=True, editable=False, help_text='The cached HTML representation for display purposes.', null=True, verbose_name='HTML representation')),
('as_latex', models.TextField(blank=True, editable=False, help_text='The cached Latex fragment for reporting purposes.', null=True, verbose_name='Latex fragment')),
('encounter_type', models.CharField(blank=True, choices=[('stranding', 'Stranding'), ('tagging', 'Tagging'), ('nest', 'Nest'), ('tracks', 'Tracks'), ('inwater', 'In water'), ('tag-management', 'Tag Management'), ('logger', 'Logger'), ('other', 'Other')], default='stranding', editable=False, help_text='The primary concern of this encounter.', max_length=300, null=True, verbose_name='Encounter type')),
('comments', models.TextField(blank=True, help_text='Comments', null=True, verbose_name='Comments')),
],
options={
'verbose_name': 'Encounter',
'verbose_name_plural': 'Encounters',
'ordering': ['when', 'where'],
'get_latest_by': 'when',
},
),
migrations.CreateModel(
name='Expedition',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('started_on', models.DateTimeField(blank=True, help_text='The datetime of entering the site, shown as local time (no daylight savings), stored as UTC.', null=True, verbose_name='Site entered on')),
('finished_on', models.DateTimeField(blank=True, help_text='The datetime of leaving the site, shown as local time (no daylight savings), stored as UTC.', null=True, verbose_name='Site left on')),
('comments', models.TextField(blank=True, help_text='Describe any circumstances affecting data collection, e.g. days without surveys.', null=True, verbose_name='Comments')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
),
migrations.CreateModel(
name='FieldMediaAttachment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('media_type', models.CharField(choices=[('data_sheet', 'Data sheet'), ('journal', 'Field journal'), ('communication', 'Communication record'), ('photograph', 'Photograph'), ('other', 'Other')], default='photograph', help_text='What is the attached file about?', max_length=300, verbose_name='Attachment type')),
('title', models.CharField(blank=True, help_text='Give the attachment a representative name', max_length=300, null=True, verbose_name='Attachment name')),
('attachment', models.FileField(help_text='Upload the file', max_length=500, upload_to=wastd.observations.models.expedition_media, verbose_name='File attachment')),
],
),
migrations.CreateModel(
name='Observation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='SiteVisitStartEnd',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('source', models.CharField(choices=[('direct', 'Direct entry'), ('paper', 'Paper data sheet'), ('odk', 'OpenDataKit mobile data capture'), ('wamtram', 'WAMTRAM 2 tagging DB'), ('ntp-exmouth', 'NTP Access DB Exmouth'), ('ntp-broome', 'NTP Access DB Broome'), ('cet', 'Cetacean strandings DB'), ('pin', 'Pinniped strandings DB')], default='direct', help_text='Where was this record captured initially?', max_length=300, verbose_name='Data Source')),
('source_id', models.CharField(blank=True, help_text='The ID of the record in the original source, or a newly allocated ID if left blank. Delete and save to regenerate this ID.', max_length=1000, null=True, verbose_name='Source ID')),
('datetime', models.DateTimeField(help_text='Local time (no daylight savings), stored as UTC.', verbose_name='Observation time')),
('location', django.contrib.gis.db.models.fields.PointField(help_text='The observation location as point in WGS84', srid=4326, verbose_name='Location')),
('type', models.CharField(choices=[('start', 'start'), ('end', 'end')], default='start', help_text='Start of end of site visit?', max_length=300, verbose_name='Type')),
],
),
migrations.CreateModel(
name='Survey',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('status', django_fsm.FSMField(choices=[('new', 'New'), ('proofread', 'Proofread'), ('curated', 'Curated'), ('published', 'Published')], default='new', max_length=50, verbose_name='QA Status')),
('source', models.CharField(choices=[('direct', 'Direct entry'), ('paper', 'Paper data sheet'), ('odk', 'OpenDataKit mobile data capture'), ('wamtram', 'WAMTRAM 2 tagging DB'), ('ntp-exmouth', 'NTP Access DB Exmouth'), ('ntp-broome', 'NTP Access DB Broome'), ('cet', 'Cetacean strandings DB'), ('pin', 'Pinniped strandings DB')], default='direct', help_text='Where was this record captured initially?', max_length=300, verbose_name='Data Source')),
('source_id', models.CharField(blank=True, help_text='The ID of the start point in the original source.', max_length=1000, null=True, verbose_name='Source ID')),
('device_id', models.CharField(blank=True, help_text='The ID of the recording device, if available.', max_length=1000, null=True, verbose_name='Device ID')),
('transect', django.contrib.gis.db.models.fields.LineStringField(blank=True, help_text='The surveyed path as LineString in WGS84, optional. E.g. automatically captured by form Track Tally.', null=True, srid=4326, verbose_name='Transect line')),
('start_location', django.contrib.gis.db.models.fields.PointField(blank=True, help_text='The start location as point in WGS84.', null=True, srid=4326, verbose_name='Survey start point')),
('start_time', models.DateTimeField(blank=True, help_text="The datetime of entering the site, shown as local time (no daylight savings), stored as UTC. The time of 'feet in the sand, start recording encounters'.", null=True, verbose_name='Survey start time')),
('start_photo', models.FileField(blank=True, help_text='Site conditions at start of survey.', max_length=500, null=True, upload_to=wastd.observations.models.survey_media, verbose_name='Site photo start')),
('start_comments', models.TextField(blank=True, help_text='Describe any circumstances affecting data collection, e.g. days without surveys.', null=True, verbose_name='Comments at start')),
('end_source_id', models.CharField(blank=True, help_text='The ID of the record in the original source.', max_length=1000, null=True, verbose_name='Source ID of end point')),
('end_device_id', models.CharField(blank=True, help_text='The ID of the recording device which captured the end point, if available.', max_length=1000, null=True, verbose_name='End Device ID')),
('end_location', django.contrib.gis.db.models.fields.PointField(blank=True, help_text='The end location as point in WGS84.', null=True, srid=4326, verbose_name='Survey end point')),
('end_time', models.DateTimeField(blank=True, help_text="The datetime of leaving the site, shown as local time (no daylight savings), stored as UTC. The time of 'feet in the sand, done recording encounters.'", null=True, verbose_name='Survey end time')),
('end_photo', models.FileField(blank=True, help_text='Site conditions at end of survey.', max_length=500, null=True, upload_to=wastd.observations.models.expedition_media, verbose_name='Site photo end')),
('end_comments', models.TextField(blank=True, help_text='Describe any circumstances affecting data collection, e.g. days without surveys.', null=True, verbose_name='Comments at finish')),
('production', models.BooleanField(default=True, help_text='Whether the survey is a real (production) survey, or a training survey.', verbose_name='Production run')),
('reporter', models.ForeignKey(blank=True, help_text='The person who captured the start point, ideally this person also recoreded the encounters and end point.', null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Recorded by')),
('site', models.ForeignKey(blank=True, help_text='The surveyed site, if known.', null=True, on_delete=django.db.models.deletion.PROTECT, to='observations.Area', verbose_name='Surveyed site')),
('team', models.ManyToManyField(blank=True, help_text='Additional field workers, apart from the reporter, who assisted with data collection.', related_name='survey_team', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['start_location', 'start_time'],
},
),
migrations.CreateModel(
name='SurveyEnd',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('source', models.CharField(choices=[('direct', 'Direct entry'), ('paper', 'Paper data sheet'), ('odk', 'OpenDataKit mobile data capture'), ('wamtram', 'WAMTRAM 2 tagging DB'), ('ntp-exmouth', 'NTP Access DB Exmouth'), ('ntp-broome', 'NTP Access DB Broome'), ('cet', 'Cetacean strandings DB'), ('pin', 'Pinniped strandings DB')], default='direct', help_text='Where was this record captured initially?', max_length=300, verbose_name='Data Source')),
('source_id', models.CharField(blank=True, help_text='The ID of the start point in the original source.', max_length=1000, null=True, verbose_name='Source ID')),
('device_id', models.CharField(blank=True, help_text='The ID of the recording device, if available.', max_length=1000, null=True, verbose_name='Device ID')),
('end_location', django.contrib.gis.db.models.fields.PointField(blank=True, help_text='The end location as point in WGS84.', null=True, srid=4326, verbose_name='Survey end point')),
('end_time', models.DateTimeField(blank=True, help_text="The datetime of leaving the site, shown as local time (no daylight savings), stored as UTC. The time of 'feet in the sand, done recording encounters.'", null=True, verbose_name='Survey end time')),
('end_photo', models.FileField(help_text='Site conditions at end of survey.', max_length=500, upload_to=wastd.observations.models.survey_media, verbose_name='Site photo end')),
('end_comments', models.TextField(blank=True, help_text='Describe any circumstances affecting data collection, e.g. days without surveys.', null=True, verbose_name='Comments at finish')),
('reporter', models.ForeignKey(blank=True, help_text='The person who captured the start point, ideally this person also recoreded the encounters and end point.', null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Recorded by')),
('site', models.ForeignKey(blank=True, help_text='The surveyed site, if known.', null=True, on_delete=django.db.models.deletion.PROTECT, to='observations.Area', verbose_name='Surveyed site')),
],
options={
'ordering': ['end_location', 'end_time'],
},
),
migrations.CreateModel(
name='AnimalEncounter',
fields=[
('encounter_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Encounter')),
('taxon', models.CharField(choices=[('na', 'not observed'), ('Cheloniidae', 'Marine turtles'), ('Cetacea', 'Whales and Dolphins'), ('Pinnipedia', 'Pinnipeds'), ('Sirenia', 'Dugongs'), ('Elasmobranchii', 'Sharks and Rays'), ('Hydrophiinae', 'Sea snakes and kraits')], default='Cheloniidae', help_text='The taxonomic group of the animal.', max_length=300, verbose_name='Taxonomic group')),
('species', models.CharField(choices=[('na', 'not observed'), ('natator-depressus', 'Natator depressus (Flatback turtle)'), ('chelonia-mydas', 'Chelonia mydas (Green turtle)'), ('eretmochelys-imbricata', 'Eretmochelys imbricata (Hawksbill turtle)'), ('caretta-caretta', 'Caretta caretta (Loggerhead turtle)'), ('lepidochelys-olivacea', 'Lepidochelys olivacea (Olive ridley turtle)'), ('dermochelys-coriacea', 'Dermochelys coriacea (Leatherback turtle)'), ('chelonia-mydas-agassazzi', 'Chelonia mydas agassazzi (Black turtle or East Pacific Green)'), ('corolla-corolla', 'Corolla corolla (Hatchback turtle)'), ('cheloniidae-fam', 'Cheloniidae (Unidentified turtle)'), ('delphinus-delphis', 'Delphinus delphis (Short-beaked common dolphin)'), ('grampus-griseus', "Grampus griseus (Risso's dolphin)"), ('lagenodelphis-hosei', "Lagenodelphis hosei (Fraser's dolphin)"), ('lagenorhynchus-obscurus', 'Lagenorhynchus obscurus (Dusky dolphin)'), ('orcaella-heinsohni', 'Orcaella heinsohni (Australian snubfin dolphin)'), ('sousa-sahulensis', 'Sousa sahulensis (Australian humpback dolphin)'), ('sousa-chinensis', 'Sousa chinensis (Chinese white dolphin)'), ('stenella-attenuata', 'Stenella attenuata (Pantropical spotted dolphin)'), ('stenella-coeruleoalba', 'Stenella coeruleoalba (Striped dolphin)'), ('stenella-longirostris', 'Stenella longirostris (Spinner dolphin)'), ('stenella-sp', 'Stenella sp. (Unidentified spotted dolphin)'), ('steno-bredanensis', 'Steno bredanensis (Rough-toothed dolphin)'), ('tursiops-aduncus', 'Tursiops aduncus (Indo-Pacific bottlenose dolphin)'), ('tursiops-truncatus', 'Tursiops truncatus (Offshore bottlenose dolphin)'), ('tursiops-sp', 'Tursiops sp. (Unidentified bottlenose dolphin)'), ('delphinidae-fam', 'Unidentified dolphin'), ('balaenoptera-acutorostrata', 'Balaenoptera acutorostrata (Dwarf minke whale)'), ('balaenoptera-bonaerensis', 'Balaenoptera bonaerensis (Antarctic minke whale)'), ('balaenoptera-borealis', 'Balaenoptera borealis (Sei whale)'), ('balaenoptera-edeni', "Balaenoptera edeni (Bryde's whale)"), ('balaenoptera-musculus', 'Balaenoptera musculus (Blue whale)'), ('balaenoptera-musculus-brevicauda', 'Balaenoptera musculus brevicauda (Pygmy blue whale)'), ('balaenoptera-physalus', 'Balaenoptera physalus (Fin whale)'), ('balaenoptera-omurai', "Balaenoptera omurai (Omura's whale)"), ('balaenoptera-sp', 'Balaenoptera sp. (Unidentified Balaenoptera)'), ('caperea-marginata', 'Caperea marginata (Pygmy Right Whale)'), ('eubalaena-australis', 'Eubalaena australis (Southern right whale)'), ('feresa-attenuata', 'Feresa attenuata (Pygmy killer whale)'), ('globicephala-macrorhynchus', 'Globicephala macrorhynchus (Short-finned pilot whale)'), ('globicephala-melas', 'Globicephala melas (Long-finned pilot whale)'), ('globicephala-sp', 'Globicephala sp. (Unidentified pilot whale)'), ('indopacetus-pacificus', "Indopacetus pacificus (Longman's beaked whale)"), ('kogia-breviceps', 'Kogia breviceps (Pygmy sperm whale)'), ('kogia-sima', 'Kogia sima (Dwarf sperm whale)'), ('kogia-sp', 'Kogia sp. (Unidentified small sperm whale)'), ('megaptera-novaeangliae', 'Megaptera novaeangliae (Humpback whale)'), ('mesoplodon-bowdoini', "Mesoplodon bowdoini (Andew's beaked whale)"), ('mesoplodon-densirostris', "Mesoplodon densirostris (Blainville's beaked whale)"), ('mesoplodon-grayi', "Mesoplodon grayi (Gray's beaked whale)"), ('mesoplodon-hectori', "Mesoplodon hectori (Hector's beaked whale"), ('mesoplodon-layardii', 'Mesoplodon layardii (Strap-toothed whale)'), ('mesoplodon-mirus', "Mesoplodon mirus (True's beaked whale)"), ('mesoplodon-sp', 'Mesoplodon sp. (Beaked whale)'), ('berardius-arnuxii', 'Berardius arnuxii (Giant beaked whale)'), ('orcinus-orca', 'Orcinus orca (Killer whale)'), ('peponocephala-electra', 'Peponocephala electra (Melon-headed whale)'), ('physeter-macrocephalus', 'Physeter macrocephalus (Sperm whale)'), ('pseudorca-crassidens', 'Pseudorca crassidens (False killer whale)'), ('ziphius-cavirostris', "Ziphius cavirostris (Cuvier's beaked whale)"), ('tasmacetus-shepherdi', "Tasmacetus shepherdi (Shepherd's beaked whale)"), ('cetacea', 'Unidentified whale'), ('dugong-dugon', 'Dugong dugon (Dugong)'), ('arctocephalus-forsteri', 'Arctocephalus forsteri (New Zealand fur seal)'), ('neophoca-cinerea', 'Neophoca cinerea (Australian sea lion)'), ('arctocephalus-tropicalis', 'Arctocephalus tropicalis (Subantarctic fur seal)'), ('hydrurga-leptonyx', 'Hydrurga leptonyx (Leopard seal)'), ('lobodon-carcinophagus', 'Lobodon carcinophagus (Crabeater seal)'), ('mirounga-leonina', 'Mirounga leonina (Southern elephant seal)'), ('pinnipedia', 'Unidentified pinniped'), ('hydrophiinae-subfam', 'Hydrophiinae subfam. (Sea snakes and kraits)'), ('acalyptophis-sp', 'Acalyptophis sp. (Horned sea snake)'), ('aipysurus-sp', 'Aipysurus sp. (Olive sea snake)'), ('astrotia-sp', "Astrotia sp. (Stokes' sea snake)"), ('emydocephalus-sp', 'Emydocephalus sp. (Turtlehead sea snake)'), ('enhydrina-sp', 'Enhydrina sp. (Beaked sea snake)'), ('ephalophis-sp', "Ephalophis sp. (Grey's mudsnake)"), ('hydrelaps-sp', 'Hydrelaps sp. (Port Darwin mudsnake)'), ('hydrophis-sp', 'Hydrophis sp. (sea snake)'), ('kerilia-sp', "Kerilia sp. (Jerdon's sea snake)"), ('kolpophis-sp', 'Kolpophis sp. (bighead sea snake)'), ('lapemis-sp', "Lapemis sp. (Shaw's sea snake)"), ('laticauda-sp', 'Laticauda sp. (Sea krait)'), ('parahydrophis-sp', 'Parahydrophis (Northern mangrove sea snake)'), ('parapistocalamus-sp', "Parapistocalamus sp. (Hediger's snake)"), ('pelamis-sp', 'Pelamis sp. (Yellow-bellied sea snake)'), ('praescutata-sp', 'Praescutata sp. (Sea snake)'), ('thalassophis-sp', 'Thalassophis sp. (Sea snake)')], default='unidentified', help_text='The species of the animal.', max_length=300, verbose_name='Species')),
('sex', models.CharField(choices=[('na', 'unknown sex'), ('male', 'male'), ('female', 'female'), ('intersex', 'hermaphrodite or intersex')], default='na', help_text="The animal's sex.", max_length=300, verbose_name='Sex')),
('maturity', models.CharField(choices=[('na', 'unknown maturity'), ('hatchling', 'hatchling'), ('post-hatchling', 'post-hatchling'), ('juvenile', 'juvenile'), ('pre-pubsecent-immature', 'pre-pubsecent immature'), ('pubsecent-immature', 'pubsecent immature'), ('sub-adult', 'sub-adult'), ('adult-measured', 'adult (status determined from carapace and tail measurements)'), ('unweaned', 'unweaned immature'), ('weaned', 'weaned immature'), ('adult', 'adult')], default='na', help_text="The animal's maturity.", max_length=300, verbose_name='Maturity')),
('health', models.CharField(choices=[('na', 'unknown health'), ('alive', 'alive, healthy'), ('alive-injured', 'alive, injured'), ('alive-then-died', 'D1 (alive, then died)'), ('dead-edible', 'D2 (dead, fresh)'), ('dead-organs-intact', 'D3 (dead, organs intact)'), ('dead-advanced', 'D4 (dead, organs decomposed)'), ('dead-mummified', 'D5 (dead, mummified)'), ('dead-disarticulated', 'D6 (dead, disarticulated)'), ('other', 'other')], default='na', help_text='On a scale from the Fresh Prince of Bel Air to 80s Hair Metal: how dead and decomposed is the animal?', max_length=300, verbose_name='Health status')),
('activity', models.CharField(choices=[('na', 'not observed'), ('arriving', 'arriving on beach'), ('approaching', 'approaching nesting site'), ('digging-body-pit', 'digging body pit'), ('excavating-egg-chamber', 'excavating egg chamber'), ('laying-eggs', 'laying eggs'), ('filling-in-egg-chamber', 'filling in egg chamber'), ('filling-in-nest', 'filling in nest'), ('camouflaging-nest', 'camouflaging nest'), ('returning-to-water', 'returning to water'), ('general-breeding-activity', 'general breeding activity'), ('floating', 'floating (dead, sick, unable to dive, drifting in water)'), ('beach-washed', 'beach washed (dead, sick or stranded on beach/coast)'), ('beach-jumped', 'beach jumped'), ('carcass-tagged-released', 'carcass tagged and released'), ('carcass-inland', 'carcass or butchered remains found removed from coast'), ('captivity', 'in captivity'), ('non-breeding', 'general non-breeding activity (swimming, sleeping, feeding, etc.)'), ('other', 'other activity')], default='na', help_text="The animal's activity at the time of observation.", max_length=300, verbose_name='Activity')),
('behaviour', models.TextField(blank=True, help_text='Notes on condition or behaviour.', null=True, verbose_name='Condition and behaviour')),
('habitat', models.CharField(choices=[('na', 'unknown habitat'), ('beach-below-high-water', '(B) beach below high water mark'), ('beach-above-high-water', '(A) beach above high water mark and dune'), ('beach-edge-of-vegetation', '(E) edge of vegetation'), ('in-dune-vegetation', '(V) inside vegetation'), ('beach', 'beach (below vegetation line)'), ('bays-estuaries', 'bays, estuaries and other enclosed shallow soft sediments'), ('dune', 'dune'), ('dune-constructed-hard-substrate', 'dune, constructed hard substrate (concrete slabs, timber floors, helipad)'), ('dune-grass-area', 'dune, grass area'), ('dune-compacted-path', 'dune, hard compacted areas (road ways, paths)'), ('dune-rubble', 'dune, rubble, usually coral'), ('dune-bare-sand', 'dune, bare sand area'), ('dune-beneath-vegetation', 'dune, beneath tree or shrub'), ('slope-front-dune', 'dune, front slope'), ('sand-flats', 'sand flats'), ('slope-grass', 'slope, grass area'), ('slope-bare-sand', 'slope, bare sand area'), ('slope-beneath-vegetation', 'slope, beneath tree or shrub'), ('below-mean-spring-high-water-mark', 'below the mean spring high water line or current level of inundation (old db value)'), ('below-mshwm', 'below the mean spring high water line or current level of inundation'), ('lagoon-patch-reef', 'lagoon, patch reef'), ('lagoon-open-sand', 'lagoon, open sand areas'), ('mangroves', 'mangroves'), ('reef-coral', 'coral reef'), ('reef-crest-front-slope', 'reef crest (dries at low water) and front reef slope areas'), ('reef-flat', 'reef flat, dries at low tide'), ('reef-seagrass-flats', 'coral reef with seagrass flats'), ('reef-rocky', 'rocky reef'), ('open-water', 'open water'), ('harbour', 'harbour'), ('boat-ramp', 'boat ramp')], default='na', help_text='The habitat in which the animal was encountered.', max_length=500, verbose_name='Habitat')),
('nesting_event', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Was the animal nesting?', max_length=300, verbose_name='Nesting event')),
('laparoscopy', models.BooleanField(default=False, help_text="Was the animal's sex and maturity determined through laparoscopy?", max_length=300, verbose_name='Laparoscopy conducted')),
('checked_for_injuries', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Was the animal checked for injuries, were any found?', max_length=300, verbose_name='Checked for injuries')),
('scanned_for_pit_tags', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Was the animal scanned for PIT tags, were any found?', max_length=300, verbose_name='Scanned for PIT tags')),
('checked_for_flipper_tags', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Was the animal checked for flipper tags, were any found?', max_length=300, verbose_name='Checked for flipper tags')),
('cause_of_death', models.CharField(choices=[('na', 'not observed'), ('indeterminate-decomposed', 'Indeterminate due to decomposition'), ('boat-strike', 'Boat strike'), ('trauma-human-induced', 'Human induced trauma'), ('trauma-animal-induced', 'Animal induced trauma'), ('drowned-entangled-fisheries', 'Drowned entangled in fisheries equipment'), ('drowned-entangled-infrastructure', 'Drowned entangled in infrastructure'), ('drowned-entangled-debris', 'Drowned entangled in debris'), ('drowned-entangled', 'Drowned entangled'), ('drowned-other', 'Drowned'), ('fishery-bycatch', 'Fishery bycatch'), ('handling-accident', 'Handling accident'), ('car-collision', 'Car collision'), ('ingested-debris', 'Ingested debris'), ('harvest', 'Harvested for human consumption'), ('poisoned', 'Poisoned'), ('misorientation', 'Misorientation on beach'), ('natural', 'Natural death'), ('birthing', 'Birthing complications'), ('still-born', 'Still birth'), ('calf-failure-to-thrive', 'Calf failed to thrive'), ('starved', 'Starvation'), ('stranded', 'Stranding'), ('euthanasia-firearm', 'Euthanasia by firearm'), ('euthanasia-injection', 'Euthanasia by injection'), ('euthanasia-implosion', 'Euthanasia by implosion'), ('euthanasia', 'Euthanasia'), ('predation', 'Predation')], default='na', help_text='If dead, is the case of death known?', max_length=300, verbose_name='Cause of death')),
('cause_of_death_confidence', models.CharField(choices=[('na', 'not observed'), ('guess', 'Guess based on insuffient evidence'), ('expert-opinion', 'Expert opinion based on available evidence'), ('validated', 'Validated by authoritative source')], default='na', help_text='What is the cause of death, if known, based on?', max_length=300, verbose_name='Cause of death confidence')),
],
options={
'verbose_name': 'Animal Encounter',
'verbose_name_plural': 'Animal Encounters',
'ordering': ['when', 'where'],
'get_latest_by': 'when',
},
bases=('observations.encounter',),
),
migrations.CreateModel(
name='DispatchRecord',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('sent_to', models.ForeignKey(blank=True, help_text='The receiver of the dispatch.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='receiver', to=settings.AUTH_USER_MODEL, verbose_name='Sent to')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='DugongMorphometricObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('body_length_mm', models.PositiveIntegerField(blank=True, help_text='The body length in millimetres.', null=True, verbose_name='Body length (mm)')),
('body_girth_mm', models.PositiveIntegerField(blank=True, help_text='The body girth at the widest point in millimetres.', null=True, verbose_name='Body girth (mm)')),
('tail_fluke_width_mm', models.PositiveIntegerField(blank=True, help_text='The tail fluke width in millimetres.', null=True, verbose_name='Tail fluke width (mm)')),
('tusks_found', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Did the animal have tusks?', max_length=300, verbose_name='Tusks found')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='HatchlingMorphometricObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('straight_carapace_length_mm', models.PositiveIntegerField(blank=True, help_text='The straight carapace length in millimetres.', null=True, verbose_name='Straight carapace length (mm)')),
('straight_carapace_width_mm', models.PositiveIntegerField(blank=True, help_text='The straight carapace width in millimetres.', null=True, verbose_name='Straight carapace width (mm)')),
('body_weight_g', models.PositiveIntegerField(blank=True, help_text='The body weight in grams (1000 g = 1kg).', null=True, verbose_name='Body weight (g)')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='LineTransectEncounter',
fields=[
('encounter_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Encounter')),
('transect', django.contrib.gis.db.models.fields.LineStringField(help_text='The line transect as LineString in WGS84', srid=4326, verbose_name='Transect line')),
],
options={
'verbose_name': 'Line Transect Encounter',
'verbose_name_plural': 'Line Transect Encounters',
'ordering': ['when', 'where'],
'get_latest_by': 'when',
},
bases=('observations.encounter',),
),
migrations.CreateModel(
name='LoggerEncounter',
fields=[
('encounter_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Encounter')),
('logger_type', models.CharField(choices=[('temperature-logger', 'Temperature Logger'), ('data-logger', 'Data Logger'), ('ctd-data-logger', 'Conductivity, Temperature, Depth SR data logger')], default='temperature-logger', help_text='The logger type.', max_length=300, verbose_name='Type')),
('deployment_status', models.CharField(choices=[('programmed', 'programmed'), ('posted', 'posted to field team'), ('deployed', 'deployed in situ'), ('resighted', 'resighted in situ'), ('retrieved', 'retrieved in situ'), ('downloaded', 'downloaded')], default='resighted', help_text='The logger life cycle status.', max_length=300, verbose_name='Status')),
('logger_id', models.CharField(blank=True, help_text='The ID of a logger must be unique within the tag type.', max_length=1000, null=True, verbose_name='Logger ID')),
],
options={
'verbose_name': 'Logger Encounter',
'verbose_name_plural': 'Logger Encounters',
'ordering': ['when', 'where'],
'get_latest_by': 'when',
},
bases=('observations.encounter',),
),
migrations.CreateModel(
name='ManagementAction',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('management_actions', models.TextField(blank=True, help_text='Managment actions taken. Keep updating as appropriate.', null=True, verbose_name='Management Actions')),
('comments', models.TextField(blank=True, help_text='Any other comments or notes.', null=True, verbose_name='Comments')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='MediaAttachment',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('media_type', models.CharField(choices=[('data_sheet', 'Data sheet'), ('communication', 'Communication record'), ('photograph', 'Photograph'), ('other', 'Other')], default='photograph', help_text='What is the attached file about?', max_length=300, verbose_name='Attachment type')),
('title', models.CharField(blank=True, help_text='Give the attachment a representative name', max_length=300, null=True, verbose_name='Attachment name')),
('attachment', models.FileField(help_text='Upload the file', max_length=500, upload_to=wastd.observations.models.encounter_media, verbose_name='File attachment')),
],
bases=('observations.observation',),
),
migrations.CreateModel(
name='NestTagObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('status', models.CharField(choices=[('applied-new', 'applied new'), ('resighted', 're-sighted associated with nest')], default='resighted', help_text='The status this tag was seen in, or brought into.', max_length=300, verbose_name='Tag status')),
('flipper_tag_id', models.CharField(blank=True, help_text='The primary flipper tag ID of the nesting turtle if available.', max_length=1000, null=True, verbose_name='Flipper Tag ID')),
('date_nest_laid', models.DateField(blank=True, help_text='The calendar (not turtle) date of nest creation.', null=True, verbose_name='Date nest laid')),
('tag_label', models.CharField(blank=True, help_text='Any extra nest label if other two components are not available.', max_length=1000, null=True, verbose_name='Tag Label')),
('comments', models.TextField(blank=True, help_text='Any other comments or notes.', null=True, verbose_name='Comments')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='SiteVisit',
fields=[
('expedition_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Expedition')),
('source', models.CharField(choices=[('direct', 'Direct entry'), ('paper', 'Paper data sheet'), ('odk', 'OpenDataKit mobile data capture'), ('wamtram', 'WAMTRAM 2 tagging DB'), ('ntp-exmouth', 'NTP Access DB Exmouth'), ('ntp-broome', 'NTP Access DB Broome'), ('cet', 'Cetacean strandings DB'), ('pin', 'Pinniped strandings DB')], default='direct', help_text='Where was this record captured initially?', max_length=300, verbose_name='Data Source')),
('source_id', models.CharField(blank=True, help_text='The ID of the start point in the original source, or a newly allocated ID if left blank. Delete and save to regenerate this ID.', max_length=1000, null=True, verbose_name='Source ID')),
('end_source_id', models.CharField(blank=True, help_text='The ID of the record in the original source, or a newly allocated ID if left blank. Delete and save to regenerate this ID.', max_length=1000, null=True, verbose_name='Source ID of end point')),
('start_location', django.contrib.gis.db.models.fields.PointField(blank=True, help_text='The start location as point in WGS84', null=True, srid=4326, verbose_name='Start location')),
('end_location', django.contrib.gis.db.models.fields.PointField(blank=True, help_text='The end location as point in WGS84', null=True, srid=4326, verbose_name='End location')),
('transect', django.contrib.gis.db.models.fields.LineStringField(blank=True, help_text='The surveyed path as LineString in WGS84, optional.', null=True, srid=4326, verbose_name='Transect line')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.expedition',),
),
migrations.CreateModel(
name='TagObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('tag_type', models.CharField(choices=[('flipper-tag', 'Flipper Tag'), ('pit-tag', 'PIT Tag'), ('sat-tag', 'Satellite Relay Data Logger'), ('blood-sample', 'Blood Sample'), ('biopsy-sample', 'Biopsy Sample'), ('stomach-content-sample', 'Stomach Content Sample'), ('physical-sample', 'Physical Sample'), ('egg-sample', 'Egg Sample'), ('qld-monel-a-flipper-tag', 'QLD Monel Series A flipper tag'), ('qld-titanium-k-flipper-tag', 'QLD Titanium Series K flipper tag'), ('qld-titanium-t-flipper-tag', 'QLD Titanium Series T flipper tag'), ('acoustic-tag', 'Acoustic tag'), ('commonwealth-titanium-flipper-tag', 'Commonwealth titanium flipper tag (old db value)'), ('cmlth-titanium-flipper-tag', 'Commonwealth titanium flipper tag'), ('cayman-juvenile-tag', 'Cayman juvenile tag'), ('hawaii-inconel-flipper-tag', 'Hawaii Inst Mar Biol Inconel tag'), ('ptt', 'Platform Transmitter Terminal (PTT)'), ('rototag', 'RotoTag'), ('narangebub-nickname', 'Narangebup rehab informal name'), ('aqwa-nickname', 'AQWA informal name'), ('atlantis-nickname', 'Atlantis informal name'), ('wa-museum-reptile-registration-number', 'WA Museum Natural History Reptiles Catalogue Registration Number (old db value)'), ('wam-reptile-registration-number', 'WA Museum Natural History Reptiles Catalogue Registration Number'), ('genetic-tag', 'Genetic ID sequence'), ('other', 'Other')], default='flipper-tag', help_text='What kind of tag is it?', max_length=300, verbose_name='Tag type')),
('tag_location', models.CharField(choices=[('head', 'head'), ('eyes', 'eyes'), ('neck', 'neck'), ('plastron', 'plastron'), ('carapace', 'carapace'), ('internals', 'internals'), ('cloaca', 'cloaca'), ('tail', 'tail'), ('flipper-front-left-1', 'front left flipper, 1st scale from body'), ('flipper-front-left-2', 'front left flipper, 2nd scale from body'), ('flipper-front-left-3', 'front left flipper, 3rd scale from body'), ('flipper-front-left', 'front left flipper'), ('flipper-front-right-1', 'front right flipper, 1st scale from body'), ('flipper-front-right-2', 'front right flipper, 2nd scale from body'), ('flipper-front-right-3', 'front right flipper, 3rd scale from body'), ('flipper-front-right', 'front right flipper'), ('flipper-rear-left', 'rear left flipper'), ('flipper-rear-right', 'rear right flipper'), ('shoulder-left', 'left shoulder'), ('shoulder-right', 'right shoulder'), ('whole', 'whole turtle'), ('other', 'Other')], default='whole', help_text='Where is the tag attached, or the sample taken from?', max_length=300, verbose_name='Tag position')),
('name', models.CharField(help_text='The ID of a tag must be unique within the tag type.', max_length=1000, verbose_name='Tag ID')),
('status', models.CharField(choices=[('ordered', 'ordered from manufacturer'), ('produced', 'produced by manufacturer'), ('delivered', 'delivered to HQ'), ('allocated', 'allocated to field team'), ('applied-new', 'applied new'), ('resighted', 're-sighted associated with animal'), ('reclinched', 're-sighted and reclinched on animal'), ('removed', 'taken off animal'), ('found', 'found detached'), ('returned', 'returned to HQ'), ('decommissioned', 'decommissioned'), ('destroyed', 'destroyed'), ('observed', 'observed in any other context, see comments')], default='resighted', help_text='The status this tag was seen in, or brought into.', max_length=300, verbose_name='Tag status')),
('comments', models.TextField(blank=True, help_text='Any other comments or notes.', null=True, verbose_name='Comments')),
('handler', models.ForeignKey(blank=True, help_text='The person in physical contact with the tag or sample', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tag_handler', to=settings.AUTH_USER_MODEL, verbose_name='Handled by')),
('recorder', models.ForeignKey(blank=True, help_text='The person who records the tag observation', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tag_recorder', to=settings.AUTH_USER_MODEL, verbose_name='Recorded by')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='TemperatureLoggerDeployment',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('depth_mm', models.PositiveIntegerField(blank=True, help_text='The depth of the buried logger in mm.', null=True, verbose_name='Logger depth (mm)')),
('marker1_present', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Is the first marker in place?', max_length=300, verbose_name='Marker 1 present')),
('distance_to_marker1_mm', models.PositiveIntegerField(blank=True, help_text='The distance to the first marker in mm.', null=True, verbose_name='Distance to marker 1 (mm)')),
('marker2_present', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Is the second marker in place?', max_length=300, verbose_name='Marker 2 present')),
('distance_to_marker2_mm', models.PositiveIntegerField(blank=True, help_text='The distance to the second marker in mm.', null=True, verbose_name='Distance to marker 2 (mm)')),
('habitat', models.CharField(choices=[('na', 'unknown habitat'), ('beach-below-high-water', '(B) beach below high water mark'), ('beach-above-high-water', '(A) beach above high water mark and dune'), ('beach-edge-of-vegetation', '(E) edge of vegetation'), ('in-dune-vegetation', '(V) inside vegetation'), ('beach', 'beach (below vegetation line)'), ('bays-estuaries', 'bays, estuaries and other enclosed shallow soft sediments'), ('dune', 'dune'), ('dune-constructed-hard-substrate', 'dune, constructed hard substrate (concrete slabs, timber floors, helipad)'), ('dune-grass-area', 'dune, grass area'), ('dune-compacted-path', 'dune, hard compacted areas (road ways, paths)'), ('dune-rubble', 'dune, rubble, usually coral'), ('dune-bare-sand', 'dune, bare sand area'), ('dune-beneath-vegetation', 'dune, beneath tree or shrub'), ('slope-front-dune', 'dune, front slope'), ('sand-flats', 'sand flats'), ('slope-grass', 'slope, grass area'), ('slope-bare-sand', 'slope, bare sand area'), ('slope-beneath-vegetation', 'slope, beneath tree or shrub'), ('below-mean-spring-high-water-mark', 'below the mean spring high water line or current level of inundation (old db value)'), ('below-mshwm', 'below the mean spring high water line or current level of inundation'), ('lagoon-patch-reef', 'lagoon, patch reef'), ('lagoon-open-sand', 'lagoon, open sand areas'), ('mangroves', 'mangroves'), ('reef-coral', 'coral reef'), ('reef-crest-front-slope', 'reef crest (dries at low water) and front reef slope areas'), ('reef-flat', 'reef flat, dries at low tide'), ('reef-seagrass-flats', 'coral reef with seagrass flats'), ('reef-rocky', 'rocky reef'), ('open-water', 'open water'), ('harbour', 'harbour'), ('boat-ramp', 'boat ramp')], default='na', help_text='The habitat in which the nest was encountered.', max_length=500, verbose_name='Habitat')),
('distance_to_vegetation_mm', models.PositiveIntegerField(blank=True, help_text='The distance to the beach-vegetation border in mm. Positive values if logger is located on beach, negative values if in vegetation.', null=True, verbose_name='Distance to vegetation (mm)')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='TemperatureLoggerSettings',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('logging_interval', models.DurationField(blank=True, help_text='The time between individual readings as python timedelta string. E.g, 1h is `01:00:00`; 1 day is `1 00:00:00`.', null=True, verbose_name='Logging interval')),
('recording_start', models.DateTimeField(blank=True, help_text='The preset start of recording, stored as UTC and shown in local time.', null=True, verbose_name='Recording start')),
('tested', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Was the logger tested after programming?', max_length=300, verbose_name='Tested')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='TrackTallyObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('species', models.CharField(choices=[('natator-depressus', 'Natator depressus (Flatback turtle)'), ('chelonia-mydas', 'Chelonia mydas (Green turtle)'), ('eretmochelys-imbricata', 'Eretmochelys imbricata (Hawksbill turtle)'), ('caretta-caretta', 'Caretta caretta (Loggerhead turtle)'), ('lepidochelys-olivacea', 'Lepidochelys olivacea (Olive ridley turtle)'), ('dermochelys-coriacea', 'Dermochelys coriacea (Leatherback turtle)'), ('chelonia-mydas-agassazzi', 'Chelonia mydas agassazzi (Black turtle or East Pacific Green)'), ('corolla-corolla', 'Corolla corolla (Hatchback turtle)'), ('cheloniidae-fam', 'Cheloniidae (Unidentified turtle)')], default='cheloniidae-fam', help_text='The species of the animal causing the track.', max_length=300, verbose_name='Species')),
('nest_age', models.CharField(choices=[('old', '(O) old, made before last night'), ('fresh', '(F) fresh, made last night'), ('unknown', '(U) unknown age'), ('missed', '(M) missed turtle, made within past hours')], default='unknown', help_text='The track or nest age.', max_length=300, verbose_name='Age')),
('nest_type', models.CharField(choices=[('track-not-assessed', 'track, not checked for nest'), ('false-crawl', 'track without nest'), ('successful-crawl', 'track with nest'), ('track-unsure', 'track, checked for nest, unsure if nest'), ('nest', 'nest, unhatched, no track'), ('hatched-nest', 'nest, hatched'), ('body-pit', 'body pit, no track')], default='track-not-assessed', help_text='The track or nest type.', max_length=300, verbose_name='Type')),
('tally', models.PositiveIntegerField(blank=True, help_text='The sum of encountered tracks.', null=True, verbose_name='Tally')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='TurtleDamageObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('body_part', models.CharField(choices=[('head', 'head'), ('eyes', 'eyes'), ('neck', 'neck'), ('plastron', 'plastron'), ('carapace', 'carapace'), ('internals', 'internals'), ('cloaca', 'cloaca'), ('tail', 'tail'), ('flipper-front-left-1', 'front left flipper, 1st scale from body'), ('flipper-front-left-2', 'front left flipper, 2nd scale from body'), ('flipper-front-left-3', 'front left flipper, 3rd scale from body'), ('flipper-front-left', 'front left flipper'), ('flipper-front-right-1', 'front right flipper, 1st scale from body'), ('flipper-front-right-2', 'front right flipper, 2nd scale from body'), ('flipper-front-right-3', 'front right flipper, 3rd scale from body'), ('flipper-front-right', 'front right flipper'), ('flipper-rear-left', 'rear left flipper'), ('flipper-rear-right', 'rear right flipper'), ('shoulder-left', 'left shoulder'), ('shoulder-right', 'right shoulder'), ('whole', 'whole turtle'), ('other', 'Other')], default='whole-turtle', help_text='The body part affected by the observed damage.', max_length=300, verbose_name='Affected body part')),
('damage_type', models.CharField(choices=[('tip-amputated', 'tip amputation'), ('amputated-from-nail', 'amputation from nail'), ('amputated-half', 'half amputation'), ('amputated-entirely', 'entire amputation'), ('barnacles', 'barnacles'), ('algal-growth', 'algal growth'), ('tumor', 'tumor'), ('tag-scar', 'tag scar'), ('tag-seen', 'tag seen but not identified'), ('cuts', 'cuts'), ('boat-strike', 'boat or propeller strike'), ('entanglement', 'entanglement'), ('deformity', 'deformity'), ('other', 'other')], default='minor-trauma', help_text='The type of the damage.', max_length=300, verbose_name='Damage type')),
('damage_age', models.CharField(choices=[('healed-entirely', 'entirely healed'), ('healed-partially', 'partially healed'), ('fresh', 'fresh')], default='healed-entirely', help_text='The age of the damage.', max_length=300, verbose_name='Damage age')),
('description', models.TextField(blank=True, help_text='A description of the damage.', null=True, verbose_name='Description')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='TurtleMorphometricObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('curved_carapace_length_mm', models.PositiveIntegerField(blank=True, help_text='The curved carapace length in millimetres.', null=True, verbose_name='Curved carapace length (mm)')),
('curved_carapace_length_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Curved carapace length accuracy')),
('straight_carapace_length_mm', models.PositiveIntegerField(blank=True, help_text='The straight carapace length in millimetres.', null=True, verbose_name='Straight carapace length (mm)')),
('straight_carapace_length_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Straight carapace length accuracy')),
('curved_carapace_width_mm', models.PositiveIntegerField(blank=True, help_text='Curved carapace width in millimetres.', null=True, verbose_name='Curved carapace width (mm)')),
('curved_carapace_width_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Curved carapace width (mm)')),
('tail_length_carapace_mm', models.PositiveIntegerField(blank=True, help_text='The tail length in millimetres, measured from carapace to tip.', null=True, verbose_name='Tail length from carapace (mm)')),
('tail_length_carapace_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Tail length from carapace accuracy')),
('tail_length_vent_mm', models.PositiveIntegerField(blank=True, help_text='The tail length in millimetres, measured from vent to tip.', null=True, verbose_name='Tail length from vent (mm)')),
('tail_length_vent_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Tail Length Accuracy')),
('tail_length_plastron_mm', models.PositiveIntegerField(blank=True, help_text='The tail length in millimetres, measured from plastron to tip.', null=True, verbose_name='Tail length from plastron (mm)')),
('tail_length_plastron_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Tail length from plastron accuracy')),
('maximum_head_width_mm', models.PositiveIntegerField(blank=True, help_text='The maximum head width in millimetres.', null=True, verbose_name='Maximum head width (mm)')),
('maximum_head_width_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Maximum head width accuracy')),
('maximum_head_length_mm', models.PositiveIntegerField(blank=True, help_text='The maximum head length in millimetres.', null=True, verbose_name='Maximum head length (mm)')),
('maximum_head_length_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Maximum head length accuracy')),
('body_depth_mm', models.PositiveIntegerField(blank=True, help_text='The body depth, plastron to carapace, in millimetres.', null=True, verbose_name='Body depth (mm)')),
('body_depth_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Body depth accuracy')),
('body_weight_g', models.PositiveIntegerField(blank=True, help_text='The body weight in grams (1000 g = 1kg).', null=True, verbose_name='Body weight (g)')),
('body_weight_accuracy', models.CharField(blank=True, choices=[('1', 'To nearest 1 mm'), ('5', 'To nearest 5 mm'), ('10', 'To nearest 1 cm'), ('100', 'To nearest 10 cm'), ('1000', 'To nearest 1 m or 1 kg'), ('10000', 'To nearest 10 m or 10 kg')], help_text='The expected measurement accuracy.', max_length=300, null=True, verbose_name='Body weight accuracy')),
('handler', models.ForeignKey(blank=True, help_text='The person conducting the measurements.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='morphometric_handler', to=settings.AUTH_USER_MODEL, verbose_name='Measured by')),
('recorder', models.ForeignKey(blank=True, help_text='The person recording the measurements.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='morphometric_recorder', to=settings.AUTH_USER_MODEL, verbose_name='Recorded by')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='TurtleNestDisturbanceObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('disturbance_cause', models.CharField(choices=[('turtle', '(A)nother turtle'), ('bandicoot', '(Ba)ndicoot predation'), ('bird', '(Bi)rd predation'), ('crab', '(Cr)ab predation'), ('croc', '(Cr)oc predation'), ('cyclone', '(Cy)clone disturbance'), ('dingo', '(Di)ngo predation'), ('dog', '(Do)g predation'), ('fox', '(F)ox predation'), ('goanna', '(G)oanna predation'), ('human', '(Hu)man'), ('pig', '(P)ig predation'), ('tide', '(Ti)dal disturbance'), ('vehicle', '(V)ehicle damage'), ('unknown', '(U)nknown'), ('other', '(O)ther identifiable (see comments)')], help_text='The cause of the disturbance.', max_length=300, verbose_name='Disturbance cause')),
('disturbance_cause_confidence', models.CharField(choices=[('na', 'not observed'), ('guess', 'Guess based on insuffient evidence'), ('expert-opinion', 'Expert opinion based on available evidence'), ('validated', 'Validated by authoritative source')], default='na', help_text='What is the choice of disturbance cause based on?', max_length=300, verbose_name='Disturbance cause choice confidence')),
('disturbance_severity', models.CharField(choices=[('partly', 'nest partly destroyed'), ('completely', 'nest completely destroyed'), ('na', 'nest in indeterminate condition')], default='na', help_text='The impact of the disturbance on nest viability.', max_length=300, verbose_name='Disturbance severity')),
('comments', models.TextField(blank=True, help_text='Any other comments or notes.', null=True, verbose_name='Comments')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='TurtleNestDisturbanceTallyObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('species', models.CharField(choices=[('natator-depressus', 'Natator depressus (Flatback turtle)'), ('chelonia-mydas', 'Chelonia mydas (Green turtle)'), ('eretmochelys-imbricata', 'Eretmochelys imbricata (Hawksbill turtle)'), ('caretta-caretta', 'Caretta caretta (Loggerhead turtle)'), ('lepidochelys-olivacea', 'Lepidochelys olivacea (Olive ridley turtle)'), ('dermochelys-coriacea', 'Dermochelys coriacea (Leatherback turtle)'), ('chelonia-mydas-agassazzi', 'Chelonia mydas agassazzi (Black turtle or East Pacific Green)'), ('corolla-corolla', 'Corolla corolla (Hatchback turtle)'), ('cheloniidae-fam', 'Cheloniidae (Unidentified turtle)')], default='cheloniidae-fam', help_text='The species of the nesting animal.', max_length=300, verbose_name='Species')),
('disturbance_cause', models.CharField(choices=[('turtle', '(A)nother turtle'), ('bandicoot', '(Ba)ndicoot predation'), ('bird', '(Bi)rd predation'), ('crab', '(Cr)ab predation'), ('croc', '(Cr)oc predation'), ('cyclone', '(Cy)clone disturbance'), ('dingo', '(Di)ngo predation'), ('dog', '(Do)g predation'), ('fox', '(F)ox predation'), ('goanna', '(G)oanna predation'), ('human', '(Hu)man'), ('pig', '(P)ig predation'), ('tide', '(Ti)dal disturbance'), ('vehicle', '(V)ehicle damage'), ('unknown', '(U)nknown'), ('other', '(O)ther identifiable (see comments)')], default='turtle', help_text='The cause of the disturbance.', max_length=300, verbose_name='Disturbance cause')),
('no_nests_disturbed', models.PositiveIntegerField(blank=True, help_text='The sum of damaged nests.', null=True, verbose_name='Tally of nests disturbed')),
('no_tracks_encountered', models.PositiveIntegerField(blank=True, help_text='The sum of signs, e.g. predator tracks.', null=True, verbose_name='Tally of disturbance signs')),
('comments', models.TextField(blank=True, help_text='Any other comments or notes.', null=True, verbose_name='Comments')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.CreateModel(
name='TurtleNestEncounter',
fields=[
('encounter_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Encounter')),
('nest_age', models.CharField(choices=[('old', '(O) old, made before last night'), ('fresh', '(F) fresh, made last night'), ('unknown', '(U) unknown age'), ('missed', '(M) missed turtle, made within past hours')], default='unknown', help_text='The track or nest age.', max_length=300, verbose_name='Age')),
('nest_type', models.CharField(choices=[('track-not-assessed', 'track, not checked for nest'), ('false-crawl', 'track without nest'), ('successful-crawl', 'track with nest'), ('track-unsure', 'track, checked for nest, unsure if nest'), ('nest', 'nest, unhatched, no track'), ('hatched-nest', 'nest, hatched'), ('body-pit', 'body pit, no track')], default='track-not-assessed', help_text='The track or nest type.', max_length=300, verbose_name='Type')),
('species', models.CharField(choices=[('natator-depressus', 'Natator depressus (Flatback turtle)'), ('chelonia-mydas', 'Chelonia mydas (Green turtle)'), ('eretmochelys-imbricata', 'Eretmochelys imbricata (Hawksbill turtle)'), ('caretta-caretta', 'Caretta caretta (Loggerhead turtle)'), ('lepidochelys-olivacea', 'Lepidochelys olivacea (Olive ridley turtle)'), ('dermochelys-coriacea', 'Dermochelys coriacea (Leatherback turtle)'), ('chelonia-mydas-agassazzi', 'Chelonia mydas agassazzi (Black turtle or East Pacific Green)'), ('corolla-corolla', 'Corolla corolla (Hatchback turtle)'), ('cheloniidae-fam', 'Cheloniidae (Unidentified turtle)')], default='cheloniidae-fam', help_text='The species of the animal which created the track or nest.', max_length=300, verbose_name='Species')),
('habitat', models.CharField(choices=[('na', 'unknown habitat'), ('beach-below-high-water', '(B) beach below high water mark'), ('beach-above-high-water', '(A) beach above high water mark and dune'), ('beach-edge-of-vegetation', '(E) edge of vegetation'), ('in-dune-vegetation', '(V) inside vegetation')], default='na', help_text='The habitat in which the track or nest was encountered.', max_length=500, verbose_name='Habitat')),
('disturbance', models.CharField(choices=[('na', 'NA'), ('absent', 'Confirmed absent'), ('present', 'Confirmed present')], default='na', help_text='Is there evidence of predation or other disturbance?', max_length=300, verbose_name='Evidence of predation or disturbance')),
],
options={
'verbose_name': 'Turtle Nest Encounter',
'verbose_name_plural': 'Turtle Nest Encounters',
'ordering': ['when', 'where'],
'get_latest_by': 'when',
},
bases=('observations.encounter',),
),
migrations.CreateModel(
name='TurtleNestObservation',
fields=[
('observation_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='observations.Observation')),
('nest_position', models.CharField(choices=[('na', 'unknown habitat'), ('beach-below-high-water', '(B) beach below high water mark'), ('beach-above-high-water', '(A) beach above high water mark and dune'), ('beach-edge-of-vegetation', '(E) edge of vegetation'), ('in-dune-vegetation', '(V) inside vegetation')], default='unknown', help_text='The position of the nest on the beach.', max_length=300, verbose_name='Beach position')),
('eggs_laid', models.BooleanField(default=False, help_text="Did round, white objects leave the turtle's butt?", verbose_name='Did the turtle lay eggs?')),
('egg_count', models.PositiveIntegerField(blank=True, help_text='The total number of eggs laid as observed during tagging.', null=True, verbose_name='Total number of eggs laid')),
('no_egg_shells', models.PositiveIntegerField(blank=True, help_text='The number of empty shells counted which were more than 50 percent complete.', null=True, verbose_name='Egg shells (S)')),
('no_live_hatchlings', models.PositiveIntegerField(blank=True, help_text='The number of live hatchlings left among shells excluding those in neck of nest.', null=True, verbose_name='Live hatchlings in nest (L)')),
('no_dead_hatchlings', models.PositiveIntegerField(blank=True, help_text='The number of dead hatchlings that have left their shells.', null=True, verbose_name='Dead hatchlings (D)')),
('no_undeveloped_eggs', models.PositiveIntegerField(blank=True, help_text='The number of unhatched eggs with no obvious embryo.', null=True, verbose_name='Undeveloped eggs (UD)')),
('no_unhatched_eggs', models.PositiveIntegerField(blank=True, help_text='The number of unhatched eggs with obvious, not yet full term, embryo.', null=True, verbose_name='Unhatched eggs (UH)')),
('no_unhatched_term', models.PositiveIntegerField(blank=True, help_text='The number of unhatched, apparently full term, embryo in egg or pipped with small amount of external yolk material.', null=True, verbose_name='Unhatched term (UHT)')),
('no_depredated_eggs', models.PositiveIntegerField(blank=True, help_text='The number of open, nearly complete shells containing egg residue.', null=True, verbose_name='Depredated eggs (P)')),
('nest_depth_top', models.PositiveIntegerField(blank=True, help_text='The depth of sand above the eggs in mm.', null=True, verbose_name='Nest depth (top) mm')),
('nest_depth_bottom', models.PositiveIntegerField(blank=True, help_text='The depth of the lowest eggs in mm.', null=True, verbose_name='Nest depth (bottom) mm')),
('sand_temp', models.FloatField(blank=True, help_text='The sand temperature in degree Celsius.', null=True, verbose_name='Sand temperature')),
('air_temp', models.FloatField(blank=True, help_text='The air temperature in degree Celsius.', null=True, verbose_name='Air temperature')),
('water_temp', models.FloatField(blank=True, help_text='The water temperature in degree Celsius.', null=True, verbose_name='Water temperature')),
('egg_temp', models.FloatField(blank=True, help_text='The egg temperature in degree Celsius.', null=True, verbose_name='Egg temperature')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('observations.observation',),
),
migrations.AddField(
model_name='observation',
name='encounter',
field=models.ForeignKey(help_text='The Encounter during which the observation was made', on_delete=django.db.models.deletion.CASCADE, to='observations.Encounter', verbose_name='Encounter'),
),
migrations.AddField(
model_name='observation',
name='polymorphic_ctype',
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_observations.observation_set+', to='contenttypes.ContentType'),
),
migrations.AddField(
model_name='fieldmediaattachment',
name='expedition',
field=models.ForeignKey(help_text='Surveys can be conducted during an expedition.', on_delete=django.db.models.deletion.CASCADE, to='observations.Expedition', verbose_name='Expedition'),
),
migrations.AddField(
model_name='expedition',
name='polymorphic_ctype',
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_observations.expedition_set+', to='contenttypes.ContentType'),
),
migrations.AddField(
model_name='expedition',
name='site',
field=models.ForeignKey(blank=True, help_text='The entire surveyed area.', null=True, on_delete=django.db.models.deletion.PROTECT, to='observations.Area', verbose_name='Surveyed area'),
),
migrations.AddField(
model_name='expedition',
name='team',
field=models.ManyToManyField(related_name='expedition_team', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='encounter',
name='area',
field=models.ForeignKey(blank=True, help_text='The general area this encounter took place in.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='encounter_area', to='observations.Area', verbose_name='Area'),
),
migrations.AddField(
model_name='encounter',
name='observer',
field=models.ForeignKey(help_text='The person who executes the measurements, source of measurement bias', on_delete=django.db.models.deletion.PROTECT, related_name='observer', to=settings.AUTH_USER_MODEL, verbose_name='Measured by'),
),
migrations.AddField(
model_name='encounter',
name='polymorphic_ctype',
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_observations.encounter_set+', to='contenttypes.ContentType'),
),
migrations.AddField(
model_name='encounter',
name='reporter',
field=models.ForeignKey(help_text='The person who writes the data sheet in the field, source of handwriting and spelling errors', on_delete=django.db.models.deletion.PROTECT, related_name='reporter', to=settings.AUTH_USER_MODEL, verbose_name='Recorded by'),
),
migrations.AddField(
model_name='encounter',
name='site',
field=models.ForeignKey(blank=True, help_text='The surveyed site, if known.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='encounter_site', to='observations.Area', verbose_name='Surveyed site'),
),
migrations.AddField(
model_name='encounter',
name='survey',
field=models.ForeignKey(blank=True, help_text='The survey during which this encounter happened.', null=True, on_delete=django.db.models.deletion.PROTECT, to='observations.Survey', verbose_name='Survey'),
),
migrations.AlterUniqueTogether(
name='area',
unique_together={('area_type', 'name')},
),
migrations.AlterUniqueTogether(
name='surveyend',
unique_together={('source', 'source_id')},
),
migrations.AlterUniqueTogether(
name='survey',
unique_together={('source', 'source_id')},
),
migrations.AlterUniqueTogether(
name='encounter',
unique_together={('source', 'source_id')},
),
]
| 137.211268 | 5,779 | 0.670268 | 9,316 | 77,936 | 5.505582 | 0.118184 | 0.043537 | 0.028095 | 0.031819 | 0.705401 | 0.686547 | 0.658588 | 0.636284 | 0.604738 | 0.566816 | 0 | 0.011275 | 0.170422 | 77,936 | 567 | 5,780 | 137.453263 | 0.782024 | 0.000577 | 0 | 0.57424 | 1 | 0.021467 | 0.496245 | 0.051368 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.010733 | 0 | 0.017889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
587c7307d11f141c7d4fbe2cc4464313f9856cbe | 797 | py | Python | tests/test_main.py | animuk/f8a-stacks-report | f4ec0c303720a5c42bded6df6e34899fc6112f10 | [
"Apache-2.0"
] | null | null | null | tests/test_main.py | animuk/f8a-stacks-report | f4ec0c303720a5c42bded6df6e34899fc6112f10 | [
"Apache-2.0"
] | null | null | null | tests/test_main.py | animuk/f8a-stacks-report | f4ec0c303720a5c42bded6df6e34899fc6112f10 | [
"Apache-2.0"
] | null | null | null | """Tests for main module."""
from f8a_report.main import time_to_generate_monthly_report, main
from unittest import mock
class TodayMockClass:
"""Mock class for `today` from datetime module."""
def __init__(self, day):
"""Construct the class and initialize day attribute."""
self.day = day
def test_time_to_generate_monthly_report():
"""Test the function time_to_generate_monthly_report."""
today = TodayMockClass(1)
assert time_to_generate_monthly_report(today) is True
today = TodayMockClass(30)
assert time_to_generate_monthly_report(today) is False
@mock.patch('f8a_report.main.ReportHelper.get_report', return_value=[{}, True])
def test_main(_mock1):
"""Test the function main."""
resp = main()
assert (isinstance(resp, dict))
| 27.482759 | 79 | 0.72271 | 106 | 797 | 5.141509 | 0.415094 | 0.055046 | 0.12844 | 0.192661 | 0.304587 | 0.205505 | 0.146789 | 0.146789 | 0 | 0 | 0 | 0.009063 | 0.169385 | 797 | 28 | 80 | 28.464286 | 0.814199 | 0.240903 | 0 | 0 | 1 | 0 | 0.067358 | 0.067358 | 0 | 0 | 0 | 0 | 0.214286 | 1 | 0.214286 | false | 0 | 0.142857 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5888c6fdc8e4a76fc7930213ac18525bb6b6a29c | 166 | py | Python | PycharmProjects/pythonProject/venv/ex003.py | Caiocolas/-Exercicios-Python- | 7c4fa922f3ec89f1d5a5ccd928651722b932793c | [
"MIT"
] | null | null | null | PycharmProjects/pythonProject/venv/ex003.py | Caiocolas/-Exercicios-Python- | 7c4fa922f3ec89f1d5a5ccd928651722b932793c | [
"MIT"
] | null | null | null | PycharmProjects/pythonProject/venv/ex003.py | Caiocolas/-Exercicios-Python- | 7c4fa922f3ec89f1d5a5ccd928651722b932793c | [
"MIT"
] | null | null | null | v1 = int(input('Digite um valor:'))
v2 = int(input('Digite outro valor:'))
re = (v1+v2)
print ('O valor da soma entre {} e {} tem o resultado {}!'.format(v1,v2,re))
| 27.666667 | 76 | 0.620482 | 29 | 166 | 3.551724 | 0.62069 | 0.15534 | 0.271845 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043165 | 0.162651 | 166 | 5 | 77 | 33.2 | 0.697842 | 0 | 0 | 0 | 0 | 0 | 0.509091 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
58896dc7359939933a6e374216ea99d83c37611a | 796 | py | Python | DataBase/spider/BoxOffice/douban.py | Mbaey/CupCup | a6bf9b10f68020bf9bb2d44c19f7f6a89367abde | [
"Apache-2.0"
] | 4 | 2017-08-06T09:16:38.000Z | 2021-08-31T07:07:00.000Z | CupCupNow/DataBase/spider/DoubanMovie/douban.py | aikeshuidema/CupCup | 3b902c0399b87e2bb0e94f1dd82241bc7e952cae | [
"Apache-2.0"
] | null | null | null | CupCupNow/DataBase/spider/DoubanMovie/douban.py | aikeshuidema/CupCup | 3b902c0399b87e2bb0e94f1dd82241bc7e952cae | [
"Apache-2.0"
] | 1 | 2017-08-11T08:08:48.000Z | 2017-08-11T08:08:48.000Z | # coding: UTF-8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import json
import datetime
import urllib2
import MySQLdb
import MySQLdb.cursors
db = MySQLdb.connect(host='127.0.0.1', user='root', passwd='root', db='test', port=3306, charset='utf8', cursorclass = MySQLdb.cursors.DictCursor)
db.autocommit(True)
cursor = db.cursor()
def insertData(directors, rate, title, casts, cover,adaptor, type, date, timelen, summary):
# (null, 'bb', 'aaaaaa',?, null )
sql ='insert into movie ( director, rate,title, casts, cover, adaptor, type, date, timelen, summary) values ( %s, %s, %s, %s,%s, %s, %s, %s, %s, %s)'
cursor.execute(sql,( directors, rate, title, casts, cover,adaptor, type, date, timelen, summary))
print 'success'
# cursor.close()
# db.close()
# 不关了 | 33.166667 | 153 | 0.677136 | 110 | 796 | 4.9 | 0.527273 | 0.033395 | 0.044527 | 0.051948 | 0.319109 | 0.319109 | 0.319109 | 0.319109 | 0.319109 | 0.211503 | 0 | 0.020772 | 0.153266 | 796 | 24 | 154 | 33.166667 | 0.778932 | 0.094221 | 0 | 0 | 0 | 0.066667 | 0.248603 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.066667 | 0.4 | null | null | 0.066667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
58a97b4f11b73693efdad95bc0d879c6a8b2c173 | 158 | py | Python | utils/onehot.py | ahirsharan/SegNet | 3044f5fbc78c98685ba2f1b7d45be6b60d7aaaef | [
"MIT"
] | 10 | 2020-07-04T05:28:23.000Z | 2022-03-21T03:37:59.000Z | utils/onehot.py | ahirsharan/SegNet | 3044f5fbc78c98685ba2f1b7d45be6b60d7aaaef | [
"MIT"
] | 1 | 2020-11-24T15:19:11.000Z | 2020-11-27T01:53:29.000Z | utils/onehot.py | ahirsharan/SegNet | 3044f5fbc78c98685ba2f1b7d45be6b60d7aaaef | [
"MIT"
] | 1 | 2022-03-22T06:00:48.000Z | 2022-03-22T06:00:48.000Z | import torch.nn.functional as F
import torch
def onehot(X,num_classes):
ident=torch.eye(num_classes,dtype=int)
X_onehot=ident[X]
return X_onehot
| 19.75 | 42 | 0.746835 | 27 | 158 | 4.222222 | 0.592593 | 0.192982 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158228 | 158 | 7 | 43 | 22.571429 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
5444ba4ad9dea26dfce70707ac115cc1a7f551f4 | 27,393 | py | Python | labot/mitm/bridge.py | amnesik/LaBot | 7215ad1bfbdceffd8261069611ea95eb37e4dfcf | [
"MIT"
] | null | null | null | labot/mitm/bridge.py | amnesik/LaBot | 7215ad1bfbdceffd8261069611ea95eb37e4dfcf | [
"MIT"
] | null | null | null | labot/mitm/bridge.py | amnesik/LaBot | 7215ad1bfbdceffd8261069611ea95eb37e4dfcf | [
"MIT"
] | null | null | null | """
Classes to take decisions for transmitting the packets
The classes inheriting from BridgeHandler must
implement `handle`.
The classes inheriting from MsgBridgeHandler must
implement `handle_message`.
"""
import select
from abc import ABC, abstractmethod
from collections import deque
import os
import logging
import time
import requests
from ..data import Buffer, Msg, Dumper
from .. import protocol
logger = logging.getLogger("labot")
# TODO: use the logger
def from_client(origin):
return origin.getpeername()[0] == "127.0.0.1"
def direction(origin):
if from_client(origin):
return "Client->Server"
else:
return "Server->Client"
class BridgeHandler(ABC):
"""Abstract class for bridging policies.
You just have to subclass and fill the handle method.
It implements the proxy_callback that will be called
when a client tries to connect to the server.
proxy_callback will call `handle` on every packet.
To modify the behavior, you have to create subclasses pf
BridgeHandler.
"""
def __init__(self, coJeu, coSer):
self.coJeu = coJeu
self.coSer = coSer
self.other = {coJeu: coSer, coSer: coJeu}
self.conns = [coJeu, coSer]
@abstractmethod
def handle(self, data, origin):
pass
@classmethod
def proxy_callback(cls, coJeu, coSer):
"""Callback that can be called by the proxy
It creates an instance of the class and
calls `handle` on every packet
coJeu: socket to the game
coSer: socket to the server
"""
bridge_handler = cls(coJeu, coSer)
bridge_handler.loop()
def loop(self):
conns = self.conns
active = True
try:
while active:
rlist, wlist, xlist = select.select(conns, [], conns)
if xlist or not rlist:
break
for r in rlist:
data = r.recv(8192)
if not data:
active = False
break
self.handle(data, origin=r)
finally:
for c in conns:
c.close()
class DummyBridgeHandler(BridgeHandler):
"""Implements a dummy policy
that forwards all packets"""
def handle(self, data, origin):
self.other[origin].sendall(data)
class PrintingBridgeHandler(DummyBridgeHandler):
"""
Implements a dummy policy that
forwards and prints all packets
"""
def handle(self, data, origin):
super().handle(data, origin)
print(direction(origin), data.hex())
class MsgBridgeHandler(DummyBridgeHandler, ABC):
"""
Advanced policy to work with the parsed messages
instead of the raw packets like BridgeHandler.
This class implements a generic `handle` that calls
`handle_message` which acts on the parsed messages
and that should be implemented by the subclasses.
"""
def __init__(self, coJeu, coSer):
super().__init__(coJeu, coSer)
self.buf = {coJeu: Buffer(), coSer: Buffer()}
def handle(self, data, origin):
super().handle(data, origin)
self.buf[origin] += data
from_client = origin == self.coJeu
# print(direction(origin), self.buf[origin].data)
msg = Msg.fromRaw(self.buf[origin], from_client)
while msg is not None:
if msg.id in protocol.msg_from_id:
msgType = protocol.msg_from_id[msg.id]
parsedMsg = protocol.read(msgType, msg.data)
assert msg.data.remaining() == 0, (
"All content of %s have not been read into %s:\n %s"
% (msgType, parsedMsg, msg.data)
)
self.handle_message(parsedMsg, origin)
else:
print('sorry, no '+str(msg.id))
#msgType = protocol.msg_from_id[msg.id]
# parsedMsg = protocol.read(msgType, msg.data)
## assert msg.data.remaining() == 0, (
# "All content of %s have not been read into %s:\n %s"
# % (msgType, parsedMsg, msg.data)
# )
# self.handle_message(parsedMsg, origin)
msg = Msg.fromRaw(self.buf[origin], from_client)
@abstractmethod
def handle_message(self, msg, origin):
pass
class PrintingMsgBridgeHandler(MsgBridgeHandler):
def handle_message(self, msg, origin):
print(direction(origin))
print(msg)
print()
print()
class InjectorBridgeHandler(BridgeHandler):
"""Forwards all packets and allows to inject
packets
"""
def __init__(self, coJeu, coSer, db_size=100, dumper=None):
super().__init__(coJeu, coSer)
self.buf = {coJeu: Buffer(), coSer: Buffer()}
self.injected_to_client = 0
self.injected_to_server = 0
self.counter = 0
self.db = deque([], maxlen=db_size)
self.dumper = dumper
def send_to_client(self, data):
if isinstance(data, Msg):
data = data.bytes()
self.injected_to_client += 1
self.coJeu.sendall(data)
def send_to_server(self, data):
if isinstance(data, Msg):
data.count = self.counter + 1
data = data.bytes()
self.injected_to_server += 1
self.coSer.sendall(data)
def ask_item_price(self, itemid=11971):
msg= Msg.from_json(
{"__type__": "ExchangeBidHouseSearchMessage", "follow": True, 'genId': itemid}
)
self.send_to_server(msg)
def send_message(self, s):
msg = Msg.from_json(
{"__type__": "ChatClientMultiMessage", "content": s, "channel": 0}
)
self.send_to_server(msg)
def handle(self, data, origin):
self.other[origin].sendall(data) # ici
self.buf[origin] += data
from_client = origin == self.coJeu
msg = Msg.fromRaw(self.buf[origin], from_client)
while msg is not None:
if msg.id in protocol.msg_from_id:
msgType = protocol.msg_from_id[msg.id]
parsedMsg = protocol.read(msgType, msg.data)
assert msg.data.remaining() in [0, 48], (
"All content of %s have not been read into %s:\n %s"
% (msgType, parsedMsg, msg.data)
)
if from_client:
logger.debug(
("-> [%(count)i] %(name)s (%(size)i Bytes)"),
dict(
count=msg.count,
name=protocol.msg_from_id[msg.id]["name"],
size=len(msg.data),
),
)
else:
logger.debug(
("<- %(name)s (%(size)i Bytes)"),
dict(name=protocol.msg_from_id[msg.id]["name"], size=len(msg.data)),
)
if from_client:
msg.count += self.injected_to_server - self.injected_to_client
self.counter = msg.count
else:
self.counter += 1
self.db.append(msg)
if self.dumper is not None:
self.dumper.dump(msg)
#ici self.other[origin].sendall(msg.bytes()) #self.other[origin].sendall(msg.bytes()) data
self.handle_message(parsedMsg, origin)
msg = Msg.fromRaw(self.buf[origin], from_client)
time.sleep(0.5) #0.005
else:
#ici self.other[origin].sendall(data)
print(str(data)+ 'sent !!!!')
time.sleep(0.5)
# print('sorry, no pkt id in db '+str(msg.id))
# logger.debug('sorry, no pkt id in db '+str(msg.id))
# if from_client:
# msg.count += self.injected_to_server - self.injected_to_client
# self.counter = msg.count
# else:
# self.counter += 1
# self.other[origin].sendall(data)
# #msg = Msg.fromRaw(self.buf[origin], from_client)
# time.sleep(0.5)
def handle_message(self, m, o):
print(direction(o))
print(m)
print()
print()
pass
class LucInjector(DummyBridgeHandler):
def __init__(self, coJeu, coSer):
super().__init__(coJeu, coSer)
self.buf = {coJeu: Buffer(), coSer: Buffer()}
self.injected_to_server = 0
self.counter = 0
self.injections = 0
self.script = "off"
self.items = [16663,17123,17124,17125,17126,17127,17128,17129,17130,17131,17132,17133,17134,17135,17136,17137,17138,17139,17140,17141,17142,17143,17144,17145,17146,17147,17148,17149,17150,17151,17152,17153,17154,17155,17156,17157,17158,17159,17160,17161,17421,372,485,756,998,1020,1691,2299,2480,2560,2562,2646,3000,3001,3002,3208,6475,6843,6845,8086,8757,8758,8760,8789,8804,8809,11281,11696,12739,12742,13098,13172,13496,13699,13738,13740,13742,13743,13744,13745,13747,13914,13936,13947,13948,14143,14466,14471,14517,14518,14861,14863,14922,14923,14924,14925,14926,15052,15164,15445,15448,15449,15458,15462,15478,15724,15811,16152,16157,17617,17623,17624,18363,19408,19410,19969,19970,19973,20911,20913,21209,21211,1686,1687,1688,1689,1692,10031,2539,2540,2543,12733,12744,12745,16212,16458,16459,16460,12582,12583,12584,12585,12586,12587,16909,16910,16911,16912,16913,16914,16915,16916,16917,16918,16919,16920,16921,16922,16923,16924,16925,16926,276,292,311,373,385,386,406,410,417,420,429,440,477,501,641,642,643,752,792,838,1018,1023,1086,1089,1328,1464,1465,1466,1467,1506,1507,1508,1509,1510,1676,1683,1684,1731,1732,1733,1749,1770,1771,1773,1775,1777,1977,1983,1985,2012,2058,2059,2246,2266,2267,2268,2274,2280,2286,2294,2295,2296,2297,2302,2316,2320,2321,2328,2330,2401,2448,2449,2454,2455,2462,2466,2467,2468,2479,2481,2482,2484,2486,2488,2492,2493,2494,2499,2500,2504,2505,2506,2508,2510,2515,2525,2526,2527,2549,2553,2556,2558,2561,2566,2572,2575,2576,2577,2582,2584,2585,2596,2607,2617,2618,2619,2620,2622,2623,2625,2626,2627,2628,2632,2645,2648,2649,2650,2651,2652,2653,2656,2662,2663,2669,2676,2805,2806,3209,6476,6478,6479,6480,6622,6625,6626,6648,6649,6650,6651,6652,6659,6770,6885,6904,7220,7386,7919,8001,8064,8075,8076,8077,8137,8140,8144,8160,8326,8364,8396,8516,8517,8671,8672,8673,8674,8675,8759,8765,8783,8784,8787,8788,8790,8805,8806,8807,8810,8811,8812,8813,8832,9269,9279,11279,11282,11310,11311,11475,11529,11531,11815,11942,12001,12374,12428,12429,12430,12431,12440,12441,12442,12443,12444,12445,12446,12447,13140,13338,13339,13340,13342,13343,13489,13490,13491,13492,13494,13499,13502,13503,13505,13700,13702,13703,13705,13706,13707,13708,13709,13720,13721,13726,13727,13728,13729,13732,13733,13736,13746,13917,13920,13924,13925,13929,13930,13932,13937,13979,13995,14142,14266,14268,14278,14282,14284,14461,14469,14472,14473,14474,14490,14507,14511,14795,14859,14865,14868,14927,14936,14944,14945,14947,14949,14950,14954,14977,15044,15047,15048,15065,15069,15070,15072,15074,15165,15166,15167,15180,15182,15230,15416,15444,15446,15447,15451,15455,15457,15459,15461,15531,15533,15551,15686,15689,15727,15728,15729,15730,15731,15732,15733,15809,16000,16001,16008,16009,16010,16153,16155,16158,16160,16161,16180,16181,16207,16214,16215,16216,16219,16518,16524,16526,17065,17075,17116,17117,17567,17568,17570,17611,17614,17621,17625,17626,17713,17714,17715,17864,17867,17869,17970,17974,17975,17977,17978,17983,17984,17987,18198,18357,18358,18359,18364,18367,18385,18441,18537,18540,18563,18729,18731,18733,18735,18738,18739,18740,18741,18743,19068,19073,19074,19233,19234,19235,19236,19401,19402,19404,19405,19406,19968,20126,20127,20128,20129,20130,20131,20292,20649,20650,20651,20652,20653,20654,20655,20656,20658,20659,20660,20661,20815,20817,20818,20905,20906,20907,20910,20912,20914,20939,20941,20942,20961,20963,20964,20965,20966,20967,20972,21012,21013,21205,21208,21210,435,1612,6488,7262,7263,7264,7265,7290,7291,8496,9383,11795,11892,14141,16150,16210,438,1893,2464,2496,2501,2512,2573,2591,2594,2644,2667,8063,8381,8798,11135,11219,11230,11238,11312,11524,11882,11921,11929,11943,11945,13493,13972,13991,14458,15040,15175,16515,17615,17973,18369,18370,18730,19411,20820,1461,1462,7652,12734,12743,16419,16420,17060,286,519,1334,1730,1978,1984,1986,6601,8761,10909,12432,12433,12434,12435,12436,12437,12438,12439,13154,13718,15691,17031,18366,1333,1335,1337,1338,1340,1341,1342,1343,1345,1346,1347,1348,2529,2538,2541,1751,1755,1758,1760,1761,1763,1780,1781,1783,1785,1787,1789,1791,1793,1795,1797,1798,1800,1802,1804,1806,1808,1845,1848,1851,1852,1854,1976,11508,11509,598,600,602,603,607,1750,1754,1757,1759,1762,1779,1782,1784,1786,1788,1790,1792,1794,1796,1799,1801,1803,1805,1807,1844,1846,1847,1849,1853,2187,11106,11500,16461,16462,16463,16464,16465,16466,16467,16468,16469,16470,16471,16472,17994,291,371,388,409,418,646,649,650,761,840,1672,1690,1890,1894,2248,2282,2301,2315,2559,2574,2621,6441,7258,7275,7276,7277,7278,7284,7292,7293,7294,7295,7297,7343,8059,8060,8061,8062,8065,8066,8085,8250,8251,8311,8321,8322,8389,8393,8397,8399,8403,8405,8481,8484,8570,8571,8754,8755,8756,8763,8764,8786,8795,11227,11229,11241,11250,11321,11523,11814,11924,11936,12076,12741,13335,13608,13697,13698,13704,13923,13934,13935,13940,14459,14468,14470,14862,14864,15039,15041,15043,15051,15169,15178,15228,15725,15726,15810,16148,17114,17616,17620,17641,17976,17979,18362,18542,18734,19072,19972,20908,20943,21271,301,414,415,416,1141,1670,1685,1889,1892,2247,2602,2605,2675,6897,6898,6899,6900,6902,6903,8158,8249,8252,8309,8387,8557,8766,11223,11232,11257,12016,13165,13167,13717,13719,13722,13941,13984,13989,14512,15071,15075,15720,16512,17622,19237,20960,374,380,395,421,428,1324,1332,1336,1344,1428,2254,2318,2365,2624,2661,2665,7267,7268,7287,7288,7903,8749,8750,8751,8752,8753,8777,8778,8779,8780,8781,8782,9388,9389,13529,13945,13946,14475,16378,16379,16380,16381,16385,16386,16389,16390,17992,459,6868,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,8078,11193,16489,16490,16491,16492,16493,16494,16495,16496,16497,16498,16499,315,316,463,464,465,466,467,918,929,965,1575,1660,1679,6490,7026,7027,7028,7222,7223,7224,7225,7369,7370,8762,8916,8998,9941,10835,11330,11517,11559,11560,11561,11562,12468,14279,14290,14635,15176,15177,15181,15263,15271,16156,16208,18539,18543,20969,20970,274,431,448,450,543,544,545,546,547,1326,2251,2304,2305,2306,7023,7024,7025,8102,8373,8374,8375,8376,8394,8402,8729,8731,8732,8733,8734,8735,8736,8737,9940,11323,11324,11325,11327,11329,11331,11332,11333,11518,11522,11530,11543,11544,11545,11546,11547,11548,11549,11550,11551,11552,11553,11554,11555,11556,11557,11558,12375,13731,14952,17021,17022,17553,17988,19971,20452,6603,6605,6606,6607,6608,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6624,6658,7922,7923,362,363,364,1613,1663,1681,1891,2264,2507,2563,6739,6740,7030,7260,7273,7279,7280,7281,7282,7283,7298,7299,7300,7301,7302,7303,8050,8052,8053,8054,8084,8312,8314,8315,8352,8353,8354,8355,8356,8360,8362,8367,8383,8385,8388,8390,8391,8392,8401,8404,8482,8483,8491,8492,8493,8546,8680,8681,8682,8996,8997,9401,11225,11318,11527,12467,13593,13594,13595,13596,14263,14265,14996,14997,14998,15042,15172,15688,15723,16522,17115,17118,17612,17972,17981,18368,18565,20909,20944,20959,21207,21263,365,1652,1673,2060,2288,2451,2490,2502,2571,7285,11252,11335,11520,11895,13341,13724,13943,14457,14510,15067,15452,15685,15716,16002,16159,17609,17985,18564,20814,305,310,366,375,379,382,383,387,407,408,411,412,413,430,432,433,439,479,481,848,1142,1327,1614,1664,1675,1680,1709,2179,2245,2249,2252,2259,2279,2300,2322,2323,2336,2463,2465,2483,2509,2514,2516,2528,2554,2581,2598,2599,2642,2643,2664,2666,6738,7274,7403,7404,7405,7406,7407,7408,7410,7411,7906,8055,8056,8057,8058,8083,8313,8327,8328,8344,8345,8346,8347,8357,8358,8361,8363,8365,8368,8386,8408,8409,8410,8488,8489,8490,8515,8730,8738,8739,8740,8741,8744,8802,8803,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,11118,11122,11222,11228,11240,11242,11251,11254,11256,11309,11316,11322,11326,11334,11340,11525,11526,11880,11883,11922,11923,11927,11930,11931,11933,11939,11944,11946,11949,12015,12242,12243,12451,13096,13097,13157,13164,13168,13169,13274,13334,13495,13497,13498,13500,13504,13713,13714,13715,13716,13922,13926,13927,13928,13931,13933,13938,13939,13942,13949,13950,13971,13973,13974,13975,13983,13985,13986,13987,13993,13994,14264,14267,14280,14462,14463,14467,14477,14514,14515,14817,14822,14928,14951,15045,15046,15076,15168,15170,15171,15173,15179,15229,15450,15454,15456,15460,15717,15719,15721,15722,16051,16218,16525,17441,17569,17613,17619,17971,17980,17982,17990,18383,18538,18562,18566,18732,19069,19232,19399,19400,19407,19974,19975,20819,20945,21212,21256,21268,360,419,2317,2497,2551,2647,6844,11119,11231,11247,11248,11336,11519,11887,11920,11926,11928,11934,13155,13976,14476,14509,14516,15049,17618,18541,20940,367,844,845,846,847,2654,2673,11233,11328,11533,12448,13723,15066,15541,20971,2056,2283,2453,2460,2491,2495,2552,2578,2579,2580,2583,6841,9277,11121,11246,11255,11320,11521,11886,11896,11919,11935,11948,12449,13156,13913,13988,14145,14478,14853,14948,15073,15174,15684,15718,16149,16162,16163,16213,16220,17610,17986,18411,18568,19071,19231,19403,20816,21206,21265,12832,12833,12834,12835,12836,12837,12845,12860,12861,12862,12863,12876,12970,15008,20668,20669,20680,312,313,350,441,442,443,444,445,446,447,480,7032,7033,11110,17995,1526,1527,1528,1529,1531,1532,1533,1534,1535,1536,1537,1538,1634,17965,17967,1459,1460,1463,1468,12075,13193,18742,302,361,537,538,1974,1975,14479,384,880,881,882,885,1694,2998,7905,8406,11117,11136,11221,11338,11339,11341,11937,13982,16217,16511,16358,16507,16666,16667,16668,16841,16842,16844,16845,16846,16847,16848,16849,16850,16851,16852,16853,16854,16855,16856,16857,16858,16859,16860,16861,16862,16863,16864,16865,16866,16867,16869,16870,16871,16872,16873,16874,16876,16877,16878,16880,16881,16882,16883,16884,16885,16886,16887,16951,16955,16956,16957,16958,16959,16960,16961,16962,16963,16964,16965,16966,16967,16968,16969,16970,16971,16972,16973,16974,16975,16976,16981,16982,16983,16984,16985,16986,16987,16988,16989,16990,16991,16992,16993,16994,16995,16996,16997,16998,389,390,396,397,399,1973,8520,11226,11313,11497,14823,18209,287,288,300,391,392,393,394,422,427,2150,6671,7059,8785,11199,11239,13336,13730,15793,16384,368,369,370,757,2241,2242,2436,2437,8310,8712,12737,12738,12740,13060,13061,13062,13365,13366,13367,381,398,997,1325,1678,1734,1736,2324,2325,2326,2329,2331,2674,10831,20231,15379,15380,15381,15383,15384,15385,15386,15387,15388,15389,15390,15394,15395,15396,15397,15398,15480,15481,15482,15483,15484,15535,15536,15537,15538,15539,15902,15903,16022,16023,16024,16025,16026,16027,16028,16029,16030,16031,16032,16034,16035,16036,16037,16038,17222,17223,17224,17225,17226,17227,17228,17229,17232,17233,17234,17235,17236,17237,17238,17239,17242,17243,17244,17245,17246,17249,17250,17251,17252,17253,17257,17258,17259,17260,17261,17644,17645,17646,17647,17648,17649,17651,17652,306,309,593,594,1339,1772,1774,1776,1778,2253,2557,2659,6842,7020,7266,7904,8157,8745,8746,8747,8748,9381,9382,9384,9385,9386,9387,9391,11102,11501,11695,13166,16382,16383,16387,16388,16513,18361,285,529,531,535,690,2019,2022,2027,2030,2033,2037,7068,11502,424,426,651,652,653,654,1696,2273,2277,2278,2281,2285,2503,2513,2550,7259,7304,7305,7306,7307,7308,7379,7380,7381,7382,7383,7384,7385,7393,8002,8082,8380,8384,8398,8400,8485,8486,8487,8791,8800,8801,8808,8994,8995,11249,11253,11319,11516,11925,11932,11940,13487,13916,14921,15050,15219,15414,18318,21264,14645,14646,14647,14648,14649,14650,14651,14652,14653,14654,14655,14656,14657,14658,14659,14660,14661,14662,14663,14664,14665,14666,14667,14668,14669,14670,14671,14672,14673,14674,14675,14676,14677,14678,14679,14680,14681,14682,14683,14684,14685,14686,14687,14688,14689,14690,14691,14692,14693,14694,14695,14696,14697,14698,14699,14700,14701,14702,14703,14704,14705,14706,14720,14774,14975,15095,15272,15273,15274,15362,15702,15703,15704,15705,15734,15735,15736,16285,16286,17037,17414,17735,17736,17737,19905,19906,19907,19908,19909,19910,19911,19912,19913,19914,19915,19916,19921,19938,21217,434,1610,1682,6486,7269,7270,7271,7272,8494,8770,8771,8772,8773,8774,8775,9263,11891,16151,16154,16211,304,486,487,883,884,886,887,901,2271,2275,2287,2511,2555,2999,7907,8323,8324,8407,11120,11243,11337,11342,11884,11938,13196,13915,13918,13919,13921,13980,14860,14946,308,842,843,1129,8348,8349,8350,8351,8369,8370,8371,8372,8769,8776,8792,8793,11314,11317,12450,15687,19409,19412,961,962,963,1568,1569,1570,6884,7309,7310,7311,7312,7509,7510,7511,7557,7908,7918,7924,7926,7927,8073,8135,8139,8142,8143,8156,8307,8320,8329,8342,8343,8436,8437,8438,8439,8476,8477,8545,8917,8971,8972,8975,8977,9247,9248,9249,9250,9251,9252,9254,11174,11175,11176,11177,11178,11179,11180,11181,11636,11798,11799,12017,12073,12150,12151,12152,12351,12735,13333,14043,14044,14045,14046,14047,14464,14465,14560,14870,14935,15093,15162,15278,15279,15280,15475,15476,15477,15690,15806,15807,15808,15991,16179,17112,17113,17563,17564,17565,18066,18067,18068,18421,18544,18552,18736,19041,19049,19216,19514,19515,19963,20918,20919,20920,21216,21249,290,377,378,1674,9267,9278,9280,9281,11885,11888,11889,11890,11893,11894,13977,13978,14144,15485,16165,16166,16167,16168,16523,289,400,401,405,423,425,532,533,1671,2018,2021,2026,2029,2032,2035,2036,7018,11109,11499,16452,16453,16454,16455,16456,16457,17993,2290,2291,2292,2293,2303,2487,2609,2610,2611,2613,8138,8159,8308,13944,14819,15415,18371,18567,437,1611,6487,6736,8495,13528,303,449,460,461,470,471,472,473,474,476,920,926,1002,1329,2250,2357,2358,2379,2564,2565,6489,7013,7014,7015,7016,7017,7261,7286,7289,7925,8796,8797,11107,11315,11528,11532,14460,14513,16487,16488,17991,746,747,748,749,750,6457,6458,7035,7036,11280,12728,13981,16440,307,376,648,1022,1455,1456,1457,1458,2586,2588,8141,8161,8359,8767,11224,11941,13488,13725,13990,13992,15068,15453,15715,17989,19070]
self.itemsleft = [None] * len(self.items)
self.timer = time.time()
def send_to_server(self, data):
if isinstance(data, Msg):
data.count = self.counter + 1
print("Injected : ",end="")
print(data.json())
data = data.bytes()
self.injected_to_server += 1
self.coSer.sendall(data)
def send_message(self, s):
msg = Msg.from_json(
{"__type__": "ChatClientMultiMessage", "content": s, "channel": 0}
)
self.send_to_server(msg)
def ask_item_price(self, itemid):
msg= Msg.from_json(
{'__type__': 'ExchangeBidHouseSearchMessage', 'genId': itemid, 'follow': True}
)
self.send_to_server(msg)
def disconnect_hdv(self):
msg= Msg.from_json(
{'__type__': 'LeaveDialogRequestMessage'}
)
self.send_to_server(msg)
def connect_hdv(self):
msg= Msg.from_json(
{'__type__': 'InteractiveUseRequestMessage', 'elemId': 522694, 'skillInstanceUid': 136144973}
)
self.send_to_server(msg)
def handle(self, data, origin):
super().handle(data, origin)
#self.other[origin].sendall(data)
self.buf[origin] += data
from_client = origin == self.coJeu
# print(direction(origin), self.buf[origin].data)
msg = Msg.fromRaw(self.buf[origin], from_client)
while msg is not None:
if msg.id in protocol.msg_from_id:
msgType = protocol.msg_from_id[msg.id]
parsedMsg = protocol.read(msgType, msg.data)
assert msg.data.remaining() == 0, (
"All content of %s have not been read into %s:\n %s"
% (msgType, parsedMsg, msg.data)
)
self.handle_message(parsedMsg, origin)
else:
print('sorry, no '+str(msg.id))
msg = Msg.fromRaw(self.buf[origin], from_client)
def handle_message(self, msg, origin):
# print(direction(origin))
if self.script == "on":
if len(self.itemsleft) == 0:
self.itemsleft = [None] * len(self.items)
for i in range(0, len(self.items)):
self.itemsleft[i] = self.items[i]
# self.script = "off"
else:
datenow = time.time()
diff = datenow - self.timer
if diff > 0.8:
if (self.injections%3) == 2:
self.disconnect_hdv()
self.connect_hdv()
else:
self.ask_item_price(self.itemsleft.pop())
self.timer = datenow
self.injections = self.injections + 1
# mask game internals functions
if msg["__type__"] not in ["GameMapMovementMessage","SetCharacterRestrictionsMessage","GameContextRefreshEntityLookMessage","GameRolePlayShowActorMessage","GameMapChangeOrientationMessage","UpdateMapPlayersAgressableStatusMessage","GameContextRemoveElementMessage","ChatServerMessage","ChatServerWithObjectMessage"] or direction(origin) == "Client->Server":
# if msg["__type__"] == "InteractiveUseRequestMessage":
print(direction(origin))
print(msg)
# retreive price and export it
if msg["__type__"] == "ExchangeTypesItemsExchangerDescriptionForUserMessage":
if len(msg["itemTypeDescriptions"]) > 0:
print("--------------- GOT ONE ---------------")
itemID = msg["itemTypeDescriptions"][0]["objectGID"]
pricesArray = msg["itemTypeDescriptions"][0]["prices"]
print(itemID)
print(pricesArray)
prices = str(pricesArray[0]) + ',' + str(pricesArray[1]) + ',' + str(pricesArray[2])
requests.get('https://o-sens-propre.fr/dodo/add.php?token=456789tyhujizoefiuho678945&itemID='+str(itemID)+'&prices='+prices)
print("--------------- GOT ONE ---------------")
# execute our injection : start it by sending any message on chat to /general
elif msg["__type__"] == "ChatClientMultiMessage":
print(msg["content"])
if msg["content"] == "stop":
self.script = "off"
self.send_message("stooooooop")
elif msg["content"] == "lessgo":
self.script = "on"
self.timer = time.time()
self.itemsleft = [None] * len(self.items)
for i in range(0, len(self.items)):
self.itemsleft[i] = self.items[i]
self.send_message("gooooooooo")
# self.send_message("azerteyuioop")
# for i in [0,1,2,3,4,5,7,8,9]: DO THIIIIIIIIIS in any packet when script is on
# self.ask_item_price(307+i)
# time.sleep(4)
# self.ask_item_price(11971)
# print(msg.json()) # for debug with crash
| 67.470443 | 13,566 | 0.680466 | 3,985 | 27,393 | 4.63212 | 0.692597 | 0.006447 | 0.008451 | 0.008289 | 0.197681 | 0.188851 | 0.164581 | 0.157918 | 0.155967 | 0.139932 | 0 | 0.492071 | 0.171248 | 27,393 | 405 | 13,567 | 67.637037 | 0.321029 | 0.101814 | 0 | 0.525097 | 0 | 0.003861 | 0.051568 | 0.019389 | 0 | 0 | 0 | 0.002469 | 0.011583 | 1 | 0.104247 | false | 0.011583 | 0.034749 | 0.003861 | 0.177606 | 0.081081 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
546d2c794d2d5a2313bb06d2c39fe5a6b990f09e | 448 | py | Python | tests/Unit/Elliptic/Systems/Elasticity/BoundaryConditions/LaserBeam.py | nilsvu/spectre | 1455b9a8d7e92db8ad600c66f54795c29c3052ee | [
"MIT"
] | 117 | 2017-04-08T22:52:48.000Z | 2022-03-25T07:23:36.000Z | tests/Unit/Elliptic/Systems/Elasticity/BoundaryConditions/LaserBeam.py | GitHimanshuc/spectre | 4de4033ba36547113293fe4dbdd77591485a4aee | [
"MIT"
] | 3,177 | 2017-04-07T21:10:18.000Z | 2022-03-31T23:55:59.000Z | tests/Unit/Elliptic/Systems/Elasticity/BoundaryConditions/LaserBeam.py | geoffrey4444/spectre | 9350d61830b360e2d5b273fdd176dcc841dbefb0 | [
"MIT"
] | 85 | 2017-04-07T19:36:13.000Z | 2022-03-01T10:21:00.000Z | # Distributed under the MIT License.
# See LICENSE.txt for details.
import numpy as np
from numpy import sqrt, exp, pi
def normal_dot_minus_stress(x, n, beam_width):
n /= np.linalg.norm(n)
r = sqrt(np.linalg.norm(x)**2 - np.dot(x, n)**2)
beam_profile = exp(-(r / beam_width)**2) / pi / beam_width**2
return np.tensordot(-n, beam_profile, axes=0)
def normal_dot_minus_stress_linearized(x, n, beam_width):
return np.zeros(3)
| 26.352941 | 65 | 0.6875 | 79 | 448 | 3.734177 | 0.481013 | 0.122034 | 0.081356 | 0.115254 | 0.155932 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016216 | 0.174107 | 448 | 16 | 66 | 28 | 0.781081 | 0.140625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.111111 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
547309e88a07e8d592fed5bc523162e851cf6b49 | 3,227 | py | Python | hooks/webkitpy/tool/commands/sheriffbot.py | nizovn/luna-sysmgr | 48b7e2546e81d6ad1604353f2e5ab797a7d1667c | [
"Apache-2.0"
] | 3 | 2018-11-16T14:51:17.000Z | 2019-11-21T10:55:24.000Z | WebKit/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | 1 | 2021-02-20T13:12:15.000Z | 2021-02-20T13:12:15.000Z | WebKit/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os
from webkitpy.common.system.deprecated_logging import log
from webkitpy.common.config.ports import WebKitPort
from webkitpy.tool.bot.sheriff import Sheriff
from webkitpy.tool.bot.sheriffircbot import SheriffIRCBot
from webkitpy.tool.commands.queues import AbstractQueue
from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
name = "sheriff-bot"
watchers = AbstractQueue.watchers + [
"abarth@webkit.org",
"eric@webkit.org",
]
# AbstractQueue methods
def begin_work_queue(self):
AbstractQueue.begin_work_queue(self)
self._sheriff = Sheriff(self._tool, self)
self._irc_bot = SheriffIRCBot(self._tool, self._sheriff)
self._tool.ensure_irc_connected(self._irc_bot.irc_delegate())
def work_item_log_path(self, failure_map):
return None
def _is_old_failure(self, revision):
return self._tool.status_server.svn_revision(revision)
def next_work_item(self):
self._irc_bot.process_pending_messages()
return
def should_proceed_with_work_item(self, failure_map):
# Currently, we don't have any reasons not to proceed with work items.
return True
def process_work_item(self, failure_map):
return True
def handle_unexpected_error(self, failure_map, message):
log(message)
# StepSequenceErrorHandler methods
@classmethod
def handle_script_error(cls, tool, state, script_error):
# Ideally we would post some information to IRC about what went wrong
# here, but we don't have the IRC password in the child process.
pass
| 39.839506 | 78 | 0.753951 | 435 | 3,227 | 5.485057 | 0.473563 | 0.030176 | 0.026823 | 0.019279 | 0.095557 | 0.056999 | 0.056999 | 0.056999 | 0.056999 | 0.056999 | 0 | 0.001524 | 0.186861 | 3,227 | 80 | 79 | 40.3375 | 0.907774 | 0.536412 | 0 | 0.058824 | 0 | 0 | 0.029392 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0.029412 | 0.205882 | 0.117647 | 0.676471 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
548e6ef0c6d891adc8df0107d485dfbbca08217a | 7,921 | py | Python | 02.Regression/02.Multiple-Linear-Regression/multiple_linear_regression.py | HassanRahim26/Machine-Learning | 4cce862e06191126c9070b47dd5d910c0cf40b67 | [
"MIT"
] | null | null | null | 02.Regression/02.Multiple-Linear-Regression/multiple_linear_regression.py | HassanRahim26/Machine-Learning | 4cce862e06191126c9070b47dd5d910c0cf40b67 | [
"MIT"
] | null | null | null | 02.Regression/02.Multiple-Linear-Regression/multiple_linear_regression.py | HassanRahim26/Machine-Learning | 4cce862e06191126c9070b47dd5d910c0cf40b67 | [
"MIT"
] | null | null | null | # Multiple Linear Regression
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('50_Startups.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values
print(X)
"""
[[165349.2 136897.8 471784.1 'New York']
[162597.7 151377.59 443898.53 'California']
[153441.51 101145.55 407934.54 'Florida']
[144372.41 118671.85 383199.62 'New York']
[142107.34 91391.77 366168.42 'Florida']
[131876.9 99814.71 362861.36 'New York']
[134615.46 147198.87 127716.82 'California']
[130298.13 145530.06 323876.68 'Florida']
[120542.52 148718.95 311613.29 'New York']
[123334.88 108679.17 304981.62 'California']
[101913.08 110594.11 229160.95 'Florida']
[100671.96 91790.61 249744.55 'California']
[93863.75 127320.38 249839.44 'Florida']
[91992.39 135495.07 252664.93 'California']
[119943.24 156547.42 256512.92 'Florida']
[114523.61 122616.84 261776.23 'New York']
[78013.11 121597.55 264346.06 'California']
[94657.16 145077.58 282574.31 'New York']
[91749.16 114175.79 294919.57 'Florida']
[86419.7 153514.11 0.0 'New York']
[76253.86 113867.3 298664.47 'California']
[78389.47 153773.43 299737.29 'New York']
[73994.56 122782.75 303319.26 'Florida']
[67532.53 105751.03 304768.73 'Florida']
[77044.01 99281.34 140574.81 'New York']
[64664.71 139553.16 137962.62 'California']
[75328.87 144135.98 134050.07 'Florida']
[72107.6 127864.55 353183.81 'New York']
[66051.52 182645.56 118148.2 'Florida']
[65605.48 153032.06 107138.38 'New York']
[61994.48 115641.28 91131.24 'Florida']
[61136.38 152701.92 88218.23 'New York']
[63408.86 129219.61 46085.25 'California']
[55493.95 103057.49 214634.81 'Florida']
[46426.07 157693.92 210797.67 'California']
[46014.02 85047.44 205517.64 'New York']
[28663.76 127056.21 201126.82 'Florida']
[44069.95 51283.14 197029.42 'California']
[20229.59 65947.93 185265.1 'New York']
[38558.51 82982.09 174999.3 'California']
[28754.33 118546.05 172795.67 'California']
[27892.92 84710.77 164470.71 'Florida']
[23640.93 96189.63 148001.11 'California']
[15505.73 127382.3 35534.17 'New York']
[22177.74 154806.14 28334.72 'California']
[1000.23 124153.04 1903.93 'New York']
[1315.46 115816.21 297114.46 'Florida']
[0.0 135426.92 0.0 'California']
[542.05 51743.15 0.0 'New York']
[0.0 116983.8 45173.06 'California']]
"""
# Encoding categorical data
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder
ct = ColumnTransformer(transformers = [('encoder', OneHotEncoder(), [3])], remainder = 'passthrough')
X = np.array(ct.fit_transform(X))
print(X)
"""
[[0.0 0.0 1.0 165349.2 136897.8 471784.1]
[1.0 0.0 0.0 162597.7 151377.59 443898.53]
[0.0 1.0 0.0 153441.51 101145.55 407934.54]
[0.0 0.0 1.0 144372.41 118671.85 383199.62]
[0.0 1.0 0.0 142107.34 91391.77 366168.42]
[0.0 0.0 1.0 131876.9 99814.71 362861.36]
[1.0 0.0 0.0 134615.46 147198.87 127716.82]
[0.0 1.0 0.0 130298.13 145530.06 323876.68]
[0.0 0.0 1.0 120542.52 148718.95 311613.29]
[1.0 0.0 0.0 123334.88 108679.17 304981.62]
[0.0 1.0 0.0 101913.08 110594.11 229160.95]
[1.0 0.0 0.0 100671.96 91790.61 249744.55]
[0.0 1.0 0.0 93863.75 127320.38 249839.44]
[1.0 0.0 0.0 91992.39 135495.07 252664.93]
[0.0 1.0 0.0 119943.24 156547.42 256512.92]
[0.0 0.0 1.0 114523.61 122616.84 261776.23]
[1.0 0.0 0.0 78013.11 121597.55 264346.06]
[0.0 0.0 1.0 94657.16 145077.58 282574.31]
[0.0 1.0 0.0 91749.16 114175.79 294919.57]
[0.0 0.0 1.0 86419.7 153514.11 0.0]
[1.0 0.0 0.0 76253.86 113867.3 298664.47]
[0.0 0.0 1.0 78389.47 153773.43 299737.29]
[0.0 1.0 0.0 73994.56 122782.75 303319.26]
[0.0 1.0 0.0 67532.53 105751.03 304768.73]
[0.0 0.0 1.0 77044.01 99281.34 140574.81]
[1.0 0.0 0.0 64664.71 139553.16 137962.62]
[0.0 1.0 0.0 75328.87 144135.98 134050.07]
[0.0 0.0 1.0 72107.6 127864.55 353183.81]
[0.0 1.0 0.0 66051.52 182645.56 118148.2]
[0.0 0.0 1.0 65605.48 153032.06 107138.38]
[0.0 1.0 0.0 61994.48 115641.28 91131.24]
[0.0 0.0 1.0 61136.38 152701.92 88218.23]
[1.0 0.0 0.0 63408.86 129219.61 46085.25]
[0.0 1.0 0.0 55493.95 103057.49 214634.81]
[1.0 0.0 0.0 46426.07 157693.92 210797.67]
[0.0 0.0 1.0 46014.02 85047.44 205517.64]
[0.0 1.0 0.0 28663.76 127056.21 201126.82]
[1.0 0.0 0.0 44069.95 51283.14 197029.42]
[0.0 0.0 1.0 20229.59 65947.93 185265.1]
[1.0 0.0 0.0 38558.51 82982.09 174999.3]
[1.0 0.0 0.0 28754.33 118546.05 172795.67]
[0.0 1.0 0.0 27892.92 84710.77 164470.71]
[1.0 0.0 0.0 23640.93 96189.63 148001.11]
[0.0 0.0 1.0 15505.73 127382.3 35534.17]
[1.0 0.0 0.0 22177.74 154806.14 28334.72]
[0.0 0.0 1.0 1000.23 124153.04 1903.93]
[0.0 1.0 0.0 1315.46 115816.21 297114.46]
[1.0 0.0 0.0 0.0 135426.92 0.0]
[0.0 0.0 1.0 542.05 51743.15 0.0]
[1.0 0.0 0.0 0.0 116983.8 45173.06]]
"""
# Splitting the dataset into the Training set and Test set
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
# Training the Multiple Linear Regression model on the Training set
from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
## This line of code will build the Multiple Regression Model.
regressor.fit(X_train, y_train)
## This line of code will train the model on the training set.
# Predicting the Test set results
y_pred = regressor.predict(X_test)
np.set_printoptions(precision = 2)
print(np.concatenate((y_pred.reshape(len(y_pred), 1), y_test.reshape(len(y_test), 1)), 1))
"""
[[103015.2 103282.38]
[132582.28 144259.4 ]
[132447.74 146121.95]
[ 71976.1 77798.83]
[178537.48 191050.39]
[116161.24 105008.31]
[ 67851.69 81229.06]
[ 98791.73 97483.56]
[113969.44 110352.25]
[167921.07 166187.94]]
"""
"""
# Evaluating the Model Performance
from sklearn.metrics import r2_score
r2_score(y_test, y_pred)
"""
# Making a single prediction (for example the profit of a startup with R&D Spend = 160000, Administration Spend = 130000, Marketing Spend = 300000 and State = 'California')
print(regressor.predict([[1, 0, 0, 160000, 130000, 300000]]))
## [181566.92]
"""
Therefore, our model predicts that the profit of a Californian startup which spent 160000 in R&D, 130000 in Administration and 300000 in Marketing is $ 181566,92.
Important note 1: Notice that the values of the features were all input in a double pair of square brackets. That's because the "predict" method always expects a 2D array as the format of its inputs. And putting our values into a double pair of square brackets makes the input exactly a 2D array. Simply put:
1,0,0,160000,130000,300000 -> scalars
[1,0,0,160000,130000,300000] -> 1D array
[[1,0,0,160000,130000,300000]] -> 2D array
Important note 2: Notice also that the "California" state was not input as a string in the last column but as "1, 0, 0" in the first three columns. That's because of course the predict method expects the one-hot-encoded values of the state, and as we see in the second row of the matrix of features X, "California" was encoded as "1, 0, 0". And be careful to include these values in the first three columns, not the last three ones, because the dummy variables are always created in the first columns.
"""
# Getting the final linear regression equation with the values of the coefficients
print(regressor.coef_)
print(regressor.intercept_)
"""
[ 8.66e+01 -8.73e+02 7.86e+02 7.73e-01 3.29e-02 3.66e-02]
42467.52924853204
"""
"""
Therefore, the equation of our multiple linear regression model is:
Profit=86.6 × Dummy State 1 − 873 × Dummy State 2 + 786 × Dummy State 3 + 0.773 × R&D Spend + 0.0329 × Administration + 0.0366 × Marketing Spend + 42467.53
Important Note: To get these coefficients we called the "coef_" and "intercept_" attributes from our regressor object. Attributes in Python are different than methods and usually return a simple value or an array of values.
"""
| 41.041451 | 501 | 0.711148 | 1,568 | 7,921 | 3.576531 | 0.284439 | 0.066334 | 0.05724 | 0.040656 | 0.492154 | 0.470399 | 0.022825 | 0.004636 | 0 | 0 | 0 | 0.428889 | 0.148719 | 7,921 | 192 | 502 | 41.255208 | 0.40175 | 0.080419 | 0 | 0.086957 | 0 | 0 | 0.033435 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.043478 | 0.304348 | 0 | 0.304348 | 0.304348 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
5492e0d1cbe11edd4184851eec16c63690cb09d9 | 1,941 | py | Python | {{cookiecutter.github_repository_name}}/tests/{{cookiecutter.app_name}}_tests/users/test_views.py | ehudhala/cookiecutter-django-rest-angular2 | fd1ccf2a7659feb207872a11159e1c30bb444d31 | [
"MIT"
] | 16 | 2016-11-04T19:13:16.000Z | 2018-02-19T18:13:23.000Z | {{cookiecutter.github_repository_name}}/tests/{{cookiecutter.app_name}}_tests/users/test_views.py | ehudhala/cookiecutter-django-rest-angular2 | fd1ccf2a7659feb207872a11159e1c30bb444d31 | [
"MIT"
] | null | null | null | {{cookiecutter.github_repository_name}}/tests/{{cookiecutter.app_name}}_tests/users/test_views.py | ehudhala/cookiecutter-django-rest-angular2 | fd1ccf2a7659feb207872a11159e1c30bb444d31 | [
"MIT"
] | 7 | 2016-11-08T04:31:41.000Z | 2018-07-30T15:14:02.000Z | # from django.core.urlresolvers import reverse
# from django.forms.models import model_to_dict
# from django.contrib.auth.hashers import check_password
# from nose.tools import ok_, eq_
# from rest_framework.test import APITestCase
# from faker import Faker
# from {{cookiecutter.app_name}}.users.models import User
# from {{cookiecutter.app_name}}_tests.users.factories import UserFactory
#
# fake = Faker()
#
#
# class TestUserAPI(APITestCase):
# """
# Tests the /users endpoint.
# """
#
# def setUp(self):
# self.url = reverse('user-list')
# self.user_data = model_to_dict(UserFactory.build())
#
# def test_post_request_with_no_data_fails(self):
# response = self.client.post(self.url, {})
# eq_(response.status_code, 400)
#
# def test_post_request_with_valid_data_succeeds(self):
# response = self.client.post(self.url, self.user_data)
# eq_(response.status_code, 201)
#
# user = User.objects.get(pk=response.data.get('id'))
# eq_(user.username, self.user_data.get('username'))
# ok_(check_password(self.user_data.get('password'), user.password))
#
#
# class TestUserDetailAPI(APITestCase):
#
# def setUp(self):
# self.user = UserFactory()
# self.url = reverse('user-detail', kwargs={'pk': self.user.pk})
# self.client.credentials(HTTP_AUTHORIZATION='Token {}'.format(self.user.auth_token))
#
# def test_get_request_returns_a_given_user(self):
# response = self.client.get(self.url)
# eq_(response.status_code, 200)
#
# def test_put_request_updates_a_user(self):
# new_first_name = fake.first_name()
# payload = {'first_name': new_first_name}
# response = self.client.put(self.url, payload)
# eq_(response.status_code, 200)
#
# user = User.objects.get(pk=self.user.id)
# eq_(user.first_name, new_first_name)
# TODO: rewrite tests in pytest
| 34.660714 | 93 | 0.672334 | 252 | 1,941 | 4.936508 | 0.333333 | 0.051447 | 0.038585 | 0.064309 | 0.213023 | 0.090836 | 0.053055 | 0 | 0 | 0 | 0 | 0.007648 | 0.191654 | 1,941 | 55 | 94 | 35.290909 | 0.785214 | 0.943328 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.018182 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
54967cc7b53cdb814fb714a7fa9fb397e178f578 | 535 | py | Python | Day 05/stats_analysis.py | nitish3006/100-days-of-code-1 | 1cf706ad56c6a7cf141edc833946c2ca6c27b107 | [
"MIT"
] | 31 | 2019-10-12T18:29:37.000Z | 2022-01-17T06:13:14.000Z | Day 05/stats_analysis.py | nitish3006/100-days-of-code-1 | 1cf706ad56c6a7cf141edc833946c2ca6c27b107 | [
"MIT"
] | 3 | 2019-09-17T04:25:43.000Z | 2019-09-26T19:05:00.000Z | Day 05/stats_analysis.py | nitish3006/100-days-of-code-1 | 1cf706ad56c6a7cf141edc833946c2ca6c27b107 | [
"MIT"
] | 13 | 2020-06-15T12:18:39.000Z | 2022-02-22T02:34:02.000Z | import pandas as pd
import matplotlib.pyplot as plt
# Import our data file
stock_prices = pd.read_csv('/data/tesla.csv')
# Print stock_prices DataFrame for review
# print(stock_prices)
# Print using the .describe() method
# print(stock_prices.describe())
# Print the minimum value of Open
# print(stock_prices['Open'].min())
# Print the maximum value of Open
# print(stock_prices['Open'].max())
# Print the average or the mean value of Open
# print(stock_prices['Open'].mean())
stock_prices['Open'].plot(kind='box')
plt.show()
| 21.4 | 45 | 0.73271 | 83 | 535 | 4.614458 | 0.445783 | 0.229765 | 0.250653 | 0.125326 | 0.24282 | 0.24282 | 0.24282 | 0 | 0 | 0 | 0 | 0 | 0.134579 | 535 | 24 | 46 | 22.291667 | 0.827214 | 0.66729 | 0 | 0 | 0 | 0 | 0.13253 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
549e8584b0814592dc85278267c8af959dd649b9 | 165 | py | Python | professor-service/run.py | mjrulesamrat/k8s-demo | b0b7ff300ec0d048990024697deb140bc14ba2f2 | [
"MIT"
] | null | null | null | professor-service/run.py | mjrulesamrat/k8s-demo | b0b7ff300ec0d048990024697deb140bc14ba2f2 | [
"MIT"
] | null | null | null | professor-service/run.py | mjrulesamrat/k8s-demo | b0b7ff300ec0d048990024697deb140bc14ba2f2 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
app = FastAPI()
@app.get("/api/v1/incoming")
def incoming():
return {"message": "You've seccussfully reached professor server!"}
| 20.625 | 71 | 0.70303 | 21 | 165 | 5.52381 | 0.809524 | 0.172414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007143 | 0.151515 | 165 | 7 | 72 | 23.571429 | 0.821429 | 0 | 0 | 0 | 0 | 0 | 0.412121 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0.2 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
54a13f448618c99994c396c6ec7094459e1d8722 | 239 | py | Python | 6 kyu/The Lamp Revisited.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 6 | 2020-09-03T09:32:25.000Z | 2020-12-07T04:10:01.000Z | 6 kyu/The Lamp Revisited.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 1 | 2021-12-13T15:30:21.000Z | 2021-12-13T15:30:21.000Z | 6 kyu/The Lamp Revisited.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | null | null | null | class Lamp:
def __init__(self, color):
self.color=color
self.on=False
def state(self):
return "The lamp is off." if not self.on else "The lamp is on."
def toggle_switch(self):
self.on=not self.on | 29.875 | 71 | 0.606695 | 38 | 239 | 3.684211 | 0.473684 | 0.171429 | 0.128571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.288703 | 239 | 8 | 72 | 29.875 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0.129167 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0 | 0.125 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
54a45a0d1668da8c9b2c0e2992e6a7ef6488f59d | 58 | py | Python | olliebennett/__init__.py | olliebennett/raspberry-pi-scripts | 4e8dc3dcd80b195aa80100a7de2a2a4230715de4 | [
"MIT"
] | 1 | 2015-08-09T21:48:31.000Z | 2015-08-09T21:48:31.000Z | olliebennett/__init__.py | olliebennett/raspberry-pi-scripts | 4e8dc3dcd80b195aa80100a7de2a2a4230715de4 | [
"MIT"
] | 1 | 2015-08-09T23:29:54.000Z | 2015-08-09T23:29:54.000Z | olliebennett/__init__.py | olliebennett/raspberry-pi-scripts | 4e8dc3dcd80b195aa80100a7de2a2a4230715de4 | [
"MIT"
] | null | null | null | __author__ = 'Ollie Bennett | http://olliebennett.co.uk/'
| 29 | 57 | 0.724138 | 7 | 58 | 5.428571 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103448 | 58 | 1 | 58 | 58 | 0.730769 | 0 | 0 | 0 | 0 | 0 | 0.724138 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
54b2bc80bff894dc81754f1c4f6377a0356ac3be | 1,029 | py | Python | snake_agent_factory.py | sbeignez/Coding-Adventures | 3fc3656b73371eac3847cded6c91aa65a6185f5b | [
"MIT"
] | null | null | null | snake_agent_factory.py | sbeignez/Coding-Adventures | 3fc3656b73371eac3847cded6c91aa65a6185f5b | [
"MIT"
] | null | null | null | snake_agent_factory.py | sbeignez/Coding-Adventures | 3fc3656b73371eac3847cded6c91aa65a6185f5b | [
"MIT"
] | null | null | null | from snake_utils import *
from snake_agent_ai import *
from snake_agent_astar import *
from snake_agent_greedy import *
from snake_agent_bfs import *
from snake_agent_rl_qlearning import *
class AgentFactory():
def __init__(self, session, agent_type : Agents):
self._session = session
self._agent_type = agent_type
def get_agent(self):
if self._agent_type == Agents.AGENT_GREEDY:
return AgentGreedy(self._session, self._agent_type)
elif self._agent_type == Agents.AGENT_A_STAR:
return AgentAStar(self._session, self._agent_type)
elif self._agent_type == Agents.AGENT_BFS:
return AgentBFS(self._session, self._agent_type)
elif self._agent_type == Agents.AGENT_SUPER_STAR:
return AgentSuperStar(self._session, self._agent_type)
elif self._agent_type == Agents.AGENT_Q_LEARNING:
return AgentQLearning(self._session, self._agent_type)
else:
raise ValueError("Agents type incorrect")
| 34.3 | 66 | 0.701652 | 130 | 1,029 | 5.130769 | 0.284615 | 0.175412 | 0.214393 | 0.17991 | 0.383808 | 0.311844 | 0.311844 | 0.311844 | 0.311844 | 0.311844 | 0 | 0 | 0.223518 | 1,029 | 29 | 67 | 35.482759 | 0.834793 | 0 | 0 | 0 | 0 | 0 | 0.020448 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.086957 | false | 0 | 0.26087 | 0 | 0.608696 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
49afdbafa3903fc83c1caa9b63dae685d77a7d40 | 505 | py | Python | tests/test_constant.py | civilian/django-business-logic | 3af2175318d019e6327d41e0256cb945b33a713c | [
"MIT"
] | 160 | 2016-05-25T12:51:02.000Z | 2022-01-29T20:39:22.000Z | tests/test_constant.py | civilian/django-business-logic | 3af2175318d019e6327d41e0256cb945b33a713c | [
"MIT"
] | 36 | 2016-09-06T11:13:27.000Z | 2021-02-27T12:33:31.000Z | tests/test_constant.py | civilian/django-business-logic | 3af2175318d019e6327d41e0256cb945b33a713c | [
"MIT"
] | 30 | 2016-07-23T14:41:51.000Z | 2022-03-25T21:31:06.000Z | # -*- coding: utf-8 -*-
#
from .common import *
class ConstantTest(TestCase):
def test_init(self):
integer_const = NumberConstant(value=33)
self.assertEqual(33, integer_const.value)
def test_str(self):
integer_const = NumberConstant(value=33)
self.assertEqual(str(33), str(integer_const))
def test_interpret(self):
integer_const = NumberConstant(value=33)
context = Context()
self.assertEqual(33, integer_const.interpret(context))
| 24.047619 | 62 | 0.665347 | 58 | 505 | 5.637931 | 0.37931 | 0.220183 | 0.146789 | 0.275229 | 0.562691 | 0.431193 | 0.318043 | 0.318043 | 0 | 0 | 0 | 0.032911 | 0.217822 | 505 | 20 | 63 | 25.25 | 0.794937 | 0.041584 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.083333 | 0 | 0.416667 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
49b11908f2f4b153a8067fb495c27246ccd878ea | 1,261 | py | Python | app/backend/api/endpoints/user.py | sourcery-ai-bot/find-my-pet | 82654e20740c3bd7935374868ec0dd0b4d2c33bd | [
"Apache-2.0"
] | 2 | 2020-03-16T10:33:00.000Z | 2021-04-08T09:15:34.000Z | app/backend/api/endpoints/user.py | sourcery-ai-bot/find-my-pet | 82654e20740c3bd7935374868ec0dd0b4d2c33bd | [
"Apache-2.0"
] | 21 | 2020-03-16T11:09:34.000Z | 2021-04-08T12:27:55.000Z | app/backend/api/endpoints/user.py | sourcery-ai-bot/find-my-pet | 82654e20740c3bd7935374868ec0dd0b4d2c33bd | [
"Apache-2.0"
] | 1 | 2021-04-08T09:15:36.000Z | 2021-04-08T09:15:36.000Z | # coding=utf-8
from flask_restplus import Resource
from app.backend.api.restplus import api
from app.backend.api.serializers.user import user_get_serializer, user_post_serializer
from app.backend.web.business.user import UserBus
ns_user = api.namespace('user', description='Users operations and registry')
@ns_user.route('/')
class Users(Resource):
def __init__(self, api=None, *args, **kwargs):
super(Users, self).__init__(api, *args, **kwargs)
self.bus = UserBus()
@api.marshal_with(user_get_serializer)
def get(self):
return self.bus.get()
@api.expect(user_post_serializer)
@api.marshal_with(user_get_serializer, code=201)
def post(self):
return self.bus.add(api.payload)
@ns_user.route('/<username>', methods=('GET', 'POST', 'PUT', 'DELETE'))
class User(Resource):
def __init__(self, api=None, *args, **kwargs):
super(User, self).__init__(api, *args, **kwargs)
self.bus = UserBus()
@api.marshal_with(user_get_serializer)
def get(self, username):
return self.bus.get(username=username)
@api.expect(user_post_serializer)
@api.marshal_with(user_get_serializer)
def put(self, username):
return self.bus.put(username=username, payload=api.payload)
def delete(self, username):
return self.bus.delete(username=username)
| 27.413043 | 86 | 0.747819 | 183 | 1,261 | 4.934426 | 0.262295 | 0.054264 | 0.094131 | 0.079734 | 0.469546 | 0.390919 | 0.390919 | 0.387597 | 0.387597 | 0.296788 | 0 | 0.003552 | 0.107058 | 1,261 | 45 | 87 | 28.022222 | 0.798401 | 0.009516 | 0 | 0.290323 | 0 | 0 | 0.048917 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.225806 | false | 0 | 0.129032 | 0.16129 | 0.580645 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
49b229ed0763a109bb11e917ae10770aaacf0130 | 861 | py | Python | freeline/freeline_core/cursor.py | xyzmst/rxlist | 959ceda68650e71c9b0081a1131fcdc9c60c24d0 | [
"Apache-2.0"
] | 6,094 | 2016-08-03T17:36:41.000Z | 2022-03-29T11:34:21.000Z | freeline/freeline_core/cursor.py | xyzmst/rxlist | 959ceda68650e71c9b0081a1131fcdc9c60c24d0 | [
"Apache-2.0"
] | 1,010 | 2016-08-12T11:59:06.000Z | 2022-01-12T15:50:11.000Z | freeline/freeline_core/cursor.py | xyzmst/rxlist | 959ceda68650e71c9b0081a1131fcdc9c60c24d0 | [
"Apache-2.0"
] | 773 | 2016-08-15T06:41:35.000Z | 2022-02-15T12:40:33.000Z | # -*- coding:utf8 -*-
from terminal import Terminal
class Cursor(object):
def __init__(self, term=None):
self.term = Terminal() if term is None else term
self._stream = self.term.stream
self._saved = False
def write(self, s):
self._stream.write(s)
def save(self):
self.write(self.term.save)
self._saved = True
def restore(self):
if self._saved:
self.write(self.term.restore)
def flush(self):
self._stream.flush()
def newline(self):
self.write(self.term.move_down)
self.write(self.term.clear_bol)
def clear_lines(self, num_lines=0):
for i in range(num_lines):
self.write(self.term.clear_eol)
self.write(self.term.move_down)
for i in range(num_lines):
self.write(self.term.move_up)
| 23.916667 | 56 | 0.599303 | 119 | 861 | 4.176471 | 0.327731 | 0.160966 | 0.183099 | 0.239437 | 0.358149 | 0.245473 | 0.144869 | 0.144869 | 0.144869 | 0.144869 | 0 | 0.003247 | 0.284553 | 861 | 35 | 57 | 24.6 | 0.803571 | 0.022067 | 0 | 0.16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.28 | false | 0 | 0.04 | 0 | 0.36 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
49b49c51ab1b2a3a6302b76933196e47ee8588c6 | 27 | py | Python | omni-mini/configs.py | indy-lab/ProtoTransfer | 90a526bb209160e376b2b8290e99b0f62b240052 | [
"MIT"
] | 43 | 2020-06-23T08:09:08.000Z | 2022-03-03T03:05:34.000Z | omni-mini/configs.py | Asphalt93/ProtoTransfer | 2e186ffd5bd795244c6dd7192575b84f935c5749 | [
"MIT"
] | 5 | 2020-07-03T20:58:24.000Z | 2021-08-04T06:34:09.000Z | omni-mini/configs.py | Asphalt93/ProtoTransfer | 2e186ffd5bd795244c6dd7192575b84f935c5749 | [
"MIT"
] | 9 | 2020-07-21T03:26:29.000Z | 2021-09-26T06:10:37.000Z | data_path = '../few_data/'
| 13.5 | 26 | 0.62963 | 4 | 27 | 3.75 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 27 | 1 | 27 | 27 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
49badaf36438777dc4c34a8a760291b52f883549 | 428 | py | Python | tests/test_sample.py | Itisfilipe/django-live-profiler | 578a8343a42bacc697d688ac4f0a0e2f332f9ab1 | [
"MIT"
] | 24 | 2017-10-21T17:21:19.000Z | 2022-03-31T15:31:47.000Z | tests/test_sample.py | Itisfilipe/django-live-profiler | 578a8343a42bacc697d688ac4f0a0e2f332f9ab1 | [
"MIT"
] | null | null | null | tests/test_sample.py | Itisfilipe/django-live-profiler | 578a8343a42bacc697d688ac4f0a0e2f332f9ab1 | [
"MIT"
] | 15 | 2016-12-10T14:36:51.000Z | 2022-02-05T23:37:42.000Z | """
Sample Test
"""
# pylint: disable=redefined-outer-name, unused-argument
import pytest
import sample.main
@pytest.fixture
def sample_fixture():
"""Setup test fixture"""
return 1
def test_func(sample_fixture):
"""Test the sample function"""
assert sample.main.sample_func(1) == 2
def test_negative(sample_fixture):
"""Negative test of sample function"""
assert sample.main.sample_func(-2) == -1
| 17.833333 | 55 | 0.698598 | 57 | 428 | 5.122807 | 0.421053 | 0.10274 | 0.136986 | 0.178082 | 0.273973 | 0.273973 | 0.273973 | 0 | 0 | 0 | 0 | 0.014045 | 0.168224 | 428 | 23 | 56 | 18.608696 | 0.80618 | 0.334112 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0.333333 | false | 0 | 0.222222 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
49c907d3ef72faa29e29803b1d1c97ca60f8e546 | 682 | py | Python | src/mutanno/web/views.py | dbmi-bgm/cgap-annotation-server | 05d022f254b5e3057abf13aa9c8bdae5eb8b6e3a | [
"MIT"
] | 1 | 2021-05-27T14:27:47.000Z | 2021-05-27T14:27:47.000Z | src/mutanno/web/views.py | dbmi-bgm/cgap-annotation-server | 05d022f254b5e3057abf13aa9c8bdae5eb8b6e3a | [
"MIT"
] | 8 | 2020-02-11T20:06:10.000Z | 2020-09-28T20:03:17.000Z | src/mutanno/web/views.py | dbmi-bgm/cgap-annotation-server | 05d022f254b5e3057abf13aa9c8bdae5eb8b6e3a | [
"MIT"
] | null | null | null | from . import stat
from . import gene
from . import variant
from .util import web
# Create your views here.
def home(request):
data = {}
return web.render(request, 'index.html', data)
def gene_list(request):
data = {}
return web.render(request, 'gene_list.html', data)
def gene_view(request):
data = {}
return web.render(request, 'gene_view.html', data)
def variant_list(request):
data = {}
return web.render(request, 'variant_list.html', data)
def variant_view(request):
data = {}
return web.render(request, 'variant_view.html', data)
def stat_view(request):
data = {}
return web.render(request, 'stat_list.html', data)
| 18.432432 | 57 | 0.668622 | 93 | 682 | 4.795699 | 0.225806 | 0.147982 | 0.2287 | 0.269058 | 0.538117 | 0.538117 | 0.464126 | 0 | 0 | 0 | 0 | 0 | 0.199413 | 682 | 36 | 58 | 18.944444 | 0.81685 | 0.033724 | 0 | 0.272727 | 0 | 0 | 0.130898 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.181818 | 0 | 0.727273 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
49fae2309cb1a52ed464ff0836521e4afc752e3a | 264 | py | Python | webapp/WebProject/user_auth/admin.py | jai-soni/csye6225-spring2019 | a0fb898f650a79bc683e54dd8b51d82633ebe1f4 | [
"Apache-2.0"
] | 1 | 2019-12-03T23:19:00.000Z | 2019-12-03T23:19:00.000Z | webapp/WebProject/user_auth/admin.py | jai-soni/csye6225-spring2019 | a0fb898f650a79bc683e54dd8b51d82633ebe1f4 | [
"Apache-2.0"
] | 4 | 2020-06-06T00:37:09.000Z | 2021-06-10T22:16:04.000Z | webapp/WebProject/user_auth/admin.py | jai-soni/csye6225-spring2019 | a0fb898f650a79bc683e54dd8b51d82633ebe1f4 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import *
class NotesModelAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'content', 'user', 'created_on', 'last_updated_on')
admin.site.register(NotesModel, NotesModelAdmin)
admin.site.register(Attachment) | 37.714286 | 86 | 0.768939 | 32 | 264 | 6.21875 | 0.71875 | 0.201005 | 0.170854 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094697 | 264 | 7 | 87 | 37.714286 | 0.832636 | 0 | 0 | 0 | 0 | 0 | 0.162264 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
b702a614381dd0e01441a33e3e720e1bd9d1f294 | 800 | py | Python | essmc2/datasets/base_dataset.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | null | null | null | essmc2/datasets/base_dataset.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | null | null | null | essmc2/datasets/base_dataset.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | null | null | null | # Copyright 2021 Alibaba Group Holding Limited. All Rights Reserved.
from abc import ABCMeta, abstractmethod
from torch.utils.data import Dataset
from essmc2.utils.file_systems import FS
from ..transforms.registry import build_pipeline, TRANSFORMS
class BaseDataset(Dataset, metaclass=ABCMeta):
def __init__(self,
mode='test',
pipeline=None):
super(BaseDataset, self).__init__()
self.mode = mode
self.pipeline = build_pipeline(pipeline, TRANSFORMS)
def __getitem__(self, index: int):
item = self._get(index)
return self.pipeline(item)
@abstractmethod
def _get(self, index: int):
pass
def __repr__(self) -> str:
return f"{self.__class__.__name__}: mode={self.mode}, len={len(self)}"
| 27.586207 | 78 | 0.67 | 94 | 800 | 5.393617 | 0.510638 | 0.047337 | 0.047337 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00813 | 0.23125 | 800 | 28 | 79 | 28.571429 | 0.81626 | 0.0825 | 0 | 0 | 0 | 0 | 0.087432 | 0.035519 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0.052632 | 0.210526 | 0.052632 | 0.578947 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
b7068bf43698c1ce99824f716d0df94addefe9b2 | 414 | py | Python | app/app/api/routes.py | icapora/fastapi-tortoise | 521e02c097718552a46b5f8fa228ce4669cd095c | [
"MIT"
] | null | null | null | app/app/api/routes.py | icapora/fastapi-tortoise | 521e02c097718552a46b5f8fa228ce4669cd095c | [
"MIT"
] | null | null | null | app/app/api/routes.py | icapora/fastapi-tortoise | 521e02c097718552a46b5f8fa228ce4669cd095c | [
"MIT"
] | null | null | null | from app.controllers import login, opinions, status, users
from fastapi import APIRouter
api_route = APIRouter()
api_route.include_router(status.router, prefix="/status", tags=["status"])
api_route.include_router(login.router, prefix="/login", tags=["login"])
api_route.include_router(users.router, prefix="/users", tags=["users"])
api_route.include_router(opinions.router, prefix="/opinions", tags=["opinions"])
| 46 | 80 | 0.772947 | 55 | 414 | 5.654545 | 0.290909 | 0.128617 | 0.192926 | 0.270096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065217 | 414 | 8 | 81 | 51.75 | 0.803618 | 0 | 0 | 0 | 0 | 0 | 0.125604 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b71ae0ce6f66b6d84f746ac9997b742f50f61d81 | 562 | py | Python | 258_add_digits.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | 1 | 2020-07-15T14:16:23.000Z | 2020-07-15T14:16:23.000Z | 258_add_digits.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | null | null | null | 258_add_digits.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | null | null | null | #
# 258. Add Digits
#
# Q: https://leetcode.com/problems/add-digits/
# A: https://leetcode.com/problems/add-digits/discuss/756944/Javascript-Python3-C%2B%2B-1-Liners
#
# using reduce() to accumulate the digits of x
class Solution:
def addDigits(self, x: int) -> int:
return x if x < 10 else self.addDigits(reduce(lambda a, b: a + b, map(lambda s: int(s), str(x))))
# using sum() to accumulate the digits of x
class Solution:
def addDigits(self, x: int) -> int:
return x if x < 10 else self.addDigits(sum(map(lambda c: int(c), str(x))))
| 33.058824 | 105 | 0.66548 | 95 | 562 | 3.936842 | 0.421053 | 0.072193 | 0.085562 | 0.128342 | 0.652406 | 0.652406 | 0.475936 | 0.475936 | 0.475936 | 0.475936 | 0 | 0.036876 | 0.179715 | 562 | 16 | 106 | 35.125 | 0.774403 | 0.430605 | 0 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.333333 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3f960cdbd0c9cae1606b4d3f26cf2ff15a649f5d | 159 | py | Python | judge_client/constants.py | trojsten/judge-client | 75d28dd7e638ca28bae6b16b256dba16f39385ff | [
"MIT"
] | 2 | 2018-08-19T15:00:02.000Z | 2020-06-17T11:54:47.000Z | judge_client/constants.py | trojsten/judge-client | 75d28dd7e638ca28bae6b16b256dba16f39385ff | [
"MIT"
] | 1 | 2022-01-19T21:02:45.000Z | 2022-01-19T21:02:45.000Z | judge_client/constants.py | trojsten/judge-client | 75d28dd7e638ca28bae6b16b256dba16f39385ff | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Common constants for submit
SUBMIT_RESPONSE_ERROR = 'CERR'
SUBMIT_RESPONSE_OK = 'OK'
SUBMIT_RESPONSE_PROTOCOL_CORRUPTED = 'PROTCOR'
| 22.714286 | 46 | 0.754717 | 20 | 159 | 5.65 | 0.7 | 0.371681 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007194 | 0.125786 | 159 | 6 | 47 | 26.5 | 0.805755 | 0.308176 | 0 | 0 | 0 | 0 | 0.121495 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3f9fce5a9ff4144f4720b5df984f8190750f58fa | 7,926 | py | Python | airbyte-integrations/connectors/source-posthog/source_posthog/streams.py | ravitejasaidus/airbyte | 2f7c15a540ad16824ac80f8674e30c63b915a690 | [
"MIT"
] | 2 | 2021-03-02T09:17:41.000Z | 2021-03-02T11:02:23.000Z | airbyte-integrations/connectors/source-posthog/source_posthog/streams.py | ravitejasaidus/airbyte | 2f7c15a540ad16824ac80f8674e30c63b915a690 | [
"MIT"
] | 4 | 2021-06-10T13:30:31.000Z | 2021-06-10T14:03:22.000Z | airbyte-integrations/connectors/source-posthog/source_posthog/streams.py | keu/airbyte | 0bfd83052887e1ca72ddfdb339c62d2e39b050bc | [
"MIT"
] | 1 | 2021-05-31T00:08:34.000Z | 2021-05-31T00:08:34.000Z | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
import math
import urllib.parse
from abc import ABC, abstractmethod
from typing import Any, Iterable, Mapping, MutableMapping, Optional
import requests
from airbyte_cdk.sources.streams.http import HttpStream
class PosthogStream(HttpStream, ABC):
url_base = "https://app.posthog.com/api/"
primary_key = "id"
data_field = "results"
def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]:
resp_json = response.json()
if resp_json.get("next"):
next_query_string = urllib.parse.urlsplit(resp_json["next"]).query
params = dict(urllib.parse.parse_qsl(next_query_string))
return params
def request_headers(self, **kwargs) -> Mapping[str, Any]:
return {"Content-Type": "application/json", "User-Agent": "posthog-python/1.4.0"}
def parse_response(self, response: requests.Response, stream_state: Mapping[str, Any], **kwargs) -> Iterable[Mapping]:
response_json = response.json()
yield from response_json.get(self.data_field, [])
def request_params(
self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
) -> MutableMapping[str, Any]:
params = {}
if next_page_token:
params.update(next_page_token)
return params
class IncrementalPosthogStream(PosthogStream, ABC):
"""
Because endpoints has descending order we need to save initial state value to know when to stop pagination.
start_date is used to as a min date to filter on.
"""
state_checkpoint_interval = math.inf
def __init__(self, start_date: str, **kwargs):
super().__init__(**kwargs)
self._start_date = start_date
self._initial_state = None # we need to keep it here because next_page_token doesn't accept state argument
@property
@abstractmethod
def cursor_field(self) -> str:
"""
Defining a cursor field indicates that a stream is incremental, so any incremental stream must extend this class
and define a cursor field.
"""
def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]:
"""
Return next page token until we reach the page with records older than state/start_date
"""
min_state = self._initial_state or self._start_date
response_json = response.json()
data = response_json.get(self.data_field, [])
latest_record = data[-1] if data else None # records are ordered so we check only last one
if not latest_record or latest_record[self.cursor_field] > min_state:
return super().next_page_token(response=response)
def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]) -> Mapping[str, Any]:
"""
Return the latest state by comparing the cursor value in the latest record with the stream's most recent state object
and returning an updated state object.
"""
latest_state = latest_record.get(self.cursor_field)
current_state = current_stream_state.get(self.cursor_field) or latest_state
return {self.cursor_field: max(latest_state, current_state)}
def parse_response(self, response: requests.Response, stream_state: Mapping[str, Any], **kwargs) -> Iterable[Mapping]:
data = super().parse_response(response=response, stream_state=stream_state, **kwargs)
for record in data:
if record.get(self.cursor_field) >= stream_state.get(self.cursor_field, self._start_date):
yield record
class Annotations(IncrementalPosthogStream):
"""
Docs: https://posthog.com/docs/api/annotations
"""
cursor_field = "updated_at"
def path(self, **kwargs) -> str:
return "annotation"
def request_params(self, stream_state: Mapping[str, Any], **kwargs) -> MutableMapping[str, Any]:
params = super().request_params(stream_state=stream_state, **kwargs)
params["order"] = f"-{self.cursor_field}" # sort descending
return params
class Cohorts(PosthogStream):
"""
Docs: https://posthog.com/docs/api/cohorts
normal ASC sorting. But without filters like `since`
"""
def path(self, **kwargs) -> str:
return "cohort"
class Events(IncrementalPosthogStream):
"""
Docs: https://posthog.com/docs/api/events
"""
cursor_field = "timestamp"
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
return "event"
def request_params(self, stream_state: Mapping[str, Any], **kwargs) -> MutableMapping[str, Any]:
params = super().request_params(stream_state=stream_state, **kwargs)
since_value = stream_state.get(self.cursor_field) or self._start_date
since_value = max(since_value, self._start_date)
params["after"] = since_value
return params
class EventsSessions(PosthogStream):
"""
Docs: https://posthog.com/docs/api/events
"""
data_field = "result"
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
return "event/sessions"
def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]:
resp_json = response.json()
return resp_json.get("pagination")
class FeatureFlags(PosthogStream):
"""
Docs: https://posthog.com/docs/api/feature-flags
"""
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
return "feature_flag"
class Insights(PosthogStream):
"""
Docs: https://posthog.com/docs/api/insights
Endpoint does not support incremental read because id, created_at and last_refresh are ordered in any particular way
"""
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
return "insight"
class InsightsPath(PosthogStream):
"""
Docs: https://posthog.com/docs/api/insights
"""
data_field = "result"
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
return "insight/path"
class InsightsSessions(PosthogStream):
"""
Docs: https://posthog.com/docs/api/insights
"""
data_field = "result"
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
return "insight/session"
class Persons(PosthogStream):
"""
Docs: https://posthog.com/docs/api/people
"""
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
return "person"
class Trends(PosthogStream):
"""
Docs: https://posthog.com/docs/api/insights
"""
data_field = "result"
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
return "insight/trend"
| 34.311688 | 135 | 0.682438 | 1,020 | 7,926 | 5.169608 | 0.264706 | 0.028447 | 0.051773 | 0.03224 | 0.377394 | 0.362981 | 0.33169 | 0.269107 | 0.260193 | 0.251849 | 0 | 0.001277 | 0.209816 | 7,926 | 230 | 136 | 34.46087 | 0.840651 | 0.296997 | 0 | 0.303922 | 0 | 0 | 0.054126 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.215686 | false | 0 | 0.058824 | 0.107843 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3fb8f9ccd0741445fdf777a6b82e63cf07f8eccc | 282 | py | Python | snipping/main.py | yittg/Snipping | 99962214e81ed4a0a02b9cc01f7faa5cb702e39b | [
"MIT"
] | 4 | 2016-02-16T10:25:35.000Z | 2016-11-30T06:11:05.000Z | snipping/main.py | yittg/Snipping | 99962214e81ed4a0a02b9cc01f7faa5cb702e39b | [
"MIT"
] | 2 | 2016-02-16T10:23:52.000Z | 2016-02-16T15:42:32.000Z | snipping/main.py | yittg/Snipping | 99962214e81ed4a0a02b9cc01f7faa5cb702e39b | [
"MIT"
] | null | null | null | """Main
"""
import sys
from snipping import application
from snipping import prompt_toolkit
def main():
init_file = None
if len(sys.argv) > 1:
init_file = sys.argv[1]
app = application.get_application(init_file=init_file)
return prompt_toolkit.run(app)
| 16.588235 | 58 | 0.698582 | 40 | 282 | 4.75 | 0.5 | 0.168421 | 0.189474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008929 | 0.205674 | 282 | 16 | 59 | 17.625 | 0.839286 | 0.014184 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
3fdb30c557fd3c99486708db0ff972f2db57069b | 9,175 | py | Python | crystalgodgenerator.py | trinitysoulstars/thecrystalgod.com | 97a5e56fdc2260bacf60b0cea7982a3d28287285 | [
"Apache-2.0"
] | null | null | null | crystalgodgenerator.py | trinitysoulstars/thecrystalgod.com | 97a5e56fdc2260bacf60b0cea7982a3d28287285 | [
"Apache-2.0"
] | null | null | null | crystalgodgenerator.py | trinitysoulstars/thecrystalgod.com | 97a5e56fdc2260bacf60b0cea7982a3d28287285 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
""" Generate The Corpus Cloud with Page Elements, to be Styled """
import jinja2
import arrow
corpus = {
"5Cars": "http://5cars.world",
"Astral Seed": "http://trinitysoulstars.com",
"Ascension Symptoms": "http://ascension.fyi",
"Amethyst Grills": "http://amethystgrills.com/",
"Bubblin": "http://bubblin.life",
"Clouds": "http://clouds.zone",
"decause": "http://twitter.com/remy_d",
"Five Cars": "http://5cars.world",
"Guarav": "http://trinitysoulstars.com",
"Higher Self": "http://highself.solutions",
"Juice Brew": "http://juicebrew.life",
"LightBody": "http://lightbodytherapy.life",
"Manifest": "http://trinitysoulstars.com",
"Mt Meru": "http://mtmeru.life",
"Nino": "http://nino.movie",
"Realms": "http://trinitysoulstars.com",
"Starseed": "http://trinitysoulstars.com",
"Soulstar": "http://trinitysoulstars.com",
"Theosyn": "http://trinitysoulstars.com",
"TRS": "http://truthreignsupreme.club",
"Source": "http://github.com/trinitysoulstars",
}
terms = []
titles = ["Welcome to the Trinity Node - the most lit sector in the multiverse"]
metadesc = ["Welcome to the Trinity Node - the most lit sector in the multiverse"]
authors = ["Trinity Soulstars - https://github.com/trinitysoulstars"]
videos = ['<iframe width="560" height="315" src="https://www.youtube.com/embed/3V8mfIDWy1M" frameborder="0" allowfullscreen></iframe>']
boldwords = {
"Crystal God": "http://thecrystalgod.com/",
}
# analytics = ['''
# ''']
for term, link in corpus.iteritems():
print term, link
terms.append(term)
print "terms = %s " % terms
print "titles = %s " % titles
print "metadesc = %s " % metadesc
print "authors = %s " % authors
print "videos = %s " % videos
#print "analytics = %s " % analytics
for term, link in boldwords.iteritems():
print term, link
template = jinja2.Template("""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>
{%- for title in titles: -%}
{{title}}
{%- endfor -%}
</title>
<meta name="description" content="
{%- for desc in metadesc: -%}
{{desc}}
{%- endfor -%}"/>
<meta name="keywords" content="
{%- for term in terms: -%}
{{term}},
{%- endfor %}"/>
<meta name="author" content="
{%- for author in authors: -%}
{{author}}
{%- endfor -%}"/>
<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
<!-- Bootstrap Core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<!-- Theme CSS -->
<link href="css/grayscale.min.css" rel="stylesheet">
<!-- Font for Stars Background -->
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>
<!-- Custom CSS -->
<link href="css/custom.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDomains", ["*.thecrystalgod.com","*.trinitysoulstars.github.io/thecrystalgod"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//piwik-decause.rhcloud.com/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '7']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//piwik-decause.rhcloud.com/piwik.php?idsite=7" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
</head>
<div id='stars'></div>
<div id='stars2'></div>
<div id='stars3'></div>
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
<!-- Navigation -->
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
Menu <i class="fa fa-bars"></i>
</button>
<a class="navbar-brand page-scroll" href="#page-top">
<i class="fa fa-codepen"></i> <span class="light">Trinity</span> NODE
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- Hidden li included to remove active class from about link when scrolled up past about section -->
<li class="hidden">
<a href="#page-top"></a>
</li>
<li>
<a target="_blank" class="page-scroll" href="https://soundcloud.com/trinitysoulstars"><i style="margin-right: 3px;" class="fa fa-soundcloud"></i> <span style="font-size:13px;">SoundCloud</span></a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Body -->
<header class="intro" style="margin-top: 5%;">
<div class="intro-body">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<a class="logo" href ="http://trinitysoulstars.com/" target="_blank"><img style="width: 230px;" src="img/logo.png"/></a>
{% for video in videos: %}
{{video}},
{% endfor %}
<hr style="margin-top: 8px;margin-bottom: 13px;border: 0;border-top: 1px solid #eee;width: 500px;"/>
<p style="margin: 30px 0 40px;"><a style="margin-right:8px:" href="https://www.facebook.com/trinitysoulstars" class="btn btn-circle page-scroll" target="_blank">
<i class="fa fa-facebook"></i>
</a>
<a style="margin-left:4px;margin-right:4px;" href="https://twitter.com/trinitysoulstar" class="btn btn-circle page-scroll" target="_blank">
<i class="fa fa-twitter"></i>
</a>
<a href="https://www.instagram.com/trinitysoulstars/" class="btn btn-circle page-scroll" target="_blank">
<i class="fa fa-instagram"></i>
</a>
</p>
<!-- Tag Cloud -->
<p class='pcloud'>
{% for term, link in boldwords.iteritems(): -%}
<a class='boldwords btn-lg' target="_blank" href="{{link}}">{{term}}</a>
{% endfor -%}
{% for term, link in corpus.iteritems(): -%}
<a target="_blank" class="btn-lg" href="{{link}}">{{term}}</a>
{% endfor %}
</p>
</div>
</div>
</div>
</div>
</header>
<!-- jQuery -->
<script src="vendor/jquery/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<!-- Google Maps API Key - Use your own API key to enable the map feature. More information on the Google Maps API can be found at https://developers.google.com/maps/ -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCRngKslUGJTlibkQ3FkfTxj3Xss1UlZDA&sensor=false"></script>
<!-- Theme JavaScript -->
<script src="js/grayscale.min.js"></script>
</body>
</html>
""")
# When you add new elements to the template, you must define it outside the template, and then pass in the value below
output = template.render(corpus=corpus, terms=terms, titles=titles, metadesc=metadesc, authors=authors, videos=videos, boldwords=boldwords)
with open('{}.html'.format(arrow.now().format()[0:10]), "wb") as f:
f.write(output)
| 38.389121 | 221 | 0.577112 | 1,091 | 9,175 | 4.839597 | 0.328139 | 0.013636 | 0.034848 | 0.023864 | 0.159659 | 0.129924 | 0.101894 | 0.079167 | 0.079167 | 0.079167 | 0 | 0.01349 | 0.23248 | 9,175 | 238 | 222 | 38.55042 | 0.736297 | 0.02158 | 0 | 0.122995 | 1 | 0.128342 | 0.88693 | 0.137997 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.010695 | null | null | 0.037433 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b20477a785a95ce58d48f3e8fd272d89b4d1b78a | 882 | py | Python | src/repositories/user.py | laurosn/flask-api-starter-kit | 09a5b67bf48abeb427beae9bccae323aea16d9ae | [
"MIT"
] | null | null | null | src/repositories/user.py | laurosn/flask-api-starter-kit | 09a5b67bf48abeb427beae9bccae323aea16d9ae | [
"MIT"
] | null | null | null | src/repositories/user.py | laurosn/flask-api-starter-kit | 09a5b67bf48abeb427beae9bccae323aea16d9ae | [
"MIT"
] | null | null | null | """ Defines the User repository """
from models.user import User
from models import db
class UserRepository:
""" The repository for the user model """
@staticmethod
def get(email):
""" Query a user by last and first name """
return User.query.filter_by(email=email).one_or_none()
def update(self, last_name, first_name, age):
""" Update a user's age """
user = self.get(last_name, first_name)
user.age = age
return user.save()
@staticmethod
def create(last_name, first_name, age):
""" Create a new user """
user = User(last_name=last_name, first_name=first_name, age=age)
return user.save()
def delete(self, last_name, first_name):
""" Delete a user """
user = self.get(last_name, first_name)
if user:
user.delete()
return user
| 24.5 | 72 | 0.606576 | 119 | 882 | 4.352941 | 0.310924 | 0.138996 | 0.175676 | 0.196911 | 0.310811 | 0.108108 | 0.108108 | 0 | 0 | 0 | 0 | 0 | 0.282313 | 882 | 35 | 73 | 25.2 | 0.818325 | 0.174603 | 0 | 0.315789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0 | 0.105263 | 0 | 0.578947 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
b20abb9d50c97067e8f3df612bf6df5889a596b3 | 227 | py | Python | src/setup.py | mikewolfli/batch_print | 3e10af5a30ce1b92e0a65d9e0bcda5f6c4cec374 | [
"Unlicense"
] | null | null | null | src/setup.py | mikewolfli/batch_print | 3e10af5a30ce1b92e0a65d9e0bcda5f6c4cec374 | [
"Unlicense"
] | null | null | null | src/setup.py | mikewolfli/batch_print | 3e10af5a30ce1b92e0a65d9e0bcda5f6c4cec374 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Created on 2015年8月25日
@author: 10256603
'''
from distutils.core import setup
import encodings
import py2exe
setup(windows=[ {
"script":"batch_print.py",
}]) | 17.461538 | 50 | 0.568282 | 23 | 227 | 5.565217 | 0.869565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.10559 | 0.290749 | 227 | 13 | 51 | 17.461538 | 0.689441 | 0.277533 | 0 | 0 | 0 | 0 | 0.127389 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0.166667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
b20b22377658b8b32fc3a27778302df85bee4703 | 157 | py | Python | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 11/E9.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | 12 | 2018-11-14T03:55:58.000Z | 2021-12-12T01:13:05.000Z | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 11/E9.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | null | null | null | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 11/E9.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | 7 | 2019-10-10T06:28:58.000Z | 2022-02-15T07:18:12.000Z | song = "The rain in Spain..."
print(" ".join(song.split()))
# the output only differs from the 'song' when there are more than one spaces between characters
| 39.25 | 96 | 0.719745 | 25 | 157 | 4.52 | 0.84 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159236 | 157 | 3 | 97 | 52.333333 | 0.856061 | 0.598726 | 0 | 0 | 0 | 0 | 0.344262 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
b753a6417322c9a45f24683d3e370f24f175092a | 1,549 | py | Python | authx/utils.py | ace-han/onedegree | ffa30c518a0035509289c36e70316c1b660df3fd | [
"BSD-3-Clause"
] | null | null | null | authx/utils.py | ace-han/onedegree | ffa30c518a0035509289c36e70316c1b660df3fd | [
"BSD-3-Clause"
] | 2 | 2015-10-27T10:12:36.000Z | 2015-11-01T05:21:06.000Z | authx/utils.py | ace-han/onedegree | ffa30c518a0035509289c36e70316c1b660df3fd | [
"BSD-3-Clause"
] | null | null | null |
from rest_framework import serializers
from authx.models import User
from rest_framework_jwt.utils import jwt_payload_handler as drf_jwt_payload_handler
class UserSerializer(serializers.ModelSerializer):
password = serializers.CharField(
style={'input_type': 'password'},
write_only=True # password not showing for the time being
)
class Meta:
model = User
def jwt_response_payload_handler(token, user=None, request=None):
"""
Returns the response data for both the login and refresh views.
Override to return a custom response such as including the
serialized representation of the User.
Deprecated: as some info can be within token xxx.yyy.zzz
payload => yyy (base64 encoded)
"""
return {
'token': token,
#'user': UserSerializer(user).data,
}
def jwt_payload_handler(user):
payload = drf_jwt_payload_handler(user)
'''
warnings.warn(
'The following fields will be removed in the future: '
'`email` and `user_id`. ',
DeprecationWarning
)
payload = {
'user_id': user.pk,
'email': user.email,
'username': username,
'exp': datetime.utcnow() + api_settings.JWT_EXPIRATION_DELTA
}
'''
payload.setdefault('selfie_path', user.selfie_path)
payload.setdefault('nickname', user.nickname or user.username)
# payload.setdefault('roles', []) # TODO
return payload | 30.372549 | 83 | 0.630084 | 173 | 1,549 | 5.49711 | 0.537572 | 0.073607 | 0.071504 | 0.042061 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0018 | 0.282763 | 1,549 | 51 | 84 | 30.372549 | 0.854185 | 0.23499 | 0 | 0 | 0 | 0 | 0.055191 | 0 | 0 | 0 | 0 | 0.019608 | 0 | 1 | 0.105263 | false | 0.105263 | 0.157895 | 0 | 0.526316 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
b77fc50fd4c1ddb1388835baab0d1cea697c0adc | 249 | py | Python | engine/constants.py | tynr-io/labelling-engine | 96befdd9b7cad977fbcdc878c94f23a2ffe9f79f | [
"MIT"
] | null | null | null | engine/constants.py | tynr-io/labelling-engine | 96befdd9b7cad977fbcdc878c94f23a2ffe9f79f | [
"MIT"
] | null | null | null | engine/constants.py | tynr-io/labelling-engine | 96befdd9b7cad977fbcdc878c94f23a2ffe9f79f | [
"MIT"
] | null | null | null | DATABASES_PATH="../tmp/storage"
CREDENTIALS_PATH_BUCKETS="../credentials/tynr/engine/bucketAccess.json"
CREDENTIALS_PATH_FIRESTORE = '../credentials/tynr/engine/firestoreServiceAccount.json'
INGESTION_COLLECTION = "tyns"
INGESTION_BATCH_LIMIT = 1000 | 49.8 | 86 | 0.835341 | 27 | 249 | 7.407407 | 0.666667 | 0.15 | 0.21 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016736 | 0.040161 | 249 | 5 | 87 | 49.8 | 0.820084 | 0 | 0 | 0 | 0 | 0 | 0.468 | 0.396 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b78bfe0092dbfc66846b95d60cda4b7bb9980b6b | 2,911 | py | Python | app/controllers/web/admin/component.py | arxcdr/silverback | 212139cbc1a648d1f877d60f2d7c4d750eefc3da | [
"BSD-3-Clause"
] | null | null | null | app/controllers/web/admin/component.py | arxcdr/silverback | 212139cbc1a648d1f877d60f2d7c4d750eefc3da | [
"BSD-3-Clause"
] | null | null | null | app/controllers/web/admin/component.py | arxcdr/silverback | 212139cbc1a648d1f877d60f2d7c4d750eefc3da | [
"BSD-3-Clause"
] | null | null | null | """
Component Web Controller
"""
# Standard Library
import os
# Third Party Library
from django.views import View
from django.http import Http404
from django.shortcuts import render
from django.utils.translation import gettext as _
# Local Library
from app.modules.core.context import Context
from app.modules.core.decorators import login_if_not_authenticated
from app.modules.core.component import Component as ComponentModule
class ComponentList(View):
template_name = 'templates/admin/component/list.html'
__context = Context()
__component = ComponentModule()
__correlation_id = None
@login_if_not_authenticated
def get(self, request):
self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else ""
self.__context.autoload_options()
self.__context.autoload_user(request.user.id if request.user.is_authenticated else None)
self.__context.push({
"page_title": _("Components · %s") % self.__context.get("app_name", os.getenv("APP_NAME", "Silverback"))
})
return render(request, self.template_name, self.__context.get())
class ComponentAdd(View):
template_name = 'templates/admin/component/add.html'
__context = Context()
__component = ComponentModule()
__correlation_id = None
@login_if_not_authenticated
def get(self, request):
self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else ""
self.__context.autoload_options()
self.__context.autoload_user(request.user.id if request.user.is_authenticated else None)
self.__context.push({
"page_title": _("Add a Component · %s") % self.__context.get("app_name", os.getenv("APP_NAME", "Silverback")),
"groups": self.__component.get_all_groups()
})
return render(request, self.template_name, self.__context.get())
class ComponentEdit(View):
template_name = 'templates/admin/component/edit.html'
__context = Context()
__component = ComponentModule()
__correlation_id = None
@login_if_not_authenticated
def get(self, request, component_id):
self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else ""
component = self.__component.get_one_by_id(component_id)
if not component:
raise Http404("Component not found.")
self.__context.autoload_options()
self.__context.autoload_user(request.user.id if request.user.is_authenticated else None)
self.__context.push({
"page_title": _("Edit Component · %s") % self.__context.get("app_name", os.getenv("APP_NAME", "Silverback")),
"component": component,
"groups": self.__component.get_all_groups()
})
return render(request, self.template_name, self.__context.get())
| 33.848837 | 122 | 0.69976 | 354 | 2,911 | 5.437853 | 0.211864 | 0.085714 | 0.043636 | 0.047792 | 0.72 | 0.72 | 0.659221 | 0.659221 | 0.659221 | 0.659221 | 0 | 0.00254 | 0.188595 | 2,911 | 85 | 123 | 34.247059 | 0.811177 | 0.026108 | 0 | 0.607143 | 0 | 0 | 0.142655 | 0.036814 | 0 | 0 | 0 | 0 | 0 | 1 | 0.053571 | false | 0 | 0.142857 | 0 | 0.517857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
b793db1e2c44b3691ddb98dddc04eaa2f28dba82 | 580 | py | Python | src/helperobjects/EntryCellRow.py | linjorejoy/json-testcase-generator | 872c5dd48e97746ee8f538c105611cb2395d7d22 | [
"MIT"
] | 1 | 2021-08-11T02:51:28.000Z | 2021-08-11T02:51:28.000Z | src/helperobjects/EntryCellRow.py | linjorejoy/json-testcase-generator | 872c5dd48e97746ee8f538c105611cb2395d7d22 | [
"MIT"
] | null | null | null | src/helperobjects/EntryCellRow.py | linjorejoy/json-testcase-generator | 872c5dd48e97746ee8f538c105611cb2395d7d22 | [
"MIT"
] | null | null | null | from tkinter import Entry
from helperobjects.EntryCell import EntryCell
from typing import List
class EntryCellRow:
def __init__(self):
self.file_name:str = None
self.entry_cell_list:List[EntryCell] = []
self.comment_entry:Entry = None
def add_cell(self, entry_cell:EntryCell):
self.entry_cell_list.append(entry_cell)
def get_all(self):
return self.entry_cell_list
def __hash__(self):
return hash(self.__key)
def __key(self):
return (self.file_name.__hash__, self.entry_cell_list.__hash__)
| 25.217391 | 71 | 0.691379 | 77 | 580 | 4.753247 | 0.337662 | 0.147541 | 0.177596 | 0.185792 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.227586 | 580 | 23 | 72 | 25.217391 | 0.816964 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3125 | false | 0 | 0.1875 | 0.1875 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
b7973259be592dd476bcb72ec56c97380048fb93 | 37,916 | py | Python | instagram_api/big_strings/experiments.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | 13 | 2019-08-07T21:24:34.000Z | 2020-12-12T12:23:50.000Z | instagram_api/big_strings/experiments.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | instagram_api/big_strings/experiments.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | __all__ = ['EXPERIMENTS']
EXPERIMENTS = ','.join([
'ig_android_sticker_search_explorations',
'android_ig_camera_ar_asset_manager_improvements_universe',
'ig_android_stories_seen_state_serialization',
'ig_stories_photo_time_duration_universe',
'ig_android_bitmap_cache_executor_size',
'ig_android_stories_music_search_typeahead',
'ig_android_delayed_comments',
'ig_android_switch_back_option',
'ig_android_video_profiler_loom_traces',
'ig_android_paid_branded_content_rendering',
'ig_android_direct_app_reel_grid_search',
'ig_android_stories_no_inflation_on_app_start',
'ig_android_camera_sdk_check_gl_surface_r2',
'ig_promote_review_screen_title_universe',
'ig_android_direct_newer_single_line_composer_universe',
'ig_direct_holdout_h1_2019',
'ig_explore_2019_h1_destination_cover',
'ig_android_direct_stories_in_direct_inbox',
'ig_fb_graph_differentiation_no_fb_data',
'ig_android_recyclerview_binder_group_enabled_universe',
'ig_android_direct_share_sheet_custom_fast_scroller',
'ig_android_video_exoplayer_2',
'ig_android_shopping_channel_in_explore',
'ig_android_stories_music_filters',
'ig_android_2018_h1_hashtag_report_universe',
'ig_android_live_replay_highlights_universe',
'ig_android_hashtag_page_reduced_related_items',
'ig_android_live_titles_broadcaster_side_create_title_universe',
'ig_android_fbns_preload_direct_universe',
'ig_android_prefetch_carousels_on_swipe_universe',
'ig_camera_network_activity_logger',
'ig_camera_remove_display_rotation_cb_universe',
'ig_android_interactions_migrate_inline_composer_to_viewpoint_universe',
'ig_android_realtime_always_start_connection_on_condition_universe',
'ig_android_ad_leadgen_single_screen_universe',
'ig_android_enable_zero_rating',
'ig_android_import_page_post_after_biz_conversion',
'ig_camera_ar_effect_attribution_position',
'ig_android_vc_call_ended_cleanup_universe',
'ig_stories_engagement_holdout_2019_h1_universe',
'ig_android_story_import_intent',
'ig_direct_report_conversation_universe',
'ig_biz_graph_connection_universe',
'ig_android_codec_high_profile',
'ig_android_nametag',
'ig_android_sso_family_key_universe',
'ig_android_parse_direct_messages_bytes_universe',
'ig_hashtag_creation_universe',
'ig_android_gallery_order_by_date_taken',
'ig_android_igtv_reshare',
'ig_end_of_feed_universe',
'ig_android_share_others_post_reorder',
'ig_android_additional_contact_in_nux',
'ig_android_live_use_all_preview_sizes',
'ig_android_clarify_invite_options',
'ig_android_live_align_by_2_universe',
'ig_android_separate_network_executor',
'ig_android_realtime_manager_optimization',
'ig_android_auto_advance_su_unit_when_scrolled_off_screen',
'ig_android_network_cancellation',
'ig_android_media_as_sticker',
'ig_android_stories_video_prefetch_kb',
'ig_android_maintabfragment',
'ig_inventory_connections',
'ig_stories_injection_tool_enabled_universe',
'ig_android_stories_disable_highlights_media_preloading',
'ig_android_live_start_broadcast_optimized_universe',
'ig_android_stories_question_response_mutation_universe',
'ig_android_onetap_upsell_change_pwd',
'ig_nametag_data_collection',
'ig_android_disable_scroll_listeners',
'ig_android_persistent_nux',
'ig_android_igtv_audio_always_on',
'ig_android_enable_liger_preconnect_universe',
'ig_android_persistent_duplicate_notif_checker_user_based',
'ig_android_rate_limit_mediafeedviewablehelper',
'ig_android_search_remove_null_state_sections',
'ig_android_stories_viewer_drawable_cache_universe',
'ig_direct_android_reply_modal_universe',
'ig_android_biz_qp_suggest_page',
'ig_shopping_indicator_content_variations_android',
'ig_android_stories_reel_media_item_automatic_retry',
'ig_fb_notification_universe',
'ig_android_live_disable_speed_test_ui_timeout_universe',
'ig_android_direct_thread_scroll_perf_oncreate_universe',
'ig_android_low_data_mode_backup_2',
'ig_android_invite_xout_universe',
'ig_android_low_data_mode_backup_3',
'ig_android_low_data_mode_backup_4',
'ig_android_low_data_mode_backup_5',
'ig_android_video_abr_universe',
'ig_android_low_data_mode_backup_1',
'ig_android_signup_refactor_santity',
'ig_challenge_general_v2',
'ig_android_place_signature_universe',
'ig_android_hide_button_for_invite_facebook_friends',
'ig_android_business_promote_tooltip',
'ig_android_follow_requests_ui_improvements',
'ig_android_shopping_post_tagging_nux_universe',
'ig_android_stories_sensitivity_screen',
'ig_android_camera_arengine_shader_caching_universe',
'ig_android_insta_video_broadcaster_infra_perf',
'ig_android_direct_view_more_qe',
'ig_android_direct_visual_message_prefetch_count_universe',
'ig_camera_android_ar_effect_stories_deeplink',
'ig_android_client_side_delivery_universe',
'ig_android_stories_send_client_reels_on_tray_fetch_universe',
'ig_android_direct_inbox_background_view_models',
'ig_android_startup_thread_priority',
'ig_android_stories_viewer_responsiveness_universe',
'ig_android_live_use_rtc_upload_universe',
'ig_android_live_ama_viewer_universe',
'ig_android_business_id_conversion_universe',
'ig_smb_ads_holdout_2018_h2_universe',
'ig_android_modal_activity_no_animation_fix_universe',
'ig_android_camera_post_smile_low_end_universe',
'ig_android_live_realtime_comments_universe',
'ig_android_vc_in_app_notification_universe',
'ig_eof_caboose_universe',
'ig_android_new_one_tap_nux_universe',
'ig_android_igds_edit_profile_fields',
'ig_android_downgrade_viewport_exit_behavior',
'ig_android_mi_batch_upload_universe',
'ig_camera_android_segmentation_async_universe',
'ig_android_use_recyclerview_for_direct_search_universe',
'ig_android_live_comment_fetch_frequency_universe',
'ig_android_create_page_on_top_universe',
'ig_android_direct_log_badge_count_inconsistent',
'ig_android_stories_text_format_emphasis',
'ig_android_question_sticker_replied_state',
'ig_android_ad_connection_manager_universe',
'ig_android_image_upload_skip_queue_only_on_wifi',
'ig_android_ad_watchbrowse_carousel_universe',
'ig_android_interactions_show_verified_badge_for_preview_comments_universe',
'ig_stories_question_sticker_music_format_prompt',
'ig_android_activity_feed_row_click',
'ig_android_hide_crashing_newsfeed_story_t38131972',
'ig_android_video_upload_quality_qe1',
'ig_android_save_collaborative_collections',
'ig_android_location_attribution_text',
'ig_camera_android_profile_ar_notification_universe',
'coupon_price_test_boost_instagram_media_acquisition_universe',
'ig_android_video_outputsurface_handlerthread_universe',
'ig_android_country_code_fix_universe',
'ig_perf_android_holdout_2018_h1',
'ig_android_stories_music_overlay',
'ig_android_enable_lean_crash_reporting_universe',
'ig_android_resumable_downloads_logging_universe',
'ig_android_stories_default_rear_camera_universe',
'ig_android_low_latency_consumption_universe',
'ig_android_offline_mode_holdout',
'ig_android_foreground_location_collection',
'ig_android_stories_close_friends_disable_first_time_badge',
'ig_android_react_native_universe_kill_switch',
'ig_android_video_ta_universe',
'ig_android_media_rows_async_inflate',
'ig_android_stories_gallery_video_segmentation',
'ig_android_stories_in_feed_preview_notify_fix_universe',
'ig_android_video_rebind_force_keep_playing_fix',
'ig_android_direct_business_holdout',
'ig_android_xposting_upsell_directly_after_sharing_to_story',
'ig_android_gallery_high_quality_photo_thumbnails',
'ig_android_interactions_new_comment_like_pos_universe',
'ig_feed_core_experience_universe',
'ig_android_friends_sticker',
'ig_android_business_ix_universe',
'ig_android_suggested_highlights',
'ig_android_stories_posting_offline_ui',
'ig_android_stories_close_friends_rings_remove_green_universe',
'ig_android_canvas_tilt_to_pan_universe',
'ig_android_vc_background_call_toast_universe',
'ig_android_concurrent_cold_start_universe',
'ig_promote_default_destination_universe',
'mi_viewpoint_viewability_universe',
'ig_android_location_page_info_page_upsell',
'igds_android_listrow_migration_universe',
'ig_direct_reshare_sharesheet_ranking',
'ig_android_fb_sync_options_universe',
'ig_android_drawable_usage_logging_universe',
'ig_android_recommend_accounts_destination_routing_fix',
'ig_android_fix_prepare_direct_push',
'ig_direct_android_larger_media_reshare_style',
'ig_android_video_feed_universe',
'ig_android_building_aymf_universe',
'ig_android_internal_sticker_universe',
'ig_traffic_routing_universe',
'ig_android_search_normalization',
'ig_android_ad_watchmore_entry_point_universe',
'ig_camera_android_segmentation_enabled_universe',
'ig_android_igtv_always_show_browse_ui',
'ig_android_page_claim_deeplink_qe',
'ig_explore_2018_h2_account_rec_deduplication_android',
'ig_android_story_accidentally_click_investigation_universe',
'ig_android_shopping_pdp_hero_carousel',
'ig_android_clear_inflight_image_request',
'ig_android_show_su_in_other_users_follow_list',
'ig_android_stories_infeed_lower_threshold_launch',
'ig_android_main_feed_video_countdown_timer',
'instagram_interests_holdout',
'ig_android_continuous_video_capture',
'ig_android_category_search_edit_profile',
'ig_android_contact_invites_nux_universe',
'ig_android_settings_search_v2_universe',
'ig_android_video_upload_iframe_interval',
'ig_business_new_value_prop_universe',
'ig_android_power_metrics',
'ig_android_stories_collapse_seen_segments',
'ig_android_live_follow_from_comments_universe',
'ig_android_hashtag_discover_tab',
'ig_android_live_skip_live_encoder_pts_correction',
'ig_android_reel_zoom_universe',
'enable_creator_account_conversion_v0_universe',
'ig_android_test_not_signing_address_book_unlink_endpoint',
'ig_android_direct_tabbed_media_picker',
'ig_android_direct_mutation_manager_job_scheduler',
'ig_ei_option_setting_universe',
'ig_android_hashtag_related_items_over_logging',
'ig_android_livewith_liveswap_optimization_universe',
'ig_android_direct_new_intro_card',
'ig_camera_android_supported_capabilities_api_universe',
'ig_android_video_webrtc_textureview',
'ig_android_share_claim_page_universe',
'ig_direct_android_mentions_sender',
'ig_android_whats_app_contact_invite_universe',
'ig_android_video_scrubber_thumbnail_universe',
'ig_camera_ar_image_transform_library',
'ig_android_insights_creation_growth_universe',
'ig_android_igtv_refresh_tv_guide_interval',
'ig_android_stories_gif_sticker',
'ig_android_stories_music_broadcast_receiver',
'ig_android_fb_profile_integration_fbnc_universe',
'ig_android_low_data_mode',
'ig_fb_graph_differentiation_control',
'ig_android_show_create_content_pages_universe',
'ig_android_igsystrace_universe',
'ig_android_new_contact_invites_entry_points_universe',
'ig_android_ccu_jobscheduler_inner',
'ig_android_netego_scroll_perf',
'ig_android_fb_connect_follow_invite_flow',
'ig_android_invite_list_button_redesign_universe',
'ig_android_react_native_email_sms_settings_universe',
'ig_android_igtv_aspect_ratio_limits',
'ig_hero_player',
'ig_android_save_auto_sharing_to_fb_option_on_server',
'ig_android_live_presence_universe',
'ig_android_whitehat_options_universe',
'android_cameracore_preview_frame_listener2_ig_universe',
'ig_android_memory_manager',
'ig_account_recs_in_chaining',
'ig_explore_2018_finite_chain_android_universe',
'ig_android_tagging_video_preview',
'ig_android_feed_survey_viewpoint',
'ig_android_hashtag_search_suggestions',
'ig_android_profile_neue_infra_rollout_universe',
'ig_android_instacrash_detection',
'ig_android_interactions_add_search_bar_to_likes_list_universe',
'ig_android_vc_capture_universe',
'ig_nametag_local_ocr_universe',
'ig_branded_content_share_to_facebook',
'ig_android_direct_segmented_video',
'ig_android_search_page_v2',
'ig_android_stories_recently_captured_universe',
'ig_business_integrity_ipc_universe',
'ig_android_share_product_universe',
'ig_fb_graph_differentiation_top_k_fb_coefficients',
'ig_shopping_viewer_share_action',
'ig_android_direct_share_story_to_facebook',
'ig_android_business_attribute_sync',
'ig_android_video_time_to_live_cache_eviction',
'ig_android_location_feed_related_business',
'ig_android_view_and_likes_cta_universe',
'ig_live_holdout_h2_2018',
'ig_android_profile_memories_universe',
'ig_promote_budget_warning_view_universe',
'ig_android_redirect_to_web_on_oembed_fail_universe',
'ig_android_optic_new_focus_controller',
'ig_android_shortcuts',
'ig_android_search_hashtag_badges',
'ig_android_navigation_latency_logger',
'ig_android_direct_composer_avoid_hiding_thread_camera',
'ig_android_direct_remix_visual_messages',
'ig_android_custom_story_import_intent',
'ig_android_biz_new_choose_category',
'ig_android_view_info_universe',
'ig_android_camera_upsell_dialog',
'ig_android_business_ix_self_serve',
'ig_android_dead_code_detection',
'ig_android_ad_watchbrowse_universe',
'ig_android_pbia_proxy_profile_universe',
'ig_android_qp_kill_switch',
'ig_android_gap_rule_enforcer_universe',
'ig_android_direct_delete_or_block_from_message_requests',
'ig_android_direct_left_aligned_navigation_bar',
'ig_android_feed_load_more_viewpoint_universe',
'ig_android_stories_reshare_reply_msg',
'ig_android_one_tap_sharesheet_fb_extensions',
'ig_android_stories_feeback_message_composer_entry_point',
'ig_direct_holdout_h2_2018',
'ig_camera_android_facetracker_v12_universe',
'ig_android_camera_ar_effects_low_storage_universe',
'ig_camera_android_black_feed_sticker_fix_universe',
'ig_android_direct_media_forwarding',
'ig_android_camera_attribution_in_direct',
'ig_android_audience_control',
'ig_android_stories_cross_sharing_to_fb_holdout_universe',
'ig_android_enable_main_feed_reel_tray_preloading',
'ig_android_profile_neue_universe',
'ig_company_profile_holdout',
'ig_camera_android_areffect_photo_capture_universe',
'ig_rti_inapp_notifications_universe',
'ig_android_vc_join_timeout_universe',
'ig_android_feed_core_ads_2019_h1_holdout_universe',
'ig_android_interactions_composer_mention_search_universe',
'ig_android_igtv_save',
'ig_android_follower_following_whatsapp_invite_universe',
'ig_android_claim_location_page',
'ig_android_story_ads_2019_h1_holdout_universe',
'ig_android_3pspp',
'ig_android_cache_timespan_objects',
'ig_timestamp_public_test',
'ig_android_histogram_reporter',
'ig_android_feed_auto_share_to_facebook_dialog',
'ig_android_arengine_separate_prepare',
'ig_android_skip_button_content_on_connect_fb_universe',
'ig_android_igtv_profile_tab',
'ig_android_show_fb_name_universe',
'ig_android_interactions_inline_composer_extensions_universe',
'ig_camera_async_space_validation_for_ar',
'ig_android_pigeon_sampling',
'ig_story_camera_reverse_video_experiment',
'ig_android_live_use_timestamp_normalizer',
'ig_android_profile_lazy_load_carousel_media',
'ig_android_stories_question_sticker_music_format',
'ig_business_profile_18h1_holdout_universe',
'ig_pacing_overriding_universe',
'ig_android_direct_allow_multiline_composition',
'ig_android_interactions_emoji_extension_followup_universe',
'ig_android_story_ads_direct_cta_universe',
'ig_android_q3lc_transparency_control_settings',
'ig_stories_selfie_sticker',
'ig_android_sso_use_trustedapp_universe',
'ig_android_ad_increase_story_adpreload_priority_universe',
'ig_android_interests_netego_dismiss',
'ig_direct_giphy_gifs_rating',
'ig_android_shopping_catalogsearch',
'ig_android_stories_music_awareness_universe',
'ig_android_qcc_perf',
'ig_android_stories_reels_tray_media_count_check',
'ig_android_new_fb_page_selection',
'ig_android_facebook_crosspost',
'ig_android_internal_collab_save',
'ig_video_holdout_h2_2017',
'ig_android_story_sharing_universe',
'ig_promote_post_insights_entry_universe',
'ig_android_direct_thread_store_rewrite',
'ig_android_qp_clash_management_enabled_v4_universe',
'ig_branded_content_paid_branded_content',
'ig_android_large_heap_override',
'ig_android_live_subscribe_user_level_universe',
'ig_android_igtv_creation_flow',
'ig_android_video_call_finish_universe',
'ig_android_direct_mqtt_send',
'ig_android_do_not_fetch_follow_requests_on_success',
'ig_android_remove_push_notifications',
'ig_android_vc_directapp_integration_universe',
'ig_android_explore_discover_people_entry_point_universe',
'ig_android_sonar_prober_universe',
'ig_android_live_bg_download_face_filter_assets_universe',
'ig_android_gif_framerate_throttling',
'ig_android_live_webrtc_livewith_params',
'ig_android_vc_always_start_connection_on_condition_universe',
'ig_camera_worldtracking_set_scale_by_arclass',
'ig_android_direct_inbox_typing_indicator',
'ig_android_stories_music_lyrics_scrubber',
'ig_feed_experience',
'ig_android_direct_new_thread_local_search_fix_universe',
'ig_android_appstate_logger',
'ig_promote_insights_video_views_universe',
'ig_android_dismiss_recent_searches',
'ig_android_downloadable_igrtc_module',
'ig_android_fb_link_ui_polish_universe',
'ig_stories_music_sticker',
'ig_android_device_capability_framework',
'ig_scroll_by_two_cards_for_suggested_invite_universe',
'ig_android_stories_helium_balloon_badging_universe',
'ig_android_business_remove_unowned_fb_pages',
'ig_android_stories_combined_asset_search',
'ig_stories_allow_camera_actions_while_recording',
'ig_android_analytics_mark_events_as_offscreen',
'ig_android_optic_feature_testing',
'ig_android_camera_universe',
'ig_android_optic_photo_cropping_fixes',
'ig_camera_regiontracking_use_similarity_tracker_for_scaling',
'ig_android_refreshable_list_view_check_spring',
'felix_android_video_quality',
'ig_android_biz_endpoint_switch',
'ig_android_direct_continuous_capture',
'ig_android_comments_direct_reply_to_author',
'ig_android_vc_webrtc_params',
'ig_android_claim_or_connect_page_on_xpost',
'ig_android_anr',
'ig_android_optic_new_architecture',
'ig_android_stories_viewer_as_modal_high_end_launch',
'ig_android_hashtag_follow_chaining_over_logging',
'ig_new_eof_demarcator_universe',
'ig_android_push_notifications_settings_redesign_universe',
'ig_hashtag_display_universe',
'ig_fbns_push',
'coupon_price_test_ad4ad_instagram_resurrection_universe',
'ig_android_live_rendering_looper_universe',
'ig_android_mqtt_cookie_auth_memcache_universe',
'ig_android_live_end_redirect_universe',
'ig_android_direct_mutation_manager_media_2',
'ig_android_ccu_jobscheduler_outer',
'ig_smb_ads_holdout_2019_h1_universe',
'ig_fb_graph_differentiation',
'ig_android_stories_share_extension_video_segmentation',
'ig_android_interactions_realtime_typing_indicator_and_live_comments',
'ig_android_stories_create_flow_favorites_tooltip',
'ig_android_live_nerd_stats_universe',
'ig_android_universe_video_production',
'ig_android_hide_reset_with_fb_universe',
'ig_android_reactive_feed_like_count',
'ig_android_stories_music_precapture',
'ig_android_vc_service_crash_fix_universe',
'ig_android_shopping_product_overlay',
'ig_android_direct_double_tap_to_like_hearts',
'ig_camera_android_api_rewrite_universe',
'ig_android_growth_fci_team_holdout_universe',
'ig_android_stories_gallery_recyclerview_kit_universe',
'ig_android_story_ads_instant_sub_impression_universe',
'ig_business_signup_biz_id_universe',
'ig_android_save_all',
'ig_android_main_feed_fragment_scroll_timing_histogram_uni',
'ig_android_ttcp_improvements',
'ig_android_camera_ar_platform_profile_universe',
'ig_explore_2018_topic_channel_navigation_android_universe',
'ig_android_live_fault_tolerance_universe',
'ig_android_stories_viewer_tall_android_cap_media_universe',
'native_contact_invites_universe',
'ig_android_dash_script',
'ig_android_insights_media_hashtag_insight_universe',
'ig_camera_fast_tti_universe',
'ig_android_stories_whatsapp_share',
'ig_android_inappnotification_rootactivity_tweak',
'ig_android_render_thread_memory_leak_holdout',
'ig_android_private_highlights_universe',
'ig_android_rate_limit_feed_video_module',
'ig_android_one_tap_fbshare',
'ig_share_to_story_toggle_include_shopping_product',
'ig_android_direct_speed_cam_univ',
'ig_payments_billing_address',
'ig_android_ufiv3_holdout',
'ig_android_new_camera_design_container_animations_universe',
'ig_android_livewith_guest_adaptive_camera_universe',
'ig_android_direct_fix_playing_invalid_visual_message',
'ig_shopping_viewer_intent_actions',
'ig_promote_add_payment_navigation_universe',
'ig_android_optic_disable_post_capture_preview_restart',
'ig_android_main_feed_refresh_style_universe',
'ig_android_live_analytics',
'ig_android_story_ads_performance_universe_1',
'ig_android_stories_viewer_modal_activity',
'ig_android_story_ads_performance_universe_3',
'ig_android_story_ads_performance_universe_4',
'ig_android_feed_seen_state_with_view_info',
'ig_android_ads_profile_cta_feed_universe',
'ig_android_vc_cowatch_universe',
'ig_android_optic_thread_priorities',
'ig_android_igtv_chaining',
'ig_android_live_qa_viewer_v1_universe',
'ig_android_stories_show_story_not_available_error_msg',
'ig_android_inline_notifications_recommended_user',
'ig_shopping_post_insights',
'ig_android_webrtc_streamid_salt_universe',
'ig_android_wellbeing_timeinapp_v1_universe',
'ig_android_profile_cta_v3',
'ig_android_video_qp_logger_universe',
'ig_android_cache_video_autoplay_checker',
'ig_android_live_suggested_live_expansion',
'ig_android_vc_start_from_direct_inbox_universe',
'ig_perf_android_holdout',
'ig_fb_graph_differentiation_only_fb_candidates',
'ig_android_expired_build_lockout',
'ig_promote_lotus_universe',
'ig_android_video_streaming_upload_universe',
'ig_android_optic_fast_preview_restart_listener',
'ig_interactions_h1_2019_team_holdout_universe',
'ig_android_ad_async_ads_universe',
'ig_camera_android_effect_info_bottom_sheet_universe',
'ig_android_stories_feedback_badging_universe',
'ig_android_sorting_on_self_following_universe',
'ig_android_edit_location_page_info',
'ig_promote_are_you_sure_universe',
'ig_android_interactions_feed_label_below_comments_refactor_universe',
'ig_android_camera_platform_effect_share_universe',
'ig_stories_engagement_swipe_animation_simple_universe',
'ig_login_activity',
'ig_android_direct_quick_replies',
'ig_android_fbns_optimization_universe',
'ig_android_stories_alignment_guides_universe',
'ig_android_rn_ads_manager_universe',
'ig_explore_2018_post_chaining_account_recs_dedupe_universe',
'ig_android_click_to_direct_story_reaction_universe',
'ig_internal_research_settings',
'ig_android_stories_video_seeking_audio_bug_fix',
'ig_android_insights_holdout',
'ig_android_swipe_up_area_universe',
'ig_android_rendering_controls',
'ig_android_feed_post_sticker',
'ig_android_inline_editing_local_prefill',
'ig_android_hybrid_bitmap_v3_prenougat',
'ig_android_cronet_stack',
'ig_android_enable_igrtc_module',
'ig_android_scroll_audio_priority',
'ig_android_shopping_product_appeals_universe',
'ig_android_fb_follow_server_linkage_universe',
'ig_android_fblocation_universe',
'ig_android_direct_updated_story_reference_ui',
'ig_camera_holdout_h1_2018_product',
'live_with_request_to_join_button_universe',
'ig_android_music_continuous_capture',
'ig_android_churned_find_friends_redirect_to_discover_people',
'ig_android_main_feed_new_posts_indicator_universe',
'ig_vp9_hd_blacklist',
'ig_ios_queue_time_qpl_universe',
'ig_android_split_contacts_list',
'ig_android_connect_owned_page_universe',
'ig_android_felix_prefetch_thumbnail_sprite_sheet',
'ig_android_multi_dex_class_loader_v2',
'ig_android_watch_and_more_redesign',
'igtv_feed_previews',
'ig_android_qp_batch_fetch_caching_enabled_v1_universe',
'ig_android_profile_edit_phone_universe',
'ig_android_vc_renderer_type_universe',
'ig_android_local_2018_h2_holdout',
'ig_android_purx_native_checkout_universe',
'ig_android_vc_disable_lock_screen_content_access_universe',
'ig_android_business_transaction_in_stories_creator',
'android_cameracore_ard_ig_integration',
'ig_video_experimental_encoding_consumption_universe',
'ig_android_iab_autofill',
'ig_android_location_page_intent_survey',
'ig_camera_android_segmentation_qe2_universe',
'ig_android_image_mem_cache_strong_ref_universe',
'ig_android_business_promote_refresh_fb_access_token_universe',
'ig_android_stories_samsung_sharing_integration',
'ig_android_hashtag_header_display',
'ig_discovery_holdout_2019_h1_universe',
'ig_android_user_url_deeplink_fbpage_endpoint',
'ig_android_direct_mutation_manager_handler_thread_universe',
'ig_branded_content_show_settings_universe',
'ig_android_ad_holdout_watchandmore_universe',
'ig_android_direct_thread_green_dot_presence_universe',
'ig_android_camera_new_post_smile_universe',
'ig_android_shopping_signup_redesign_universe',
'ig_android_vc_missed_call_notification_action_reply',
'allow_publish_page_universe',
'ig_android_experimental_onetap_dialogs_universe',
'ig_promote_ppe_v2_universe',
'android_cameracore_ig_gl_oom_fixes_universe',
'ig_android_multi_capture_camera',
'ig_android_fb_family_navigation_badging_user',
'ig_android_follow_requests_copy_improvements',
'ig_media_geo_gating',
'ig_android_comments_notifications_universe',
'ig_android_render_output_surface_timeout_universe',
'ig_android_drop_frame_check_paused',
'ig_direct_raven_sharesheet_ranking',
'ig_android_realtime_mqtt_logging',
'ig_family_bridges_holdout_universe',
'ig_android_rainbow_hashtags',
'ig_android_ad_watchinstall_universe',
'ig_android_ad_account_top_followers_universe',
'ig_android_betamap_universe',
'ig_android_video_ssim_report_universe',
'ig_android_cache_network_util',
'ig_android_leak_detector_upload_universe',
'ig_android_carousel_prefetch_bumping',
'ig_fbns_preload_default',
'ig_android_inline_appeal_show_new_content',
'ig_fbns_kill_switch',
'ig_hashtag_following_holdout_universe',
'ig_android_show_weekly_ci_upsell_limit',
'ig_android_direct_reel_options_entry_point_2_universe',
'enable_creator_account_conversion_v0_animation',
'ig_android_http_service_same_thread',
'ig_camera_holdout_h1_2018_performance',
'ig_android_direct_mutation_manager_cancel_fix_universe',
'ig_music_dash',
'ig_android_fb_url_universe',
'ig_android_reel_raven_video_segmented_upload_universe',
'ig_android_promote_native_migration_universe',
'ig_camera_android_badge_face_effects_universe',
'ig_android_hybrid_bitmap_v3_nougat',
'ig_android_multi_author_story_reshare_universe',
'ig_android_vc_camera_zoom_universe',
'ig_android_enable_request_compression_ccu',
'ig_android_video_controls_universe',
'ig_android_logging_metric_universe_v2',
'ig_android_xposting_newly_fbc_people',
'ig_android_visualcomposer_inapp_notification_universe',
'ig_android_contact_point_upload_rate_limit_killswitch',
'ig_android_webrtc_encoder_factory_universe',
'ig_android_search_impression_logging',
'ig_android_handle_username_in_media_urls_universe',
'ig_android_sso_kototoro_app_universe',
'ig_android_mi_holdout_h1_2019',
'ig_android_igtv_autoplay_on_prepare',
'ig_file_based_session_handler_2_universe',
'ig_branded_content_tagging_upsell',
'ig_shopping_insights_parity_universe_android',
'ig_android_live_ama_universe',
'ig_android_external_gallery_import_affordance',
'ig_android_updatelistview_on_loadmore',
'ig_android_optic_new_zoom_controller',
'ig_android_hide_type_mode_camera_button',
'ig_android_photos_qpl',
'ig_android_reel_impresssion_cache_key_qe_universe',
'ig_android_show_profile_picture_upsell_in_reel_universe',
'ig_android_live_viewer_tap_to_hide_chrome_universe',
'ig_discovery_holdout_universe',
'ig_android_direct_import_google_photos2',
'ig_android_stories_tray_in_viewer',
'ig_android_request_verification_badge',
'ig_android_direct_unlimited_raven_replays_inthreadsession_fix',
'ig_android_netgo_cta',
'ig_android_viewpoint_netego_universe',
'ig_android_stories_separate_overlay_creation',
'ig_android_iris_improvements',
'ig_android_biz_conversion_naming_test',
'ig_android_fci_empty_feed_friend_search',
'ig_android_hashtag_page_support_places_tab',
'ig_camera_android_ar_platform_universe',
'ig_android_stories_viewer_prefetch_improvements',
'ig_android_optic_camera_warmup',
'ig_android_place_search_profile_image',
'ig_android_interactions_in_feed_comment_view_universe',
'ig_android_fb_sharing_shortcut',
'ig_android_oreo_hardware_bitmap',
'ig_android_analytics_diagnostics_universe',
'ig_android_insights_creative_tutorials_universe',
'ig_android_vc_universe',
'ig_android_profile_unified_follow_view',
'ig_android_collect_os_usage_events_universe',
'ig_android_shopping_nux_timing_universe',
'ig_android_fbpage_on_profile_side_tray',
'ig_android_native_logcat_interceptor',
'ig_android_direct_thread_content_picker',
'ig_android_notif_improvement_universe',
'ig_face_effect_ranking',
'ig_android_shopping_more_from_business',
'ig_feed_content_universe',
'ig_android_hacked_account_reporting',
'ig_android_disk_usage_logging_universe',
'ig_android_ad_redesign_iab_universe',
'ig_android_banyan_migration',
'ig_android_profile_event_leak_holdout',
'ig_android_stories_loading_automatic_retry',
'ig_android_gqls_typing_indicator',
'ag_family_bridges_2018_h2_holdout',
'ig_promote_net_promoter_score_universe',
'ig_android_direct_last_seen_message_indicator',
'ig_android_biz_conversion_suggest_biz_nux',
'ig_android_log_mediacodec_info',
'ig_android_vc_participant_state_callee_universe',
'ig_camera_android_boomerang_attribution_universe',
'ig_android_stories_weblink_creation',
'ig_android_horizontal_swipe_lfd_logging',
'ig_profile_company_holdout_h2_2018',
'ig_android_ads_manager_pause_resume_ads_universe',
'ig_promote_fix_expired_fb_accesstoken_android_universe',
'ig_android_stories_media_seen_batching_universe',
'ig_android_interactions_nav_to_permalink_followup_universe',
'ig_android_live_titles_viewer_side_view_title_universe',
'ig_android_direct_mark_as_read_notif_action',
'ig_android_edit_highlight_redesign',
'ig_android_direct_mutation_manager_backoff_universe',
'ig_android_interactions_comment_like_for_all_feed_universe',
'ig_android_mi_skip_analytic_event_pool_universe',
'ig_android_fbc_upsell_on_dp_first_load',
'ig_android_audio_ingestion_params',
'ig_android_video_call_participant_state_caller_universe',
'ig_fbns_shared',
'ig_feed_engagement_holdout_2018_h1',
'ig_camera_android_bg_processor',
'ig_android_optic_new_features_implementation',
'ig_android_stories_reel_interactive_tap_target_size',
'ig_android_video_live_trace_universe',
'ig_android_igtv_browse_with_pip_v2',
'ig_android_interactive_listview_during_refresh',
'ig_android_igtv_feed_banner_universe',
'ig_android_unfollow_from_main_feed_v2',
'ig_android_self_story_setting_option_in_menu',
'ig_android_ad_watchlead_universe',
'ufi_share',
'ig_android_live_special_codec_size_list',
'ig_android_live_qa_broadcaster_v1_universe',
'ig_android_hide_stories_viewer_list_universe',
'ig_android_direct_albums',
'ig_android_business_transaction_in_stories_consumer',
'ig_android_scroll_stories_tray_to_front_when_stories_ready',
'ig_android_direct_thread_composer',
'instagram_android_stories_sticker_tray_redesign',
'ig_camera_android_superzoom_icon_position_universe',
'ig_android_business_cross_post_with_biz_id_infra',
'ig_android_photo_invites',
'ig_android_reel_tray_item_impression_logging_viewpoint',
'ig_account_identity_2018_h2_lockdown_phone_global_holdout',
'ig_android_high_res_gif_stickers',
'ig_close_friends_v4',
'ig_fb_cross_posting_sender_side_holdout',
'ig_android_ads_history_universe',
'ig_android_comments_composer_newline_universe',
'ig_rtc_use_dtls_srtp',
'ig_promote_media_picker_universe',
'ig_android_live_start_live_button_universe',
'ig_android_vc_ongoing_call_notification_universe',
'ig_android_rate_limit_feed_item_viewable_helper',
'ig_android_bitmap_attribution_check',
'ig_android_ig_to_fb_sync_universe',
'ig_android_reel_viewer_data_buffer_size',
'ig_two_fac_totp_enable',
'ig_android_vc_missed_call_notification_action_call_back',
'ig_android_stories_landscape_mode',
'ig_android_ad_view_ads_native_universe',
'ig_android_igtv_whitelisted_for_web',
'ig_android_global_prefetch_scheduler',
'ig_android_live_thread_delay_for_mute_universe',
'ig_close_friends_v4_global',
'ig_android_share_publish_page_universe',
'ig_android_new_camera_design_universe',
'ig_direct_max_participants',
'ig_promote_hide_local_awareness_universe',
'ig_android_graphql_survey_new_proxy_universe',
'ig_android_fs_creation_flow_tweaks',
'ig_android_ad_watchbrowse_cta_universe',
'ig_android_camera_new_tray_behavior_universe',
'ig_android_direct_expiring_media_loading_errors',
'ig_android_show_fbunlink_button_based_on_server_data',
'ig_android_downloadable_vp8_module',
'ig_android_igtv_feed_trailer',
'ig_android_fb_profile_integration_universe',
'ig_android_profile_private_banner',
'ig_camera_android_focus_attribution_universe',
'ig_android_rage_shake_whitelist',
'ig_android_su_follow_back',
'ig_android_prefetch_notification_data',
'ig_android_webrtc_icerestart_on_failure_universe',
'ig_android_vpvd_impressions_universe',
'ig_android_payload_based_scheduling',
'ig_android_grid_cell_count',
'ig_android_new_highlight_button_text',
'ig_android_direct_search_bar_redesign',
'ig_android_hashtag_row_preparer',
'ig_android_ad_pbia_header_click_universe',
'ig_android_direct_visual_viewer_ppr_fix',
'ig_background_prefetch',
'ig_camera_android_focus_in_post_universe',
'ig_android_time_spent_dashboard',
'ig_android_direct_vm_activity_sheet',
'ig_promote_political_ads_universe',
'ig_android_stories_auto_retry_reels_media_and_segments',
'ig_android_recommend_accounts_killswitch',
'ig_shopping_video_half_sheet',
'ig_android_ad_iab_qpl_kill_switch_universe',
'ig_android_interactions_direct_share_comment_universe',
'ig_android_vc_sounds_universe',
'ig_camera_android_cache_format_picker_children',
'ig_android_post_live_expanded_comments_view_universe',
'ig_android_always_use_server_recents',
'ig_android_qp_slot_cooldown_enabled_universe',
'ig_android_asset_picker_improvements',
'ig_android_direct_activator_cards',
'ig_android_pending_media_manager_init_fix_universe',
'ig_android_facebook_global_state_sync_frequency_universe',
'ig_android_network_trace_migration',
'ig_android_creation_new_post_title',
'ig_android_reverse_audio',
'ig_android_camera_gallery_upload_we_universe',
'ig_android_direct_inbox_async_diffing_universe',
'ig_android_live_save_to_camera_roll_limit_by_screen_size_universe',
'ig_android_profile_phone_autoconfirm_universe',
'ig_direct_stories_questions',
'ig_android_optic_surface_texture_cleanup',
'ig_android_vc_use_timestamp_normalizer',
'ig_android_post_recs_show_more_button_universe',
'ig_shopping_checkout_mvp_experiment',
'ig_android_direct_pending_media',
'ig_android_scroll_main_feed',
'ig_android_intialization_chunk_410',
'ig_android_story_ads_default_long_video_duration',
'ig_android_interactions_mention_search_presence_dot_universe',
'ig_android_stories_music_sticker_position',
'ig_android_direct_character_limit',
'ig_stories_music_themes',
'ig_android_nametag_save_experiment_universe',
'ig_android_media_rows_prepare_10_31',
'ig_android_fs_new_gallery',
'ig_android_stories_hide_retry_button_during_loading_launch',
'ig_android_remove_follow_all_fb_list',
'ig_android_biz_conversion_editable_profile_review_universe',
'ig_android_shopping_checkout_mvp',
'ig_android_local_info_page',
'ig_android_direct_log_badge_count'
])
| 46.752158 | 80 | 0.829571 | 4,937 | 37,916 | 5.53413 | 0.220782 | 0.21049 | 0.16613 | 0.01852 | 0.082315 | 0.031037 | 0.012078 | 0 | 0 | 0 | 0 | 0.005637 | 0.106393 | 37,916 | 810 | 81 | 46.809877 | 0.80075 | 0 | 0 | 0 | 0 | 0 | 0.829017 | 0.819285 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.006188 | 0 | 0.006188 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b7a51fbfad3f7c7ee459303517df4fef8785d068 | 7,260 | py | Python | lib/pose_loss_layer/layer.py | gramuah/pose-estimation-study | e1051df18e52fe7efdba1e6410674fae70561f29 | [
"BSD-2-Clause"
] | 3 | 2018-03-14T16:03:40.000Z | 2018-08-15T18:07:00.000Z | lib/pose_loss_layer/layer.py | gramuah/pose-estimation-study | e1051df18e52fe7efdba1e6410674fae70561f29 | [
"BSD-2-Clause"
] | 2 | 2018-05-29T07:59:14.000Z | 2019-07-04T00:27:44.000Z | lib/pose_loss_layer/layer.py | gramuah/pose-estimation-study | e1051df18e52fe7efdba1e6410674fae70561f29 | [
"BSD-2-Clause"
] | 1 | 2018-07-25T10:23:24.000Z | 2018-07-25T10:23:24.000Z | '''
Created on Jan 8, 2016
@author: Daniel Onoro Rubio
'''
import caffe
from fast_rcnn.config import cfg
from roi_data_layer.minibatch import get_minibatch
import numpy as np
import yaml
from multiprocessing import Process, Queue
class PoseLossLayer(caffe.Layer):
"""
Pose loss layer that computes the biternion loss.
"""
def setup(self, bottom, top):
# check input pair
if len(bottom) != 3:
raise Exception("Need two inputs to compute distance.")
self.DEG2RAD_CONST = np.pi/180.0
# Pose weigths cls*n_bins
self.pose_weigths = [0.92, 1.06, 0.98, 1.04, 0.97, 1.07, 1.02, 1.06, \
0.89, 0.99, 0.99, 1.02, 0.74, 1.10, 1.10, 1.10, \
1.00, 1.08, 1.09, 1.01, 0.58, 0.90, 0.93, 0.87, \
0.90, 1.07, 1.04, 1.02, 0.81, 1.10, 1.02, 1.03, \
0.98, 1.07, 1.03, 1.06, 0.91, 1.10, 1.08, 1.03, \
0.95, 1.09, 1.09, 0.99, 0.91, 1.10, 1.09, 1.03]
def reshape(self, bottom, top):
# check input dimensions match
if bottom[0].count != (bottom[1].count*2):
raise Exception("Pose prediction does not match with pose labels dimensions.")
# To save inner products between pred and GT
self.inner_prod = np.zeros( bottom[0].data.shape[0] )
# Hold predicted modules
self.pred_mod = np.zeros( bottom[0].data.shape[0] )
# Hold polar labels
self.pol_labels = np.zeros( (bottom[0].data.shape[0], 2) )
# loss output is scalar
top[0].reshape(1)
def forward(self, bottom, top):
'''
Forward pass:
bottom[0]: predicted tuple (unnormalized)
bottom[1]: pose angle labels (degrees)
bottom[2]: class labels
'''
cls_labels = bottom[2].data.astype(np.int32) # Cast them to integer
# done= False
total_loss = 0
inds = np.where(cls_labels > 0)[0]
for ix in inds:
cls = cls_labels[ix]
# Cast labels into polar cordinates (cos x sin x)
rad_labels = bottom[1].data[ix,cls]*self.DEG2RAD_CONST
polar_labels = np.hstack( (np.cos(rad_labels), np.sin(rad_labels) ) ).reshape((1,2))
polar_pred = bottom[0].data[ix, cls*2:cls*2+2].reshape((2,1))
self.pol_labels[ix] = polar_labels
self.inner_prod[ix] = np.dot(polar_labels,polar_pred)
self.pred_mod[ix] = np.linalg.norm(polar_pred)
loss = 1 - self.inner_prod[ix]/self.pred_mod[ix]
total_loss += loss
# if not done:
# done = True
# print "GT: ", polar_labels
# print "Pred: ", polar_pred.ravel()/self.pred_mod[ix]
top[0].data[...] = total_loss/len(inds)
def backward(self, top, propagate_down, bottom):
# Reset gradients
bottom[0].diff[...] = np.zeros_like(bottom[0].diff)
# Get class labels
cls_labels = bottom[2].data.astype(np.int32) # Cast them to integer
# pose_labels = bottom[1].data # Poses
#
# pose_step = 360.0/4
# last_bin_angle = 360 - pose_step/2.0
inds = np.where(cls_labels > 0)[0]
for ix in inds:
cls = cls_labels[ix]
# First parameter
bottom[0].diff[ix, cls*2] += self.inner_prod[ix]*bottom[0].data[ix, cls*2] / (self.pred_mod[ix]**3) \
-self.pol_labels[ix, 0] / self.pred_mod[ix]
# Second parameter
bottom[0].diff[ix, cls*2 + 1] += self.inner_prod[ix]*bottom[0].data[ix, cls*2+1] / (self.pred_mod[ix]**3) \
-self.pol_labels[ix, 1] / self.pred_mod[ix]
# Weight loss
# wcls_ix = (cls-1)*4
# if pose_labels[ix, cls] > last_bin_angle:
# pose_ix = 0
# else:
# pose_ix = int( abs(pose_labels[ix, cls] - pose_step/2)/pose_step ) # Compute class + pose idx
#
# w = self.pose_weigths[wcls_ix + pose_ix]
# bottom[0].diff[ix, cls*2:cls*2 + 2] *= w
# Normalize output
bottom[0].diff[...] = bottom[0].diff[...] #/ bottom[0].num
class PoseEuclideanLossLayer(caffe.Layer):
"""
Pose loss layer that computes the biternion loss.
"""
def setup(self, bottom, top):
# check input pair
if len(bottom) != 3:
raise Exception("Need two inputs to compute distance.")
self.DEG2RAD_CONST = np.pi/180.0
# Pose weigths cls*n_bins
self.pose_weigths = [0.92, 1.06, 0.98, 1.04, 0.97, 1.07, 1.02, 1.06, \
0.89, 0.99, 0.99, 1.02, 0.74, 1.10, 1.10, 1.10, \
1.00, 1.08, 1.09, 1.01, 0.58, 0.90, 0.93, 0.87, \
0.90, 1.07, 1.04, 1.02, 0.81, 1.10, 1.02, 1.03, \
0.98, 1.07, 1.03, 1.06, 0.91, 1.10, 1.08, 1.03, \
0.95, 1.09, 1.09, 0.99, 0.91, 1.10, 1.09, 1.03]
def reshape(self, bottom, top):
# check input dimensions match
if bottom[0].count != (bottom[1].count*2):
raise Exception("Pose prediction does not match with pose labels dimensions.")
# Hold polar labels
self.pol_labels = np.zeros( (bottom[0].data.shape[0], 2) )
# Init diff
self.diff = np.zeros_like(bottom[0].data, dtype=np.float32)
# Count of fg objets
self.count = 1
# loss output is scalar
top[0].reshape(1)
def forward(self, bottom, top):
'''
Forward pass:
bottom[0]: predicted tuple (unnormalized)
bottom[1]: pose angle labels (degrees)
bottom[2]: class labels
'''
# Init diff
self.diff = np.zeros_like(bottom[0].data, dtype=np.float32)
cls_labels = bottom[2].data.astype(np.int32) # Cast them to integer
done= False
inds = np.where(cls_labels > 0)[0]
self.count = 0
# for ix in range( len(cls_labels) ):
for ix in inds:
cls = cls_labels[ix]
# Cast labels into polar cordinates (cos x sin x)
rad_labels = bottom[1].data[ix,cls]*self.DEG2RAD_CONST
polar_labels = np.hstack( (np.cos(rad_labels), np.sin(rad_labels) ) ).reshape((1,2))
polar_pred = bottom[0].data[ix, cls*2:cls*2+2].reshape((1,2))
# if not done:
# done = True
# print "GT: ", polar_labels
# print "Pred: ", polar_pred
self.count += 1
self.diff[ix, cls:cls+2] = polar_pred - polar_labels
self.count = max(self.count,1)
top[0].data[...] = np.sum(self.diff**2) / self.count / 2.
def backward(self, top, propagate_down, bottom):
# Normalize output
bottom[0].diff[...] = self.diff[...] / self.count | 38.010471 | 119 | 0.510055 | 1,017 | 7,260 | 3.557522 | 0.180924 | 0.0445 | 0.013267 | 0.025152 | 0.741294 | 0.713101 | 0.70094 | 0.660033 | 0.645661 | 0.62963 | 0 | 0.09019 | 0.35551 | 7,260 | 191 | 120 | 38.010471 | 0.683052 | 0.264876 | 0 | 0.611765 | 0 | 0 | 0.036958 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.094118 | false | 0 | 0.070588 | 0 | 0.188235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b7c2d9ab2674b9c75f24e651d135e48db27866b2 | 717 | py | Python | src/browserist/factory/set.py | jakob-bagterp/browserist | 76bd916dd217b7da3759fd6ec3374191002dc091 | [
"Apache-2.0"
] | 2 | 2022-02-20T10:03:19.000Z | 2022-03-22T11:17:10.000Z | src/browserist/factory/set.py | jakob-bagterp/browserist | 76bd916dd217b7da3759fd6ec3374191002dc091 | [
"Apache-2.0"
] | null | null | null | src/browserist/factory/set.py | jakob-bagterp/browserist | 76bd916dd217b7da3759fd6ec3374191002dc091 | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.edge.options import Options as EdgeOptions
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.ie.options import Options as IEOptions
from selenium.webdriver.safari.options import Options as SafariOptions
from ..model.browser.base.driver import BrowserDriver
def page_load_strategy(browser_driver: BrowserDriver, options: ChromeOptions | EdgeOptions | FirefoxOptions | IEOptions | SafariOptions) -> ChromeOptions | EdgeOptions | FirefoxOptions | IEOptions | SafariOptions:
options.page_load_strategy = browser_driver.settings.page_load_strategy.value
return options
| 55.153846 | 213 | 0.841004 | 83 | 717 | 7.168675 | 0.337349 | 0.10084 | 0.176471 | 0.184874 | 0.29916 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101813 | 717 | 12 | 214 | 59.75 | 0.923913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.666667 | 0 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b7db0ce52482d14bb86e532983b37cb30cfae2dd | 169 | py | Python | src/make_headers.py | ABHISHEKVALSAN/ML-Arrhythmia-Dataset | c8adaf02d90c096cb332daafb0d1cf2ec8f24307 | [
"MIT"
] | null | null | null | src/make_headers.py | ABHISHEKVALSAN/ML-Arrhythmia-Dataset | c8adaf02d90c096cb332daafb0d1cf2ec8f24307 | [
"MIT"
] | null | null | null | src/make_headers.py | ABHISHEKVALSAN/ML-Arrhythmia-Dataset | c8adaf02d90c096cb332daafb0d1cf2ec8f24307 | [
"MIT"
] | null | null | null | import pandas as pd
from constants import HEADERS
data = pd.read_csv('data/data.csv',sep=';')
data.columns=HEADERS
data.to_csv('data/data_with_headers.csv',index=False)
| 28.166667 | 53 | 0.781065 | 29 | 169 | 4.413793 | 0.551724 | 0.171875 | 0.171875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 169 | 5 | 54 | 33.8 | 0.820513 | 0 | 0 | 0 | 0 | 0 | 0.236686 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
b7f5bdf88fa01317222b0c48c87c9f37a79aa9dd | 765 | py | Python | python/hetu/gpu_links/CrossEntropyLink.py | AFDWang/Hetu | c2c85a8db885dabec41aeafe3895e5f818795e57 | [
"Apache-2.0"
] | 82 | 2021-07-20T02:45:54.000Z | 2022-03-14T07:08:45.000Z | python/hetu/gpu_links/CrossEntropyLink.py | AFDWang/Hetu | c2c85a8db885dabec41aeafe3895e5f818795e57 | [
"Apache-2.0"
] | 4 | 2021-11-25T13:39:21.000Z | 2022-03-13T04:14:14.000Z | python/hetu/gpu_links/CrossEntropyLink.py | AFDWang/Hetu | c2c85a8db885dabec41aeafe3895e5f818795e57 | [
"Apache-2.0"
] | 13 | 2021-07-18T14:40:56.000Z | 2022-03-09T06:37:42.000Z | from __future__ import absolute_import
import ctypes
from .._base import _LIB
from .. import ndarray as _nd
def cross_entropy(y, y_, out, stream=None):
assert isinstance(y, _nd.NDArray)
assert isinstance(y_, _nd.NDArray)
assert isinstance(out, _nd.NDArray)
_LIB.DLGpuCrossEntropy(
y.handle, y_.handle, out.handle, stream.handle if stream else None)
def cross_entropy_gradient(grad_arr, y_arr, label, out_arr, stream=None):
assert isinstance(grad_arr, _nd.NDArray)
assert isinstance(y_arr, _nd.NDArray)
assert isinstance(label, _nd.NDArray)
assert isinstance(out_arr, _nd.NDArray)
_LIB.DLGpuCrossEntropyGradient(
grad_arr.handle, y_arr.handle, label.handle, out_arr.handle, stream.handle if stream else None)
| 33.26087 | 103 | 0.747712 | 108 | 765 | 5 | 0.259259 | 0.207407 | 0.138889 | 0.231481 | 0.414815 | 0.251852 | 0.251852 | 0 | 0 | 0 | 0 | 0 | 0.162092 | 765 | 22 | 104 | 34.772727 | 0.842434 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.411765 | 1 | 0.117647 | false | 0 | 0.235294 | 0 | 0.352941 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b7f7c86d762368cffb8fb3e8f0f45c2af20cdf7b | 139 | py | Python | Aniyom Ebenezer/Phase 2/LIST/Day_44_Challenge_Solution/Question 6 Solution.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Aniyom Ebenezer/Phase 2/LIST/Day_44_Challenge_Solution/Question 6 Solution.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Aniyom Ebenezer/Phase 2/LIST/Day_44_Challenge_Solution/Question 6 Solution.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | """
Write a Python program to convert a string to a list.
"""
import ast
color = "['red', 'green', 'white']"
print(ast.literal_eval(color)) | 23.166667 | 53 | 0.676259 | 22 | 139 | 4.227273 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.143885 | 139 | 6 | 54 | 23.166667 | 0.781513 | 0.381295 | 0 | 0 | 0 | 0 | 0.316456 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
4d1c0f48d1a6a11d049e66a8790a02f42e0308a0 | 740 | py | Python | tests/helper/fetch.py | alarig/peeringdb-py | 917cda69f7bc05be008faa66875827d408328609 | [
"Apache-2.0"
] | 71 | 2015-11-10T04:55:54.000Z | 2022-02-25T20:03:48.000Z | tests/helper/fetch.py | alarig/peeringdb-py | 917cda69f7bc05be008faa66875827d408328609 | [
"Apache-2.0"
] | 53 | 2016-01-29T12:15:38.000Z | 2022-03-04T07:03:41.000Z | tests/helper/fetch.py | alarig/peeringdb-py | 917cda69f7bc05be008faa66875827d408328609 | [
"Apache-2.0"
] | 28 | 2016-02-03T07:59:34.000Z | 2022-02-27T19:25:06.000Z | from twentyc.rpc import RestClient
from twentyc.rpc.client import NotFoundException, PermissionDeniedException
from peeringdb import get_backend
from peeringdb.resource import Network
from . import _data
# try: from peeringdb import _debug_http
# except: pass
__data = {Network: {20: _data.twentyc}}
class Fetcher(RestClient):
def __init__(self, **kwargs):
super(Fetcher, self).__init__(**kwargs)
def fetch(self, R, pk, depth):
return __data[R][pk]
def fetch_latest(self, R, pk, depth=0):
return fetch(R, pk, depth), None
def fetch_all_latest(self, R, params={}, depth=0):
return list(__data[R].values())
def fetch_deleted(self, R, pk, depth=0):
return __deleted[R][pk]
| 24.666667 | 75 | 0.691892 | 100 | 740 | 4.87 | 0.4 | 0.036961 | 0.065708 | 0.073922 | 0.078029 | 0.078029 | 0 | 0 | 0 | 0 | 0 | 0.008375 | 0.193243 | 740 | 29 | 76 | 25.517241 | 0.80737 | 0.068919 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.294118 | 0.235294 | 0.882353 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
4d1cb532237d552d4922263049d5ebeec1572bed | 261 | py | Python | puzzlesolver/classifiers/__init__.py | zhakguder/puzzlesolver | 6516a446065f84031607b8a97a566784d25fa21f | [
"MIT"
] | null | null | null | puzzlesolver/classifiers/__init__.py | zhakguder/puzzlesolver | 6516a446065f84031607b8a97a566784d25fa21f | [
"MIT"
] | null | null | null | puzzlesolver/classifiers/__init__.py | zhakguder/puzzlesolver | 6516a446065f84031607b8a97a566784d25fa21f | [
"MIT"
] | null | null | null | import os
from configparser import ConfigParser
from puzzlesolver.utils import get_project_root
PROJECT_ROOT = get_project_root()
config = ConfigParser()
CONFIG_FILE = os.path.join(PROJECT_ROOT, "puzzlesolver/classifiers/config.ini")
config.read(CONFIG_FILE)
| 26.1 | 79 | 0.831418 | 35 | 261 | 5.971429 | 0.457143 | 0.210526 | 0.133971 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088123 | 261 | 9 | 80 | 29 | 0.878151 | 0 | 0 | 0 | 0 | 0 | 0.1341 | 0.1341 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
4d50515852d638c6711404a1f461b0a12fe8c447 | 425 | py | Python | crawler/items.py | rocksea/cralwer | 2c95045f4422ad102ad3485b479abba89fb8148d | [
"MIT"
] | null | null | null | crawler/items.py | rocksea/cralwer | 2c95045f4422ad102ad3485b479abba89fb8148d | [
"MIT"
] | null | null | null | crawler/items.py | rocksea/cralwer | 2c95045f4422ad102ad3485b479abba89fb8148d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class NaverKinItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
qTitle = scrapy.Field()
qContent = scrapy.Field()
aContent = scrapy.Field()
aDt= scrapy.Field()
qDt= scrapy.Field()
pass
| 21.25 | 53 | 0.663529 | 56 | 425 | 5.035714 | 0.642857 | 0.234043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002967 | 0.207059 | 425 | 19 | 54 | 22.368421 | 0.833828 | 0.484706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.125 | 0.125 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
4d5263183626d315336bdb3fdc06e08dc55c2dea | 404 | py | Python | src/CPCLI/processing_function/__init__.py | cpcgskill/CPCLI | 2fa432b9f978be7eeebaf803c3572c1ff280a2d8 | [
"Apache-2.0"
] | 2 | 2021-02-24T23:02:34.000Z | 2021-07-22T12:49:43.000Z | src/CPCLI/processing_function/__init__.py | 2921251087/CPCLI | 2fa432b9f978be7eeebaf803c3572c1ff280a2d8 | [
"Apache-2.0"
] | null | null | null | src/CPCLI/processing_function/__init__.py | 2921251087/CPCLI | 2fa432b9f978be7eeebaf803c3572c1ff280a2d8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*-coding:utf-8 -*-
u"""
:创建时间: 2021/2/23 6:41
:作者: 苍之幻灵
:我的主页: https://cpcgskill.com
:QQ: 2921251087
:爱发电: https://afdian.net/@Phantom_of_the_Cang
:aboutcg: https://www.aboutcg.org/teacher/54335
:bilibili: https://space.bilibili.com/351598127
"""
from .addhead import addhead
from .delete_blank_lines import deleteBlankLines
from .delete_useless_strings import deleteUselessStrings
| 25.25 | 56 | 0.759901 | 58 | 404 | 5.172414 | 0.793103 | 0.066667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094595 | 0.084158 | 404 | 15 | 57 | 26.933333 | 0.716216 | 0.631188 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4d5db355fcbc1440b9232abe430beadb0a6a6a0c | 11,153 | py | Python | twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 1 | 2022-03-03T05:24:20.000Z | 2022-03-03T05:24:20.000Z | twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 1 | 2022-03-03T05:32:47.000Z | 2022-03-03T05:36:32.000Z | env/lib/python3.9/site-packages/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py | giannicrivello/AudioShack_BE | b50ba91b6904ac069fc37c98a691729932297b6a | [
"MIT"
] | null | null | null | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class BundleCopyList(ListResource):
""" PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. """
def __init__(self, version, bundle_sid):
"""
Initialize the BundleCopyList
:param Version version: Version that contains the resource
:param bundle_sid: The unique string that identifies the resource.
:returns: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyList
:rtype: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyList
"""
super(BundleCopyList, self).__init__(version)
# Path Solution
self._solution = {'bundle_sid': bundle_sid, }
self._uri = '/RegulatoryCompliance/Bundles/{bundle_sid}/Copies'.format(**self._solution)
def create(self, friendly_name=values.unset):
"""
Create the BundleCopyInstance
:param unicode friendly_name: The string that you assigned to describe the copied bundle
:returns: The created BundleCopyInstance
:rtype: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyInstance
"""
data = values.of({'FriendlyName': friendly_name, })
payload = self._version.create(method='POST', uri=self._uri, data=data, )
return BundleCopyInstance(self._version, payload, bundle_sid=self._solution['bundle_sid'], )
def stream(self, limit=None, page_size=None):
"""
Streams BundleCopyInstance records from the API as a generator stream.
This operation lazily loads records as efficiently as possible until the limit
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param int limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
the default value of 50 records. If no page_size is defined
but a limit is defined, stream() will attempt to read the
limit with the most efficient page size, i.e. min(limit, 1000)
:returns: Generator that will yield up to limit results
:rtype: list[twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyInstance]
"""
limits = self._version.read_limits(limit, page_size)
page = self.page(page_size=limits['page_size'], )
return self._version.stream(page, limits['limit'])
def list(self, limit=None, page_size=None):
"""
Lists BundleCopyInstance records from the API as a list.
Unlike stream(), this operation is eager and will load `limit` records into
memory before returning.
:param int limit: Upper limit for the number of records to return. list() guarantees
never to return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
the default value of 50 records. If no page_size is defined
but a limit is defined, list() will attempt to read the limit
with the most efficient page size, i.e. min(limit, 1000)
:returns: Generator that will yield up to limit results
:rtype: list[twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyInstance]
"""
return list(self.stream(limit=limit, page_size=page_size, ))
def page(self, page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
Retrieve a single page of BundleCopyInstance records from the API.
Request is executed immediately
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
:returns: Page of BundleCopyInstance
:rtype: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyPage
"""
data = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, })
response = self._version.page(method='GET', uri=self._uri, params=data, )
return BundleCopyPage(self._version, response, self._solution)
def get_page(self, target_url):
"""
Retrieve a specific page of BundleCopyInstance records from the API.
Request is executed immediately
:param str target_url: API-generated URL for the requested results page
:returns: Page of BundleCopyInstance
:rtype: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyPage
"""
response = self._version.domain.twilio.request(
'GET',
target_url,
)
return BundleCopyPage(self._version, response, self._solution)
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.Numbers.V2.BundleCopyList>'
class BundleCopyPage(Page):
""" PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. """
def __init__(self, version, response, solution):
"""
Initialize the BundleCopyPage
:param Version version: Version that contains the resource
:param Response response: Response from the API
:param bundle_sid: The unique string that identifies the resource.
:returns: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyPage
:rtype: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyPage
"""
super(BundleCopyPage, self).__init__(version, response)
# Path Solution
self._solution = solution
def get_instance(self, payload):
"""
Build an instance of BundleCopyInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyInstance
:rtype: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyInstance
"""
return BundleCopyInstance(self._version, payload, bundle_sid=self._solution['bundle_sid'], )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.Numbers.V2.BundleCopyPage>'
class BundleCopyInstance(InstanceResource):
""" PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. """
class Status(object):
DRAFT = "draft"
PENDING_REVIEW = "pending-review"
IN_REVIEW = "in-review"
TWILIO_REJECTED = "twilio-rejected"
TWILIO_APPROVED = "twilio-approved"
PROVISIONALLY_APPROVED = "provisionally-approved"
class EndUserType(object):
INDIVIDUAL = "individual"
BUSINESS = "business"
def __init__(self, version, payload, bundle_sid):
"""
Initialize the BundleCopyInstance
:returns: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyInstance
:rtype: twilio.rest.numbers.v2.regulatory_compliance.bundle.bundle_copy.BundleCopyInstance
"""
super(BundleCopyInstance, self).__init__(version)
# Marshaled Properties
self._properties = {
'sid': payload.get('sid'),
'account_sid': payload.get('account_sid'),
'regulation_sid': payload.get('regulation_sid'),
'friendly_name': payload.get('friendly_name'),
'status': payload.get('status'),
'valid_until': deserialize.iso8601_datetime(payload.get('valid_until')),
'email': payload.get('email'),
'status_callback': payload.get('status_callback'),
'date_created': deserialize.iso8601_datetime(payload.get('date_created')),
'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')),
}
# Context
self._context = None
self._solution = {'bundle_sid': bundle_sid, }
@property
def sid(self):
"""
:returns: The unique string that identifies the resource
:rtype: unicode
"""
return self._properties['sid']
@property
def account_sid(self):
"""
:returns: The SID of the Account that created the resource
:rtype: unicode
"""
return self._properties['account_sid']
@property
def regulation_sid(self):
"""
:returns: The unique string of a regulation
:rtype: unicode
"""
return self._properties['regulation_sid']
@property
def friendly_name(self):
"""
:returns: The string that you assigned to describe the resource
:rtype: unicode
"""
return self._properties['friendly_name']
@property
def status(self):
"""
:returns: The verification status of the Bundle resource
:rtype: BundleCopyInstance.Status
"""
return self._properties['status']
@property
def valid_until(self):
"""
:returns: The ISO 8601 date and time in GMT when the resource will be valid until
:rtype: datetime
"""
return self._properties['valid_until']
@property
def email(self):
"""
:returns: The email address
:rtype: unicode
"""
return self._properties['email']
@property
def status_callback(self):
"""
:returns: The URL we call to inform your application of status changes
:rtype: unicode
"""
return self._properties['status_callback']
@property
def date_created(self):
"""
:returns: The ISO 8601 date and time in GMT when the resource was created
:rtype: datetime
"""
return self._properties['date_created']
@property
def date_updated(self):
"""
:returns: The ISO 8601 date and time in GMT when the resource was last updated
:rtype: datetime
"""
return self._properties['date_updated']
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.Numbers.V2.BundleCopyInstance>'
| 35.977419 | 104 | 0.646463 | 1,251 | 11,153 | 5.617106 | 0.172662 | 0.020492 | 0.03145 | 0.03515 | 0.565675 | 0.537498 | 0.49381 | 0.460936 | 0.430767 | 0.416109 | 0 | 0.007084 | 0.265937 | 11,153 | 309 | 105 | 36.093851 | 0.851228 | 0.484982 | 0 | 0.188119 | 1 | 0 | 0.140051 | 0.037788 | 0 | 0 | 0 | 0 | 0 | 1 | 0.217822 | false | 0 | 0.049505 | 0 | 0.504951 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
4d5ec6e2779f5f5b1a7e912e11bbfd25715f77d2 | 588 | py | Python | tests/kernels/test_decaying.py | vishalbelsare/mlkernels | a682de952cc35c123e4a4b177eaaee60da25e52e | [
"MIT"
] | 5 | 2021-02-25T21:46:00.000Z | 2021-08-21T12:22:37.000Z | tests/kernels/test_decaying.py | vishalbelsare/mlkernels | a682de952cc35c123e4a4b177eaaee60da25e52e | [
"MIT"
] | 2 | 2021-06-01T14:10:07.000Z | 2021-10-02T16:53:31.000Z | tests/kernels/test_decaying.py | vishalbelsare/mlkernels | a682de952cc35c123e4a4b177eaaee60da25e52e | [
"MIT"
] | 3 | 2021-06-08T13:30:31.000Z | 2021-08-21T12:23:06.000Z | from mlkernels import EQ, DecayingKernel
from ..util import standard_kernel_tests
def test_decaying_kernel():
k = DecayingKernel(3.0, 4.0)
# Verify that the kernel has the right properties.
assert not k.stationary
assert str(k) == "DecayingKernel(3.0, 4.0)"
# Test equality.
assert DecayingKernel(3.0, 4.0) == DecayingKernel(3.0, 4.0)
assert DecayingKernel(3.0, 4.0) != DecayingKernel(3.0, 5.0)
assert DecayingKernel(3.0, 4.0) != DecayingKernel(4.0, 4.0)
assert DecayingKernel(3.0, 4.0) != EQ()
# Standard tests:
standard_kernel_tests(k)
| 28 | 63 | 0.678571 | 89 | 588 | 4.41573 | 0.314607 | 0.045802 | 0.3257 | 0.302799 | 0.473282 | 0.473282 | 0.37659 | 0.37659 | 0.277354 | 0 | 0 | 0.07563 | 0.190476 | 588 | 20 | 64 | 29.4 | 0.75 | 0.134354 | 0 | 0 | 0 | 0 | 0.047525 | 0 | 0 | 0 | 0 | 0 | 0.545455 | 1 | 0.090909 | false | 0 | 0.181818 | 0 | 0.272727 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4d62becbca7096ac38e3d836e75222a937eb3db7 | 175 | py | Python | Unique Usernames.py | Lyubomir-Dakov/Python-Advanced | 3b3b7181cc2bafc6f60329d6e42873d0f78b972f | [
"MIT"
] | null | null | null | Unique Usernames.py | Lyubomir-Dakov/Python-Advanced | 3b3b7181cc2bafc6f60329d6e42873d0f78b972f | [
"MIT"
] | null | null | null | Unique Usernames.py | Lyubomir-Dakov/Python-Advanced | 3b3b7181cc2bafc6f60329d6e42873d0f78b972f | [
"MIT"
] | null | null | null | num_usernames = int(input())
usernames = set()
for _ in range(num_usernames):
username = input()
usernames.add(username)
[print(name) for name in usernames]
| 19.444444 | 36 | 0.668571 | 22 | 175 | 5.181818 | 0.545455 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211429 | 175 | 8 | 37 | 21.875 | 0.826087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4d895a5594acf21a2c7cd3f8b33186e63d26b47a | 14,108 | py | Python | src/genie/libs/parser/iosxe/tests/test_show_monitor.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 2 | 2021-01-27T03:37:39.000Z | 2021-01-27T03:40:50.000Z | src/genie/libs/parser/iosxe/tests/test_show_monitor.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 1 | 2020-08-01T00:23:31.000Z | 2020-08-01T00:40:05.000Z | src/genie/libs/parser/iosxe/tests/test_show_monitor.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | null | null | null | # Python
import unittest
from unittest.mock import Mock
# ATS
from pyats.topology import Device
from pyats.topology import loader
# Metaparser
from genie.metaparser.util.exceptions import SchemaEmptyParserError,SchemaMissingKeyError
# iosxe show_monitor
from genie.libs.parser.iosxe.show_monitor import ShowMonitor,ShowMonitorCapture
# ============================
# Unit test for 'show monitor'
# ============================
class test_show_monitor(unittest.TestCase):
'''Unit test for "show monitor"
"show monitor session all"
"show monitor session {session}"
'''
device = Device(name='aDevice')
empty_output = {'execute.return_value': ''}
golden_parsed_output1 = {
'session':
{'1':
{'destination_erspan_id': '1',
'destination_ip_address': '172.18.197.254',
'mtu': 1464,
'origin_ip_address': '172.18.197.254',
'source_ports':
{'tx_only': 'Gi0/1/4'},
'status': 'Admin Enabled',
'type': 'ERSPAN Source Session'},
'2':
{'destination_ports': 'Gi0/1/6',
'mtu': 1464,
'source_erspan_id': '1',
'source_ip_address': '172.18.197.254',
'status': 'Admin Enabled',
'type': 'ERSPAN Destination Session'}}}
golden_output1 ={'execute.return_value':'''
Router#show monitor
Load for five secs: 16%/0%; one minute: 4%; five minutes: 4%
Time source is NTP, 17:34:06.635 EST Fri Oct 21 2016
Session 1
---------
Type : ERSPAN Source Session
Status : Admin Enabled
Source Ports :
TX Only : Gi0/1/4
Destination IP Address : 172.18.197.254
MTU : 1464
Destination ERSPAN ID : 1
Origin IP Address : 172.18.197.254
Session 2
---------
Type : ERSPAN Destination Session
Status : Admin Enabled
Destination Ports : Gi0/1/6
Source IP Address : 172.18.197.254
Source ERSPAN ID : 1
MTU : 1464
Router#
'''}
golden_parsed_output2 = {
'session':
{'1':
{'destination_erspan_id': '1',
'destination_ip_address': '10.76.1.2',
'mtu': 1464,
'origin_ip_address': '10.76.1.1',
'source_ports':
{'both': 'Gi0/1/4'},
'status': 'Admin Enabled',
'type': 'ERSPAN Source Session'},
'2':
{'destination_ports': 'Gi0/1/6',
'mtu': 1464,
'source_erspan_id': '1',
'source_ip_address': '172.18.197.254',
'status': 'Admin Disabled',
'type': 'ERSPAN Destination Session'}}}
golden_output2={'execute.return_value': '''
Router#show monitor session all
Load for five secs: 15%/0%; one minute: 13%; five minutes: 7%
Time source is NTP, 19:54:41.566 EST Fri Oct 21 2016
Session 1
---------
Type : ERSPAN Source Session
Status : Admin Enabled
Source Ports :
Both : Gi0/1/4
Destination IP Address : 10.76.1.2
MTU : 1464
Destination ERSPAN ID : 1
Origin IP Address : 10.76.1.1
Session 2
---------
Type : ERSPAN Destination Session
Status : Admin Disabled
Destination Ports : Gi0/1/6
Source IP Address : 172.18.197.254
Source ERSPAN ID : 1
MTU : 1464
'''}
golden_parsed_output3 = {
'session':
{'2':
{'destination_ports': 'Gi0/0/1',
'mtu': 1464,
'source_ports':
{'both': 'Gi0/0/1'},
'source_rspan_vlan': 100,
'status': 'Admin Enabled',
'type': 'Remote Destination Session'}}}
golden_output3 = {'execute.return_value': '''
Router # show monitor session 2
Session 2
---------
Type : Remote Source Session
Status : Admin Enabled
Source Ports :
Both : Gi0/0/1
MTU : 1464
Session 2
---------
Type : Remote Destination Session
Status : Admin Enabled
Destination Ports : Gi0/0/1
MTU : 1464
Source RSPAN VLAN : 100
'''}
golden_parsed_output4 = {
'session':
{'1':
{'destination_erspan_id': '10',
'destination_ip_address': '10.12.12.2',
'filter_access_group': 100,
'origin_ip_address': '10.12.12.1',
'source_subinterfaces':
{'both': 'Gi2/2/0.100'},
'status': 'Admin Enabled',
'type': 'ERSPAN Source Session'}}}
golden_output4 = {'execute.return_value': '''
Router#show monitor session 1
Session 1
---------
Type: ERSPAN Source Session
Status: Admin Enabled
Source Subinterfaces:
Both: Gi2/2/0.100
Filter Access-Group: 100
Destination IP Address : 10.12.12.2
Destination ERSPAN ID : 10
Origin IP Address: 10.12.12.1
'''}
def test_show_monitor_golden1(self):
self.maxDiff = None
self.device = Mock(**self.golden_output1)
obj = ShowMonitor(device=self.device)
parsed_output = obj.parse()
self.assertEqual(parsed_output, self.golden_parsed_output1)
def test_show_monitor_golden2(self):
self.maxDiff = None
self.device = Mock(**self.golden_output2)
obj = ShowMonitor(device=self.device)
parsed_output = obj.parse()
self.assertEqual(parsed_output, self.golden_parsed_output2)
def test_show_monitor_golden3(self):
self.maxDiff = None
self.device = Mock(**self.golden_output3)
obj = ShowMonitor(device=self.device)
parsed_output = obj.parse(session='2')
self.assertEqual(parsed_output, self.golden_parsed_output3)
def test_show_monitor_golden4(self):
self.maxDiff = None
self.device = Mock(**self.golden_output4)
obj = ShowMonitor(device=self.device)
parsed_output = obj.parse(session='1')
self.assertEqual(parsed_output, self.golden_parsed_output4)
def test_show_monitor_empty(self):
self.maxDiff = None
self.device = Mock(**self.empty_output)
obj = ShowMonitor(device=self.device)
with self.assertRaises(SchemaEmptyParserError):
parsed_output = obj.parse()
# ============================================
# Unit test for 'show monitor capture '
# ============================================
class test_show_monitor_capture(unittest.TestCase):
'''Unit test for "show monitor capture" '''
device = Device(name='aDevice')
empty_output = {'execute.return_value': ''}
golden_parsed_output1 ={
'status_information':
{'CAPTURE':
{'target_type':
{'interface': 'Control Plane',
'direction': 'both',
'status': 'Inactive'},
'filter_details':
{'filter_details_type': 'Capture all packets'},
'buffer_details':
{'buffer_type': 'LINEAR (default)',
'buffer_size': 10
},
'limit_details':
{'packets_number': 0,
'packets_capture_duaration': 0,
'packets_size': 0,
'maximum_packets_number': 1000,
'packet_sampling_rate': 0}}}}
golden_output1 = {'execute.return_value':'''
Router#show monitor capture
Load for five secs: 2%/0%; one minute: 7%; five minutes: 8%
Time source is NTP, 18:31:17.685 EST Thu Sep 8
Status Information for Capture CAPTURE
Target Type:
Interface: Control Plane, Direction : both
Status : Inactive
Filter Details:
Capture all packets
Buffer Details:
Buffer Type: LINEAR (default)
Buffer Size (in MB): 10
Limit Details:
Number of Packets to capture: 0 (no limit)
Packet Capture duration: 0 (no limit)
Packet Size to capture: 0 (no limit)
Maximum number of packets to capture per second: 1000
Packet sampling rate: 0 (no sampling)
Router#
'''}
golden_parsed_output2 ={
'status_information':
{'NTP':
{'target_type':
{'interface': 'GigabitEthernet0/0/0',
'direction': 'both',
'status': 'Active'
},
'filter_details':
{'filter_details_type': 'Capture all packets'},
'buffer_details':
{'buffer_type': 'LINEAR (default)',
'buffer_size': 10
},
'limit_details':
{'packets_number': 0,
'packets_capture_duaration': 0,
'packets_size': 0,
'maximum_packets_number': 1000,
'packet_sampling_rate': 0}}}}
golden_output2 = {'execute.return_value':'''
Router#show monitor capture
Load for five secs: 1%/0%; one minute: 17%; five minutes: 8%
Time source is NTP, 16:22:09.994 EST Fri Oct 14 2016
Status Information for Capture NTP
Target Type:
Interface: GigabitEthernet0/0/0, Direction: both
Status : Active
Filter Details:
Capture all packets
Buffer Details:
Buffer Type: LINEAR (default)
Buffer Size (in MB): 10
Limit Details:
Number of Packets to capture: 0 (no limit)
Packet Capture duration: 0 (no limit)
Packet Size to capture: 0 (no limit)
Maximum number of packets to capture per second: 1000
Packet sampling rate: 0 (no sampling)
Router#
'''}
golden_parsed_output3={
'status_information':
{'mycap':
{'target_type':
{'interface': 'GigabitEthernet1/0/3',
'direction': 'both',
'status': 'Inactive'
},
'filter_details':
{'filter_details_type': 'IPv4',
'source_ip': 'any',
'destination_ip': 'any',
'protocol': 'any'},
'buffer_details':
{'buffer_type': 'LINEAR (default)'
},
'file_details':
{'file_name': 'flash:mycap.pcap',
'file_size': 5,
'file_number': 2,
'size_of_buffer': 10
},
'limit_details':
{'packets_number': 0,
'packets_capture_duaration': 0,
'packets_size': 0,
'packets_per_second': 0,
'packet_sampling_rate': 0}}}}
golden_output3={'execute.return_value':'''
SWITCH#show monitor capture mycap
Status Information for Capture mycap
Target Type:
Interface: GigabitEthernet1/0/3, Direction: both
Status : Inactive
Filter Details:
IPv4
Source IP: any
Destination IP: any
Protocol: any
Buffer Details:
Buffer Type: LINEAR (default)
File Details:
Associated file name: flash:mycap.pcap
Total size of files(in MB): 5
Number of files in ring: 2
Size of buffer(in MB): 10
Limit Details:
Number of Packets to capture: 0 (no limit)
Packet Capture duration: 0 (no limit)
Packet Size to capture: 0 (no limit)
Packets per second: 0 (no limit)
Packet sampling rate: 0 (no sampling)
'''}
def test_show_monitor_capture_empty(self):
self.maxDiff= None
self.device = Mock(**self.empty_output)
obj = ShowMonitorCapture(device=self.device)
with self.assertRaises(SchemaEmptyParserError):
parsed_output = obj.parse()
def test_show_monitor_capture_full1(self):
self.maxDiff = None
self.device = Mock(**self.golden_output1)
obj = ShowMonitorCapture(device=self.device)
parsed_output = obj.parse()
self.assertEqual(parsed_output, self.golden_parsed_output1)
def test_show_monitor_capture_full2(self):
self.maxDiff = None
self.device = Mock(**self.golden_output2)
obj = ShowMonitorCapture(device=self.device)
parsed_output = obj.parse()
self.assertEqual(parsed_output, self.golden_parsed_output2)
def test_show_monitor_capture_full3(self):
self.maxDiff = None
self.device = Mock(**self.golden_output3)
obj = ShowMonitorCapture(device=self.device)
parsed_output = obj.parse()
self.assertEqual(parsed_output, self.golden_parsed_output3)
if __name__ == '__main__':
unittest.main() | 35.182045 | 89 | 0.502481 | 1,371 | 14,108 | 5.015317 | 0.134209 | 0.041594 | 0.023997 | 0.02356 | 0.81559 | 0.764398 | 0.750145 | 0.670012 | 0.61591 | 0.560064 | 0 | 0.052827 | 0.389495 | 14,108 | 401 | 90 | 35.182045 | 0.745501 | 0.027148 | 0 | 0.64881 | 0 | 0 | 0.531737 | 0.021231 | 0 | 0 | 0 | 0 | 0.026786 | 1 | 0.026786 | false | 0 | 0.017857 | 0 | 0.104167 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4d9dc229539ac995b5f06ca705d2f04b809d1ec7 | 1,217 | py | Python | lib/net/generateNet.py | Guo-Xiaoqing/ThresholdNet | 460026bdacd9d5e577e9b4ae1370e8c9924fcfc3 | [
"MIT"
] | 7 | 2020-12-29T14:09:27.000Z | 2021-07-08T07:12:24.000Z | lib/net/generateNet.py | CityU-AIM-Group/ThresholdNet | e82da9f1266c07518c4037d0a0b3afd6290ca33d | [
"MIT"
] | null | null | null | lib/net/generateNet.py | CityU-AIM-Group/ThresholdNet | e82da9f1266c07518c4037d0a0b3afd6290ca33d | [
"MIT"
] | 2 | 2021-04-08T11:59:07.000Z | 2021-08-09T15:16:41.000Z | # ----------------------------------------
# Written by Xiaoqing Guo
# ----------------------------------------
import torch
import torch.nn as nn
from net.deeplabv3plus import deeplabv3plus
from net.fcn import FCN8s
from net.unetplusplus import NestedUNet
from net.SegNet import SegNet
def generate_net(cfg):
if cfg.MODEL_NAME == 'deeplabv3plus' or cfg.MODEL_NAME == 'deeplabv3+':
return deeplabv3plus(cfg)
if cfg.MODEL_NAME == 'fcn' or cfg.MODEL_NAME == 'FCN':
return FCN8s(cfg)
if cfg.MODEL_NAME == 'UNetplusplus' or cfg.MODEL_NAME == 'UNet++':
return NestedUNet(cfg)
if cfg.MODEL_NAME == 'segnet' or cfg.MODEL_NAME == 'SegNet':
return SegNet(cfg)
# if cfg.MODEL_NAME == 'supernet' or cfg.MODEL_NAME == 'SuperNet':
# return SuperNet(cfg)
# if cfg.MODEL_NAME == 'eanet' or cfg.MODEL_NAME == 'EANet':
# return EANet(cfg)
# if cfg.MODEL_NAME == 'danet' or cfg.MODEL_NAME == 'DANet':
# return DANet(cfg)
# if cfg.MODEL_NAME == 'deeplabv3plushd' or cfg.MODEL_NAME == 'deeplabv3+hd':
# return deeplabv3plushd(cfg)
# if cfg.MODEL_NAME == 'danethd' or cfg.MODEL_NAME == 'DANethd':
# return DANethd(cfg)
else:
raise ValueError('generateNet.py: network %s is not support yet'%cfg.MODEL_NAME)
| 36.878788 | 82 | 0.666393 | 167 | 1,217 | 4.736527 | 0.257485 | 0.192162 | 0.288243 | 0.147914 | 0.25158 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009588 | 0.142975 | 1,217 | 32 | 83 | 38.03125 | 0.748802 | 0.441249 | 0 | 0 | 0 | 0 | 0.156156 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.058824 | false | 0 | 0.352941 | 0 | 0.647059 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4da788f2dfc173dd43bf958bde7eafc50a604154 | 124 | py | Python | HJ 14/code.py | swy20190/NiuKe | d9dbbbbac403f5b4fe37efe82f9708aff614f018 | [
"MIT"
] | null | null | null | HJ 14/code.py | swy20190/NiuKe | d9dbbbbac403f5b4fe37efe82f9708aff614f018 | [
"MIT"
] | null | null | null | HJ 14/code.py | swy20190/NiuKe | d9dbbbbac403f5b4fe37efe82f9708aff614f018 | [
"MIT"
] | null | null | null | num = int(input())
words = []
for i in range(num):
words.append(input())
words.sort()
for word in words:
print(word) | 17.714286 | 25 | 0.629032 | 20 | 124 | 3.9 | 0.6 | 0.25641 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.193548 | 124 | 7 | 26 | 17.714286 | 0.78 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4db33c7f324b62976e578c10a561fd11333cf4a1 | 36 | py | Python | python/spinn/data/__init__.py | pramitmallick/spinn | a5d476b3fad8e4ee97eeed7ac914993bdf7be384 | [
"MIT"
] | 103 | 2017-07-15T01:58:59.000Z | 2022-03-06T07:27:37.000Z | python/spinn/data/__init__.py | pramitmallick/spinn | a5d476b3fad8e4ee97eeed7ac914993bdf7be384 | [
"MIT"
] | 9 | 2017-08-10T17:43:52.000Z | 2021-09-20T15:46:19.000Z | python/spinn/data/__init__.py | pramitmallick/spinn | a5d476b3fad8e4ee97eeed7ac914993bdf7be384 | [
"MIT"
] | 40 | 2017-08-23T20:35:22.000Z | 2021-05-04T06:54:23.000Z | T_SHIFT = 0
T_REDUCE = 1
T_SKIP = 2
| 9 | 12 | 0.666667 | 9 | 36 | 2.333333 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 0.25 | 36 | 3 | 13 | 12 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4db452dcfd649c24de79e5a321f74a2ad8be735c | 134 | py | Python | python_demos/dates_demo/time_diff.py | t4d-classes/advanced-python_05102021 | 2d596a6135a0e25d641e2a8f6c8ea0091291e843 | [
"MIT"
] | null | null | null | python_demos/dates_demo/time_diff.py | t4d-classes/advanced-python_05102021 | 2d596a6135a0e25d641e2a8f6c8ea0091291e843 | [
"MIT"
] | null | null | null | python_demos/dates_demo/time_diff.py | t4d-classes/advanced-python_05102021 | 2d596a6135a0e25d641e2a8f6c8ea0091291e843 | [
"MIT"
] | null | null | null | """ time diff demo """
import time
start = time.time()
time.sleep(3)
end = time.time()
time_diff = end - start
print(time_diff)
| 9.571429 | 23 | 0.649254 | 21 | 134 | 4.047619 | 0.428571 | 0.376471 | 0.282353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009259 | 0.19403 | 134 | 13 | 24 | 10.307692 | 0.777778 | 0.104478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.166667 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4dc9a42b91a1e6b2eba446f066771241a1e1722e | 418 | py | Python | uvoyeur/app/Agent/__init__.py | egustafson/uvoyeur | ed7a9c60933a898964a111c0e5311bab3172b21a | [
"Apache-2.0"
] | null | null | null | uvoyeur/app/Agent/__init__.py | egustafson/uvoyeur | ed7a9c60933a898964a111c0e5311bab3172b21a | [
"Apache-2.0"
] | null | null | null | uvoyeur/app/Agent/__init__.py | egustafson/uvoyeur | ed7a9c60933a898964a111c0e5311bab3172b21a | [
"Apache-2.0"
] | null | null | null | """ Client (App) Agent singleton
More description - TBD
"""
#
# Author: Eric Gustafson <eg-git@elfwerks.org> (29 Aug 2015)
#
# ############################################################
# import statement
def init_agent(**kwargs):
# opportunity for pre/post hooks.
return Agent(**kwargs)
class Agent:
def __init__(self, **kwargs):
None
## Local Variables:
## mode: python
## End:
| 14.928571 | 62 | 0.535885 | 43 | 418 | 5.093023 | 0.837209 | 0.063927 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017964 | 0.200957 | 418 | 27 | 63 | 15.481481 | 0.637725 | 0.476077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0.2 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
4deb3f25e6248afaca2a1e6cd3c492c56e7c4ff5 | 359 | py | Python | hyperion/torch/data/__init__.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | 14 | 2021-12-19T04:24:15.000Z | 2022-03-18T03:24:04.000Z | hyperion/torch/data/__init__.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | null | null | null | hyperion/torch/data/__init__.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | 5 | 2021-12-14T20:41:27.000Z | 2022-02-24T14:18:11.000Z | """
Copyright 2019 Johns Hopkins University (Author: Jesus Villalba)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
# datasets
from .feat_seq_dataset import FeatSeqDataset
from .paired_feat_seq_dataset import PairedFeatSeqDataset
from .audio_dataset import AudioDataset
# samplers
from .weighted_seq_sampler import ClassWeightedSeqSampler
| 25.642857 | 66 | 0.81337 | 45 | 359 | 6.311111 | 0.688889 | 0.137324 | 0.098592 | 0.140845 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025078 | 0.111421 | 359 | 13 | 67 | 27.615385 | 0.865204 | 0.392758 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4deeed8aa1253076ca937b9a354bcdeba019bc51 | 462 | py | Python | task_5/create_example.py | christopher-besch/bwinf39 | e5394b37894a56608312057d179029d8a5df98fd | [
"MIT"
] | 1 | 2021-01-04T15:16:44.000Z | 2021-01-04T15:16:44.000Z | task_5/create_example.py | christopher-besch/bwinf39 | e5394b37894a56608312057d179029d8a5df98fd | [
"MIT"
] | null | null | null | task_5/create_example.py | christopher-besch/bwinf39 | e5394b37894a56608312057d179029d8a5df98fd | [
"MIT"
] | null | null | null | from random import choice
def main():
amount_students = 1000
amount_wishes = 100
print(amount_students)
for student_number in range(1, amount_students + 1):
wishes = []
for _ in range(amount_wishes):
while str(wish := choice(range(1, amount_students + 1))) in wishes:
pass
wishes.append(str(wish))
print(" ".join(wishes))
if __name__ == "__main__":
main()
| 24.315789 | 80 | 0.569264 | 53 | 462 | 4.660377 | 0.490566 | 0.226721 | 0.097166 | 0.161943 | 0.17004 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03537 | 0.32684 | 462 | 18 | 81 | 25.666667 | 0.758842 | 0 | 0 | 0 | 0 | 0 | 0.02027 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0.071429 | 0.071429 | 0 | 0.142857 | 0.142857 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
15085e6b9a45b57cfcf1f66dc43190adfe79a81c | 175 | py | Python | modules/2.79/bpy/types/ShrinkwrapConstraint.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | modules/2.79/bpy/types/ShrinkwrapConstraint.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | modules/2.79/bpy/types/ShrinkwrapConstraint.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | class ShrinkwrapConstraint:
distance = None
project_axis = None
project_axis_space = None
project_limit = None
shrinkwrap_type = None
target = None
| 15.909091 | 29 | 0.691429 | 19 | 175 | 6.105263 | 0.578947 | 0.284483 | 0.258621 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.268571 | 175 | 10 | 30 | 17.5 | 0.90625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1515555b091b66dd98eafaac5534dd27eb29cd8f | 1,407 | py | Python | tests/test_main.py | tsandrini/DoSU | 312afb1c1dccaf5088b8d5818adf08d5406076ae | [
"MIT"
] | null | null | null | tests/test_main.py | tsandrini/DoSU | 312afb1c1dccaf5088b8d5818adf08d5406076ae | [
"MIT"
] | 2 | 2017-02-07T08:23:34.000Z | 2017-09-09T08:46:25.000Z | tests/test_main.py | tsandrini/dosu | 312afb1c1dccaf5088b8d5818adf08d5406076ae | [
"MIT"
] | null | null | null | """
__/\\\\\\\\\\\\______________________/\\\\\\\\\\\____/\\\________/\\\_
_\/\\\////////\\\__________________/\\\/////////\\\_\/\\\_______\/\\\_
_\/\\\______\//\\\________________\//\\\______\///__\/\\\_______\/\\\_
_\/\\\_______\/\\\_____/\\\\\______\////\\\_________\/\\\_______\/\\\_
_\/\\\_______\/\\\___/\\\///\\\_______\////\\\______\/\\\_______\/\\\_
_\/\\\_______\/\\\__/\\\__\//\\\_________\////\\\___\/\\\_______\/\\\_
_\/\\\_______/\\\__\//\\\__/\\\___/\\\______\//\\\__\//\\\______/\\\__
_\/\\\\\\\\\\\\/____\///\\\\\/___\///\\\\\\\\\\\/____\///\\\\\\\\\/___
_\////////////________\/////_______\///////////________\/////////_____
Created by Tomáš Sandrini
"""
import unittest
import unittest.mock
import os
import random
from dosu import __main__
from dosu import handler
from dosu.helpers import str_random
from dosu import config
class TestMain(unittest.TestCase):
def test_args_w(self):
subject = 'TestSubject' + str_random(5)
args = __main__.get_args(['-w', subject])
__main__.process_args(args)
self.assertTrue(handler.make.has_been_called)
def test_args_d(self):
subject = random.choice(config.subjects)
args = __main__.get_args(['-d', subject])
__main__.process_args(args)
self.assertTrue(handler.delete.has_been_called)
if __name__ == "__main__":
unittest.main()
| 31.266667 | 78 | 0.561478 | 94 | 1,407 | 4.989362 | 0.425532 | 0.06823 | 0.089552 | 0.085288 | 0.200426 | 0.200426 | 0.200426 | 0.200426 | 0 | 0 | 0 | 0.000824 | 0.137171 | 1,407 | 44 | 79 | 31.977273 | 0.385502 | 0.448472 | 0 | 0.095238 | 0 | 0 | 0.032951 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 1 | 0.095238 | false | 0 | 0.380952 | 0 | 0.52381 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
127d795a68d5899e40f6a8e3c076bda1c1bbf0ca | 313 | py | Python | dockercloud/api/exceptions.py | lllanos/Docker-Python-Lib-for-Cloud | 3df41bf76038e3ee7b03da7b110896f35ec1398d | [
"Apache-2.0"
] | null | null | null | dockercloud/api/exceptions.py | lllanos/Docker-Python-Lib-for-Cloud | 3df41bf76038e3ee7b03da7b110896f35ec1398d | [
"Apache-2.0"
] | null | null | null | dockercloud/api/exceptions.py | lllanos/Docker-Python-Lib-for-Cloud | 3df41bf76038e3ee7b03da7b110896f35ec1398d | [
"Apache-2.0"
] | null | null | null | class ApiError(Exception):
"""An error status code was returned when querying the HTTP API"""
pass
class AuthError(ApiError):
"""An 401 Unauthorized status code was returned when querying the API"""
pass
class NonUniqueIdentifier(ApiError):
pass
class ObjectNotFound(ApiError):
pass
| 18.411765 | 76 | 0.71885 | 38 | 313 | 5.921053 | 0.526316 | 0.12 | 0.115556 | 0.186667 | 0.32 | 0.32 | 0.32 | 0 | 0 | 0 | 0 | 0.012048 | 0.204473 | 313 | 16 | 77 | 19.5625 | 0.891566 | 0.405751 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
12814b500b0c6386ff368fa1a2acc84cd8772def | 393 | py | Python | sms/db/storydata.py | NovelLab/sms | b9df8d22d8a5bd555a4c7f5bf9cdd0084f156ae9 | [
"MIT"
] | null | null | null | sms/db/storydata.py | NovelLab/sms | b9df8d22d8a5bd555a4c7f5bf9cdd0084f156ae9 | [
"MIT"
] | null | null | null | sms/db/storydata.py | NovelLab/sms | b9df8d22d8a5bd555a4c7f5bf9cdd0084f156ae9 | [
"MIT"
] | null | null | null | """Define story data."""
# Official Libraries
# My Modules
from sms.utils import assertion
__all__ = (
'StoryData',
)
# Main
class StoryData(object):
def __init__(self, data: list):
self.data = assertion.is_list(data)
def get_data(self) -> list:
return self.data
def is_empty(self) -> bool:
return True if not self.data else False
| 15.115385 | 47 | 0.618321 | 50 | 393 | 4.64 | 0.62 | 0.137931 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.274809 | 393 | 25 | 48 | 15.72 | 0.814035 | 0.137405 | 0 | 0 | 0 | 0 | 0.02719 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 1 | 0.272727 | false | 0 | 0.090909 | 0.181818 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
12874b544a36cbd930ff84441da7f8129612526c | 648 | py | Python | pypro/videos/tests/conftest.py | rodrigoddc/django-advanced-course | 098507d8111f38f8a6b914575e50861538913f6c | [
"MIT"
] | 1 | 2020-06-30T01:30:31.000Z | 2020-06-30T01:30:31.000Z | pypro/videos/tests/conftest.py | rodrigoddc/django-advanced-course | 098507d8111f38f8a6b914575e50861538913f6c | [
"MIT"
] | 102 | 2020-06-30T01:03:27.000Z | 2021-09-22T19:26:44.000Z | pypro/videos/tests/conftest.py | rodrigoddc/django-advanced-course | 098507d8111f38f8a6b914575e50861538913f6c | [
"MIT"
] | null | null | null | import pytest
from django.urls import reverse
from model_bakery import baker
from pypro.videos.models.model_video import Video
@pytest.fixture
def video(db):
return baker.make(Video)
@pytest.fixture
def videos(db):
return baker.make(Video, 3)
@pytest.fixture
def response_video_list(client, videos):
return client.get(reverse('videos:video_list'))
@pytest.fixture
def response_video_item(client, video):
return client.get(reverse('videos:video_render', args=(video.slug, )))
@pytest.fixture
def response_video_item_fail(client, video):
return client.get(reverse('videos:video_render', args=(video.slug + '_fail', )))
| 20.903226 | 84 | 0.756173 | 92 | 648 | 5.184783 | 0.304348 | 0.136268 | 0.167715 | 0.150943 | 0.624738 | 0.471698 | 0.264151 | 0.264151 | 0.264151 | 0.264151 | 0 | 0.001761 | 0.123457 | 648 | 30 | 85 | 21.6 | 0.838028 | 0 | 0 | 0.263158 | 0 | 0 | 0.092593 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.263158 | false | 0 | 0.210526 | 0.263158 | 0.736842 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
1298a56cbb42035c791ffe83eb12987ca3c4cd6a | 237 | py | Python | src/games/abc/basePlayer.py | Italian-Coders-Group/papaya | ce0d4e0bb461f19899a4f7122e3a19527f2c20cc | [
"MIT"
] | 1 | 2020-12-04T19:36:23.000Z | 2020-12-04T19:36:23.000Z | src/games/abc/basePlayer.py | Italian-Coders-Group/papaya | ce0d4e0bb461f19899a4f7122e3a19527f2c20cc | [
"MIT"
] | 16 | 2020-12-07T00:06:28.000Z | 2021-04-25T19:13:59.000Z | src/games/abc/basePlayer.py | Italian-Coders-Group/papaya | ce0d4e0bb461f19899a4f7122e3a19527f2c20cc | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
import discord
import core
class BasePlayer(metaclass=ABCMeta):
user: int
team: int
async def getUser( self ) -> discord.User:
return await core.Bot.instance.client.fetch_user(self.user)
| 16.928571 | 61 | 0.767932 | 33 | 237 | 5.484848 | 0.69697 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147679 | 237 | 13 | 62 | 18.230769 | 0.89604 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.375 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
12a23694b77d37bdb4910b20b889352d6ea03429 | 191 | py | Python | submissions/abc125/b.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/abc125/b.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/abc125/b.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(n):
xy = v[i] - c[i]
if xy > 0:
ans += xy
print(ans)
| 15.916667 | 35 | 0.47644 | 34 | 191 | 2.676471 | 0.5 | 0.263736 | 0.21978 | 0.32967 | 0.43956 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014925 | 0.298429 | 191 | 11 | 36 | 17.363636 | 0.664179 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.111111 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
12d42981a056e15165745dacd06da228d717bc71 | 267 | py | Python | modules/api/functional_test/live_tests/internal/health_test.py | slandry90/vinyldns | bf3122bdd5058af53561224adb1984e3b9f1f5bc | [
"Apache-2.0"
] | 333 | 2018-07-27T12:58:40.000Z | 2022-03-16T23:05:37.000Z | modules/api/functional_test/live_tests/internal/health_test.py | slandry90/vinyldns | bf3122bdd5058af53561224adb1984e3b9f1f5bc | [
"Apache-2.0"
] | 1,010 | 2018-07-27T14:43:14.000Z | 2022-03-25T09:29:43.000Z | modules/api/functional_test/live_tests/internal/health_test.py | slandry90/vinyldns | bf3122bdd5058af53561224adb1984e3b9f1f5bc | [
"Apache-2.0"
] | 123 | 2018-07-26T20:06:04.000Z | 2022-02-16T17:12:17.000Z | import pytest
from hamcrest import *
from vinyldns_python import VinylDNSClient
def test_health(shared_zone_test_context):
"""
Tests that the health check endpoint works
"""
client = shared_zone_test_context.ok_vinyldns_client
client.health()
| 19.071429 | 56 | 0.7603 | 34 | 267 | 5.676471 | 0.617647 | 0.103627 | 0.145078 | 0.217617 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183521 | 267 | 13 | 57 | 20.538462 | 0.885321 | 0.157303 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.5 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
12f570c09bdac3a66f72c4d0df27a904f15b220c | 86 | py | Python | celeryd.py | PythonicNinja/test_celery | f2d798ce229159543cc06c6ca2dc2f4d2654e907 | [
"MIT"
] | null | null | null | celeryd.py | PythonicNinja/test_celery | f2d798ce229159543cc06c6ca2dc2f4d2654e907 | [
"MIT"
] | null | null | null | celeryd.py | PythonicNinja/test_celery | f2d798ce229159543cc06c6ca2dc2f4d2654e907 | [
"MIT"
] | null | null | null | from celery import Celery
app = Celery('tasks')
'''
This file is used to create
'''
| 10.75 | 27 | 0.674419 | 13 | 86 | 4.461538 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.197674 | 86 | 7 | 28 | 12.285714 | 0.84058 | 0 | 0 | 0 | 0 | 0 | 0.098039 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
4202ba0d5aaf107e9ee41233b1beae64f18dc9ea | 2,722 | py | Python | venv/lib/python3.6/site-packages/past/types/olddict.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/past/types/olddict.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | 1 | 2021-06-01T23:32:38.000Z | 2021-06-01T23:32:38.000Z | venv/lib/python3.6/site-packages/past/types/olddict.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | """
A dict subclass for Python 3 that behaves like Python 2's dict
Example use:
>>> from past.builtins import dict
>>> d1 = dict() # instead of {} for an empty dict
>>> d2 = dict(key1='value1', key2='value2')
The keys, values and items methods now return lists on Python 3.x and there are
methods for iterkeys, itervalues, iteritems, and viewkeys etc.
>>> for d in (d1, d2):
... assert isinstance(d.keys(), list)
... assert isinstance(d.values(), list)
... assert isinstance(d.items(), list)
"""
import sys
from past.utils import with_metaclass
_builtin_dict = dict
ver = sys.version_info[:2]
class BaseOldDict(type):
def __instancecheck__(cls, instance):
return isinstance(instance, _builtin_dict)
class olddict(with_metaclass(BaseOldDict, _builtin_dict)):
"""
A backport of the Python 3 dict object to Py2
"""
iterkeys = _builtin_dict.keys
viewkeys = _builtin_dict.keys
def keys(self):
return list(super(olddict, self).keys())
itervalues = _builtin_dict.values
viewvalues = _builtin_dict.values
def values(self):
return list(super(olddict, self).values())
iteritems = _builtin_dict.items
viewitems = _builtin_dict.items
def items(self):
return list(super(olddict, self).items())
def has_key(self, k):
"""
D.has_key(k) -> True if D has a key k, else False
"""
return k in self
# def __new__(cls, *args, **kwargs):
# """
# dict() -> new empty dictionary
# dict(mapping) -> new dictionary initialized from a mapping object's
# (key, value) pairs
# dict(iterable) -> new dictionary initialized as if via:
# d = {}
# for k, v in iterable:
# d[k] = v
# dict(**kwargs) -> new dictionary initialized with the name=value pairs
# in the keyword argument list. For example: dict(one=1, two=2)
# """
#
# if len(args) == 0:
# return super(olddict, cls).__new__(cls)
# # Was: elif isinstance(args[0], newbytes):
# # We use type() instead of the above because we're redefining
# # this to be True for all unicode string subclasses. Warning:
# # This may render newstr un-subclassable.
# elif type(args[0]) == olddict:
# return args[0]
# # elif isinstance(args[0], _builtin_dict):
# # value = args[0]
# else:
# value = args[0]
# return super(olddict, cls).__new__(cls, value)
def __native__(self):
"""
Hook for the past.utils.native() function
"""
return super(oldbytes, self)
__all__ = ["olddict"]
| 27.77551 | 80 | 0.599192 | 344 | 2,722 | 4.598837 | 0.363372 | 0.069532 | 0.032238 | 0.03603 | 0.097345 | 0.097345 | 0.040455 | 0.040455 | 0 | 0 | 0 | 0.011765 | 0.281778 | 2,722 | 97 | 81 | 28.061856 | 0.797442 | 0.591109 | 0 | 0 | 0 | 0 | 0.00691 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.24 | false | 0 | 0.08 | 0.16 | 0.88 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
421d5f442d5390e8717b7e387c7d652bd5289a60 | 173 | py | Python | usaspending_api/awards/v2/urls_transactions.py | truthiswill/usaspending-api | bd7d915442e2ec94cc830c480ceeffd4479be6c0 | [
"CC0-1.0"
] | null | null | null | usaspending_api/awards/v2/urls_transactions.py | truthiswill/usaspending-api | bd7d915442e2ec94cc830c480ceeffd4479be6c0 | [
"CC0-1.0"
] | 1 | 2021-11-15T17:53:27.000Z | 2021-11-15T17:53:27.000Z | usaspending_api/awards/v2/urls_transactions.py | truthiswill/usaspending-api | bd7d915442e2ec94cc830c480ceeffd4479be6c0 | [
"CC0-1.0"
] | null | null | null | from django.conf.urls import url
from usaspending_api.awards.v2.views.transactions import TransactionViewSet
urlpatterns = [
url(r'^$', TransactionViewSet.as_view())
]
| 24.714286 | 75 | 0.780347 | 21 | 173 | 6.333333 | 0.809524 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006494 | 0.109827 | 173 | 6 | 76 | 28.833333 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0.011561 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
42441fe979c428b02b9c2546a6a7123330fd950b | 11,135 | py | Python | services/Wikidata_Endpoint_API/main.py | muhammad-abbady/JenTab | df7b1450cb14e64edade30ea7de49d05a7d7dbf2 | [
"Apache-2.0"
] | null | null | null | services/Wikidata_Endpoint_API/main.py | muhammad-abbady/JenTab | df7b1450cb14e64edade30ea7de49d05a7d7dbf2 | [
"Apache-2.0"
] | null | null | null | services/Wikidata_Endpoint_API/main.py | muhammad-abbady/JenTab | df7b1450cb14e64edade30ea7de49d05a7d7dbf2 | [
"Apache-2.0"
] | null | null | null | from quart import Quart, request
import traceback
import inc.api
import inc.api_properties
import inc.api_classes
import inc.api_types
import util_log
util_log.init("Wikidata_Endpoint_API.log")
app = Quart(__name__)
app.debug = False
@app.route('/test')
async def routeTest():
# res = await inc.api.get_type_lst(['Q559290'])
# res = await inc.api.get_type_lst([get_literals_for_lst_lst'Q6239', 'Q313'])
# res = await inc.api_classes.get_parents_for('Q559290')
# res = await inc.api_classes.get_parents_for_lst(['Q2472824', 'Q55'])
# res = await inc.api_classes.get_subclasses('Q7631964')
# res = await inc.api.get_properties_for('Q2', 'Q18589965')
# res = await inc.api_properties.get_literals_full_for_lst(['Q188370'])
# res = await inc.api_properties.get_literals_topranked_for_lst(['Q2472824'])
# res = await inc.api_properties.get_objects_full_for_lst(['Q18881773'])
# res = await inc.api_properties.get_objects_topranked_for_lst(['Q2472824'])
res = await inc.api_properties.get_strings_for_lst(['Q71441798']) # Note: it doesn't return a format of Wiki Pxxx
# res = await inc.api.filter_entities_by_classes(['Q188370', 'Q6772633', 'Q6772631'], ['Q2385804'])
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Cells ~~~~~~~~~~~~~~~~~~~~~~
@app.route('/filter_entities_by_classes', methods=['POST'])
async def routeFilter_values_by_classes():
entities = (await request.json)["entities"]
classes = (await request.json)["classes"]
res = await inc.api.filter_entities_by_classes(entities, classes)
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Classes ~~~~~~~~~~~~~~~~~~~~~~
@app.route('/get_type_for', methods=['POST'])
async def routeGet_type_for():
txt = (await request.json)["text"]
res = await inc.api_types.get_type_lst([txt])
return res
@app.route('/get_type_for_lst', methods=['POST'])
async def routeGet_type_for_lst():
queries = (await request.json)["texts"]
res = await inc.api_types.get_type_lst(queries)
return res
@app.route('/get_ancestors_for_lst', methods=['POST'])
async def routeGet_ancestors_for_lst():
entities = (await request.json)["entities"]
res = await inc.api_types.get_ancestors_for_lst(entities)
return res
@app.route('/get_hierarchy_for_lst', methods=['POST'])
async def routeGet_hierarchy_for_lst():
entities = (await request.json)["entities"]
res = await inc.api_types.get_hierarchy_for_lst(entities)
return res
@app.route('/get_subclasses_for', methods=['POST'])
async def routeGet_subclasses_for():
klass = (await request.json)["wikiclass"]
res = await inc.api.get_subclasses(klass)
return res
@app.route('/get_parents_for', methods=['POST'])
async def routeGet_parents_for():
klass = (await request.json)["wikiclass"]
res = await inc.api_classes.get_parents_for_lst([klass])
return res
@app.route('/get_parents_for_lst', methods=['POST'])
async def routeGet_parents_for_lst():
klasses = (await request.json)["texts"]
res = await inc.api_classes.get_parents_for_lst(klasses)
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Literals ~~~~~~~~~~~~~~~~~~~~~~
@app.route('/get_literals_for_lst', methods=['POST'])
async def routeGet_literals_for_lst():
queries = (await request.json)["texts"]
res = await inc.api_properties.get_literals_full_for_lst(queries)
return res
@app.route('/get_literals_for', methods=['POST'])
async def routeGet_literals_for():
txt = (await request.json)["text"]
res = await inc.api_properties.get_literals_full_for_lst([txt])
return res
@app.route('/get_literals_full_for_lst', methods=['POST'])
async def routeGet_literals_full_for_lst():
queries = (await request.json)["texts"]
res = await inc.api_properties.get_literals_full_for_lst(queries)
return res
@app.route('/get_literals_full_for', methods=['POST'])
async def routeGet_literals_full_for():
txt = (await request.json)["text"]
res = await inc.api_properties.get_literals_full_for_lst([txt])
return res
@app.route('/get_literals_topranked_for_lst', methods=['POST'])
async def routeGet_literals_topranked_for_lst():
queries = (await request.json)["texts"]
res = await inc.api_properties.get_literals_topranked_for_lst(queries)
return res
@app.route('/get_literals_topranked_for', methods=['POST'])
async def routeGet_literals_topranked_for():
txt = (await request.json)["text"]
res = await inc.api_properties.get_literals_topranked_for_lst([txt])
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Objects ~~~~~~~~~~~~~~~~~~~~~~
@app.route('/get_objects_for_lst', methods=['POST'])
async def routeGet_objects_for_lst():
queries = (await request.json)["texts"]
res = await inc.api_properties.get_objects_full_for_lst(queries)
return res
@app.route('/get_objects_for', methods=['POST'])
async def routeGet_objects_for():
txt = (await request.json)["text"]
res = await inc.api_properties.get_objects_full_for_lst([txt])
return res
@app.route('/get_objects_full_for_lst', methods=['POST'])
async def routeGet_objects_full_for_lst():
queries = (await request.json)["texts"]
res = await inc.api_properties.get_objects_full_for_lst(queries)
return res
@app.route('/get_objects_full_for', methods=['POST'])
async def routeGet_objects_full_for():
txt = (await request.json)["text"]
res = await inc.api_properties.get_objects_full_for_lst([txt])
return res
@app.route('/get_objects_topranked_for_lst', methods=['POST'])
async def routeGet_objects_topranked_for_lst():
queries = (await request.json)["texts"]
res = await inc.api_properties.get_objects_topranked_for_lst(queries)
return res
@app.route('/get_objects_topranked_for', methods=['POST'])
async def routeGet_objects_topranked_for():
txt = (await request.json)["text"]
res = await inc.api_properties.get_objects_topranked_for_lst([txt])
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Reverse Objects ~~~~~~~~~~~~~~~~~~~~~~
@app.route('/get_reverse_objects_for_lst', methods=['POST'])
async def routeGet_reverse_objects_for_lst():
queries = (await request.json)["entities"]
res = await inc.api_properties.get_reverse_objects_topranked_for_lst(queries)
return res
@app.route('/get_reverse_objects_topranked_for_lst', methods=['POST'])
async def routeGet_reverse_objects_topranked_for():
entities = (await request.json)["entities"]
res = await inc.api_properties.get_reverse_objects_topranked_for_lst(entities)
return res
@app.route('/get_reverse_objects_classed_for_lst', methods=['POST'])
async def routeGet_reverse_objects_classed_for_lst():
params = await request.json
entities = params["entities"]
klass = params["class"]
res = await inc.api_properties.get_reverse_objects_classed_for_lst(entities, klass)
return res
@app.route('/get_children_for_lst', methods=['POST'])
async def routeGet_children_for_lst():
params = await request.json
entities = params["entities"]
res = await inc.api_types.get_children_for_lst(entities)
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Strings ~~~~~~~~~~~~~~~~~~~~~~
@app.route('/get_strings_for', methods=['POST'])
async def routeGet_string_for():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_strings_for_lst(params["text"], lang)
return res
@app.route('/get_strings_for_lst', methods=['POST'])
async def routeGet_string_for_lst():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_strings_for_lst(params["texts"], lang)
return res
@app.route('/get_labels_for_lst', methods=['POST'])
async def routeGet_labels_for_lst():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_labels_for_lst(params["entities"], lang)
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Properties ~~~~~~~~~~~~~~~~~~~~~~
@app.route('/get_connection_for_lst', methods=['POST'])
async def routeGet_connection_for_lst():
pairs = (await request.json)["pairs"]
res = await inc.api.get_connection_for_lst(pairs)
return res
@app.route('/get_properties_for', methods=['POST'])
async def routeGet_properties_for():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_properties_full_for_lst([params["text"]], lang)
return res
@app.route('/get_properties_for_lst', methods=['POST'])
async def routeGet_properties_for_lst():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_properties_full_for_lst(params["texts"], lang)
return res
@app.route('/get_properties_full_for', methods=['POST'])
async def routeGet_properties_full_for():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_properties_full_for_lst([params["text"]], lang)
return res
@app.route('/get_properties_full_for_lst', methods=['POST'])
async def routeGet_properties_full_for_lst():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_properties_full_for_lst(params["texts"], lang)
return res
@app.route('/get_properties_topranked_for', methods=['POST'])
async def routeGet_properties_topranked_for():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_properties_topranked_for_lst([params["text"]], lang)
return res
@app.route('/get_properties_topranked_for_lst', methods=['POST'])
async def routeGet_properties_topranked_for_lst():
params = await request.json
if 'lang' in params:
lang = params['lang']
else:
lang = 'en'
res = await inc.api_properties.get_properties_topranked_for_lst(params["texts"], lang)
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Other ~~~~~~~~~~~~~~~~~~~~~~
@app.route('/get_popularity_for_lst', methods=['POST'])
async def routeGet_popularity_for_lst():
entities = (await request.json)["entities"]
res = await inc.api.get_popularity_for_lst(entities)
return res
@app.route('/get_direct_types_for_lst', methods=['POST'])
async def routeGet_direct_types_for_lst():
entities = (await request.json)["entities"]
res = await inc.api_types.get_direct_types_for_lst(entities)
return res
# ~~~~~~~~~~~~~~~~~~~~~~ Default ~~~~~~~~~~~~~~~~~~~~~~
@app.errorhandler(500)
def handle_500(e):
"""output the internal error stack in case of unhandled exception"""
try:
raise e
except:
return traceback.format_exc(), 500
@app.route('/')
def routeRoot():
return 'endpoint.wikidata.svc'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5007)
| 30.258152 | 118 | 0.687113 | 1,492 | 11,135 | 4.824397 | 0.081769 | 0.068352 | 0.073354 | 0.093359 | 0.841206 | 0.804529 | 0.786607 | 0.680745 | 0.53626 | 0.467213 | 0 | 0.013129 | 0.151774 | 11,135 | 367 | 119 | 30.340599 | 0.748968 | 0.121419 | 0 | 0.489796 | 0 | 0 | 0.140617 | 0.069386 | 0 | 0 | 0 | 0 | 0 | 1 | 0.008163 | false | 0 | 0.028571 | 0.004082 | 0.195918 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
425f4b2bfc6695d67fd5c0d17026bdcbb6305c86 | 1,262 | py | Python | opentaxii/auth/manager.py | fossabot/OpenTAXII | cb267fc3f5b17b72e16a52bf8a5cbf7a7789e9ad | [
"BSD-Source-Code"
] | null | null | null | opentaxii/auth/manager.py | fossabot/OpenTAXII | cb267fc3f5b17b72e16a52bf8a5cbf7a7789e9ad | [
"BSD-Source-Code"
] | null | null | null | opentaxii/auth/manager.py | fossabot/OpenTAXII | cb267fc3f5b17b72e16a52bf8a5cbf7a7789e9ad | [
"BSD-Source-Code"
] | 1 | 2021-02-09T15:00:22.000Z | 2021-02-09T15:00:22.000Z | import structlog
log = structlog.getLogger(__name__)
class AuthManager(object):
'''Manager responsible for authentication.
Manager uses API instance ``api`` for basic auth operations and
provides additional logic on top.
:param `opentaxii.auth.api.OpenTAXIIAuthAPI` api:
instance of Auth API class
'''
def __init__(self, api):
self.api = api
def authenticate(self, username, password):
'''Authenticate a user.
:param str username: username
:param str password: password
:return: auth token
:rtype: string
'''
return self.api.authenticate(username, password)
def get_account(self, token):
'''Get account for auth token.
:param str token: auth token
:return: an account entity
:rtype: `opentaxii.entities.Account`
'''
return self.api.get_account(token)
def create_account(self, username, password):
'''Create an account.
NOTE: Additional method that is only used in the helper scripts
shipped with OpenTAXII.
'''
account = self.api.create_account(username, password)
log.info("account.created", username=account.username)
return account
| 25.24 | 71 | 0.639461 | 141 | 1,262 | 5.638298 | 0.432624 | 0.044025 | 0.050314 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.272583 | 1,262 | 49 | 72 | 25.755102 | 0.866013 | 0.450872 | 0 | 0 | 0 | 0 | 0.027174 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0.307692 | 0.076923 | 0 | 0.692308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
42671de1b4eae9f21dceb2c34b3cd9d9f307256f | 277 | py | Python | python/kata/5-kyu/Maximum subarray sum/main.py | Carlososuna11/codewars-handbook | a0e7c9ac5ad19cfaed3ad463c04616daa3fed82e | [
"MIT"
] | null | null | null | python/kata/5-kyu/Maximum subarray sum/main.py | Carlososuna11/codewars-handbook | a0e7c9ac5ad19cfaed3ad463c04616daa3fed82e | [
"MIT"
] | null | null | null | python/kata/5-kyu/Maximum subarray sum/main.py | Carlososuna11/codewars-handbook | a0e7c9ac5ad19cfaed3ad463c04616daa3fed82e | [
"MIT"
] | null | null | null | import codewars_test as test
from solution import max_sequence
test.describe("Tests")
test.it('should work on an empty array')
test.assert_equals(max_sequence([]), 0)
test.it('should work on the example')
test.assert_equals(max_sequence([-2, 1, -3, 4, -1, 2, 1, -5, 4]), 6) | 34.625 | 68 | 0.718412 | 49 | 277 | 3.938776 | 0.571429 | 0.170984 | 0.124352 | 0.165803 | 0.466321 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045455 | 0.126354 | 277 | 8 | 68 | 34.625 | 0.752066 | 0 | 0 | 0 | 0 | 0 | 0.215827 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0 | true | 0 | 0.285714 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
427df0aa4b3f8a11d9742322dfc8c86de1453262 | 347 | py | Python | cocos/symbolic/__init__.py | michaelnowotny/cocos | 3c34940d7d9eb8592a97788a5df84b8d472f2928 | [
"MIT"
] | 101 | 2019-03-30T05:23:01.000Z | 2021-11-27T09:09:40.000Z | cocos/symbolic/__init__.py | michaelnowotny/cocos | 3c34940d7d9eb8592a97788a5df84b8d472f2928 | [
"MIT"
] | 3 | 2019-04-17T06:04:12.000Z | 2020-12-14T17:36:01.000Z | cocos/symbolic/__init__.py | michaelnowotny/cocos | 3c34940d7d9eb8592a97788a5df84b8d472f2928 | [
"MIT"
] | 5 | 2020-02-07T14:29:50.000Z | 2020-12-09T17:54:07.000Z | from ._lambdification import (
DUMMY_TIME_SYMBOL,
lambdify,
LambdifiedArrayExpressions,
LambdifiedMatrixExpressions,
LambdifiedVectorExpressions,
LambdifiedArrayExpression,
LambdifiedMatrixExpression,
LambdifiedVectorExpression,
LambdifiedScalarExpression
)
from .utilities import find_length_of_state_vectors
| 24.785714 | 51 | 0.806916 | 22 | 347 | 12.409091 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158501 | 347 | 13 | 52 | 26.692308 | 0.934932 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
428ef9c88deee1f7256e0c979e5d12250ddb3a37 | 380 | py | Python | src/timeline_year.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2020-04-10T19:32:43.000Z | 2021-05-08T23:39:21.000Z | src/timeline_year.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2016-09-01T04:38:53.000Z | 2019-01-31T15:51:39.000Z | src/timeline_year.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 7 | 2016-08-10T10:30:59.000Z | 2020-02-21T14:12:35.000Z | import sys
import util
import timeline_year_country
import timeline_year_index
import timeline_year_individual
def run(year):
print("Creating timeline/" + year)
util.makedirs("../timeline/" + year)
timeline_year_index.run(year)
timeline_year_country.run(year)
timeline_year_individual.run(year)
if __name__ == "__main__":
run(sys.argv[1])
| 23.75 | 41 | 0.721053 | 49 | 380 | 5.183673 | 0.367347 | 0.377953 | 0.212598 | 0.149606 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003205 | 0.178947 | 380 | 15 | 42 | 25.333333 | 0.810897 | 0 | 0 | 0 | 0 | 0 | 0.10411 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.076923 | false | 0 | 0.384615 | 0 | 0.461538 | 0.076923 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
429c254c1eab568335b65c87436b8bb6c00a8234 | 1,299 | py | Python | gateway/migrations/0007_auto_20180410_0810.py | u-transnet/utransnet-gateway | bea4e99d2d5f404a5456adc453d0a73e7b19332c | [
"MIT"
] | null | null | null | gateway/migrations/0007_auto_20180410_0810.py | u-transnet/utransnet-gateway | bea4e99d2d5f404a5456adc453d0a73e7b19332c | [
"MIT"
] | null | null | null | gateway/migrations/0007_auto_20180410_0810.py | u-transnet/utransnet-gateway | bea4e99d2d5f404a5456adc453d0a73e7b19332c | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-04-10 05:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gateway', '0006_auto_20180405_0111'),
]
operations = [
migrations.RemoveField(
model_name='bitsharestransnettransaction',
name='closed',
),
migrations.RemoveField(
model_name='bitsharestransnettransaction',
name='error',
),
migrations.RemoveField(
model_name='transnetbitsharestransaction',
name='closed',
),
migrations.RemoveField(
model_name='transnetbitsharestransaction',
name='error',
),
migrations.AddField(
model_name='bitsharestransnettransaction',
name='state',
field=models.CharField(choices=[('idle', 'Idle'), ('complete', 'Complete'), ('error', 'Error')], default='idle', max_length=10, verbose_name='State'),
),
migrations.AddField(
model_name='transnetbitsharestransaction',
name='state',
field=models.CharField(choices=[('idle', 'Idle'), ('complete', 'Complete'), ('error', 'Error')], default='idle', max_length=10, verbose_name='State'),
),
]
| 32.475 | 162 | 0.584296 | 107 | 1,299 | 6.971963 | 0.392523 | 0.072386 | 0.13941 | 0.160858 | 0.63807 | 0.63807 | 0.289544 | 0.289544 | 0.289544 | 0.289544 | 0 | 0.037274 | 0.277136 | 1,299 | 39 | 163 | 33.307692 | 0.757189 | 0.034642 | 0 | 0.787879 | 1 | 0 | 0.252396 | 0.152556 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.030303 | 0 | 0.121212 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
42a61fb4ce631ba9c42dd6d83f0576df62b4d099 | 1,229 | py | Python | aug.py | RainBoltz/time-series-augmentation-toolkit | 2e5712f3f6b96b62e407bd2a05cdf3a9c80aa602 | [
"MIT"
] | 2 | 2020-12-17T07:52:33.000Z | 2021-04-27T02:21:52.000Z | aug.py | RainBoltz/time-series-augmentation-toolkit | 2e5712f3f6b96b62e407bd2a05cdf3a9c80aa602 | [
"MIT"
] | null | null | null | aug.py | RainBoltz/time-series-augmentation-toolkit | 2e5712f3f6b96b62e407bd2a05cdf3a9c80aa602 | [
"MIT"
] | 1 | 2020-06-01T09:23:16.000Z | 2020-06-01T09:23:16.000Z | import numpy as np
np.random.seed(9453)
from time_series_augmentation_toolkit import DN
import pickle
with open('labeldata.pkl','rb') as f:
data = pickle.load(f)
output = []
for d in data:
this_output = d.copy()
r = np.random.choice([3,5,10,15,20], size=4, p=[0.1,0.5,0.3,0.05,0.05])
this_output['ohlc_data']['open'] = np.rint(DN(np.array(this_output['ohlc_data']['open']), sigma=r[0])).tolist()
this_output['ohlc_data']['high'] = np.rint(DN(np.array(this_output['ohlc_data']['high']), sigma=r[1])).tolist()
this_output['ohlc_data']['low'] = np.rint(DN(np.array(this_output['ohlc_data']['low']), sigma=r[2])).tolist()
this_output['ohlc_data']['close'] = np.rint(DN(np.array(this_output['ohlc_data']['close']), sigma=r[3])).tolist()
for i in range(this_output['index'][1] - this_output['index'][0] + 1):
if this_output['ohlc_data']['high'][i] < this_output['ohlc_data']['low'][i]:
this_output['ohlc_data']['high'][i], this_output['ohlc_data']['low'][i] = \
this_output['ohlc_data']['low'][i], this_output['ohlc_data']['high'][i]
output.append(this_output)
with open('labeldata_aug.pkl','wb') as f:
pickle.dump(output, f) | 45.518519 | 117 | 0.624898 | 201 | 1,229 | 3.641791 | 0.288557 | 0.245902 | 0.26776 | 0.344262 | 0.531421 | 0.364754 | 0.364754 | 0.364754 | 0.364754 | 0.184426 | 0 | 0.030593 | 0.148902 | 1,229 | 27 | 118 | 45.518519 | 0.669216 | 0 | 0 | 0 | 0 | 0 | 0.181301 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c40878ccfd4a7d97c415e1cae481eeceed9194bb | 190 | py | Python | 0401-0500/0492-Construct the Rectangle/0492-Construct the Rectangle.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0401-0500/0492-Construct the Rectangle/0492-Construct the Rectangle.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0401-0500/0492-Construct the Rectangle/0492-Construct the Rectangle.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | import math
class Solution:
def constructRectangle(self, area: int) -> List[int]:
W = int(math.sqrt(area))
while area % W:
W -= 1
return [area//W, W]
| 23.75 | 57 | 0.536842 | 25 | 190 | 4.08 | 0.6 | 0.098039 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007874 | 0.331579 | 190 | 7 | 58 | 27.142857 | 0.795276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c42f8d506e9344afbc3a6039dc84f2ff03ba3ff3 | 349 | py | Python | week1/warmups/fib_number_test.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | null | null | null | week1/warmups/fib_number_test.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | 1 | 2021-09-16T05:44:31.000Z | 2021-09-16T05:44:31.000Z | week1/warmups/fib_number_test.py | sevgo/Programming101 | ac25c4d9695563b449a629c60ec77a739c9f5be3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import unittest
from fib_number import fib_number
class Test_Fib_Number(unittest.TestCase):
def test_is_number_fib_number(self):
self.assertIsInstance(fib_number(3), int)
def test_fib_number(self):
self.assertEqual(fib_number(10), 11235813213455)
if __name__ == "__main__":
unittest.main()
| 18.368421 | 56 | 0.730659 | 47 | 349 | 5 | 0.510638 | 0.268085 | 0.110638 | 0.144681 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.062069 | 0.169054 | 349 | 18 | 57 | 19.388889 | 0.748276 | 0.060172 | 0 | 0 | 0 | 0 | 0.024465 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c4362b590b98629d691a21d6862261afe05b25c9 | 19 | py | Python | static/returns.py | cisaacstern/when-rad | ea97d77be0ff227494ce5eb168872f397ee4f064 | [
"BSD-3-Clause"
] | null | null | null | static/returns.py | cisaacstern/when-rad | ea97d77be0ff227494ce5eb168872f397ee4f064 | [
"BSD-3-Clause"
] | null | null | null | static/returns.py | cisaacstern/when-rad | ea97d77be0ff227494ce5eb168872f397ee4f064 | [
"BSD-3-Clause"
] | null | null | null | returns = """
"""
| 4.75 | 13 | 0.368421 | 1 | 19 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.263158 | 19 | 3 | 14 | 6.333333 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c452857457205e054f052fb93b5f206f4da8e07a | 153 | py | Python | opencv/readimage.py | moosemaniam/learning | 93fd1b88fdd63ffc8dcddcb2da1ad41b9fd7e32c | [
"CC0-1.0"
] | null | null | null | opencv/readimage.py | moosemaniam/learning | 93fd1b88fdd63ffc8dcddcb2da1ad41b9fd7e32c | [
"CC0-1.0"
] | null | null | null | opencv/readimage.py | moosemaniam/learning | 93fd1b88fdd63ffc8dcddcb2da1ad41b9fd7e32c | [
"CC0-1.0"
] | null | null | null | import numpy as np
import cv2 as cv
#reads image as greyscale
img = cv.imread("image.jpg",0)
cv.imshow('image',img)
cv.waitKey(0)
cv.destroyAllWindows()
| 19.125 | 30 | 0.745098 | 27 | 153 | 4.222222 | 0.592593 | 0.087719 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022222 | 0.117647 | 153 | 7 | 31 | 21.857143 | 0.822222 | 0.156863 | 0 | 0 | 0 | 0 | 0.109375 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c45ef42d805d64b5a73a6d5583f4fd346acd1080 | 2,094 | py | Python | tests/test_kinematics.py | RafaelCenzano/Marvin-V4 | a3d33816716c7581eae662eedf7b99c8ebf76d93 | [
"Apache-2.0"
] | 4 | 2019-10-03T03:19:00.000Z | 2021-02-22T02:51:34.000Z | tests/test_kinematics.py | Marvin-Virtual-Assistant/Marvin-V4 | a3d33816716c7581eae662eedf7b99c8ebf76d93 | [
"Apache-2.0"
] | 6 | 2019-10-21T17:02:55.000Z | 2021-01-12T17:53:36.000Z | tests/test_kinematics.py | RafaelCenzano/Marvin-V4 | a3d33816716c7581eae662eedf7b99c8ebf76d93 | [
"Apache-2.0"
] | 1 | 2021-03-09T16:39:32.000Z | 2021-03-09T16:39:32.000Z | from . import physics, assertEqual
classObjecttoTest = physics.kinematics.Kinematics(
initialVelocity=3, acceleration=2, time=20, sigFigs=1)
classObjecttoTest.calculations()
classObjecttoTestTwo = physics.kinematics.Kinematics(
acceleration=-1, deltaDistance=2, finalVelocity=0, sigFigs=1)
classObjecttoTestTwo.calculations()
classObjecttoTestThree = physics.kinematics.Kinematics(
finalVelocity=135, acceleration=-41, initialVelocity=372, sigFigs=2)
classObjecttoTestThree.calculations()
def test_kinematics_one_vi():
assertEqual(classObjecttoTest.initialVelocity, '3')
def test_kinematics_one_vf():
assertEqual(classObjecttoTest.finalVelocity, '40')
def test_kinematics_one_a():
assertEqual(classObjecttoTest.acceleration, '2')
def test_kinematics_one_t():
assertEqual(classObjecttoTest.time, '20')
def test_kinematics_one_d():
assertEqual(classObjecttoTest.deltaDistance, '500')
def test_kinematics_one_record():
assertEqual(classObjecttoTest.record, [1, 5])
def test_kinematics_two_vi():
assertEqual(classObjecttoTestTwo.initialVelocity, '2')
def test_kinematics_two_vf():
assertEqual(classObjecttoTestTwo.finalVelocity, '0')
def test_kinematics_two_a():
assertEqual(classObjecttoTestTwo.acceleration, '-1')
def test_kinematics_two_t():
assertEqual(classObjecttoTestTwo.time, '2')
def test_kinematics_two_d():
assertEqual(classObjecttoTestTwo.deltaDistance, '2')
def test_kinematics_two_record():
assertEqual(classObjecttoTestTwo.record, [7, 4])
def test_kinematics_three_vi():
assertEqual(classObjecttoTestThree.initialVelocity, '372')
def test_kinematics_three_vf():
assertEqual(classObjecttoTestThree.finalVelocity, '135')
def test_kinematics_three_a():
assertEqual(classObjecttoTestThree.acceleration, '-41')
def test_kinematics_three_t():
assertEqual(classObjecttoTestThree.time, '5.8')
def test_kinematics_three_d():
assertEqual(classObjecttoTestThree.deltaDistance, '1500')
def test_kinematics_three_record():
assertEqual(classObjecttoTestThree.record, [9, 4])
| 24.635294 | 72 | 0.788443 | 212 | 2,094 | 7.533019 | 0.198113 | 0.078898 | 0.191609 | 0.075141 | 0.039449 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027837 | 0.107927 | 2,094 | 84 | 73 | 24.928571 | 0.827088 | 0 | 0 | 0 | 0 | 0 | 0.014804 | 0 | 0 | 0 | 0 | 0 | 0.413043 | 1 | 0.391304 | false | 0 | 0.021739 | 0 | 0.413043 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
67032b19d21cfedd2a87e391f574f9bd0d72589b | 222 | py | Python | minimo/interface/cli.py | philip1134/mini-mo | 485c7967ce42b2d3b4a33fde2b074b80563921ab | [
"MIT"
] | 4 | 2018-02-27T11:58:26.000Z | 2019-06-04T03:29:43.000Z | minimo/interface/cli.py | philip1134/mini-mo | 485c7967ce42b2d3b4a33fde2b074b80563921ab | [
"MIT"
] | null | null | null | minimo/interface/cli.py | philip1134/mini-mo | 485c7967ce42b2d3b4a33fde2b074b80563921ab | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
#
# author: philip1134
# date: 2021-04-27
#
import click
class MoCLI(click.Group):
"""Interface for cli type"""
def __init__(self, **attrs):
super(MoCLI, self).__init__()
# end
| 12.333333 | 37 | 0.599099 | 28 | 222 | 4.464286 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.075145 | 0.220721 | 222 | 17 | 38 | 13.058824 | 0.647399 | 0.378378 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
670d85c68165bdb508925a46b3799de7e5d6b7d4 | 56 | py | Python | win32/redrrpy/__init__.py | PiRSquared17/r-orange | 6bc383f1db3c10c59e16b39daffc44df904ce031 | [
"Apache-2.0"
] | 1 | 2019-04-15T13:50:30.000Z | 2019-04-15T13:50:30.000Z | win32/redrrpy/__init__.py | PiRSquared17/r-orange | 6bc383f1db3c10c59e16b39daffc44df904ce031 | [
"Apache-2.0"
] | null | null | null | win32/redrrpy/__init__.py | PiRSquared17/r-orange | 6bc383f1db3c10c59e16b39daffc44df904ce031 | [
"Apache-2.0"
] | 1 | 2016-01-21T23:00:21.000Z | 2016-01-21T23:00:21.000Z | ## __init__ function for the base package.
| 14 | 43 | 0.589286 | 6 | 56 | 4.833333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.357143 | 56 | 4 | 44 | 14 | 0.805556 | 0.696429 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
67155f75c124ae7d71d1cf38fa37205d968bb12d | 265 | py | Python | v1/replies/models/post_reply.py | lawiz22/PLOUC-Backend-master | b93fa2fea8d45df9f19c3c58037e59dad4981921 | [
"MIT"
] | null | null | null | v1/replies/models/post_reply.py | lawiz22/PLOUC-Backend-master | b93fa2fea8d45df9f19c3c58037e59dad4981921 | [
"MIT"
] | 3 | 2020-06-05T21:24:34.000Z | 2022-03-11T23:50:26.000Z | v1/replies/models/post_reply.py | lawiz22/PLOUC-Backend-master | b93fa2fea8d45df9f19c3c58037e59dad4981921 | [
"MIT"
] | null | null | null | from django.db import models
from v1.posts.models.post import Post
from .reply import Reply
class PostReply(Reply):
post = models.ForeignKey(Post)
class Meta:
default_related_name = 'post_replies'
def __str__(self):
return self.body
| 18.928571 | 45 | 0.70566 | 36 | 265 | 5 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004831 | 0.218868 | 265 | 13 | 46 | 20.384615 | 0.864734 | 0 | 0 | 0 | 0 | 0 | 0.045283 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0.111111 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
672508bb34440c3d88c116b9db78973e19039e05 | 7,818 | py | Python | book_spider/settings.py | cleven1/Book_sprder | 7f5872cfdf886147b06665d629074b2d0da22fa1 | [
"MIT"
] | null | null | null | book_spider/settings.py | cleven1/Book_sprder | 7f5872cfdf886147b06665d629074b2d0da22fa1 | [
"MIT"
] | null | null | null | book_spider/settings.py | cleven1/Book_sprder | 7f5872cfdf886147b06665d629074b2d0da22fa1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for book_spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
# http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
BOT_NAME = 'book_spider'
SPIDER_MODULES = ['book_spider.spiders']
NEWSPIDER_MODULE = 'book_spider.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'book_spider (+http://www.yourdomain.com)'
# Obey robots.txt rules
ROBOTSTXT_OBEY = True
# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32
# Configure a delay for requests for the same website (default: 0)
# See http://scrapy.readthedocs.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
DOWNLOAD_DELAY = 1
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16
# Disable cookies (enabled by default)
#COOKIES_ENABLED = False
# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False
# Override the default request headers:
#DEFAULT_REQUEST_HEADERS = {
# 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
# 'Accept-Language': 'en',
#}
# Enable or disable spider middlewares
# See http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
# 'book_spider.middlewares.MyCustomSpiderMiddleware': 543,
#}
# Enable or disable downloader middlewares
# See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
#DOWNLOADER_MIDDLEWARES = {
# 'book_spider.middlewares.MyCustomDownloaderMiddleware': 543,
#}
DOWNLOADER_MIDDLEWARES = {
'book_spider.middlewares.RandomUserAgent': 100,
# 'book_spider.middlewares.RandomProxy': 200
}
User_Agents = [
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60 ',
'Mozilla/5.0 (Windows NT 5.1; U; en; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.50 ',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.50',
'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0 ',
'Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 ',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11 ',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 ',
'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/2.0 Safari/536.11',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.71 Safari/537.1 LBBROWSER ',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; LBBROWSER) ',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E; LBBROWSER)”',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; QQBrowser/7.0.3698.400) ',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 SE 2.X MetaSr 1.0 ',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; SE 2.X MetaSr 1.0)',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.3.4000 Chrome/30.0.1599.101 Safari/537.36',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 UBrowser/4.0.3214.0 Safari/537.36',
'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5',
'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5',
'Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; zh-cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5 ',
'Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5',
'Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; HTC_Wildfire_A3333 Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 ',
'Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
'MQQBrowser/26 Mozilla/5.0 (Linux; U; Android 2.3.7; zh-cn; MB200 Build/GRJ22; CyanogenMod-7) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
'Opera/9.80 (Android 2.3.4; Linux; Opera Mobi/build-1107180945; U; en-GB) Presto/2.8.149 Version/11.10',
'Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13',
'Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.337 Mobile Safari/534.1+',
'Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0',
'Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/20.0.019; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.18124',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; HTC; Titan)'
]
PROXIES = [
{'ip_port':'111.155.116.222:8123','user_passwd':''},
{'ip_port':'61.135.217.7:80','user_passwd':''},
{'ip_port':'61.135.217.7:80','user_passwd':''}
]
# Enable or disable extensions
# See http://scrapy.readthedocs.org/en/latest/topics/extensions.html
#EXTENSIONS = {
# 'scrapy.extensions.telnet.TelnetConsole': None,
#}
# Configure item pipelines
# See http://scrapy.readthedocs.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
'book_spider.pipelines.BookSpiderPipeline': 300,
}
# Enable and configure the AutoThrottle extension (disabled by default)
# See http://doc.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False
# Enable and configure HTTP caching (disabled by default)
# See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = 'httpcache'
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
| 56.652174 | 207 | 0.731901 | 1,336 | 7,818 | 4.233533 | 0.244012 | 0.013083 | 0.046146 | 0.036775 | 0.473656 | 0.422383 | 0.402228 | 0.370403 | 0.337871 | 0.311881 | 0 | 0.126304 | 0.11691 | 7,818 | 137 | 208 | 57.065693 | 0.692932 | 0.363392 | 0 | 0 | 0 | 0.653846 | 0.895681 | 0.029951 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.057692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
673124b0ee880f517c2b84a841257d4aaa4ec3fb | 479 | py | Python | pyHexa/main.py | Rod-Persky/pyLynxHexapod | 8205edda4ad4505fe604bd37fc4d0d3ebc51dcbd | [
"AFL-3.0",
"Unlicense"
] | 1 | 2021-06-13T14:07:45.000Z | 2021-06-13T14:07:45.000Z | pyHexa/main.py | Rod-Persky/pyLynxHexapod | 8205edda4ad4505fe604bd37fc4d0d3ebc51dcbd | [
"AFL-3.0",
"Unlicense"
] | null | null | null | pyHexa/main.py | Rod-Persky/pyLynxHexapod | 8205edda4ad4505fe604bd37fc4d0d3ebc51dcbd | [
"AFL-3.0",
"Unlicense"
] | 1 | 2015-01-23T07:23:57.000Z | 2015-01-23T07:23:57.000Z | from bottle import route, run, template, static_file
import lynxmotion
import behaviors
import os.path
static_root = os.path.join(os.path.dirname(__file__), 'static')
@route('/')
def home_page():
return template('controller')
@route('/static/<filepath:path>')
def server_static(filepath):
return static_file(filepath, root=static_root)
#run(reloader=False, host='localhost', port=8080, server='cherrypy')
run(reloader=False, host='0.0.0.0', port=8080) | 28.176471 | 69 | 0.720251 | 66 | 479 | 5.075758 | 0.454545 | 0.053731 | 0.095522 | 0.119403 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028777 | 0.129436 | 479 | 17 | 70 | 28.176471 | 0.77458 | 0.139875 | 0 | 0 | 0 | 0 | 0.118687 | 0.058081 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0.166667 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.