sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
c20be3c9f4b7bf70077e1dec11f6f90bcad2b8eca8dac6ada1ff044a28ccedbc
Python
191
8
from pandas.tests.extension.decimal.array import ( DecimalArray, DecimalDtype, make_data, to_decimal, ) __all__ = ["DecimalArray", "DecimalDtype", "to_decimal", "make_data"]
62702d09bd36093cb24e81aea4db023e51c1a27721a60450e0120d204335cf95
Python
193
6
from escargot.operations.thought import Thought from escargot.operations.graph_of_operations import GraphOfOperations from escargot.operations.operations import ( Operation, Generate )
26bc58dc411314a1801f85d11f85b0b80c9f71bb93402eee397530572b1ea45e
Python
194
9
import numpy as np def one_hot(value): num = '12345' letter = [0 for _ in range(len(num))] letter[value-1] = 1 letter = np.array([letter]) # print(letter) return letter
45b42e7cf8ac0ee4b9b74a7b42ed6ee31b4d6fc06f17025cc970443476f6e264
Python
195
9
import unittest from api_tests import * from event_tests import * from gradient_tests import * from norm_tests import * from odeint_tests import * if __name__ == '__main__': unittest.main()
243b932e13acb7827967324e60b4a78453dace5b74c9ef5d03577ea721df12bc
Python
196
4
from .equiformer_v2_oc20 import EquiformerV2_OC20, EquiformerV2_OC20_Lightning from .lr_scheduler import CosineLRLambda __all__ = [EquiformerV2_OC20_Lightning, EquiformerV2_OC20, CosineLRLambda]
51030289ffe93bcdd36a882990ade8583a6ec789dbe6fe744b33527e81429352
Python
196
8
__all__ = ['NOmniglot', 'nomniglot_full', 'nomniglot_nw_ks','nomniglot_pair','utils'] from . import ( NOmniglot, nomniglot_full, nomniglot_nw_ks, nomniglot_pair, utils )
0be6c06108c103c147b98a50e4f8d1e4e44426dee68b79e32d6d035571c4134a
Python
197
5
from .ctable import CTable from .energies import HydrogenOptimizer from .topology import ProteinData, ProteinDataBatch __all__ = ["CTable", "HydrogenOptimizer", "ProteinData", "ProteinDataBatch"]
94638229488d9829313250d2db17a8744c40430149e9306aca09ec01fb88b81b
Python
197
6
"""Writer classes for saving data to various formats.""" from ._ome_tiff import _OMETiffWriter from ._tiff_sequence import _TiffSequenceWriter __all__ = ["_OMETiffWriter", "_TiffSequenceWriter"]
b809e2b81c92e8154dfe89bcb5c873ae4e63df3f80214a8d91808d28c641379d
Python
198
5
from yass.explore.explorers import SpikeTrainExplorer, RecordingExplorer __all__ = ['SpikeTrainExplorer', 'RecordingExplorer'] # TODO: check if matplotlib is installed, if not, show error message
4ed42143bff1e351493e15b786b43b682829d140a3f955d6c6e77471a62b5d47
Python
201
7
from qcportal import PortalClient import sys dataset_name = sys.argv[1] client = PortalClient('https://ml.qcarchive.molssi.org') ds = client.get_dataset('singlepoint', dataset_name) ds.print_status()
a9954ff3a94bbbdeb08b72be6fbad9554e8e738d16dd00816caa4625aff3edf5
Python
201
6
"""Readers for different file formats.""" from ._ome_zarr_reader import OMEZarrReader from ._tensorstore_zarr_reader import TensorstoreZarrReader __all__ = ["OMEZarrReader", "TensorstoreZarrReader"]
8f7ea94e4d5b7e3479d4264dfa6646fba3eb21489d42ea5479a124be7a4d9021
Python
202
10
"""Molecular vibrational systems""" # Don't import scripts automatically to avoid running them # Users should import explicitly if needed __all__ = [ 'vib_ch3cn', 'vib_clo2', 'vib_h2co', ]
9d7462fbe4b7675da4e1fb415806a4be5fad63750cf5d1a8d1d2bb67510aa318
Python
202
8
""" Original authors: https://github.com/alimuldal/diptest The code under this module is a fork from the original project. """ from diptest._interface import dip, diptest __all__ = ['dip', 'diptest']
a13b0dfe4ca1462ee11dd291ce2f4fcf04aeda01e213710fe0592e477d416453
Python
204
12
import numpy as np import pandas as pd def test_contains_nan(): # GH#52840 arr = pd.array(range(5)) / 0 assert np.isnan(arr._data[0]) assert not arr.isna()[0] assert np.nan in arr
ec12f1e249fdcb98a981f654599e32fcc2c450d817e8c4390f20f0b21849c553
Python
204
9
from pandas.io.parsers.readers import ( TextFileReader, TextParser, read_csv, read_fwf, read_table, ) __all__ = ["TextFileReader", "TextParser", "read_csv", "read_fwf", "read_table"]
669f37a3dd0fbd9e7a31b84d46bd4d6443d3a61a3b8d11dc2d888403d47f059c
Python
205
9
import pytest @pytest.fixture(params=["split", "records", "index", "columns", "values"]) def orient(request): """ Fixture for orients excluding the table format. """ return request.param
78c8b12ebfc948fdd91f02422aa9449747d6c48303531591f6a296c5844131e9
Python
206
9
#!/usr/bin/env python3 """ Convenience wrapper to run antiSMASH directly from the source tree without installing. """ from antismash.__main__ import entrypoint if __name__ == '__main__': entrypoint()
d370bd69926223832f956b407b73e34b2994b47ae85ae5a0739881c8aa427c29
Python
208
9
from hd5file import ascii_to_hd5 import sys filename = sys.argv[1] ascii_to_hd5 (filename, add_reverse=False, num_padding=0, add_shape=False)
224624165d28d8b439aaeae86f0a0f829e23aa2dae294ee9868024de866d898a
Python
209
7
import numpy as np class TestSeriesDtypes: def test_dtype(self, datetime_series): assert datetime_series.dtype == np.dtype("float64") assert datetime_series.dtypes == np.dtype("float64")
8522ecf099b3e5aa9acae7a780927791d4f93f0369056a4aae6412762a67742f
Python
210
8
def _escape_inner(s: str, /) -> str: return ( s.replace("&", "&amp;") .replace(">", "&gt;") .replace("<", "&lt;") .replace("'", "&#39;") .replace('"', "&#34;") )
c77db9fc0c9fb823027489d029b83f88f439151fc434381d997f9d2111422a66
Python
210
7
"""Passive visualisation tools for browsing RELION cryo-ET data.""" from .tilt_series import view_tilt_series from .tomograms import view_tomograms from .particles import view_particles from ._cli import cli
49c4a35e06f1ada356686f3b968793e68798b2624f3b7228f4f40643fbbcaea1
Python
211
2
from .dataset import training_datasets, peak_dataset, wg_dataset, robustness_peak_dataset, robustness_wg_dataset from .task import train_model, eval_model, eval_robustness, export_predictions, predict_snv_atac
bff00477f7aabde3eb1d0cb9fd9a0efc0d52275b259fe6b144bde70b388ceaec
Python
211
9
from monai.metrics import DiceMetric import torch def evaluation_metrics(config): if config["metrics"] == "dice": metrica = DiceMetric(include_background=True)#reduction="mean" return metrica
c0bb5df434ac4f86fe88b6eeda853afe8608beb94468dc2fe089cac9f0c10e93
Python
215
8
__version__ = "2.0.15" import lib.tensor as tensor import lib.mpcomplex as mpcomplex import lib.smi as smi from lib.mpunits import vectorize from lib.designer_fit_wrappers import save_params import lib.rpg as rpg
28d2cf7c16c864e3f12738626362aa7e274ab29dc9bc6afc95eefc13352d9726
Python
217
11
# -*- coding: utf-8 -*- ''' Python module to read common electrophysiology file formats. ''' from .stfio import * from . import stfio_plot as plot try: from . import stfio_neo as neo except ImportError: pass
c0d93b9be3e9b9fbb6baf4fe57134040757fec6b3926684c207e3f70785a7500
Python
218
14
from numpy import argmax import numpy as np def one_hot(value): num = '01' letter = [0 for _ in range(len(num))] letter[value] = 1 letter = np.array([letter]) return letter # print(one_hot(4))
fe882560d891768ca2d655abe361ddc894cf75a79a7b2ee47de4365f6cb394fe
Python
218
8
from torchvision import transforms def get_transforms(): return transforms.Compose([ transforms.Resize((224, 224)), transforms.RandomHorizontalFlip(), transforms.ToTensor(), ])
427a18556f36f13335eeeabedc42de7ad8599bc5cdd98d03904693737b0baf74
Python
219
16
""" public toolkit API """ from pandas.api import ( extensions, indexers, interchange, types, typing, ) __all__ = [ "interchange", "extensions", "indexers", "types", "typing", ]
690f141682b4ba229c35135bc37717e1ba71a8ea38e6625baa1b394a46748b33
Python
219
5
from ._list_difficult_words import list_difficult_words from ._set_difficult_words import set_difficult_words from ._list_words import list_words __all__ = ["list_difficult_words", "set_difficult_words", "list_words"]
2f79829d83d3a7302035f79d56eabd83bc4f59b7347353e8b7de24f6367d3692
Python
221
9
import collections import numpy as np def test_no_duplicates_in_np__all__(): # Regression test for gh-10198. dups = {k: v for k, v in collections.Counter(np.__all__).items() if v > 1} assert len(dups) == 0
dd04f290b6be5dc13ac55ee64d50cda04b9425c7b9279f570cd15862ce75bdfc
Python
221
3
from AttentiveFP.AttentiveLayers import Fingerprint from AttentiveFP.AttentiveLayers_viz import Fingerprint_viz from AttentiveFP.getFeatures import save_smiles_dicts, get_smiles_dicts, get_smiles_array, moltosvg_highlight
f842b0687c30fb2adb9bb67977700dfca1135a65d8819d9d5ba287684da288b2
Python
221
7
from pandas.core.arrays.arrow.accessors import ( ListAccessor, StructAccessor, ) from pandas.core.arrays.arrow.array import ArrowExtensionArray __all__ = ["ArrowExtensionArray", "StructAccessor", "ListAccessor"]
0c45919786e8d1f38575f47561aaf89d534a6d944b35d8bc75fcd33d631fd6ad
Python
222
9
from ._reader import napari_get_reader from .imc_widget import IMCWidget try: from ._version import version as __version__ except ImportError: __version__ = "unknown" __all__ = ["IMCWidget", "napari_get_reader"]
8928e1cd8c619d124b492be8f75520f8bf1d66d5a6c66ad582219da2f13ed2b2
Python
223
9
import typer CLI_NAME = 'relion_tomo_derive_particle_positions' cli = typer.Typer( name=CLI_NAME, add_completion=False, no_args_is_help=True, help='Derive particle poses from annotations for refinement.' )
3cad28e4abfe35d4753f13789bd5ae914885021a6414cf3b0078f2aee3ce0ae4
Python
225
12
from rdkit.Chem.EState import Fingerprinter import numpy as np _type = 'Estate-based' def GetEstateFPs(mol): ''' 79 bits Estate fps ''' x = Fingerprinter.FingerprintMol(mol)[0] return x.astype(np.bool_)
cd55ea1b10c843e79bc7171eb48f4a709f591077880b8d3ce82a03bf273c08d3
Python
225
7
""" Test files dedicated to individual (stand-alone) Series methods Ideally these files/tests should correspond 1-to-1 with tests.frame.methods These may also present opportunities for sharing/de-duplicating test code. """
55bd58a8bab7f35fa7529f158e483ac9c24ec4fddd57668ef578f2335ba17b64
Python
226
8
from __future__ import annotations from pandas.compat._optional import import_optional_dependency ne = import_optional_dependency("numexpr", errors="warn") NUMEXPR_INSTALLED = ne is not None __all__ = ["NUMEXPR_INSTALLED"]
5f03cbe885845139856279bf2d8ba9b827be59ff05dfbf398828dcada773ccf3
Python
226
11
"""Functionality to process NIRS data.""" from .common import ( get_extinction_coefficients, channel_distances, split_long_short_channels ) import cedalion.nirs.cw import cedalion.nirs.fd import cedalion.nirs.td
f3f3aa0737779320dddbeb99844c8e72c6df13e240c6f349213efa3a980987fb
Python
226
6
import muon as mu import scanpy as sc mdata = mu.MuData({"RNA": sc.read_h5ad(snakemake.input.merged_rna_anndata), "ATAC": sc.read_h5ad(snakemake.input.merged_atac_anndata)}) mdata.write_h5mu(snakefile.output.merged_multiome)
7d4ce576b9f1bc510d86476e1d14d350d9375a849ecd3441d373c2765a3b8191
Python
227
7
#replace the dictionary definition with one containing upper and lower bounds for each bounded input feature. boundslist = [] for i in range(2401): boundslist += [(0,2)] #each pixel has same limits #boundsdict[0] = (0,1)
1b69d265a803b38fe1442cd26288c604e172534f362bb9235feb1fc70361bbeb
Python
229
14
from . import counts from . import metrics from . import selections from . import transformations from . import validations __all__ = [ "counts", "metrics", "selections", "transformations", "validations", ]
33a7424b977be741737fd197ef1c8d91af92676c091422faeb2e63fa6a07870a
Python
229
7
""" Test files dedicated to individual (stand-alone) DataFrame methods Ideally these files/tests should correspond 1-to-1 with tests.series.methods These may also present opportunities for sharing/de-duplicating test code. """
27685021802f2fb83287c846f6bdd760f5faf652bb9c94b72081d99781444a3c
Python
230
8
""" Public API for DataFrame interchange protocol. """ from pandas.core.interchange.dataframe_protocol import DataFrame from pandas.core.interchange.from_dataframe import from_dataframe __all__ = ["from_dataframe", "DataFrame"]
3a03f20b5839591b2d5f43cb084980aac901954371388035c3a1cf2122095458
Python
230
7
#replace the dictionary definition with one containing upper and lower bounds for each bounded input feature. boundslist = [] for i in range(128*128): boundslist += [(0,1)] #each pixel has same limits #boundsdict[0] = (0,1)
7d8d6a8ba5031633d6d5be066b185c27db51010bba4972d920d77f572eb45d26
Python
231
7
from collections.abc import Sequence from typing import SupportsIndex, TypeAlias _Shape: TypeAlias = tuple[int, ...] # Anything that can be coerced to a shape tuple _ShapeLike: TypeAlias = SupportsIndex | Sequence[SupportsIndex]
9a3590fc7afed60766b9b0d77d824b2331c2c2587d921b43bffa678509019ca6
Python
232
8
## python setup.py build_ext --inplace from distutils.core import setup, Extension from Cython.Build import cythonize import numpy as np setup(ext_modules=cythonize(["cyPoisson_sim.pyx"]), include_dirs = [np.get_include()])
e02b66ce9af1269a9ac077ae71eca8bf7efb46c74a6e6e776a3356091aff49c6
Python
232
7
#replace the dictionary definition with one containing upper and lower bounds for each bounded input feature. boundslist = [] for i in range(128*128): boundslist += [(0,255)] #each pixel has same limits #boundsdict[0] = (0,1)
4114b951cb5560720d68b3fc55affed378d3039eaf539f073d82c9873cf7790f
Python
234
10
# Tests for MDAnalysis-calculated properties # Properties to test: COM, position of ions/DNA/mRNA - make this general #import pandas #import numpy #import pytest #import sbmlcore #def test_MDAnalysis_import(): #def test_pncA_COM():
ed5fcda3330032cf4c5735e6bfb24c155b64b66bf740a6940bab9f6f49abbd08
Python
235
9
"""Stub alternative CLI command for import_tilt_series job.""" from ._cli import cli @cli.command(name='alternative', hidden=True) def stub(): """Stub for an alternative to SerialEM tomo metadata import_tilt_series.""" pass
0b390d9fab0093d8245d86b421e9abb0849722a71a22a336516bc68b6bb60b7f
Python
237
11
from . import ansatz from . import blocks from . import chems from . import dataset from . import graphs from . import measurements from . import conversions from . import lattice from . import hamiltonians costfunctions = measurements
30684f6f245c8ab15783fb801b1c90feaf01932e99529059d271d741ae4b61df
Python
238
9
# ruff: noqa: TCH004 from typing import TYPE_CHECKING if TYPE_CHECKING: # import modules that have public classes/functions from pandas.io.formats import style # and mark only those modules as public __all__ = ["style"]
4ab1afda8799c5b2520143fea7dbca8555b2ce17e8c2317aab5fdcae99499c5d
Python
238
8
"""kani-utils package.""" import importlib_metadata try: __version__ = importlib_metadata.version(__name__) except importlib_metadata.PackageNotFoundError: # package is not installed __version__ = "0.0.0" # pragma: no cover
1d416fe2e9b28a9ef97a0b9bad5b9a1b9e8f17cf7b3a4e7e8d0fb29a79651d9f
Python
240
14
""" Created on Nov 22, 2024 @author: mning """ import pandas as pd def fSum(df: pd.DataFrame, chnName: str, numEl: int): tmpDF = df.filter(regex="(chnName)|*_Scale_*", axis="columns") colNames = tmpDF.columns.values return
664490d2429ff07aa0449791cf2876b1e3cbaa664916b5416fd41fa309cd13a0
Python
240
10
import os __version__ = "1.0.2.3-alpha.0" DATA_DIR = os.path.dirname(os.path.realpath(__file__)) + "/data/" STATIC_FILE = DATA_DIR + "waltzdb_export.csv" SEQ_FILE = DATA_DIR + "Atomic.csv" SEQ_MODEL_DIR = DATA_DIR + "models/sequential"
ad4c50c71cdb3e22a9df20c6c9ae83db1280ee5ba71922263859969a851c7b12
Python
240
14
""" Created on Jun 5, 2024 @author: mning """ import logging class logFilter(logging.Filter): def __init__(self, level): self.__level = level def filter(self, logRecord): return logRecord.levelno >= self.__level
1addbd325e13a0f48cf3c8f9e22bb8dd62adad4f40fa6a0fe1098c8a2ab379d5
Python
241
10
"""For when pip wants to check the date or time.""" import datetime def today_is_later_than(year: int, month: int, day: int) -> bool: today = datetime.date.today() given = datetime.date(year, month, day) return today > given
995c78e64683ee77e2239934db3e5633dd4ea447e15173acea0d734b45e00957
Python
241
9
import numpy as np import reza fs = 100.0 t = np.arange(0, 10, 1/fs) x = np.sin(2*np.pi*1.2*t) + 0.3*np.sin(2*np.pi*20*t) + 0.05*np.random.randn(t.size) y = reza.bandpass(x, fs, 0.5, 5.0) print("done", y.shape, "has_cpp=", reza.has_cpp())
e426e596df0f56266caa2a987cc752cfa6bf6c1501bb3b9743a17cb01b4a10c7
Python
241
10
"""module containing a test for testing""" from unittest import TestCase class TestTests(TestCase): """Test class for... tests...""" def test_if_tests_work_ok(self): """you know the drill""" self.assertEqual(1, 1)
04706940aa10bf81234f452958103e0a4e0be4eb0ca9323622e636e29fae7179
Python
242
11
"""Sub-package containing the matrix class and related functions. """ from . import defmatrix from .defmatrix import * __all__ = defmatrix.__all__ from numpy._pytesttester import PytestTester test = PytestTester(__name__) del PytestTester
307d8f6a1a5d8cb151faaddc63e0d4167dc1133cdc46434e6893cb382b18b0c3
Python
242
18
''' Created on 2018.8.29 @author: liangqian ''' class Pitch(): ''' classdocs ''' def __init__(self): ''' Constructor ''' self.name = '' self.frequence = 0 #midi index number just now
3e5d1e09baa1b69b69728736e08cd3e06c99fa31d034a28b15bdbe69289aed0f
Python
243
4
from .accuracy import accuracy, isfloat from .meter import WeightedMeter, AverageMeter, TotalMeter from .count_params import count_params from .prepossess import mixup_criterion, continus_mixup_data, mixup_cluster_loss, intra_loss, inner_loss
5458e4eca6f4dc3f92cbd6525d41be3d4ca54d0f4531ed6c2e6527f297267ff8
Python
245
13
# Re-export the tau-fitting API from internal module(s) from .scripts.calculate_tau import ( fit_single_exp, fit_single_exp_2d, func_single_exp, ) __all__ = [ "fit_single_exp", "fit_single_exp_2d", "func_single_exp", ]
9c05fe026e89a0bf64e77889fc28d927635c8c8a5acf6d47f3b9eb5b83a9d379
Python
246
5
""" The application codebase is related to research and previous version of tensorcircuit, the code inside is subject to change, be caution to use. Most of the useful code is and will be refactored and copied to other parts of tensorcircuit. """
5d6df93b68f3ae4d4332ed17018ad988a6e30dcfcb0db42b92aacd10fb796f52
Python
247
10
import torch class ModuleListInfo(torch.nn.ModuleList): def __init__(self, info_str, modules=None) -> None: super().__init__(modules) self.info_str = str(info_str) def __repr__(self) -> str: return self.info_str
a8243772c04107639121e25298b68408fefa6410dbe03189269c8dce592b7c99
Python
247
7
"""Passive visualisation tools for browsing RELION cryo-ET data.""" from .particles import combine_particle_annotations from .spheres import derive_poses_on_spheres from .filaments import get_poses_along_filament_backbones from ._cli import cli
4a9d213f5adb46b2aced2e51977cb008f949b45fcc422f5b8645bc8ecc64673c
Python
249
7
"""Example of how to save labeled images.""" from cali.util import save_labeled_images db_path = "tests/test_data/data_and_db_for_tests/test_db.cali" out = "/Users/fdrgsp/Desktop/cali_test/labels" save_labeled_images(db_path, out, overwrite=True)
0b7385bb4346c03cd0e0b3a69923853ec452be46c19fe99d7788ffe58a89c3eb
Python
250
13
from ._implementation import ( CyclicDependencyError, DependencyGroupInclude, DependencyGroupResolver, resolve, ) __all__ = ( "CyclicDependencyError", "DependencyGroupInclude", "DependencyGroupResolver", "resolve", )
7b485ccea0a33218592e8303051440b8a34310c2967dd0820cc3263d4caf0fea
Python
250
10
"""Randomized Watson Hamiltonian experiments""" # Don't import scripts automatically to avoid running them # Users should import explicitly if needed __all__ = [ 'fnn_compare', 'anharmonic_correction_sample', 'vib_random_hamiltonian', ]
74d072d80d6300954df768d2e82154b1c29286273f0e565c38c08bdbdbd020d2
Python
253
9
import mido from midi_functions import clear_all_notes # MIDI Output midi_music_out = mido.open_output('IAC Driver Music Port') midi_noise_out = mido.open_output('IAC Driver Noise Port') clear_all_notes(midi_music_out) clear_all_notes(midi_noise_out)
e2ab739cea0c99fecde2dfc527800d5fb2b0b539bf9f927cf188d4ec5c0d9843
Python
254
7
"""Contains benchmarking functionality""" from .benchmark_data_loader import BenchmarkData from .benchmark_metrics import BenchmarkMetrics from .benchmark_output import OutputGenerator __all__ = ["BenchmarkData", "BenchmarkMetrics", "OutputGenerator"]
f864c6d9552a929c7032ace654ee05ef26ca75d21b027b801d77e65907138b74
Python
254
10
# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from typing import Any, Callable, Tuple # Type annotations ParseFloat = Callable[[str], Any] Key = Tuple[str, ...] Pos = int
feafce79671e734496d54ab61427f9a70fce71fd9d4cee9f77616830ba6309f5
Python
254
9
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 28 22:52:40 2019 @author: sychoi """ vis_grayord_sigcorr(pval, rval, cf.outname, cf.out_dir, int(cf.smooth_iter), cf.save_surfaces, cf.save_figures, 'True', cf.bfp_path, cf.fsl_path)
d64fd65af8d3f5e0c34433aeb735c279bbd82a6feacda400dc6b8b9345646c92
Python
255
8
# # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from gunicorn.http.message import Message, Request from gunicorn.http.parser import RequestParser __all__ = ['Message', 'Request', 'RequestParser']
0f64697e48789a70190a45e0fc07872a4a8c3e62cd37ef6990c9ddbe7fa649e9
Python
256
12
from dataclasses import dataclass from typing import Optional @dataclass class RecordingConfig: mode: Optional[str] = "Manual" duration: float = 600.0 codec: str = "FMP4" MODES = ["Manual", "Timed"] CODECS = ["FMP4", "FFV1", "H264"]
0616b17f57d170301393e33def5261332a8ba1b1b7f6a2d35985e9f398f6bd20
Python
257
5
import os ROOT_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), '../../../')) DIAGNOSES = ["Pain", "Nausea/Diarrhea/Vomiting/Dehydration", "Anemia", "Neutropenia/Fever/Sepsis/Pneumonia"] CLASSES = ["CLASS_1", "CLASS_2", "CLASS_3", "CLASS_4"]
35a2d6fc94e228b82a3178a98eacf1167fb5c1d8a9b653b65b1381fca2b0c7de
Python
257
8
# # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. version_info = (23, 0, 0) __version__ = ".".join([str(v) for v in version_info]) SERVER = "gunicorn" SERVER_SOFTWARE = "%s/%s" % (SERVER, __version__)
4a4560f9d12038316452a80cd23dcaddfd4870bfdb60b8b049d0fc226654f9a2
Python
257
17
''' Created on 2014.11.25 @author: Liang Qian ''' #from tools import dbconnection as DB from tools import exdata as Data data = Data.EXDATA() curneuronindex = 0 SynapseNumberPerDendrite = 40 ProximalDendriteNumerPerNeuron = 1 f = open('fire.csv','w')
a923f10fc72c8a663d5f6053578c721a45e37aaacb6e56e6c909c40632e70b1e
Python
257
9
from setuptools import setup from Cython.Build import cythonize import numpy setup( name="get_distances_utils", ext_modules=cythonize("get_distances_utils.pyx", compiler_directives={'language_level': "3"}), include_dirs=[numpy.get_include()] )
029a7df0112b50c36b394308e0d89d0c0d5e254087ad8fa1985beed70e5ed9eb
Python
259
11
from dataclasses import dataclass from typing import Optional @dataclass class CameraConfig: camera_type: str = "Pylon" camera_id: Optional[str] = None config_file: Optional[str] = None fps: float = 30.0 video_file: Optional[str] = None
649559a340dc5c3b55e81014b8f00a6f0315f1a19f6b324b53b2f0ea546605cc
Python
259
10
import pytest from pandas import MultiIndex def test_pickle_compat_construction(): # this is testing for pickle compat # need an object to create with with pytest.raises(TypeError, match="Must pass both levels and codes"): MultiIndex()
c6808be525f29bcf69db22f3a529e565fd29cec992079ffbe4df6d82c5a7f220
Python
260
15
"""NQS for Vibrational Systems""" from . import opt_tools from . import nqs_vib from . import Selected_Configs from . import driver_ex from . import vib_ham __all__ = [ 'opt_tools', 'nqs_vib', 'Selected_Configs', 'driver_ex', 'vib_ham', ]
4d7dc691016df03dbf6fc06e61de8591e417b01ac5e47a84fa42fa97bbbdbb1b
Python
262
8
from __future__ import absolute_import from __future__ import division from __future__ import print_function from smac.env.multiagentenv import MultiAgentEnv from smac.env.starcraft2.starcraft2 import StarCraft2Env __all__ = ["MultiAgentEnv", "StarCraft2Env"]
db9ca1bfa146f922947293d845d982edb4efc52f07992bb7e1a8be49d8caf190
Python
263
11
from dataclasses import dataclass from typing import Optional @dataclass class PoseConfig: enabled: bool = False pose_model: Optional[str] = "V1 - SuperScorer" pose_device: str = "cpu" GRIMACE_MODELS = ["V1 - SuperScorer", "Demo (Fake Mouse)"]
11c67baf8e84af4a0b96359245f51dae14331e3d957ecf3cb41adffaba9088f5
Python
265
7
from __future__ import annotations # the peak detection is based on scipy.signal.find_peaks # https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html ECG_HEIGHT: float = 0.975 ECG_DISTANCE: float = 0.5 ECG_PROMINENCE: float | None = None
2b16c063ebecf8b0a1171b20ea5f0cc420ecedca321d3d19d992023458af73eb
Python
265
9
import torch from models.UnetModel4 import UNet3D def LoadModel(model_config, modelPath=None): model = UNet3D(**model_config) if not modelPath is None: ckpt = torch.load(modelPath) model.load_state_dict(ckpt['state_dict']) return model
5ede3b41a7022b062bbb38c38be80e06aef6e0945e0e3f429bdc548b97ebfb7e
Python
265
10
from typing import Any def load_ipython_extension(ip: Any) -> None: # pragma: no cover # prevent circular import from pip._vendor.rich.pretty import install from pip._vendor.rich.traceback import install as tr_install install() tr_install()
f9c2d7be1cee422d1731f53e35da934008abb8dd0c53d03d1c4da0a28ed9cc94
Python
266
9
from typing import Any from pandas import Index def allow_na_ops(obj: Any) -> bool: """Whether to skip test cases including NaN""" is_bool_index = isinstance(obj, Index) and obj.inferred_type == "boolean" return not is_bool_index and obj._can_hold_na
124c09b3c4b827703a3f18d9dc8706ed7e0f6ee8b840d2a9ef063fb424a65646
Python
267
11
from .jaccard import calc_jaccard_pair, calc_jaccard_sets from .adjacency import calc_ai_pair, calc_ai_lists from .dss import calc_dss_pair __all__ = [ "calc_jaccard_pair", "calc_jaccard_sets", "calc_ai_pair", "calc_ai_lists", "calc_dss_pair", ]
0db88494e21a35b6716c767a356e164178d6b5943316b28885403af27fc04919
Python
268
14
""" Logger Utility helpers for CLI tasks. """ import logging import sys def setup_logging(level: int = logging.INFO): logging.basicConfig( level=level, format="%(asctime)s [%(levelname)s] %(name)s: %(message)s", stream=sys.stdout, )
02b59342720a8710d568c2358f45a1829934722e9d3f49a95221b0311a8476d6
Python
270
15
from pandas.io.json._json import ( read_json, to_json, ujson_dumps, ujson_loads, ) from pandas.io.json._table_schema import build_table_schema __all__ = [ "ujson_dumps", "ujson_loads", "read_json", "to_json", "build_table_schema", ]
fe88fbe39278202b666d6664e90406548a7cbcbd93073a7e543936203a4ec6e8
Python
271
14
from __future__ import annotations import pytest from textstat.backend import counts @pytest.mark.parametrize( "text,expected", [ # TODO ], ) def test_count_faseeh(text: str, expected: int) -> None: assert counts.count_faseeh(text) == expected
4cae8e9ccae82e825fd4512a01cd6a56b6ac68a1d1c498deb7b34208d7454460
Python
272
13
import random import numpy as np import torch def setup(seed: int): torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False np.random.seed(seed) torch.cuda.manual_seed_all(seed) torch.manual_seed(seed) random.seed(seed)
9c21ac62af491ba8f3a6f009dff47cffd369fcc2da4dff5146fdf4d422175bdc
Python
272
10
from typing import Optional from app.config.video_files import VideoFilesConfig class VideoFilesConfigValidator: @classmethod def validate(cls, video_files: VideoFilesConfig) -> Optional[str]: if video_files is None: return "Config is null"
b7d77b3d66d011c8ef6fc52d6295e3b90a0dc5add4a91113e0da06b1d5b8afbf
Python
273
12
"""Contains modules for diagnostics""" from .logger import init_logger, init_logger_file, DisableLogger from .profiler import Profiler, calc_cpu_percent __all__ = [ "init_logger", "init_logger_file", "DisableLogger", "Profiler", "calc_cpu_percent", ]
365bb10a2e6beb5ee7461bb235e36267d2fc3d4e2e0e88b5ecb8c4f2ecb4a634
Python
275
9
# the dense layers for these multi outputs tasks dense_layers_config = { 'ChEMBL': [1563], # 1310 outputs 'ToxCast': [1024], # 617 outputs 'PCBA': [256], #128 outputs 'MUV':[512], #17 outputs 'SIDER': [128], # 27 outputs 'Tox21':[256], # 12 outputs}
53d855cf495383a5da4d11786d432062781ba7aa887b46c2b26717fe64ef90b7
Python
275
7
#!/usr/bin/env python3.7 """The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """
e3ceb9fadfbf50626a27170d9f7708484cbebd017cabb27e40ceb5cde512e02f
Python
277
15
from .scripts.spike_train_utils import ( bin_spike_train_fixed_len, simulate_hawkes_thinning, get_lv, get_trials, bin_trials, ) __all__ = [ "bin_spike_train_fixed_len", "simulate_hawkes_thinning", "get_lv", "get_trials", "bin_trials", ]
2b6ea1f798b67c0c91628aaa4b16fc11102973eaee26a8a6d3b923497e7c2529
Python
279
11
from dataclasses import dataclass from typing import Optional @dataclass class PoseTopConfig: show_preview: bool = False pose_model: Optional[str] = "V1 - GrimaceBoxTop" pose_device: str = "cuda:0" POSE_TOP_MODELS = ["V1 - GrimaceBoxTop", "Demo (Fake Mouse)"]
eca13d98b25ff53c7dd0631d2a3c47bb23abc5d672bd040a949876ff414bd7f5
Python
280
16
"""Contains enums for input parameters.""" # from python from enum import Enum class INPUT_MODE(Enum): FLAT = "flat" RECURSIVE = "recursive" class RUN_MODE(Enum): CLUSTER = "cluster" QUERY = "query" BENCHMARK = "benchmark" DEREPLICATE = "dereplicate"
d6d95fb22dda35d22ee6b34bbb131db90e1ebf06ef1b8c2ca52ae59530985d48
Python
281
12
""" Created on Oct 1, 2024 @author: mning """ from src.features.extract_entropy import extract_Entropy # extract_Entropy(op_Band="alpha") # extract_Entropy(op_Band="beta") extract_Entropy(op_Band="broadband") # extract_Entropy(op_Band="delta") # extract_Entropy(op_Band="theta")