sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
88187470d43d6b8c71d20162ba164c55c8c3e910ed83bfafd0524be38c02cdea | Python | 7,624 | 204 | from pathlib import Path
import bisect
import pickle
from typing import List, Optional, Union
import lmdb
import numpy as np
import torch
from torch.utils.data import Dataset
from scdp.common.typing import assert_is_instance as aii
def decode_coeff_sidecar_payload(raw: bytes, field: str) -> torch.Tensor:
"""Dec... |
8d44d598a55a04977c0266bddc2abc5b89bef2c2490827595ff1190890ec7d6d | Python | 7,626 | 202 | import rdkit, rdkit.Chem, rdkit.Chem.rdDepictor, rdkit.Chem.Draw
import networkx as nx
from rdkit import Chem
import pandas as pd
import numpy as np
def filterValidSmiles(dataset):
"""
Function used to remove invalid SMILES from dataset. An non-valid SMILE is a SMILE which cannot be correctly parsed
by rdk... |
b9f5593f0897ae3d67fb327dadf8ec891b713c0e3b4f2d83ff67c128f9126193 | Python | 7,628 | 219 | """Get minimum versions of dependencies from a pyproject.toml file."""
import sys
from collections import defaultdict
if sys.version_info >= (3, 11):
import tomllib
else:
# For Python 3.10 and below, which doesnt have stdlib tomllib
import tomli as tomllib
import re
from typing import List
import reques... |
d2d718c1e6758af7648b8c73bac73e68c48fc4a3ebfa607e20c807b924a601fa | Python | 7,629 | 210 | from itertools import combinations
from pgmpy.base._base import _CoreGraph
class MAG(_CoreGraph):
"""
Class for representing Maximal Ancestral Graphs (MAGs).
A MAG has directed (``"->"``), bidirected (``"<>"``) and undirected (``"--"``) edges: bidirected edges encode
latent confounding and undirecte... |
f2a404fd7e31121dbf549208bfc89db0bbd4bf5d2c78adbb9ff19b8ed12ab871 | Python | 7,632 | 234 | """
Copyright 2015 by Washington University in Saint Louis. Authored by S. Joshua Swamidass.
A license to use for strictly non-commerical use is granted.
Derivative work is not permited without prior written authorization.
All other rights reserved.
"""
from scipy import inf, asarray, array, rand, zeros, prod,... |
a0020b6de18513f4ec3187fe6315e357003b264d22006d383fdf2f311fd328c1 | Python | 7,636 | 250 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import functools
import math
import os
from typing import Optional
import torch
import torch.distributed as dist
# import torchdata.datapipes as dp
import h5py
from .common import ZarrLister, build_datapipes
class ShallowWaterDatasetOpener():... |
1bcc3cb95a9620bcf5c2140898b73904b81d6214b61e8804af33f0d7a908389d | Python | 7,643 | 231 | file_name = 'CellJ.json'
rotationXY = 0 #degrees XY
rotationYZ = 0 #degrees YZ
rotationXZ = 0 #degrees XZ
import math as mth
import neurom as nm
from neurom import viewer
from matplotlib.backends.backend_pdf import PdfPages
from subprocess import call
import os, shutil, sys
#Rotate morphologies
pp = PdfP... |
90a74f7e796583e91e7e4136994a8bc4cf65bc38be894848e1e5e17a073db710 | Python | 7,643 | 231 | file_name = 'CellJ.json'
rotationXY = 0 #degrees XY
rotationYZ = 0 #degrees YZ
rotationXZ = 0 #degrees XZ
import math as mth
import neurom as nm
from neurom import viewer
from matplotlib.backends.backend_pdf import PdfPages
from subprocess import call
import os, shutil, sys
#Rotate morphologies
pp = PdfP... |
a9e6576c01c363bb703f27d8372facb4015de1865834768aff7ccb9017ac7174 | Python | 7,643 | 231 | file_name = 'CellJ.json'
rotationXY = 0 #degrees XY
rotationYZ = 0 #degrees YZ
rotationXZ = 0 #degrees XZ
import math as mth
import neurom as nm
from neurom import viewer
from matplotlib.backends.backend_pdf import PdfPages
from subprocess import call
import os, shutil, sys
#Rotate morphologies
pp = PdfP... |
b10e8fc97551615acef74b384e46e51d3b6859691c30b307e22027a891d09709 | Python | 7,643 | 231 | file_name = 'CellJ.json'
rotationXY = 0 #degrees XY
rotationYZ = 0 #degrees YZ
rotationXZ = 0 #degrees XZ
import math as mth
import neurom as nm
from neurom import viewer
from matplotlib.backends.backend_pdf import PdfPages
from subprocess import call
import os, shutil, sys
#Rotate morphologies
pp = PdfP... |
b87ec507ddb8c19c81278907a9620e91cb130b20ca957121eb098b685baa7bd5 | Python | 7,643 | 231 | file_name = 'CellJ.json'
rotationXY = 0 #degrees XY
rotationYZ = 0 #degrees YZ
rotationXZ = 0 #degrees XZ
import math as mth
import neurom as nm
from neurom import viewer
from matplotlib.backends.backend_pdf import PdfPages
from subprocess import call
import os, shutil, sys
#Rotate morphologies
pp = PdfP... |
b922793eda1194841b8b680c29f467e21951ff16f877a2beac951ebf1c040967 | Python | 7,643 | 231 | file_name = 'CellJ.json'
rotationXY = 0 #degrees XY
rotationYZ = 0 #degrees YZ
rotationXZ = 0 #degrees XZ
import math as mth
import neurom as nm
from neurom import viewer
from matplotlib.backends.backend_pdf import PdfPages
from subprocess import call
import os, shutil, sys
#Rotate morphologies
pp = PdfP... |
fbca05632a66643044c05b86a4ca4c48e37c9191684841025847dc7bbab06cb7 | Python | 7,648 | 246 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# -*- coding: utf-8 -*-
#
# Rallpack1 model
# Author Iain Hepburn
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import numpy as np
import numpy.linalg as la
import sys
import os
from mpi4py import MPI
import... |
c8671a6223b496cff8d54f4495c18a36b90dc694a9fcf048c3fcc0832d2f6268 | Python | 7,650 | 196 | ####################################################################################
#
# 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... |
a342c1d555481096e04a97b2e279e7d37cbcff73661f697ad27abd5c7d87e70b | Python | 7,657 | 187 | import numpy as np
import pandas as pd
import pytest
from skbase.lookup import all_objects
from pgmpy.base import DAG
from pgmpy.causal_discovery import ANM, GES, IGCI, PC, BootstrapEstimator, ChowLiu, ExpertInLoop
from pgmpy.causal_discovery._base import BaseCausalDiscovery
from pgmpy.causal_discovery.bivariate_score... |
b94903454152031b2507cba9fea22ab5d1ce90815a15f00ffd82417ed99b8ba0 | Python | 7,658 | 218 | # coding: utf-8
""" MIT License """
'''
Project: Parenchymal Attention Network
Authors: Axel Masquelin
Description:
'''
# Dependencies
# ---------------------------------------------------------------------------- #
from argparse import Namespace
import matplotlib.pyplot as plt
import pandas as pd
import nu... |
0feff1f74b02edc1e6d2e39b97b0d5e2db1ec9261806c10b0f49e03085c81705 | Python | 7,661 | 172 | # 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... |
37448c3b47167c5c693e432475901fc2ecbb730cdd4f6f451c35a6d03e7b9193 | Python | 7,663 | 217 | ###########################################################################################
# Implementation of MACE models and other models based E(3)-Equivariant MPNNs
# Authors: Ilyes Batatia, Gregor Simm
# This program is distributed under the MIT License (see MIT.md)
###############################################... |
82f74eef1dd9711b62e4dcfef17323a3cbc6c8e2169aee484a1480ab6b9fcc0a | Python | 7,663 | 148 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 12 13:53:06 2023
@author: weihan
"""
import time
import argparse
import pandas as pd
from utils import *
def set_args():
parser = argparse.ArgumentParser(description='Graph construct by genome and miRNA information')
parser.add_argume... |
171e48d383029b4efac31778b8abe93837a8249cde9f2de820dbe7f281d0ed19 | Python | 7,665 | 248 | '''
splicing.py - wrap various differential expression tools
===========================================================
Purpose
-------
This module provides tools for differential splicing analysis, which
are abstracted modules that can ease the use of the tools and provide
additional functionality. They generate a ... |
81a31975b26aa8e7deaf42d2951bfa3dc8eb20622bbc7aa31fcfbc077727121c | Python | 7,677 | 197 | '''
Preprocessing script for SUPPORT datasets to create experiment-ready .npy files
Authors: Lexie Li, George H. Chen
'''
import os
import numpy as np
import pandas as pd
def process_support(mode):
'''
mode could be one of {'discretized', 'original', 'cox'}
'''
support_dzclasses = ['ARF_MOSF', 'COPD_... |
d602cd4186ebd88f2790beaad7c8669071807e9f70c6d35ab4555cd5677bab9e | Python | 7,678 | 204 | """**Embedding models**.
**Embedding models** are wrappers around embedding models
from different APIs and services.
Embedding models can be LLMs or not.
"""
import logging
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
from langchain_classic.embeddings.base import init_em... |
0ce5210d37c75656337cf6f4122b3ef18b01e9b534fe7d0585dad23435e17273 | Python | 7,680 | 277 | from collections import OrderedDict, abc as container_abc
from copy import deepcopy
import inspect
class Fake(object):
def __init__(self):
self.fake = 1
def singleton(cls):
instances = {}
def _singleton(*args, **kwargs):
if cls not in instances:
instances[cls] = cls(*args, *... |
d01a0d85c7a7a7be500f649c5ca4ad0eb926bc2e6a12fddf06e90075b3414828 | Python | 7,680 | 165 | """
In this file the DSS engine is set up.
The objects for circuit, bus, and branch are also set up for further use in the RL environment.
This file also includes function to modify the base DSS circuit with sectionalizing, tie switch, and generator information.
The translation of DSS Circuit into a graph structure is ... |
963615a663f60b9a045aa578b5a38617f8e243c52dc63758119a601e71612fa2 | Python | 7,681 | 266 | # ModulePy = tools_NMF
"""
@author: Fernando SOLDEVILLA: https://github.com/cbasedlf , https://github.com/cbasedlf/optsim
Complex Meedia Optics lab: https://github.com/comediaLKB
Useful functions/classes for light field project and general optics
"""
#%% Import stuff
import numpy as np
from num... |
373d3c56110ff0f0ab3cef0a817b81a4cfa877f29d06ff72ce6bec6759892f01 | Python | 7,683 | 237 | #!/usr/bin/env python
import sys, os, os.path, subprocess, time, re
import argparse
import datetime
from argparse import RawTextHelpFormatter
__author__ = "Allison Regier (aregier@wustl.edu)"
__version__ = "$Revision: 0.0.2 $"
__date__ = "$Date: 2016-05-09 14:53 $"
def get_args():
parser = argparse.ArgumentParser... |
3e8d21d382f795834444eb5364734d7f235de4d7a9b2837812413389c48ac772 | Python | 7,683 | 184 | import argparse
import time
import math
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.optim as optim
import sys
sys.path.append("../../")
from TCN.lambada_language.utils import *
from TCN.lambada_language.model import TCN
import pickle
parser = argparse.ArgumentParser(description... |
75015a780929d95a6330b942963342cba6ac1e909349863aae09e69dac7348ad | Python | 7,686 | 204 | """Convert TUH Abnormal Dataset to the BIDS format.
See "The Temple University Hospital EEG Corpus: Electrode Location and Channel
Labels" document on TUH EEG's website for more info on the dataset conventions:
https://www.isip.piconepress.com/publications/reports/2020/tuh_eeg/electrodes/
E.g., to run on drago:
>>> p... |
c364f876256634d4307c69f0fe5f7d5c1733d22318a097fbb5d3d63f1dde7e3a | Python | 7,686 | 240 | import numpy as np
from numpy.random import default_rng
import tensorflow as tf
tf.config.threading.set_intra_op_parallelism_threads(2)# Limit number of threads
from tensorflow import keras
from tensorflow.keras.layers import Dense, Flatten, Reshape, Dropout
from tensorflow.keras.initializers import RandomUniform
impor... |
33b877e47947f713e949e8b515ccbda929fbe8038e84e868813670e171e0eaa1 | Python | 7,687 | 153 | import numpy as np
import torch
from torch import nn as nn
import torch.optim as optim
from torch.utils.tensorboard import SummaryWriter
from src.models.recurrent import RecurrentNetwork
from src.neurogym import NG_utils
from src import utils
def initialize_model(args, dataset):
model = RecurrentNetwork(dataset.e... |
4961c191d1168356c13103996c6d2037b5bf6e84037989e743c34f71dd7b00ca | Python | 7,687 | 181 | import numpy as np
import itertools
from rdkit import Chem
from rdkit.Chem.AtomPairs import Pairs
from rdkit.Chem import Descriptors
def combinations(*smiles_frags, start, end):
"""returns all possible combinations of substructures
takes in a number of smiles fragments. Returns a list of possible representat... |
e5759165dc21e30702b90febb73fea7049a0890f73e8b566a2de6887230d935c | Python | 7,690 | 219 | import warnings
from functools import partial
from typing import Any
from typing import Dict
from typing import Optional
from typing import Tuple
import numpy as np
import torch
from neuralpredictors.training import early_stopping
from neuralpredictors.training import LongCycler
from neuralpredictors.training import M... |
a1217df705caf5c3b0f4391bff2e31aa97bac6ac7c8eba101f853b99d9557f74 | Python | 7,692 | 178 | import pdb
import numpy as np
import torch
from torch.autograd import Function
from dense import batch_norm
from queue import Queue
from threading import Condition
cum_queue = Queue()
broadcast_queue = Queue()
broadcast_cv = Condition()
class BatchNormPFunction(Function):
def __init__(self, running_mean, runn... |
47a3660f2e404ceea003f0d608c6d2f9457d821fe8015e4e2ad74491bf78e908 | Python | 7,693 | 291 | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: py:percent,ipynb
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.15.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# -... |
86a13e000181b988c405b890b67636f0c61b39b8a2d38813fae7825b35bfc575 | Python | 7,695 | 268 | # 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... |
25527fc594081702c7eecb0554b0a2de0d42fe03186ce5dedf43ccab9224e42f | Python | 7,698 | 170 | 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... |
7bd411292dfd368c6ba19ef374119955b415298c9eb61cd82b6ea64676efa5d0 | Python | 7,698 | 176 | import os
import sys
import shutil
import warnings
import pytest
import re
import glob
from pycromanager import start_headless, stop_headless
import socket
from mmpycorex import download_and_install_mm, find_existing_mm_install
def is_port_in_use(port):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s... |
71fc6eab61a58b36528eff6d8de5ade9bc25adc9baa8df963594ef03a5d61232 | Python | 7,699 | 181 | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
ddae8fe750adebfb13f5fd989542ddc2bc01f73cd7f6aabd39320d39e178a2e4 | Python | 7,701 | 208 | # coding: utf-8
""" MIT License """
'''
Project: Parenchymal Attention Network
Authors: Axel Masquelin
Description: Image manipulation and visualization function
'''
# Libraries
# ---------------------------------------------------------------------------- #
# from PIL import Image
from sklearn.model_select... |
8b703a7ed7d15d4d4c56baa4e40d0e61178d07381b44553815abcacb78f99acd | Python | 7,703 | 338 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 10:54:28 2019
@author: dalan
list of unit and default parameters:
time: ms
voltage: mV
current: uA/cm^2
capacitance: uf/cm^2
conducrance: mS/cm^2
Cm = 1 uF/cm^2
Vna = 115mV
Vk = -12mV
Vl = 10.613mV
gna_bar = 120mS/cm^2
gk_b... |
9f36ddc572d62a357c10b4bd34ea821342d40afce4ff0d33775245767de2c1b5 | Python | 7,703 | 247 | from EPI_MRI.utils import *
from abc import ABC, abstractmethod
from EPI_MRI.LinearOperators import FFT3D, getLaplacianStencil
class InitializationMethod(ABC):
"""
Defines initialization method to be used to initialize field map estimate.
All children must implement an initialization evaluation method.
... |
b6c067695052829e2bd9ed776070e1e5e6f1b046f24acb94b0fd6b13fd5ae99e | Python | 7,704 | 170 | # Sconda conda activate abc; cd /mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN/results/fcdnn_variable_genes; python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import roc_curve, auc
from scipy.stats import shapiro, m... |
f73cdae2aecb90201c6d012d41efced3830ad062e049a8d5775a1a55eb4b4158 | Python | 7,706 | 165 | ''' Test module for RBM sampler.
:Version:
1.1.0
:Date:
04.04.2017
:Author:
Jan Melchior
:Contact:
JanMelchior@gmx.de
:License:
Copyright (C) 2017 Jan Melchior
This file is part of the Python library PyDeep.
PyDeep is free softw... |
b7d3afe32b65141356166b24a01e095c934b147c61cd4fb09d3f195c8c14a6fe | Python | 7,707 | 154 | import argparse
import logging
import importlib
from pathlib import Path
import tensorflow as tf
from dipgnn.utils.register import registers
class CommonArgs():
def __init__(self):
self.parser = argparse.ArgumentParser('DiPGNN')
self.add_common_args()
def get_args(self):
... |
9d6eb97a0bb021f8c7f4a5aeff5799e572adf10d917b811f0bbfcdb80a332510 | Python | 7,711 | 186 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
POCIF-BAT R2 — Extraction des courbes diagnostiques (RPT) du corpus Kim et al. (2025).
Pour chaque cellule et chaque test de performance de référence, on isole la
décharge diagnostique pleine plage et on la rééchantillonne sur une grille
fixe de profondeur de décharge... |
6054794f715dd39437ac188236386e19908f334e29b77b4346fc103982986192 | Python | 7,712 | 139 | # 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... |
eff544d87fa13a859fa0d17a326471e80a6f6517e2caf5d86807b9f4d9ddd398 | Python | 7,727 | 248 | import types, os
import matplotlib, torch, joblib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from net_utils import load_from_file
from networks import HebbRecogDecoupledManual, HebbRecogDecoupledManualSequential
from data import generate_recog_data, recog_chance
from plott... |
589e3e4a8ba49565e80f2d7c278724bb07c8d7f7624cbe12dfa77a0001bcf4a6 | Python | 7,731 | 245 | """**Vector store** stores embedded data and performs vector search.
One of the most common ways to store and search over unstructured data is to
embed it and store the resulting embedding vectors, and then query the store
and retrieve the data that are 'most similar' to the embedded query.
"""
from typing import TYP... |
63c50b765389a12749f9cb972851bee5d8755e0db3ecc11bbedd564c907ffb51 | Python | 7,731 | 206 | import h5py
import random
import numpy as np
EPSILON = 1e-6
def get_sparse_tensor(adj_matrix, default_value=0.):
# 把稠密矩阵变成稀疏矩阵,即把邻接矩阵变成(面,面)对
idx = np.where(np.not_equal(adj_matrix, default_value))
values = adj_matrix[idx]
shape = np.shape(adj_matrix)
idx = np.transpose(idx).astype(np.int32)
... |
bf741eeb6de8bb3b80ff254255f16904450eed8e12c2839decbba2171d36ba84 | Python | 7,739 | 205 | 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 *
from DrugGene_Network import *
import argparse
import numpy as np
import time
from sklearn.preprocessing import MinM... |
eb848e99c27fd6e1f9931f698b553b7927d90c70b1351231a6ec6240db7a87d4 | Python | 7,745 | 179 | from network import common_network
from alg.algs.base import Algorithm
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.cuda.amp import autocast
from alg.modelopera import get_fea
import numpy as np
class AbstractCAD(Algorithm):
"""Contrastive adversarial domain bottleneck (abstract cl... |
c57de1ce9696aec333b04a875c50af31db57184556dcbe276fba092290d03899 | Python | 7,752 | 200 | import os
import io
import pickle
import tempfile
import json
import torch
import numpy as np
import ase
from ase.calculators.vasp import VaspChargeDensity
from pyrho.charge_density import ChargeDensity
from scdp.common.utils import cell_heights
def read_pmg_pkl(fpath):
with open(fpath, "rb") as f:
chgca... |
16b008598de7c61c0b5575e3af02f9b1a9e6697559864df1591314e4b4ec6b9f | Python | 7,756 | 187 | import torch
import torch.nn as nn
import torch.nn.functional as F
from equivariant_diffusion.egnn_new import EGNN, GNN
from equivariant_diffusion.en_diffusion import EnVariationalDiffusion
remove_mean_batch = EnVariationalDiffusion.remove_mean_batch
import numpy as np
class EGNNDynamics(nn.Module):
def __init__(... |
c660fd00208251e55baf2e28f2d11de65d279cbf85bf47a1da8ce0a12987761a | Python | 7,758 | 198 | import datetime as dt
from copy import deepcopy
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.vectorstores... |
0e373f2284ddabb3c1734f0ecb069708753139636f4b0812a8a47f69e73f91f0 | Python | 7,760 | 217 | ####################################################################################
#
# 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... |
cad87a4386ee941e1809f700e0b71dfef45541cf1c23da306df742657194fec3 | Python | 7,760 | 199 | # This file aggregates and plots the results from the experiment
# One figure for r2, one for mse
# Label with linear/poly scaling_type linear/ffnn
# Load all files in directory
from os import walk
import pandas as pd
import matplotlib.pyplot as plt
import pdb
SMALL_SIZE = 16
MEDIUM_SIZE = 20
BIGGER_SIZE = 20
plt.... |
d97b6f4f7e8b94356809474fd9f241f6cc04b93016a88740bd71370e220ca4ff | Python | 7,765 | 214 | import logging
import os
import math
import numpy as np
import pandas as pd
from scipy import cluster
from sklearn.cluster import KMeans
from helpers.array_operations import reconstruct_symmetric_matrix_from_tril
def compute_basis_state(
config_dict: dict, all_subjects_tril_tvfc: np.array,
model_nam... |
e2fcabdc32655f8839f474cacb136eecf0ac3d66ab39f64a65d4364a77d4fde6 | Python | 7,765 | 190 | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
636e67b7067ce47b417f7e986cb2160a40674681f222af0a9cb745108e70b6d9 | Python | 7,768 | 211 | #-----------------------------------------------------------------------------
# Copyright (C) 2019-2022 A. Behdenna, A. Nordor, J. Haziza and A. Gema
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... |
714e57640627db585474a7d90782f050b9b325dad489eef86694f1fbe560e9ca | Python | 7,770 | 240 | import asyncio
import logging
from collections.abc import Sequence
from langchain_core.callbacks import (
AsyncCallbackManagerForRetrieverRun,
CallbackManagerForRetrieverRun,
)
from langchain_core.documents import Document
from langchain_core.language_models import BaseLanguageModel
from langchain_core.output_... |
b633a41e1a615b11c9b53b665a3d849c6e414659531a6abed4cdfb230a028971 | Python | 7,771 | 204 | from mimic3models import metrics
from mimic3models import common_utils
import numpy as np
import threading
import random
class BatchGen(object):
def __init__(self, reader, discretizer, normalizer, ihm_pos, partition,
target_repl, batch_size, small_part, shuffle, return_names=False):
self.... |
f2017bd51f36ed2f4cb5653be29dc82d546d6048543de5de3ab13e582b77c0ba | Python | 7,771 | 176 | """The DeepMapper iterate-N-accumulate orchestrator.
Generalises the legacy ``deepmap(X, y, num_passes, min_accuracy, max_tries)`` loop:
each pass draws a fresh feature->pixel **arrangement** (seeded permutation), builds
pseudo-images, trains the **swappable backbone**, gates on held-out accuracy, then
attributes and ... |
a5ea31c4b6bed9c1def00135d738b7ff42ca89dc5adfcc2bed2e16f714f26a42 | Python | 7,772 | 134 | """ARC deep backbone: transformer over anchored cycle windows with multi-source invariance regularisation.
Differences from deep_models.py
* dataset-balanced mini-batches (equal rows from every SOURCE dataset)
* CORAL penalty (Sun & Saenko 2016) between the embedding second-order statistics of each pair of source ... |
8138a6f22efe77f6308103d875dce8c1f3cecc350e2f5d45910daded042d7e47 | Python | 7,774 | 172 | import logging
import numpy as np
from openmmtools.integrators import PeriodicNonequilibriumIntegrator
from openmmtools.utils import get_fastest_platform
from pkg_resources import resource_filename
from simtk import unit
from simtk import openmm
import os
import pathlib
import time
from perses.app.relative_point_mutati... |
a2cb978da3d3de6b5db960139852b519911bd7759ecc31c9aaed25dc78d82071 | Python | 7,776 | 189 | from sys import stderr
import os
from os import getcwd
from os.path import realpath, dirname, join
import torch
from torch import nn
import numpy as np
from .any2int import Any2Int
import warnings
def construct_embedder(trial, initialized: bool, w2i, prefix: str = ""):
embedder_type = trial.suggest_categorical(pr... |
3f0164e1c4192f8f7edb8490494212f97929536b670a15dacac6b1ea796d1d5d | Python | 7,780 | 239 | import os
import csv
import numpy as np
from scipy.ndimage import gaussian_filter1d
from scipy.signal import morlet
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
import gc
# 读取CSV文件中的subid和group列元素
csv_file = 'E:/ml/code/data/normalized_output.csv'
txt_folder = 'E:/ml/code/fmridata/'... |
8367c457c72d89fbe8190ade0f95ba83b57d2b9b310572ff83a6309ad2a18d44 | Python | 7,781 | 224 | import numpy as np
from sklearn.decomposition import PCA
import deeptime
import matplotlib.pyplot as plt
from pensa.preprocessing import sort_coordinates
def project_on_eigenvector_tica(data, ev_idx, ana):
"""
Projects a trajectory onto an eigenvector of its tICA.
Parameters
----------
data :... |
15209421b335d0e5fcf746b902e904fb1c1d403d117706e34452c137c576947c | Python | 7,782 | 188 | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
1fa9d2eefaba7b2e538b3799c2f8c433ac49284e61eb50cfd0b925f02990a0a0 | Python | 7,782 | 247 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# -*- coding: utf-8 -*-
#
# Rallpack1 model
# Author Iain Hepburn
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import numpy as np
import numpy.linalg as la
import sys
import os
from mpi4py import MPI
import... |
c1c45a05a2b8fbc45a1fa5708be561e00aed2e439007b48fdb366dde7f307c3f | Python | 7,793 | 237 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pickle
import os
import yaml
from sklearn.impute import SimpleImputer
import numpy as np
import math
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
np.random.seed(100)
get_ipython().run_line_magic('matplotlib', 'inline')
# %config Inli... |
0deefdd9269ac1aa1dbe560aa79874fe69678933a6799a940dd97167463b9bb9 | Python | 7,795 | 198 | # Rdkit import should be first, do not move it
try:
from rdkit import Chem
except ModuleNotFoundError:
pass
import utils
import argparse
from qm9 import dataset
from qm9.models import get_model
import os
from equivariant_diffusion.utils import assert_mean_zero_with_mask, remove_mean_with_mask,\
assert_corre... |
b6b35be4b912da3275c444533e6cd9c7e140df176021ca39fb57bf2a6e866f98 | Python | 7,800 | 223 |
import numpy as np
from scipy.stats import hypergeom
import pandas as pd
from time import time
import datetime
import sys
def list_format(entry):
return entry.replace("['", '').replace("']", '').split("', '")
store_probs = False # Set to True to generate a file with computed probabilities to make future analyese fa... |
cb05806d5c75fd4bf31ec82cff73dcf6870b89569303772f9df086dca1e98a9e | Python | 7,800 | 221 | import numpy as np
import scipy as spy
import segyio
import utils
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler, StandardScaler
import h5py
import sys
from shutil import copyfile
## Load seismic data to array
def loadSegy... |
953cf47fbc647c5067c758fcd15714576782d2359ea0a185ad8f091a1f9e086d | Python | 7,806 | 176 | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
f651597b51a605494ea26db7e043866ec605928fb321b5d578a25e6422849929 | Python | 7,806 | 248 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# -*- coding: utf-8 -*-
#
# Rallpack1 model
# Author Iain Hepburn
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import numpy as np
import numpy.linalg as la
import sys
import os
from mpi4py import MPI
import... |
74ae07916e4869f8a4abe6df7fdf282945ad61fc9467525f4273401572fae799 | Python | 7,807 | 221 | import collections.abc
import time
from typing import Any, Dict, Tuple
import torch
from bindsnet.network import Network
from bindsnet.network.monitors import Monitor
def recursive_to(item, device):
# language=rst
"""
Recursively transfers everything contained in item to the target
device.
:para... |
91abd30aa691ff53c28e2a1f78857bf09845129721f51474e268d784b17387ae | Python | 7,810 | 248 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 20 10:47:26 2022
@author: M. Agustina Frechou
"""
'''
Imports
'''
#matplotlib.use('Qt5Agg')
import os
import numpy as np
import glob
import h5py
from skimage.transform import resize
'''
Functions
'''
def extract_zones(textures_trace, t_voltages = [0.6, 1.2, 1.8, 2.4]... |
34faa925c8a40b87c7151345a8249c65f394448a2a04239d16fac9eed372e655 | Python | 7,811 | 202 | """Implementation based on the template of ALIGNN."""
from typing import Tuple
import numpy as np
import torch
import torch.nn.functional as F
from pydantic.typing import Literal
from torch import nn
from matformer.models.utils import RBFExpansion
from matformer.utils import BaseSettings
from matformer.features impor... |
d8c3f03b87939fb081aad73ccaeb3eacb590e130f147148e4d4cfae34432238f | Python | 7,813 | 172 | 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 ... |
46050018fdc41ae70dc3981d606898c114d4ebb93675601f1e027562be172f41 | Python | 7,814 | 190 | from simtk import unit
import sys
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
from openmmtools.constants import kB
import matplotlib.pyplot as plt
################################################################################
# NUMBER OF ATTEMPTS
#######################################################... |
9310cbd2151b37a157f0e9de21631c712aa82301eca5516ee726c0ab30cd1bf4 | Python | 7,822 | 212 | ###########################################################################################
# from MACE and PhiSNet
###########################################################################################
import math
import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
from e3nn imp... |
72ca7fb5b2087f250e81f453d42fa0280cef2cf690af25a6eccd55ffae4ad07b | Python | 7,825 | 256 | r"""
This is an implementation of voxel convolution
>>> test()
"""
import math
import torch
from e3nn import o3
from e3nn.o3 import FullyConnectedTensorProduct, Linear
#from e3nn.math import soft_one_hot_linspace
from .soft_one_hot_linspace import soft_one_hot_linspace
class Convolution(torch.nn.Module):
r"""co... |
a8a2c0fc12f505836c60a5512462e9a79938e17a4f55af2638cf744a50a37a5d | Python | 7,829 | 165 | import torch
import torch.nn as nn
import torch.nn.functional as F
def knn(x, k):
inner = -2 * torch.matmul(x.transpose(2, 1), x)
xx = torch.sum(x ** 2, dim=1, keepdim=True)
pairwise_distance = -xx - inner - xx.transpose(2, 1)
idx = pairwise_distance.topk(k=k, dim=-1)[1] # (batch_size, num_points, k)... |
2adac0fc7dd1b5b1ec5d5068d84deabf18e53b977b9cee903eb4a64e74efc9d3 | Python | 7,830 | 208 | 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... |
b386b407d78d3c68eb324e504f88e0e50df498a3c668be4b359769d0d09027d4 | Python | 7,830 | 167 | """
In this file the DSS engine is set up.
The objects for circuit, bus, and branch are also set up for further use in the RL environment.
This file also includes function to modify the base DSS circuit with sectionalizing, tie switch, and generator information.
The translation of DSS Circuit into a graph structure is ... |
f7ac477aeb3267ab0f812d8114a92dd915769969b049ee106487346ce8e84c9b | Python | 7,833 | 209 | import torch
from Bio.PDB import Selection
from Bio.PDB.Residue import Residue
from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.MMCIFParser import MMCIFParser
from easydict import EasyDict
from .constants import (AA, max_num_heavyatoms,
restype_to_heavyatom_names,
B... |
278f407a928175402ab682b723fddd311e997c91a54269820c75fdc2fc44fc3d | Python | 7,839 | 205 | import torch
import torch.nn as nn
import copy
from .so3 import SO3_Embedding
from .radial_function import RadialFunction
class EdgeDegreeEmbedding(torch.nn.Module):
"""
Args:
sphere_channels (int): Number of spherical channels
lmax_list (list:int): List of degrees (l) fo... |
94eaf654da4ef95ccf7440cfe2a756b5a8957cfafdfe597d79a121e62a99e608 | Python | 7,840 | 202 | import numpy as np
import common.atoms
from rosetta import *
from pyrosetta import *
init("-mute basic -mute core -mute protocols -ex1 -ex2 -constant_seed")
#from pyrosetta.toolbox import pose_from_rcsb, cleanATOM # , mutate_residue
from pyrosetta.rosetta.protocols.simple_moves import MutateResidue
from pyrosetta.... |
95882ad51f70e1f1f0c083bcceca1fe5585be997de77ffe98cab18ca5380a8c8 | Python | 7,844 | 241 | from __future__ import annotations
from pathlib import Path
from typing import List
import matplotlib.pyplot as plt
import numpy as np
from libs.function.cluster import binning
class Visualizer:
def __init__(self, plot_length: int) -> None:
self.plot_length = plot_length
self.fsize = 16
de... |
667657d8dc3732940db45b3a6876090fc46d53efd3478ad0d387721d917ede82 | Python | 7,845 | 235 | # Copyright 2024 DeepMind Technologies Limited
#
# AlphaFold 3 source code is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
d9b35a4f7658d8039e286f6b2f3f12991dc0654f8b31e9028792e80df49a4b81 | Python | 7,845 | 198 | # Rdkit import should be first, do not move it
try:
from rdkit import Chem
except ModuleNotFoundError:
pass
import utils
import argparse
from qm9 import dataset
from qm9.models import get_model, get_autoencoder, get_latent_diffusion
import os
from equivariant_diffusion.utils import assert_mean_zero_with_mask, r... |
d25bb23eae0c4d4a41696df5f488441116f7ffdebe2c17ea3d5fb3fe75d76a05 | Python | 7,846 | 224 | """
##############################################################################
#
# Annotate statistical significancy for all motifs in all windows
# around all sites based on the provided cutoff parameter.
#
# AUTHOR: Maciej_Bak
# AFFILIATION: University_of_Basel
# AFFILIATION: Swiss_Institute_of_Bioinfor... |
2d28b0395a8f107240028ad0a0b733dd61468817db412798dbc0ebeaa6bc747e | Python | 7,848 | 248 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# -*- coding: utf-8 -*-
#
# Rallpack1 model
# Author Iain Hepburn
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import steps.quiet
from steps.geom import UNKNOWN_TET
import steps.model as smodel
import steps... |
d0a9ea6c17520a0b45c57089f7e3a366c32389daaa4fa691baeb6ad462de77c7 | Python | 7,848 | 229 | # 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... |
bb95f3f3d23f84a79486b9534579ca5b63883b5672a734901f12da59b9ae3ac1 | Python | 7,852 | 191 | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
bc96ceb17e558884fd000766b9939e17f38791f882b2ad9ad5ce46db3d3a9ed3 | Python | 7,853 | 265 | #!/usr/bin/env python
# coding: utf-8
# In[18]:
import pickle
import os
import yaml
from sklearn.impute import SimpleImputer
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScale... |
8427555d097ea18038bf3d70b9ac148fcff5b32c30bb0ee762e8fba4d4b01071 | Python | 7,858 | 247 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# -*- coding: utf-8 -*-
#
# Rallpack1 model
# Author Iain Hepburn
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import steps.quiet
from steps.geom import UNKNOWN_TET
import steps.model as smodel
import steps... |
5cfe0321517b4eb03c807120d9e927a1cf0e2521e99b2fb3e70c2cb0fa1c0b8e | Python | 7,860 | 201 | from sklearn.metrics import roc_auc_score, average_precision_score, mean_absolute_error, r2_score
import pandas as pd
import os
import numpy as np
try:
import torch
except ImportError:
torch = None
### Evaluator for graph classification
class Evaluator:
def __init__(self, name, eval_metric, n_tasks, mean=... |
e13da104c7322ebb4a3f781984e11e86efd55173338c16717b4d1ba1e58c00c6 | Python | 7,860 | 204 | from imagizer_cv import spatial_imagizer, get_spotdist, get_img_coord
from registration import registration_spatial
import matplotlib.pyplot as plt
import scanpy as sc
import numpy as np
import pandas as pd
import cv2
import scanorama
from utils import shape_matching
from scipy.ndimage import gaussian_filter
from scipy... |
513bc8a142fa8695571072ab08573a66af44cf9cad0ef139871d60b62203b9b1 | Python | 7,864 | 227 | import os, time
import numpy as np
from skimage import transform, morphology, measure, segmentation
from sklearn.metrics import classification_report
from skimage.io import imread, imsave
import scipy.ndimage as ndi
from morgana.ImageTools import processfeatures
def create_features(_input, scaler,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.