sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fafb272d77a4c5f153b2489e4be692f8197db94d21364b5a03a94165ac51e91d
Python
14,847
319
import tensorflow as tf #import tensorflow as tf tf.compat.v1.disable_v2_behavior() import tensorflow.compat.v1 as tf import numpy as np from tqdm import tqdm from colorama import Fore import random import os import matplotlib.pyplot as plt os.environ["CUDA_VISIBLE_DEVICES"]="0" #Custom implementation of a hybrid de...
0bea8cc9dd5ffc56d0c8f1eb8f406943e0ae20afaeb9e1627d46829e0055e913
Python
14,868
342
"""regression test - the ported craniometrics has to give the same numbers as the old algorithm on the same mesh. baseline came from running the unmodified old CranioMetrics math against tests/fixtures/test_mesh.ply, see tests/fixtures/test_mesh_craniometrics_baseline.json for the details. tolerances aren't zero beca...
ede0346d65c239c07312d5361d515003458a274391825a3751deccdf78484c5b
Python
14,871
378
from sklearn.tree import BaseDecisionTree from sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor from sklearn.metrics import roc_auc_score from numpy import * import time from operator import itemgetter from multiprocessing import Pool def COMPUTE_GRN_AUROC(VIM, grn_true): import numpy as np ...
8d9f9cd83e37c9bdd9c2bcffbf2af0d2dd92b43084efc8ba38f90cced0b650a1
Python
14,877
341
import torch.nn.functional as F import torch import torch.nn as nn from utils import grid # ---------------------------------------------------------------------------------------------------------------------- # Baseline FNO: code from https://github.com/neural-operator/fourier_neural_operator # ---------------------...
0efbb70f9e21fde4e7e186700200cde25b8ed95511678322faa4c32cdf269aec
Python
14,878
415
import unittest import subprocess import glob import datetime import os import torch from shutil import copyfile from rfdiffusion.inference import utils as iu from rfdiffusion.util import calc_rmsd import sys, json script_dir = os.path.dirname(os.path.abspath(__file__)) class TestSubmissionCommands(unittest.TestCase...
fed3b12f8e9712440fe0fc0938a993a83769985dbbcb07408f347688c93602bb
Python
14,893
416
import json import uuid from contextvars import copy_context from typing import Any, cast import pytest from langchain_core.callbacks.manager import ( AsyncCallbackManager, CallbackManager, atrace_as_chain_group, trace_as_chain_group, ) from langchain_core.callbacks.stdout import StdOutCallbackHandler...
640c0182cf329eb7257bcd0ac8a7a07eba5d0d18f6924318f3fda2bd7c032992
Python
14,900
380
from collections import OrderedDict import csv from logging import Logger from random import Random from typing import List, Optional, Set, Tuple, Union import os from rdkit import Chem import numpy as np from tqdm import tqdm from .data import MoleculeDatapoint, MoleculeDataset from HMSA.args import PredictArgs, Train...
3d4fb24fb7cd6a46355ce647f2281dfad6e3dd45fb8051b1a8fd786753c2dc1b
Python
14,908
343
# -- coding: utf-8 -- # @Time : 2023/3/12 21:34 # @Author : Biao Zhang # @Email : littlebiao@outlook.com # @File : analysis_utils.py # @Description: This file is used to ... import pickle import numpy as np import scanpy as sc, anndata as ad import scipy.sparse as sp import pandas as pd import sys import matplotlib.p...
722dca01eb6ab0713fff9158e71faa7bedfdd9b127893d427812f428da91f397
Python
14,912
375
""" Class for generating datasets with different properties. :Version: 2.0.0 :Date: 04.07.2018 :Author: Jan Melchior :Contact: JanMelchior@gmx.de :License: Copyright (C) 2018 Jan Melchior This program is free software: you can redistribute it a...
d39ffd43bba4095424a695dbb68efdfa6cbe228e533b3c2edda1fba60f0c4013
Python
14,926
345
import argparse import logging import os import random import shutil import sys import time import numpy as np import torch import torch.backends.cudnn as cudnn import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tensorboardX import SummaryWriter from torch.nn import BCEWithLogitsLos...
8b86615b8652881439a3a5b76461201c5571016c79c6725e3db1e022bcb198ae
Python
14,934
443
# dataloader for RGAN # Created: 6/16/2021 # Status: ok import copy import glob import json import os import random import sys # from typing import Literal import nibabel as nib import numpy as np import pandas as pd import torch from torch.utils.data import Dataset from utils import read_csv_cox_ext as read_csv_ext...
ffba4ee0dcfe027cd5d2bc8b0891a6c50161f0f56c9ede1fefdbccf9b7658733
Python
14,937
329
""" Adapted from: https://github.com/karpathy/nanoGPT/blob/eba36e84649f3c6d840a93092cb779a260544d08/model.py """ import math from dataclasses import dataclass import torch from torch import Tensor import torch.nn as nn from torch.nn import functional as F from mat2seq import CIFTokenizer @dataclass class GPTConfig:...
5a0000d179c76e9d83e24e25702e0737655806e8067440a1a6e3afcaf0bb8ecb
Python
14,958
366
import albumentations as A from albumentations.pytorch import ToTensorV2 from joblib import Parallel, delayed from torch.utils.data import DataLoader from modulable_CNN3D import CNN3D import os import torch from torch import nn import numpy as np from skimage.io import imread, imsave from src.napari_svetlana.CustomDa...
abe6b532f1f181f518809f8be8ec43b3485492f33b9d800ff016def7ca686ea3
Python
14,962
438
""" Evaluate a flow-matching checkpoint on a data split (default: test). Uses ``ChgFlowMatchingModule.predict_coeffs`` (Euler CFM integration by default) then ``orbital_inference`` for nMAPE — same probe chunking as ``scdp/scripts/test.py``. Euler time grids: ``--integrate_schedule uniform|endpoint_refine|power`` (se...
17304e08f26045d4a8b14ab522eec35875cb323e457205f20d2e305e88acca60
Python
14,992
321
import torch from CEL.networks.models.meta_model import ModelClass from torch.autograd import Function from itertools import chain from copy import deepcopy from tqdm import tqdm from torch.func import stack_module_state from torch.func import functional_call from einops import rearrange, reduce, repeat, pack, unpack i...
7dddb90575b68f209128a7a7aa44a2b0d5646fe85057bca203ade63523330998
Python
15,001
431
"""Model utilities for torch implementation.""" import copy import time import math import torch from ._torch_linalg_utils import ( one_hot_encoding, matern_type_kernel, matrix_inv_cholesky, matrix_block_indexing, matrix_trace_of_product, matrix_blockdiag_rotation, matrix_block_trace, ) def get_hyperpar...
60f6418377faee7a2c33ae478215407dae2960de7cbee89af4bcff643b20eb7c
Python
15,010
409
""" ############################################################################## # # Cluster the set of alternatively spliced exons # # AUTHOR: Maciej_Bak # AFFILIATION: University_of_Basel # AFFILIATION: Swiss_Institute_of_Bioinformatics # CONTACT: wsciekly.maciek@gmail.com # CREATED: 26-03-2020 # LICE...
fe13df8ffb2f7b40ec3aa2910718375895984a946006df86a60ac11f53f13cda
Python
15,019
407
"""Retriever that generates and executes structured queries over its own data source.""" import logging from collections.abc import Sequence from typing import Any from langchain_core.callbacks.manager import ( AsyncCallbackManagerForRetrieverRun, CallbackManagerForRetrieverRun, ) from langchain_core.document...
105f5a254c2b1af875b52c2416d5df98590c1392a6f5b627d9e23b5eaaca7375
Python
15,028
338
from torch import nn import torch import math class GCL(nn.Module): def __init__(self, input_nf, output_nf, hidden_nf, normalization_factor, aggregation_method, edges_in_d=0, nodes_att_dim=0, act_fn=nn.SiLU(), attention=False): super(GCL, self).__init__() input_edge = input_nf * 2...
2b014e58599b8de43d35b0d660ca9476722dfb086b81aac18a8f6c5fce9ced87
Python
15,056
432
''' morphological helper functions for app.py import to app.py and use morph_with_none, sec_coordinates, stem2plot, sec2stem = morph_lib_creator.create() to create needed libraries of default morphology. ''' import numpy as np import pickle import json def map_sec2stem(morphology): '''create sec->stem dict...
a33f0ae51326864b1b72e58aec807ef74e81252767da4adf996e934dbf192f94
Python
15,084
449
# -*- coding: utf-8 -*- """ This file defines a set of functions useful for working with pandas dataframes full of tabular data """ import numpy as np import pandas as pd import logging from itertools import groupby from sklearn import preprocessing import torch from torch.utils.data import TensorDataset logger = log...
46db79dbf56973a821dfdcb864d7715d549b4387a46699f01c152122c0ce3c45
Python
15,085
332
import torch from torch import nn from nnsegnext.network_architecture.neural_network import SegmentationNetwork import numpy as np from copy import deepcopy from timm.models.layers import DropPath class ConvDropoutNormNonlin(nn.Module): def __init__(self,input_features,output_features,conv_kwargs,dropout_op_kwargs...
9fdf29e5ce140a8ebbc28fb57b78ff6e571ded7090f16a624ec7fcc9eec488e6
Python
15,094
459
"""Neural networks for all experiments.""" import snntorch from snntorch import surrogate import torch class RLIF(torch.nn.Module): """Simple spiking neural network in snntorch.""" def __init__(self, timesteps, hidden, num_output): super().__init__() self.timesteps = timesteps self.hi...
12d1cf5d2724c5710e8e6001406fb5af81dd00a21980fcab0639cf82f1db01ca
Python
15,107
307
"""in-memory session store - one uploaded mesh + whatever state it's in, per session. actual pipeline work runs on a background thread pool so the request doesn't just hang there for minutes. kept this deliberately simple, no redis/celery/database. this is a single-process tool (either the desktop app or a small inter...
982e668737599df3a4cf88d6127d19c745be2a0920c9a9e6f4bb4abe6c2b7923
Python
15,120
438
# Copyright 2021 AlQuraishi Laboratory # Copyright 2021 DeepMind Technologies Limited # # 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 # # U...
df1b3c3ea0e6fdc15ade2ea64fa55f80b8ba03014779e9a5ba92d0ffeaaa8f36
Python
15,158
344
"""tests for metopic.py. there's no clinical baseline for any of this (see metopic.py's module docstring) - these check the math against synthetic contours with known shapes instead: a plain fitted parabola (should recover its own coefficients and read ~zero deviation everywhere), a bump added at a known position (sho...
d8d64046e2e758ab6e43ef4d6f9e48078993f47bff83b8d25638d10b1cc4baa3
Python
15,182
349
import argparse import logging import os import random import shutil import sys import time import numpy as np import torch import torch.backends.cudnn as cudnn import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tensorboardX import SummaryWriter from torch.nn import BCEWithLogitsLos...
94e84b082667876ab2f604328b02d92a6758f9e99f7faa0b7d4139a905e1a680
Python
15,186
342
# coding: utf-8 """ MIT License """ ''' Project: Parenchymal Attention Network Authors: Axel Masquelin Description: ''' # Libraries # ---------------------------------------------------------------------------- # from argparse import Namespace from sklearn.model_selection import train_test_split from torchi...
3a2f87802b5b4368c761713cf6734920416c36f571da2e644ca7107c0b7b8bab
Python
15,195
344
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
ccc9d3d12911d1c65560f8b4b6ab12c98e24770b6017b717056278c56c712283
Python
15,209
492
# Copyright (c) <2021> <University of Paderborn> # Signal and System Theory Group, Univ. of Paderborn, https://sst-group.org/ # https://github.com/SSTGroup/independent_vector_analysis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated d...
62bb5160d183790ab14fb262c73482dc7d30e4e48d792e5a854d0e793270935f
Python
15,211
630
import json from collections.abc import AsyncIterator, Iterator from typing import Any import pytest from pydantic import BaseModel, Field from langchain_core.exceptions import OutputParserException from langchain_core.output_parsers.json import ( SimpleJsonOutputParser, ) from langchain_core.utils.function_calli...
49d35a0ef81d9591432ba89d3713c982ebc7f588dbbca856a9fd0cabe7369446
Python
15,213
352
# coding=utf-8 from pyexpat import features import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F from alg.modelopera import get_fea from network import common_network from alg.pl_algs.base import Algorithm import numpy as np import...
414ee253336747239113b6b0d47b883c3b7f2d486e7d1b866b574b617e07805a
Python
15,216
343
import torch import torch.nn as nn import torch.nn.functional as F from models.FNO import MLP2d, MLP3d from utils import grid ################################################################ # 2d radial fourier layers ################################################################ class radialSpectralConv2d(nn.Module...
d107d8af1adb009c012b78dc6a3b699e450a6cbbff258b4889fa547a1ddbbfc1
Python
15,217
387
# Copyright (c) <2021> <University of Paderborn> # Signal and System Theory Group, Univ. of Paderborn, https://sst-group.org/ # https://github.com/SSTGroup/independent_vector_analysis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated d...
fc80f21bef47eea5b888d1020fe89835010c2e20cdc29a5d0980d4d3810f4920
Python
15,221
402
import numpy as np import networkx as nx from tqdm import tqdm from copy import deepcopy from scipy.sparse.linalg import eigsh from scipy.sparse import coo_matrix, csr_matrix, identity from scipy import sparse from numpy.random import randn import os import random import torch from torch_scatter import scatter_sum, sca...
ae6a2ed54bd42a5aacb96b86fce9c86bc101dfceaa590f226f27bfcae403eec8
Python
15,235
431
#################################################################################### # # STEPS - STochastic Engine for Pathway Simulation # Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan. # Copyright (C) 2003-2006 University of Antwerp, Belgium. # # See the file AUTHORS for detai...
2cbbecfacef18cd57b1ab11fddc61259f313aab896404efea4a79b65dcc70518
Python
15,236
433
"""File search middleware for Anthropic text editor and memory tools. This module provides Glob and Grep search tools that operate on files stored in state or filesystem. """ from __future__ import annotations import fnmatch import json import operator import os import re import subprocess from contextlib import sup...
1735e2ecb3be098af204c074aecb897d865172b57adf4710ddd0fd77d0550ec7
Python
15,243
316
''' Count chronic stats of a mouse 8/30/2022 ''' import os import json import re import datetime import traceback from collections import OrderedDict # import typing import shutil import numpy as np import matplotlib.pyplot as plt import matplotlib import pandas as pd # font = {# 'family' : 'monospace', # # 'w...
dbab0467c78e8adb6d4321cb0f69424bba2b3dd5a7531206da91205de678f9eb
Python
15,261
400
"""Chain that makes API calls and summarizes the responses to answer a question.""" from __future__ import annotations from collections.abc import Sequence from typing import Any from urllib.parse import urlparse from langchain_core._api import deprecated from langchain_core.callbacks import ( AsyncCallbackManag...
0dc4075ff9c30752db9ec9797c313ad1c79d33a799a334d4ce73fd96ceeed9a6
Python
15,265
390
# Copyright 2024 DeepMind Technologies Limited # # AlphaFold 3 source code is 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...
3c90ca5c158a8c3e8d8f9a9ee6a84c6a0286c17900b55b897c14dd76ad47803d
Python
15,267
456
"""Data loaders for the de novo sequencing task.""" import functools import logging import math import os import pathlib from typing import Optional, Sequence import lightning.pytorch as pl import numpy as np import pyarrow as pa import spectrum_utils.spectrum as sus import torch.utils.data._utils.collate from depthc...
05e4c85bacc078313b355a13fb51cbe2c264ee81f3fda2a0c5e53328f8befc4b
Python
15,279
453
# Copyright Generate Biomedicines, Inc. # # 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 ...
852347a530ee29e11b5e1d5dfef4f981e4bc2bfacea0099c855be5f6dc0802c0
Python
15,280
329
import re import hashlib import pathlib import itertools import subprocess import collections import unicodedata from pybtex import errors, database import attr from csvw import dsv from csvw.metadata import ForeignKey, Datatype from cldfbench import Dataset as BaseDataset from cldfbench import CLDFSpec from cldfcatal...
bcd5bf68468cbe7798882c3663f4f6713355a5fa3ac9860fb22d241b510e5d14
Python
15,281
416
#!/usr/bin/env python import pysam import argparse, sys import math, time, re from collections import Counter from argparse import RawTextHelpFormatter __author__ = "Colby Chiang (cc2qe@virginia.edu)" __version__ = "$Revision: 0.0.1 $" __date__ = "$Date: 2015-04-22 09:31 $" # -------------------------------------- #...
955325d3c2c7105130e0e47b20458ee3ea9656af9a2de838cff64f3c03430435
Python
15,290
360
import tensorflow as tf from tensorflow.keras import backend as K import numpy as np from utils.utils import read_mrc,prctile_norm from scipy.interpolate import interp1d import numpy.fft as F from scipy import asarray as ar, exp from scipy.optimize import leastsq, minimize, curve_fit import math def create_psf_loss(ps...
df9da316d32c998fa0bd1b531b00c64fb816e37b672206996baecc02daa78e37
Python
15,290
436
#################################################################################### # # STEPS - STochastic Engine for Pathway Simulation # Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan. # Copyright (C) 2003-2006 University of Antwerp, Belgium. # # See the file AUTHORS for detai...
83cf6b9bc1d92184a9b389528f2e82b375d3689abff8bf7f4c109f8c8bc5502c
Python
15,294
477
"""Module to generate networkx graphs.""" """Implementation based on the template of Matformer.""" from multiprocessing.context import ForkContext from re import X import numpy as np import pandas as pd from jarvis.core.specie import chem_data, get_node_attributes # from jarvis.core.atoms import Atoms from collections...
11b60961d1d08db75238f0beeb8e6e68eda475b09f8e5c40396a79d03a5be3de
Python
15,306
436
#################################################################################### # # STEPS - STochastic Engine for Pathway Simulation # Copyright (C) 2007-2023 Okinawa Institute of Science and Technology, Japan. # Copyright (C) 2003-2006 University of Antwerp, Belgium. # # See the file AUTHORS for d...
d01507060c76f90969e457ba757cef891c84bbc0ec503e974da6e78be0b13062
Python
15,319
397
#################################################################################### # # STEPS - STochastic Engine for Pathway Simulation # Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan. # Copyright (C) 2003-2006 University of Antwerp, Belgium. # # See the file AUTHORS for detai...
e766a81446bd232fa3b8d82e881de7c16b3be27cb7d00019ae3839742b3625f6
Python
15,319
447
"""Training and testing functionality for the de novo peptide sequencing model.""" import glob import logging import os import tempfile import uuid import warnings from pathlib import Path from typing import Iterable, List, Optional, Union import lightning.pytorch as pl import numpy as np import torch from depthcharge...
7d8d03fefeca1ab4160bd5655bb9f677a7044541a653315425c7691b40224208
Python
15,321
414
# Copyright (c) MONAI Consortium # 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, so...
3dd69549734e519b5a15baf83d0624e141fa6f87d99134566b5a5c0e2010f54b
Python
15,336
378
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this sof...
75ad6473e49145774dc83d3d372da0a54cde1bc5586d99b901b92675a326a160
Python
15,338
322
import torch from CEL.networks.models.meta_model import ModelClass from torch.autograd import Function from itertools import chain from copy import deepcopy from tqdm import tqdm from torch.func import stack_module_state from torch.func import functional_call from einops import rearrange, reduce, repeat, pack, unpack i...
5cac4269f702cafac55fdb0b89c7afa1f93eb82a652216da153b514dceedf796
Python
15,348
353
"""Dataloaders for genomics datasets, including pretraining and downstream tasks. - Adapted from: https://github.com/huggingface/transformers/blob/master/examples/pytorch/language-modeling/run_clm.py - Adapted from: https://github.com/HazyResearch/flash-attention/blob/main/training/src/datamodu...
72feec8061d353611d8c478375cee175fd7a2034e182d9f4d049e458295b027b
Python
15,350
318
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ POCIF-BAT R2 — H-R2-2, H-R2-3 et H-R2-4. H-R2-2 L'écart d'ordre est structuré et prédictible sur permutation non vue. H-R2-3 Le modèle généralise à une précédence absente de l'entraînement. H-R2-4 La contrainte de complète positivité améliore la prédiction. Protoc...
42669e55daee58c822ed04319014a1fae8369b3a63aaee387ad1acf6cf809bf5
Python
15,355
432
"""Chain that just formats a prompt and calls an LLM.""" from __future__ import annotations import warnings from collections.abc import Sequence from typing import Any, cast from langchain_core._api import deprecated from langchain_core.callbacks import ( AsyncCallbackManager, AsyncCallbackManagerForChainRun...
62a6a43ebdca336e5115cf143cc44ec7a8924a483ef7c1896e916dbd33a0c925
Python
15,393
304
########################################### # IMPORTS ########################################### from openmmtools.states import SamplerState, ThermodynamicState, CompoundThermodynamicState from simtk import unit, openmm from perses.dispersed.utils import compute_potential_components from openmmtools.constants import k...
7431b43a30f7fd9f1eb1d15fc82c4850d8d18940ad502e0cea3e6081be05301a
Python
15,393
304
########################################### # IMPORTS ########################################### from openmmtools.states import SamplerState, ThermodynamicState, CompoundThermodynamicState from simtk import unit, openmm from perses.tests.utils import compute_potential_components from openmmtools.constants import kB fr...
736c19f01723b07c394fd824e887bbfd7383852725a88f7620d2fb1c28d98654
Python
15,395
567
import torch from EPI_MRI.utils import m_plus from abc import ABC, abstractmethod class LinearOperator(ABC): """ Abstract class to define operations of LinearOperator subclasses. A LinearOperator object must define methods for multiplication and transpose multiplication. """ @abstractmethod d...
a97d2f5b1a322e35944c21f7a7c724a8547eaacfc5af94c0fca475f881b6c5b3
Python
15,395
456
######################################################################## # Well-mixed chemical reactions. # AIMS: to verify STEPS well-mixed stochastic solver 'Wmrssa' computes # reaction rates correctly when many different chemical species and # reactions are present in the model. # This model combines all well...
33a6d4971f06778d07f199725908add42f7b2af8b3fc43746333468a5c5acbd9
Python
15,401
265
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
11cddddc20866a121c8510c887202604f2d0df4bd43742f3dac27bee8087a1d7
Python
15,402
456
######################################################################## # Well-mixed chemical reactions. # AIMS: to verify STEPS well-mixed stochastic solver 'Wmdirect' computes # reaction rates correctly when many different chemical species and # reactions are present in the model. # This model combines all we...
3778dc772b1c324572684176fc72c10c0783feca04b82711bf950e3d729bfdbf
Python
15,412
379
import sys;sys.path.append('../src/') import pylab import spiketools import defaultSimulate as default from copy import deepcopy from bisect import bisect_right from matplotlib.ticker import MaxNLocator import pandas as pd import pickle from joblib import Parallel, delayed import numpy as np # Local modules (not instal...
54ae9fdfa40ae8e0fbb7b0d7647b87ce642a3c654c996173f45f51770f18f140
Python
15,412
456
######################################################################## # Well-mixed chemical reactions. # AIMS: to verify STEPS well-mixed stochastic solver 'Wmrssa' computes # reaction rates correctly when many different chemical species and # reactions are present in the model. # This model combines all well...
ca9461add1abc5fb57f3b2b01066756e8bd5035afb08b1a1d1d41c6f66bdeac8
Python
15,417
402
import logging import platform import tempfile import time from pathlib import Path import numpy as np import pytest from matplotlib import pyplot as plt from astrocast.clustering import HdbScan, Linkage, Distance from astrocast.helper import DummyGenerator class TestHdbscan: def test_plain(self): dg =...
e3abe155040b224a82dfdafcff07cc2386d0d2700600cff40f171aacd1ba8cba
Python
15,419
456
######################################################################## # Well-mixed chemical reactions. # AIMS: to verify STEPS well-mixed stochastic solver 'Wmdirect' computes # reaction rates correctly when many different chemical species and # reactions are present in the model. # This model combines all we...
87eabb638165db0fdca6955f28ace0eb85a9e509bab0a7de59bf8223b5d49a5c
Python
15,434
389
# Copyright 2023 DeepMind Technologies Limited. All Rights Reserved. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
7a37b989b25e4d36f0b92dde0294812db96f66fea96c0ad4307f45efa057ba45
Python
15,437
316
import torch from CEL.networks.models.meta_model import ModelClass from torch.autograd import Function from itertools import chain from copy import deepcopy from tqdm import tqdm from torch.func import stack_module_state from torch.func import functional_call from einops import rearrange, reduce, repeat, pack, unpack i...
c60658ccdc6be6728005cc5178b5448d5c994c3c9e9068243c96189e27cfd97d
Python
15,437
421
"""Tool retry middleware for agents.""" from __future__ import annotations import asyncio import time import warnings from typing import TYPE_CHECKING, Any from langchain_core.messages import ToolMessage from langgraph.errors import GraphBubbleUp from langchain.agents.middleware._retry import ( OnFailure, R...
31a5ef341c4128a2d45c35482626a7e977e01ae75f6db43eac2d672d02ef44db
Python
15,438
404
import torch import torch.nn as nn import torch.nn.functional as F import math from opt_einsum import contract as einsum from rfdiffusion.util_module import init_lecun_normal class FeedForwardLayer(nn.Module): def __init__(self, d_model, r_ff, p_drop=0.1): super(FeedForwardLayer, self).__init__() s...
c8d8e52499a5490d487fc2f310f49df22c18e3f70efe91f5c2b54a541a57b1ea
Python
15,438
434
#################################################################################### # # STEPS - STochastic Engine for Pathway Simulation # Copyright (C) 2007-2023 Okinawa Institute of Science and Technology, Japan. # Copyright (C) 2003-2006 University of Antwerp, Belgium. # # See the file AUTHORS for d...
fd7390ffc6ca8272526820e865d7458f62638d33e6fd5c9ccc33c6f710b504a0
Python
15,438
459
######################################################################## # Spatial chemical reactions. # AIMS: to verify STEPS spatial deterministic solver 'TetODE' computes # reaction rates correctly when many different chemical species and # reactions are present in the model. # This model combines all validat...
02976491071c613ff8f8e8dc0327bac895cdc40b3094cc50491a797aba357520
Python
15,442
438
"""unit tests for src/craniumpy_core/cohort.py - pure function tests, no FastAPI needed, same style as test_reporting.py testing the underlying math/IO directly. api/routers/cohort.py's own request/response plumbing is covered separately in test_api.py.""" from __future__ import annotations import io from pathlib imp...
2796b86d1be786a859eec407572460d98ca647e594fb8cbe866cc3b386f27273
Python
15,450
466
import logging import os import mxnet as mx import numpy as np import scipy.stats import pickle from ..utils import * class IdentityOp(mx.operator.CustomOp): def __init__(self, logging_prefix="identity", input_debug=False, grad_debug=False): super(IdentityOp, self).__init__() self.logging_prefix=lo...
69e76d8e4548791efe098ed3a511fbb4b06bad5bcef5ca560c72d62915094895
Python
15,454
484
"""Base classes for scoring the output of a model on a scale of 1-10.""" from __future__ import annotations import logging import re from typing import Any from langchain_core.callbacks import Callbacks from langchain_core.language_models import BaseLanguageModel from langchain_core.output_parsers import BaseOutputP...
b3db6c0270728ad70692c50220a5c333cf855e238c01cce224c31b2228f530a4
Python
15,455
459
######################################################################## # Spatial chemical reactions. # AIMS: to verify STEPS spatial deterministic solver 'TetODE' computes # reaction rates correctly when many different chemical species and # reactions are present in the model. # This model combines all validat...
692dcf343cddbe893c6386a7e0ecab62a3830289dd724a68413beac97d662d7f
Python
15,458
410
""" Helper functions for use with our topic heatmap visualization Jupyter notebook Authors: Lexie Li, George H. Chen """ import matplotlib import numpy as np import os import pickle import re import matplotlib.pyplot as plt from matplotlib import colors import seaborn as sb import warnings matplotlib.rcParams['pdf.fon...
1e40b5953ddbb91b9fdea629ddc6aee18e5d6dbc57b243000e7c998755b68a46
Python
15,463
371
from __future__ import division import multiprocessing as mp import itertools as it import numpy as np import scipy from scipy.special import factorial, comb as nchoosek import logging LOG = logging.getLogger(__name__) IMAG_CONST = scipy.sqrt(-1) PI_CONST = np.pi NAN_CONST = np.NaN def nested_loop(stack, args): ...
8d8109eb96eb485e69fed732853ac1d4f9c2de03c457878e2d8eaa5898f68f08
Python
15,467
481
import csv from pathlib import Path import matplotlib.pyplot as plt import numpy as np import time from typing import Any, Dict, Union, Tuple import pickle as pk import os import torch.distributed as dist import torch from jarvis.core.atoms import Atoms from jarvis.db.jsonutils import dumpjson, loadjson from torch ...
683bc1c9922b6104e4b9b6fa4760b1bbdde36740eea8ded132a43913b6ba0db3
Python
15,471
490
''' PipelineTransfacMatch.py ======================== - Classes and functions used in pipeline_trasfacmatch.py ========================================================= ''' ################ # import modules ################ import re import os import sqlite3 import collections from cgatcore import pipeline as P impor...
a64506ed9b6ede9f9a1b4b2047cc9d3ebc9b8372849b1725a23099ee50dd3165
Python
15,493
464
import os import sys import re import types import itertools import matplotlib.pyplot as plt import numpy import numpy.ma from ChipseqReport import * import Annotations from cgatReport.Tracker import * ########################################################################## #########################################...
83dccdddba2736947f987b10caa5505d4d3ef990d9964ee16080678005acae00
Python
15,495
382
""" This module contains functions to run the compliance checks in parallel""" import argparse import sys import time from pathlib import Path from typing import Iterable, Union from MRdataset import load_mr_dataset, MRDS_EXT, DatasetEmptyException from mrQA import check_compliance from mrQA import logger from mrQA.c...
ed7e1df1b7d62617daacfdbc7b816b6719ecf81556be70d1de89365395ae46e6
Python
15,505
427
import keras from keras.models import Sequential, Model, load_model from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda from keras.layers import Conv2D, MaxPooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D from keras.layers import GRU, BatchNormalization, LocallyConnected2D, Permute from keras.l...
0e07b36e6a8a216f1111de48c899d7464311400263ee02e0b65c26b9596595d1
Python
15,506
434
#################################################################################### # # STEPS - STochastic Engine for Pathway Simulation # Copyright (C) 2007-2023 Okinawa Institute of Science and Technology, Japan. # Copyright (C) 2003-2006 University of Antwerp, Belgium. # # See the file AUTHORS for d...
fbfb23fcdb4eb7692158426db055cd502bbd2584a4b146adbcc4de84ba0de261
Python
15,524
446
# Copyright 2021 AlQuraishi Laboratory # Copyright 2021 DeepMind Technologies Limited # # 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 # # U...
2e37ab7af3a2a4977e87612d8ed59a59f6d89e15f3723371ced170ccdc4de491
Python
15,530
468
""" Codes borrowed from Open Catalyst Project (OCP) https://github.com/Open-Catalyst-Project/ocp and https://github.com/yuanqidu/M2Hub/ (MIT license) --- This code borrows heavily from the DimeNet implementation as part of pytorch-geometric: https://github.com/rusty1s/pytorch_geometric. License: --- Copyright (c) 2...
dca1e724b2ef40a5a045bd4cf2902e128e1006c5e77e130a664d77f44d4e1abe
Python
15,533
357
"""Planning and task management middleware for agents.""" from collections.abc import Awaitable, Callable from typing import Annotated, Any, Literal, cast from langchain_core.messages import AIMessage, SystemMessage, ToolMessage from langchain_core.tools import InjectedToolCallId, StructuredTool, tool from langgraph....
ab2d47d04ba16db95463af4810030fde91c46b722728774ae51032cbe56212c0
Python
15,535
382
# coding=utf-8 """Includes TestMetrics which tests the metrics class of vulcanai.""" import pytest import numpy as np import torch from vulcanai.models.metrics import Metrics from vulcanai.models.cnn import ConvNet from torch.utils.data import TensorDataset, DataLoader import pandas as pd import os # noinspection PyP...
818f0e885a2da20836e2dfd3b4a2c6e5879a986669dfcce550e11860ebd56250
Python
15,537
404
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 18 16:54:08 2021 @author: shni2598 """ import numpy as np import matlab.engine import mydata #%% class MUA_findchangepts: def __init__(self): ##self.stim_dura = None self.dt = 0.1 # ms self.mua_sampling_in...
c45b5296b379b74ba0c2ac6439bce50d9f07441bca28148135a6614bd45c9d73
Python
15,540
345
# Copyright Generate Biomedicines, Inc. # # 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 ...
36aa4a88fdfc6c77be77561c61e30fb5fa2b28f5562d0fbe9529a59cc5cadaf1
Python
15,547
419
import pickle import math import os from .normalizer import Normalizer from .tokenizer import Tokenizer from .data_helper import DataHelper class SpellCheck: def __init__(self): self.normalizer = Normalizer() self.tokenizer = Tokenizer() self.data_helper = DataHelper() ...
72a79041c93fa030336c8021d4c133ca938506f0f2b233d47ff8e8d317ca803c
Python
15,547
326
""" Functions required for initializing the circuit. The DSS circuit is set up along with the bus and branch objects. The Graph model of the DSS Circuit is also instantiated here. """ import win32com.client import numpy as np import math import networkx as nx class DSS(): # to initialize the DSS circu...
ded6f1bbd3628abd7fc9d8be23241e0d810e4f54cf485f3bdf2765e574d2fa75
Python
15,552
422
# Copyright 2022 AlQuraishi Laboratory # # 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 i...
a482052b38d5aa78944778448bc0d90287b948de2c3083110ff2a9e4a478d173
Python
15,561
340
import matplotlib.pyplot as plt import matplotlib.patches as patches import itertools from Simulator.SimulatorPattern import simulatorPattern from Simulator.SimulatorPatternDual import simulatorPatternDual from matplotlib.lines import Line2D from Articles.Sequential_Learning_Striatum.Code.FigureSequential import * num...
095e5ce5b186ef11929bdfe3cfd4d7100115e9cd33fab2cae93705866892e1f7
Python
15,568
412
# Copyright Generate Biomedicines, Inc. # # 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 ...
ef548c29d72191acfddfe1a945ba7fe0856b89b5d7ca2df92519965d87b11ed3
Python
15,573
324
"""tests for clipping.py. test_clip_plane_keeps_positive_normal_side and test_clip_sphere_keeps_inside pin down the sign conventions - checked these against real pyvista behavior first, getting this backwards would silently cut away the wrong half of a head and you'd never notice from the code alone. the cranial_clip/...
58fe58e416baae482872eb0489da64c3b5a37de83c649270a1ffb14b4486cfbd
Python
15,581
404
# code adapted from https://github.com/arneschneuing/DiffSBDD/blob/main/process_crossdock.py from pathlib import Path from time import time import argparse import shutil import random import matplotlib.pyplot as plt import seaborn as sns from tqdm import tqdm import numpy as np from Bio.PDB import PDBParser from Bi...
538681ac91d6ddc6fb28c06d57b1ff71c786f7db3bd4e4c0a0ef2b8dbd74fdf0
Python
15,587
477
"""Unique methods used within db-search mode""" import functools import logging import os import re import string from pathlib import Path from typing import Dict, Iterator, Pattern, Set, Tuple import depthcharge.constants import depthcharge.tokenizers import numpy as np import pandas as pd import pyteomics.fasta imp...
828766d133f2b8753aabfbada5d1e80a4f2aec821f32d98cf1a135214a7144ef
Python
15,592
367
# -*- coding: utf-8 -*- import os import copy import odl import torch import numpy as np from math import ceil from tqdm import tqdm from warnings import warn from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter from torch.optim.lr_scheduler import CyclicLR, OneCycleLR from dival...
dfc0ea1b06e610a316993dae5da01e8d75f0f4eea664499c2ea05f11a56b0f3f
Python
15,595
420
import logging import numpy as np import pandas as pd import scipy.linalg as la from helpers.data import assert_normalized def get_phenotype_array( phenotype_df: pd.DataFrame, subjects_subset_list: list, morphometricity_subject_measure: str, ) -> np.array: """ Returns a normalized array with val...