sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
465cdd269739844ee219729c2dd6ead88dc23710de55e060bce0e3d2edea8c48 | Python | 21,173 | 488 | """
Utilities to make sequence data for the adaptive learning tasks.
"""
import argparse
import json
import model_learner as model
import numpy as np
import pandas as pd
import random as rd
N_SESSIONS = 1
N_TRIALS = 75
P_C = 1/20
P1_MIN = 0.1
P1_MAX = 0.9
MIN_RUN_LENGTH = 6
MAX_RUN_LENGTH = 250
MIN_ODD_CHANGE = 4
SC... |
939b46aca9b2566c5499432809d8baf097e81c8d41d6edafe3ac90eb86c63011 | Python | 21,175 | 453 | """Run diffusion preprocessing, MNI surface prediction and native-space processing."""
from __future__ import annotations
import argparse
import json
import logging
import os
import shlex
import signal
import subprocess
import shutil
import sys
from collections import deque
from contextlib import contextmanager
from ... |
3aedf72d694c179dd3c1b1468bed4eb8dfcac76e118ef6eb3d53dcf6365eb4bb | Python | 21,179 | 647 | import argparse
import json
import logging
import os
import random
from io import open
import numpy as np
from tqdm import tqdm
import yaml
from easydict import EasyDict as edict
import sys
import torch
from pytorch_transformers.optimization import (
AdamW,
WarmupConstantSchedule,
WarmupLinearSchedule,
)... |
06ff17c3d35a49dfcdfa16fe0e8e44c6550c055d82be3feb1a4327190ed02943 | Python | 21,188 | 548 | import copy
from math import pi, log
from einops import rearrange, repeat
import torch
import torch.nn as nn
from torch.nn.utils import weight_norm
from torch.nn.utils.weight_norm import WeightNorm
from pdearena.utils.activations import SinusoidalEmbedding, ACTIVATION_REGISTRY
from pdearena.configs.config import Confi... |
65a84253b8a739769d47c1ba327d19f66b61f6d0049585eb3dfb2b8b09c2cec9 | Python | 21,193 | 446 | import os
import pathlib
import time
from typing import Union, List, Literal
import equinox as eqx
import numpy as np
import torch
import torch.nn.functional as F
import wandb
from einops import rearrange, repeat, pack, unpack, reduce
from torch_scatter import scatter, scatter_std
from torchdiffeq import odeint as nn_... |
cf29b4936ddadfac823ad6bf4f45810cfbf12acf352ed357c9b94b0be141cf23 | Python | 21,206 | 566 | '''Publication.py - publishing pipeline results
===============================================
Publishing refers to the process of taking all the final results of a
pipeline and putting them somewhere to share with others.
Methods in this module are still in development.
Reference
---------
'''
# import re
# imp... |
13b708b0b7cfda0d952aeff5e78aea2372a2c9997590af4f87da481ab4a09021 | Python | 21,208 | 588 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 11 19:15:45 2021
@author: Xingyan Liu
"""
import logging
from pathlib import Path
import os
from typing import Sequence, Union, Mapping, Optional, List
import time
import random
import numpy as np
from pandas import value_counts
import torch
from torch import Tensor, Lon... |
4401a692ae44063247eb94f661f70fceff120187622eda2ee147f0640518b931 | Python | 21,213 | 266 | import pandas as pd
import numpy as np
import sklearn
from scipy.stats import rankdata
from sklearn.metrics import roc_curve, roc_auc_score, auc, precision_recall_curve, average_precision_score, f1_score, \
accuracy_score
import argparse, sys, os, errno
def plot_roc(prob, label):
fpr, tpr, _ = roc_curve(label,... |
c5311997f322595a63433ec97634a6b089f2c9fb8d862ce24bf3809e1ff82155 | Python | 21,275 | 428 | import unittest, gc, mdshare, pyemma, os, requests, scipy.spatial, scipy.spatial.distance, pytest, importlib, scipy.stats, sys, os
import scipy as sp
import MDAnalysis as mda
import matplotlib.pyplot as plt
import numpy as np
from pyemma.util.contexts import settings
from pensa.clusters import *
from pensa.comparison ... |
3eb83973eb6ef2116248f7857d692d65655e5b81ab6dba03ef382eff93c2862c | Python | 21,280 | 673 | r"""
Miscellaneous utilities
"""
import os
import logging
import signal
import subprocess
import sys
from collections import defaultdict
from multiprocessing import Process
from typing import Any, List, Mapping, Optional
import numpy as np
import pandas as pd
import torch
#from pybedtools.helpers import set_bedtools_... |
a9e99e4e4e76401fd017b9b7facc5b1cf35bea5e4708b655bb8c75db430ba895 | Python | 21,317 | 531 | # Copyright Generate Biomedicines, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
b9cc69574008cbad49e2b60171baed0aa7e063ad8f2b2007ac4c3cbc7afedb64 | Python | 21,321 | 549 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 21 17:38:45 2021
@author: Shencong Ni
"""
'''
1. get the power spectrum and the theta-gamma coupling of spontaneous activity
2. analyse the top-down attention's effect on Fano factor and noise correlation
run 'two_inputs_simu.py' before running th... |
bd29af62c0a3ddcf17eb790b67be4066445906caf87e5ed834798ae57f5259dc | Python | 21,335 | 470 | """
python
Load_and_Test_GhmCN.py
Purpose: Load trained networks and test how given datasets predicts gene expression.
Usage: python ./Load_etTest_EGA.py [-c <str>] [-rf <int>] [-mo <str>]
Arguments:
'-c', '--cell_line', default='E116', type=str
'-rf', '--regression_flag', default=1 (1 = regression; 0 = clas... |
c7bb7cd67d73a1769ef8712af213705f8578a64d6cc4d12cf43a72f08aa76d46 | Python | 21,335 | 585 | import numpy as np
import MDAnalysis as mda
from MDAnalysis.analysis.dihedrals import Dihedral
def read_torsions(pdb, xtc, sel=[[0, 1, 2, 3], [1, 2, 3, 4]], first_frame=0, last_frame=None, step=1, naming=None):
"""
Load distances between all atom pairs between two selected groups.
Parameters
--------... |
47d78706d75643be09c819c637cb7ff0036a13d40509571b16f255bbb5806aba | Python | 21,359 | 534 | """Derivations of standard content blocks from Anthropic content."""
import json
from collections.abc import Iterator
from typing import Any, cast
from langchain_core.messages import AIMessage, AIMessageChunk
from langchain_core.messages import content as types
def _populate_extras(
standard_block: types.Conten... |
92872f63a0fd17e835e5371d008a3c7dfcca4020cdbc1c2b5c7c93ef2817c41a | Python | 21,394 | 513 | import os, time, importlib, errno
import matplotlib.pyplot as plt
# from dt_utils import Timer
#from networks import HebbDiags
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils.tensorboard import SummaryWriter
#%%#################
### Base Classes ###
####################
... |
377f1685bd797038234d13444f97f16962b6b12b920fb32242b674c2520ecf7a | Python | 21,405 | 546 |
import pandas as pd
import numpy as np
from tqdm import tqdm
from scipy import signal
from scipy import ndimage
from scipy.signal import medfilt
from scipy.signal import hilbert, butter, lfilter
import matplotlib.pyplot as plt
from PoET.utils import identify_active_time_period, check_hand_, meanfilt
import prox_tv... |
5163ba936487f2a7b6bfe6657f6b0b47539d000a7aec1023c005cbcb320153fb | Python | 21,420 | 554 | import copy
from math import pi, log
from einops import rearrange, repeat
import torch
import torch.nn as nn
from torch.nn.utils import weight_norm
from torch.nn.utils.weight_norm import WeightNorm
from pdearena.utils.activations import SinusoidalEmbedding, ACTIVATION_REGISTRY
from pdearena.configs.config import Confi... |
a9e3200100ef349f60dc7c5fdab18761aa32fff0837d653ef59be0a69cfec0cc | Python | 21,422 | 657 | ####################################################################################
#
# 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... |
dfc4a3bd1db000e943a3dcd4fc29caf5d968a71751c096c2533cde2cb137772b | Python | 21,477 | 611 | import logging
import tempfile
import time
from pathlib import Path
import awkward as ak
import numpy as np
import pandas as pd
import pytest
from astrocast.helper import CachedClass, DummyGenerator, EventSim, Normalization, SampleInput, \
download_pretrained_models, download_sample_data, get_data_dimensions, is_... |
ea0ace0efb04ad79119b710dfb9d7ab44c7492564d57bfd07d822d322b5c3ff3 | Python | 21,495 | 465 | import os
import pickle
import numpy as np
import pandas as pd
from dipgnn.utils.register import registers
from sklearn.preprocessing import StandardScaler
@registers.data_container.register("data_container")
class DataContainer(object):
def __init__(
self,
graph_data_list,
ta... |
462047a49c2f350405fd92663a995b4ca3bf208c0d8735584a35dc5d3f94c0e8 | Python | 21,497 | 382 | # -*- coding: utf-8 -*-
# author: Felix Repp felix.repp@mpikg.mpg.de
# !/usr/bin/env python
import os
import numpy as np
import pdb
import shutil
import tinaui
__version__ = '0.5.2'
# import tina
"""\mainpage
\section Introduction
Tool for Image and Network Analysis (TINA) is a software which was written to analyze ... |
84abfa4192169b5700a8e4b12a835f5039a4aa11be5f3f5cd0cc0c4d257bf6f3 | Python | 21,500 | 503 | #!/usr/bin/env python
import os,sys,glob,torch,random
import numpy as np
import argparse
try:
import pyrosetta
pyrosetta.init()
APPROX = False
except:
print("WARNING: pyRosetta not found, will use an approximate SSE calculation")
APPROX = True
def main():
args=get_args()
assert args.input_p... |
35449abc41afb04968744b0e52b0d38d46ca3d01e407dbc98f1188f7d06dc300 | Python | 21,504 | 517 | """API tests for api/routers/facial.py - the Facial Anthropometrics
workspace's own request/response plumbing (template load/pick/preview,
batch extraction/correction/export). Underlying geometry math is covered in
tests/test_facial_measurements.py; this file is about the endpoints,
caching, and per-file/per-measuremen... |
2c3d00eb24af2b07ae1d1ecf10c4bb55da8256e7010073e91ff7934f8da503e9 | Python | 21,514 | 502 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("/home/cunger/local/lib/python2.7/site-packages/isodate-0.4.9-py2.7.egg")
sys.path.append("/home/cunger/local/lib/python2.7/site-packages/SPARQLWrapper-1.5.2-py2.7.egg")
sys.path.append("/home/cunger/local/lib/python2.7/site-packages/rdflib-3.2.3... |
8d639eb09ab3777cf3013790c3c1353a95dfe6bd1ad1061bf27e1236c2cbc62d | Python | 21,523 | 663 | """
TypedMolecule TODOs
* Testing
* Detemine whether atomic numbers are required, or whether a TypedMol could have a mix of
TypedAtom and TypedParticles, where the latter doesn't need atomic nubmers
* Determine whether typedmols should have isomorphism operations
* Should be able to go to hill formula (?), networkx, ... |
47e5a8cd5af5d203c2f1548460ce1e836ec6bf74ea282643faf6ff24a96520bf | Python | 21,526 | 477 | import argparse
from models import twostage_RCAN3D, twostage_Unet3D
from tensorflow.keras import optimizers
import glob
import numpy as np
import datetime
from utils.utils import prctile_norm
from utils.data_loader import DataLoader
import tifffile as tiff
from scipy.interpolate import interp1d
import os
import cv2
imp... |
839662cef0b200fb97817844895f43af95917a86a273481f77473a3727cdba21 | Python | 21,526 | 593 | from __future__ import annotations
import re
from collections.abc import Mapping
from enum import Enum
from typing import Any
from langchain_core.callbacks import Callbacks
from langchain_core.language_models import BaseLanguageModel
from langchain_core.output_parsers import BaseOutputParser
from langchain_core.promp... |
f6333b07bae02b1f698ff1de4cdca44c427372fcc78bd45def47841e62280105 | Python | 21,540 | 536 | import os
import numpy as np
import pandas as pd
import scanpy as sc
import matplotlib.pyplot as plt
import trajectory_reconstruction_tradeoff as T
from sklearn.decomposition import PCA
import random
random.seed(20)
np.random.seed(20)
from numpy.random import default_rng
rng = default_rng() # Creates a new random nu... |
14596503a49947732da1da36c8adb6b7b8038e057d7cfc56bb1289021ebb1dc1 | Python | 21,572 | 476 | from __future__ import annotations
import networkx as nx
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from sklearn.base import clone
from sklearn.utils import get_tags
from tqdm.auto import tqdm
from pgmpy import config
from pgmpy.base import ADMG, DAG, MAG, PDAG
from pgmpy.causal_disco... |
0943bfb9c9a7a335aa16f8cc868f3e1d4609122078aa3b4d178201628f2fee71 | Python | 21,637 | 800 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 2 18:06:45 2023
@author: mariano
"""
import sys, os
import cooler
import matplotlib.pyplot as plt
import numpy as np
import scipy as spy
from scipy.ndimage import gaussian_filter
from scipy.interpolate import interp1d
import pandas as pd
import... |
ee2f20110016b2308ed007daff6cb36dd096375d22498d5135b4ac4132f693d9 | Python | 21,648 | 472 | """
In this file the sectionalizing and tie switch details are specified.
The DER details are also specified (in particular the ones with and without grid forming capability).
Also the path for the DSS file containing the circuit information is specified.
The final DSS circuit which will be used by the MISOCP is ... |
0643aefa4513eb7a4e16a949cb50f080dea4a1eff7ab34486348b8b22e676a6d | Python | 21,664 | 535 | import json
from collections.abc import Callable, Sequence
from typing import Any, Literal
from langchain_core._api import deprecated
from langchain_core.output_parsers import (
BaseGenerationOutputParser,
BaseOutputParser,
JsonOutputParser,
PydanticOutputParser,
)
from langchain_core.output_parsers.op... |
d11e862425915326158bd5cd55064402b9b4aa52d030744ba20fa20dce008bfd | Python | 21,670 | 488 | import argparse
from models import twostage_RCAN3D
from tensorflow.keras import optimizers
import glob
import numpy as np
import datetime
from utils.utils import prctile_norm
from utils.data_loader import DataLoader
from utils.augment_sim_img import aug_sim_img_3D
import tifffile as tiff
from scipy.interpolate import i... |
7f2c935ba6a7fd71809946e8a817c9d6cf7321e0a441c2aad1c2834fd650fa68 | Python | 21,671 | 365 | # 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... |
38d18749528107e65c64d7c7f4acd3bfba8c0a1ebf0cef1e9f2908410591a4c0 | Python | 21,681 | 502 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 19 12:00:58 2021
@author: Shencong Ni
"""
'''
Detect the On/Off states.
Run 'two_inputs_simu.py' before running this script.
'''
import matplotlib as mpl
mpl.use('Agg')
import mydata
import numpy as np
import firing_rate_analysis as fra
# import... |
25cc7e1da2d8d043653918151d5ba4bf652d73c991007a26c723ebac4b5a38cd | Python | 21,684 | 585 | import os
from tqdm import tqdm
import torch
import torch.nn as nn
import numpy as np
import random
from networks import UNet4layers
import torch.nn.functional as F
from utils import create_mask
import math
from complexNonLinearities import *
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
clas... |
0fce4cc4abec9c5a16a1d9f97c88c37c037f3fb1a74ba065987d3b821e24e9d4 | Python | 21,686 | 280 | """Constitutional principles.
Constitutional principles from https://arxiv.org/pdf/2212.08073.pdf (Bai et al. 2022)
UnifiedObjectives v0.2 principles ("uo-*") adapted from https://examine.dev/docs/Unified_objectives.pdf (Samwald et al. 2023).
"""
from langchain_classic.chains.constitutional_ai.models import Constitut... |
8445b837e169e906d5dcebad28846415ac11bcdb4ca7273fe548721b095cba88 | Python | 21,717 | 488 | """ Module for EnrichmentScope object visualization
This module allows the user to extract and visualize information from EnrichmentScope object.
Here, it is possible to evaluate enrichment results with 1) dotplots, 2)heatmaps and 3) network analysis.
Dotplots allows the visualization of statistical significance and ... |
71c661ef4e0483b06739a403b0a2ca531f982a14d42cb1a79fb48564474c14ec | Python | 21,738 | 591 | ####################################################################################
#
# 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... |
b0e31d2db065449317897ef9fd6728209002372b1496b41d977bd55fc5216f1c | Python | 21,744 | 544 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import functools
from typing import Optional
import os
import h5py
import torch
import torchdata.datapipes as dp
from torch_geometric.data import Data
from pdearena.data.datapipes_common import build_datapipes
from pdearena.configs.confi... |
3d9b37f34d562f85da0c0e50559d0bd836c26f4b08f8fec4b280d5d9de7c9874 | Python | 21,746 | 483 | """
Created on Tue Jun 28 12:11:26 2022
@author: swainkasish@gmail.com
"""
#%% import libraries
import numpy as np
import pandas as pd
import time
from sklearn.preprocessing import StandardScaler,Normalizer,MinMaxScaler
from sklearn.decomposition import PCA,TruncatedSVD
from sklearn.neighbors import KNeighborsRegre... |
e1f1185e8b729632e92a255bd3b3bfd4395478fdb5fe5db6b39dbafc987f408e | Python | 21,746 | 483 | """
Created on Tue Jun 28 12:11:26 2022
@author: swainkasish@gmail.com
"""
#%% import libraries
import numpy as np
import pandas as pd
import time
from sklearn.preprocessing import StandardScaler,Normalizer,MinMaxScaler
from sklearn.decomposition import PCA,TruncatedSVD
from sklearn.neighbors import KNeighborsRegre... |
d76b20169dd6b432a15c80bb4f1dbabd4480fa9a640e3c77e5ed0600cb2d1aba | Python | 21,754 | 591 | ####################################################################################
#
# 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... |
91a71f5eb8b5cd05c713638f2b25b72edd7f2d70749a7ae8bcf784d23132c33a | Python | 21,755 | 651 | import logging
import platform
import time
from pathlib import Path
import dask.array
import matplotlib
import numpy as np
import pandas as pd
import pytest
import dask.array as da
from astrocast import helper
from astrocast.analysis import Events, Video
from astrocast.helper import EventSim
from astrocast.preparatio... |
bfbd7daa30ea5f8227569dbb03004366310e7c33c8a6ac0a67577fdb12334c71 | Python | 21,811 | 363 | """Compute native-space curvature, thickness, and cortical parcellations."""
from __future__ import annotations
import argparse
from concurrent.futures import ThreadPoolExecutor
import json
import os
from pathlib import Path
import shlex
import shutil
import subprocess
import sys
import tempfile
from threading import ... |
62371ffa0df96d3e3fbd0207f0c80ebe5a97b9c91609c22d442ba7cf3bbee4ea | Python | 21,823 | 488 | # Imports
import sys
import os
import argparse
import inspect
from datetime import datetime
import numpy as np
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 odeint
except Impo... |
c06f2a6eefa7c518a13990550f75fa1efaa8796cf4522e32c033b47f576a2b1c | Python | 21,856 | 551 | import logging
from pathlib import Path
import pytest
from astrocast.denoising import Network, PyTorchNetwork, SubFrameDataset, SubFrameGenerator
from astrocast.helper import SampleInput
from astrocast.preparation import IO
class TestDenosingTensorflow:
data = None
si_objects = None
@classmethod
... |
a4294ff9233d42ebcefa8b9d910c8b69e8f724596bfdf3cb6cb9296b9edde62e | Python | 21,862 | 768 | '''
enrichment.py - Tasks for computing genomic enrichment
==============================================================
Reference
---------
'''
import re
import os
import tempfile
import collections
import shutil
import cgatcore.experiment as E
from cgatcore import pipeline as P
import sqlite3
def outputSegments(... |
b7e7f6695b738e322e1055e4c2e7bce0dd236f54fb32af130ad3c800bb5184e9 | Python | 21,884 | 525 | """Classes and methods for applying locality-sensitive hashing.
This code is modified from CATCH (https://github.com/broadinstitute/catch/blob/master/catch/utils/lsh.py),
which is released under the following license:
MIT License
Copyright (c) 2018 Hayden Metsky, Broad Institute, Inc., and Massachusetts
Institute of ... |
e873b51eff72c954fb4d168ba898777b9a08aa97ef65105cd617b56e7a108c6d | Python | 21,905 | 571 | # This file uses sklearn library to setup ML model comparison experiment with cross validation
# It will write out files to an 'out' directory that it will try to create
import time
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import PolynomialFeatures, F... |
a550a5d094bf68313edb4901ffe6df499dbcf62727275f292addcc5cbea5202d | Python | 21,920 | 443 | # 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... |
cc30cbba362cc40fc4fbaefbcdc6ee5bb1baa68151fc8f55c4cd8a8c1f619e0f | Python | 21,923 | 460 | ################################################################################
# #
# # # # ##### ##### # ##### ##### ##### ##### # ##### #
# ## ## # # # # # # # # # # # # ... |
a0cb7419479fecdec7969a88459d762937cd715291c7b1c22efcafcbcf218fd5 | Python | 21,924 | 504 | """Load and use a model to predict activity of a guide-target pair.
"""
import os
# Disable some (but apparently not all) INFO and WARNING messages
# from TensorFlow; must come before the TensorFlow import
os.environ['TF_CPP_MIN_LOG_LEVEL'] = "2"
import numpy as np
import tensorflow as tf
# Again, suppress TensorFl... |
f8f9bcb43c1b7eeea3ef3f909438fad6f31362ae01c1fc86cf954657577ca8c9 | Python | 21,941 | 596 | # More ordering studies
import heapq
import pickle
import sys
from collections import deque
from multiprocessing import Pool
import scipy
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import breadth_first_order, depth_first_order, reverse_cuthill_mckee
from sklearn.utils import shuffle
import torch
impo... |
64f1e693ba7fd57df577c2210ec3895971d67b050ef2c7f7e31bc82230f2e9ee | Python | 21,946 | 436 | import copy
import torch
import os
from tqdm import tqdm
import numpy as np
from CEL.utils.register import register
import torch.nn as nn
import optax
import equinox as eqx
import jax
from CEL.data.data_manager import MyDataLoader
from CEL.networks.models.meta_model import ModelClass
import pathlib
from munch import M... |
71bc92cdb6362586da9ea17794ae8b1637bfabce3eacf97243909035b8a331c0 | Python | 21,970 | 672 | """Fork of Openfold's IPA."""
import numpy as np
import torch
import math
from scipy.stats import truncnorm
import torch.nn as nn
from typing import Optional, Callable, List, Sequence
from openfold.utils.rigid_utils import Rigid
from data import all_atom
def permute_final_dims(tensor: torch.Tensor, inds: List[int]):... |
9258d2db0614224ba29478f2fb4db1647f08f752f5e5728fc355856a575d9db4 | Python | 21,976 | 684 | """
2023.08.30
author: femke.hurtak@epfl.ch
Script to compute the clustering of the graph multiple times.
"""
import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
import multiprocessing as mp
from tqdm import tqdm
import pandas as pd
from loaddata import (
load_graph_an... |
5389959c8f1a668e8a249508a9349a7619630e334e33a3db3dea75556d4c0ad5 | Python | 21,991 | 463 | """
Fit model with the best parameter
"""
import argparse
import time
import random
import pickle
import pathlib
import numpy as np
import pandas as pd
import sklearn.feature_extraction as skfet
import sklearn.preprocessing as skpre
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from... |
84cd442cf20c95b7cfd7bde6a1861c2ecb0b71a6cee6ee5309b695d9eb72e434 | Python | 21,998 | 444 | # 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... |
2e1ea124fd0fc5dd6fb0dfb8449c9b25010b91d2b837c106aed2be214183356f | Python | 22,002 | 445 | # 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... |
69ea11c394520774b021ef36cc40449ce2c400d137c61af5ec5d2740c0349258 | Python | 22,016 | 573 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 4 11:41:08 2023
@author: Shencong Ni
"""
import mydata
import numpy as np
#import brian2.numpy_ as np
#from brian2.only import *
#import post_analysis as psa
import firing_rate_analysis as fra
#import frequency_analysis as fqa
import get_onoff_cp... |
aea4a965132e6267fe1aaec04c0601b7e61f038bd512d9c8074f9e0115a0c45f | Python | 22,026 | 477 | import torch.utils.checkpoint as checkpoint
from rfdiffusion.util_module import *
from rfdiffusion.Attention_module import *
from rfdiffusion.SE3_network import SE3TransformerWrapper
# Components for three-track blocks
# 1. MSA -> MSA update (biased attention. bias from pair & structure)
# 2. Pair -> Pair update (bias... |
9abc4687dbea3b2963b7d4fdcd144253eeb68a7afde902bc277e7e8b4af5c9cd | Python | 22,039 | 554 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import xml.dom.minidom as dom
import xml.dom
import os
import socket
import re
import sys
import datetime
import codecs
from SPARQLWrapper import SPARQLWrapper, JSON
endpoint = "http://vtentacle.techfak.uni-bielefeld.de:443/sparql/"
sparql = SPARQLWrapper(endpoint)
# Doku... |
edbd54bfc106aff599f4ba9905df275295dcc3beb9dd7faf1eebb0b1215e872e | Python | 22,058 | 591 | # 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... |
003d420577d122121d4c0c413c9012f394953c23e173edcefd26518be2b01536 | Python | 22,062 | 622 | """Functions for performing an alignment of sequences, with curation.
"""
from collections import OrderedDict
import hashlib
import logging
import os
import random
import re
import subprocess
import tempfile
try:
import boto3
from botocore.exceptions import ClientError
except:
cloud = False
else:
clou... |
ed61c5a6b66de4ea4bd9282e2494e958346f0476a89f4488301634c98b429852 | Python | 22,062 | 445 | # 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... |
38c0057d9d389c47b9da88cd6abddc29ce675d8f35f787fd261584555803054b | Python | 22,120 | 450 | # 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... |
c0895c6bee828fa3522a704cb9abd3ee7950b8bb590889c06624caee673df048 | Python | 22,128 | 809 | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
"""
Code adjusted from Uncertainpy: a Python toolbox for uncertainty quantification and sensitivity analysis, tailored towards computational neuroscience.
https://github.com/simetenn/uncertainpy.git
"""
axis_grey = (0.6, 0.6, 0.6)
ticks_color ... |
a3def55a4d5b70a9acc7bf821b4a4c9d2d741b099fe0de13fbf3df13e1f2530b | Python | 22,161 | 455 | #Importing the saliency module. If not installed use the above pip command to install it in your environment
import PIL.Image
from matplotlib import pylab as P
from matplotlib import pylab as plt
import saliency.core as saliency
from pathlib import Path
from data import DataLoad
import tensorflow as tf
from utils impor... |
54933e5d03c937e42dd000853191e6b2dc632bda0fcaddb45c6cb2b1cd7d5abf | Python | 22,172 | 498 | from typing import Optional, Tuple
import torch
from torch import Tensor, nn
from torch_geometric.data import Data
from torch_geometric.nn import MessagePassing
from torch_scatter import scatter
from .utils import (
NeighborEmbedding,
EdgeEmbedding,
CosineCutoff,
Distance,
Sphere,
VecLayerNorm,
... |
4f34051757588432376fae7bb6e41f07e5b2355ab5851a9630171c8acae3e386 | Python | 22,181 | 468 | """
Fit model with the best parameter
"""
import argparse
import time
import pickle
import pathlib
import numpy as np
import pandas as pd
import sklearn.feature_extraction as skfet
import sklearn.preprocessing as skpre
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.nn impo... |
2142dd27090b9e70891ba0a8381c2a840007a12b243b4efa3c24abdb4fd84c5b | Python | 22,183 | 422 | # -*- coding: utf-8 -*-
# @title Emulate SNN behavior
# @file SnnEmulator.py
# @author Romain Beaubois
# @date 23 Oct 2023
# @copyright
# SPDX-FileCopyrightText: © 2023 Romain Beaubois <refbeaubois@yahoo.com>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# @brief
#
# @details
# > **23 Oct 2023** :... |
a8e54a6e7866661cdde60b7e16d96bb47c0f28839332d813f41154edd188614b | Python | 22,189 | 615 | """ This class contains methods to read and write data.
:Implemented:
- Save/Load arbitrary objects.
- Save/Load images.
- Load MNIST.
- Load CIFAR.
- Load Caltech.
- Load olivietti face dataset
- Load nactural image patches
- Load UCI binary dataset
... |
c48dd6a63dfdac256321b28c9f82f91927974ef742a30c5e61636341b7244d3b | Python | 22,216 | 576 | import tensorflow as tf
import numpy as np
from utils.ProcessData import get_maxDims, gen_smiles2graph
from sklearn.utils import gen_batches
import matplotlib.pyplot as plt
import pandas as pd
def perform_validation(model,validation,val_metric,batchsize,nfeat):
"""
Test the model on a validation set.
INPU... |
3479d4044344c8bc10901a29f56117c98ee6a26d367157cd93609eabe35c14db | Python | 22,225 | 447 | # 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... |
16414deb89ed3a61048cecb6ba78e03c843219e948713ba56c8ffff5c6c4a4a8 | Python | 22,237 | 556 | import os
import pickle
import sys
import multiprocessing as mp
import mdtraj as md
import numpy as np
from . import exmax, nnutils, utils, data_processing
import copy
import pickle
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils import data as torch_... |
16970560694f02c3b9039ad06204d47d690d11408562fdf589ba3bf4f6081c75 | Python | 22,254 | 447 | # 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... |
49388616697a679ea3cb9050c487607766dd9155113197817ebe5d5f71e47cc9 | Python | 22,257 | 512 | from __future__ import print_function
import json, time, os, sys, glob
import shutil
import numpy as np
import torch
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.data.dataset import random_split, Subset
import torch.utils
import torch.utils.checkpoint
import copy
import torch.nn as ... |
941209d31c2c81efc0400381e47bedf571ed1f3becde652e64d5e2a6de065517 | Python | 22,280 | 612 | # 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... |
08a922e429c9d081d45820dec51496fc33c077bf70996675a9e57f9b38494bc2 | Python | 22,281 | 554 | """
This module implements tracker classes that can be used to keep track
of statistics that are generated throughout training.
"""
from __future__ import annotations
import copy
import logging
import time
from collections import abc, defaultdict
from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Unio... |
dc392aea59e980890fff1279356d9eebf6afb3fbbb6afbd1c9f406107b3ee0fe | Python | 22,312 | 415 | # Copyright (c) DP Technology.
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import torch
from typing import Callable, List, Optional
# this import is for backward compa... |
303cbf524fc0a2f39b2376be254e37b2a22da7cd039ff4ea1f631091314e2657 | Python | 22,385 | 446 | import numpy as np
import matplotlib.pyplot as plt
from NetworkModel.NetworkPatternRecognition import patternRecognition, patternRecognitionDual, patternRecognitionExample
from lmfit import Minimizer, Parameters
from Simulator.Pattern import patternClass, pattern_Succession, \
pattern_... |
771a1931b42cf7377659851a635a4542833e8badf3778a4d8a51d80c53205623 | Python | 22,386 | 566 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("/home/cunger/local/lib/python2.7/site-packages/SPARQLWrapper-1.5.2-py2.7.egg")
import xml.dom.minidom as dom
import xml.dom
import os
import socket
import re
import datetime
import codecs
from SPARQLWrapper import SPARQLWrapper, JSON
en_sparq... |
7118b2b5cdea05067b144a310547a41314a5d6ed561a07cde1d052482fceb8e3 | Python | 22,390 | 566 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("/homes/cunger/.local/lib64/python2.7/site-packages/SPARQLWrapper-1.5.2-py2.7.egg")
import xml.dom.minidom as dom
import xml.dom
import os
import socket
import re
import datetime
import codecs
from SPARQLWrapper import SPARQLWrapper, JSON
en_s... |
e8413f72d6479cc66acf1dbb7008ae17d2ed4f1d1731e7c52e5b466952d4ce4d | Python | 22,390 | 366 | """Geometry checks for native-space FreeSurfer postprocessing."""
from pathlib import Path
import json
import os
import shutil
import tempfile
from threading import Lock
import time
import unittest
from unittest.mock import patch
import nibabel as nib
import numpy as np
import SimpleITK as sitk
import trimesh
import ... |
669a42dc880f9a9e4c477270e0363c7b196179fc55021c57e501daddb9375728 | Python | 22,395 | 446 | ''' Test module for FNN model methods.
:Version:
1.0
:Date:
08.02.2016
:Author:
Jan Melchior
:Contact:
JanMelchior@gmx.de
:License:
Copyright (C) 2016 Jan Melchior
This program is free software: you can redistribute it and/or modify
... |
070978fa5f3bbeaca1f41c71a7eb472dd40fa90dc146810c2e2dd7a3dc4f1565 | Python | 22,442 | 448 | # 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... |
ac764d79ccac9088d147c2f807943e5d081ea156452351d48dfa31fc4c4879b3 | Python | 22,449 | 661 | """Base classes for indexing."""
from __future__ import annotations
import abc
import time
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any, TypedDict
from typing_extensions import override
from langchain_core._api import beta
from langchain_core.retrievers import BaseRetriever
from langcha... |
d9c76fef4bd519f252fb4e68c6837cc2ae0995009d4be5a4f14585ba191441cc | Python | 22,473 | 723 | '''preprocess.py - Tasks for processing short read data sets
====================================================================
Processing reads is a common task before mapping. Different sequencing
technologies and applications require different read processing. This
module provides utility functions to abstract s... |
8f9df20fe2a4ebbd4b19a25b53fc0edb1fa91063ec23e2cf5140e94a97258dba | Python | 22,490 | 649 | """Test Tracer classes."""
from __future__ import annotations
from datetime import datetime, timezone
from typing import Any
from uuid import uuid4
import pytest
from freezegun import freeze_time
from langchain_core.callbacks import AsyncCallbackManager
from langchain_core.exceptions import TracerException
from lan... |
89537f4ebbd3f1d60eb1907c45d5a9a42d8a56c13ecbd5036f5b44cf510656cf | Python | 22,493 | 588 | """
##############################################################################
#
# Parser for the snakemake config template.
# Generates the real config.yml file for the MAPP pipeline.
#
# AUTHOR: Maciej_Bak
# AFFILIATION: University_of_Basel
# AFFILIATION: Swiss_Institute_of_Bioinformatics
# CONTACT: w... |
409c45bb9fc3995112a2b85d33e462239f456ee38dcad1c35a2af8ec54a97f37 | Python | 22,502 | 254 | from sentence_tokenization import SentenceBoundaryDetection
def test():
sent_tokenizer = SentenceBoundaryDetection()
sent_tokenizer.set_deid_pattern("\[\*\*|\*\*\]")
text = '''
Test:
1. Lymphoplasmacytoid lymphoma involving bone marrow and spleen diagnosed
initially in [** Dat... |
09f96ac7b4923f417c20796a0dd478b35f67be9d1724ba36c321661228b70191 | Python | 22,513 | 607 | # 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... |
2eee6c2ba7263d8c7765b9223c1c336e45df9e5dcbb254959ee0cb4fad737d23 | Python | 22,519 | 472 | ## Feature extraction
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.fft import fft, fftfreq, fftshift
from scipy.signal import blackman
from scipy.stats import kurtosis,skew
import statsmodels.api as sm
import seaborn
from scipy.signal import find_peaks
import functions_paths as fpt... |
fc92accae4bad1d012a7edccfc9ef1510e3b60e9dc4be3c99ec30a3b466bbb53 | Python | 22,553 | 489 | import itertools
import numpy as np
import numpy.testing as np_test
import pytest
from skbase.utils.dependencies import _check_soft_dependencies
from pgmpy import config
from pgmpy.example_models import load_model
from pgmpy.factors import factor_product
from pgmpy.factors.discrete import DiscreteFactor, TabularCPD
f... |
33d9289990c16468ec92a83f62e7c6cb783d4aabc0c8788b560ee7294fdfbbf0 | Python | 22,560 | 547 | """
Module to analyse stimulations. e.g., getting stimulation starts, aligning variables around stimulation, ...
Author: jonas.braun@epfl.ch
"""
import os
import sys
import numpy as np
import pandas as pd
from twoppp import utils
from twoppp.behaviour import stimulation as twoppp_stimulation
sys.path.append(os.path.d... |
94e8db5953d054587d61b8c9e7f0a7042c0f7e615d0f6227e5d925c0d2b2aa61 | Python | 22,577 | 634 | """Deprecated as of LangChain v0.3.4 and will be removed in LangChain v1.0.0."""
import logging
from abc import ABC, abstractmethod
from collections.abc import Iterable
from itertools import islice
from typing import TYPE_CHECKING, Any
from langchain_core._api import deprecated
from langchain_core.language_models imp... |
304ae7748a0b47a052551182a638f2bf9e40840eaa5f9042011a3b349c6cf06b | Python | 22,606 | 712 | """Configuration utilities for `Runnable` objects."""
from __future__ import annotations
import asyncio
# Cannot move uuid to TYPE_CHECKING as RunnableConfig is used in Pydantic models
import uuid # noqa: TC003
import warnings
from collections.abc import (
Awaitable,
Callable,
Generator,
Iterable,
... |
527afa0b9be71827273c2942bce7b7633df72d41fdcebec8e3b859de43254916 | Python | 22,612 | 623 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.