sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1c9e6b15a1c0f93b58099f21513ac1560539773c34f6d9b81db66911fcc34122
Python
166
3
from .dpm_solver import DPMSolverDiffuser from .general import VariancePreservingDiffuser, VarianceExplodingDiffuser from .score_dynamics import ScoreDynamicsDiffuser
5a32247c3e63e03c774154bafbe44b99ca7a154fa09d1aa97a29ba601ee63a72
Python
168
7
def metapipeline( pipelines: list, close: bool = True, adgile: bool =True ) -> None: for p in pipelines: p.pipeline(close=close, adgile=adgile)
a42c1fc8641d6b529858367149d9300bf9d434c9790e59723f53725e556e4dcd
Python
169
3
from .session import Session, SessionCollection from .med_associates import parse_ma_session, parse_ma_directory from .tdt import parse_tdt_session, parse_tdt_directory
2f2ed2a0418f48875114201c2263bf7b1ff06bc26bec35428f745ba05b9c4a04
Python
170
6
# -*- coding: utf-8 -*- # The standard library now has an interruptible pool from multiprocessing.pool import Pool as InterruptiblePool __all__ = ["InterruptiblePool"]
72c4f7872049399609ce454b430394a7cc5092fb6a9562fa2822811312668dec
Python
170
9
from setuptools import find_packages, setup setup( name='DXGB', packages=find_packages(), version='0.1.0', author='Jianing Lu', license='gpl-3.0', )
13d7c7324a901372f276f4f8d21d06627b208321733e023000a6429aaa972a89
Python
171
6
import pandas import sys df = pandas.read_csv(sys.stdin, sep=' ') df[df["fdurGP"].notna()].to_csv(sys.stdout,sep=' ',index=False) #df.dropna(thresh=1).to_csv(sys.stdout)
1bd6d7f4b160367808edc6e9ed0fb9e0677e350567cc74520be768828d0811b9
Python
172
7
import sys import pandas as pd df = pd.read_csv(sys.stdin, sep=' ', keep_default_na=False) gb = df.groupby('sentid') for _, _df in gb: print(' '.join(list(_df.word)))
592725317b77523cc3de79c09034fe53f2de2075a250d996d84fe0152bb05b38
Python
172
2
from .mlp import build_mlp_model, build_lr_mlp_model, build_smlp_model, plot_mlp_model, PlotMLPCallback, MLPNetwork, MOVotingRegressor from .al import CompositionGenerator
eb6d50c5d5765af3998a8812557c6f56b6576b001355e6079742b3e1be034080
Python
173
8
# import stuff from placerg.funcs import * from placerg.funcsrg import * from placerg.funcsall import * from placerg.objects import * from scipy.optimize import curve_fit
397da2a4400eb266cdceca30c427c3bc82c562e24eb4635c0d9e150e6ab1520e
Python
174
6
#!/usr/bin/env python3 """Compatibility entry point; accepts the same options as run_end_to_end.py.""" from run_end_to_end import main if __name__ == "__main__": main()
5850bc40020935a6b50d7cdffb5ba59eb66f3b3a002302f1d4f7e53e83711ac8
Python
174
7
""" Public API for function executor engines to be used with ``map`` and ``apply``. """ from pandas.core.apply import BaseExecutionEngine __all__ = ["BaseExecutionEngine"]
bf317fe890a3b9807ab617043e8858d732d026a8d373b4e50c7c020190b90f8a
Python
174
6
__all__ = ['ModelBase', 'ModelEDNN3D', 'ModelStacked', 'ModelTwin'] from .ModelBase import * from .ModelEDNN3D import * from .ModelStacked import * from .ModelTwin import *
e6038ddab94fd7ac31129920da283fee0224f4c7eff69d3fc1216a5ed6b8ceb7
Python
174
10
"""Gradec: Meta-analytic gradient decoding.""" from . import decode, fetcher, plot, segmentation __all__ = [ "segmentation", "decode", "fetcher", "plot", ]
ca778d5295eb9bfe01ed59b0eeb21f12a0a80f6076f1162fe45b8cb30e561e6e
Python
175
4
from evcouplings.complex.protocol import * from evcouplings.complex.alignment import * from evcouplings.complex.distance import * from evcouplings.complex.similarity import *
08baedf081eb3adcfe56c1e9222d67cc71c4270a8c0b7b895b36854d308cd348
Python
177
7
"""Pre-built denoising algorithms.""" from mrpro.algorithms.denoiser.total_variation_denoising import total_variation_denoising __all__ = [ 'total_variation_denoising', ]
0f68350bf33ed333161c6d2ca0c3ca84dc8095858c8250badabec016c11bcb60
Python
177
10
# -*- coding: utf-8 -*- from collections import namedtuple __all__ = ["Model"] Model = namedtuple( "Model", ("log_prob_fn", "compute_log_prob_fn", "map_fn", "random") )
33d2a29dd1ef30da5e0eac3d090ac0abd33f064640f0fcbe7da1099791812ab2
Python
179
11
from __future__ import annotations import os import sys sys.path.append('.') sys.path.append('..') sys.path.append('../../') path = os.path.abspath(os.path.dirname(__file__))
fceb44f05fd0bde6cd82e0a5f17269254edd1ceba71c0e51ca3e5e3a60bf1d0e
Python
179
8
from . import config from . import control from . import data from . import models from . import server from . import simulations from . import timeseries from . import utilities
2f77f2a38629f3f104e184140f7ea279c44b2837de40cff37bd93013e79e1563
Python
181
4
"""Module contains code for LDA analysis.""" # Define package version. # This is read dynamically by setuptools in setup.cfg to determine the release version. __version__ = "0.0.1"
ad7952953bf3c74f8907df22405c41faa274827758b2551b41ccc22ffd2216c1
Python
181
4
from pycaret.internal.display.display import CommonDisplay, DummyDisplay from pycaret.utils.generic import enable_colab __all__ = ["CommonDisplay", "DummyDisplay", "enable_colab"]
be3d120a6feb0518d60940397434ad44c0f575093ac6304c84ad4f665a66d01a
Python
181
8
"""Calling cards data analysis in Python""" from pycallingcards.datasets._datasets import ( SP1_Cre_data, SP1_K562HCT116_data, mouse_brd4_data, mousecortex_data, )
fe059edc44b5cf3eeeafd85548fa53d1cc879bbc2f29375b055720f38376e358
Python
185
7
import sys import pandas as pd df = pd.read_csv(sys.stdin, sep=' ') network = int(sys.argv[1]) df = df[df.network == network] df.to_csv(sys.stdout, sep=' ', index=False, na_rep='NaN')
ced5115a05136299eecf7b0798e1a9c0b5efdcfd9657b73c16660a836b78a208
Python
186
11
import numba.cuda def start_profiling(do_prof): if (do_prof): numba.cuda.profile_start() def stop_profiling(do_prof): if (do_prof): numba.cuda.profile_stop()
e44a120b4906b611db259b71705da0032805c7d640d8760e3a99f48bfe7fe5a7
Python
186
11
"""Calling cards data analysis in Python""" from pycallingcards.reading._read import ( combine_qbed, read_barbodes, read_qbed, read_rna, save_bed, save_qbed, )
48fa7d8391e2fef29ee37b0b914e70cbbee0ac49389dfaa169334650f11b294f
Python
187
3
from .modek_product import modek_product, modek_fold, modek_unfold from .m_product import mprod, mtran, facewise, t_eye from .transformation_matrices import dct_matrix, random_orthogonal
c787335b6cb0935e8164d1d1a5cc78f3299c680198629c64a958981fccfc56c2
Python
189
8
# b2b_synchrony/__init__.py from .EEG_device import EEG from .bispectrum import bispec from .stopwatch import timer from .graphs import Graph __all__ = ["EEG", "bispec", "timer", "Graph"]
0efea898456a04dcdc8394830e15ff732cedf30623ab735bb92be6987ce8abc0
Python
191
8
from pandas.tests.extension.decimal.array import ( DecimalArray, DecimalDtype, make_data, to_decimal, ) __all__ = ["DecimalArray", "DecimalDtype", "make_data", "to_decimal"]
92ea760fa71da70156e8a671e34eac161620ba5fa47e5826749fc35504322564
Python
191
8
import numpy as np from skimage import morphology as morpho, io as skio, filters, util, measure import tube2 import align from cine import Cine from sklearn.ensemble import IsolationForest
9b8175e6e2b88a4606de423cafe7f642435550bde2b97c36426a5b3f63cf235a
Python
192
7
__all__ = ['data', 'evaluation', 'test', 'utils', 'nn'] from windseer import data from windseer import evaluation from windseer import test from windseer import utils from windseer import nn
3d9873b5b1936972d33861d9daf73b9cfb10ec6d0f71a258fa8fa0e7e5e4fb0f
Python
193
7
""" Benchmarks in this directory should depend only on tslibs, tseries.offsets, and to_offset. i.e. any code changes that do not touch those files should not need to run these benchmarks. """
8257de5841dcfa75a4449ca10d381cf41195d63f1172c4eed7195132c722200c
Python
193
9
from pathlib import Path from ecgdigitize.image import openImage import ecgdigitize image = openImage(Path('lead-pictures/002-49853179.png')) print(ecgdigitize.estimateRotationAngle(image))
a1acab699f1655dea65e1083a38e2db2a626de6ebc109c3070253145ccc784b6
Python
194
5
from evcouplings.align.alignment import * from evcouplings.align.pfam import * from evcouplings.align.protocol import * from evcouplings.align.tools import * from evcouplings.align.ena import *
fcc793aa23e4abc30178934cbe4052760eacf0ffc817ecc587c9260fc2940104
Python
195
11
"""Fixtures for CLI tests.""" import pytest @pytest.fixture def parser(): """Full CLI argument parser.""" from lightning_pose.cli.main import _build_parser return _build_parser()
060bb7530849fbb1786161fb779d80f62ae70c71e40283c9248f995b7264b78e
Python
200
12
import os import sys import matplotlib.pyplot as pl import numpy as np # sys.path.prepend(os.path.abspath(os.path.join(__file__, "..", "..", ".."))) # import emcee def plot_acor(acorfn): pass
7e24d47166292b1bf3277ff4128cd7947cf6abc80d3dde87336ccba6ba20552a
Python
202
5
from evcouplings.compare.ecs import * from evcouplings.compare.distances import * from evcouplings.compare.mapping import * from evcouplings.compare.pdb import * from evcouplings.compare.sifts import *
1281a5261d732b091b292a8279fb88722f9fd54128e6cc43e53dd56413f0b388
Python
203
9
import sys import configparser config = configparser.ConfigParser() config.optionxform = str config.readfp(sys.stdin) split_ids = config['data']['split_ids'] print(' '.join(split_ids.strip().split()))
9c42e48532ca3a491e78f247837f47f73b9d36d14470aaaafa99e51d336b56a7
Python
203
9
# -*- coding: utf-8 -*- from .aggregator import SumAggregator, ConcatAggregator, NeighAggregator Aggregator = { 'sum': SumAggregator, 'concat': ConcatAggregator, 'neigh': NeighAggregator }
556bcace8d28ae24e28a6c6e7b154ddb76e287b8775e579d4ef6adf9e44684fa
Python
205
6
"""Public API for loading trained models and running predictions.""" from lightning_pose.api.model import Model from lightning_pose.api.model_config import ModelConfig __all__ = ["Model", "ModelConfig"]
0d44c7221ff36e22af4e61553b24d55cf81c6dfbfb3fe67f4cf2e24b70af4363
Python
206
4
from .block_matrix import BlockMatrix # noqa: F401 from .dm_dataset import MatrixDataset # noqa: F401 from .dm_element import MatrixElement # noqa: F401 from .dm_filter import MatrixFilter # noqa: F401
0f85190ec558a5985192773b94301a19e75986fa56a6353fb8dd593ce969ab33
Python
208
8
from .ecgdigitize import \ estimateRotationAngle, \ SignalDetectionMethod, \ SignalExtractionMethod, \ digitizeSignal, \ GridDetectionMethod, \ GridExtractionMethod, \ digitizeGrid
510ce6e43bda9e737a586ebb0fc34535e0511d72a15404f7b44d0a84a11d3810
Python
210
4
# MOFTransformer version 2.0.0 from moftransformer.datamodules import datamodule, dataset from moftransformer.datamodules.dataset import Dataset from moftransformer.datamodules.datamodule import Datamodule
cd6661ab6cb65a30e876fbc79c8445ce2eaaddbffa4401f41e6065a77e00fe38
Python
210
8
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Created by Roberto Preste from mtoolnote.mtoolnote import annotate __author__ = """Roberto Preste""" __email__ = "robertopreste@gmail.com" __version__ = '0.2.0'
06d5f7d30ebc402428bb4962cc43f56e75236f8b1000de5f1cff2fcfab380159
Python
211
11
import datetime __version__ = "0.6.0rc1" __author__ = "Junshen Xu" __copyright__ = f"{datetime.date.today().year}, {__author__}" __email__ = "junshen@mit.edu" __url__ = "https://github.com/daviddmc/NeSVoR"
2c9b89ba9704956ba8df2eddc24d7555db10e41c6dcc19c925bce8b9208d285b
Python
212
5
from .core import Pipeline # noqa: F401 from .dataslot import Dataslot # noqa: F401 from .filter import Filter # noqa: F401 from .filter_ray import FilterRay # noqa: F401 from .plot import Plot # noqa: F401
78404f09ad00f5ba143e64c5bc3770486945d67a67b1d9a7958a2c09d9308313
Python
213
9
from .bias_field import n4_bias_field_correction from .masking import ( brain_segmentation, stack_intersect, volume_intersect, otsu_thresholding, thresholding, ) from .assessment import assess
e855535735c0eda4598b5da73d1c2f49ed39bbf8ce0e752f0f4a6604d5a15932
Python
214
9
from brand import Booter if __name__ == '__main__': # parse command line arguments args = Booter.parse_booter_args() kwargs = vars(args) # Run Booter booter = Booter(**kwargs) booter.run()
bf6cae03d5086519b72338c8fd8acacfdc89bcedb60827cc9fddfca5ea294985
Python
215
6
class BaseLoader: def read(f): raise NotImplementedError("Reading is not implemented for this type") def write(f, data): raise NotImplementedError("Writing is not implemented for this type")
97365d8c8c6bae3a5c183cbe8062c58c18c87ae66763ced78aae8edfe7ca5f82
Python
217
10
# -*- coding: utf-8 -*- # Import classes and functions from sub directory # from sdna.net.core import * from sdna.net.functional import * # Add classes from directory # from sdna.net.net import * __all__ = ['Net']
c2bad9a9aef5f032259f8a68afa8a4474e32040b3497070958e13a368ed46347
Python
217
5
from evcouplings.couplings.mapping import * from evcouplings.couplings.model import * from evcouplings.couplings.pairs import * from evcouplings.couplings.tools import * from evcouplings.couplings.mean_field import *
9885f1331d4f0ad5d08216bf72d0e9333fad89de8749d177feb403a1d57246a8
Python
218
6
from .DropDownMenu import DropDownMenu from .SelectPKLFile import SelectPKLFile from .SelectSub import SelectSub from .SelectSes import SelectSes from .SelectAcqlab import SelectAcqLab from .SelectROI import SelectROI
da0dbf06030c947479fd7b5d2677912c890422728ae63503a233868a8618ed55
Python
219
6
from evcouplings.visualize.parameters import * from evcouplings.visualize.pairs import * from evcouplings.visualize.mutations import * from evcouplings.visualize.misc import * from evcouplings.visualize.pymol import *
8cc242cc569b1c363ff0f9b175ca155d42356ec2791c89d8984570631d3cfd5a
Python
220
8
from os.path import dirname, basename, isfile, join import glob modules = glob.glob(join(dirname(__file__), "*.py")) __all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py') ]
1fd1a6233059023da65c4c766f6b99295805b39150b989afc6b87ffc3ac781a4
Python
221
7
import warnings # suppresses plotnine warnings warnings.filterwarnings('ignore') from .heatmap import heatmap from .gene_profile import gene_profile from .n_es_genes import n_es_genes from .save_as_pdf import save_as_pdf
38af4f6481622751ab2e9a6528727a815e597e17b1db43ff6afbdd3b9657cdce
Python
221
7
from pandas.core.arrays.arrow.accessors import ( ListAccessor, StructAccessor, ) from pandas.core.arrays.arrow.array import ArrowExtensionArray __all__ = ["ArrowExtensionArray", "ListAccessor", "StructAccessor"]
88c7f6f186f4d6440a8727d1e6331ce1c2644230320881d97bcf5194a8bb6b17
Python
222
8
r""" This package contains math utils for articulated body system including 3D rotation representation conversion, spatial math, etc. """ from .general import * from .angular import * from .spatial import *
1540accf5481c6d546964b63ea026e1c9ff3b66a0ae08a0dd0dbbc14eb435719
Python
225
7
import sys import pandas as pd df = pd.read_csv(sys.stdin, sep=' ') df['startofsentence'] = df.sentpos == 1 df['endofsentence'] = df.sentpos.shift(-1).fillna(1) == 1 df.to_csv(sys.stdout, sep=' ', index=False, na_rep='NaN')
fe6e7218cc6ed0136e9e93a13ea618ca2cea5f22a02b962ff4524cbc49e69897
Python
225
10
""" This is a placeholder test to allow pytest to pass. Without this pytest exits with non-zero exit code which fails the build. """ def test_always_pass(): """A placeholder test that always passes.""" assert True
c02b8407a9c54cd8b234dfb421595183dd38e01c0d040a58b8ae4a857b2860c9
Python
226
6
# License: see [LICENSE, LICENSES/legged_gym/LICENSE] import os LEGGED_GYM_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) LEGGED_GYM_ENVS_DIR = os.path.join(LEGGED_GYM_ROOT_DIR, 'legged_gym', 'envs')
52e29e4c5b2d7092014bad233df1aa4dd343bba84f1063574435b5cf4b544a22
Python
229
17
import numpy as np def linear(x): return x def linear_deriv(x): return np.array([np.sum(np.eye(x.shape[0]), axis=0)]).reshape(2, ) def tanh(x): return np.tanh(x) def tanh_deriv(x): return 1 - tanh(x) ** 2
f086547350cb747ee714749f80ae1cec4a1d6af86e2db2c89f519fbed5f31f9a
Python
229
7
from dataknead import Knead # Convert from JSON to TOML Knead("input/entity.json").write("output/entity.toml") # Convert from TOML to JSON Knead("input/example.toml").write("output/toml_example.json", indent = 4, default = str)
0e82c5faab949d8d1a1db56086973b8d943d93ed13ad153fc56fedc3147a507e
Python
230
4
from .fully_connected import FullyConnected from .resnet import ResNet, AntiSymmetricResNet, HamiltonianResNet from .t_fully_connected import tFullyConnected from .t_resnet import tResNet, tAntisymmetricResNet, tHamiltonianResNet
7ccdaafc400cc77f3b7d56840cd0ece09dd914129d1da940d020aad3659aedce
Python
230
12
from setuptools import setup setup( name='registration', version='', packages=['py-lddmm', 'py-lddmm.base', 'py-lddmm.Misc'], url='', license='', author='younes', author_email='', description='' )
e9bb6fa80f8713be7d545eec4cab77d4163e9975045952b2a9d889e9d6f2b415
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__ = ["DataFrame", "from_dataframe"]
e6dd08d9772d2dede155da1e26342446d029157fd3b3cd57bc303a4a43cfd492
Python
231
6
from evcouplings.fold.tools import * from evcouplings.fold.cns import * from evcouplings.fold.filter import * from evcouplings.fold.restraints import * from evcouplings.fold.protocol import * from evcouplings.fold.ranking import *
2f49cc37a8d98ea4c16ee9711986464325b2e1769a01665bdd2bb6d80da4bdb5
Python
232
4
if __name__ == '__main__': from .estimate_nexi_noiseless import estimate_nexi_noiseless from .estimate_nexi import estimate_nexi from .powderaverage.powderaverage import powder_average, save_data_as_npz, normalize_sigma
62fe1e5bc3ddd5e4b2d2f97b65ea6726d44d97d1021e37db5de1a3254bca34ec
Python
233
13
import sys sentid=0 print('word sentid sentpos') for line in sys.stdin: sentpos=1 line = line.split() for word in line: print(word + ' ' + str(sentid) + ' ' + str(sentpos)) sentpos += 1 sentid += 1
ef76a404b5616dc79107341e8ca339c904735a40c362082cfbc431ea2ad3e6fa
Python
234
10
""" Timeseries API """ from pandas._libs.tslibs.parsing import guess_datetime_format from pandas.tseries import offsets from pandas.tseries.frequencies import infer_freq __all__ = ["guess_datetime_format", "infer_freq", "offsets"]
94225f3292c4c6c7ad59b58b54fb004e9f108815ee872b25df5fe4764d05f7ec
Python
235
7
"""Report generator for qc command. """ import os from atropos.commands.legacy_report import LegacyReportGenerator class ReportGenerator(LegacyReportGenerator): template_path = os.path.join(os.path.dirname(__file__), 'templates')
e59f3c6ad10e5a7d1dee34f12f14bd3fec7d72d7e06150594c62a2bc51a4fec3
Python
235
9
import sys for line in sys.stdin.readlines(): sline = line.split() for i in xrange(len(sline)): if sline[i][0].isalnum(): sline[i] = sline[i].lower() sys.stdout.write(' '.join(sline)+'\n')
b303432573df4365427cdcc65ba7bcb6b42b1ce176378d1ae993eba8555b41b1
Python
236
5
from .log import auto_log from .configs import PROJ_DIR, OUTPUT_DIR, MODEL_DIR, DATA_DIR, FIG_DIR, SAVE_DIR from .cache import obj_to_version, load_cache, save_cache, cache_return from .data import load_data, load_model, augmente_data
0bd65766297124b889f7003c2a95406e9d39e866123eec61489f8ae479dd5e0a
Python
237
7
from trainers.cnn_trainer import CNNTrainer from models.cnn.model import CNN from models.neural_main import neural_main from models.cnn.args import get_args if __name__ == '__main__': neural_main("CNN", CNN, CNNTrainer, get_args())
592d05615bd7a71524449c6d3d9af0dbdfa8e06aace81a3c2e9a928c411874c2
Python
237
7
"""Report generator for trim command. """ import os from atropos.commands.legacy_report import LegacyReportGenerator class ReportGenerator(LegacyReportGenerator): template_path = os.path.join(os.path.dirname(__file__), 'templates')
721508df388bfc8c6499255325aa7da267b7a5d2e0374dfcc5e782009ec72d57
Python
237
9
# ruff: noqa: TC004 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"]
d4ee5a730b59d6198fb659c46e63f6eba7fa22ded987ab6f402174a48386236e
Python
238
17
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 2 17:02:44 2021 @author: jeanbaptiste """ VALID_TRANS_CHANNELS = ['Trans'] VALID_FLUO_CHANNELS = [ 'CFP', 'DAPI', 'GFP', 'RFP', 'YFP' ]
32151123b9f567bebe873a86103d2c578eeba315e70522fab2bc00e867ca2ca3
Python
240
9
""" ScanOMetrics: python package for personalized brain image analysis """ _version_major = 0 _version_minor = 1 _version_micro = 1 _version_pre = '' __version__ = '%d.%d.%d%s' % (_version_major,_version_minor,_version_micro,_version_pre)
35877f120164cb0dbe89e2e21e81e39ad61488b5c1b19760157cf099b245329f
Python
240
10
# flake8: noqa from .alpha import estimate_alpha, read_alpha from .p_c import estimate_p_c, read_p_c from .p_e import ( estimate_p_e, estimate_p_e_control, estimate_p_e_nasc, read_p_e, ) from .pi import estimate_pi, read_pi
165f9d4976e0d8129987fe5edc5a2f84c4c5b76a588c291c0827cb8e8724d6e1
Python
242
5
# MOFTransformer version 2.0.0 from moftransformer.utils.prepare_data import prepare_data from moftransformer.utils.install_griday import install_griday, uninstall_griday __all__ = ["prepare_data", "install_griday", "uninstall_griday"]
5594d93d978b73a19e51834a7251ab6a86c70267322b3a02291244115e029357
Python
242
12
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_core.ipynb (unless otherwise specified). __all__ = [] # Cell import os import numpy as np import torch import random import pkg_resources from rxnfp.models import SmilesClassificationModel
8d75095c8ec1b5640434bb4a6a08986797f8ee58c2099c1fa10edf961b0b05eb
Python
243
13
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 13 12:19:36 2020 @author: reisertm """ from .model import * from .crop_generator import * from .improc_utils import * from .customLayers import * from .Augmenter import *
c60252e80582b65e8c1b321a0f59d5bbce6229d1ea705122d1963f3c4101838d
Python
245
7
from trainers.lstm_trainer import LSTMTrainer from models.lstm.model import LSTM from models.neural_main import neural_main from models.lstm.args import get_args if __name__ == '__main__': neural_main("LSTM", LSTM, LSTMTrainer, get_args())
de0db4264ec31bb499ed6990d80d68362ad5e4122f100dbef60856ebaa59622b
Python
247
17
#! /usr/bin/env python import random from sys import argv infile=argv[1] k=int(argv[2]) L = [] with open(infile,"r") as f: for line in f: L.append(line.rstrip()) L1 = random.sample(L,k) for item in L1: print(item)
529ae9b23b46ed1c62293c72ca0cdb829f6463fe7abe12e34884504352ddc494
Python
248
11
from setuptools import setup, find_packages setup( name="sbrnet_core", version="0.1", packages=find_packages(), install_requires=[], author="Jeffrey Alido", author_email="jalido@bu.edu", description="Sbrnet project", )
727517cd657cbcacb63d43cd7a204a6d3ae25b491202189830d7963180c3fa44
Python
248
13
import sys sys.path.append('.') from CommonSystem.Config import Config from UICreator.UIFactory import UIFactory config = Config() config.stiLEN=1 factory = UIFactory(config) frames = factory.getFrames() factory.saveFrames(frames)
f6666719b999400f395ce9f530a07e8572d955a3ba84d87b33435a3ce79ec7b1
Python
249
9
__all__ = [ 'HDF5Dataset', 'interpolation', 'generate_turbulence', 'process_dataset', 'utils' ] from .generate_turbulence import * from .HDF5Dataset import * from .interpolation import * from .process_datasets import * from .utils import *
e66c194f47b9ae8638a40b62786ac63dd000464ee8eedd695511a728b8281702
Python
250
7
import matplotlib as mpl from .cumulative import plot_cumulative_events from .raster import plot_event_raster # set some matplotlib parameters mpl.rcParams['pdf.fonttype'] = 42 # turn on true-type fonts, provides better editing of PDF/Illustrator
066ddbbc00cbd5e43aabc0a7c381fe7936e4433bad6a27645d143a1ffa829699
Python
251
7
from models.bert.args import get_args from models.bert.model import BERT from datasets.scar_bert import SCARBERT from models.transformer_main import transformer_main if __name__ == '__main__': transformer_main("BERT", BERT, SCARBERT, get_args())
67ba0ac1c08550017f8f7a5f7616d3a7f71789bebe093fa8e31baddc6cd499ab
Python
251
10
import sys import pandas as pd df = pd.read_csv(sys.stdin, sep=' ') gb = df.groupby("docid") for _, df_doc in gb: print("!ARTICLE") gb_sent = df_doc.groupby("sentid") for _, df_sent in gb_sent: print(' '.join(list(df_sent.word)))
aaf9ff883265b6f525b0ebdbf44a1bef80c48f5365b1d169b613fda0b0e76aa9
Python
251
8
from dataknead import Knead def parse(data): books = data["catalog"]["book"] data["catalog"]["book"] = [b for b in books if b["author"] == "O'Brien, Tim"] return data Knead("input/books.xml").apply(parse).write("output/obrien-books.xml")
ef0c355c80de9a5a31fe80328d6cac03fa448178fc0a3570177ee8a297a9e1df
Python
251
7
from biophysics_fitting.setup_stim import setup_BAC def BAC_injection(cell, dist = None): ''' This injects the BAC stimulus as defined in Hay et. al. 2011 at a specified distance. ''' setup_BAC(cell, dist = dist) return cell
ac244c7534baceeb429b8b953778bebae100766b83151f0c1b18902ff22285fe
Python
253
4
from .mouse_ens_to_human_ens import mouse_ens_to_human_ens from .mouse_symbol_to_mouse_ens import mouse_symbol_to_mouse_ens from .human_ens_to_human_symbol import human_ens_to_human_symbol from .human_symbol_to_human_ens import human_symbol_to_human_ens
e3bad2e1dea523857c63965684c61c478890570697dfe2ca54385123ab13ea05
Python
253
11
"""Smoke tests for the multimodal_ad package foundation.""" import multimodal_ad def test_version_is_set() -> None: assert multimodal_ad.__version__ == "0.1.0" def test_package_importable() -> None: assert multimodal_ad.__doc__ is not None
6e56db2ff0edf049802108cd679af9442c7c5af7aaed4c822d4aaa3a8d4b93f8
Python
254
14
#!/usr/bin/env python """ File: __init__.py Date: 5/1/18 Author: Jon Deaton (jdeaton@stanford.edu) Brain Tumor Segmentation 2018 Data Set """ import warnings warnings.simplefilter(action='ignore', category=FutureWarning) from BraTS.DataSet import *
451cbfb0d086c9d6c3d80600bdb18560679139da97fa772608c3684fa078aaae
Python
255
9
import numpy as np from .meshes import Mesh class ImageVarifold(): def __init__(self, source=None, weights=None, image=None): super(ImageVarifold, self).__init__(mesh=mesh, weights=weights) if image is not None: self.ima
68564b0ee7636207d19ade0cc82d3de72d6dc8599107ab9fce1b2b4f1141cf42
Python
256
9
""" Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ from .mri_data import SliceDataset from .volume_sampler import VolumeSampler
4ed618e46dbb38bdef1d76669e1429ca82790c4a763be6a8bb4d6de96dd53577
Python
258
9
from os.path import dirname, basename, isfile, join import glob from .MFGEcoliDataset import MFGEcoli modules = glob.glob(join(dirname(__file__), "*.py")) __all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py') ]
5601cbd8983eec9434e4a49ccae7ca3edd02c97802125a8c60051539d13cc2a8
Python
258
9
from .helper import ( relative_image_difference, dotproduct_adjointness_test, operator_isometry_test, linear_operator_unitary_test, autodiff_test, gradient_of_linear_operator_test, forward_mode_autodiff_of_linear_operator_test, )
7cf69becc50a56368ff8c485745ee92f6376e892c0bedf4fd5bb196015297b2c
Python
258
7
from shapeout2 import util def test_get_valid_filename(): assert util.get_valid_filename("KLµ123$)]") == "KLu123-))" assert util.get_valid_filename("..KLµ123$)].") == "KLu123-))" assert util.get_valid_filename(". KLµ123$)]") == "_KLu123-))"
fdbf480b7c0789f1c4b553e61232c8e98c9a2cc0c3371a1760dc10aeb4566fc3
Python
258
11
from setuptools import find_packages, setup REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()] setup( name="src", packages=find_packages(), version="0.1.0", python_requires=">=3.9", install_requires=REQUIREMENTS )
53e091a1656721d12a872bb479c9ed64e58ab349a2f6cace9ce25e33912002a0
Python
260
14
__all__ = ['save_json', 'load_json'] import json def save_json(data, file, **kwargs): with open(file, "w") as f: json.dump(data, f, **kwargs) def load_json(file, **kwargs): with open(file, "r") as f: return json.load(f, **kwargs)
d3cdce19dbee40a997281033f137bc69ee1c7fdfb0e8cdfc0d62fb9b02c96c65
Python
262
15
""" .. module:: tool_common :platform: Linux, Windows :synopsis: Common constants used by tools .. moduleauthor:: Fredrik Nysjo """ TOOL_PLANE_X = 0 TOOL_PLANE_Y = 1 TOOL_PLANE_Z = 2 TOOL_MODE_2D = 0 TOOL_MODE_3D = 1 TOOL_OP_ADD = 0 TOOL_OP_SUBTRACT = 1