sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b555d037a43c7febc35e1bbd09c949191fc4e42f3941d648aa62438a6ba42558 | Python | 12,294 | 353 | import torch
import numpy as np
import seq_des.util.data as data
import seq_des.util.canonicalize as canonicalize
import seq_des.util.voxelize as voxelize
import common.atoms
import torch.nn.functional as F
from torch.distributions.categorical import Categorical
def get_idx(filename):
# get variable or fixed in... |
b698a591725d456e9c89b09d8b99553b104024ea4ae4287f1d9c2caedd986029 | Python | 12,295 | 274 | 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
... |
d88dda0df3b701a46419af10d856f12b90daca12401f84d44aaf962084f60dc5 | Python | 12,295 | 410 | """Fixtures used for testing."""
import numpy as np
import psims
import pytest
import yaml
from pyteomics.mass import calculate_mass, fast_mass, std_aa_mass
@pytest.fixture
def mgf_small(tmp_path):
"""An MGF file with 2 annotated spectra."""
peptides = ["LESLIEK", "PEPTIDEK"]
mgf_file = tmp_path / "small... |
7bfb2b023023f5b8f5d4b0a663bf774a5c5b735168cbf5d2c3fb0b9fd7969ae5 | Python | 12,300 | 333 | """Tests for LangSmith gateway configuration resolution."""
from typing import Any
import pytest
from pydantic import BaseModel, ConfigDict, Field, SecretStr
from langchain_core.utils._gateway import (
GatewayConfig,
_apply_gateway_config,
_parse_gateway_metadata,
_resolve_gateway_base_url,
_reso... |
cf45d73b2d9007183b2e273df435358023d945dddaa76069d183586f49d2d2b1 | Python | 12,303 | 344 | """=========================================
Read Mapping parameter titration pipeline
=========================================
* align reads to the genome using a range of different parameters
* calculate alignment statistics
Requirements
------------
On top of the default cgat setup, the pipeline requires ... |
ae730fddd8a42403da635c64f3e9d7874f178ab248440fc51d08939f034f7cb1 | Python | 12,304 | 433 | """===========================
Geneset analysis
===========================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Overview
========
This pipeline performs gene set analysis of one or more
genesets.
Input data are two collections of files, genelists and pathways.
Genelists are tabular d... |
7647b3cae13a7920ff377cbb4a78844cd0d8bc8c50d3f30e8e894cdf2b1392a1 | Python | 12,305 | 392 | #!/usr/bin/env python
# This file is a part of the `allegro` package. Please see LICENSE and README at the root for information on using it.
"""Minimal autotuning rig for TritonContracter."""
import torch
from ase.build import bulk, make_supercell
from e3nn import o3
from nequip.data.transforms import NeighborListTr... |
8862cf97ff9de1de29192b026a5f59f65211ea8933d362f5368c34d0c8604885 | Python | 12,306 | 343 | #!/usr/bin/env python3
# The MIT License
# Copyright (c) 2025 Genome Research Ltd.
# Author: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software witho... |
1d281c89b786f3cf1bc38bf7f4698019116c326d3c3ef3e184da1f870a84a1cd | Python | 12,307 | 309 | # -- coding: utf-8 --
# @Time : 2022/12/17 14:02
# @Author : Biao Zhang
# @Email : littlebiao@outlook.com
# @File : load_mouse_2020sa.py
import numpy as np
import pandas as pd
import difflib
from collections import Counter
import json
import scanpy as sc, anndata as ad
from scipy.sparse import csr_matrix
def string_s... |
0284e9221144db9a32ad1b1043f48251f2d440aa1ab158e8d238a0c6e2ec239d | Python | 12,314 | 319 | import re, math
import torch
import numpy as np
from scipy.linalg import sqrtm
import scipy
from tqdm import tqdm
from itertools import product
valid_vocab = {
'A': 7,
'C': 8,
'G': 9,
'T': 10,
'N': 11,
}
DNA_vocab = {
'A': 7,
'C': 8,
'G': 9,
'T': 10,
}
index_mapping = {
valid_vo... |
d451b71424dfe6de9a85d55eb4169190bbd58d3594545cd800d2628b5bf4d416 | Python | 12,318 | 325 | #Native to python
import pickle
import os
import shutil
import click
import yaml
import multiprocessing as mp
#third-party libraries
import numpy as np
import mdtraj as md
#diffnets libraries
from diffnets.analysis import Analysis
from diffnets.data_processing import ProcessTraj, WhitenTraj
from diffnets.training impor... |
634043daaeff34456a460cbf08b6ab08aef08f0c7631c19b65082cb9da3477c9 | Python | 12,319 | 287 | # Rdkit import should be first, do not move it
try:
from rdkit import Chem
except ModuleNotFoundError:
pass
import build_dataset
from configs.datasets_config import pdb_protein
import copy
import utils
import argparse
import wandb
from os.path import join
from protein.models import get_optim, get_model
from equ... |
8aad1b757e950a95a20ec2d7a284d5b913232affd66ef93aad72fab49b203039 | Python | 12,322 | 204 | # 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... |
4181a5ddc84c944b7ad507c0cfcc5d980c5e4420f13859ca4ac2b00497bf04e3 | Python | 12,334 | 179 | """Tables and summary CSVs for the raw-derived corpus B (results/b4_*.csv, results/b12_*.csv, results/b4deep_point.csv).
tables/table1b_datasets.tex corpus-B overview (dataset, chemistry, format, cells, records, median cycles, share reaching EOL)
tables/table_physics.tex MAPE by protocol x feature set... |
0177627bde76b36df6b1f8e98c217faec4151221349553542353ea0b519fb9f8 | Python | 12,335 | 325 | import torch
import numpy as np
import torch.nn as nn
from timm.models.layers import trunc_normal_
from pdearena.models.transolver.model.Embedding import timestep_embedding
from pdearena.models.transolver.model.Physics_Attention import Physics_Attention_Structured_Mesh_2D
from pdearena.configs.config import CFDConfig
f... |
1e796219b662e7da18e21e2d2d22ad62e201fd8466eeef901e830f8035c2b43e | Python | 12,335 | 274 | 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
... |
dedcd3e80332fe14602b0b9f2911033e998b3ff138d8f753befd3e6d3170eb74 | Python | 12,339 | 269 | 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... |
0dcb65d785cbda5de59dd2b16cec06a8d511c2db8aad5a507149c2fcdb239dfd | Python | 12,340 | 246 |
"""
@author: Leonardo Bonetti (with the support of Francesco Carlomagno)
leonardo.bonetti@psych.ox.ac.uk
leonardo.bonetti@clin.au.dk
"""
#################### INFORMATION THAT MUST BE UPDATED BEFORE RUNNING THE SCRIPT ####################
logdir = ('/home/stimuser/Desktop/PatternRecognition_Leonardo/Data_collecti... |
5da2504b9a1ab1273b8da6571ee5f2d9af80ecb5f12da73584212b21a4d4dad9 | Python | 12,350 | 359 | # 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
#... |
eb881f72bc7430675602369884a6e7f1308acd57f7c7459ce9fee3e3be8ebc96 | Python | 12,357 | 332 | import os
from pyexpat import model
import yaml
import sys
import argparse
import shutil
# from pickle import dump
# from pickle import load
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.impute import SimpleImputer
# from sklearn.model_select... |
6cbbb6b77c2c4920ef432b47e2989f59105ea87aac2c589d9264892d6b224e26 | Python | 12,359 | 348 | from SMdRQA.RQA_functions import entropy
from SMdRQA.RQA_functions import average
from SMdRQA.RQA_functions import maxi
from SMdRQA.RQA_functions import mode
from SMdRQA.RQA_functions import percentmorethan
from SMdRQA.RQA_functions import diaghist
from SMdRQA.RQA_functions import onedhist
from SMdRQA.RQA_functions imp... |
813cb02788af7cdc3310d6bdf6c54b10d578646d8af5c60b5b8b269ecd527e36 | Python | 12,359 | 312 | # 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... |
b1ab214357c061949fffe57ca080056bd5b8f11c4cb99f73450ff2d2232c4b7a | Python | 12,361 | 341 | import os
import pickle
from itertools import chain, repeat
import networkx as nx
import numpy as np
import pandas as pd
import torch
from ogb.utils.features import atom_to_feature_vector, bond_to_feature_vector
from rdkit import Chem
from rdkit.Chem import AllChem, Descriptors
from rdkit.Chem.rdMolDescriptors import ... |
8d697fc89c42ddf0527e925a8802305e1923bf5ee4c040fc7f6736903c301c77 | Python | 12,363 | 356 | import torch
from torch.utils.data import DataLoader
import csv
from dateutil import parser
import numpy as np
import time
import random
import os
class StructureDataset():
def __init__(self, pdb_dict_list, verbose=True, truncate=None, max_length=100,
alphabet='ACDEFGHIKLMNPQRSTVWYX'):
alphabet_set... |
1253f4e65bd0c524d93b6a31974cddf30ab205a5d2c856dbbc91f5eac7487a21 | Python | 12,364 | 368 | """
Created by
@author Shengze Cai
Modified by
@author Mitchell Daneker
Contact Mitchell Daneker with any questions via mdaneker@seas.upenn.edu
"""
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
import tensorflow as tf
if tf.__version__ >= "2.0.0":
import tensorflow.compat.v1 as tf
tf.disable_v2_beha... |
ff905ce8a25b04cecdaebf27fd2933990d5a07b0906310b2e6e2e504d462e923 | Python | 12,372 | 307 | """Provider-side tool search middleware."""
from __future__ import annotations
import warnings
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeAlias
from langchain_core.tools import BaseTool
from typing_extensions import NotRequired, TypedDict
from langchain.chat_models.base import _a... |
54bab7c4680e0b45f0546f55fffe3df914be2eaa7408dbdf55a0693d3150c3c4 | Python | 12,373 | 466 | """
Serialization mix-in
.. todo ::
Currently, the ``openff-toolkit`` toolkit package requires a number
of dependencies to support all of these serialization protocols.
Instead, should we not include these by default, and instead raise
a helpful exception with installation instructions if one of the
se... |
fe1361ccaf87be1e9b72dcdb6722f980308a6dec1b7795e2c0cf50fd88ba7330 | Python | 12,377 | 310 | import pandas as pd
import numpy as np
import sys, os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import keras
import keras.backend as K
from tensorflow.keras.utils import to_categorical
... |
018256a0d55b18cf59418f2efacd5d315544c0699e51688cf7e5de72f036c758 | Python | 12,386 | 356 | # 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... |
f68ba2650e9d957046a1fc7af2baebb44b5eef87a1ca3dd09e690c422f860f30 | Python | 12,386 | 281 | file_name = 'CellJ.json'
Step = 0.1 #ms
Edel = 100 #ms
stopTime = [10000] #ms
rangesL = [10000] #phase calculation crop limit low
rangesH = [-10000] #phase calculation crop limit high
signalInd = 0
import pycircstat
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import efel
from sc... |
bc46e76b9f3a445c352872796e33c3b2b09eae3a3aa8bbf61e2ab990da507822 | Python | 12,388 | 263 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import pdb
import torch
from torch import nn
from functools import partial
from pdearena.modules.activations import ACTIVATION_REGISTRY
from .condition_utils import fourier_embedding
import numpy as np
class ConvBlock(nn.Module):
def __ini... |
f6764e399a8f5db8d5c2ba278d43bc54793dec9c236a91d5c7133d1f97758853 | Python | 12,391 | 392 | # imports
import os
import subprocess as sp
from platform import system
import warnings
import numpy as np
import torch as tr
import pandas as pd
from sincfold.embeddings import NT_DICT
from sincfold import __path__ as sincfold_path
from sincfold.embeddings import NT_DICT, VOCABULARY
CT2DOT_CALL = f"export DATAPATH... |
79ca865140b1d99ddef62f93b4535b1d68aa98ce2e6450a113df54d0d38df2df | Python | 12,407 | 328 | 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
import cProfile, pstats, io
import Bio.Data.CodonTable as bdc
from itertools ... |
4224f99939c888133119be795b1d53fd3778ad0b15c38e61a165e5f40ea9b5fb | Python | 12,409 | 405 | from langchain_core.messages import AIMessage, AIMessageChunk, HumanMessage
from langchain_core.messages import content as types
def test_convert_to_v1_from_bedrock() -> None:
message = AIMessage(
[
{"type": "thinking", "thinking": "foo", "signature": "foo_signature"},
{"type": "te... |
8c725d5df10147a57c1c3ca967690aa0fd2ea3e9d1f0f11b6930be661603cc9a | Python | 12,419 | 329 | ####################################################################################
#
# 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... |
eb321f22b32af54f2a0073bfd5f44365f6bcb95074df3f14c6740719f52a5ad5 | Python | 12,436 | 281 | import numpy as numx
import pydeep.base.numpyextension as npExt
from pydeep.base.activationfunction import Sigmoid
import pydeep.rbm.model as RBM_MODEL
import pydeep.rbm.estimator as RBM_ESTIMATOR
def _partition_function_exact_check(model, batchsize_exponent='AUTO'):
''' Computes the true partition function for t... |
e6a06cbe009c274d1713179c5dd4244bbd68226af78e5d09413c280368ea8f63 | Python | 12,441 | 238 | import argparse
import os.path
def main(args):
import json, time, os, sys, glob
import shutil
import warnings
import numpy as np
import torch
from torch import optim
from torch.utils.data import DataLoader
import queue
import copy
import torch.nn as nn
import torch.nn.functi... |
a266f0835f2aa5b978231f7218e6d17bbb423f2541ef8a6744713a256edd61d4 | Python | 12,443 | 302 | # -*- coding: utf-8 -*-
ModulePy= str('NMF_example.py')
"""
Description: simple code (example) for NMF demixing used in fluorescence speckles (fully evolved speckles) written by Fernando SOLDEVILA.
- Input files:
(i) raw_ensemble_video_data.mat [videodata_ddmmyyyy_001.mat]
(ii) ground_tru... |
b887470f6de18c47854290b587c20e71c1f54cd10ad4874804325bba527e14d6 | Python | 12,448 | 217 | import numpy as np
import InitFunctions
from NetworkModel import networkClass
from NeuronModel import stim, poissonPop
from WeightModel import synapticClass, spikeBased, STDP, weightClass
from NetworkModel.StriatumNeurons import find_params_neuron
class patternRecognition(networkClass):
parameters = {'P': 1,
... |
728f4949edd300fe6a7fadf67a57eb38660a0453223b7d597b9568e5262f182c | Python | 12,456 | 264 | """longitudinal/follow-up comparison endpoints: a per-vertex diff/heatmap
between two already-correspondent meshes, the same measurement suite the
Patients workspace's Analysis tab shows (run directly on an arbitrary
already-registered mesh, no session /run needed), and a two-timepoint PDF
report.
deliberately doesn't... |
7cf2ae28923bf5fb895250ea047ae35f35165d24ced97d9d954c71f4044731c9 | Python | 12,457 | 309 | import io
import numpy as np
import os
from PIL import Image
from scipy import interpolate
from typing import Callable, List, NamedTuple, Optional, Sequence, Tuple
import skimage.measure
from scipy import stats
def estimate_image_avg_entropy(image: np.ndarray) -> float:
entropy = (estimate_entropy(image) + est... |
92d9e31f76a6ef2e6b2ffff78a04375c1b7d7da29c45ba939c628dd261528765 | Python | 12,460 | 333 | """Chain for applying constitutional principles to the outputs of another chain."""
from typing import Any
from langchain_core._api import deprecated
from langchain_core.callbacks import CallbackManagerForChainRun
from langchain_core.language_models import BaseLanguageModel
from langchain_core.prompts import BaseProm... |
90cdf1278dba1c8fef49ab9fa14ff249cd8af84d4b7dd90130b098b22290d49c | Python | 12,467 | 335 | """Compute Transfer Entropy per condition + CI + stats.
"""
import os
import numpy as np
import xarray as xr
import pandas as pd
import argparse
from joblib import Parallel, delayed
from frites.io import logger
from frites.utils import nonsorted_unique
from frites.workflow import WfStats
from frites.core import copno... |
fabb9bdba18509a65c302cb41980d6847f1aa72cac7b15ad9d84ecd782480378 | Python | 12,471 | 326 | """Module for computing basic quantities from a spectral graph model: the forward model
Makes the calculation for a single frequency only. This variation separates the global
coupling alpha (in laplacian) and the local coupling alpha = 1. """
import numpy as np
def network_transfer_function(brain, parameters, w, us... |
077ba96fa9288a5b8e963ed99385e474adbbfb030c4a34a0f38d941b37b867f7 | Python | 12,477 | 282 | import numpy as numx
import pydeep.base.numpyextension as npExt
from pydeep.base.activationfunction import Sigmoid
import pydeep.rbm.model as RBM_MODEL
import pydeep.rbm.sampler as RBM_SAMPLER
import pydeep.rbm.estimator as RBM_ESTIMATOR
def _partition_function_exact_check(model, batchsize_exponent='AUTO'):
''' C... |
aa62f9b0cadc0090ab25d3f8575994dd8285add6a2af0c3d12faa031223bd40a | Python | 12,494 | 221 | ####################################################################################
#
# 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... |
49b737be744bcb79ed0e44e3a6aac4fc6f5f3a92b083dd8f93bf79a26d603f18 | Python | 12,504 | 284 | # Imports
import sys
import os
import argparse
import inspect
from datetime import datetime
import numpy as np
import sklearn
from tqdm import tqdm
from math import ceil
from time import perf_counter, process_time
import torch
import torch.optim as optim
try:
from torchdiffeq.__init__ import odeint_adjoint as od... |
502e695321228e5ca7479577bf619d54a67d74189922d2803d0797c1c51e2042 | Python | 12,512 | 358 | from __future__ import print_function, absolute_import
import os
import sys
import imp
import json
import shutil
import subprocess
import tempfile
from distutils.dep_util import newer_group
from distutils.core import Extension
from distutils.errors import DistutilsExecError
from distutils.ccompiler import new_compiler
... |
d2c5ec9a199c5a0e2cba6fec8eacf175a544bbcc1cb86eb7f6183425f44c6436 | Python | 12,516 | 280 | file_name = 'CellJ.json'
Step = 0.1 #ms
Edel = 100 #ms
stopTime = [20000] #ms
rangesL = [10000] #phase calculation crop limit low
rangesH = [-10000] #phase calculation crop limit high
signalInd = 0
import pycircstat
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import efel
from sc... |
29a2c514ef7fcf636dee4d8e200f08346bae6e6d3bb8619b8b00e651c3180d8b | Python | 12,522 | 340 | from synister.synister_db import SynisterDb
from synister.read_config import read_predict_config
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sn
import pandas as pd
import statistics
import os
def parse_prediction(predict_config):
db = SynisterDb(
predict_config["db_credentials"],
... |
8b824f8c01514a526c61888560a1a16d194a0a19daf5cfc091ac38f36ed5140a | Python | 12,524 | 301 | """Dataset class NIFTI3D
"""
import os
import pathlib
import pickle
import re
import numpy as np
from scipy.ndimage.morphology import binary_dilation, binary_erosion
import torch
from data.base_dataset import BaseDataset, get_transform
from torchvision import transforms
import nibabel as nib
from monai.transforms im... |
a0ac74443188998fb83c9d60ccb39e1623e5d27ed667fdfe835d915910caa644 | Python | 12,532 | 339 | import torch
import torch.nn.functional as F
import math
import numpy as np
class KANLinear(torch.nn.Module):
def __init__(
self,
in_features,
out_features,
grid_size=5,
spline_order=3,
scale_noise=0.1,
scale_base=1.0,
scale_spline=1.0,
enabl... |
1219adad99329c53eac6bd40288b59fee727332697895333e24f8b6aef7e7e75 | Python | 12,535 | 284 | 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 B... |
3b1c7a4843a4285e7e04208bb1bce7f17129c025fb635e291fe6632a484cb067 | Python | 12,540 | 287 | """Swappable backbones, CNN <-> ViT <-> autoencoder behind one interface.
The whole point of the revision: the model is a plug-in. ``build(spec, num_classes)``
returns a ``torch.nn.Module`` for any registered ``kind``; the rest of the pipeline
(``runner``, ``attribution``) never names a concrete architecture.
torch /... |
916109ea44cb933b2380e3c640f426440cd9a5687d4c8b900d69b53f8eb48cef | Python | 12,572 | 308 | from IdealObserver.IdealObserver import run_inference
import data_analysis_utils as dana
import model_learner_pos
import numpy as np
import scipy.stats
def expanded_if_needed(array, ndim_with_sessions=2):
# if the array contains a single session and does not have a dimension
# indexing the sessions, add one su... |
96acb889461597f75992bb3f5aed7bfc5e53fbecb39800738681740421b36373 | Python | 12,577 | 250 | # 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... |
fcba186c1caae634c1879b97030bd7a97b7d6aee1594a5706454682e0ea89a18 | Python | 12,587 | 264 | """
loading data from files
Author: jonas.braun@epfl.ch
"""
import os
import sys
import numpy as np
import pandas as pd
import pickle
from scipy.ndimage import gaussian_filter1d, gaussian_filter, median_filter
from twoppp import load, rois, utils
from twoppp.behaviour import synchronisation, fictrac, sleap
import par... |
6e155dc6aaea9807bb66001b11f86e4b641253edbfb29792f02ca5d908d7ae61 | Python | 12,590 | 288 | 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 B... |
daae8d872d9dfe1f5da124fc9f9e7ec74ba20526f3ed4b76b96449b5ba30e179 | Python | 12,592 | 238 | # Copyright (c) 2008-2026 the MRtrix3 contributors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Covered Software is provided under this License on an "as is"
#... |
9493d52f8b089df5305a9033b45b0da4cccc7325a82e7215af161bf834d8ad8d | Python | 12,619 | 294 | """tests for remesh.py.
test_repair_mesh_pymeshfix_reaches_watertight and
test_repair_mesh_trimesh_only_fixes_winding both check the actual difference
between the two repair methods rather than just saying so in a comment -
pymeshfix gets the real test mesh fully watertight, trimesh's own repair
only manages consisten... |
89787d717e7bf653b55ed78066ac0eb8ff56da36c6328f788fc261db2bf5033d | Python | 12,626 | 286 | # Rdkit import should be first, do not move it
try:
from rdkit import Chem
except ModuleNotFoundError:
pass
import argparse
import torch
import numpy as np
from tqdm import tqdm
from eval_follow_edm.datasets_config import get_dataset_info
from eval_follow_edm.analyze import analyze_stability_for_molecules
impo... |
d66f1ea72c1728bf539cc685e4b692d57681a1ec4165889d50301c14a18f9679 | Python | 12,626 | 285 | import os.path as osp
import h5py
import numpy as np
import warnings
from tqdm import tqdm
import torch
import torch.nn.functional as F
from torch_geometric.data import Data
from torch_geometric.data import InMemoryDataset
from Bio.PDB import PDBParser
import re
class BioLiPdataset(InMemoryDataset):
def __ini... |
4de1417bf18c4481474571474feddfd6e97448f1ed9ffdff6fda390eb38da4eb | Python | 12,627 | 283 | # This file is a part of the `allegro` package. Please see LICENSE and README at the root for information on using it.
from e3nn import o3
from nequip.data import AtomicDataDict
from nequip.model import model_builder
from nequip.nn import (
SequentialGraphNetwork,
ScalarMLP,
AtomwiseReduce,
Pe... |
8159a3dea581ae94d763b1df07cca72c998028aba3d281ec3c7e46b870a9cf58 | Python | 12,646 | 399 | import numpy as np
import pdb
from PIL import Image
import scipy.io as io
import os
import scipy.optimize as op
import copy
import shutil
import cPickle
def get_index_from_pos(dataset, x, y, z):
xi = ((np.array(x) - dataset.origin[0]) /
dataset.spacing[0]).astype(np.int).ravel()
yi = ((np.array(y) -... |
2b63c35024514204c423104dd624a7eb10a7d29ac74f066989964bce9b47eeaf | Python | 12,656 | 368 | from typing import Union
import warnings
import numpy as np
import torch
from e3nn.o3 import Irreps, FullTensorProduct
import hienet._keys as KEY
class AverageNumber:
def __init__(self):
self._sum = 0.0
self._count = 0
def update(self, values: torch.Tensor):
self._sum += values.sum... |
351f098192a3ad7b91d094a6775530841fd073a8e7377821cb9e9853bc0e64c2 | Python | 12,689 | 352 | """
This example shows how to use pycromanager to interact with the micro-manager core.
Aside from the setup section, each following section can be run independently
"""
from pycromanager import ZMQRemoteMMCoreJ
import numpy as np
import time
from arduino_triggering import TriggerTester
### Setup
trigger_arduino = Tr... |
4271e71cff386f2791136ca78142987692434520cd56e32edd1cf21396ac73cf | Python | 12,691 | 315 | import os, random
from tqdm import tqdm
import numpy as np
import pandas as pd
from torch_geometric.data import DataLoader
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
from sklearn.metrics import average_precision_score, roc_auc_score, mean_squared_error
... |
940f9cde38bc28f88cf440c561b71422e158ea2e50557584863f1a17725fff55 | Python | 12,728 | 287 | import sys;sys.path.append('../src')
from matplotlib import pylab
import pandas as pd
import numpy as np
import analyse_experiment as analyses
import joe_and_lili
from scipy.stats import wilcoxon
import pickle as pickle
from GeneralHelper import nice_figure, ax_label1, simpleaxis1
path = '../data/preprocessed_and_simu... |
43c50a7cd67c40f207887fd953520144c78c7f8f0fecab8dc1ff956a3c3a2649 | Python | 12,751 | 310 | import logging
import os
import socket
import sys
import numpy as np
import pandas as pd
from sklearn.metrics import explained_variance_score, r2_score
from sklearn.linear_model import Ridge
# from sklearn.kernel_ridge import KernelRidge
# from sklearn.linear_model import Lasso
# from sklearn.svm import SVR
# from sk... |
8b974177e660f1f77cce04f93adfef326474e56978d5fb1bf93561315387e3fc | Python | 12,752 | 280 | # Rdkit import should be first, do not move it
try:
from rdkit import Chem
except ModuleNotFoundError:
pass
import build_geom_dataset
from configs.datasets_config import geom_with_h
import copy
import utils
import argparse
import wandb
from os.path import join
from qm9.models import get_optim, get_model
from eq... |
0eedeb8648a461ffc83d28d628c65800b233c6d9330978f78bc5ee188074d746 | Python | 12,759 | 367 | import argparse
from pathlib import Path
from datetime import datetime
import logging
import quantities as pq
import neo
from neo.utils import get_events, cut_segment_by_epoch, add_epoch
from elephant.signal_processing import butter
from elephant.spectral import welch_psd
import numpy as np
import matplotlib.pyplot... |
f24027384cecb9f7093410fa328b8c4529e4914e298fd881aed98311a8a58259 | Python | 12,760 | 394 | """
===========================
Project 4 Pipeline
===========================
:Author: Ian Subery
:Release: $Id$
:Date: |today|
:Tags: Python
A pipeline to run various packages for detecting fusion transcripts in RNA-seq data.
Overview
========
The pipleline takes a set up reads in any legal format for tophat and ... |
607a7f67a4c4ae3844fb99ce39d6fdde8de355c7cd49b6d0cc3943d6c4739072 | Python | 12,762 | 268 | import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV, RandomizedSearchCV, RepeatedStratifiedKFold, cross_val_score
from sklearn.metrics import roc_auc_score
from xgboost import XGBC... |
ef7d0575524298ca1785b29d9a43d725b2539e90dc67598cd536efc2edf71be9 | Python | 12,774 | 399 | """`BasePrompt` schema definition."""
from __future__ import annotations
import warnings
from abc import ABC, abstractmethod
from string import Formatter
from typing import TYPE_CHECKING, Any, Literal, cast
from pydantic import BaseModel, create_model
from typing_extensions import override
from langchain_core.promp... |
bd49d0cab5b3dfa01859345516c863b5a9cf060f84969bcca603d654aae11cda | Python | 12,781 | 263 | import numpy as numx
from pydeep.base.activationfunction import Sigmoid
import pydeep.rbm.model as RBM_MODEL
import pydeep.rbm.sampler as RBM_SAMPLER
class CD(object):
def __init__(self, model, batch_size):
# Set batch size
self.batch_size = batch_size
# Store model
... |
a5520c1368326761dbf83deb5679f49bb9df1dcf804802e16e31a1302dba0cfd | Python | 12,783 | 318 | '''
enrichmentgsea.py
=============================================
:Tags: Python
Usage
-----
This pipeline is a wrapper of script runGSEA.py (enrichment analysis
by using GSEA. Further
description is provided
... |
b0684363411cc67b8013a675f5d223847136b86a6780746e6fdf6dd6f6ce31d1 | Python | 12,790 | 263 | import numpy as numx
from pydeep.base.activationfunction import Sigmoid
import pydeep.rbm.model as RBM_MODEL
import pydeep.rbm.sampler as RBM_SAMPLER
class CD(object):
def __init__(self, model, batch_size):
# Set batch size
self.batch_size = batch_size
# Store model
... |
ad7c5b481827a261bfe110642fbfb656da93f11656ca2e65588c672925e14ec5 | Python | 12,793 | 202 | # Sconda conda activate TensorFlow_CPU_01; cd /mnt/bioadhoc-temp/Groups/RaoLab/Edahi/ForFerhatGit/FCDNN/code
#!/mnt/BioAdHoc/Groups/RaoLab/Edahi/00.Scripts/01.Downloaded/anaconda3/envs/TensorFlow_CPU_01/bin/python
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pi... |
b579603e71208e795ae8f9a8a045a289725c815626c75c82696010a77069dc29 | Python | 12,798 | 308 | # built-in modules
import warnings
# third party modules
import torch
import numpy as np
# pnabind modules
from pnabind.nn import processBatch
from pnabind.nn.metrics import auroc, auprc, balanced_accuracy_score, recall_score, brier_score_loss, specificity
from pnabind.nn.metrics import precision_score, jaccard_score... |
69c2c5596864682297bcf28046fa3357d30e7e54f71f9b349d0b6ae2c0699e94 | Python | 12,802 | 234 | import os
import logging
import time
import h5py
import numpy as np
import pyBigWig
import gzip
from predmoter.core.constants import GIT_COMMIT, MAX_VALUES_IN_RAM
log = logging.getLogger("PredmoterLogger")
class Converter:
def __init__(self, infile, output_dir, outformat, basename, strand, experimental=False,
... |
b83fd8e82c9f24d95f13e6804b556674d93e2885cc7a3f6a9cca64209fc2f150 | Python | 12,835 | 367 | """
##############################################################################
#
# Plot heatmaps of samples' Z-scores in every window over every site
#
# AUTHOR: Maciej_Bak
# AFFILIATION: University_of_Basel
# AFFILIATION: Swiss_Institute_of_Bioinformatics
# CONTACT: wsciekly.maciek@gmail.com
# CREATED:... |
8a202578a56051b751fe1a710ca386627b07c0d3613ac68c8c3a324090b88f5d | Python | 12,837 | 348 | import argparse
from os.path import join
import torch
import pickle
from qm9 import dataset
from qm9.utils import compute_mean_mad
from qm9.property_prediction import main_qm9_prop
from torch.utils.data import Dataset, DataLoader
from torch import nn
from tqdm import tqdm
import numpy as np
from qm9.property_prediction... |
c7cd350b6d7ae8cb2d8ccbc1b52198111ff64fbb00e4abe1a9f1a2e30c7f25f3 | Python | 12,837 | 283 | from scipy.integrate import solve_ivp
from edNEGmodel.edNEGmodel import *
import numpy as np
def test_modules():
alpha = 2.0
V_sn = 1.437e-9 # [cm**3]
V_se = 7.185e-10 # [cm**3]
V_sg = 1.437e-9 # [cm**3]
V_dn = 1.437e-9 # [cm**3]
V_de = 7.185... |
b6230c21f5b452f1a6087ef7dff2a010d9596f6197bd7eb29881428dfe431ac8 | Python | 12,842 | 363 | from itertools import chain
import numpy as np
import openpyxl
import pandas as pd
import time
import xlrd
import tensorflow as tf
from sklearn.linear_model import Lasso
from sklearn.manifold import TSNE
seed = int(time.time() * 100) % 399
print(seed)
np.random.seed(seed)
all_health_genes = pd.read_excel(... |
c77321aac34ba32ed97139ec86a3a3b00d5cad66836ccdfe967b54192ea72e99 | Python | 12,844 | 337 | """Module implements an agent that uses OpenAI's APIs function enabled API."""
import json
from collections.abc import Sequence
from json import JSONDecodeError
from typing import Any
from langchain_core._api import deprecated
from langchain_core.agents import AgentAction, AgentActionMessageLog, AgentFinish
from lang... |
39b8b62d902409fe3dee844a4b6cde474fdc20603a343dd0e0ca7cbb02b4c704 | Python | 12,845 | 277 | """repairing holes and resampling down to a target vertex count.
old app used pymeshfix for repair and pyacvd (voronoi clustering) for
resampling - both from gui_methods.py's repairsample, old repo.
repair_mesh has two methods:
- "pymeshfix" (default) - the real pymeshfix engine
(pymeshfix._meshfix.clean_from_a... |
e6488a7b5f3fd2dff1ae22bed65da90b35a1730c0dcf97a48da0545d4bec1543 | Python | 12,848 | 326 | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to... |
7b7cb1052799fb5c91accddd5c263d76e02ef2b100cb70ba17fa1af8ad5cd6fc | Python | 12,860 | 414 | from collections.abc import AsyncIterator, Callable, Iterator, Sequence
from typing import (
Any,
)
import pytest
from pydantic import BaseModel
from syrupy.assertion import SnapshotAssertion
from typing_extensions import override
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.l... |
daa9ab324140e02614efcb40525c25e29e02ac7b2a9a4c98873b3a7a52831fbb | Python | 12,860 | 294 | """
Author: Benny
Date: Nov 2019
"""
import argparse
import os
from data_utils.S3DISDataLoader import S3DISDataset
import torch
import datetime
import logging
from pathlib import Path
import sys
import importlib
import shutil
from tqdm import tqdm
import provider
import numpy as np
import time
BASE_DIR = os.path.dirna... |
4da3d095420deeed5a729850b83afcb3e9c420c421f9755f4b402ef40c79f463 | Python | 12,867 | 324 | import numpy as np
import os, tqdm
from skimage.io import imread, imsave
from skimage import img_as_bool
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.colors import LinearSegmentedColormap
from textwrap import wrap
from matplotlib import rc
rc('font', size=17)
rc('font', family='Arial')
# rc(... |
f9013cf13ca92b3b67318b883d335d46b7bd10d5b876009984705f2366422e00 | Python | 12,871 | 386 | #!/usr/bin/env python
import pathlib
import pandas as pd
import tqdm
from statsmodels.stats.multitest import multipletests
def rename_columns(data, namings):
cols = data.columns.to_series()
cols = cols.replace(namings)
data.columns = cols.values
def merge_other(data, columns):
tmp = data.loc[
... |
6a3fc8622130731502b93e5294e4d3624b9c25b2d3a0ac7809f88754ef713936 | Python | 12,872 | 395 | import logging
import torch
import torch.nn as nn
import torch.distributed as dist
from torch.utils.data import DataLoader, RandomSampler
from torch.utils.data.distributed import DistributedSampler
from pytorch_transformers.tokenization_bert import BertTokenizer
from model.datasets import DatasetMapTrain, DatasetMapEv... |
96e4496eb0c97627fc8b198b3018e63d70b4be710fc0e62dd8239963616f70d9 | Python | 12,883 | 335 | import os
import shutil
import sys
import time
import zipfile
from collections import defaultdict
from glob import glob
from urllib.request import urlretrieve
import numpy as np
import torch
from PIL import Image
from tqdm import tqdm
class Davis(torch.utils.data.Dataset):
SUBSET_OPTIONS = ["train", "val", "test... |
9c98e45ae642f9c99ad8eb87a4c9eaa0852f591578f4bc4acde18ba0e4bdeabc | Python | 12,884 | 334 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 1 09:34:24 2021
@author: Bruno Caneco
Module containing the core code to perform object detection evaluation. Mostly
based on tool published in https://github.com/rafaelpadilla/Object-Detection-Metrics.
'This project applies the most popular metrics used to evaluate obj... |
eaf112f1bb498736c9802e2359c9ab2f4941d18d3d70a32eaf2eb3d84c876faa | Python | 12,893 | 314 | # Copyright (c) 2008-2026 the MRtrix3 contributors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Covered Software is provided under this License on an "as is"
#... |
5d16c0ae1e137f06bb04c30c0f35aca2f7878f5f4cf57ffc6c7872f8c2cb498c | Python | 12,909 | 290 | # 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... |
551a57e33c0408bcc63c6e39a1e27ba3c339091be366858ed44a429df9df4c35 | Python | 12,911 | 289 | """
This script uses dRFEtools to classify female versus male
in BrainSeq Phase 2 DLPFC, Hippocampus, and BrainSeq Phase 3
Caudate Nucleus. This is a RiboZero total RNA datasets.
"""
import numpy as np
import polars as pl
import pandas as pd
from pyhere import here
import re, errno, os, argparse
import dRFEtools, sessi... |
6cc9f68190caedd0647a31df1677c3a2e0e44952f862bfd893daf6181ccf113b | Python | 12,913 | 304 | from __future__ import division
from __future__ import print_function
import os
import time
import h5py
import random
import argparse
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from copy import deepcopy
from torch_geometric.data import Data
from models import *
def see... |
ca16d8ca1ceab40b509474276f8f62278ce7be2ce1286ef42034ba34159d2dc8 | Python | 12,915 | 275 | # 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... |
fde4703dbd8cf69542b06988d9a4cc01841b06530f308ac0602393b192ae4198 | Python | 12,917 | 351 | import numpy as np
import torch
from copy import deepcopy
from scdp.common.pyg import Data
from scdp.data.vnode import get_virtual_nodes
from scdp.data.utils import (
read_pmg_pkl, read_vasp, read_cube, read_json, calculate_grid_pos, make_graph
)
class AtomicNumberTable:
def __init__(self, zs):
self.zs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.