sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c385ad2dc948d7ffab0035ffb1c36cf03153d4aa871c988c5cf844ece59e3739
Python
19,819
510
from pathlib import Path from typing import Dict, List, Optional, Union import numpy as np import torch from pytorch_lightning import LightningDataModule from torch.utils.data import random_split from torch_geometric.loader import DataLoader from torch_geometric.data import InMemoryDataset, Data from sklearn.utils im...
f8a3ae3ce75d3aa8810511e0bfaf15b98077cb37e22ce13bbfeb40a6da7355bf
Python
19,821
338
"""Early validation, subject isolation and reuse after cache cleanup.""" from contextlib import nullcontext import json import os from pathlib import Path import signal import subprocess import sys import tempfile import time import unittest from unittest.mock import patch import torch import run_ddsurfer_pipeline a...
9c9550aaf986db4bba69241b6f4a57a984bb7825a807ae76edec0fd2f19889f8
Python
19,858
418
import copy import numpy as np import pandas as pd import torch from transformers import AutoTokenizer, AutoModel import spacy class TransformerRSM(object): def __init__(self, stimulus_name, model_name, file_path=None, verbose=False): self.stimulus_name = stimulus_name self.model_name = model_n...
029dc0724603e0765fd1959d186a3d6aa49dafe3c04c3db78bf6ccd0a362c9f1
Python
19,868
547
#!/usr/bin/env python3 import os import pickle import json import logging import multiprocessing as mp import polars as pl from enrichm.annotate import Annotate ################################################################################ def parse_genomes(path): genome = pickle.load(open(path, 'rb')) retu...
1ffd039890a3a5198ccdaf8b3d7f6d542e46b51521f026661e454f529a16f347
Python
19,956
502
from typing import TYPE_CHECKING, Any, NoReturn import numpy as np import pandas as pd from numpy.typing import ArrayLike from skbase.utils.dependencies import _check_soft_dependencies, _safe_import BaseDistribution = _safe_import("skpro.distributions.base.BaseDistribution") if TYPE_CHECKING: from matplotlib.axe...
4f4c0dd6d86f356a43fd0fc2db93a93993a9c2d7647448d24a8069e8e6122e25
Python
19,957
545
import os import argparse import pickle import math import random import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F import scipy.stats from Bio.PDB.Polypeptide import one_to_index def seed_all(seed): torch.backends.cudnn.deterministic = True torch.manual...
db3def212435d21000bfbc7d38fe85321d77e55135434f923ed46e761fc04c5b
Python
19,961
655
import pytest from langchain_core.messages import AIMessage, AIMessageChunk, HumanMessage from langchain_core.messages import content as types from langchain_core.messages.block_translators.openai import ( convert_to_openai_data_block, ) from tests.unit_tests.language_models.chat_models.test_base import ( _con...
6ab38011e8185d73928bf14b624aa3a1ba5b870918d9b0cfebefd6739407ca61
Python
20,035
514
""" Wrapper class providing a minimal consistent interface to `AmberTools <http://ambermd.org/AmberTools.php>`_. """ __all__ = ("AmberToolsToolkitWrapper",) import functools import subprocess import tempfile from collections import defaultdict from shutil import which from typing import TYPE_CHECKING import numpy as...
ea0ed941c5823e4e969fd2e2c186abc8ba474269d66d4f6c7dc7124fae63893c
Python
20,039
410
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # :noTabs=true: # (c) Copyright Rosetta Commons Member Institutions. # (c) This file is part of the Rosetta software suite and is made available under license. # (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. # (c) For more infor...
92d8692cf3e659370acd10f909c8a89243e99c2528a386c4c909a041f1122849
Python
20,057
429
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ POCIF-BAT — Préenregistrement du cycle R2. Ce fichier fixe, AVANT toute exécution de test comparatif, les hypothèses, les critères de réfutation, les seuils numériques, les partitions et les règles de décision. Il est haché ; le condensat est reporté dans le manifeste...
ae65b34afee3cceb32fa81b1db45c8d4001d53716e9cf309bb5baef37d3d27e3
Python
20,059
515
"""Destination resolution for LangSmith tracing.""" from collections.abc import Iterator from contextlib import AbstractContextManager, nullcontext from itertools import product from typing import Any from unittest.mock import MagicMock from uuid import uuid4 import pytest from langsmith import Client, address, confi...
017c66e8f555f69af45539e7a56a1ae7e0d9480270800f2ebcef59f2ebdb2811
Python
20,076
621
'''tracks.py - Working with sample names in pipelines ============================================================= Motivation ---------- A pipeline typically processes the data streams from several experimental data sources. These data streams are usually processed separately (processing, quality control) and as agg...
438b33f1828b8b5379d546808000ef963d1c7576f96bed939d3899fd979da895
Python
20,101
467
import asyncio import os from collections import defaultdict, OrderedDict import torch.nn.functional as F from torch.cuda.amp import autocast, GradScaler from core.runner import runner_register from dataset.utils.load_data import load_data_omics from utils.my_containers import AverageMeter, deep_dict_get from utils.t...
88d98a77849f479131cb4991a5a4124a44ecc03e46ed7f2e2d8e773ef826fdf7
Python
20,142
517
import torch import copy from .so3 import SO3Grid def check_activation_name(act_name): assert act_name in [ 'gate', 's2', 'sep_s2', 's2_swiglu', 's2_swiglu_mem', 'sep_s2_swiglu', 'sep-merge_s2_swiglu', 'sep_s2_swiglu_mem', 'sep...
8099776934da915e562b3c211c8eeb77ca0997b44e1a90fd46205a73d2d9df40
Python
20,153
435
import os import glob import numpy as np import matplotlib.pyplot as plt from utils.constants import ALL_MODELS from paths import TRAINING_DATA_PATH, TEST_DATA_PATH from utils.distribution_distance import compute_jsd import matplotlib.gridspec as gridspec from matplotlib.patches import Rectangle from matplotlib_scaleba...
e82abe2e99282fcd811aad7ab8c29374b53d2e36da86124aee87ac18af4adb3f
Python
20,153
455
import numpy as numx import pydeep.base.numpyextension as numxExt from pydeep.base.activationfunction import Sigmoid from scipy.signal import convolve2d class Weight_layer(object): ''' This class implements a weight layer that connects one unit layer to another. ''' @classmethod def gene...
046f3ef1a46e45c4bd7ce6083b9335c7aceffba778b045d8c928e7693a061bbb
Python
20,162
328
import sys import os import shutil import matplotlib.pyplot as plt from matplotlib.lines import Line2D sys.path.insert(1, os.path.join(sys.path[0], '../../../')) from Articles.DMS_DLS.Code.FiguresDMS import * ratio = 0.4 name = 'article' name_dir = 'main' P_stim_by_pattern_list_noise = [[10, [3, 5], [10, 15], [0.0...
14a55eb023ba4fd87ae2025d69658c9a54c8220b64fd6020b7ed2958a518ed1b
Python
20,163
539
""" Created on Mon Dec 3 17:53:24 2018 @author: Nick Anthony """ from __future__ import annotations import typing from dataclasses import dataclass from numbers import Number from typing import Union import numpy as np import copy import matplotlib.pyplot as plt import matplotlib as mpl from misc.PropertyMap import P...
0bf587d4663d73d8256eb7540bec011a5ce5cd94a136ad1c05a02683622007ed
Python
20,171
389
import importlib from enum import Enum from importlib.util import find_spec import numpy as np import pandas as pd import pytest from scipy.stats import norm from sklearn.exceptions import NotFittedError from sklearn.linear_model import LinearRegression import pgmpy.parameterization from pgmpy.parameterization import...
efe41bdeb65b7a19132fb0d7a51b5f3a444d5646d0a259f3112c987f68360296
Python
20,180
568
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import CustomModuleArch, InheritedFullyConnectedFlexiLayerSizeArch, SingleInputInheritedFullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch from modulusDL.eq.pde import NavierStokes_CoordTransformed i...
c85368eeae65628fd742f79a80a6ff68bc63967e53184c3c8f6fb8ef1f670e91
Python
20,184
661
"""Implementation based on the template of ALIGNN.""" import imp import random from pathlib import Path from typing import Optional # from typing import Dict, List, Optional, Set, Tuple import os import torch import numpy as np import pandas as pd from jarvis.core.atoms import Atoms from matformer.graphs import PygG...
9706fd7a458a630c83f87df2da650f43809b5b8696de4ef5fdd8b75741c363ac
Python
20,193
414
# %% """ ============================================================== Study of the features chosen for the classification - ATM & ImCoh + SVM =============================================================== """ # Authors: Marie-Constance Corsi <marie.constance.corsi@gmail.com> # # License: BSD (3-clause) import gzi...
af4714ccfc27eb76051817b5a7fd8e6e814bdc0fad11c771f5327ea765b9e3d7
Python
20,199
378
import os import numpy as np import pickle from scipy.stats import mannwhitneyu import params def test_stats_pre_post(all_flies, i_beh, GAL4, beh_name,measured="", i_0=500, i_1=750,file=None,per_fly_avg=True): v_pre = [] p_pre = [] v_post = [] p_post = [] if not per_fly_avg: for fly in a...
a1a84a44358a4696ce3ba58501393481794e99a64e1640a36f04b7f595a8d0ef
Python
20,202
529
import functools import time import numpy as np import torch import torch.nn as nn from torch.autograd import Variable from torch.nn import init from torch.optim import lr_scheduler ############################################################################### # Functions ############################################...
14a149174bd8191c76a24000a1666222cf0781e4ae643cffbf49ebf73e2d40e5
Python
20,206
539
"""Module tests interaction of chat model with caching abstraction..""" from typing import Any import pytest from typing_extensions import override from langchain_core.caches import RETURN_VAL_TYPE, BaseCache from langchain_core.globals import set_llm_cache from langchain_core.language_models.chat_models import _cle...
d6bebc73d3d71eaae9a50dd2621d7056b7a78517e3e9d2828387f2ffeacd58e7
Python
20,217
300
import argparse import os import warnings import torch.cuda from predmoter.core.constants import PREDMOTER_VERSION class BaseParser: def __init__(self, prog="", description=""): super(BaseParser, self).__init__() self.parser = argparse.ArgumentParser(prog=prog, description=description, add_help=...
883a6693d0e20bf1cafc07bb6e927617e6fcace950ac1544367aea15b4e22ed9
Python
20,219
406
import copy import torch import os from tqdm import tqdm import numpy as np from CEL.utils.register import register import torch.nn as nn import optax import equinox as eqx import jax from CEL.data.data_manager import MyDataLoader from CEL.networks.models.meta_model import ModelClass import pathlib from munch import M...
20803855a1f9ba880c405ecd5395558ed37da83ed0a2ac9c44d16c2fc2d7e505
Python
20,223
517
try: import cPickle as pickle except: import pickle import numpy as np import logging import os from collections import namedtuple from nowcasting.config import cfg from nowcasting.hko_iterator import get_exclude_mask from nowcasting.helpers.msssim import _SSIMForMultiScale def pixel_to_dBZ(img): """ ...
d6decf329f859bc62511e432c2ac27d804560c4f53c04a07e993c211d6ab08e0
Python
20,236
422
""" Prepare all SARS-CoV-2 Mpro structures for docking and simulation in monomer and dimer forms and desired protonation states. """ # Configure logging import logging from rich.logging import RichHandler FORMAT = "%(message)s" from rich.console import Console logging.basicConfig( level=logging.INFO, format=FORMA...
5b8168e8bdb6ee1b5d99aa9c0c33ccc34b6b017f747645ec5d4175e4f30207f7
Python
20,259
606
''' Created on Oct 12, 2011 this code is for reading input parameters. @author: Ying Jin @status: @contact: yjin@cshl.edu @version: ''' # python modules import sys import os import re import logging import time import gzip import collections from math import log from TEToolkit.Constants import * from TEToolkit.Shor...
4676c9fffefd6f2f9fb8985b7e418aa9e8ed97f90aee13c4229f997ee0d0aee9
Python
20,261
643
#!/usr/bin/env python3 ''' Interpolate label between sparse sections using alpha shape - Speeds up manual labeling for larger label volumes Usage ---- interp_labels.py <label image> <index list> interp_labels.py -h Example ---- >>> interp_labels_a3.py -i labels.nii.gz -l 1,3,4 Authors ---- Mike Tyszka and Wolfgang P...
cdfddd9aa719895be5e02ddcd1b49d279de892e9f96bad9d70e14dbe3085fb46
Python
20,281
596
# supervised autoencoders import mdtraj as md import multiprocessing as mp import numpy as np import os import itertools import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable class split_ae(nn.Module): """Unsupervised autoencoder with a split input (i....
31392a0b0d08d9cd6473f62a50acbb19d677fbfa14244695fd38e5baad872b40
Python
20,290
572
# 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...
c7670eb5a47aee1fb45501dc49ca7d3d581a043526c413f7cebdb899572d6aab
Python
20,305
578
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import CustomModuleArch, InheritedFullyConnectedFlexiLayerSizeArch, FullyConnectedFlexiLayerSizeArch, SingleInputInheritedFullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch from modulusDL.eq.pde impo...
c8e9fb374c1b6ab269682ccdf6eb1f1893f4a54e5e071a845713e9af95f58357
Python
20,311
631
"""Utilities for pydantic.""" from __future__ import annotations import inspect import textwrap import warnings from contextlib import nullcontext from functools import lru_cache, wraps from types import GenericAlias from typing import ( TYPE_CHECKING, Any, TypeGuard, TypeVar, cast, overload, ...
1fb915fe2ddedc7d42255f4ee418607dc3036f9958557f42b4d4846df13b617d
Python
20,315
472
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 28 2021 @author: Simon Pelletier """ import warnings import pickle import numpy as np import pandas as pd import os import csv import json import matplotlib import xgboost import xgboost as xgb from sklearn.feature_selection import SelectKBest from...
7069aee9b39482e6df2c4f08a0d8b7aad74d15988c029e41f087fc6f12bca922
Python
20,324
468
# TEMP copy of processing/paq.py to use for experimenting with and creating paq as child of temporal cellsdata. import os.path from dataclasses import dataclass from typing import List import numpy as np import pandas as pd import seaborn as sns import matplotlib.ticker as mticker import matplotlib.pyplot as plt fro...
f4c78a94a6fde6951ffb764dc3668920e74d44d3b65116248457e1b5a657acec
Python
20,329
548
# -*- coding: utf-8 -*- """ Created on Wed Apr 10 17:27:13 2024 @author: Shencong Ni """ ''' Simulation for spontaneous activity ''' import brian2.numpy_ as np from scipy import sparse from brian2.only import * import time import mydata import os import datetime import connection as cn import poisson_stimuli as ...
b956751c0ad745634a2a89ef82251c767a9f3565e18a826ee909a0670c746657
Python
20,337
478
"""Simulation tests derived from the examples/ notebooks. Covers end-to-end physics behaviour: directional activation, numerical stability under prolonged stepping, environment step dynamics, and policy forward pass / training loop correctness. """ import numpy as np import torch from motornet.effector import ( E...
4d5012286119fdf1557170db890ca167948e92844a56b10b3b25ac0a9e47f942
Python
20,345
534
"""Classes and methods for using a trie to query for similar DNA/RNA strings. The trie here is intended to store relatively short strings (e.g., k-mers where k is about 28). It is expected that many of the strings will be highly similar to other strings (i.e., there are dense regions in the space of strings) -- for ex...
d11088c761d6e9eacc6ad5d6bd41f293ed550bfea5ec28934c8fa1c471e24cc7
Python
20,346
457
# Copyright (c) DP Technology. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function from ast import Not import torch import torch.nn as nn import torch.nn.functional as F from unicor...
6cedb194f474ef01eb2bcea1c621926dbc3b3f52e632e5b3cdc334d5e335bae6
Python
20,382
458
import math import numpy as np from Bio import Phylo from pycircos.pycircos import Garc from pycircos.pycircos import Gcircle class Tarc(Garc): def __init__(self, arc_id=None, tree=None, format="newick", interspace=3, raxis_range=(900, 950), facecolor=None, edgecolor="#303030", linewidth=0, label=None, labelposi...
8e8e0ce0a57df779d881762c6aebf46d89158a5082adedbfd7c526bab376bf6d
Python
20,383
523
#!/usr/bin/env python3 from enrichm.sequence_io import SequenceIO import logging import os ############################################################################### class Genome: ''' A genome object which collects all the attributes of an input genome, including protein sequences and their annotatio...
1834378895959c057725269445e1262b15fb141a5cc6c757f5761bb4b5961e71
Python
20,397
558
'''counts2counts.py - perform transformations on counts tables ============================================================== :Tags: Python Purpose ------- This scripts provides transformations for counts tables The methods implemented are filter Output the counts table after applying filtering. spike Outpu...
870bc66f6dc5107437699444cd7262d3d0ea0881cf7ee532e7b3028302cd1a48
Python
20,405
442
# -*- coding: utf-8 -*- # @title Generate configuration for organoid emulation # @file OrgStructures.py # @author Romain Beaubois # @date 17 Feb 2022 # @copyright # SPDX-FileCopyrightText: © 2022 Romain Beaubois <refbeaubois@yahoo.com> # SPDX-License-Identifier: GPL-3.0-or-later # # @brief...
31f8099ed2ace00ff67aadf9ce934efab32a7ecebcc19ec6286b894c7cd50e96
Python
20,414
606
from functools import partial # from pathlib import Path from typing import Any, Dict, Union import ignite import torch from ignite.contrib.handlers import TensorboardLogger try: from ignite.contrib.handlers.stores import EpochOutputStore except Exception as exp: from ignite.handlers.stores import EpochOutpu...
2ee1f1707906b8f177d29e487ad4f507789f84c11e6f35e77e494b10d17700aa
Python
20,436
578
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import CustomModuleArch, InheritedFullyConnectedFlexiLayerSizeArch, FullyConnectedFlexiLayerSizeArch, SingleInputInheritedFullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch from modulusDL.eq.pde impo...
8d7f74303fb05374d4aefd77877259e7f26df6c3bd321375c2a3ffa96972027b
Python
20,436
468
# new copy of processing/paq.py to use for experimenting with and creating paq as child of temporal cellsdata. import os.path from dataclasses import dataclass from typing import List import numpy as np import pandas as pd import seaborn as sns import matplotlib.ticker as mticker import matplotlib.pyplot as plt from...
c61f919f31e7dafb68dc42b5d917387f558822e15292b9aceefd5e3d9022db89
Python
20,437
578
import os os.environ["CUDA_VISIBLE_DEVICES"]="3" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import CustomModuleArch, InheritedFullyConnectedFlexiLayerSizeArch, FullyConnectedFlexiLayerSizeArch, SingleInputInheritedFullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch from modulusDL.eq.pde impo...
fdfe9cfc7137985eae31dbb4512a2596099d2e2b54b15cdf3d963a0d6c668be7
Python
20,443
596
import mne import torch from torch import nn import numpy as np import pandas as pd from sklearn.model_selection import KFold from sklearn.metrics import mean_absolute_error, r2_score from sklearn.preprocessing import StandardScaler from sklearn.compose import TransformedTargetRegressor from joblib.parallel import Para...
94a40bd43a22e808beb2e44c39fa6c8ca045175edcd0224968ee1f1f87210c8b
Python
20,460
263
import pandas as pd import numpy as np import sklearn from scipy.stats import rankdata from sklearn.metrics import roc_curve, roc_auc_score, auc, precision_recall_curve, average_precision_score, f1_score, \ accuracy_score import argparse, sys, os, errno def plot_roc(prob, label): fpr, tpr, _ = roc_curve(label,...
08bc2db4b88088126c095aa6d9ac46936e6c7eec3406a440bb971eae51ef9bc5
Python
20,475
539
"""**Document Loaders** are classes to load Documents. **Document Loaders** are usually used to load a lot of Documents in a single run. """ from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.document_loaders import ( Acre...
2ba47f09157dfe5f9fe37c5668e2e58681fb87cc9338c957923528f372fa929f
Python
20,491
562
from abc import ABC, abstractmethod from itertools import product from pathlib import Path from typing import List, Union from MRdataset import logger from MRdataset.config import VALID_DATASET_FORMATS from MRdataset.utils import valid_dirs, convert2ascii from protocol import BaseSequence # class Run(UserDict): # ...
8dab24d01c876426812a3cccdd6eaf1a146563ebc0692b53d83588fac6d45afa
Python
20,492
619
from functools import partial # from pathlib import Path from typing import Any, Dict, Union import ignite import torch from ignite.contrib.handlers import TensorboardLogger try: from ignite.contrib.handlers.stores import EpochOutputStore except Exception as exp: from ignite.handlers.stores import EpochOutpu...
f4a6dbd50ee9532ada4787ae569f2f8575e105b88089968ffa8ce525e99db8d4
Python
20,501
664
"""================================================= pipeline_testing - automated testing of pipelines ================================================= This pipeline executes other pipelines for testing purposes. Overview ======== This pipeline implements automated testing of cgat pipelines. The pipeline downloads...
09dac04356c2ae3f5f679f88f367ccf4997ac7ffd2c1d331b4136fb27e2cec23
Python
20,504
546
#################################################################################### # # 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...
0b0834988a86b42c98fcd27c1f3f11c21ce2cb1fa76501b13a978dd1cea5b0dc
Python
20,521
562
""" =================== Project 20 pipeline =================== :Author: David Sims :Release: $Id: pipeline_proj020.py 2900 2013-06-03 14:38:00Z david $ :Date: |today| :Tags: Python The project 020 pipeline processes reads from a gene trap screen experiment to identify trapped genes: * Align reads to the gene tr...
c6b30df62194ea75f0ddacbfe27d7d1ed071235777d465de90b3f568f017b87f
Python
20,521
513
# 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 ...
4dc9dcc38b3c6e256a821124e2d982953a7054dc4e6a2958dae89b9130700c17
Python
20,528
508
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from abc import ABC, abstractmethod from typing import Dict, List import torch from torchmetrics import MetricCollection from torch_geometric.data import Batch from pytorch_lightning import LightningModule from pytorch_lightning.cli im...
b25e64136e8a98d513f6b0d1f5a741641e38f01d5848780a99e746c02a8435b4
Python
20,529
511
# MCNN model import tensorflow.keras as keras import tensorflow as tf import numpy as np import time from utils.utils import calculate_metrics from utils.utils import create_directory class Classifier_MCNN: def __init__(self, output_directory, verbose, build=True): self.output_directory = output_directo...
f41a15da7511c2c20599da3a695f818b1d9a9cb900ce7afafe16785425d2ddde
Python
20,552
522
import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt from scipy.stats import hypergeom, mannwhitneyu import pandas as pd import numpy as np import pickle pd.set_option('display.max_rows', 400) pd.set_option('display.max_columns', 10) import sys, os import random from pathlib import Path f...
80f3c8fa57b7fdc90e88467904c125ba3b918355e5456256c1131600093f01c9
Python
20,553
549
import threading from collections import OrderedDict from random import Random from typing import Dict, Iterator, List, Optional, Union, Tuple import numpy as np import torch from torch.utils.data import DataLoader, Dataset, Sampler from rdkit import Chem from rdkit import DataStructs from .scaler import StandardScale...
805415f5dc3500ece1406287f7a3467953892d2eec2b8a04eef04269ff28bc2b
Python
20,556
538
import os import multiprocessing as mp import functools import glob from .utils import * import pickle from collections import defaultdict import numpy as np import mdtraj as md from scipy.linalg import inv, sqrtm import torch class ImproperlyConfigured(Exception): '''The given configuration is incomplete or othe...
0d6e36bb0df8645fd2dda785c844245af1a1088c0d11714434f66173f8dbda3f
Python
20,561
576
import os os.environ["CUDA_VISIBLE_DEVICES"]="2" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import CustomModuleArch, InheritedFullyConnectedFlexiLayerSizeArch, SingleInputInheritedFullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch from modulusDL.eq.pde import NavierStokes_CoordTransformed i...
be486e2801e2948bb426622209893203a7b31b20724d0d9d4e4c5a63a8906fb4
Python
20,563
576
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import CustomModuleArch, InheritedFullyConnectedFlexiLayerSizeArch, SingleInputInheritedFullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch from modulusDL.eq.pde import NavierStokes_CoordTransformed i...
af4e8133c6fad33f07fc7ea20f744907ec234b78c5ad2e865c47fd220506884b
Python
20,585
565
# 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...
d4d85dea54073e958060b190c7c0c11eb5fbf158460544dce59ae56e37222f62
Python
20,597
569
''' runMEDIPS.py - wrap MEDIPS analysis =================================== :Tags: Python Purpose ------- Runs MEDIPS from the commandline. Note that the appropriate UCSC genome file has to have been downloaded previously in Bioconductor:: source("http://bioconductor.org/biocLite.R") biocLite("BSgenome.Hsapi...
aa904fb6bbef4b05e2cfaca0a5c781ca62293383bb213eb88ef701d334b8454f
Python
20,612
621
#!/usr/bin/env """ # Author: Kai Cao """ import torch import numpy as np import os import anndata import scanpy as sc from anndata import AnnData import scipy import pandas as pd from scipy.sparse import issparse from .model.vae import VAE from .model.utils import EarlyStopping from .logger import create_logger fro...
4474f89c021c2d96a2394922049fbc69aedb1f3fa40912146cfd36008887f90e
Python
20,635
434
import unittest from EPI_MRI.LinearOperators import * class TestLinearOperators(unittest.TestCase): def setUp(self): """ Initialize any common data or setup needed for the tests. """ torch.manual_seed(81) # reproducibility with randomness self.device = 'cuda' if torch.cuda.is_available() ...
ad1c0ea13ac36baa6340d2670fd93d658ce00351f5331788374e4da9db94a7d4
Python
20,683
657
"""A chain for comparing the output of two models using embeddings.""" import functools import logging from enum import Enum from importlib import util from typing import Any from langchain_core.callbacks import Callbacks from langchain_core.callbacks.manager import ( AsyncCallbackManagerForChainRun, Callback...
eaa04f705e8f5fdb57366b64a213453abae04f29d8f0a3a08b37b0bc9dc97060
Python
20,683
550
#################################################################################### # # 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...
29722c95580a0fcc121c029efacb62ca193bc68265af03c0c09a5ab3e58ca7f1
Python
20,684
460
# 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...
4d21d0cc8c4eabcf71a545d3703963c7b87ffaa7a1fa63b173d48d113a20c936
Python
20,689
461
""" python Load_and_Test_GhmCN.py Purpose: Load trained networks and test how given datasets predicts gene expression. Usage: python ./Load_etTest_EGA.py [-c <str>] [-rf <int>] [-mo <str>] Arguments: '-c', '--cell_line', default='E116', type=str '-rf', '--regression_flag', default=1 (1 = regression; 0 = clas...
ced157fa3c99fc1b7d08207a98d60672f247a6d9cbb9e2eb2350d7e9f76310f9
Python
20,695
485
import os import numpy as np from typing import Dict, List, Union, Tuple, Callable, Optional from omegaconf import DictConfig import warnings from modulus.solver import Solver from modulus.domain import Domain from modulus.loss.aggregator import NTK, Sum import time import torch from torch.utils.tensorb...
3ab622b61aa618b776dbce58a38c9afabbe5b5f1cdf52d6b15f801eea251b9f1
Python
20,711
392
import os from .data_helper import DataHelper from .normalizer import Normalizer class FindStems(): def __init__(self): self.dir_path = os.path.dirname(os.path.realpath(__file__)) + "/" self.noun_lex_path = self.dir_path + "resource/stemmer/stem_lex.pckl" self.verb_lex_path = ...
7bbd6ba1144d0fd546e3b74d93d7dc5aa3d03c93a079b6185012da40a3734879
Python
20,713
513
from collections import deque from collections.abc import Hashable, Iterable from itertools import pairwise import networkx as nx from pgmpy.utils.types import Self class _GraphAlgorithms: """Graph-algorithm methods for ``_CoreGraph``-based classes (inherited, not instantiated alone).""" def get_ancestral_...
a0f176c73cde123526027919284bd82dd1bce365cbf2bad955f949c900d9d94f
Python
20,732
382
#################################################################################### # # 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...
65f0bc9db0b647b711ec50a73678fad7c3480a3174635959db38f5f8a89d3a92
Python
20,742
536
# This file takes all available input data and trains the regressors # using the prescribed preprocess methods. # It displays time domain estimates for all data files as well as # sensitivity plots for sensor channels and estimates import time import os import numpy as np import pandas as pd import matplotlib.pyplot ...
2048644764c77b5a5f71661ae5b21e2a771171bc1a78d8ad6b2fd0fbf009eb48
Python
20,767
500
""" This module contains the weight layer for DBMs. :Implemented: - DBM model :Version: 1.0.0 :Date: 26.05.2019 :Author: Jan Melchior :Contact: JanMelchior@gmx.de :License: Copyright (C) 2019 Jan Melchior This file is part of the Py...
47a6407d32a3e10aaf98695e714490333b9606c143dea7f1cf4f7ebb46b35028
Python
20,770
443
"""Functions for preparing an alignment for input. This includes downloading, curating, and aligning sequences. """ from collections import Counter from collections import OrderedDict import logging import os import random from easyDesign.prepare import align from easyDesign.prepare import cluster from easyDesign.pr...
1654569480d141523c5b9ffe65943c1f80f0b8939721bd5d5485fe94db1583e8
Python
20,848
522
#!/usr/bin/python ############################################################################# #Package: stamp #Updated by Yiqin Wang #Usage: #generate mtDNA alignments for whole-genome sequencing data # ############################################################################## from argparse import Argum...
413ab48432285ccbfab7ba4666ab74d26a96732a58839ef06a962e9188ef4835
Python
20,891
529
from collections.abc import Hashable, Iterable from itertools import combinations from typing import Any import networkx as nx import numpy as np import pandas as pd from pgmpy.base import PDAG from pgmpy.causal_discovery._base import BaseCausalDiscovery, _ScoreMixin from pgmpy.structure_score import BaseStructureSco...
bb62deaa1bb6141c646974df19b4cd87a16801f3e3e58534819e01cb5f0dbf08
Python
20,896
440
"plotting utils" import os import numpy as np import matplotlib.pyplot as plt import torch as T import src.utils as utils import src.plotting as plot FIG_SIZE = (6, 6) FONTSIZE = 16 LABELSIZE = 16 LEGENDSIZE = 14 def hist_in_bins(*distributions, conds, binning, style={"range": [0,1], "bins": 20}, l...
f2ce6514242f75d8833112159436a6993665278ca478f7a6d95fc1bbc831a073
Python
20,907
537
import os import torch import numpy as np import pandas as pd import networkx as nx from rdkit import Chem from rdkit.Chem import AllChem from torch_geometric.data import Data, InMemoryDataset # allowable node and edge features allowable_features = { 'possible_atomic_num_list': list(range(1, 119)), 'possible_...
8a835d1738e4012f415c7e416b4b25bf2ef4424686801a6dba1f58ac357d61a4
Python
20,953
566
#################################################################################### # # 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...
a5bb3d76ad22516aabaceabb4b245ca0d2d799e56b37955f76bee9d3cc0dede0
Python
20,956
573
import numpy as np from queue import PriorityQueue import math import matplotlib.pyplot as plt from scipy.optimize import curve_fit from scipy.signal import argrelextrema import os from pensa.features import * # -- Functions to cluster feature distributions into discrete states -- def _smooth(x,window_len,window=N...
d3e8e1ad3ace6ada774713192b114f7f622a16cdee28866da940834bbf48d8e4
Python
20,962
545
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 12 14:51:24 2020 @author: shni2598 """ import numpy as np import pywt from scipy import signal as spsignal import matplotlib.pyplot as plt import scipy.signal.windows as sp_windows import mydata #import pdb #%% def myfft(data, Fs, amp=True, power=F...
45c72bcc430738c2373bd0175a22a6c13c930d1654b570518fc0549bf830cfe8
Python
21,010
495
''' The MSN class defining the cell ''' from neuron import h import numpy as np import json # Distributions: ''' T-type Ca: g = 1.0/( 1 +np.exp{(x-70)/-4.5} ) naf (den): (0.1 + 0.9/(1 + np.exp((x-60.0)/10.0))) ''' def calculate_distribution(d3, dist, a4, a5, a6, a7, g8): ''' Used for setting the maximal c...
f69c5f6bb820a63c9dc447a393fafbbe75a6eb4a64019171687768604d77968b
Python
21,012
642
#################################################################################### # # 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...
b6e2f59b166a428d8ff0b7c3afd0a9c61a104e26e0eb3bf9e5fdb569fecf7b9a
Python
21,033
495
import sys;sys.path.append('../src') from matplotlib import pylab import pandas as pd import analyse_experiment as analyses import joe_and_lili from scipy.stats import wilcoxon import pickle as pickle import analyse_model from reaction_times_functions import ( reaction_time_plot, get_reaction_time_analysis) import ...
6a8d8229e5ad9e145979ac70853531861670439790cbe63ed1345272bb251e9d
Python
21,043
501
"""PDB dataset loader.""" import math from typing import Optional import torch import torch.distributed as dist import tree import numpy as np import torch import pandas as pd import logging import random import functools as fn from torch.utils import data from data import utils as du from openfold.data import data_...
f11abb853d0eed0a683c7ba157d2bee8ece34d879036bfc4cbe3bfa5ccc9bc2a
Python
21,054
606
import pickle from multiprocessing import Pool from sklearn.utils import shuffle import torch import os, json import os.path as osp from itertools import repeat import numpy as np from rdkit import Chem from torch_geometric.data import InMemoryDataset, Data from tqdm import tqdm import networkx as nx from torch_geometr...
023b5c30589b34f64d1a8b62f2b698497de2a06428b225455ade33d9401004cd
Python
21,058
586
#!/usr/bin/env python import xml.etree.ElementTree as etree from io import BytesIO from itertools import chain import numpy as np from pgmpy.factors.discrete import TabularCPD from pgmpy.models import DiscreteBayesianNetwork from pgmpy.readwrite._base import BaseReader, BaseWriter from pgmpy.utils import compat_fns ...
eb153cd55d240a6a3d41377727ec3f9a1950d685381245eb6f303d61197f04b5
Python
21,063
763
#!/usr/bin/env python3 """ Create a report of intra and inter-observer atlas label statistics Expects a label directory organized as follows: <label_dir>/ <observer A>/ <template 1> <observer B>/ Usage ---- atlas.py -d <observer labels directory> atlas.py -h Authors ---- Mike Tyszka, Caltech Brain Imaging C...
c483dad0c9f917c93eaa4dddc8ed53f48a68af9d5e1626a79822b32e01a34fba
Python
21,080
532
import copy import warnings import numpy as np import pandas as pd import pytest from skbase.utils.dependencies import _check_soft_dependencies from pgmpy.parameterization.distributions.nominal import NominalDistribution pytestmark = pytest.mark.skipif( not _check_soft_dependencies("skpro", severity="none"), rea...
cd1b3979e3bccec2333260ca11d9fa4b2ba06925cc0ac96c566c7439401882e0
Python
21,090
537
#pylint: disable=E1101 import math import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class create_classifier(nn.Module): def __init__(self, latent_dim, nhidden=16, N=2): super(create_classifier, self).__init__() self.gru_rnn = nn.GRU(latent_dim, nhidden, batch...
9d220cc5f899e8ea2d7a74469dc085211fed49adb19aa79fbda05ccdaaff90ba
Python
21,130
578
"""Chain for chatting with a vector database.""" from __future__ import annotations import inspect import warnings from abc import abstractmethod from collections.abc import Callable from pathlib import Path from typing import Any from langchain_core._api import deprecated from langchain_core.callbacks import ( ...
ed57b57b91f059da905ce7fd23f878cd5261d7c383a71fe86b33c2a20d4ad0dd
Python
21,133
531
"general plotting" import matplotlib.pyplot as plt import numpy as np import copy from sklearn.metrics import roc_curve, roc_auc_score from matplotlib.ticker import (MultipleLocator, AutoMinorLocator) import matplotlib.colors as mcolors import src.utils as utils # from plot_utils import get_atlas_internal_str np.sete...
ab4f893bc4d54e7884eba024c1916d58f7e0c3e51b5502b3811f8db3db2e09e4
Python
21,139
456
# 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...
19ffc75614fa2ecb4642e368f85c101364595b572919137652d477a0b3518fdc
Python
21,158
532
"""Implementation of a record management layer in SQLAlchemy. The management layer uses SQLAlchemy to track upserted records. Currently, this layer only works with SQLite; hopwever, should be adaptable to other SQL implementations with minimal effort. Currently, includes an implementation that uses SQLAlchemy which ...