sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ecbe4778d3c7a7f340b43363423b6685f304540c6d8aa0b554d3473267ccfb17
Python
5,427
123
import torch from torch_scatter import scatter from torch_sparse import SparseTensor from math import pi as PI def xyz_to_d(edge_index, num_nodes, distance_vectors): """ Compute the diatance, angle, and torsion from geometric information. Args: pos: Geometric information for every node in the grap...
bca2c85122d500f8a537ba3529f4c9aff147a8f43bc5cb69560aa5faa40726d1
Python
5,430
165
import numpy as numx import pydeep.base.numpyextension as numxExt from pydeep.base.activationfunction import Sigmoid import pydeep.misc.visualization as VIS import pydeep.misc.io as IO from scipy.signal import convolve2d from pydeep.dbm.unit_layer import * from pydeep.dbm.weight_layer import * from pydeep.dbm.model im...
f44d462cee75e1ff3a689aea02e707a8b36492192354ed0c5e6ff1c45da46393
Python
5,430
123
import os import sys from time import time import multiprocessing import subprocess from queue import Empty as qEmptyException import traceback import json import warnings import numpy as np sys.path.insert(0, "../") from preprocess_rhd.preprocess_rhd import preprocess_one_session from utils_here import clear_folder ...
9c6ae742f23f01b471d54a36d772c9afe007714432e0aa2d40c258cc5f781c10
Python
5,432
150
#################################################################################### # # 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...
211dbda1194f9511e8fded849657e41f36596b3ff2149bd109202ba1dc1d7eac
Python
5,434
142
import sys import os import numpy as np import torch import torch.utils.data as du from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import util from util import * class DrugGene_network(nn.Module): def __init__(self, term_size_map, term_direct_gene_map, graph, ngene, ndrug, s...
158141fbbb252092c9c6476a0007f828b30ff969005232e1c169cc0a2d5edf10
Python
5,439
177
#!/usr/bin/env python # coding: utf-8 # In[12]: import numpy as np from numpy.random import randn import pandas as pd import math from scipy import stats import numpy as np import pandas as pd from pandas import Series,DataFrame import pingouin as pg import matplotlib as mpl import matplotlib.pyplot as plt impor...
cf9c7dcdd265edcff52a7b388d5f753fd77f6f7f3a813eaf9f49ab4c0fa67eed
Python
5,444
134
import os import torch from torch.utils.data import DataLoader from orbevo.datasets.pyg_dataset import TDDFTv2_pyg, collate_fn, keep_qm9_good_after_split from torch.utils.data.distributed import DistributedSampler import numpy as np class DataModule: def __init__(self, cfg, world_size, time_start=0, time_cond=1,...
55ec8fb6624e28507c53a047e25d74874204e01cd39657a244d22bd83db15210
Python
5,445
155
#!/usr/bin/env python # coding: utf-8 # ## Calculate predictions for Wu combinatorial Library # Ran this section on the group server import numpy as np import pandas as pd from os.path import isfile, join, exists from os import listdir, chdir from tqdm import tqdm from os.path import abspath import sys # for relat...
74c3b2bb3937642f6aa00d957029a93df6b2fff914e76def5579f0bf81f90efa
Python
5,445
176
# from analysis.data_filter import load_seqs import os import shutil import sys import pickle as pkl from tqdm import tqdm, trange import argparse import pickle def check(names, target_folder): processed = os.listdir(target_folder) processed = [p[:-5] for p in processed] rest_names = [] ...
8e96df5b312081b1beac21bbeffc2edb8eac790cb1ea5e6b14fa4ec2208b0e4b
Python
5,446
149
# Training procedure for CIFAR-100 using ResNet 110. # ResNet model from https://github.com/BIGBALLON/cifar-10-cnn/blob/master/4_Residual_Network/ResNet_keras.py import keras import numpy as np from keras.datasets import cifar100 from keras.preprocessing.image import ImageDataGenerator from keras.layers.normalization ...
2338a50bad04a92f4bfd316f048ec0ffdebf8b9f276808d64350bc165c5b5cf6
Python
5,448
163
import numpy as numx import pydeep.base.numpyextension as numxExt from pydeep.base.activationfunction import Sigmoid import pydeep.misc.visualization as VIS import pydeep.misc.io as IO from scipy.signal import convolve2d #from DBM_centered_flexible import Binary_layer #from DBM.unit_layer import * #from DBM.weight_laye...
5bf4bdc94bb3fbf021ca8e3cc09f2c183cd18d4bdffe0caee0733f5045cfc3c9
Python
5,450
149
import numpy as np import scipy as sp import scipy.stats import scipy.spatial import scipy.spatial.distance import pyemma from pyemma.util.contexts import settings import MDAnalysis as mda import matplotlib.pyplot as plt import os from pensa.features import * def kolmogorov_smirnov_analysis(features_a, features_b, a...
8a4c4c66f380a509d0cd4146c24e049aec60fe880f667965e808b165722fcc5d
Python
5,453
133
from collections import defaultdict import csv import json from logging import Logger import os from typing import Callable, Dict, List, Tuple import numpy as np import pandas as pd from .run_training import run_training from HMSA.args import TrainArgs from HMSA.constants import TEST_SCORES_FILE_NAME, TRAIN_LOGGER_NA...
222e34efdbf532a26bb1bc634b7b08cdd25a82d6f2e52a6a99fbfbd8662da413
Python
5,455
166
"""R^3 diffusion methods.""" import numpy as np from scipy.special import gamma import torch class R3Diffuser: """VP-SDE diffuser class for translations.""" def __init__(self, r3_conf): """ Args: min_b: starting value in variance schedule. max_b: ending value in varian...
d1f4a29a3dbdaf686f5381e02b29caec8cb4f6b7e5570b9b1f14503f8c6cd595
Python
5,458
149
# Training procedure for CIFAR-10 using ResNet 110. # ResNet model from https://github.com/BIGBALLON/cifar-10-cnn/blob/master/4_Residual_Network/ResNet_keras.py import keras import numpy as np from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator from keras.layers.normalization im...
8e5a74324ee5fa74b81c8d7860fcbec58aba9d534089c5a75fbf72ead93f0fe9
Python
5,459
147
import os import torch from torch.autograd import Variable import re from collections import Counter import pickle """ Note: The meaning of batch_size in PTB is different from that in MNIST example. In MNIST, batch_size is the # of sample data that is considered in each iteration; in PTB, however, it is the number of...
1d20f4aabd3167037dba2d8794fca81c15b9581d68ea11c6ff63e94de2a64376
Python
5,466
146
# Copyright (c) 2023 Shihao Ma, Haotian Cui, WangLab @ U of T # This source code is modified from https://github.com/yuyangw/MolCLR # under MIT License. The original license is included below: # ======================================================================== # MIT License # Copyright (c) 2021 Yuyang Wang #...
31b7e13198026f6e9cca4e522e04a13e40357288544a30c3a9eefd1541e85017
Python
5,467
127
''' preprocess rhd files into mda files; called from <repo_dir>/main_runnables/preprop_and_sort.py 8/31/2022 jz103 ''' import os import gc import warnings from copy import deepcopy from time import time import numpy as np # import pandas as pd # from scipy.io import loadmat, savemat from .load_intan_rhd_format impor...
b18ab0b9d4c6e531f1b5dfbd6f7ecece3429dc890dc4ca18d643f1a73a2daa7a
Python
5,467
158
import Bio.SeqIO as sio import tensorflow as tf import numpy as np from sklearn.preprocessing import LabelBinarizer from tensorflow.keras.utils import to_categorical import random import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' import tqdm #load model filterm = tf.keras.models.load_model(os.path.join(os.path.dirnam...
aa790ab1298675032d40522da6efdef29f8b35308b3cace98b85b2780fb7a995
Python
5,470
146
''' @author: Xu Yan @file: ModelNet.py @time: 2021/3/19 15:51 ''' import os import numpy as np import warnings import pickle from tqdm import tqdm from torch.utils.data import Dataset warnings.filterwarnings('ignore') def pc_normalize(pc): centroid = np.mean(pc, axis=0) pc = pc - centroid m = np.max(np....
12c9de10ee719d77ae42bb051b2bd42f8283b8b3b3c26a07080d749e38c7525d
Python
5,471
156
#################################################################################### # # 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...
778764f5c6429d388427c7447d0e99009a72818646f626916104e3e4256f743b
Python
5,471
159
""" SynergyNet chemical hypergraph dose hypergraph """ import numpy as np import math import torch from torch import nn import torch.nn.functional as F from torch.nn.parameter import Parameter import HyperGAT_Model as srcHGATmdl class DrugCombHypergraph(nn.Module): def __init__(self, in_chemical_n, ...
c6ffe5fc22b1754b3f81e825c194a8954b9965a7c246a683a0bb9a55e32d46b1
Python
5,471
159
# coding=utf-8 import os import sys sys.path.append('/projectnb/ivc-ml/dlteif/transferlearning/codebase') sys.path.append('/projectnb/ivc-ml/dlteif/transferlearning/codebase/DeepDG/alg') import time import numpy as np import argparse from tqdm import tqdm import torch.distributed as dist import alg from alg.opt impor...
8b5ef9cf613faa17ac7e3ec41ae7899d6475a915d810738b9ac30d2b03519d2f
Python
5,475
165
import tensorflow as tf import tensorflow_datasets as tfds import jax.numpy as jnp import jax.random as jrng from clu.preprocess_spec import PreprocessFn from dataclasses import dataclass from typing import Tuple, Sequence from projectlib.utils import maybe @dataclass class ToFloat: name: str = "image" def _...
4e1fa1da2c11d3229894908cee30b0d15187c52c4399c49c5996587f43ad4452
Python
5,476
166
"""Custom **exceptions** for LangChain.""" from enum import Enum from typing import Any class LangChainException(Exception): # noqa: N818 """General LangChain exception.""" class TracerException(LangChainException): """Base class for exceptions in tracers module.""" class OutputParserException(ValueErro...
85c077bb59782f9024745bdddeed6f6f1969ce2f006c8347ec04d9d53c47b08d
Python
5,479
138
import os # this stops jax from stealing all the memory os.environ["XLA_PYTHON_CLIENT_PREALLOCATE"]="false" import jax import jax.numpy as jnp import jax.random as jrng import tensorflow as tf import optax import seaborn as sns import hydra from omegaconf import DictConfig from orbax.checkpoint import (CheckpointMana...
2da25ec8ff2e648987cfdc78447253a41bef18a679d614e7b938f8cb3e058585
Python
5,482
151
import numpy as np import scipy as sp import scipy.stats import mdshare import pyemma from pyemma.util.contexts import settings import MDAnalysis as mda import matplotlib.pyplot as plt from pensa.clusters import obtain_clusters, obtain_combined_clusters def wss_over_number_of_clusters(data, alg...
98659e858b647b5449a2746fd663190359bb80ef651ea1bdec801b1343e23b1e
Python
5,483
105
import gym import random from gym import spaces import numpy as np import logging from random import sample, uniform from math import ceil from Environments.DSSdirect_123bus_loadandswitching.DSS_Initialize import * from Environments.DSSdirect_123bus_loadandswitching.state_action_reward import * from gym.utils ...
09a88a7e3013c808805398af260925681e11c7a21edcb6694611109d9addca14
Python
5,486
189
#!/usr/bin/env """ # Author: Kai Cao # Modified from RAE """ import torch from torch.distributions import Normal, kl_divergence __all__ = ['kl_div', 'distance_matrix', 'distance_gmm', 'unbalanced_ot'] def kl_div(mu, var, weight=None): loss = kl_divergence(Normal(mu, var.sqrt()), Normal(torch.zeros_like(mu),torc...
3b08b3a4bc5e6b6fbeb0dc311e666472321401f435b555f46ae8673fd3479284
Python
5,486
189
#!/usr/bin/env python3 """ Use a new key to reorder label numbers in label volumes. Usage ---- remap_labels.py -ok <Old Key> -nk <New Key> <Label Volumes> ... remap_labels.py -h Example ---- >>> remap_labels.py -ok old.txt -nk new.txt labels1.nii.gz labels2.nii.gz Authors ---- Mike Tyszka, Caltech, Division of Human...
a1bfe79b085c296917aac4005c79dd654d8c63049140159b9f80a0a75bc511ef
Python
5,486
152
# coding=utf-8 """Contains all visualization utilities.""" import torch from torch.nn import ReLU, SELU, ModuleList import logging logger = logging.getLogger(__name__) def get_notable_indices(feature_importances, top_k=5): """ Return dict of top k and bottom k features useful from matrix. Parameters: ...
c96079c77a12f9b5642078b7d6a1caeb07f1bb45628687101ee187d44a63f708
Python
5,486
120
"""This module contains various functions for plotting data from `MotorNet` training and simulation sessions. """ import numpy as np import matplotlib.pyplot as plt from matplotlib.collections import LineCollection def compute_limits(data, margin=0.1): """Computes the limits to use for plotting data, given the ran...
119319c7696be33c284325e3ee3110c71d5b4e50d9e222980f504234de2ccc3f
Python
5,491
175
#!/usr/bin/env python3 """ Create an ITK-SNAP label key from a subset of the Allen Brain Atlas human ontology via the online API Usage ---- allen2itksnap.py -k <ITK-SNAP label key file> allen2itksnap.py -h Example ---- >>> allen2itksnap.py -o Amy_BG_Labels.txt Authors ---- Mike Tyszka, Caltech, Division of Humaninit...
25e714929eb9ae6e3e7e7f9dcdc99cfbe04837ea0c379ef3af29ae2dcc87a46f
Python
5,493
179
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bindsnet documentation build configuration file, created by # sphinx-quickstart on Tue May 1 21:54:09 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # a...
ab05515c83b680806645e90338f4f4cd6fd2aa1c1a9a5bf1298a766776218532
Python
5,494
150
import numpy as np import os import torch import torch.utils.data as data import pymeshlab from data.preprocess import find_neighbor type_to_index_map = { 'night_stand': 0, 'range_hood': 1, 'plant': 2, 'chair': 3, 'tent': 4, 'curtain': 5, 'piano': 6, 'dresser': 7, 'desk': 8, 'bed': 9, 'sink': 10, 'laptop'...
e6216702c28894d19591bc00214b1c731b496734c70a4a586700669bc418ca87
Python
5,494
186
import pandas as pd import numpy as np from cgatReport.Tracker import SingleTableTrackerRows from cgatReport.Tracker import SingleTableTrackerHistogram from cgatReport.Tracker import * from cgatReport.Utils import PARAMS as P from IsoformReport import * class imagesTracker(TrackerImages): '''Convience Tracker ...
f731a79ccc77517b16320a317d52979f1ff0a90d184695a20b9a43487d2ee606
Python
5,495
155
from ChipseqReport import * import Annotations ########################################################################## ########################################################################## ########################################################################## # Looking at distance ########################...
eef59499984d206466b86d86ba8ea02d7b18d55fc74ca50fde1b186313fbfec3
Python
5,496
104
import matplotlib import matplotlib.pyplot as plt import numpy as np from FiguresFunctions.FiguresPattern import * font = {'size' : 16} matplotlib.rc('font', **font) name = ['Symmetric LTD'] name_J = ['No Inhibition', 'Bilateral Inhibition', '2 -> 1', '1 -> 2'] def path_name(Apostpre,Aprepost,J_matrix,P,epsilon,h...
56a2eb22dde9f58bfba0d7e142f85f94de70a15e46b95b44f8b98f04e4e473e7
Python
5,501
139
# Copyright 2020 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
235466680400e48bde88c5b72b8f33b5115edaba105c370fb78f90432019535e
Python
5,503
134
#pylint: disable=E1101, E0401, E1102, W0621, W0221 import argparse import numpy as np import torch import torch.nn as nn import torch.optim as optim import time from random import SystemRandom import models import utils parser = argparse.ArgumentParser() parser.add_argument('--niters', type=int, default=2000) parser....
dfb31711d267ae0b2c478db60cb77c663f82541fecde293d971ec8190dd7882f
Python
5,503
170
import pathlib import re import numpy import pytest from openff.utilities import has_package, skip_if_missing from openff.toolkit import Molecule, unit from openff.toolkit._tests.create_molecules import ( create_acetaldehyde, create_cis_1_2_dichloroethene, create_cyclohexane, create_ethanol, creat...
2736d92cb106e736c9684178fab5429fd683ef98987d4cbbd5748f413fd74df2
Python
5,506
141
"""Compatibility wrapper for Ax optimization APIs. Provides an `optimize` function with the historical managed_loop signature, implemented on top of `ax.api.client.Client`. """ from __future__ import annotations from typing import Any, Callable try: from ax.api.client import Client from ax.api.configs impor...
2effb9a299d0e59957e2adf9812b7ad36f2a0ea0906073cda22809bf32a10cd3
Python
5,507
158
""" recommend_frames.py: search and determine optimal reference frames to annotate for ZephIR. Determine median frames to recommend as reference frames via k-medoids clustering based on thumbnail distances (see build_pdists). Clustering is done iteratively, such that one cluster is determined at a time. n_iter > 0 wil...
471dfd818eac9882c7dacec35b5bed57050374d9a8a7df974c6234611e8e0fae
Python
5,508
197
import gzip import io from skbase.base import BaseObject from skbase.lookup import all_objects from pgmpy.base import DAG from pgmpy.readwrite import BIFReader from pgmpy.utils.hf_hub import read_hf_file class BaseExampleModel(BaseObject): """ Base class for all models in pgmpy. Inherits from `skbase.b...
7f73dc236b0a6219d7178ec7f83a4f1c9705f399febf1d96b7f4d83cca843fe1
Python
5,511
188
from __future__ import annotations import logging from copy import deepcopy from pathlib import Path from typing import List import numpy as np from omegaconf import DictConfig, OmegaConf from libs.common.metrics import Metrics from libs.common.position import Position, Position2D, Position3D from libs.common.weight...
326639e646361d84bd6e4423ce4abda925b8e60875e480cb4333864149ece324
Python
5,514
177
"""Image prompt template for a multimodal model.""" from typing import Any, Literal, cast from pydantic import Field from langchain_core.prompt_values import ImagePromptValue, ImageURL, PromptValue from langchain_core.prompts.base import BasePromptTemplate from langchain_core.prompts.string import ( DEFAULT_FORM...
7d98b5c742338f17d5bdfa9098b72e7c5301fd3de12d4a3a462388502969089d
Python
5,530
142
"""unit tests for src/craniumpy_core/facial_cohort_link.py and facial_measurements_io.py - pure function tests, no FastAPI needed, same style as test_cohort.py. router-level plumbing (the /facial-measurements/ load endpoint) is covered separately in test_facial_api.py.""" from __future__ import annotations import io ...
bb76bcb29abf224483e47fa85837d98b34e5c9d7abb4bca99dd6fbdf06e38cfb
Python
5,530
135
import os import glob import numpy as np import matplotlib.pyplot as plt from utils.constants import ALL_MODELS from scipy.stats import iqr, linregress from paths import TRAINING_DATA_PATH, TEST_DATA_PATH from utils.distribution_distance import compute_jsd, compute_kld def compile_distance_measures(data_path): ou...
781e79956dd1c176e55dfa008a2d3f1a683fb8fea5cdc38d6c1edf6b30a60536
Python
5,537
193
import tempfile import time from pathlib import Path import matplotlib import numpy as np import pytest from matplotlib import pyplot as plt from scipy.cluster.hierarchy import linkage from astrocast.autoencoders import CNN_Autoencoder from astrocast.helper import DummyGenerator from astrocast.reduction import Featur...
ca4e8425eee134c6824aeff155cdf9fc0da2b5d63927b91a7598f0bf71cb3462
Python
5,537
195
from ChipseqReport import * # for trackers_derived_sets and trackers_master if not os.path.exists("conf.py"): raise IOError("could not find conf.py") exec(compile(open("conf.py").read(), "conf.py", 'exec')) class SNPSlicer(ChipseqReport.DefaultTracker): def getSlices(self, subset=None): return self...
e24e8a44996bce12d10933db47c2704b3577edfdb6c811ff7a22b44c426e8cd3
Python
5,539
193
import numpy as np import tensorflow as tf from tensorflow.keras import Model from tensorflow.keras.layers import Activation, Add, Dense, Input, \ LayerNormalization, Subtract from explainability import LRP # def test_non_sequential_model(): # i1 = Input((5,)) # d1 = Dens...
9408b23be9c18bf4e8164f751560959e1887572fa27e95e7e5e4ed04c06ec854
Python
5,540
156
from neuron import h from bmtk.simulator.bionet.io_tools import io from bmtk.simulator.bionet.default_setters.cell_models import fix_axon_peri, fix_axon_allactive, \ set_params_allactive, fix_axon_perisomatic_directed,get_axon_direction import numpy as np def set_params_allactive_AIS_seg(hobj, para...
e2788cce1fad7997b99749f7291a8a8a93322c9123fd04cd526864f4b6cf431b
Python
5,540
124
import numpy as numx import pydeep.base.numpyextension as numxExt class DBM_model(object): def __init__(self, layers): ''' This function initializes the weight layer. :Parameters: model: Model, basically a list of layers -type: Weight_layer ...
d3b074a20e0b8d38333d6b6cf7d65a37c0341d5879551161075b903fabc214cd
Python
5,542
195
"""**Tools** are classes that an Agent uses to interact with the world. Each tool has a **description**. Agent uses the description to choose the right tool for the job. """ import warnings from typing import Any from langchain_core._api import LangChainDeprecationWarning from langchain_core.tools import ( BaseT...
57211219759d9ed02806bd1dc111bd457bd8cb5239c4af8809df99ea86322555
Python
5,543
173
# -*- coding: utf-8 -*- """ Created on Mon Jan 16 11:04:35 2023 @author: dell """ import tensorflow as tf from tensorflow.keras.models import Model import tensorflow.keras.layers as klayers import tensorflow.keras.models as kmodels import tensorflow.keras.backend as kbackend from tensorflow.keras.layers...
8f4a5951844201364e5d7d90d8b4cc11d285c17361e72adb1d23c320c0c43515
Python
5,548
154
#################################################################################### # # 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...
a5ed9dc172b0e0f993fb029f9b246904ae4020f1c3f5947685661c0f36cd45be
Python
5,548
155
from enum import Enum from typing import Any from langchain_core.callbacks import ( AsyncCallbackManagerForRetrieverRun, CallbackManagerForRetrieverRun, ) from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever from langchain_core.stores import BaseStore, ByteStore fro...
027a000e62347614e73fe516b52bb1f156ade0d6dca2735c850b327ec61b0758
Python
5,549
157
#################################################################################### # # 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...
a82f4636fcb807d1aac80a214454dc757477a4c8123ee58d46e2bb5c79073a07
Python
5,549
143
from typing import Union import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd from . import stats def read_csv(filename: str) -> dict: raw_results = {"Experimental": {}, "Calculated": []} expt_block = False calc_block = False with open(filename, "r") as f: ...
200b731def0e55dd3f87d1cd283d3e14248ac1fa9163422b45ef5dbe64b1033b
Python
5,550
119
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Main program running KINNTREX This program accepts three inputs input: Param_fName: parameter file name Save_Path: The path in which the program saves the out put information Sample_Name: Uses the sample name for picking the parameters that are relevant to...
e7d493431db9dfdcd8014db4b36ff4b47c5a55afa2965155c32a920dbb8fb94b
Python
5,553
157
# Python plugin that supports loading batch of images in parallel import cv2 import numpy import threading import os import struct import concurrent.futures from concurrent.futures import ThreadPoolExecutor, wait _imread_executor_pool = ThreadPoolExecutor(max_workers=16) class UnknownImageFormat(Exception): pass ...
4085c06010a67368b08bd73feeb40b1977e38f5b80183a452e9d48320068ac27
Python
5,555
134
import torch import torch.nn as nn from egnn.egnn_new import EGNN, GNN from equivariant_diffusion.utils import remove_mean, remove_mean_with_mask import numpy as np class EGNN_dynamics_QM9(nn.Module): def __init__(self, in_node_nf, context_node_nf, n_dims, hidden_nf=64, device='cpu', ...
489312ace37e6558c141c3eb6d58b9060dba115aefe66c3f95baf7629b276f6d
Python
5,557
156
from __future__ import annotations from typing import Annotated, Any, TypeVar from langchain_core.exceptions import OutputParserException from langchain_core.output_parsers import BaseOutputParser, StrOutputParser from langchain_core.prompts import BasePromptTemplate from langchain_core.runnables import Runnable, Run...
aac790af5f8677c30ecfc680f19f2352cf6686eac884f77af2010de0cf816a96
Python
5,557
166
'''utilites for generating tf.data.Dataset pipelines from tfrecords generated, e.g. by .tfrec_utils ''' from glob import glob from math import ceil import tensorflow as tf from .tfrec_utils import count_samples_in_records def random_patch(patch_size): '''constructs a patch sampling function. ''' def _c...
9dc70f72e04e286eae6f95a83885ee55de4a2afcc06bf50348492ed579f3b329
Python
5,559
137
import torch import numpy as np from ._base import register_transform, _get_CB_positions from rde.utils.protein.dihedral_chi import CHI_PI_PERIODIC_LIST from rde.utils.transforms.noise import transform_15to37, get_dihedral @register_transform('corrupt_chi_angle') class CorruptChiAngle(object): def __init__(self...
53f9c8abae1e38c62298e73cddb2d04338730f276d6116e36ace894d7f2f9e38
Python
5,560
167
import torch import numpy as np import matplotlib.pyplot as plt plt.rcParams['savefig.format'] = 'pdf' plt.rcParams['savefig.transparent'] = True plt.rcParams['savefig.bbox'] = 'tight' plt.rcParams['savefig.directory'] = '~' from data import generate_recog_data from net_utils import load_from_file from plo...
1985d3a523c7541106972b2e261deced0a262197ac1063b8642c91b9192a6fbc
Python
5,561
195
'''submit.py - run a collection of qsub scripts on the cluster =========================================================== Purpose ------- This script will submit a collection of qsub scripts on the cluster. The script will only submit those jobs for which a result is not present. Usage ----- For example:: pyt...
0f3479d0ad9204d95eebc4e1f630cf87a2fcd575f6067f18e74d8780e7a76593
Python
5,562
177
import torch import torchvision from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils import torch.optim as optim import torchvision.transforms as standard_transforms import numpy as np impor...
5b7e1f79a83649d7fb32ca511910442f16f44773c037ea0dd6750b6829638a9a
Python
5,562
160
import os import functools import pickle import multiprocessing as mp import glob import numpy as np import mdtraj as md import torch import click class ImproperlyConfigured(Exception): '''The given configuration is incomplete or otherwise not usable.''' pass #Give me ipath to trajectories, indices, path to...
95bbc3aafa3117fa56e910e6218f13d79a45dc64fa1a99bbface97bbe4de83b4
Python
5,563
177
from pathlib import Path from unittest import SkipTest, TestCase import numpy as np import pytest import torch import chroma from chroma.data import Protein from chroma.layers.structure.backbone import impute_masked_X from chroma.layers.structure.mvn import ( BackboneMVNGlobular, BackboneMVNResidueGas, Co...
9cae892e7251ea5cd614c6b0f1d716c0b4206816ed3d2bd4cba1a20378291e3a
Python
5,565
157
import numpy as np from collections import namedtuple from numpy import array, float32 from src.PID import discretize def get_FF_activations(df): """ """ transition = namedtuple('transition', ('observation', 'activation', 'reward')) configuration = namedtuple('configuration', ('episode', 'buffer', 'su...
02b6656dedd29b01217f5aba026f6d3b2c0515cfccdb2873d40f69572e3daa6f
Python
5,568
173
""" Train/test split for deepsignal extract output; additionally sample train/validation datasets. """ import multiprocessing as mp import sys import pandas as pd sys.path.append('..') from utils.constants.final_analysis import NUM_FOLDS from utils.constants.final_analysis import DS_EXTRACT_COLS def split_sample_e...
4d1b294bb7e699e2c0b481a358254aa042f51394996048196b5f9f3953fda9ee
Python
5,570
154
# -*- coding: utf-8 -*- """ Created on Wed Feb 20 19:24:58 2019 @author: Vinícius Rezende Carvalho """ import numpy as np def VMD(f, alpha, tau, K, DC, init, tol): """ u,u_hat,omega = VMD(f, alpha, tau, K, DC, init, tol) Variational mode decomposition Python implementation by Vinícius Rez...
dd53e2c4d81e520f0b0499bc00e564d3407de4d08e2fde547bb0a4fabd5d88bf
Python
5,571
147
import pandas as pd import numpy as np import cv2 import torch from torchvision import transforms from torchvision.utils import save_image from torch.utils.data import DataLoader,Dataset from joblib import Parallel,delayed from tqdm import tqdm import matplotlib.pyplot as plt from engine import utils from constants im...
ae16bdb5700cad4eed9c5c8402a580c17b623d6fab40379038eb0e37cb80a995
Python
5,575
181
"""Evaluators for parsing strings.""" import json import logging from collections.abc import Callable from operator import eq from typing import Any, cast from langchain_core.utils.json import parse_json_markdown from typing_extensions import override from langchain_classic.evaluation.schema import StringEvaluator ...
121ab1857229e71006a98c25c9f8115282a969c94d2c2354f0c039bbfbd9b46f
Python
5,579
161
import json import pytest from langchain_core.load import load, loads from langchain_core.prompts import PromptTemplate from langchain_core.prompts.dict import DictPromptTemplate def test__dict_message_prompt_template_fstring() -> None: template = { "type": "text", "text": "{text1}", "ca...
9a1ea59baafab6b108a13c81767169ed958da0966eff99d1a65eddaf6dfc3684
Python
5,581
181
from collections.abc import AsyncIterator, Callable, Iterator, Sequence from typing import ( Any, TypeVar, ) from langchain_core.stores import BaseStore K = TypeVar("K") V = TypeVar("V") class EncoderBackedStore(BaseStore[K, V]): """Wraps a store with key and value encoders/decoders. Examples that ...
27fa855c0ffe46f3e8c8cd99436efd452078cda38c191ae375c09089d65e92b7
Python
5,588
107
import numpy as np import pyemma as pe import h5py import logging logging.basicConfig(encoding='utf-8', level=logging.INFO) from src.utils import update_yaml from config.paths import TRAJECTORY_PATHS_TEMPLATE, TOPOLOGY_PATH_TEMPLATE, MINDIST_PATH_TEMPLATE, INFO_PATH_TEMPLATE, CLUSTER_AVG_PATH_TEMPLATE, MODEL_OUTPUTS_PA...
3eece6848deb6ba05a1bf7c97614075259213f42029627026ba568e8e0df6e91
Python
5,589
152
import numpy as np from joblib import Parallel, delayed from scipy.interpolate import interp1d from scipy.special import erf, erfinv from sklearn.base import BaseEstimator, TransformerMixin from sklearn.utils.validation import FLOAT_DTYPES, check_array, check_is_fitted class GaussRankScaler(BaseEstimator, Transformer...
156d13df6b194e913423a353f240da692731b35ddeccf1b3a85076d2607875a0
Python
5,590
140
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from rdkit import Chem from torch_geometric.data import Data # allowable node and edge features from utils.geometric_graph import ATOM_ENCODER allowable_features = { 'possible_atomic_num_list': list(range(1, 119)), 'possibl...
229b573db0f8488cb36379081c6d6f850531948dd35bc2c10645b7a6b2dd1939
Python
5,593
91
"""General-purpose training script for image-to-image translation. This script works for various models (with option '--model': e.g., pix2pix, cyclegan, colorization) and different datasets (with option '--dataset_mode': e.g., aligned, unaligned, single, colorization). You need to specify the dataset ('--dataroot'), e...
a5e25fa152d88bcef8264eb2ac9d4c3775d3f719da062978d6a72463ecb98094
Python
5,604
176
'''MobilenetV2 in PyTorch. See the paper "MobileNetV2: Inverted Residuals and Linear Bottlenecks" for more details. ''' import torch import math import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable def conv_bn(inp, oup, stride): return nn.Sequential( nn.Conv3d(inp, ...
b09fc3208f6fed56bb3b2e9b6aaf419c837098435843f8949bf13d293c1b4e8c
Python
5,604
161
import os import pickle import numpy as np import torch import utils from dopp import FeedForwardCell def train(params, model, model_target, *, manual_grad=False): if not manual_grad: optimizer = torch.optim.SGD(model.parameters(), lr=params["lr"]) res = {} res["g0"] = torch.empty(params["tria...
b39b41d36228442b31dd5c14304d65fc210659b4e1debee64fe2ceb885346ae9
Python
5,604
151
#!/usr/bin/env python import os import sys import json import argparse from Bio import pairwise2 from Bio.pairwise2 import format_alignment from Bio.Align import substitution_matrices from Bio.PDB import PDBParser from Bio.SeqUtils import seq1 arg_parser = argparse.ArgumentParser() arg_parser.add_argument("structure_p...
b002e12fee48231d31be244963deb5be41aa872281d61916c1b8dda2489db8e8
Python
5,606
164
# Rdkit import should be first, do not move it try: from rdkit import Chem except ModuleNotFoundError: pass import utils import argparse from configs.datasets_config import qm9_with_h, qm9_without_h from qm9 import dataset from qm9.models import get_model from equivariant_diffusion.utils import assert_correct...
b76f25d00adcef0bae0c3386fa819e3a13056ebde53a7b2ec70a95be1bdb038b
Python
5,606
162
import os import sys import re import types import itertools import numpy import Annotations from cgatReport.Tracker import * from PeakcallingReport import * ########################################################################## ########################################################################## ##########...
0c1f5ea0dd0a8981a662070153a9a12a5f855b3791c3e0e8f4977b28253c9b41
Python
5,607
139
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 2 13:03:58 2021 @author: cxue2 """ import os os.environ['CUDA_VISIBLE_DEVICES'] = '3' import pandas as pd import numpy as np import tqdm from tsnecuda import TSNE from cupyx.scipy.ndimage import zoom import cupy import sys sys.path.append('../De...
cb68b671704c24f68a4e93de108200423f16dabd6cb0dd6fe0779d59c072f7eb
Python
5,612
150
from pathlib import Path from unittest import TestCase import numpy as np import torch import torch.nn.functional as F import chroma from chroma.data import Protein from chroma.layers.structure import geometry class TestDistances(TestCase): def test_sample(self): distances = geometry.Distances() ...
c2d7b40ca404819b627ab1ce95e341a139bf81bdab6c10a2709efa09a1f3bc72
Python
5,614
165
'''ShuffleNet in PyTorch. See the paper "ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices" for more details. ''' import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable def conv_bn(inp, oup, stride): return nn.Sequential( nn...
0715119672055bec4d13c1fc0c7e93ef869dcefbfb207d09d62c7393aad26108
Python
5,617
169
from collections.abc import Iterator from langchain_core._api import deprecated from langchain_core.language_models import BaseChatModel, BaseLanguageModel from langchain_core.messages import HumanMessage, SystemMessage from langchain_core.output_parsers.openai_functions import PydanticOutputFunctionsParser from langc...
b5652dd1913ccc31c7672bfdfbd899667371c52a7a42f65257db6da1981b7380
Python
5,618
157
#################################################################################### # # 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...
c8c1cffd9c0075a3866eb8c8c103bf4e519c6c9ee7050117513225ee752d6339
Python
5,618
116
import warnings import os import numpy as np import pandas as pd from copy import copy warnings.filterwarnings("ignore") class Omicscope_Snapshot(): from .GeneralVisualization import PPInteractions from .GeneralVisualization import bar_ident from .GeneralVisualization import volcano def __init__(se...
3b1f65a8e7a0ca99ee5b5223e24c959f5b956125de8b40cdf02f668a80aa4ae1
Python
5,620
131
from typing import Optional, Callable, Union from torch_geometric.typing import OptTensor, PairOptTensor, PairTensor, Adj import torch from torch import Tensor from torch.nn import Parameter from torch_geometric.utils import remove_self_loops, add_self_loops from torch_geometric.nn.conv import PPFConv def get_angle(v...
09de8be8a331fcf1e6b1418538e7d820edb48012ff6113746dcde9cc89a5af10
Python
5,623
93
import matplotlib.pyplot as plt from Simulator.Pattern import pattern_DMS from Simulator.SimulatorPattern import simulatorPattern from Articles.DMS_DLS.Code.FiguresDMS import * from datetime import datetime class simulatorPatternDMS(simulatorPattern): def init_pattern(self): self.reward_trace = np.zero...
085ffd06d417da7b4dd100204e529385cfb173786ac5b4d23638914c5cbae4ec
Python
5,625
137
# 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...
21db93d2707349f0631672d4894188fd934115fbd17114b995091c0b9350f334
Python
5,630
159
import logging import os from typing import List import Bio.PDB import numpy as np import torch from scipy.spatial import distance_matrix from src import constants from src.constants import _3to1 from src.utils.cif2pdb import cif2pdb from src.utils.secondary_structure import renum_pdb_file, \ calculate_ss, make_s...
2c793b825305b92b15403326d3f4420d6314d059e1f6dc20bbafddb4b6bf3812
Python
5,632
157
"""Derivations of standard content blocks from Groq content.""" import json import re from typing import Any from langchain_core.messages import AIMessage, AIMessageChunk from langchain_core.messages import content as types from langchain_core.messages.base import _extract_reasoning_from_additional_kwargs def _popu...
7e74ae5b4f5d4ab86d014d889b6abf6b7d4ac5ac858de9d9b4e2bd731a9e2200
Python
5,635
139
import numpy as np from sklearn.decomposition import PCA import nltk import csv, os, re import h5py, json, pickle import pkg_resources from symspellpy import SymSpell, Verbosity np.random.seed() # randomly initialize the seed homedir = '' ### path of home directory sym_spell = SymSpell(max_dictionary_edit_distance=2...
2103d8e472b378d8d464507c117afd80f2df452e0e942bb97fa1b92b6f936024
Python
5,636
182
import odl import torch from warnings import warn from copy import deepcopy from odl.contrib.torch import OperatorModule from odl.tomo import fbp_op from odl.operator.operator import OperatorRightScalarMult from odl.operator.default_ops import ZeroOperator from dliplib.reconstructors.base import BaseLearnedReconstru...
5a798517d6abefa906e6fd005c9d7bc020fa66e31d270949d80df7b6079b3bd5
Python
5,637
123
# 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...